diff --git a/dist/index.es.js b/dist/index.es.js index da25c0d7..f2e8cd39 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -1,2 +1 @@ -function t(){return(t=Object.assign||function(t){for(var r=1;r1;){var r=t.pop(),n=r.obj[r.prop];if(e(n)){for(var i=[],o=0;o=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122?o+=i.charAt(u):f<128?o+=n[f]:f<2048?o+=n[192|f>>6]+n[128|63&f]:f<55296||f>=57344?o+=n[224|f>>12]+n[128|f>>6&63]+n[128|63&f]:(f=65536+((1023&f)<<10|1023&i.charCodeAt(u+=1)),o+=n[240|f>>18]+n[128|f>>12&63]+n[128|f>>6&63]+n[128|63&f])}return o},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,r){if(e(t)){for(var n=[],i=0;i-1?t.split(","):t},E=function(t,r,e,n){if(t){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(i),f=u?i.slice(0,u.index):i,s=[];if(f){if(!e.plainObjects&&m.call(Object.prototype,f)&&!e.allowPrototypes)return;s.push(f)}for(var a=0;e.depth>0&&null!==(u=o.exec(i))&&a=0;--o){var u,f=t[o];if("[]"===f&&e.parseArrays)u=[].concat(i);else{u=e.plainObjects?Object.create(null):{};var s="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,a=parseInt(s,10);e.parseArrays||""!==s?!isNaN(a)&&f!==s&&String(a)===s&&a>=0&&e.parseArrays&&a<=e.arrayLimit?(u=[])[a]=i:u[s]=i:u={0:i}}i=u}return i}(s,r,e,n)}};class S{constructor(t,r,e){var n;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.config=e}get template(){return`${this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?":"+this.config.port:""}`:this.config.url:""}/${this.definition.uri}`.replace(/\/+$/,"")}get parameterSegments(){var t,r;return null!=(t=null===(r=this.template.match(/{[^}?]+\??}/g))||void 0===r?void 0:r.map(t=>({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp(`^${r}$`).test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(r,e)=>{var n;if([null,void 0].includes(t[e])&&this.parameterSegments.find(({name:t})=>t===e).required)throw new Error(`Ziggy error: '${e}' parameter is required for route '${this.name}'.`);return encodeURIComponent(null!=(n=t[e])?n:"")}).replace(/\/+$/,""):this.template}}class R extends String{constructor(r,e,n=!0,i){var o;if(super(),this.t=null!=(o=null!=i?i:Ziggy)?o:null===globalThis||void 0===globalThis?void 0:globalThis.Ziggy,this.t=t({},this.t,{absolute:n}),r){if(!this.t.routes[r])throw new Error(`Ziggy error: route '${r}' is not in the route list.`);this.i=new S(r,this.t.routes[r],this.t),this.u=this.s(e)}}toString(){const r=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:r})=>r===t)).filter(t=>"_query"!==t).reduce((r,e)=>t({},r,{[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,r){var e,n=t,i=function(t){if(!t)return b;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||b.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 e=a.default;if(void 0!==t.format){if(!c.call(a.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=a.formatters[e],i=b.filter;return("function"==typeof t.filter||h(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===t.allowDots?b.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:b.charsetSentinel,delimiter:void 0===t.delimiter?b.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:b.encode,encoder:"function"==typeof t.encoder?t.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:b.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:b.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:b.strictNullHandling}}(r);"function"==typeof i.filter?n=(0,i.filter)("",n):h(i.filter)&&(e=i.filter);var o=[];if("object"!=typeof n||null===n)return"";var u=l[r&&r.arrayFormat in l?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),i.sort&&e.sort(i.sort);for(var f=0;f0?v+d:""}(t({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,r)=>"boolean"==typeof t?Number(t):r(t)})}current(t,r){const e=this.t.absolute?window.location.host+window.location.pathname:window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,i]=Object.entries(this.t.routes).find(([r,n])=>new S(t,n,this.t).matchesUrl(e))||[void 0,void 0];if(!t)return n;const o=new RegExp(`^${t.replace(".","\\.").replace("*",".*")}$`).test(n);if([null,void 0].includes(r)||!o)return o;const u=new S(n,i,this.t);r=this.s(r,u);const f=this.l(i);return!(!Object.values(r).every(t=>!t)||Object.values(f).length)||Object.entries(r).every(([t,r])=>f[t]==r)}get params(){return this.l(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}s(r={},e=this.i){r=["string","number"].includes(typeof r)?[r]:r;const n=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(r)?r=r.reduce((r,e,i)=>{var o;return t({},r,{[null===(o=n[i])||void 0===o?void 0:o.name]:e})},{}):1!==n.length||r[n[0].name]||!r.hasOwnProperty(Object.values(e.bindings)[0])&&!r.hasOwnProperty("id")||(r={[n[0].name]:r}),t({},this.h(e),this.p(r,e.bindings))}h(r){return r.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((r,{name:e},n)=>t({},r,{[e]:this.t.defaults[e]}),{})}p(r,e={}){return Object.entries(r).reduce((r,[n,i])=>{if(!i||"object"!=typeof i||Array.isArray(i)||"_query"===n)return t({},r,{[n]:i});if(!i.hasOwnProperty(e[n])){if(!i.hasOwnProperty("id"))throw new Error(`Ziggy error: object passed as '${n}' parameter is missing route model binding key '${e[n]}'.`);e[n]="id"}return t({},r,{[n]:i[e[n]]})},{})}l(r){var e;let n=window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const i=(r,e="",n)=>{const[i,o]=[r,e].map(t=>t.split(n));return o.reduce((r,e,n)=>/^{[^}?]+\??}$/.test(e)&&i[n]?t({},r,{[e.replace(/^{|\??}$/g,"")]:i[n]}):r,{})};return t({},i(window.location.host,r.domain,"."),i(n,r.uri,"/"),function(t,r){var e=w;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},i=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),u=-1,f=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(a=j(a)?[a]:a),n[s]=m.call(n,s)?o.combine(n[s],a):a}return n}(t,e):t,i=e.plainObjects?Object.create(null):{},u=Object.keys(n),f=0;f1;){var r=t.pop(),n=r.obj[r.prop];if(e(n)){for(var i=[],o=0;o=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122?o+=i.charAt(u):f<128?o+=n[f]:f<2048?o+=n[192|f>>6]+n[128|63&f]:f<55296||f>=57344?o+=n[224|f>>12]+n[128|f>>6&63]+n[128|63&f]:(f=65536+((1023&f)<<10|1023&i.charCodeAt(u+=1)),o+=n[240|f>>18]+n[128|f>>12&63]+n[128|f>>6&63]+n[128|63&f])}return o},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,r){if(e(t)){for(var n=[],i=0;i-1?t.split(","):t},E=function(t,r,e,n){if(t){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(i),f=u?i.slice(0,u.index):i,s=[];if(f){if(!e.plainObjects&&m.call(Object.prototype,f)&&!e.allowPrototypes)return;s.push(f)}for(var a=0;e.depth>0&&null!==(u=o.exec(i))&&a=0;--o){var u,f=t[o];if("[]"===f&&e.parseArrays)u=[].concat(i);else{u=e.plainObjects?Object.create(null):{};var s="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,a=parseInt(s,10);e.parseArrays||""!==s?!isNaN(a)&&f!==s&&String(a)===s&&a>=0&&e.parseArrays&&a<=e.arrayLimit?(u=[])[a]=i:u[s]=i:u={0:i}}i=u}return i}(s,r,e,n)}};class S{constructor(t,r,e){var n;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.config=e}get template(){return`${this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:""}`:this.config.url:""}/${this.definition.uri}`.replace(/\/+$/,"")}get parameterSegments(){var t,r;return null!=(t=null===(r=this.template.match(/{[^}?]+\??}/g))||void 0===r?void 0:r.map(t=>({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp(`^${r}$`).test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(r,e)=>{var n;if([null,void 0].includes(t[e])&&this.parameterSegments.find(({name:t})=>t===e).required)throw new Error(`Ziggy error: '${e}' parameter is required for route '${this.name}'.`);return encodeURIComponent(null!=(n=t[e])?n:"")}).replace(/\/+$/,""):this.template}}class R extends String{constructor(r,e,n=!0,i){var o;if(super(),this.t=null!=(o=null!=i?i:Ziggy)?o:null===globalThis||void 0===globalThis?void 0:globalThis.Ziggy,this.t=t({},this.t,{absolute:n}),r){if(!this.t.routes[r])throw new Error(`Ziggy error: route '${r}' is not in the route list.`);this.i=new S(r,this.t.routes[r],this.t),this.u=this.l(e)}}toString(){const r=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:r})=>r===t)).filter(t=>"_query"!==t).reduce((r,e)=>t({},r,{[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,r){var e,n=t,i=function(t){if(!t)return b;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||b.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 e=a.default;if(void 0!==t.format){if(!c.call(a.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=a.formatters[e],i=b.filter;return("function"==typeof t.filter||h(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===t.allowDots?b.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:b.charsetSentinel,delimiter:void 0===t.delimiter?b.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:b.encode,encoder:"function"==typeof t.encoder?t.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:b.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:b.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:b.strictNullHandling}}(r);"function"==typeof i.filter?n=(0,i.filter)("",n):h(i.filter)&&(e=i.filter);var o=[];if("object"!=typeof n||null===n)return"";var u=l[r&&r.arrayFormat in l?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),i.sort&&e.sort(i.sort);for(var f=0;f0?v+d:""}(t({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,r)=>"boolean"==typeof t?Number(t):r(t)})}current(t,r){const e=this.t.absolute?window.location.host+window.location.pathname:window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,i]=Object.entries(this.t.routes).find(([r,n])=>new S(t,n,this.t).matchesUrl(e))||[void 0,void 0];if(!t)return n;const o=new RegExp(`^${t.replace(".","\\.").replace("*",".*")}$`).test(n);if([null,void 0].includes(r)||!o)return o;const u=new S(n,i,this.t);r=this.l(r,u);const f=this.h(i);return!(!Object.values(r).every(t=>!t)||Object.values(f).length)||Object.entries(r).every(([t,r])=>f[t]==r)}get params(){return this.h(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}l(r={},e=this.i){r=["string","number"].includes(typeof r)?[r]:r;const n=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(r)?r=r.reduce((r,e,i)=>{var o;return t({},r,{[null===(o=n[i])||void 0===o?void 0:o.name]:e})},{}):1!==n.length||r[n[0].name]||!r.hasOwnProperty(Object.values(e.bindings)[0])&&!r.hasOwnProperty("id")||(r={[n[0].name]:r}),t({},this.p(e),this.v(r,e.bindings))}p(r){return r.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((r,{name:e},n)=>t({},r,{[e]:this.t.defaults[e]}),{})}v(r,e={}){return Object.entries(r).reduce((r,[n,i])=>{if(!i||"object"!=typeof i||Array.isArray(i)||"_query"===n)return t({},r,{[n]:i});if(!i.hasOwnProperty(e[n])){if(!i.hasOwnProperty("id"))throw new Error(`Ziggy error: object passed as '${n}' parameter is missing route model binding key '${e[n]}'.`);e[n]="id"}return t({},r,{[n]:i[e[n]]})},{})}h(r){var e;let n=window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const i=(r,e="",n)=>{const[i,o]=[r,e].map(t=>t.split(n));return o.reduce((r,e,n)=>/^{[^}?]+\??}$/.test(e)&&i[n]?t({},r,{[e.replace(/^{|\??}$/g,"")]:i[n]}):r,{})};return t({},i(window.location.host,r.domain,"."),i(n,r.uri,"/"),function(t,r){var e=w;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},i=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),u=-1,f=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(a=j(a)?[a]:a),n[s]=m.call(n,s)?o.combine(n[s],a):a}return n}(t,e):t,i=e.plainObjects?Object.create(null):{},u=Object.keys(n),f=0;f 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar util = require('./utils');\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = util.assign(\n {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n }\n },\n Format\n);\n","'use strict';\n\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n }).join(',');\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix\n : prefix + (allowDots ? '.' + key : '[' + key + ']');\n\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.formatter,\n options.encodeValuesOnly,\n options.charset\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj; // eslint-disable-line no-param-reassign\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n","/**\n * A Laravel route. This class represents one route and its configuration and metadata.\n */\nexport default class Route {\n /**\n * @param {String} name - Route name.\n * @param {Object} definition - Route definition.\n * @param {Object} config - Ziggy configuration.\n */\n constructor(name, definition, config) {\n this.name = name;\n this.definition = definition;\n this.bindings = definition.bindings ?? {};\n this.config = config;\n }\n\n /**\n * Get a 'template' of the complete URL for this route.\n *\n * @example\n * https://{team}.ziggy.dev/user/{user}\n *\n * @return {String} Route template.\n */\n get template() {\n // If we're building just a path there's no origin, otherwise: if this route has a\n // domain configured we construct the origin with that, if not we use the app URL\n const origin = !this.config.absolute ? '' : this.definition.domain\n ? `${this.config.url.match(/^\\w+:\\/\\//)[0]}${this.definition.domain}${this.config.port ? `:${this.config.port}` : ''}`\n : this.config.url;\n\n return `${origin}/${this.definition.uri}`.replace(/\\/+$/, '');\n }\n\n /**\n * Get an array of objects representing the parameters that this route accepts.\n *\n * @example\n * [{ name: 'team', required: true }, { name: 'user', required: false }]\n *\n * @return {Array} Parameter segments.\n */\n get parameterSegments() {\n return this.template.match(/{[^}?]+\\??}/g)?.map((segment) => ({\n name: segment.replace(/{|\\??}/g, ''),\n required: !/\\?}$/.test(segment),\n })) ?? [];\n }\n\n /**\n * Get whether this route's template matches the given URL.\n *\n * @param {String} url - URL to check.\n * @return {Boolean} Whether this route matches.\n */\n matchesUrl(url) {\n if (!this.definition.methods.includes('GET')) return false;\n\n // Transform the route's template into a regex that will match a hydrated URL,\n // by replacing its parameter segments with matchers for parameter values\n const pattern = this.template\n .replace(/\\/{[^}?]*\\?}/g, '(\\/[^/?]+)?')\n .replace(/{[^}]+}/g, '[^/?]+')\n .replace(/^\\w+:\\/\\//, '');\n\n return new RegExp(`^${pattern}$`).test(url.replace(/\\/+$/, '').split('?').shift());\n }\n\n /**\n * Hydrate and return a complete URL for this route with the given parameters.\n *\n * @param {Object} params\n * @return {String}\n */\n compile(params) {\n if (!this.parameterSegments.length) return this.template;\n\n return this.template.replace(/{([^}?]+)\\??}/g, (_, segment) => {\n // If the parameter is missing but is not optional, throw an error\n if ([null, undefined].includes(params[segment]) && this.parameterSegments.find(({ name }) => name === segment).required) {\n throw new Error(`Ziggy error: '${segment}' parameter is required for route '${this.name}'.`)\n }\n\n return encodeURIComponent(params[segment] ?? '');\n }).replace(/\\/+$/, '');\n }\n}\n","import { parse, stringify } from 'qs';\nimport Route from './Route';\n\n/**\n * A collection of Laravel routes. This class constitutes Ziggy's main API.\n */\nexport default class Router extends String {\n /**\n * @param {String} name - Route name.\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @param {Boolean} absolute - Whether to include the URL origin.\n * @param {Object} config - Ziggy configuration.\n */\n constructor(name, params, absolute = true, config) {\n super();\n\n this._config = config ?? Ziggy ?? globalThis?.Ziggy;\n this._config = { ...this._config, absolute };\n\n if (name) {\n if (!this._config.routes[name]) {\n throw new Error(`Ziggy error: route '${name}' is not in the route list.`);\n }\n\n this._route = new Route(name, this._config.routes[name], this._config);\n this._params = this._parse(params);\n }\n }\n\n /**\n * Get the compiled URL string for the current route and parameters.\n *\n * @example\n * // with 'posts.show' route 'posts/{post}'\n * (new Router('posts.show', 1)).toString(); // 'https://ziggy.dev/posts/1'\n *\n * @return {String}\n */\n toString() {\n // Get parameters that don't correspond to any route segments to append them to the query\n const unhandled = Object.keys(this._params)\n .filter((key) => !this._route.parameterSegments.some(({ name }) => name === key))\n .filter((key) => key !== '_query')\n .reduce((result, current) => ({ ...result, [current]: this._params[current] }), {});\n\n return this._route.compile(this._params) + stringify({ ...unhandled, ...this._params['_query'] }, {\n addQueryPrefix: true,\n arrayFormat: 'indices',\n encodeValuesOnly: true,\n skipNulls: true,\n encoder: (value, encoder) => typeof value === 'boolean' ? Number(value) : encoder(value),\n });\n }\n\n /**\n * Get the name of the route matching the current window URL, or, given a route name\n * and parameters, check if the current window URL and parameters match that route.\n *\n * @example\n * // at URL https://ziggy.dev/posts/4 with 'posts.show' route 'posts/{post}'\n * route().current(); // 'posts.show'\n * route().current('posts.index'); // false\n * route().current('posts.show'); // true\n * route().current('posts.show', { post: 1 }); // false\n * route().current('posts.show', { post: 4 }); // true\n *\n * @param {String} name - Route name to check.\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @return {(Boolean|String|undefined)}\n */\n current(name, params) {\n const url = this._config.absolute\n ? window.location.host + window.location.pathname\n : window.location.pathname.replace(this._config.url.replace(/^\\w*:\\/\\/[^/]+/, ''), '').replace(/^\\/+/, '/');\n\n // Find the first route that matches the current URL\n const [current, route] = Object.entries(this._config.routes).find(\n ([_, route]) => new Route(name, route, this._config).matchesUrl(url)\n ) || [undefined, undefined];\n\n // If a name wasn't passed, return the name of the current route\n if (!name) return current;\n\n // Test the passed name against the current route, matching some\n // basic wildcards, e.g. passing `events.*` matches `events.show`\n const match = new RegExp(`^${name.replace('.', '\\\\.').replace('*', '.*')}$`).test(current);\n\n if ([null, undefined].includes(params) || !match) return match;\n\n const routeObject = new Route(current, route, this._config);\n\n params = this._parse(params, routeObject);\n const routeParams = this._dehydrate(route);\n\n // If the current window URL has no route parameters, and the passed parameters are empty, return true\n if (Object.values(params).every(p => !p) && !Object.values(routeParams).length) return true;\n\n // Check that all passed parameters match their values in the current window URL\n // Use weak equality because all values in the current window URL will be strings\n return Object.entries(params).every(([key, value]) => routeParams[key] == value);\n }\n\n /**\n * Get all parameter values from the current window URL.\n *\n * @example\n * // at URL https://tighten.ziggy.dev/posts/4?lang=en with 'posts.show' route 'posts/{post}' and domain '{team}.ziggy.dev'\n * route().params; // { team: 'tighten', post: 4, lang: 'en' }\n *\n * @return {Object}\n */\n get params() {\n return this._dehydrate(this._config.routes[this.current()]);\n }\n\n /**\n * Check whether the given route exists.\n *\n * @param {String} name\n * @return {Boolean}\n */\n has(name) {\n return Object.keys(this._config.routes).includes(name);\n }\n\n /**\n * Parse Laravel-style route parameters of any type into a normalized object.\n *\n * @example\n * // with route parameter names 'event' and 'venue'\n * _parse(1); // { event: 1 }\n * _parse({ event: 2, venue: 3 }); // { event: 2, venue: 3 }\n * _parse(['Taylor', 'Matt']); // { event: 'Taylor', venue: 'Matt' }\n * _parse([4, { uuid: 56789, name: 'Grand Canyon' }]); // { event: 4, venue: 56789 }\n *\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @param {Route} route - Route instance.\n * @return {Object} Normalized complete route parameters.\n */\n _parse(params = {}, route = this._route) {\n // If `params` is a string or integer, wrap it in an array\n params = ['string', 'number'].includes(typeof params) ? [params] : params;\n\n // Separate segments with and without defaults, and fill in the default values\n const segments = route.parameterSegments.filter(({ name }) => !this._config.defaults[name]);\n\n if (Array.isArray(params)) {\n // If the parameters are an array they have to be in order, so we can transform them into\n // an object by keying them with the template segment names in the order they appear\n params = params.reduce((result, current, i) => ({ ...result, [segments[i]?.name]: current }), {});\n } else if (\n segments.length === 1\n && !params[segments[0].name]\n && (params.hasOwnProperty(Object.values(route.bindings)[0]) || params.hasOwnProperty('id'))\n ) {\n // If there is only one template segment and `params` is an object, that object is\n // ambiguous—it could contain the parameter key and value, or it could be an object\n // representing just the value (e.g. a model); we can inspect it to find out, and\n // if it's just the parameter value, we can wrap it in an object with its key\n params = { [segments[0].name]: params };\n }\n\n return {\n ...this._defaults(route),\n ...this._substituteBindings(params, route.bindings),\n };\n }\n\n /**\n * Populate default parameters for the given route.\n *\n * @example\n * // with default parameters { locale: 'en', country: 'US' } and 'posts.show' route '{locale}/posts/{post}'\n * defaults(...); // { locale: 'en' }\n *\n * @param {Route} route\n * @return {Object} Default route parameters.\n */\n _defaults(route) {\n return route.parameterSegments.filter(({ name }) => this._config.defaults[name])\n .reduce((result, { name }, i) => ({ ...result, [name]: this._config.defaults[name] }), {});\n }\n\n /**\n * Substitute Laravel route model bindings in the given parameters.\n *\n * @example\n * _substituteBindings({ post: { id: 4, slug: 'hello-world', title: 'Hello, world!' } }, { post: 'slug' }); // { post: 'hello-world' }\n *\n * @param {Object} params - Route parameters.\n * @param {Object} bindings - Route model bindings.\n * @return {Object} Normalized route parameters.\n */\n _substituteBindings(params, bindings = {}) {\n return Object.entries(params).reduce((result, [key, value]) => {\n // If the value isn't an object, or if it's an object of explicit query\n // parameters, there's nothing to substitute so we return it as-is\n if (!value || typeof value !== 'object' || Array.isArray(value) || key === '_query') {\n return { ...result, [key]: value };\n }\n\n if (!value.hasOwnProperty(bindings[key])) {\n if (value.hasOwnProperty('id')) {\n // As a fallback, we still accept an 'id' key not explicitly registered as a binding\n bindings[key] = 'id';\n } else {\n throw new Error(`Ziggy error: object passed as '${key}' parameter is missing route model binding key '${bindings[key]}'.`)\n }\n }\n\n return { ...result, [key]: value[bindings[key]] };\n }, {});\n }\n\n /**\n * Get all parameters and their values from the current window URL, based on the given route definition.\n *\n * @example\n * // at URL https://tighten.ziggy.dev/events/8/venues/chicago?zoom=true\n * _dehydrate({ domain: '{team}.ziggy.dev', uri: 'events/{event}/venues/{venue?}' }); // { team: 'tighten', event: 8, venue: 'chicago', zoom: true }\n *\n * @param {Object} route - Route definition.\n * @return {Object} Parameters.\n */\n _dehydrate(route) {\n let pathname = window.location.pathname\n // If this Laravel app is in a subdirectory, trim the subdirectory from the path\n .replace(this._config.url.replace(/^\\w*:\\/\\/[^/]+/, ''), '')\n .replace(/^\\/+/, '');\n\n // Given part of a valid 'hydrated' URL containing all its parameter values,\n // a route template, and a delimiter, extract the parameters as an object\n // E.g. dehydrate('events/{event}/{venue}', 'events/2/chicago', '/'); // { event: 2, venue: 'chicago' }\n const dehydrate = (hydrated, template = '', delimiter) => {\n const [values, segments] = [hydrated, template].map(s => s.split(delimiter));\n\n return segments.reduce((result, current, i) => {\n // Only include template segments that are route parameters\n // AND have a value present in the passed hydrated string\n return /^{[^}?]+\\??}$/.test(current) && values[i]\n ? { ...result, [current.replace(/^{|\\??}$/g, '')]: values[i] }\n : result;\n }, {});\n }\n\n return {\n ...dehydrate(window.location.host, route.domain, '.'), // Domain parameters\n ...dehydrate(pathname, route.uri, '/'), // Path parameters\n ...parse(window.location.search?.replace(/^\\?/, '')), // Query parameters\n };\n }\n\n valueOf() {\n return this.toString();\n }\n\n /**\n * @deprecated since v1.0, use `has()` instead.\n */\n check(name) {\n return this.has(name);\n }\n}\n","import Router from './Router';\n\nexport default function route(name, params, absolute, config) {\n const router = new Router(name, params, absolute, config);\n\n return name ? router.toString() : router;\n}\n"],"names":["has","Object","prototype","hasOwnProperty","isArray","Array","hexTable","array","i","push","toString","toUpperCase","arrayToObject","source","options","obj","plainObjects","create","length","assign","target","keys","reduce","acc","key","combine","a","b","concat","compact","value","queue","o","prop","refs","item","j","val","indexOf","pop","compacted","compactQueue","decode","str","decoder","charset","strWithoutPlus","replace","unescape","decodeURIComponent","e","encode","defaultEncoder","string","Symbol","call","String","escape","$0","parseInt","slice","out","c","charCodeAt","charAt","isBuffer","constructor","isRegExp","maybeMap","fn","mapped","merge","allowPrototypes","mergeTarget","forEach","targetItem","percentTwenties","Format","RFC1738","RFC3986","util","default","formatters","arrayPrefixGenerators","brackets","prefix","comma","indices","repeat","pushToArray","arr","valueOrArray","apply","toISO","Date","toISOString","defaultFormat","formats","defaults","addQueryPrefix","allowDots","charsetSentinel","delimiter","encoder","utils","encodeValuesOnly","format","formatter","serializeDate","date","skipNulls","strictNullHandling","stringify","object","generateArrayPrefix","filter","sort","v","join","objKeys","values","keyPrefix","arrayLimit","depth","ignoreQueryPrefix","interpretNumericEntities","parameterLimit","parseArrays","numberStr","fromCharCode","parseArrayValue","split","parseKeys","givenKey","valuesParsed","child","segment","exec","parent","index","chain","leaf","root","cleanRoot","isNaN","0","parseObject","Route","name","definition","config","this","bindings","template","absolute","domain","url","match","port","uri","parameterSegments","_this$template$match","map","required","test","matchesUrl","methods","includes","pattern","RegExp","shift","compile","params","_","undefined","find","Error","encodeURIComponent","Router","super","_config","Ziggy","globalThis","routes","_route","_params","_parse","unhandled","some","result","current","[object Object]","opts","TypeError","normalizeStringifyOptions","arrayFormat","joined","Number","window","location","host","pathname","route","entries","routeObject","routeParams","_dehydrate","every","p","segments","_segments$i","_defaults","_substituteBindings","dehydrate","hydrated","s","tempObj","parts","Infinity","skipIndex","part","bracketEqualsPos","pos","encodedVal","parseValues","newObj","parse","search","_window$location$sear","valueOf","check","router"],"mappings":"+MAEA,IAAIA,EAAMC,OAAOC,UAAUC,eACvBC,EAAUC,MAAMD,QAEhBE,EAAY,WAEZ,IADA,IAAIC,EAAQ,GACHC,EAAI,EAAGA,EAAI,MAAOA,EACvBD,EAAME,KAAK,MAAQD,EAAI,GAAK,IAAM,IAAMA,EAAEE,SAAS,KAAKC,eAG5D,OAAOJ,KAsBPK,EAAgB,SAAuBC,EAAQC,GAE/C,IADA,IAAIC,EAAMD,GAAWA,EAAQE,aAAef,OAAOgB,OAAO,MAAQ,GACzDT,EAAI,EAAGA,EAAIK,EAAOK,SAAUV,OACR,IAAdK,EAAOL,KACdO,EAAIP,GAAKK,EAAOL,IAIxB,OA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EPVmN,WAAM5B,OAAOC,SAAS4B,2BAAhBC,EAAwBrL,QAAQ,MAAO,MAIxDsL,UACI,YAAY3N,WAMhB4N,MAAMlF,GACF,YAAYpJ,IAAIoJ,4BClQMA,EAAMwB,EAAQlB,EAAUJ,GAClD,MAAMiF,EAAS,IAAIrD,EAAO9B,EAAMwB,EAAQlB,EAAUJ,GAElD,OAAOF,EAAOmF,EAAO7N,WAAa6N"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 0b663ef8..a8ec1d96 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).route=e()}(this,function(){var t=Object.prototype.hasOwnProperty,e=Array.isArray,r=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),n=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var r=t.pop(),n=r.obj[r.prop];if(e(n)){for(var o=[],i=0;i=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122?i+=o.charAt(u):f<128?i+=r[f]:f<2048?i+=r[192|f>>6]+r[128|63&f]:f<55296||f>=57344?i+=r[224|f>>12]+r[128|f>>6&63]+r[128|63&f]:(f=65536+((1023&f)<<10|1023&o.charCodeAt(u+=1)),i+=r[240|f>>18]+r[128|f>>12&63]+r[128|f>>6&63]+r[128|63&f])}return i},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,r){if(e(t)){for(var n=[],o=0;o-1?t.split(","):t},E=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,u=r.depth>0&&/(\[[^[\]]*])/.exec(o),f=u?o.slice(0,u.index):o,a=[];if(f){if(!r.plainObjects&&m.call(Object.prototype,f)&&!r.allowPrototypes)return;a.push(f)}for(var s=0;r.depth>0&&null!==(u=i.exec(o))&&s=0;--i){var u,f=t[i];if("[]"===f&&r.parseArrays)u=[].concat(o);else{u=r.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,s=parseInt(a,10);r.parseArrays||""!==a?!isNaN(s)&&f!==a&&String(s)===a&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(u=[])[s]=o:u[a]=o:u={0:o}}o=u}return o}(a,e,r,n)}},S=function(t,e){var r=function(t){if(!t)return w;if(null!=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");return{allowDots:void 0===t.allowDots?w.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:w.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:w.arrayLimit,charset:void 0===t.charset?w.charset:t.charset,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:w.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:w.comma,decoder:"function"==typeof t.decoder?t.decoder:w.decoder,delimiter:"string"==typeof t.delimiter||o.isRegExp(t.delimiter)?t.delimiter:w.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:w.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:w.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:w.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:w.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:w.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=(e.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(e.delimiter,Infinity===e.parameterLimit?void 0:e.parameterLimit),u=-1,f=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(s=g(s)?[s]:s),n[a]=m.call(n,a)?o.combine(n[a],s):s}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},u=Object.keys(n),f=0;f({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const e=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+e+"$").test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(e,r)=>{var n;if([null,void 0].includes(t[r])&&this.parameterSegments.find(({name:t})=>t===r).required)throw new Error("Ziggy error: '"+r+"' parameter is required for route '"+this.name+"'.");return encodeURIComponent(null!=(n=t[r])?n:"")}).replace(/\/+$/,""):this.template}}class R extends String{constructor(t,e,r=!0,n){var o;if(super(),this.t=null!=(o=null!=n?n:Ziggy)?o:null===globalThis||void 0===globalThis?void 0:globalThis.Ziggy,this.t={...this.t,absolute:r},t){if(!this.t.routes[t])throw new Error("Ziggy error: route '"+t+"' is not in the route list.");this.i=new N(t,this.t.routes[t],this.t),this.u=this.s(e)}}toString(){const t=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:e})=>e===t)).filter(t=>"_query"!==t).reduce((t,e)=>({...t,[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,e){var r,n=t,o=function(t){if(!t)return b;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||b.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=a.default;if(void 0!==t.format){if(!s.call(a.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=a.formatters[r],o=b.filter;return("function"==typeof t.filter||l(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===t.allowDots?b.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:b.charsetSentinel,delimiter:void 0===t.delimiter?b.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:b.encode,encoder:"function"==typeof t.encoder?t.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:b.encodeValuesOnly,filter:o,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:b.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:b.strictNullHandling}}(e);"function"==typeof o.filter?n=(0,o.filter)("",n):l(o.filter)&&(r=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var u=c[e&&e.arrayFormat in c?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices"];r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);for(var f=0;f0?h+y:""}({...t,...this.u._query},{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,e)=>"boolean"==typeof t?Number(t):e(t)})}current(t,e){const r=this.t.absolute?window.location.host+window.location.pathname:window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,o]=Object.entries(this.t.routes).find(([e,n])=>new N(t,n,this.t).matchesUrl(r))||[void 0,void 0];if(!t)return n;const i=new RegExp("^"+t.replace(".","\\.").replace("*",".*")+"$").test(n);if([null,void 0].includes(e)||!i)return i;const u=new N(n,o,this.t);e=this.s(e,u);const f=this.l(o);return!(!Object.values(e).every(t=>!t)||Object.values(f).length)||Object.entries(e).every(([t,e])=>f[t]==e)}get params(){return this.l(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}s(t={},e=this.i){t=["string","number"].includes(typeof t)?[t]:t;const r=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(t)?t=t.reduce((t,e,n)=>{var o;return{...t,[null===(o=r[n])||void 0===o?void 0:o.name]:e}},{}):1!==r.length||t[r[0].name]||!t.hasOwnProperty(Object.values(e.bindings)[0])&&!t.hasOwnProperty("id")||(t={[r[0].name]:t}),{...this.p(e),...this.h(t,e.bindings)}}p(t){return t.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((t,{name:e},r)=>({...t,[e]:this.t.defaults[e]}),{})}h(t,e={}){return Object.entries(t).reduce((t,[r,n])=>{if(!n||"object"!=typeof n||Array.isArray(n)||"_query"===r)return{...t,[r]:n};if(!n.hasOwnProperty(e[r])){if(!n.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+r+"' parameter is missing route model binding key '"+e[r]+"'.");e[r]="id"}return{...t,[r]:n[e[r]]}},{})}l(t){var e;let r=window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const n=(t,e="",r)=>{const[n,o]=[t,e].map(t=>t.split(r));return o.reduce((t,e,r)=>/^{[^}?]+\??}$/.test(e)&&n[r]?{...t,[e.replace(/^{|\??}$/g,"")]:n[r]}:t,{})};return{...n(window.location.host,t.domain,"."),...n(r,t.uri,"/"),...S(null===(e=window.location.search)||void 0===e?void 0:e.replace(/^\?/,""))}}valueOf(){return this.toString()}check(t){return this.has(t)}}return function(t,e,r,n){const o=new R(t,e,r,n);return t?o.toString():o}}); -//# sourceMappingURL=index.js.map +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).route=e()}(this,function(){var t=Object.prototype.hasOwnProperty,e=Array.isArray,r=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),n=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var r=t.pop(),n=r.obj[r.prop];if(e(n)){for(var o=[],i=0;i=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122?i+=o.charAt(u):f<128?i+=r[f]:f<2048?i+=r[192|f>>6]+r[128|63&f]:f<55296||f>=57344?i+=r[224|f>>12]+r[128|f>>6&63]+r[128|63&f]:(f=65536+((1023&f)<<10|1023&o.charCodeAt(u+=1)),i+=r[240|f>>18]+r[128|f>>12&63]+r[128|f>>6&63]+r[128|63&f])}return i},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,r){if(e(t)){for(var n=[],o=0;o-1?t.split(","):t},E=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,u=r.depth>0&&/(\[[^[\]]*])/.exec(o),f=u?o.slice(0,u.index):o,a=[];if(f){if(!r.plainObjects&&m.call(Object.prototype,f)&&!r.allowPrototypes)return;a.push(f)}for(var s=0;r.depth>0&&null!==(u=i.exec(o))&&s=0;--i){var u,f=t[i];if("[]"===f&&r.parseArrays)u=[].concat(o);else{u=r.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,s=parseInt(a,10);r.parseArrays||""!==a?!isNaN(s)&&f!==a&&String(s)===a&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(u=[])[s]=o:u[a]=o:u={0:o}}o=u}return o}(a,e,r,n)}},S=function(t,e){var r=function(t){if(!t)return w;if(null!=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");return{allowDots:void 0===t.allowDots?w.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:w.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:w.arrayLimit,charset:void 0===t.charset?w.charset:t.charset,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:w.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:w.comma,decoder:"function"==typeof t.decoder?t.decoder:w.decoder,delimiter:"string"==typeof t.delimiter||o.isRegExp(t.delimiter)?t.delimiter:w.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:w.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:w.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:w.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:w.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:w.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=(e.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(e.delimiter,Infinity===e.parameterLimit?void 0:e.parameterLimit),u=-1,f=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(s=g(s)?[s]:s),n[a]=m.call(n,a)?o.combine(n[a],s):s}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},u=Object.keys(n),f=0;f({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const e=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+e+"$").test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(e,r)=>{var n;if([null,void 0].includes(t[r])&&this.parameterSegments.find(({name:t})=>t===r).required)throw new Error("Ziggy error: '"+r+"' parameter is required for route '"+this.name+"'.");return encodeURIComponent(null!=(n=t[r])?n:"")}).replace(/\/+$/,""):this.template}}class N extends String{constructor(t,e,r=!0,n){var o;if(super(),this.t=null!=(o=null!=n?n:Ziggy)?o:null===globalThis||void 0===globalThis?void 0:globalThis.Ziggy,this.t={...this.t,absolute:r},t){if(!this.t.routes[t])throw new Error("Ziggy error: route '"+t+"' is not in the route list.");this.i=new T(t,this.t.routes[t],this.t),this.u=this.l(e)}}toString(){const t=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:e})=>e===t)).filter(t=>"_query"!==t).reduce((t,e)=>({...t,[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,e){var r,n=t,o=function(t){if(!t)return b;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||b.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=a.default;if(void 0!==t.format){if(!s.call(a.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=a.formatters[r],o=b.filter;return("function"==typeof t.filter||l(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===t.allowDots?b.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:b.charsetSentinel,delimiter:void 0===t.delimiter?b.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:b.encode,encoder:"function"==typeof t.encoder?t.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:b.encodeValuesOnly,filter:o,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:b.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:b.strictNullHandling}}(e);"function"==typeof o.filter?n=(0,o.filter)("",n):l(o.filter)&&(r=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var u=c[e&&e.arrayFormat in c?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices"];r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);for(var f=0;f0?h+y:""}({...t,...this.u._query},{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,e)=>"boolean"==typeof t?Number(t):e(t)})}current(t,e){const r=this.t.absolute?window.location.host+window.location.pathname:window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,o]=Object.entries(this.t.routes).find(([e,n])=>new T(t,n,this.t).matchesUrl(r))||[void 0,void 0];if(!t)return n;const i=new RegExp("^"+t.replace(".","\\.").replace("*",".*")+"$").test(n);if([null,void 0].includes(e)||!i)return i;const u=new T(n,o,this.t);e=this.l(e,u);const f=this.p(o);return!(!Object.values(e).every(t=>!t)||Object.values(f).length)||Object.entries(e).every(([t,e])=>f[t]==e)}get params(){return this.p(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}l(t={},e=this.i){t=["string","number"].includes(typeof t)?[t]:t;const r=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(t)?t=t.reduce((t,e,n)=>{var o;return{...t,[null===(o=r[n])||void 0===o?void 0:o.name]:e}},{}):1!==r.length||t[r[0].name]||!t.hasOwnProperty(Object.values(e.bindings)[0])&&!t.hasOwnProperty("id")||(t={[r[0].name]:t}),{...this.h(e),...this.v(t,e.bindings)}}h(t){return t.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((t,{name:e},r)=>({...t,[e]:this.t.defaults[e]}),{})}v(t,e={}){return Object.entries(t).reduce((t,[r,n])=>{if(!n||"object"!=typeof n||Array.isArray(n)||"_query"===r)return{...t,[r]:n};if(!n.hasOwnProperty(e[r])){if(!n.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+r+"' parameter is missing route model binding key '"+e[r]+"'.");e[r]="id"}return{...t,[r]:n[e[r]]}},{})}p(t){var e;let r=window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const n=(t,e="",r)=>{const[n,o]=[t,e].map(t=>t.split(r));return o.reduce((t,e,r)=>/^{[^}?]+\??}$/.test(e)&&n[r]?{...t,[e.replace(/^{|\??}$/g,"")]:n[r]}:t,{})};return{...n(window.location.host,t.domain,"."),...n(r,t.uri,"/"),...S(null===(e=window.location.search)||void 0===e?void 0:e.replace(/^\?/,""))}}valueOf(){return this.toString()}check(t){return this.has(t)}}return function(t,e,r,n){const o=new N(t,e,r,n);return t?o.toString():o}}); diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index b450d70c..00000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../node_modules/qs/lib/utils.js","../node_modules/qs/lib/formats.js","../node_modules/qs/lib/stringify.js","../node_modules/qs/lib/parse.js","../src/js/Route.js","../src/js/Router.js","../src/js/index.js"],"sourcesContent":["'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar util = require('./utils');\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = util.assign(\n {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n }\n },\n Format\n);\n","'use strict';\n\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n }).join(',');\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix\n : prefix + (allowDots ? '.' + key : '[' + key + ']');\n\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.formatter,\n options.encodeValuesOnly,\n options.charset\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj; // eslint-disable-line no-param-reassign\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n","/**\n * A Laravel route. This class represents one route and its configuration and metadata.\n */\nexport default class Route {\n /**\n * @param {String} name - Route name.\n * @param {Object} definition - Route definition.\n * @param {Object} config - Ziggy configuration.\n */\n constructor(name, definition, config) {\n this.name = name;\n this.definition = definition;\n this.bindings = definition.bindings ?? {};\n this.config = config;\n }\n\n /**\n * Get a 'template' of the complete URL for this route.\n *\n * @example\n * https://{team}.ziggy.dev/user/{user}\n *\n * @return {String} Route template.\n */\n get template() {\n // If we're building just a path there's no origin, otherwise: if this route has a\n // domain configured we construct the origin with that, if not we use the app URL\n const origin = !this.config.absolute ? '' : this.definition.domain\n ? `${this.config.url.match(/^\\w+:\\/\\//)[0]}${this.definition.domain}${this.config.port ? `:${this.config.port}` : ''}`\n : this.config.url;\n\n return `${origin}/${this.definition.uri}`.replace(/\\/+$/, '');\n }\n\n /**\n * Get an array of objects representing the parameters that this route accepts.\n *\n * @example\n * [{ name: 'team', required: true }, { name: 'user', required: false }]\n *\n * @return {Array} Parameter segments.\n */\n get parameterSegments() {\n return this.template.match(/{[^}?]+\\??}/g)?.map((segment) => ({\n name: segment.replace(/{|\\??}/g, ''),\n required: !/\\?}$/.test(segment),\n })) ?? [];\n }\n\n /**\n * Get whether this route's template matches the given URL.\n *\n * @param {String} url - URL to check.\n * @return {Boolean} Whether this route matches.\n */\n matchesUrl(url) {\n if (!this.definition.methods.includes('GET')) return false;\n\n // Transform the route's template into a regex that will match a hydrated URL,\n // by replacing its parameter segments with matchers for parameter values\n const pattern = this.template\n .replace(/\\/{[^}?]*\\?}/g, '(\\/[^/?]+)?')\n .replace(/{[^}]+}/g, '[^/?]+')\n .replace(/^\\w+:\\/\\//, '');\n\n return new RegExp(`^${pattern}$`).test(url.replace(/\\/+$/, '').split('?').shift());\n }\n\n /**\n * Hydrate and return a complete URL for this route with the given parameters.\n *\n * @param {Object} params\n * @return {String}\n */\n compile(params) {\n if (!this.parameterSegments.length) return this.template;\n\n return this.template.replace(/{([^}?]+)\\??}/g, (_, segment) => {\n // If the parameter is missing but is not optional, throw an error\n if ([null, undefined].includes(params[segment]) && this.parameterSegments.find(({ name }) => name === segment).required) {\n throw new Error(`Ziggy error: '${segment}' parameter is required for route '${this.name}'.`)\n }\n\n return encodeURIComponent(params[segment] ?? '');\n }).replace(/\\/+$/, '');\n }\n}\n","import { parse, stringify } from 'qs';\nimport Route from './Route';\n\n/**\n * A collection of Laravel routes. This class constitutes Ziggy's main API.\n */\nexport default class Router extends String {\n /**\n * @param {String} name - Route name.\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @param {Boolean} absolute - Whether to include the URL origin.\n * @param {Object} config - Ziggy configuration.\n */\n constructor(name, params, absolute = true, config) {\n super();\n\n this._config = config ?? Ziggy ?? globalThis?.Ziggy;\n this._config = { ...this._config, absolute };\n\n if (name) {\n if (!this._config.routes[name]) {\n throw new Error(`Ziggy error: route '${name}' is not in the route list.`);\n }\n\n this._route = new Route(name, this._config.routes[name], this._config);\n this._params = this._parse(params);\n }\n }\n\n /**\n * Get the compiled URL string for the current route and parameters.\n *\n * @example\n * // with 'posts.show' route 'posts/{post}'\n * (new Router('posts.show', 1)).toString(); // 'https://ziggy.dev/posts/1'\n *\n * @return {String}\n */\n toString() {\n // Get parameters that don't correspond to any route segments to append them to the query\n const unhandled = Object.keys(this._params)\n .filter((key) => !this._route.parameterSegments.some(({ name }) => name === key))\n .filter((key) => key !== '_query')\n .reduce((result, current) => ({ ...result, [current]: this._params[current] }), {});\n\n return this._route.compile(this._params) + stringify({ ...unhandled, ...this._params['_query'] }, {\n addQueryPrefix: true,\n arrayFormat: 'indices',\n encodeValuesOnly: true,\n skipNulls: true,\n encoder: (value, encoder) => typeof value === 'boolean' ? Number(value) : encoder(value),\n });\n }\n\n /**\n * Get the name of the route matching the current window URL, or, given a route name\n * and parameters, check if the current window URL and parameters match that route.\n *\n * @example\n * // at URL https://ziggy.dev/posts/4 with 'posts.show' route 'posts/{post}'\n * route().current(); // 'posts.show'\n * route().current('posts.index'); // false\n * route().current('posts.show'); // true\n * route().current('posts.show', { post: 1 }); // false\n * route().current('posts.show', { post: 4 }); // true\n *\n * @param {String} name - Route name to check.\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @return {(Boolean|String|undefined)}\n */\n current(name, params) {\n const url = this._config.absolute\n ? window.location.host + window.location.pathname\n : window.location.pathname.replace(this._config.url.replace(/^\\w*:\\/\\/[^/]+/, ''), '').replace(/^\\/+/, '/');\n\n // Find the first route that matches the current URL\n const [current, route] = Object.entries(this._config.routes).find(\n ([_, route]) => new Route(name, route, this._config).matchesUrl(url)\n ) || [undefined, undefined];\n\n // If a name wasn't passed, return the name of the current route\n if (!name) return current;\n\n // Test the passed name against the current route, matching some\n // basic wildcards, e.g. passing `events.*` matches `events.show`\n const match = new RegExp(`^${name.replace('.', '\\\\.').replace('*', '.*')}$`).test(current);\n\n if ([null, undefined].includes(params) || !match) return match;\n\n const routeObject = new Route(current, route, this._config);\n\n params = this._parse(params, routeObject);\n const routeParams = this._dehydrate(route);\n\n // If the current window URL has no route parameters, and the passed parameters are empty, return true\n if (Object.values(params).every(p => !p) && !Object.values(routeParams).length) return true;\n\n // Check that all passed parameters match their values in the current window URL\n // Use weak equality because all values in the current window URL will be strings\n return Object.entries(params).every(([key, value]) => routeParams[key] == value);\n }\n\n /**\n * Get all parameter values from the current window URL.\n *\n * @example\n * // at URL https://tighten.ziggy.dev/posts/4?lang=en with 'posts.show' route 'posts/{post}' and domain '{team}.ziggy.dev'\n * route().params; // { team: 'tighten', post: 4, lang: 'en' }\n *\n * @return {Object}\n */\n get params() {\n return this._dehydrate(this._config.routes[this.current()]);\n }\n\n /**\n * Check whether the given route exists.\n *\n * @param {String} name\n * @return {Boolean}\n */\n has(name) {\n return Object.keys(this._config.routes).includes(name);\n }\n\n /**\n * Parse Laravel-style route parameters of any type into a normalized object.\n *\n * @example\n * // with route parameter names 'event' and 'venue'\n * _parse(1); // { event: 1 }\n * _parse({ event: 2, venue: 3 }); // { event: 2, venue: 3 }\n * _parse(['Taylor', 'Matt']); // { event: 'Taylor', venue: 'Matt' }\n * _parse([4, { uuid: 56789, name: 'Grand Canyon' }]); // { event: 4, venue: 56789 }\n *\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @param {Route} route - Route instance.\n * @return {Object} Normalized complete route parameters.\n */\n _parse(params = {}, route = this._route) {\n // If `params` is a string or integer, wrap it in an array\n params = ['string', 'number'].includes(typeof params) ? [params] : params;\n\n // Separate segments with and without defaults, and fill in the default values\n const segments = route.parameterSegments.filter(({ name }) => !this._config.defaults[name]);\n\n if (Array.isArray(params)) {\n // If the parameters are an array they have to be in order, so we can transform them into\n // an object by keying them with the template segment names in the order they appear\n params = params.reduce((result, current, i) => ({ ...result, [segments[i]?.name]: current }), {});\n } else if (\n segments.length === 1\n && !params[segments[0].name]\n && (params.hasOwnProperty(Object.values(route.bindings)[0]) || params.hasOwnProperty('id'))\n ) {\n // If there is only one template segment and `params` is an object, that object is\n // ambiguous—it could contain the parameter key and value, or it could be an object\n // representing just the value (e.g. a model); we can inspect it to find out, and\n // if it's just the parameter value, we can wrap it in an object with its key\n params = { [segments[0].name]: params };\n }\n\n return {\n ...this._defaults(route),\n ...this._substituteBindings(params, route.bindings),\n };\n }\n\n /**\n * Populate default parameters for the given route.\n *\n * @example\n * // with default parameters { locale: 'en', country: 'US' } and 'posts.show' route '{locale}/posts/{post}'\n * defaults(...); // { locale: 'en' }\n *\n * @param {Route} route\n * @return {Object} Default route parameters.\n */\n _defaults(route) {\n return route.parameterSegments.filter(({ name }) => this._config.defaults[name])\n .reduce((result, { name }, i) => ({ ...result, [name]: this._config.defaults[name] }), {});\n }\n\n /**\n * Substitute Laravel route model bindings in the given parameters.\n *\n * @example\n * _substituteBindings({ post: { id: 4, slug: 'hello-world', title: 'Hello, world!' } }, { post: 'slug' }); // { post: 'hello-world' }\n *\n * @param {Object} params - Route parameters.\n * @param {Object} bindings - Route model bindings.\n * @return {Object} Normalized route parameters.\n */\n _substituteBindings(params, bindings = {}) {\n return Object.entries(params).reduce((result, [key, value]) => {\n // If the value isn't an object, or if it's an object of explicit query\n // parameters, there's nothing to substitute so we return it as-is\n if (!value || typeof value !== 'object' || Array.isArray(value) || key === '_query') {\n return { ...result, [key]: value };\n }\n\n if (!value.hasOwnProperty(bindings[key])) {\n if (value.hasOwnProperty('id')) {\n // As a fallback, we still accept an 'id' key not explicitly registered as a binding\n bindings[key] = 'id';\n } else {\n throw new Error(`Ziggy error: object passed as '${key}' parameter is missing route model binding key '${bindings[key]}'.`)\n }\n }\n\n return { ...result, [key]: value[bindings[key]] };\n }, {});\n }\n\n /**\n * Get all parameters and their values from the current window URL, based on the given route definition.\n *\n * @example\n * // at URL https://tighten.ziggy.dev/events/8/venues/chicago?zoom=true\n * _dehydrate({ domain: '{team}.ziggy.dev', uri: 'events/{event}/venues/{venue?}' }); // { team: 'tighten', event: 8, venue: 'chicago', zoom: true }\n *\n * @param {Object} route - Route definition.\n * @return {Object} Parameters.\n */\n _dehydrate(route) {\n let pathname = window.location.pathname\n // If this Laravel app is in a subdirectory, trim the subdirectory from the path\n .replace(this._config.url.replace(/^\\w*:\\/\\/[^/]+/, ''), '')\n .replace(/^\\/+/, '');\n\n // Given part of a valid 'hydrated' URL containing all its parameter values,\n // a route template, and a delimiter, extract the parameters as an object\n // E.g. dehydrate('events/{event}/{venue}', 'events/2/chicago', '/'); // { event: 2, venue: 'chicago' }\n const dehydrate = (hydrated, template = '', delimiter) => {\n const [values, segments] = [hydrated, template].map(s => s.split(delimiter));\n\n return segments.reduce((result, current, i) => {\n // Only include template segments that are route parameters\n // AND have a value present in the passed hydrated string\n return /^{[^}?]+\\??}$/.test(current) && values[i]\n ? { ...result, [current.replace(/^{|\\??}$/g, '')]: values[i] }\n : result;\n }, {});\n }\n\n return {\n ...dehydrate(window.location.host, route.domain, '.'), // Domain parameters\n ...dehydrate(pathname, route.uri, '/'), // Path parameters\n ...parse(window.location.search?.replace(/^\\?/, '')), // Query parameters\n };\n }\n\n valueOf() {\n return this.toString();\n }\n\n /**\n * @deprecated since v1.0, use `has()` instead.\n */\n check(name) {\n return this.has(name);\n }\n}\n","import Router from './Router';\n\nexport default function route(name, params, absolute, config) {\n const router = new Router(name, params, absolute, config);\n\n return name ? router.toString() : router;\n}\n"],"names":["has","Object","prototype","hasOwnProperty","isArray","Array","hexTable","array","i","push","toString","toUpperCase","arrayToObject","source","options","obj","plainObjects","create","length","assign","target","keys","reduce","acc","key","combine","a","b","concat","compact","value","queue","o","prop","refs","item","j","val","indexOf","pop","compacted","compactQueue","decode","str","decoder","charset","strWithoutPlus","replace","unescape","decodeURIComponent","e","encode","defaultEncoder","string","Symbol","call","String","escape","$0","parseInt","slice","out","c","charCodeAt","charAt","isBuffer","constructor","isRegExp","maybeMap","fn","mapped","merge","allowPrototypes","mergeTarget","forEach","targetItem","percentTwenties","Format","RFC1738","RFC3986","util","default","formatters","arrayPrefixGenerators","brackets","prefix","comma","indices","repeat","pushToArray","arr","valueOrArray","apply","toISO","Date","toISOString","defaultFormat","formats","defaults","addQueryPrefix","allowDots","charsetSentinel","delimiter","encoder","utils","encodeValuesOnly","format","formatter","serializeDate","date","skipNulls","strictNullHandling","stringify","object","generateArrayPrefix","filter","sort","v","join","objKeys","values","keyPrefix","arrayLimit","depth","ignoreQueryPrefix","interpretNumericEntities","parameterLimit","parseArrays","numberStr","fromCharCode","parseArrayValue","split","parseKeys","givenKey","valuesParsed","child","segment","exec","parent","index","chain","leaf","root","cleanRoot","isNaN","0","parseObject","opts","TypeError","normalizeParseOptions","tempObj","parts","Infinity","undefined","skipIndex","part","bracketEqualsPos","pos","encodedVal","parseValues","newObj","Route","name","definition","config","this","bindings","template","absolute","domain","url","match","port","uri","parameterSegments","_this$template$match","map","required","test","matchesUrl","methods","includes","pattern","RegExp","shift","compile","params","_","find","Error","encodeURIComponent","Router","super","_config","Ziggy","globalThis","routes","_route","_params","_parse","unhandled","some","result","current","[object Object]","normalizeStringifyOptions","arrayFormat","joined","Number","window","location","host","pathname","route","entries","routeObject","routeParams","_dehydrate","every","p","segments","_segments$i","_defaults","_substituteBindings","dehydrate","hydrated","s","parse","search","_window$location$sear","valueOf","check","router"],"mappings":"8KAEA,IAAIA,EAAMC,OAAOC,UAAUC,eACvBC,EAAUC,MAAMD,QAEhBE,EAAY,WAEZ,IADA,IAAIC,EAAQ,GACHC,EAAI,EAAGA,EAAI,MAAOA,EACvBD,EAAME,KAAK,MAAQD,EAAI,GAAK,IAAM,IAAMA,EAAEE,SAAS,KAAKC,eAG5D,OAAOJ,KAsBPK,EAAgB,SAAuBC,EAAQC,GAE/C,IADA,IAAIC,EAAMD,GAAWA,EAAQE,aAAef,OAAOgB,OAAO,MAAQ,GACzDT,EAAI,EAAGA,EAA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MyE,EAAOhH,IACxDkM,EACP,KAGP,MAAO,IACAsB,EAAUf,OAAOC,SAASC,KAAME,EAAM5C,OAAQ,QAC9CuD,EAAUZ,EAAUC,EAAMxC,IAAK,QAC/BsD,YAAMlB,OAAOC,SAASkB,2BAAhBC,EAAwBtL,QAAQ,MAAO,MAIxDuL,UACI,YAAY5N,WAMhB6N,MAAMrE,GACF,YAAYlK,IAAIkK,oBClQMA,EAAMwB,EAAQlB,EAAUJ,GAClD,MAAMoE,EAAS,IAAIzC,EAAO7B,EAAMwB,EAAQlB,EAAUJ,GAElD,OAAOF,EAAOsE,EAAO9N,WAAa8N"} \ No newline at end of file diff --git a/dist/index.m.js b/dist/index.m.js index 7195959b..0dab9497 100644 --- a/dist/index.m.js +++ b/dist/index.m.js @@ -1,2 +1 @@ -var t=Object.prototype.hasOwnProperty,e=Array.isArray,r=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),n=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var r=t.pop(),n=r.obj[r.prop];if(e(n)){for(var i=[],o=0;o=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122?o+=i.charAt(u):f<128?o+=r[f]:f<2048?o+=r[192|f>>6]+r[128|63&f]:f<55296||f>=57344?o+=r[224|f>>12]+r[128|f>>6&63]+r[128|63&f]:(f=65536+((1023&f)<<10|1023&i.charCodeAt(u+=1)),o+=r[240|f>>18]+r[128|f>>12&63]+r[128|f>>6&63]+r[128|63&f])}return o},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,r){if(e(t)){for(var n=[],i=0;i-1?t.split(","):t},E=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=r.depth>0&&/(\[[^[\]]*])/.exec(i),f=u?i.slice(0,u.index):i,a=[];if(f){if(!r.plainObjects&&m.call(Object.prototype,f)&&!r.allowPrototypes)return;a.push(f)}for(var s=0;r.depth>0&&null!==(u=o.exec(i))&&s=0;--o){var u,f=t[o];if("[]"===f&&r.parseArrays)u=[].concat(i);else{u=r.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,s=parseInt(a,10);r.parseArrays||""!==a?!isNaN(s)&&f!==a&&String(s)===a&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(u=[])[s]=i:u[a]=i:u={0:i}}i=u}return i}(a,e,r,n)}},S=function(t,e){var r=function(t){if(!t)return w;if(null!=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");return{allowDots:void 0===t.allowDots?w.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:w.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:w.arrayLimit,charset:void 0===t.charset?w.charset:t.charset,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:w.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:w.comma,decoder:"function"==typeof t.decoder?t.decoder:w.decoder,delimiter:"string"==typeof t.delimiter||i.isRegExp(t.delimiter)?t.delimiter:w.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:w.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:w.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:w.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:w.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:w.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},o=(e.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(e.delimiter,Infinity===e.parameterLimit?void 0:e.parameterLimit),u=-1,f=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(s=g(s)?[s]:s),n[a]=m.call(n,a)?i.combine(n[a],s):s}return n}(t,r):t,o=r.plainObjects?Object.create(null):{},u=Object.keys(n),f=0;f({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const e=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+e+"$").test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(e,r)=>{var n;if([null,void 0].includes(t[r])&&this.parameterSegments.find(({name:t})=>t===r).required)throw new Error("Ziggy error: '"+r+"' parameter is required for route '"+this.name+"'.");return encodeURIComponent(null!=(n=t[r])?n:"")}).replace(/\/+$/,""):this.template}}class R extends String{constructor(t,e,r=!0,n){var i;if(super(),this.t=null!=(i=null!=n?n:Ziggy)?i:null===globalThis||void 0===globalThis?void 0:globalThis.Ziggy,this.t={...this.t,absolute:r},t){if(!this.t.routes[t])throw new Error("Ziggy error: route '"+t+"' is not in the route list.");this.i=new N(t,this.t.routes[t],this.t),this.u=this.s(e)}}toString(){const t=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:e})=>e===t)).filter(t=>"_query"!==t).reduce((t,e)=>({...t,[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,e){var r,n=t,i=function(t){if(!t)return b;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||b.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=a.default;if(void 0!==t.format){if(!s.call(a.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=a.formatters[r],i=b.filter;return("function"==typeof t.filter||l(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===t.allowDots?b.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:b.charsetSentinel,delimiter:void 0===t.delimiter?b.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:b.encode,encoder:"function"==typeof t.encoder?t.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:b.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:b.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:b.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):l(i.filter)&&(r=i.filter);var o=[];if("object"!=typeof n||null===n)return"";var u=c[e&&e.arrayFormat in c?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices"];r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var f=0;f0?h+d:""}({...t,...this.u._query},{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,e)=>"boolean"==typeof t?Number(t):e(t)})}current(t,e){const r=this.t.absolute?window.location.host+window.location.pathname:window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,i]=Object.entries(this.t.routes).find(([e,n])=>new N(t,n,this.t).matchesUrl(r))||[void 0,void 0];if(!t)return n;const o=new RegExp("^"+t.replace(".","\\.").replace("*",".*")+"$").test(n);if([null,void 0].includes(e)||!o)return o;const u=new N(n,i,this.t);e=this.s(e,u);const f=this.l(i);return!(!Object.values(e).every(t=>!t)||Object.values(f).length)||Object.entries(e).every(([t,e])=>f[t]==e)}get params(){return this.l(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}s(t={},e=this.i){t=["string","number"].includes(typeof t)?[t]:t;const r=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(t)?t=t.reduce((t,e,n)=>{var i;return{...t,[null===(i=r[n])||void 0===i?void 0:i.name]:e}},{}):1!==r.length||t[r[0].name]||!t.hasOwnProperty(Object.values(e.bindings)[0])&&!t.hasOwnProperty("id")||(t={[r[0].name]:t}),{...this.p(e),...this.h(t,e.bindings)}}p(t){return t.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((t,{name:e},r)=>({...t,[e]:this.t.defaults[e]}),{})}h(t,e={}){return Object.entries(t).reduce((t,[r,n])=>{if(!n||"object"!=typeof n||Array.isArray(n)||"_query"===r)return{...t,[r]:n};if(!n.hasOwnProperty(e[r])){if(!n.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+r+"' parameter is missing route model binding key '"+e[r]+"'.");e[r]="id"}return{...t,[r]:n[e[r]]}},{})}l(t){var e;let r=window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const n=(t,e="",r)=>{const[n,i]=[t,e].map(t=>t.split(r));return i.reduce((t,e,r)=>/^{[^}?]+\??}$/.test(e)&&n[r]?{...t,[e.replace(/^{|\??}$/g,"")]:n[r]}:t,{})};return{...n(window.location.host,t.domain,"."),...n(r,t.uri,"/"),...S(null===(e=window.location.search)||void 0===e?void 0:e.replace(/^\?/,""))}}valueOf(){return this.toString()}check(t){return this.has(t)}}export default function(t,e,r,n){const i=new R(t,e,r,n);return t?i.toString():i} -//# sourceMappingURL=index.m.js.map +var t=Object.prototype.hasOwnProperty,e=Array.isArray,r=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),n=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var r=t.pop(),n=r.obj[r.prop];if(e(n)){for(var i=[],o=0;o=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122?o+=i.charAt(u):f<128?o+=r[f]:f<2048?o+=r[192|f>>6]+r[128|63&f]:f<55296||f>=57344?o+=r[224|f>>12]+r[128|f>>6&63]+r[128|63&f]:(f=65536+((1023&f)<<10|1023&i.charCodeAt(u+=1)),o+=r[240|f>>18]+r[128|f>>12&63]+r[128|f>>6&63]+r[128|63&f])}return o},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,r){if(e(t)){for(var n=[],i=0;i-1?t.split(","):t},E=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=r.depth>0&&/(\[[^[\]]*])/.exec(i),f=u?i.slice(0,u.index):i,a=[];if(f){if(!r.plainObjects&&m.call(Object.prototype,f)&&!r.allowPrototypes)return;a.push(f)}for(var s=0;r.depth>0&&null!==(u=o.exec(i))&&s=0;--o){var u,f=t[o];if("[]"===f&&r.parseArrays)u=[].concat(i);else{u=r.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,s=parseInt(a,10);r.parseArrays||""!==a?!isNaN(s)&&f!==a&&String(s)===a&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(u=[])[s]=i:u[a]=i:u={0:i}}i=u}return i}(a,e,r,n)}},S=function(t,e){var r=function(t){if(!t)return w;if(null!=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");return{allowDots:void 0===t.allowDots?w.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:w.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:w.arrayLimit,charset:void 0===t.charset?w.charset:t.charset,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:w.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:w.comma,decoder:"function"==typeof t.decoder?t.decoder:w.decoder,delimiter:"string"==typeof t.delimiter||i.isRegExp(t.delimiter)?t.delimiter:w.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:w.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:w.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:w.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:w.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:w.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},o=(e.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(e.delimiter,Infinity===e.parameterLimit?void 0:e.parameterLimit),u=-1,f=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(s=g(s)?[s]:s),n[a]=m.call(n,a)?i.combine(n[a],s):s}return n}(t,r):t,o=r.plainObjects?Object.create(null):{},u=Object.keys(n),f=0;f({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const e=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+e+"$").test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(e,r)=>{var n;if([null,void 0].includes(t[r])&&this.parameterSegments.find(({name:t})=>t===r).required)throw new Error("Ziggy error: '"+r+"' parameter is required for route '"+this.name+"'.");return encodeURIComponent(null!=(n=t[r])?n:"")}).replace(/\/+$/,""):this.template}}class R extends String{constructor(t,e,r=!0,n){var i;if(super(),this.t=null!=(i=null!=n?n:Ziggy)?i:null===globalThis||void 0===globalThis?void 0:globalThis.Ziggy,this.t={...this.t,absolute:r},t){if(!this.t.routes[t])throw new Error("Ziggy error: route '"+t+"' is not in the route list.");this.i=new N(t,this.t.routes[t],this.t),this.u=this.l(e)}}toString(){const t=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:e})=>e===t)).filter(t=>"_query"!==t).reduce((t,e)=>({...t,[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,e){var r,n=t,i=function(t){if(!t)return b;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||b.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=a.default;if(void 0!==t.format){if(!s.call(a.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=a.formatters[r],i=b.filter;return("function"==typeof t.filter||l(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===t.allowDots?b.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:b.charsetSentinel,delimiter:void 0===t.delimiter?b.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:b.encode,encoder:"function"==typeof t.encoder?t.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:b.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:b.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:b.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):l(i.filter)&&(r=i.filter);var o=[];if("object"!=typeof n||null===n)return"";var u=c[e&&e.arrayFormat in c?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices"];r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var f=0;f0?h+d:""}({...t,...this.u._query},{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,e)=>"boolean"==typeof t?Number(t):e(t)})}current(t,e){const r=this.t.absolute?window.location.host+window.location.pathname:window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,i]=Object.entries(this.t.routes).find(([e,n])=>new N(t,n,this.t).matchesUrl(r))||[void 0,void 0];if(!t)return n;const o=new RegExp("^"+t.replace(".","\\.").replace("*",".*")+"$").test(n);if([null,void 0].includes(e)||!o)return o;const u=new N(n,i,this.t);e=this.l(e,u);const f=this.p(i);return!(!Object.values(e).every(t=>!t)||Object.values(f).length)||Object.entries(e).every(([t,e])=>f[t]==e)}get params(){return this.p(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}l(t={},e=this.i){t=["string","number"].includes(typeof t)?[t]:t;const r=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(t)?t=t.reduce((t,e,n)=>{var i;return{...t,[null===(i=r[n])||void 0===i?void 0:i.name]:e}},{}):1!==r.length||t[r[0].name]||!t.hasOwnProperty(Object.values(e.bindings)[0])&&!t.hasOwnProperty("id")||(t={[r[0].name]:t}),{...this.h(e),...this.v(t,e.bindings)}}h(t){return t.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((t,{name:e},r)=>({...t,[e]:this.t.defaults[e]}),{})}v(t,e={}){return Object.entries(t).reduce((t,[r,n])=>{if(!n||"object"!=typeof n||Array.isArray(n)||"_query"===r)return{...t,[r]:n};if(!n.hasOwnProperty(e[r])){if(!n.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+r+"' parameter is missing route model binding key '"+e[r]+"'.");e[r]="id"}return{...t,[r]:n[e[r]]}},{})}p(t){var e;let r=window.location.pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const n=(t,e="",r)=>{const[n,i]=[t,e].map(t=>t.split(r));return i.reduce((t,e,r)=>/^{[^}?]+\??}$/.test(e)&&n[r]?{...t,[e.replace(/^{|\??}$/g,"")]:n[r]}:t,{})};return{...n(window.location.host,t.domain,"."),...n(r,t.uri,"/"),...S(null===(e=window.location.search)||void 0===e?void 0:e.replace(/^\?/,""))}}valueOf(){return this.toString()}check(t){return this.has(t)}}function T(t,e,r,n){const i=new R(t,e,r,n);return t?i.toString():i}export default T; diff --git a/dist/index.m.js.map b/dist/index.m.js.map deleted file mode 100644 index 7001f883..00000000 --- a/dist/index.m.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.m.js","sources":["../node_modules/qs/lib/utils.js","../node_modules/qs/lib/formats.js","../node_modules/qs/lib/stringify.js","../node_modules/qs/lib/parse.js","../src/js/Route.js","../src/js/Router.js","../src/js/index.js"],"sourcesContent":["'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar util = require('./utils');\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = util.assign(\n {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n }\n },\n Format\n);\n","'use strict';\n\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n }).join(',');\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix\n : prefix + (allowDots ? '.' + key : '[' + key + ']');\n\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.formatter,\n options.encodeValuesOnly,\n options.charset\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj; // eslint-disable-line no-param-reassign\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n","/**\n * A Laravel route. This class represents one route and its configuration and metadata.\n */\nexport default class Route {\n /**\n * @param {String} name - Route name.\n * @param {Object} definition - Route definition.\n * @param {Object} config - Ziggy configuration.\n */\n constructor(name, definition, config) {\n this.name = name;\n this.definition = definition;\n this.bindings = definition.bindings ?? {};\n this.config = config;\n }\n\n /**\n * Get a 'template' of the complete URL for this route.\n *\n * @example\n * https://{team}.ziggy.dev/user/{user}\n *\n * @return {String} Route template.\n */\n get template() {\n // If we're building just a path there's no origin, otherwise: if this route has a\n // domain configured we construct the origin with that, if not we use the app URL\n const origin = !this.config.absolute ? '' : this.definition.domain\n ? `${this.config.url.match(/^\\w+:\\/\\//)[0]}${this.definition.domain}${this.config.port ? `:${this.config.port}` : ''}`\n : this.config.url;\n\n return `${origin}/${this.definition.uri}`.replace(/\\/+$/, '');\n }\n\n /**\n * Get an array of objects representing the parameters that this route accepts.\n *\n * @example\n * [{ name: 'team', required: true }, { name: 'user', required: false }]\n *\n * @return {Array} Parameter segments.\n */\n get parameterSegments() {\n return this.template.match(/{[^}?]+\\??}/g)?.map((segment) => ({\n name: segment.replace(/{|\\??}/g, ''),\n required: !/\\?}$/.test(segment),\n })) ?? [];\n }\n\n /**\n * Get whether this route's template matches the given URL.\n *\n * @param {String} url - URL to check.\n * @return {Boolean} Whether this route matches.\n */\n matchesUrl(url) {\n if (!this.definition.methods.includes('GET')) return false;\n\n // Transform the route's template into a regex that will match a hydrated URL,\n // by replacing its parameter segments with matchers for parameter values\n const pattern = this.template\n .replace(/\\/{[^}?]*\\?}/g, '(\\/[^/?]+)?')\n .replace(/{[^}]+}/g, '[^/?]+')\n .replace(/^\\w+:\\/\\//, '');\n\n return new RegExp(`^${pattern}$`).test(url.replace(/\\/+$/, '').split('?').shift());\n }\n\n /**\n * Hydrate and return a complete URL for this route with the given parameters.\n *\n * @param {Object} params\n * @return {String}\n */\n compile(params) {\n if (!this.parameterSegments.length) return this.template;\n\n return this.template.replace(/{([^}?]+)\\??}/g, (_, segment) => {\n // If the parameter is missing but is not optional, throw an error\n if ([null, undefined].includes(params[segment]) && this.parameterSegments.find(({ name }) => name === segment).required) {\n throw new Error(`Ziggy error: '${segment}' parameter is required for route '${this.name}'.`)\n }\n\n return encodeURIComponent(params[segment] ?? '');\n }).replace(/\\/+$/, '');\n }\n}\n","import { parse, stringify } from 'qs';\nimport Route from './Route';\n\n/**\n * A collection of Laravel routes. This class constitutes Ziggy's main API.\n */\nexport default class Router extends String {\n /**\n * @param {String} name - Route name.\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @param {Boolean} absolute - Whether to include the URL origin.\n * @param {Object} config - Ziggy configuration.\n */\n constructor(name, params, absolute = true, config) {\n super();\n\n this._config = config ?? Ziggy ?? globalThis?.Ziggy;\n this._config = { ...this._config, absolute };\n\n if (name) {\n if (!this._config.routes[name]) {\n throw new Error(`Ziggy error: route '${name}' is not in the route list.`);\n }\n\n this._route = new Route(name, this._config.routes[name], this._config);\n this._params = this._parse(params);\n }\n }\n\n /**\n * Get the compiled URL string for the current route and parameters.\n *\n * @example\n * // with 'posts.show' route 'posts/{post}'\n * (new Router('posts.show', 1)).toString(); // 'https://ziggy.dev/posts/1'\n *\n * @return {String}\n */\n toString() {\n // Get parameters that don't correspond to any route segments to append them to the query\n const unhandled = Object.keys(this._params)\n .filter((key) => !this._route.parameterSegments.some(({ name }) => name === key))\n .filter((key) => key !== '_query')\n .reduce((result, current) => ({ ...result, [current]: this._params[current] }), {});\n\n return this._route.compile(this._params) + stringify({ ...unhandled, ...this._params['_query'] }, {\n addQueryPrefix: true,\n arrayFormat: 'indices',\n encodeValuesOnly: true,\n skipNulls: true,\n encoder: (value, encoder) => typeof value === 'boolean' ? Number(value) : encoder(value),\n });\n }\n\n /**\n * Get the name of the route matching the current window URL, or, given a route name\n * and parameters, check if the current window URL and parameters match that route.\n *\n * @example\n * // at URL https://ziggy.dev/posts/4 with 'posts.show' route 'posts/{post}'\n * route().current(); // 'posts.show'\n * route().current('posts.index'); // false\n * route().current('posts.show'); // true\n * route().current('posts.show', { post: 1 }); // false\n * route().current('posts.show', { post: 4 }); // true\n *\n * @param {String} name - Route name to check.\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @return {(Boolean|String|undefined)}\n */\n current(name, params) {\n const url = this._config.absolute\n ? window.location.host + window.location.pathname\n : window.location.pathname.replace(this._config.url.replace(/^\\w*:\\/\\/[^/]+/, ''), '').replace(/^\\/+/, '/');\n\n // Find the first route that matches the current URL\n const [current, route] = Object.entries(this._config.routes).find(\n ([_, route]) => new Route(name, route, this._config).matchesUrl(url)\n ) || [undefined, undefined];\n\n // If a name wasn't passed, return the name of the current route\n if (!name) return current;\n\n // Test the passed name against the current route, matching some\n // basic wildcards, e.g. passing `events.*` matches `events.show`\n const match = new RegExp(`^${name.replace('.', '\\\\.').replace('*', '.*')}$`).test(current);\n\n if ([null, undefined].includes(params) || !match) return match;\n\n const routeObject = new Route(current, route, this._config);\n\n params = this._parse(params, routeObject);\n const routeParams = this._dehydrate(route);\n\n // If the current window URL has no route parameters, and the passed parameters are empty, return true\n if (Object.values(params).every(p => !p) && !Object.values(routeParams).length) return true;\n\n // Check that all passed parameters match their values in the current window URL\n // Use weak equality because all values in the current window URL will be strings\n return Object.entries(params).every(([key, value]) => routeParams[key] == value);\n }\n\n /**\n * Get all parameter values from the current window URL.\n *\n * @example\n * // at URL https://tighten.ziggy.dev/posts/4?lang=en with 'posts.show' route 'posts/{post}' and domain '{team}.ziggy.dev'\n * route().params; // { team: 'tighten', post: 4, lang: 'en' }\n *\n * @return {Object}\n */\n get params() {\n return this._dehydrate(this._config.routes[this.current()]);\n }\n\n /**\n * Check whether the given route exists.\n *\n * @param {String} name\n * @return {Boolean}\n */\n has(name) {\n return Object.keys(this._config.routes).includes(name);\n }\n\n /**\n * Parse Laravel-style route parameters of any type into a normalized object.\n *\n * @example\n * // with route parameter names 'event' and 'venue'\n * _parse(1); // { event: 1 }\n * _parse({ event: 2, venue: 3 }); // { event: 2, venue: 3 }\n * _parse(['Taylor', 'Matt']); // { event: 'Taylor', venue: 'Matt' }\n * _parse([4, { uuid: 56789, name: 'Grand Canyon' }]); // { event: 4, venue: 56789 }\n *\n * @param {(String|Number|Array|Object)} params - Route parameters.\n * @param {Route} route - Route instance.\n * @return {Object} Normalized complete route parameters.\n */\n _parse(params = {}, route = this._route) {\n // If `params` is a string or integer, wrap it in an array\n params = ['string', 'number'].includes(typeof params) ? [params] : params;\n\n // Separate segments with and without defaults, and fill in the default values\n const segments = route.parameterSegments.filter(({ name }) => !this._config.defaults[name]);\n\n if (Array.isArray(params)) {\n // If the parameters are an array they have to be in order, so we can transform them into\n // an object by keying them with the template segment names in the order they appear\n params = params.reduce((result, current, i) => ({ ...result, [segments[i]?.name]: current }), {});\n } else if (\n segments.length === 1\n && !params[segments[0].name]\n && (params.hasOwnProperty(Object.values(route.bindings)[0]) || params.hasOwnProperty('id'))\n ) {\n // If there is only one template segment and `params` is an object, that object is\n // ambiguous—it could contain the parameter key and value, or it could be an object\n // representing just the value (e.g. a model); we can inspect it to find out, and\n // if it's just the parameter value, we can wrap it in an object with its key\n params = { [segments[0].name]: params };\n }\n\n return {\n ...this._defaults(route),\n ...this._substituteBindings(params, route.bindings),\n };\n }\n\n /**\n * Populate default parameters for the given route.\n *\n * @example\n * // with default parameters { locale: 'en', country: 'US' } and 'posts.show' route '{locale}/posts/{post}'\n * defaults(...); // { locale: 'en' }\n *\n * @param {Route} route\n * @return {Object} Default route parameters.\n */\n _defaults(route) {\n return route.parameterSegments.filter(({ name }) => this._config.defaults[name])\n .reduce((result, { name }, i) => ({ ...result, [name]: this._config.defaults[name] }), {});\n }\n\n /**\n * Substitute Laravel route model bindings in the given parameters.\n *\n * @example\n * _substituteBindings({ post: { id: 4, slug: 'hello-world', title: 'Hello, world!' } }, { post: 'slug' }); // { post: 'hello-world' }\n *\n * @param {Object} params - Route parameters.\n * @param {Object} bindings - Route model bindings.\n * @return {Object} Normalized route parameters.\n */\n _substituteBindings(params, bindings = {}) {\n return Object.entries(params).reduce((result, [key, value]) => {\n // If the value isn't an object, or if it's an object of explicit query\n // parameters, there's nothing to substitute so we return it as-is\n if (!value || typeof value !== 'object' || Array.isArray(value) || key === '_query') {\n return { ...result, [key]: value };\n }\n\n if (!value.hasOwnProperty(bindings[key])) {\n if (value.hasOwnProperty('id')) {\n // As a fallback, we still accept an 'id' key not explicitly registered as a binding\n bindings[key] = 'id';\n } else {\n throw new Error(`Ziggy error: object passed as '${key}' parameter is missing route model binding key '${bindings[key]}'.`)\n }\n }\n\n return { ...result, [key]: value[bindings[key]] };\n }, {});\n }\n\n /**\n * Get all parameters and their values from the current window URL, based on the given route definition.\n *\n * @example\n * // at URL https://tighten.ziggy.dev/events/8/venues/chicago?zoom=true\n * _dehydrate({ domain: '{team}.ziggy.dev', uri: 'events/{event}/venues/{venue?}' }); // { team: 'tighten', event: 8, venue: 'chicago', zoom: true }\n *\n * @param {Object} route - Route definition.\n * @return {Object} Parameters.\n */\n _dehydrate(route) {\n let pathname = window.location.pathname\n // If this Laravel app is in a subdirectory, trim the subdirectory from the path\n .replace(this._config.url.replace(/^\\w*:\\/\\/[^/]+/, ''), '')\n .replace(/^\\/+/, '');\n\n // Given part of a valid 'hydrated' URL containing all its parameter values,\n // a route template, and a delimiter, extract the parameters as an object\n // E.g. dehydrate('events/{event}/{venue}', 'events/2/chicago', '/'); // { event: 2, venue: 'chicago' }\n const dehydrate = (hydrated, template = '', delimiter) => {\n const [values, segments] = [hydrated, template].map(s => s.split(delimiter));\n\n return segments.reduce((result, current, i) => {\n // Only include template segments that are route parameters\n // AND have a value present in the passed hydrated string\n return /^{[^}?]+\\??}$/.test(current) && values[i]\n ? { ...result, [current.replace(/^{|\\??}$/g, '')]: values[i] }\n : result;\n }, {});\n }\n\n return {\n ...dehydrate(window.location.host, route.domain, '.'), // Domain parameters\n ...dehydrate(pathname, route.uri, '/'), // Path parameters\n ...parse(window.location.search?.replace(/^\\?/, '')), // Query parameters\n };\n }\n\n valueOf() {\n return this.toString();\n }\n\n /**\n * @deprecated since v1.0, use `has()` instead.\n */\n check(name) {\n return this.has(name);\n }\n}\n","import Router from './Router';\n\nexport default function route(name, params, absolute, config) {\n const router = new Router(name, params, absolute, config);\n\n return name ? router.toString() : router;\n}\n"],"names":["has","Object","prototype","hasOwnProperty","isArray","Array","hexTable","array","i","push","toString","toUpperCase","arrayToObject","source","options","obj","plainObjects","create","length","assign","target","keys","reduce","acc","key","combine","a","b","concat","compact","value","queue","o","prop","refs","item","j","val","indexOf","pop","compacted","compactQueue","decode","str","decoder","charset","strWithoutPlus","replace","unescape","decodeURIComponent","e","encode","defaultEncoder","string","Symbol","call","String","escape","$0","parseInt","slice","out","c","charCodeAt","charAt","isBuffer","constructor","isRegExp","maybeMap","fn","mapped","merge","allowPrototypes","mergeTarget","forEach","targetItem","percentTwenties","Format","RFC1738","RFC3986","util","default","formatters","arrayPrefixGenerators","brackets","prefix","comma","indices","repeat","pushToArray","arr","valueOrArray","apply","toISO","Date","toISOString","defaultFormat","formats","defaults","addQueryPrefix","allowDots","charsetSentinel","delimiter","encoder","utils","encodeValuesOnly","format","formatter","serializeDate","date","skipNulls","strictNullHandling","stringify","object","generateArrayPrefix","filter","sort","v","join","objKeys","values","keyPrefix","arrayLimit","depth","ignoreQueryPrefix","interpretNumericEntities","parameterLimit","parseArrays","numberStr","fromCharCode","parseArrayValue","split","parseKeys","givenKey","valuesParsed","child","segment","exec","parent","index","chain","leaf","root","cleanRoot","isNaN","0","parseObject","opts","TypeError","normalizeParseOptions","tempObj","parts","Infinity","undefined","skipIndex","part","bracketEqualsPos","pos","encodedVal","parseValues","newObj","Route","name","definition","config","this","bindings","template","absolute","domain","url","match","port","uri","parameterSegments","_this$template$match","map","required","test","matchesUrl","methods","includes","pattern","RegExp","shift","compile","params","_","find","Error","encodeURIComponent","Router","super","_config","Ziggy","globalThis","routes","_route","_params","_parse","unhandled","some","result","current","[object Object]","normalizeStringifyOptions","arrayFormat","joined","Number","window","location","host","pathname","route","entries","routeObject","routeParams","_dehydrate","every","p","segments","_segments$i","_defaults","_substituteBindings","dehydrate","hydrated","s","parse","search","_window$location$sear","valueOf","check","router"],"mappings":"AAEA,IAAIA,EAAMC,OAAOC,UAAUC,eACvBC,EAAUC,MAAMD,QAEhBE,EAAY,WAEZ,IADA,IAAIC,EAAQ,GACHC,EAAI,EAAGA,EAAI,MAAOA,EACvBD,EAAME,KAAK,MAAQD,EAAI,GAAK,IAAM,IAAMA,EAAEE,SAAS,KAAKC,eAG5D,OAAOJ,KAsBPK,EAAgB,SAAuBC,EAAQC,GAE/C,IADA,IAAIC,EAAMD,GAAWA,EAAQE,aAAef,OAAOgB,OAAO,MAAQ,GACzDT,EAAI,EAAGA,EAAIK,EAAOK,SAAUV,OACR,IAAdK,EA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MAAO,IACAsB,EAAUf,OAAOC,SAASC,KAAME,EAAM5C,OAAQ,QAC9CuD,EAAUZ,EAAUC,EAAMxC,IAAK,QAC/BsD,YAAMlB,OAAOC,SAASkB,2BAAhBC,EAAwBtL,QAAQ,MAAO,MAIxDuL,UACI,YAAY5N,WAMhB6N,MAAMrE,GACF,YAAYlK,IAAIkK,4BClQMA,EAAMwB,EAAQlB,EAAUJ,GAClD,MAAMoE,EAAS,IAAIzC,EAAO7B,EAAMwB,EAAQlB,EAAUJ,GAElD,OAAOF,EAAOsE,EAAO9N,WAAa8N"} \ No newline at end of file diff --git a/package.json b/package.json index 17ec5a96..ae2af2ae 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,9 @@ "url": "https://github.com/tighten/ziggy.git" }, "scripts": { - "build": "microbundle --name route --format modern,es,umd --external none", + "build": "microbundle --name route --format modern,es,umd --external none --no-sourcemap", "watch": "npm run build watch", - "build:npm": "microbundle --name route --format modern,es,umd", + "build:npm": "microbundle --name route --format modern,es,umd --no-sourcemap", "test": "jest", "prepublishOnly": "npm run build:npm" },