commentbox.io
Version:
The CommentBox.io embedded plugin library
1 lines • 33.2 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.commentBox=e():t.commentBox=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,e,r){"use strict";var o=r(6),n=r(16),i=r(3);t.exports={formats:i,parse:n,stringify:o}},function(t,e,r){"use strict";var o=SyntaxError,n=Function,i=TypeError,a=function(t){try{return n('"use strict"; return ('+t+").constructor;")()}catch(t){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(t){c=null}var l=function(){throw new i},u=c?function(){try{return l}catch(t){try{return c(arguments,"callee").get}catch(t){return l}}}():l,p=r(8)(),f=Object.getPrototypeOf||function(t){return t.__proto__},s={},y="undefined"==typeof Uint8Array?void 0:f(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":p?f([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":s,"%AsyncGenerator%":s,"%AsyncGeneratorFunction%":s,"%AsyncIteratorPrototype%":s,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":n,"%GeneratorFunction%":s,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?f(f([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?f((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?f((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?f(""[Symbol.iterator]()):void 0,"%Symbol%":p?Symbol:void 0,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":y,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=r(2),m=r(11),h=g.call(Function.call,Array.prototype.concat),v=g.call(Function.apply,Array.prototype.splice),S=g.call(Function.call,String.prototype.replace),O=g.call(Function.call,String.prototype.slice),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,w=function(t){var e=O(t,0,1),r=O(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return S(t,j,(function(t,e,r,o){n[n.length]=r?S(o,A,"$1"):e||t})),n},P=function(t,e){var r,n=t;if(m(b,n)&&(n="%"+(r=b[n])[0]+"%"),m(d,n)){var c=d[n];if(c===s&&(c=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&(r=f(n.prototype))}return d[e]=r,r}(n)),void 0===c&&!e)throw new i("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:c}}throw new o("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new i('"allowMissing" argument must be a boolean');var r=w(t),n=r.length>0?r[0]:"",a=P("%"+n+"%",e),l=a.name,u=a.value,p=!1,f=a.alias;f&&(n=f[0],v(r,h([0,1],f)));for(var s=1,y=!0;s<r.length;s+=1){var b=r[s],g=O(b,0,1),S=O(b,-1);if(('"'===g||"'"===g||"`"===g||'"'===S||"'"===S||"`"===S)&&g!==S)throw new o("property names with quotes must have matching quotes");if("constructor"!==b&&y||(p=!0),m(d,l="%"+(n+="."+b)+"%"))u=d[l];else if(null!=u){if(!(b in u)){if(!e)throw new i("base intrinsic for "+t+" exists, but the property is not available.");return}if(c&&s+1>=r.length){var j=c(u,b);u=(y=!!j)&&"get"in j&&!("originalValue"in j.get)?j.get:u[b]}else y=m(u,b),u=u[b];y&&!p&&(d[l]=u)}}return u}},function(t,e,r){"use strict";var o=r(10);t.exports=Function.prototype.bind||o},function(t,e,r){"use strict";var o=String.prototype.replace,n=/%20/g,i="RFC1738",a="RFC3986";t.exports={default:a,formatters:{RFC1738:function(t){return o.call(t,n,"+")},RFC3986:function(t){return String(t)}},RFC1738:i,RFC3986:a}},function(t,e,r){"use strict";var o=r(3),n=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),c=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},o=0;o<t.length;++o)void 0!==t[o]&&(r[o]=t[o]);return r};t.exports={arrayToObject:c,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],o=0;o<e.length;++o)for(var n=e[o],a=n.obj[n.prop],c=Object.keys(a),l=0;l<c.length;++l){var u=c[l],p=a[u];"object"==typeof p&&null!==p&&-1===r.indexOf(p)&&(e.push({obj:a,prop:u}),r.push(p))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(i(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);e.obj[e.prop]=o}}}(e),t},decode:function(t,e,r){var o=t.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(t){return o}},encode:function(t,e,r,n,i){if(0===t.length)return t;var c=t;if("symbol"==typeof t?c=Symbol.prototype.toString.call(t):"string"!=typeof t&&(c=String(t)),"iso-8859-1"===r)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var l="",u=0;u<c.length;++u){var p=c.charCodeAt(u);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||i===o.RFC1738&&(40===p||41===p)?l+=c.charAt(u):p<128?l+=a[p]:p<2048?l+=a[192|p>>6]+a[128|63&p]:p<55296||p>=57344?l+=a[224|p>>12]+a[128|p>>6&63]+a[128|63&p]:(u+=1,p=65536+((1023&p)<<10|1023&c.charCodeAt(u)),l+=a[240|p>>18]+a[128|p>>12&63]+a[128|p>>6&63]+a[128|63&p])}return l},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(i(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(e(t[o]));return r}return e(t)},merge:function t(e,r,o){if(!r)return e;if("object"!=typeof r){if(i(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(o&&(o.plainObjects||o.allowPrototypes)||!n.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var a=e;return i(e)&&!i(r)&&(a=c(e,o)),i(e)&&i(r)?(r.forEach((function(r,i){if(n.call(e,i)){var a=e[i];a&&"object"==typeof a&&r&&"object"==typeof r?e[i]=t(a,r,o):e.push(r)}else e[i]=r})),e):Object.keys(r).reduce((function(e,i){var a=r[i];return n.call(e,i)?e[i]=t(e[i],a,o):e[i]=a,e}),a)}}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return a}));var o=r(0);const n={className:"commentbox",defaultBoxId:"commentbox",tlcParam:"tlc",sortOrder:"best",backgroundColor:null,textColor:null,subtextColor:null,singleSignOn:null,createBoxUrl:(t,e)=>(e.search="",e.hash=t,e.href),onCommentCount(t){},testMode:!1},i={buttonText:"Single Sign-On",buttonIcon:"",buttonColor:"",autoSignOn:!1,onSignOn(t,e){},onSignOut(){}};function a(t,e=n){if(!t)throw new Error("Please supply a valid projectId.");const{className:r,defaultBoxId:a,tlcParam:c,sortOrder:l,backgroundColor:u,textColor:p,subtextColor:f,createBoxUrl:s,onCommentCount:y,testMode:d}=Object.keys(n).reduce((t,r)=>(t[r]=e&&e[r]?e[r]:n[r],t),{});let b=e.singleSignOn||null;b&&(b=Object.keys(i).reduce((t,e)=>(t[e]=b[e]||i[e],t),{}));const g=document.createElement("a");g.href=window.location.href;const m=document.getElementsByClassName(r),h=m.length,v={},S=d?"localhost:8000":"app.commentbox.io",O=d?"http:":"https:",j=`${O}//${S}`;for(let e=0;e<h;e++){const r=m[e];if(r.getAttribute("data-loaded"))continue;const n=r.id||a,i=Object(o.parse)(g.search.replace("?",""))[c],y=document.createElement("a");if(v[n])throw new Error("Each box must have a unique ID");v[n]=!0,r.id=n,y.href=s(n,g);const d=Object(o.parse)(y.search.replace("?","")),h=Object.keys(d).reduce((t,e)=>(e.toLowerCase()!==c.toLowerCase()&&(t[e]=d[e]),t),{});y.search=Object.keys(h).length>0?"?"+Object(o.stringify)(h):"";const S=document.createElement("iframe"),O=document.createElement("a"),A={id:n,url:y.href,tlc_param:c,tlc:i,background_color:u,text_color:p,subtext_color:f,sort_order:l},w=()=>{O.href=j,O.pathname=t,O.search=Object(o.stringify)(A),S.setAttribute("src",O.href),S.setAttribute("frameborder","0"),S.setAttribute("scrolling","no"),S.setAttribute("style","width: 100%"),r.appendChild(S),r.setAttribute("data-loaded","true")};if(b)if(Object.assign(A,{sso:"1",sso_text:b.buttonText,sso_icon:b.buttonIcon,sso_color:b.buttonColor}),b.autoSignOn){let t=!1;b.onSignOn(e=>{if(t)throw new Error("Callback already called.");t=!0,e&&(A.sso_user_payload=e),w()},e=>{if(t)throw new Error("Callback already called.");t=!0,w()})}else w();else w()}const A=function(t){const e=document.createElement("a");if(e.href=t.origin,t.data&&e.hostname===S||e.protocol===O)try{const e=JSON.parse(t.data),{event:r,id:o,payload:n}=e,i=document.getElementById(o).firstChild;if(!v[o])return;switch(r){case"count":i.setAttribute("data-comments-loaded","true"),y(n);break;case"resize":i.height=n+"px";break;case"tlc":i.setAttribute("data-tlc",n);break;case"sso-user-payload":if(b){let e=!1;b.onSignOn(r=>{if(e)throw new Error("Callback already called.");e=!0;const o=JSON.stringify(r?{event:"sso-user-payload",payload:r}:{event:"sso-user-payload-error",payload:"Could not sign in."});t.source.postMessage(o,t.origin)},r=>{if(e)throw new Error("Callback already called.");e=!0;const o=JSON.stringify({event:"sso-user-payload-error",payload:r.message});t.source.postMessage(o,t.origin)})}break;case"sso-logout":b&&b.onSignOut()}if(i.getAttribute("data-comments-loaded")&&i.getAttribute("data-tlc")&&!i.getAttribute("data-tlc-scrolled")){const t=i.getBoundingClientRect();window.scrollTo(0,window.scrollY+t.top+parseInt(i.getAttribute("data-tlc"))),i.setAttribute("data-tlc-scrolled","true")}}catch(t){}};return window.addEventListener("message",A),function(){window.removeEventListener("message",A)}}},function(t,e,r){"use strict";var o=r(7),n=r(4),i=r(3),a=Object.prototype.hasOwnProperty,c={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},l=Array.isArray,u=Array.prototype.push,p=function(t,e){u.apply(t,l(e)?e:[e])},f=Date.prototype.toISOString,s=i.default,y={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:s,formatter:i.formatters[s],indices:!1,serializeDate:function(t){return f.call(t)},skipNulls:!1,strictNullHandling:!1},d=function t(e,r,i,a,c,u,f,s,d,b,g,m,h,v,S){var O,j=e;if(S.has(e))throw new RangeError("Cyclic object value");if("function"==typeof f?j=f(r,j):j instanceof Date?j=b(j):"comma"===i&&l(j)&&(j=n.maybeMap(j,(function(t){return t instanceof Date?b(t):t}))),null===j){if(a)return u&&!h?u(r,y.encoder,v,"key",g):r;j=""}if("string"==typeof(O=j)||"number"==typeof O||"boolean"==typeof O||"symbol"==typeof O||"bigint"==typeof O||n.isBuffer(j))return u?[m(h?r:u(r,y.encoder,v,"key",g))+"="+m(u(j,y.encoder,v,"value",g))]:[m(r)+"="+m(String(j))];var A,w=[];if(void 0===j)return w;if("comma"===i&&l(j))A=[{value:j.length>0?j.join(",")||null:void 0}];else if(l(f))A=f;else{var P=Object.keys(j);A=s?P.sort(s):P}for(var x=0;x<A.length;++x){var E=A[x],k="object"==typeof E&&void 0!==E.value?E.value:j[E];if(!c||null!==k){var I=l(j)?"function"==typeof i?i(r,E):r:r+(d?"."+E:"["+E+"]");S.set(e,!0);var N=o();p(w,t(k,I,i,a,c,u,f,s,d,b,g,m,h,v,N))}}return w};t.exports=function(t,e){var r,n=t,u=function(t){if(!t)return y;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||y.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==t.format){if(!a.call(i.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=i.formatters[r],n=y.filter;return("function"==typeof t.filter||l(t.filter))&&(n=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:y.addQueryPrefix,allowDots:void 0===t.allowDots?y.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:y.charsetSentinel,delimiter:void 0===t.delimiter?y.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:y.encode,encoder:"function"==typeof t.encoder?t.encoder:y.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:y.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:y.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:y.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:y.strictNullHandling}}(e);"function"==typeof u.filter?n=(0,u.filter)("",n):l(u.filter)&&(r=u.filter);var f,s=[];if("object"!=typeof n||null===n)return"";f=e&&e.arrayFormat in c?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var b=c[f];r||(r=Object.keys(n)),u.sort&&r.sort(u.sort);for(var g=o(),m=0;m<r.length;++m){var h=r[m];u.skipNulls&&null===n[h]||p(s,d(n[h],h,b,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset,g))}var v=s.join(u.delimiter),S=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),v.length>0?S+v:""}},function(t,e,r){"use strict";var o=r(1),n=r(12),i=r(14),a=o("%TypeError%"),c=o("%WeakMap%",!0),l=o("%Map%",!0),u=n("WeakMap.prototype.get",!0),p=n("WeakMap.prototype.set",!0),f=n("WeakMap.prototype.has",!0),s=n("Map.prototype.get",!0),y=n("Map.prototype.set",!0),d=n("Map.prototype.has",!0),b=function(t,e){for(var r,o=t;null!==(r=o.next);o=r)if(r.key===e)return o.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,o={assert:function(t){if(!o.has(t))throw new a("Side channel does not contain "+i(t))},get:function(o){if(c&&o&&("object"==typeof o||"function"==typeof o)){if(t)return u(t,o)}else if(l){if(e)return s(e,o)}else if(r)return function(t,e){var r=b(t,e);return r&&r.value}(r,o)},has:function(o){if(c&&o&&("object"==typeof o||"function"==typeof o)){if(t)return f(t,o)}else if(l){if(e)return d(e,o)}else if(r)return function(t,e){return!!b(t,e)}(r,o);return!1},set:function(o,n){c&&o&&("object"==typeof o||"function"==typeof o)?(t||(t=new c),p(t,o,n)):l?(e||(e=new l),y(e,o,n)):(r||(r={key:{},next:null}),function(t,e,r){var o=b(t,e);o?o.value=r:t.next={key:e,next:t.next,value:r}}(r,o,n))}};return o}},function(t,e,r){"use strict";var o="undefined"!=typeof Symbol&&Symbol,n=r(9);t.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"==typeof o("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},function(t,e,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},function(t,e,r){"use strict";var o="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,i=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==i.call(e))throw new TypeError(o+e);for(var r,a=n.call(arguments,1),c=function(){if(this instanceof r){var o=e.apply(this,a.concat(n.call(arguments)));return Object(o)===o?o:this}return e.apply(t,a.concat(n.call(arguments)))},l=Math.max(0,e.length-a.length),u=[],p=0;p<l;p++)u.push("$"+p);if(r=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var f=function(){};f.prototype=e.prototype,r.prototype=new f,f.prototype=null}return r}},function(t,e,r){"use strict";var o=r(2);t.exports=o.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,r){"use strict";var o=r(1),n=r(13),i=n(o("String.prototype.indexOf"));t.exports=function(t,e){var r=o(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?n(r):r}},function(t,e,r){"use strict";var o=r(2),n=r(1),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||o.call(a,i),l=n("%Object.getOwnPropertyDescriptor%",!0),u=n("%Object.defineProperty%",!0),p=n("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=c(o,a,arguments);if(l&&u){var r=l(e,"length");r.configurable&&u(e,"length",{value:1+p(0,t.length-(arguments.length-1))})}return e};var f=function(){return c(o,i,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},function(t,e,r){var o="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=o&&n&&"function"==typeof n.get?n.get:null,a=o&&Map.prototype.forEach,c="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=c&&l&&"function"==typeof l.get?l.get:null,p=c&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,s="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y=Boolean.prototype.valueOf,d=Object.prototype.toString,b=Function.prototype.toString,g=String.prototype.match,m="function"==typeof BigInt?BigInt.prototype.valueOf:null,h=Object.getOwnPropertySymbols,v="function"==typeof Symbol?Symbol.prototype.toString:null,S=Object.prototype.propertyIsEnumerable,O=r(15).custom,j=O&&x(O)?O:null;function A(t,e,r){var o="double"===(r.quoteStyle||e)?'"':"'";return o+t+o}function w(t){return String(t).replace(/"/g,""")}function P(t){return"[object Array]"===I(t)}function x(t){return"[object Symbol]"===I(t)}t.exports=function t(e,r,o,n){var c=r||{};if(k(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(k(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!k(c,"customInspect")||c.customInspect;if("boolean"!=typeof l)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(k(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return function t(e,r){if(e.length>r.maxStringLength){var o=e.length-r.maxStringLength,n="... "+o+" more character"+(o>1?"s":"");return t(e.slice(0,r.maxStringLength),r)+n}return A(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,F),"single",r)}(e,c);if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);if("bigint"==typeof e)return String(e)+"n";var d=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=d&&d>0&&"object"==typeof e)return P(e)?"[Array]":"[Object]";var h=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=Array(t.indent+1).join(" ")}return{base:r,prev:Array(e+1).join(r)}}(c,o);if(void 0===n)n=[];else if(N(n,e)>=0)return"[Circular]";function S(e,r,i){if(r&&(n=n.slice()).push(r),i){var a={depth:c.depth};return k(c,"quoteStyle")&&(a.quoteStyle=c.quoteStyle),t(e,a,o+1,n)}return t(e,c,o+1,n)}if("function"==typeof e){var O=function(t){if(t.name)return t.name;var e=g.call(b.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),E=U(e,S);return"[Function"+(O?": "+O:" (anonymous)")+"]"+(E.length>0?" { "+E.join(", ")+" }":"")}if(x(e)){var B=v.call(e);return"object"==typeof e?C(B):B}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var L="<"+String(e.nodeName).toLowerCase(),T=e.attributes||[],_=0;_<T.length;_++)L+=" "+T[_].name+"="+A(w(T[_].value),"double",c);return L+=">",e.childNodes&&e.childNodes.length&&(L+="..."),L+="</"+String(e.nodeName).toLowerCase()+">"}if(P(e)){if(0===e.length)return"[]";var W=U(e,S);return h&&!function(t){for(var e=0;e<t.length;e++)if(N(t[e],"\n")>=0)return!1;return!0}(W)?"["+D(W,h)+"]":"[ "+W.join(", ")+" ]"}if(function(t){return"[object Error]"===I(t)}(e)){var G=U(e,S);return 0===G.length?"["+String(e)+"]":"{ ["+String(e)+"] "+G.join(", ")+" }"}if("object"==typeof e&&l){if(j&&"function"==typeof e[j])return e[j]();if("function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var H=[];return a.call(e,(function(t,r){H.push(S(r,e,!0)+" => "+S(t,e))})),R("Map",i.call(e),H,h)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var q=[];return p.call(e,(function(t){q.push(S(t,e))})),R("Set",u.call(e),q,h)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{s.call(t,s)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return M("WeakMap");if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t,s);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return M("WeakSet");if(function(t){return"[object Number]"===I(t)}(e))return C(S(Number(e)));if(function(t){return"[object BigInt]"===I(t)}(e))return C(S(m.call(e)));if(function(t){return"[object Boolean]"===I(t)}(e))return C(y.call(e));if(function(t){return"[object String]"===I(t)}(e))return C(S(String(e)));if(!function(t){return"[object Date]"===I(t)}(e)&&!function(t){return"[object RegExp]"===I(t)}(e)){var z=U(e,S);return 0===z.length?"{}":h?"{"+D(z,h)+"}":"{ "+z.join(", ")+" }"}return String(e)};var E=Object.prototype.hasOwnProperty||function(t){return t in this};function k(t,e){return E.call(t,e)}function I(t){return d.call(t)}function N(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,o=t.length;r<o;r++)if(t[r]===e)return r;return-1}function F(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+e.toString(16).toUpperCase()}function C(t){return"Object("+t+")"}function M(t){return t+" { ? }"}function R(t,e,r,o){return t+" ("+e+") {"+(o?D(r,o):r.join(", "))+"}"}function D(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+t.join(","+r)+"\n"+e.prev}function U(t,e){var r=P(t),o=[];if(r){o.length=t.length;for(var n=0;n<t.length;n++)o[n]=k(t,n)?e(t[n],t):""}for(var i in t)k(t,i)&&(r&&String(Number(i))===i&&i<t.length||(/[^\w$]/.test(i)?o.push(e(i,t)+": "+e(t[i],t)):o.push(i+": "+e(t[i],t))));if("function"==typeof h)for(var a=h(t),c=0;c<a.length;c++)S.call(t,a[c])&&o.push("["+e(a[c])+"]: "+e(t[a[c]],t));return o}},function(t,e){},function(t,e,r){"use strict";var o=r(4),n=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:o.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},l=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},u=function(t,e,r,o){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(i),u=c?i.slice(0,c.index):i,p=[];if(u){if(!r.plainObjects&&n.call(Object.prototype,u)&&!r.allowPrototypes)return;p.push(u)}for(var f=0;r.depth>0&&null!==(c=a.exec(i))&&f<r.depth;){if(f+=1,!r.plainObjects&&n.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;p.push(c[1])}return c&&p.push("["+i.slice(c.index)+"]"),function(t,e,r,o){for(var n=o?e:l(e,r),i=t.length-1;i>=0;--i){var a,c=t[i];if("[]"===c&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var u="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,p=parseInt(u,10);r.parseArrays||""!==u?!isNaN(p)&&c!==u&&String(p)===u&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(a=[])[p]=n:a[u]=n:a={0:n}}n=a}return n}(p,e,r,o)}};t.exports=function(t,e){var r=function(t){if(!t)return a;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?a.charset:t.charset;return{allowDots:void 0===t.allowDots?a.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:a.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||o.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var p="string"==typeof t?function(t,e){var r,u={},p=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,f=e.parameterLimit===1/0?void 0:e.parameterLimit,s=p.split(e.delimiter,f),y=-1,d=e.charset;if(e.charsetSentinel)for(r=0;r<s.length;++r)0===s[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[r]?d="utf-8":"utf8=%26%2310003%3B"===s[r]&&(d="iso-8859-1"),y=r,r=s.length);for(r=0;r<s.length;++r)if(r!==y){var b,g,m=s[r],h=m.indexOf("]="),v=-1===h?m.indexOf("="):h+1;-1===v?(b=e.decoder(m,a.decoder,d,"key"),g=e.strictNullHandling?null:""):(b=e.decoder(m.slice(0,v),a.decoder,d,"key"),g=o.maybeMap(l(m.slice(v+1),e),(function(t){return e.decoder(t,a.decoder,d,"value")}))),g&&e.interpretNumericEntities&&"iso-8859-1"===d&&(g=c(g)),m.indexOf("[]=")>-1&&(g=i(g)?[g]:g),n.call(u,b)?u[b]=o.combine(u[b],g):u[b]=g}return u}(t,r):t,f=r.plainObjects?Object.create(null):{},s=Object.keys(p),y=0;y<s.length;++y){var d=s[y],b=u(d,p[d],r,"string"==typeof t);f=o.merge(f,b,r)}return!0===r.allowSparse?f:o.compact(f)}}]).default}));