"use strict";(self.webpackChunkstudio_client=self.webpackChunkstudio_client||[]).push([[9014],{4066:(t,r,e)=>{e.d(r,{y:()=>g});var n=function(){return n=Object.assign||function(t){for(var r,e=1,n=arguments.length;e$)/g,""):"[a-zA-Z0-9-_.~%':|=+\\*@$]+")+")"},l=[{name:"url-parameter",pattern:/^:([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(t){return new RegExp(p(t[2]))}},{name:"url-parameter-splat",pattern:/^\*([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/,regex:/([^?]*)/},{name:"url-parameter-matrix",pattern:/^;([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(t){return new RegExp(";"+t[1]+"="+p(t[2]))}},{name:"query-parameter",pattern:/^(?:\?|&)(?::)?([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/},{name:"delimiter",pattern:/^(\/|\?)/,regex:function(t){return new RegExp("\\"+t[0])}},{name:"sub-delimiter",pattern:/^(!|&|-|_|\.|;)/,regex:function(t){return new RegExp(t[0])}},{name:"fragment",pattern:/^([0-9a-zA-Z]+)/,regex:function(t){return new RegExp(t[0])}}],h=function t(r,e){if(void 0===e&&(e=[]),!l.some((function(n){var a=r.match(n.pattern);return!!a&&(e.push({type:n.name,match:a[0],val:a.slice(1,2),otherVal:a.slice(2),regex:n.regex instanceof Function?n.regex(a):n.regex}),a[0].length0,this.hasSpatParam=this.tokens.filter((function(t){return/splat$/.test(t.type)})).length>0,this.hasMatrixParams=this.tokens.filter((function(t){return/matrix$/.test(t.type)})).length>0,this.hasQueryParams=this.tokens.filter((function(t){return/^query-parameter/.test(t.type)})).length>0,this.spatParams=this.getParams("url-parameter-splat"),this.urlParams=this.getParams(/^url-parameter/),this.queryParams=this.getParams("query-parameter"),this.params=this.urlParams.concat(this.queryParams),this.source=this.tokens.filter((function(t){return void 0!==t.regex})).map((function(t){return t.regex.source})).join("")}return t.createPath=function(r,e){return new t(r,e)},t.prototype.isQueryParam=function(t){return-1!==this.queryParams.indexOf(t)},t.prototype.isSpatParam=function(t){return-1!==this.spatParams.indexOf(t)},t.prototype.test=function(t,r){var e=this,i=n(n({caseSensitive:!1,strictTrailingSlash:!1},this.options),r),s=function(t,r){return r||"\\/"===t?t:t.replace(/\\\/$/,"")+"(?:\\/)?"}(this.source,i.strictTrailingSlash),u=this.urlTest(t,s+(this.hasQueryParams?"(\\?.*$|$)":"$"),i.caseSensitive,i.urlParamsEncoding);if(!u||!this.hasQueryParams)return u;var o=(0,a.Qc)(t,i.queryParams);return 0===Object.keys(o).filter((function(t){return!e.isQueryParam(t)})).length?(Object.keys(o).forEach((function(t){return u[t]=o[t]})),u):null},t.prototype.partialTest=function(t,r){var e=this,i=n(n({caseSensitive:!1,delimited:!0},this.options),r),s=function(t,r){return r?/(\/)$/.test(t)?t:t+"(\\/|\\?|\\.|;|$)":t}(this.source,i.delimited),u=this.urlTest(t,s,i.caseSensitive,i.urlParamsEncoding);if(!u)return u;if(!this.hasQueryParams)return u;var o=(0,a.Qc)(t,i.queryParams);return Object.keys(o).filter((function(t){return e.isQueryParam(t)})).forEach((function(t){return function(t,r,e){void 0===e&&(e="");var n=t[r];return t[r]=void 0===n?e:Array.isArray(n)?n.concat(e):[n,e],t}(u,t,o[t])})),u},t.prototype.build=function(t,r){var e=this;void 0===t&&(t={});var i=n(n({ignoreConstraints:!1,ignoreSearch:!1,queryParams:{}},this.options),r),s=Object.keys(t).filter((function(t){return!e.isQueryParam(t)})).reduce((function(r,n){if(!f(t[n]))return r;var a=t[n],s=e.isSpatParam(n);return"boolean"==typeof a?r[n]=a:Array.isArray(a)?r[n]=a.map((function(t){return c(t,i.urlParamsEncoding,s)})):r[n]=c(a,i.urlParamsEncoding,s),r}),{});if(this.urlParams.some((function(r){return!f(t[r])}))){var u=this.urlParams.filter((function(r){return!f(t[r])}));throw new Error("Cannot build path: '"+this.path+"' requires missing parameters { "+u.join(", ")+" }")}if(!i.ignoreConstraints&&!this.tokens.filter((function(t){return/^url-parameter/.test(t.type)&&!/-splat$/.test(t.type)})).every((function(t){return new RegExp("^"+p(t.otherVal[0])+"$").test(s[t.val])})))throw new Error("Some parameters of '"+this.path+"' are of invalid format");var o=this.tokens.filter((function(t){return!1===/^query-parameter/.test(t.type)})).map((function(t){return"url-parameter-matrix"===t.type?";"+t.val+"="+s[t.val[0]]:/^url-parameter/.test(t.type)?s[t.val[0]]:t.match})).join("");if(i.ignoreSearch)return o;var l=this.queryParams.filter((function(r){return-1!==Object.keys(t).indexOf(r)})).reduce((function(r,e){return r[e]=t[e],r}),{}),h=(0,a.J_)(l,i.queryParams);return h?o+"?"+h:o},t.prototype.getParams=function(t){var r=t instanceof RegExp?function(r){return t.test(r.type)}:function(r){return r.type===t};return this.tokens.filter(r).map((function(t){return t.val[0]}))},t.prototype.urlTest=function(t,r,e,n){var a=this,i=new RegExp("^"+r,e?"":"i"),s=t.match(i);return s?this.urlParams.length?s.slice(1,this.urlParams.length+1).reduce((function(t,r,e){return t[a.urlParams[e]]=(o[n]||decodeURIComponent)(r),t}),{}):{}:null},t}()}}]);