@nymphjs/tilmeld-setup 1.0.0-beta.120 → 1.0.0-beta.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app/index.js CHANGED
@@ -479,7 +479,7 @@
479
479
  * @param {Function} [fn]
480
480
  * @returns {void}
481
481
  */
482
- function push(props, runes = false, fn) {
482
+ function push$1(props, runes = false, fn) {
483
483
  component_context = {
484
484
  p: component_context,
485
485
  i: false,
@@ -497,7 +497,7 @@
497
497
  * @param {T} [component]
498
498
  * @returns {T}
499
499
  */
500
- function pop(component) {
500
+ function pop$1(component) {
501
501
  var context = /** @type {ComponentContext} */ (component_context);
502
502
  var effects = context.e;
503
503
 
@@ -5794,7 +5794,7 @@
5794
5794
  pending: () => {}
5795
5795
  },
5796
5796
  (anchor_node) => {
5797
- push({});
5797
+ push$1({});
5798
5798
  var ctx = /** @type {ComponentContext} */ (component_context);
5799
5799
  if (context) ctx.c = context;
5800
5800
 
@@ -5805,7 +5805,7 @@
5805
5805
  // @ts-expect-error the public typings are not what the actual function looks like
5806
5806
  component = Component(anchor_node, props) || {};
5807
5807
 
5808
- pop();
5808
+ pop$1();
5809
5809
  },
5810
5810
  transformError
5811
5811
  );
@@ -6664,8 +6664,8 @@
6664
6664
 
6665
6665
  if (effect.prev) effect.prev.next = effect.next;
6666
6666
  if (effect.next) effect.next.prev = effect.prev;
6667
- link(state, prev, effect);
6668
- link(state, effect, next);
6667
+ link$1(state, prev, effect);
6668
+ link$1(state, effect, next);
6669
6669
 
6670
6670
  move(effect, next, anchor);
6671
6671
  prev = effect;
@@ -6698,9 +6698,9 @@
6698
6698
  seen.delete(stashed[j]);
6699
6699
  }
6700
6700
 
6701
- link(state, a.prev, b.next);
6702
- link(state, prev, a);
6703
- link(state, b, start);
6701
+ link$1(state, a.prev, b.next);
6702
+ link$1(state, prev, a);
6703
+ link$1(state, b, start);
6704
6704
 
6705
6705
  current = start;
6706
6706
  prev = b;
@@ -6713,9 +6713,9 @@
6713
6713
  seen.delete(effect);
6714
6714
  move(effect, current, anchor);
6715
6715
 
6716
- link(state, effect.prev, effect.next);
6717
- link(state, effect, prev === null ? state.effect.first : prev.next);
6718
- link(state, prev, effect);
6716
+ link$1(state, effect.prev, effect.next);
6717
+ link$1(state, effect, prev === null ? state.effect.first : prev.next);
6718
+ link$1(state, prev, effect);
6719
6719
 
6720
6720
  prev = effect;
6721
6721
  }
@@ -6876,7 +6876,7 @@
6876
6876
  * @param {Effect | null} prev
6877
6877
  * @param {Effect | null} next
6878
6878
  */
6879
- function link(state, prev, next) {
6879
+ function link$1(state, prev, next) {
6880
6880
  if (prev === null) {
6881
6881
  state.effect.first = next;
6882
6882
  } else {
@@ -8494,28 +8494,667 @@
8494
8494
  ((window.__svelte ??= {}).v ??= new Set()).add(PUBLIC_VERSION);
8495
8495
  }
8496
8496
 
8497
- function getDefaultExportFromCjs (x) {
8498
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
8497
+ function parse(str, loose) {
8498
+ if (str instanceof RegExp) return { keys:false, pattern:str };
8499
+ var c, o, tmp, ext, keys=[], pattern='', arr = str.split('/');
8500
+ arr[0] || arr.shift();
8501
+
8502
+ while (tmp = arr.shift()) {
8503
+ c = tmp[0];
8504
+ if (c === '*') {
8505
+ keys.push('wild');
8506
+ pattern += '/(.*)';
8507
+ } else if (c === ':') {
8508
+ o = tmp.indexOf('?', 1);
8509
+ ext = tmp.indexOf('.', 1);
8510
+ keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );
8511
+ pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';
8512
+ if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext);
8513
+ } else {
8514
+ pattern += '/' + tmp;
8515
+ }
8516
+ }
8517
+
8518
+ return {
8519
+ keys: keys,
8520
+ pattern: new RegExp('^' + pattern + ('\/?$'), 'i')
8521
+ };
8522
+ }
8523
+
8524
+ class RouterStateImpl {
8525
+ #_loc = /** The current full location (incl. querystring) */
8526
+ state(getLocation());
8527
+
8528
+ get _loc() {
8529
+ return get(this.#_loc);
8530
+ }
8531
+
8532
+ set _loc(value) {
8533
+ set(this.#_loc, value);
8534
+ }
8535
+
8536
+ #_location = user_derived(() => this._loc.location);
8537
+
8538
+ get _location() {
8539
+ return get(this.#_location);
8540
+ }
8541
+
8542
+ set _location(value) {
8543
+ set(this.#_location, value);
8544
+ }
8545
+
8546
+ #_querystring = user_derived(() => this._loc.querystring);
8547
+
8548
+ get _querystring() {
8549
+ return get(this.#_querystring);
8550
+ }
8551
+
8552
+ set _querystring(value) {
8553
+ set(this.#_querystring, value);
8554
+ }
8555
+
8556
+ #_params = state(undefined);
8557
+
8558
+ get _params() {
8559
+ return get(this.#_params);
8560
+ }
8561
+
8562
+ set _params(value) {
8563
+ set(this.#_params, value);
8564
+ }
8565
+
8566
+ get loc() {
8567
+ return this._loc;
8568
+ }
8569
+
8570
+ /** The current location (excluding querystring) */
8571
+ get location() {
8572
+ return this._location;
8573
+ }
8574
+
8575
+ /** The current querystring */
8576
+ get querystring() {
8577
+ return this._querystring;
8578
+ }
8579
+
8580
+ get params() {
8581
+ return this._params;
8582
+ }
8583
+
8584
+ constructor() {
8585
+ if (typeof window !== "undefined") {
8586
+ window.addEventListener("hashchange", () => {
8587
+ this._loc = getLocation();
8588
+ });
8589
+ } else {
8590
+ // eslint-disable-next-line no-console
8591
+ console.warn("[svelte-spa-router] window 'window' is not defined, skipping initiation");
8592
+ }
8593
+ }
8594
+ }
8595
+
8596
+ /** Router state object, containing the current location, querystring and params. */
8597
+ const router = new RouterStateImpl();
8598
+
8599
+ /** Returns the current location from the hash. */
8600
+ function getLocation() {
8601
+ const currentHref = typeof window !== "undefined" ? window.location.href : "";
8602
+ const hashPosition = currentHref.indexOf("#/");
8603
+ let location = hashPosition > -1 ? currentHref.substr(hashPosition + 1) : "/";
8604
+
8605
+ // Check if there's a querystring
8606
+ const qsPosition = location.indexOf("?");
8607
+
8608
+ let querystring = "";
8609
+
8610
+ if (qsPosition > -1) {
8611
+ querystring = location.substr(qsPosition + 1);
8612
+ location = location.substr(0, qsPosition);
8613
+ }
8614
+
8615
+ return { location, querystring };
8499
8616
  }
8500
8617
 
8501
- var navigo_min$1 = {exports: {}};
8618
+ /**
8619
+ * Navigates to a new page programmatically.
8620
+ *
8621
+ * @param location - Path to navigate to (must start with `/` or `#/`)
8622
+ * @returns Promise that resolves after the page navigation has completed
8623
+ */
8624
+ async function push(location) {
8625
+ if (!location || location.length < 1 || location.charAt(0) != "/" && location.indexOf("#/") !== 0) {
8626
+ throw Error("Invalid parameter location");
8627
+ }
8502
8628
 
8503
- var navigo_min = navigo_min$1.exports;
8629
+ // Execute this code when the current call stack is complete
8630
+ await tick();
8504
8631
 
8505
- var hasRequiredNavigo_min;
8632
+ // Note: this will include scroll state in history even when restoreScrollState is false
8633
+ history.replaceState(
8634
+ {
8635
+ ...history.state,
8636
+ __svelte_spa_router_scrollX: window.scrollX,
8637
+ __svelte_spa_router_scrollY: window.scrollY
8638
+ },
8639
+ ""
8640
+ );
8506
8641
 
8507
- function requireNavigo_min () {
8508
- if (hasRequiredNavigo_min) return navigo_min$1.exports;
8509
- hasRequiredNavigo_min = 1;
8510
- (function (module, exports) {
8511
- !function(t,n){module.exports=n();}("undefined"!=typeof self?self:navigo_min,(function(){return function(){var t={407:function(t,n,e){e.d(n,{default:function(){return N}});var o=/([:*])(\w+)/g,r=/\*/g,i=/\/\?/g;function a(t){return void 0===t&&(t="/"),v()?location.pathname+location.search+location.hash:t}function s(t){return t.replace(/\/+$/,"").replace(/^\/+/,"")}function c(t){return "string"==typeof t}function u(t){return t&&t.indexOf("#")>=0&&t.split("#").pop()||""}function h(t){var n=s(t).split(/\?(.*)?$/);return [s(n[0]),n.slice(1).join("")]}function f(t){for(var n={},e=t.split("&"),o=0;o<e.length;o++){var r=e[o].split("=");if(""!==r[0]){var i=decodeURIComponent(r[0]);n[i]?(Array.isArray(n[i])||(n[i]=[n[i]]),n[i].push(decodeURIComponent(r[1]||""))):n[i]=decodeURIComponent(r[1]||"");}}return n}function l(t,n){var e,a=h(s(t.currentLocationPath)),l=a[0],p=a[1],d=""===p?null:f(p),v=[];if(c(n.path)){if(e="(?:/^|^)"+s(n.path).replace(o,(function(t,n,e){return v.push(e),"([^/]+)"})).replace(r,"?(?:.*)").replace(i,"/?([^/]+|)")+"$",""===s(n.path)&&""===s(l))return {url:l,queryString:p,hashString:u(t.to),route:n,data:null,params:d}}else e=n.path;var g=new RegExp(e,""),m=l.match(g);if(m){var y=c(n.path)?function(t,n){return 0===n.length?null:t?t.slice(1,t.length).reduce((function(t,e,o){return null===t&&(t={}),t[n[o]]=decodeURIComponent(e),t}),null):null}(m,v):m.groups?m.groups:m.slice(1);return {url:s(l.replace(new RegExp("^"+t.instance.root),"")),queryString:p,hashString:u(t.to),route:n,data:y,params:d}}return false}function p(){return !("undefined"==typeof window||!window.history||!window.history.pushState)}function d(t,n){return void 0===t[n]||true===t[n]}function v(){return "undefined"!=typeof window}function g(t,n){return void 0===t&&(t=[]),void 0===n&&(n={}),t.filter((function(t){return t})).forEach((function(t){["before","after","already","leave"].forEach((function(e){t[e]&&(n[e]||(n[e]=[]),n[e].push(t[e]));}));})),n}function m(t,n,e){var o=n||{},r=0;!function n(){t[r]?Array.isArray(t[r])?(t.splice.apply(t,[r,1].concat(t[r][0](o)?t[r][1]:t[r][2])),n()):t[r](o,(function(t){ void 0===t||true===t?(r+=1,n()):e&&e(o);})):e&&e(o);}();}function y(t,n){ void 0===t.currentLocationPath&&(t.currentLocationPath=t.to=a(t.instance.root)),t.currentLocationPath=t.instance._checkForAHash(t.currentLocationPath),n();}function _(t,n){for(var e=0;e<t.instance.routes.length;e++){var o=l(t,t.instance.routes[e]);if(o&&(t.matches||(t.matches=[]),t.matches.push(o),"ONE"===t.resolveOptions.strategy))return void n()}n();}function k(t,n){t.navigateOptions&&(void 0!==t.navigateOptions.shouldResolve&&console.warn('"shouldResolve" is deprecated. Please check the documentation.'),void 0!==t.navigateOptions.silent&&console.warn('"silent" is deprecated. Please check the documentation.')),n();}function O(t,n){ true===t.navigateOptions.force?(t.instance._setCurrent([t.instance._pathToMatchObject(t.to)]),n(false)):n();}m.if=function(t,n,e){return Array.isArray(n)||(n=[n]),Array.isArray(e)||(e=[e]),[t,n,e]};var w=v(),L=p();function b(t,n){if(d(t.navigateOptions,"updateBrowserURL")){var e=("/"+t.to).replace(/\/\//g,"/"),o=w&&t.resolveOptions&&true===t.resolveOptions.hash;L?(history[t.navigateOptions.historyAPIMethod||"pushState"](t.navigateOptions.stateObj||{},t.navigateOptions.title||"",o?"#"+e:e),location&&location.hash&&(t.instance.__freezeListening=true,setTimeout((function(){if(!o){var n=location.hash;location.hash="",location.hash=n;}t.instance.__freezeListening=false;}),1))):w&&(window.location.href=t.to);}n();}function A(t,n){var e=t.instance;e.lastResolved()?m(e.lastResolved().map((function(n){return function(e,o){if(n.route.hooks&&n.route.hooks.leave){var r=false,i=t.instance.matchLocation(n.route.path,t.currentLocationPath,false);r="*"!==n.route.path?!i:!(t.matches&&t.matches.find((function(t){return n.route.path===t.route.path}))),d(t.navigateOptions,"callHooks")&&r?m(n.route.hooks.leave.map((function(n){return function(e,o){return n((function(n){ false===n?t.instance.__markAsClean(t):o();}),t.matches&&t.matches.length>0?1===t.matches.length?t.matches[0]:t.matches:void 0)}})).concat([function(){return o()}])):o();}else o();}})),{},(function(){return n()})):n();}function P(t,n){d(t.navigateOptions,"updateState")&&t.instance._setCurrent(t.matches),n();}var R=[function(t,n){var e=t.instance.lastResolved();if(e&&e[0]&&e[0].route===t.match.route&&e[0].url===t.match.url&&e[0].queryString===t.match.queryString)return e.forEach((function(n){n.route.hooks&&n.route.hooks.already&&d(t.navigateOptions,"callHooks")&&n.route.hooks.already.forEach((function(n){return n(t.match)}));})),void n(false);n();},function(t,n){t.match.route.hooks&&t.match.route.hooks.before&&d(t.navigateOptions,"callHooks")?m(t.match.route.hooks.before.map((function(n){return function(e,o){return n((function(n){ false===n?t.instance.__markAsClean(t):o();}),t.match)}})).concat([function(){return n()}])):n();},function(t,n){d(t.navigateOptions,"callHandler")&&t.match.route.handler(t.match),t.instance.updatePageLinks(),n();},function(t,n){t.match.route.hooks&&t.match.route.hooks.after&&d(t.navigateOptions,"callHooks")&&t.match.route.hooks.after.forEach((function(n){return n(t.match)})),n();}],S=[A,function(t,n){var e=t.instance._notFoundRoute;if(e){t.notFoundHandled=true;var o=h(t.currentLocationPath),r=o[0],i=o[1],a=u(t.to);e.path=s(r);var c={url:e.path,queryString:i,hashString:a,data:null,route:e,params:""!==i?f(i):null};t.matches=[c],t.match=c;}n();},m.if((function(t){return t.notFoundHandled}),R.concat([P]),[function(t,n){t.resolveOptions&&false!==t.resolveOptions.noMatchWarning&&void 0!==t.resolveOptions.noMatchWarning||console.warn('Navigo: "'+t.currentLocationPath+"\" didn't match any of the registered routes."),n();},function(t,n){t.instance._setCurrent(null),n();}])];function E(){return (E=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);}return t}).apply(this,arguments)}function x(t,n){var e=0;A(t,(function o(){e!==t.matches.length?m(R,E({},t,{match:t.matches[e]}),(function(){e+=1,o();})):P(t,n);}));}function H(t){t.instance.__markAsClean(t);}function j(){return (j=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);}return t}).apply(this,arguments)}var C="[data-navigo]";function N(t,n){var e,o=n||{strategy:"ONE",hash:false,noMatchWarning:false,linksSelector:C},r=this,i="/",d=null,w=[],L=false,A=p(),P=v();function R(t){return t.indexOf("#")>=0&&(t=true===o.hash?t.split("#")[1]||"/":t.split("#")[0]),t}function E(t){return s(i+"/"+s(t))}function N(t,n,e,o){return t=c(t)?E(t):t,{name:o||s(String(t)),path:t,handler:n,hooks:g(e)}}function U(t,n){if(!r.__dirty){r.__dirty=true,t=t?s(i)+"/"+s(t):void 0;var e={instance:r,to:t,currentLocationPath:t,navigateOptions:{},resolveOptions:j({},o,n)};return m([y,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),x,S)],e,H),!!e.matches&&e.matches}r.__waiting.push((function(){return r.resolve(t,n)}));}function q(t,n){if(r.__dirty)r.__waiting.push((function(){return r.navigate(t,n)}));else {r.__dirty=true,t=s(i)+"/"+s(t);var e={instance:r,to:t,navigateOptions:n||{},resolveOptions:n&&n.resolveOptions?n.resolveOptions:o,currentLocationPath:R(t)};m([k,O,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),x,S),b,H],e,H);}}function F(){if(P)return (P?[].slice.call(document.querySelectorAll(o.linksSelector||C)):[]).forEach((function(t){"false"!==t.getAttribute("data-navigo")&&"_blank"!==t.getAttribute("target")?t.hasListenerAttached||(t.hasListenerAttached=true,t.navigoHandler=function(n){if((n.ctrlKey||n.metaKey)&&"a"===n.target.tagName.toLowerCase())return false;var e=t.getAttribute("href");if(null==e)return false;if(e.match(/^(http|https)/)&&"undefined"!=typeof URL)try{var o=new URL(e);e=o.pathname+o.search;}catch(t){}var i=function(t){if(!t)return {};var n,e=t.split(","),o={};return e.forEach((function(t){var e=t.split(":").map((function(t){return t.replace(/(^ +| +$)/g,"")}));switch(e[0]){case "historyAPIMethod":o.historyAPIMethod=e[1];break;case "resolveOptionsStrategy":n||(n={}),n.strategy=e[1];break;case "resolveOptionsHash":n||(n={}),n.hash="true"===e[1];break;case "updateBrowserURL":case "callHandler":case "updateState":case "force":o[e[0]]="true"===e[1];}})),n&&(o.resolveOptions=n),o}(t.getAttribute("data-navigo-options"));L||(n.preventDefault(),n.stopPropagation(),r.navigate(s(e),i));},t.addEventListener("click",t.navigoHandler)):t.hasListenerAttached&&t.removeEventListener("click",t.navigoHandler);})),r}function I(t,n,e){var o=w.find((function(n){return n.name===t})),r=null;if(o){if(r=o.path,n)for(var a in n)r=r.replace(":"+a,n[a]);r=r.match(/^\//)?r:"/"+r;}return r&&e&&!e.includeRoot&&(r=r.replace(new RegExp("^/"+i),"")),r}function M(t){var n=h(s(t)),o=n[0],r=n[1],i=""===r?null:f(r);return {url:o,queryString:r,hashString:u(t),route:N(o,(function(){}),[e],o),data:null,params:i}}function T(t,n,e){return "string"==typeof n&&(n=z(n)),n?(n.hooks[t]||(n.hooks[t]=[]),n.hooks[t].push(e),function(){n.hooks[t]=n.hooks[t].filter((function(t){return t!==e}));}):(console.warn("Route doesn't exists: "+n),function(){})}function z(t){return "string"==typeof t?w.find((function(n){return n.name===E(t)})):w.find((function(n){return n.handler===t}))}t?i=s(t):console.warn('Navigo requires a root path in its constructor. If not provided will use "/" as default.'),this.root=i,this.routes=w,this.destroyed=L,this.current=d,this.__freezeListening=false,this.__waiting=[],this.__dirty=false,this.__markAsClean=function(t){t.instance.__dirty=false,t.instance.__waiting.length>0&&t.instance.__waiting.shift()();},this.on=function(t,n,o){var r=this;return "object"!=typeof t||t instanceof RegExp?("function"==typeof t&&(o=n,n=t,t=i),w.push(N(t,n,[e,o])),this):(Object.keys(t).forEach((function(n){if("function"==typeof t[n])r.on(n,t[n]);else {var o=t[n],i=o.uses,a=o.as,s=o.hooks;w.push(N(n,i,[e,s],a));}})),this)},this.off=function(t){return this.routes=w=w.filter((function(n){return c(t)?s(n.path)!==s(t):"function"==typeof t?t!==n.handler:String(n.path)!==String(t)})),this},this.resolve=U,this.navigate=q,this.navigateByName=function(t,n,e){var o=I(t,n);return null!==o&&(q(o.replace(new RegExp("^/?"+i),""),e),true)},this.destroy=function(){this.routes=w=[],A&&window.removeEventListener("popstate",this.__popstateListener),this.destroyed=L=true;},this.notFound=function(t,n){return r._notFoundRoute=N("*",t,[e,n],"__NOT_FOUND__"),this},this.updatePageLinks=F,this.link=function(t){return "/"+i+"/"+s(t)},this.hooks=function(t){return e=t,this},this.extractGETParameters=function(t){return h(R(t))},this.lastResolved=function(){return d},this.generate=I,this.getLinkPath=function(t){return t.getAttribute("href")},this.match=function(t){var n={instance:r,currentLocationPath:t,to:t,resolveOptions:o};return _(n,(function(){})),!!n.matches&&n.matches},this.matchLocation=function(t,n,e){ void 0===n||void 0!==e&&!e||(n=E(n));var o={instance:r,to:n,currentLocationPath:n};return y(o,(function(){})),"string"==typeof t&&(t=void 0===e||e?E(t):t),l(o,{name:String(t),path:t,handler:function(){},hooks:{}})||false},this.getCurrentLocation=function(){return M(s(a(i)).replace(new RegExp("^"+i),""))},this.addBeforeHook=T.bind(this,"before"),this.addAfterHook=T.bind(this,"after"),this.addAlreadyHook=T.bind(this,"already"),this.addLeaveHook=T.bind(this,"leave"),this.getRoute=z,this._pathToMatchObject=M,this._clean=s,this._checkForAHash=R,this._setCurrent=function(t){return d=r.current=t},function(){A&&(this.__popstateListener=function(){r.__freezeListening||U();},window.addEventListener("popstate",this.__popstateListener));}.call(this),F.call(this);}}},n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{}};return t[o](r,r.exports,e),r.exports}return e.d=function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:true,get:n[o]});},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e(407)}().default}));
8512
-
8513
- } (navigo_min$1));
8514
- return navigo_min$1.exports;
8642
+ window.location.hash = (location.charAt(0) == "#" ? "" : "#") + location;
8515
8643
  }
8516
8644
 
8517
- var navigo_minExports = requireNavigo_min();
8518
- var Navigo = /*@__PURE__*/getDefaultExportFromCjs(navigo_minExports);
8645
+ /**
8646
+ * Navigates back in history (equivalent to pressing the browser's back button).
8647
+ *
8648
+ * @returns Promise that resolves after the page navigation has completed
8649
+ */
8650
+ async function pop() {
8651
+ // Execute this code when the current call stack is complete
8652
+ await tick();
8653
+
8654
+ window.history.back();
8655
+ }
8656
+
8657
+ /**
8658
+ * Replaces the current page but without modifying the history stack.
8659
+ *
8660
+ * @param location - Path to navigate to (must start with `/` or `#/`)
8661
+ * @returns Promise that resolves after the page navigation has completed
8662
+ */
8663
+ async function replace(location) {
8664
+ if (!location || location.length < 1 || location.charAt(0) != "/" && location.indexOf("#/") !== 0) {
8665
+ throw Error("Invalid parameter location");
8666
+ }
8667
+
8668
+ // Execute this code when the current call stack is complete
8669
+ await tick();
8670
+
8671
+ const dest = (location.charAt(0) == "#" ? "" : "#") + location;
8672
+
8673
+ try {
8674
+ const newState = { ...history.state };
8675
+
8676
+ delete newState["__svelte_spa_router_scrollX"];
8677
+ delete newState["__svelte_spa_router_scrollY"];
8678
+ window.history.replaceState(newState, "", dest);
8679
+ } catch {
8680
+ // eslint-disable-next-line no-console
8681
+ console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.");
8682
+ }
8683
+
8684
+ // The method above doesn't trigger the hashchange event, so let's do that manually
8685
+ window.dispatchEvent(new Event("hashchange"));
8686
+ }
8687
+
8688
+ /**
8689
+ * Svelte Action that enables a link element (`<a>`) to use our history management.
8690
+ *
8691
+ * For example:
8692
+ *
8693
+ * ```html
8694
+ * <a href="/books" use:link>View books</a>
8695
+ * ```
8696
+ */
8697
+ function link(node, opts) {
8698
+ let currentOpts = linkOpts(opts);
8699
+
8700
+ // Only apply to <a> tags
8701
+ if (!node || !node.tagName || node.tagName.toLowerCase() != "a") {
8702
+ throw Error("Action \"link\" can only be used with <a> tags");
8703
+ }
8704
+
8705
+ // Set initial href
8706
+ updateLinkHref(node, currentOpts);
8707
+
8708
+ // Add click handler once, using currentOpts reference
8709
+ const clickHandler = (event) => {
8710
+ event.preventDefault();
8711
+
8712
+ if (!currentOpts.disabled) {
8713
+ const target = event.currentTarget;
8714
+ const href = target ? target.getAttribute("href") : null;
8715
+
8716
+ if (href) {
8717
+ scrollstateHistoryHandler(href);
8718
+ }
8719
+ }
8720
+ };
8721
+
8722
+ node.addEventListener("click", clickHandler);
8723
+
8724
+ return {
8725
+ update(updated) {
8726
+ currentOpts = linkOpts(updated);
8727
+ updateLinkHref(node, currentOpts);
8728
+ },
8729
+
8730
+ destroy() {
8731
+ node.removeEventListener("click", clickHandler);
8732
+ }
8733
+ };
8734
+ }
8735
+
8736
+ /** Tries to restore the scroll state from the given history state. */
8737
+ function restoreScroll(state) {
8738
+ // If this exists, then this is a back navigation: restore the scroll position
8739
+ if (state) {
8740
+ window.scrollTo(state.__svelte_spa_router_scrollX || 0, state.__svelte_spa_router_scrollY || 0);
8741
+ } else {
8742
+ // Otherwise this is a forward navigation: scroll to top
8743
+ window.scrollTo(0, 0);
8744
+ }
8745
+ }
8746
+
8747
+ // Internal function used by the link function to update href attribute
8748
+ function updateLinkHref(node, opts) {
8749
+ let href = opts.href || node.getAttribute("href");
8750
+
8751
+ // Destination must start with '/' or '#/'
8752
+ if (href && href.charAt(0) == "/") {
8753
+ // Add # to the href attribute
8754
+ href = "#" + href;
8755
+ } else if (!href || href.length < 2 || href.slice(0, 2) != "#/") {
8756
+ throw Error("Invalid value for \"href\" attribute: " + href);
8757
+ }
8758
+
8759
+ node.setAttribute("href", href);
8760
+ }
8761
+
8762
+ // Internal function that ensures the argument of the link action is always an object
8763
+ function linkOpts(val) {
8764
+ if (typeof val == "string") {
8765
+ return { href: val };
8766
+ }
8767
+
8768
+ return val || {};
8769
+ }
8770
+
8771
+ /**
8772
+ * The handler attached to an anchor tag responsible for updating the
8773
+ * current history state with the current scroll state.
8774
+ */
8775
+ function scrollstateHistoryHandler(href) {
8776
+ // Setting the url (3rd arg) to href will break clicking for reasons, so don't try to do that
8777
+ history.replaceState(
8778
+ {
8779
+ ...history.state,
8780
+ __svelte_spa_router_scrollX: window.scrollX,
8781
+ __svelte_spa_router_scrollY: window.scrollY
8782
+ },
8783
+ ""
8784
+ );
8785
+
8786
+ // This will force an update as desired, but this time our scroll state will be attached
8787
+ window.location.hash = href;
8788
+ }
8789
+
8790
+ function Router($$anchor, $$props) {
8791
+ push$1($$props, true);
8792
+
8793
+ const routes = prop($$props, 'routes', 19, () => ({})),
8794
+ prefix = prop($$props, 'prefix', 3, ""),
8795
+ restoreScrollState = prop($$props, 'restoreScrollState', 3, false),
8796
+ onConditionsFailed = prop($$props, 'onConditionsFailed', 3, () => {}),
8797
+ onRouteLoaded = prop($$props, 'onRouteLoaded', 3, () => {}),
8798
+ onRouteLoading = prop($$props, 'onRouteLoading', 3, () => {}),
8799
+ onRouteEvent = prop($$props, 'onRouteEvent', 3, () => {});
8800
+
8801
+ /** Container for a route: path, component */
8802
+ class RouteItem {
8803
+ path;
8804
+ component;
8805
+ conditions;
8806
+ userData;
8807
+ props;
8808
+ _pattern;
8809
+ _keys;
8810
+
8811
+ constructor(path, component) {
8812
+ // The _sveltesparouter marker is set by `wrap()` via Object.defineProperty and is intentionally absent from the public WrappedComponent type
8813
+ const isWrapped = (c) => typeof c == "object" && c !== null && c._sveltesparouter === true;
8814
+
8815
+ if (!component || typeof component != "function" && !isWrapped(component)) {
8816
+ throw Error("Invalid component object");
8817
+ }
8818
+
8819
+ // Path must be a regular expression, or a string starting with '/' or '*'
8820
+ if (!path || typeof path == "string" && (path.length < 1 || path.charAt(0) != "/" && path.charAt(0) != "*") || typeof path == "object" && !(path instanceof RegExp)) {
8821
+ throw Error("Invalid value for \"path\" argument - strings must start with / or *");
8822
+ }
8823
+
8824
+ const parsed = typeof path == "string" ? parse(path) : parse(path);
8825
+
8826
+ this.path = path;
8827
+
8828
+ // Check if the component is wrapped and we have conditions
8829
+ if (isWrapped(component)) {
8830
+ const wrapped = component;
8831
+
8832
+ this.component = wrapped.component;
8833
+ this.conditions = wrapped.conditions || [];
8834
+ this.userData = wrapped.userData;
8835
+ this.props = wrapped.props || {};
8836
+ } else {
8837
+ const sync = component;
8838
+
8839
+ this.component = () => Promise.resolve(sync);
8840
+ this.conditions = [];
8841
+ this.props = {};
8842
+ }
8843
+
8844
+ this._pattern = parsed.pattern;
8845
+ this._keys = parsed.keys;
8846
+ }
8847
+
8848
+ /**
8849
+ * Checks if `path` matches the current route.
8850
+ * Returns the list of parameters from the URL, or `null` if no match.
8851
+ */
8852
+ match(path) {
8853
+ // If there's a prefix, check if it matches the start of the path
8854
+ // If not, bail early, else remove it before we run the matching
8855
+ if (prefix()) {
8856
+ if (typeof prefix() == "string") {
8857
+ if (path.startsWith(prefix())) {
8858
+ path = path.substr(prefix().length) || "/";
8859
+ } else {
8860
+ return null;
8861
+ }
8862
+ } else if (prefix() instanceof RegExp) {
8863
+ const m = path.match(prefix());
8864
+
8865
+ if (m && m[0]) {
8866
+ path = path.substr(m[0].length) || "/";
8867
+ } else {
8868
+ return null;
8869
+ }
8870
+ }
8871
+ }
8872
+
8873
+ // Check if the pattern matches
8874
+ const matches = this._pattern.exec(path);
8875
+
8876
+ if (matches === null) {
8877
+ return null;
8878
+ }
8879
+
8880
+ // If the input was a regular expression, _keys is false; return matches as is
8881
+ if (this._keys === false) {
8882
+ return matches;
8883
+ }
8884
+
8885
+ const out = {};
8886
+ let i = 0;
8887
+
8888
+ while (i < this._keys.length) {
8889
+ // URL-decode all values
8890
+ try {
8891
+ out[this._keys[i]] = decodeURIComponent(matches[i + 1] || "") || null;
8892
+ } catch {
8893
+ out[this._keys[i]] = null;
8894
+ }
8895
+
8896
+ i++;
8897
+ }
8898
+
8899
+ return out;
8900
+ }
8901
+
8902
+ /** Executes all conditions in order; returns false at the first failure. */
8903
+ async checkConditions(detail) {
8904
+ for (let i = 0; i < this.conditions.length; i++) {
8905
+ if (!await this.conditions[i](detail)) {
8906
+ return false;
8907
+ }
8908
+ }
8909
+
8910
+ return true;
8911
+ }
8912
+ }
8913
+
8914
+ // Set up all routes
8915
+ const routesList = [];
8916
+
8917
+ // svelte-ignore state_referenced_locally
8918
+ // routes are static, initial capture is intended
8919
+ if (routes() instanceof Map) {
8920
+ routes().forEach((route, path) => {
8921
+ routesList.push(new RouteItem(path, route));
8922
+ });
8923
+ } else {
8924
+ Object.keys(routes()).forEach((path) => {
8925
+ const map = routes();
8926
+
8927
+ routesList.push(new RouteItem(path, map[path]));
8928
+ });
8929
+ }
8930
+
8931
+ // State declarations for the currently-rendered route
8932
+ let component$1 = state(null);
8933
+
8934
+ let componentParams = state(null);
8935
+ let routeProps = state({});
8936
+ let previousScrollState = null;
8937
+ let componentObj = null;
8938
+
8939
+ // Effects
8940
+ user_effect(() => {
8941
+ history.scrollRestoration = restoreScrollState() ? "manual" : "auto";
8942
+ });
8943
+
8944
+ user_effect(() => {
8945
+ if (!restoreScrollState()) {
8946
+ return;
8947
+ }
8948
+
8949
+ const popStateChanged = (event) => {
8950
+ if (event.state && (event.state.__svelte_spa_router_scrollY || event.state.__svelte_spa_router_scrollX)) {
8951
+ previousScrollState = event.state;
8952
+ } else {
8953
+ previousScrollState = null;
8954
+ }
8955
+ };
8956
+
8957
+ window.addEventListener("popstate", popStateChanged);
8958
+
8959
+ return () => window.removeEventListener("popstate", popStateChanged);
8960
+ });
8961
+
8962
+ async function dispatchNextTick(event, detail) {
8963
+ // Execute this code when the current call stack is complete
8964
+ await tick();
8965
+
8966
+ event(detail);
8967
+ }
8968
+
8969
+ user_effect(() => {
8970
+ // React to loc changing and untrack everything else to prevent accidental dependencies
8971
+ // Cancel operation after async work in case a new loc change happened in the meantime
8972
+ const newLoc = router.loc;
8973
+
8974
+ let cancelled = false;
8975
+
8976
+ untrack(async () => {
8977
+ let i = 0;
8978
+
8979
+ while (i < routesList.length) {
8980
+ const match = routesList[i].match(newLoc.location);
8981
+
8982
+ if (!match) {
8983
+ i++;
8984
+
8985
+ continue;
8986
+ }
8987
+
8988
+ const matchParams = matchToParams(match);
8989
+
8990
+ const detail = {
8991
+ route: routesList[i].path,
8992
+ location: newLoc.location,
8993
+ querystring: newLoc.querystring || "",
8994
+ userData: routesList[i].userData,
8995
+ params: matchParams
8996
+ };
8997
+
8998
+ if (!await routesList[i].checkConditions(detail)) {
8999
+ if (cancelled) {
9000
+ return;
9001
+ }
9002
+
9003
+ set(component$1, null);
9004
+ componentObj = null;
9005
+ dispatchNextTick(onConditionsFailed(), detail);
9006
+
9007
+ return;
9008
+ }
9009
+
9010
+ if (cancelled) {
9011
+ return;
9012
+ }
9013
+
9014
+ dispatchNextTick(onRouteLoading(), { ...detail });
9015
+
9016
+ const obj = routesList[i].component;
9017
+
9018
+ if (componentObj != obj) {
9019
+ if (obj.loading) {
9020
+ set(component$1, obj.loading);
9021
+ componentObj = obj;
9022
+ set(componentParams, obj.loadingParams || null);
9023
+ set(routeProps, {});
9024
+
9025
+ const comp = obj.loading;
9026
+
9027
+ dispatchNextTick(onRouteLoaded(), {
9028
+ ...detail,
9029
+ component: comp,
9030
+ name: comp.name,
9031
+ params: obj.loadingParams || null
9032
+ });
9033
+ } else {
9034
+ set(component$1, null);
9035
+ componentObj = null;
9036
+ }
9037
+
9038
+ const loaded = await obj();
9039
+
9040
+ if (cancelled) {
9041
+ return;
9042
+ }
9043
+
9044
+ set(component$1, loaded && typeof loaded == "object" && "default" in loaded ? loaded.default : loaded);
9045
+ componentObj = obj;
9046
+ }
9047
+
9048
+ set(componentParams, matchParams);
9049
+ set(routeProps, routesList[i].props);
9050
+
9051
+ const comp = get(component$1);
9052
+
9053
+ if (comp) {
9054
+ dispatchNextTick(onRouteLoaded(), {
9055
+ ...detail,
9056
+ component: comp,
9057
+ name: comp.name,
9058
+ params: matchParams
9059
+ });
9060
+ }
9061
+
9062
+ router._params = matchParams;
9063
+
9064
+ if (restoreScrollState()) {
9065
+ restoreScroll(previousScrollState);
9066
+ previousScrollState = null;
9067
+ }
9068
+
9069
+ return;
9070
+ }
9071
+
9072
+ set(component$1, null);
9073
+ componentObj = null;
9074
+ router._params = undefined;
9075
+
9076
+ if (restoreScrollState()) {
9077
+ restoreScroll(previousScrollState);
9078
+ previousScrollState = null;
9079
+ }
9080
+ });
9081
+
9082
+ return () => {
9083
+ cancelled = true;
9084
+ };
9085
+ });
9086
+
9087
+ function matchToParams(match) {
9088
+ // Preserve all keys, including null values for unmatched optional params
9089
+ return match && typeof match == "object" && Object.keys(match).length ? match : null;
9090
+ }
9091
+
9092
+ var fragment = comment();
9093
+ var node_1 = first_child(fragment);
9094
+
9095
+ {
9096
+ var consequent_1 = ($$anchor) => {
9097
+ const Component = user_derived(() => get(component$1));
9098
+ var fragment_1 = comment();
9099
+ var node_2 = first_child(fragment_1);
9100
+
9101
+ {
9102
+ var consequent = ($$anchor) => {
9103
+ var fragment_2 = comment();
9104
+ var node_3 = first_child(fragment_2);
9105
+
9106
+ component(node_3, () => get(Component), ($$anchor, Component_1) => {
9107
+ Component_1($$anchor, spread_props(
9108
+ {
9109
+ get params() {
9110
+ return get(componentParams);
9111
+ },
9112
+
9113
+ get onRouteEvent() {
9114
+ return onRouteEvent();
9115
+ }
9116
+ },
9117
+ () => get(routeProps)
9118
+ ));
9119
+ });
9120
+
9121
+ append($$anchor, fragment_2);
9122
+ };
9123
+
9124
+ var alternate = ($$anchor) => {
9125
+ var fragment_3 = comment();
9126
+ var node_4 = first_child(fragment_3);
9127
+
9128
+ component(node_4, () => get(Component), ($$anchor, Component_2) => {
9129
+ Component_2($$anchor, spread_props(
9130
+ {
9131
+ get onRouteEvent() {
9132
+ return onRouteEvent();
9133
+ }
9134
+ },
9135
+ () => get(routeProps)
9136
+ ));
9137
+ });
9138
+
9139
+ append($$anchor, fragment_3);
9140
+ };
9141
+
9142
+ if_block(node_2, ($$render) => {
9143
+ if (get(componentParams)) $$render(consequent); else $$render(alternate, -1);
9144
+ });
9145
+ }
9146
+
9147
+ append($$anchor, fragment_1);
9148
+ };
9149
+
9150
+ if_block(node_1, ($$render) => {
9151
+ if (get(component$1)) $$render(consequent_1);
9152
+ });
9153
+ }
9154
+
9155
+ append($$anchor, fragment);
9156
+ pop$1();
9157
+ }
8519
9158
 
8520
9159
  function classMap(classObj) {
8521
9160
  return Object.entries(classObj)
@@ -8903,7 +9542,7 @@
8903
9542
  var root_1$l = from_html(`<div><div class="mdc-circular-progress__determinate-container"><svg class="mdc-circular-progress__determinate-circle-graphic" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><circle class="mdc-circular-progress__determinate-track" cx="24" cy="24" r="18" stroke-width="4"></circle><circle></circle></svg></div> <div class="mdc-circular-progress__indeterminate-container"></div></div>`);
8904
9543
 
8905
9544
  function CircularProgress($$anchor, $$props) {
8906
- push($$props, true);
9545
+ push$1($$props, true);
8907
9546
 
8908
9547
  /**
8909
9548
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -9096,7 +9735,7 @@
9096
9735
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
9097
9736
  append($$anchor, div);
9098
9737
 
9099
- return pop($$exports);
9738
+ return pop$1($$exports);
9100
9739
  }
9101
9740
 
9102
9741
  /**
@@ -10663,7 +11302,7 @@
10663
11302
  var root_1$k = from_html(`<div><div><div><!> <!></div></div> <div></div></div> <!>`, 1);
10664
11303
 
10665
11304
  function Dialog($$anchor, $$props) {
10666
- push($$props, true);
11305
+ push$1($$props, true);
10667
11306
  const $aboveFullscreenShown = () => store_get(aboveFullscreenShown, '$aboveFullscreenShown', $$stores);
10668
11307
  const [$$stores, $$cleanup] = setup_stores();
10669
11308
  const { FocusTrap } = domFocusTrap;
@@ -11132,7 +11771,7 @@
11132
11771
 
11133
11772
  append($$anchor, fragment);
11134
11773
 
11135
- var $$pop = pop($$exports);
11774
+ var $$pop = pop$1($$exports);
11136
11775
 
11137
11776
  $$cleanup();
11138
11777
 
@@ -11151,7 +11790,7 @@
11151
11790
  ]);
11152
11791
 
11153
11792
  function CommonLabel($$anchor, $$props) {
11154
- push($$props, true);
11793
+ push$1($$props, true);
11155
11794
 
11156
11795
  /**
11157
11796
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -11243,7 +11882,7 @@
11243
11882
 
11244
11883
  append($$anchor, fragment);
11245
11884
 
11246
- return pop($$exports);
11885
+ return pop$1($$exports);
11247
11886
  }
11248
11887
 
11249
11888
  var rest_excludes$U = new Set([
@@ -11259,7 +11898,7 @@
11259
11898
  ]);
11260
11899
 
11261
11900
  function CommonIcon($$anchor, $$props) {
11262
- push($$props, true);
11901
+ push$1($$props, true);
11263
11902
 
11264
11903
  /**
11265
11904
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -11348,14 +11987,14 @@
11348
11987
 
11349
11988
  append($$anchor, fragment);
11350
11989
 
11351
- return pop($$exports);
11990
+ return pop$1($$exports);
11352
11991
  }
11353
11992
 
11354
11993
  var rest_excludes$T = new Set(['$$slots', '$$events', '$$legacy', 'use', 'tag', 'children']);
11355
11994
  var root$K = from_svg(`<svg><!></svg>`);
11356
11995
 
11357
11996
  function SmuiElement($$anchor, $$props) {
11358
- push($$props, true);
11997
+ push$1($$props, true);
11359
11998
 
11360
11999
  /**
11361
12000
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -11450,14 +12089,14 @@
11450
12089
 
11451
12090
  append($$anchor, fragment);
11452
12091
 
11453
- return pop($$exports);
12092
+ return pop$1($$exports);
11454
12093
  }
11455
12094
 
11456
12095
  var rest_excludes$S = new Set(['$$slots', '$$events', '$$legacy', 'use', 'children']);
11457
12096
  var root$J = from_svg(`<svg><!></svg>`);
11458
12097
 
11459
12098
  function Svg($$anchor, $$props) {
11460
- push($$props, true);
12099
+ push$1($$props, true);
11461
12100
 
11462
12101
  if (console && console.warn) {
11463
12102
  console.warn('The @smui/common Svg component is deprecated. You can use `tag="svg"` now.');
@@ -11490,11 +12129,11 @@
11490
12129
  action(svg, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
11491
12130
  append($$anchor, svg);
11492
12131
 
11493
- return pop($$exports);
12132
+ return pop$1($$exports);
11494
12133
  }
11495
12134
 
11496
12135
  function ContextFragment($$anchor, $$props) {
11497
- push($$props, true);
12136
+ push$1($$props, true);
11498
12137
  const [$$stores, $$cleanup] = setup_stores();
11499
12138
 
11500
12139
  // svelte-ignore state_referenced_locally
@@ -11516,7 +12155,7 @@
11516
12155
 
11517
12156
  snippet(node, () => $$props.children ?? noop);
11518
12157
  append($$anchor, fragment);
11519
- pop();
12158
+ pop$1();
11520
12159
  $$cleanup();
11521
12160
  }
11522
12161
 
@@ -11536,7 +12175,7 @@
11536
12175
  ]);
11537
12176
 
11538
12177
  function ClassAdder($$anchor, $$props) {
11539
- push($$props, true);
12178
+ push$1($$props, true);
11540
12179
 
11541
12180
  /**
11542
12181
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -11661,13 +12300,13 @@
11661
12300
 
11662
12301
  append($$anchor, fragment);
11663
12302
 
11664
- return pop($$exports);
12303
+ return pop$1($$exports);
11665
12304
  }
11666
12305
 
11667
12306
  var rest_excludes$Q = new Set(['$$slots', '$$events', '$$legacy', 'children']);
11668
12307
 
11669
12308
  function Title$1($$anchor, $$props) {
11670
- push($$props, true);
12309
+ push$1($$props, true);
11671
12310
 
11672
12311
  let restProps = rest_props($$props, rest_excludes$Q);
11673
12312
  let element;
@@ -11698,13 +12337,13 @@
11698
12337
  () => element
11699
12338
  );
11700
12339
 
11701
- return pop($$exports);
12340
+ return pop$1($$exports);
11702
12341
  }
11703
12342
 
11704
12343
  var rest_excludes$P = new Set(['$$slots', '$$events', '$$legacy', 'children']);
11705
12344
 
11706
12345
  function Content$1($$anchor, $$props) {
11707
- push($$props, true);
12346
+ push$1($$props, true);
11708
12347
 
11709
12348
  let restProps = rest_props($$props, rest_excludes$P);
11710
12349
  let element;
@@ -11730,13 +12369,13 @@
11730
12369
  () => element
11731
12370
  );
11732
12371
 
11733
- return pop($$exports);
12372
+ return pop$1($$exports);
11734
12373
  }
11735
12374
 
11736
12375
  var rest_excludes$O = new Set(['$$slots', '$$events', '$$legacy', 'children']);
11737
12376
 
11738
12377
  function Actions($$anchor, $$props) {
11739
- push($$props, true);
12378
+ push$1($$props, true);
11740
12379
 
11741
12380
  let restProps = rest_props($$props, rest_excludes$O);
11742
12381
  let element;
@@ -11773,7 +12412,7 @@
11773
12412
  () => element
11774
12413
  );
11775
12414
 
11776
- return pop($$exports);
12415
+ return pop$1($$exports);
11777
12416
  }
11778
12417
 
11779
12418
  const { applyPassive } = events;
@@ -12097,7 +12736,7 @@
12097
12736
  var root_1$j = from_html(`<label><!></label>`);
12098
12737
 
12099
12738
  function FloatingLabel($$anchor, $$props) {
12100
- push($$props, true);
12739
+ push$1($$props, true);
12101
12740
 
12102
12741
  /**
12103
12742
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -12330,7 +12969,7 @@
12330
12969
 
12331
12970
  append($$anchor, fragment);
12332
12971
 
12333
- return pop($$exports);
12972
+ return pop$1($$exports);
12334
12973
  }
12335
12974
 
12336
12975
  /**
@@ -12451,7 +13090,7 @@
12451
13090
  var root$H = from_html(`<div></div>`);
12452
13091
 
12453
13092
  function LineRipple($$anchor, $$props) {
12454
- push($$props, true);
13093
+ push$1($$props, true);
12455
13094
 
12456
13095
  /**
12457
13096
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -12564,7 +13203,7 @@
12564
13203
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
12565
13204
  append($$anchor, div);
12566
13205
 
12567
- return pop($$exports);
13206
+ return pop$1($$exports);
12568
13207
  }
12569
13208
 
12570
13209
  /**
@@ -12689,7 +13328,7 @@
12689
13328
  var root_1$i = from_html(`<div><div class="mdc-notched-outline__leading"></div> <!> <div class="mdc-notched-outline__trailing"></div></div>`);
12690
13329
 
12691
13330
  function NotchedOutline($$anchor, $$props) {
12692
- push($$props, true);
13331
+ push$1($$props, true);
12693
13332
 
12694
13333
  /**
12695
13334
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -12843,7 +13482,7 @@
12843
13482
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
12844
13483
  append($$anchor, div);
12845
13484
 
12846
- return pop($$exports);
13485
+ return pop$1($$exports);
12847
13486
  }
12848
13487
 
12849
13488
  /**
@@ -13605,7 +14244,7 @@
13605
14244
  var rest_excludes$K = new Set(['$$slots', '$$events', '$$legacy', 'children']);
13606
14245
 
13607
14246
  function HelperLine($$anchor, $$props) {
13608
- push($$props, true);
14247
+ push$1($$props, true);
13609
14248
 
13610
14249
  let restProps = rest_props($$props, rest_excludes$K);
13611
14250
  let element;
@@ -13631,13 +14270,13 @@
13631
14270
  () => element
13632
14271
  );
13633
14272
 
13634
- return pop($$exports);
14273
+ return pop$1($$exports);
13635
14274
  }
13636
14275
 
13637
14276
  var rest_excludes$J = new Set(['$$slots', '$$events', '$$legacy', 'children']);
13638
14277
 
13639
14278
  function Prefix($$anchor, $$props) {
13640
- push($$props, true);
14279
+ push$1($$props, true);
13641
14280
 
13642
14281
  let restProps = rest_props($$props, rest_excludes$J);
13643
14282
  let element;
@@ -13670,13 +14309,13 @@
13670
14309
  () => element
13671
14310
  );
13672
14311
 
13673
- return pop($$exports);
14312
+ return pop$1($$exports);
13674
14313
  }
13675
14314
 
13676
14315
  var rest_excludes$I = new Set(['$$slots', '$$events', '$$legacy', 'children']);
13677
14316
 
13678
14317
  function Suffix($$anchor, $$props) {
13679
- push($$props, true);
14318
+ push$1($$props, true);
13680
14319
 
13681
14320
  let restProps = rest_props($$props, rest_excludes$I);
13682
14321
  let element;
@@ -13709,7 +14348,7 @@
13709
14348
  () => element
13710
14349
  );
13711
14350
 
13712
- return pop($$exports);
14351
+ return pop$1($$exports);
13713
14352
  }
13714
14353
 
13715
14354
  var rest_excludes$H = new Set([
@@ -13733,7 +14372,7 @@
13733
14372
  var root$F = from_html(`<input/>`);
13734
14373
 
13735
14374
  function Input($$anchor, $$props) {
13736
- push($$props, true);
14375
+ push$1($$props, true);
13737
14376
 
13738
14377
  /**
13739
14378
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -13931,7 +14570,7 @@
13931
14570
  action(input, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
13932
14571
  append($$anchor, input);
13933
14572
 
13934
- return pop($$exports);
14573
+ return pop$1($$exports);
13935
14574
  /**
13936
14575
  * An array of Action or [Action, ActionProps] to be applied to the element.
13937
14576
  */
@@ -13993,7 +14632,7 @@
13993
14632
  var root$E = from_html(`<textarea></textarea>`);
13994
14633
 
13995
14634
  function Textarea($$anchor, $$props) {
13996
- push($$props, true);
14635
+ push$1($$props, true);
13997
14636
 
13998
14637
  /**
13999
14638
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -14110,7 +14749,7 @@
14110
14749
  effect(() => bind_value(textarea, value));
14111
14750
  append($$anchor, textarea);
14112
14751
 
14113
- return pop($$exports);
14752
+ return pop$1($$exports);
14114
14753
  /**
14115
14754
  * An array of Action or [Action, ActionProps] to be applied to the element.
14116
14755
  */
@@ -14190,7 +14829,7 @@
14190
14829
  var root_5$a = from_html(`<div><!> <!> <!> <!> <!></div>`);
14191
14830
 
14192
14831
  function Textfield($$anchor, $$props) {
14193
- push($$props, true);
14832
+ push$1($$props, true);
14194
14833
 
14195
14834
  const { applyPassive } = events;
14196
14835
  let uninitializedValue = () => {};
@@ -15321,7 +15960,7 @@
15321
15960
 
15322
15961
  append($$anchor, fragment);
15323
15962
 
15324
- return pop($$exports);
15963
+ return pop$1($$exports);
15325
15964
  }
15326
15965
 
15327
15966
  let counter$4 = 0;
@@ -15341,7 +15980,7 @@
15341
15980
  var root$C = from_html(`<div><!></div>`);
15342
15981
 
15343
15982
  function HelperText($$anchor, $$props) {
15344
- push($$props, true);
15983
+ push$1($$props, true);
15345
15984
 
15346
15985
  /**
15347
15986
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -15499,7 +16138,7 @@
15499
16138
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
15500
16139
  append($$anchor, div);
15501
16140
 
15502
- return pop($$exports);
16141
+ return pop$1($$exports);
15503
16142
  }
15504
16143
 
15505
16144
  var rest_excludes$D = new Set([
@@ -15526,7 +16165,7 @@
15526
16165
  var root_1$g = from_html(`<div class="mdc-button__ripple"></div> <!><!>`, 1);
15527
16166
 
15528
16167
  function Button($$anchor, $$props) {
15529
- push($$props, true);
16168
+ push$1($$props, true);
15530
16169
 
15531
16170
  /**
15532
16171
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -15759,7 +16398,7 @@
15759
16398
 
15760
16399
  append($$anchor, fragment);
15761
16400
 
15762
- return pop($$exports);
16401
+ return pop$1($$exports);
15763
16402
  }
15764
16403
 
15765
16404
  function preventDefault(fn) {
@@ -16028,7 +16667,7 @@
16028
16667
  var root$A = from_html(`<div><input/> <div class="mdc-checkbox__background"><svg class="mdc-checkbox__checkmark" viewBox="0 0 24 24"><path class="mdc-checkbox__checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path></svg> <div class="mdc-checkbox__mixedmark"></div></div> <div class="mdc-checkbox__ripple"></div></div>`);
16029
16668
 
16030
16669
  function Checkbox($$anchor, $$props) {
16031
- push($$props, true);
16670
+ push$1($$props, true);
16032
16671
 
16033
16672
  let uninitializedValue = () => {};
16034
16673
 
@@ -16409,7 +17048,7 @@
16409
17048
 
16410
17049
  append($$anchor, div);
16411
17050
 
16412
- return pop($$exports);
17051
+ return pop$1($$exports);
16413
17052
  /**
16414
17053
  * An array of Action or [Action, ActionProps] to be applied to the element.
16415
17054
  */
@@ -16585,7 +17224,7 @@
16585
17224
  var root$z = from_html(`<div><!> <label><!></label></div>`);
16586
17225
 
16587
17226
  function FormField($$anchor, $$props) {
16588
- push($$props, true);
17227
+ push$1($$props, true);
16589
17228
 
16590
17229
  /**
16591
17230
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -16711,7 +17350,7 @@
16711
17350
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
16712
17351
  append($$anchor, div);
16713
17352
 
16714
- return pop($$exports);
17353
+ return pop$1($$exports);
16715
17354
  }
16716
17355
 
16717
17356
  var rest_excludes$A = new Set([
@@ -16738,7 +17377,7 @@
16738
17377
  var root_5$9 = from_html(`<!> <!> <!>`, 1);
16739
17378
 
16740
17379
  function ChangePassword($$anchor, $$props) {
16741
- push($$props, true);
17380
+ push$1($$props, true);
16742
17381
 
16743
17382
  const $user = () => store_get(user(), '$user', $$stores);
16744
17383
  const [$$stores, $$cleanup] = setup_stores();
@@ -17174,7 +17813,7 @@
17174
17813
  }
17175
17814
 
17176
17815
  append($$anchor, fragment);
17177
- pop();
17816
+ pop$1();
17178
17817
  $$cleanup();
17179
17818
  }
17180
17819
 
@@ -17199,7 +17838,7 @@
17199
17838
  var root_4$9 = from_html(`<!> <!> <!>`, 1);
17200
17839
 
17201
17840
  function RevokeTokens($$anchor, $$props) {
17202
- push($$props, true);
17841
+ push$1($$props, true);
17203
17842
 
17204
17843
  const $user = () => store_get(user(), '$user', $$stores);
17205
17844
  const [$$stores, $$cleanup] = setup_stores();
@@ -17521,7 +18160,7 @@
17521
18160
  }
17522
18161
 
17523
18162
  append($$anchor, fragment);
17524
- pop();
18163
+ pop$1();
17525
18164
  $$cleanup();
17526
18165
  }
17527
18166
 
@@ -17570,7 +18209,7 @@
17570
18209
  );
17571
18210
 
17572
18211
  function TwoFactor($$anchor, $$props) {
17573
- push($$props, true);
18212
+ push$1($$props, true);
17574
18213
 
17575
18214
  const $user = () => store_get(user(), '$user', $$stores);
17576
18215
  const [$$stores, $$cleanup] = setup_stores();
@@ -18308,7 +18947,7 @@
18308
18947
  }
18309
18948
 
18310
18949
  append($$anchor, fragment);
18311
- pop();
18950
+ pop$1();
18312
18951
  $$cleanup();
18313
18952
  }
18314
18953
 
@@ -18335,7 +18974,7 @@
18335
18974
  var root_7$7 = from_html(`<!> <!> <!> <!>`, 1);
18336
18975
 
18337
18976
  function Account($$anchor, $$props) {
18338
- push($$props, true);
18977
+ push$1($$props, true);
18339
18978
 
18340
18979
  const $user = () => store_get(user(), '$user', $$stores);
18341
18980
  const $clientConfig = () => store_get(clientConfig(), '$clientConfig', $$stores);
@@ -18475,14 +19114,11 @@
18475
19114
  }
18476
19115
 
18477
19116
  try {
18478
- if (await $user().$save()) {
18479
- originalEmail = $user().email;
18480
- open(false);
18481
- set(usernameVerifiedMessage, undefined);
18482
- set(emailVerifiedMessage, undefined);
18483
- } else {
18484
- set(failureMessage, 'Error saving account changes.');
18485
- }
19117
+ await $user().$save();
19118
+ originalEmail = $user().email;
19119
+ open(false);
19120
+ set(usernameVerifiedMessage, undefined);
19121
+ set(emailVerifiedMessage, undefined);
18486
19122
  } catch(e) {
18487
19123
  set(failureMessage, e?.message, true);
18488
19124
  }
@@ -19153,7 +19789,7 @@
19153
19789
  }
19154
19790
 
19155
19791
  append($$anchor, fragment);
19156
- pop();
19792
+ pop$1();
19157
19793
  $$cleanup();
19158
19794
  }
19159
19795
 
@@ -22027,7 +22663,9 @@
22027
22663
  async $delete() {
22028
22664
  this.$check();
22029
22665
  const guid = this.guid;
22030
- return (await this.$nymph.deleteEntity(this)) === guid;
22666
+ if ((await this.$nymph.deleteEntity(this)) !== guid) {
22667
+ throw new Error('Failed to delete entity.');
22668
+ }
22031
22669
  }
22032
22670
  $equals(object) {
22033
22671
  this.$check();
@@ -22122,7 +22760,9 @@
22122
22760
  this.$check();
22123
22761
  const mdate = this.mdate;
22124
22762
  await this.$nymph.patchEntity(this);
22125
- return mdate !== this.mdate;
22763
+ if (mdate === this.mdate) {
22764
+ throw new Error('Failed to patch entity.');
22765
+ }
22126
22766
  }
22127
22767
  /**
22128
22768
  * Check if this is a sleeping reference and throw an error if so.
@@ -22228,8 +22868,11 @@
22228
22868
  type: '&',
22229
22869
  guid: this.guid,
22230
22870
  });
22871
+ if (data == null) {
22872
+ throw new Error("The entity's data could not be refreshed.");
22873
+ }
22231
22874
  this.$init(data);
22232
- return this.guid == null ? 0 : true;
22875
+ return true;
22233
22876
  }
22234
22877
  $removeTag(...tags) {
22235
22878
  this.$check();
@@ -22238,7 +22881,9 @@
22238
22881
  async $save() {
22239
22882
  this.$check();
22240
22883
  await this.$nymph.saveEntity(this);
22241
- return !!this.guid;
22884
+ if (!this.guid) {
22885
+ throw new Error('Failed to save entity.');
22886
+ }
22242
22887
  }
22243
22888
  async $serverCall(method, params, stateless = false) {
22244
22889
  this.$check();
@@ -23076,12 +23721,12 @@
23076
23721
  });
23077
23722
  if (plural && Array.isArray(entity) && entity.length === response.length) {
23078
23723
  return entity.map((e, i) => response[i] &&
23079
- typeof response[i].guid !== 'undefined' &&
23724
+ response[i].guid != null &&
23080
23725
  (e.guid == null || e.guid === response[i].guid)
23081
23726
  ? e.$init(response[i])
23082
23727
  : e);
23083
23728
  }
23084
- else if (!Array.isArray(entity) && typeof response.guid !== 'undefined') {
23729
+ else if (!Array.isArray(entity) && response.guid != null) {
23085
23730
  return entity.$init(response);
23086
23731
  }
23087
23732
  throw new Error('Server error');
@@ -23920,7 +24565,7 @@
23920
24565
  var root$t = from_html(`<div><input/> <div class="mdc-radio__background"><div class="mdc-radio__outer-circle"></div> <div class="mdc-radio__inner-circle"></div></div> <div class="mdc-radio__ripple"></div></div>`);
23921
24566
 
23922
24567
  function Radio($$anchor, $$props) {
23923
- push($$props, true);
24568
+ push$1($$props, true);
23924
24569
 
23925
24570
  const binding_group = [];
23926
24571
  let uninitializedValue = () => {};
@@ -24141,7 +24786,7 @@
24141
24786
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
24142
24787
  append($$anchor, div);
24143
24788
 
24144
- return pop($$exports);
24789
+ return pop$1($$exports);
24145
24790
  }
24146
24791
 
24147
24792
  var rest_excludes$v = new Set([
@@ -24183,7 +24828,7 @@
24183
24828
  var root_10$3 = from_html(`<!> <!>`, 1);
24184
24829
 
24185
24830
  function Recover($$anchor, $$props) {
24186
- push($$props, true);
24831
+ push$1($$props, true);
24187
24832
 
24188
24833
  const $clientConfig = () => store_get(clientConfig(), '$clientConfig', $$stores);
24189
24834
  const [$$stores, $$cleanup] = setup_stores();
@@ -24907,7 +25552,7 @@
24907
25552
  }
24908
25553
 
24909
25554
  append($$anchor, fragment);
24910
- pop();
25555
+ pop$1();
24911
25556
  $$cleanup();
24912
25557
  }
24913
25558
 
@@ -24950,7 +25595,7 @@
24950
25595
  var root_10$2 = from_html(`<form><div><!></div> <div><!></div> <!> <!> <!> <div class="tilmeld-login-buttons svelte-1nt1tpa"><!></div> <!> <!></form>`);
24951
25596
 
24952
25597
  function Login($$anchor, $$props) {
24953
- push($$props, true);
25598
+ push$1($$props, true);
24954
25599
 
24955
25600
  const $clientConfig = () => store_get(clientConfig(), '$clientConfig', $$stores);
24956
25601
  const [$$stores, $$cleanup] = setup_stores();
@@ -25754,7 +26399,7 @@
25754
26399
  }
25755
26400
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
25756
26401
  append($$anchor, div);
25757
- pop();
26402
+ pop$1();
25758
26403
  $$cleanup();
25759
26404
  }
25760
26405
 
@@ -26202,7 +26847,7 @@
26202
26847
  var root$q = from_html(`<header><!></header>`);
26203
26848
 
26204
26849
  function TopAppBar($$anchor, $$props) {
26205
- push($$props, true);
26850
+ push$1($$props, true);
26206
26851
 
26207
26852
  let uninitializedValue = () => {};
26208
26853
 
@@ -26435,7 +27080,7 @@
26435
27080
  action(header, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
26436
27081
  append($$anchor, header);
26437
27082
 
26438
- return pop($$exports);
27083
+ return pop$1($$exports);
26439
27084
  /**
26440
27085
  * An array of Action or [Action, ActionProps] to be applied to the element.
26441
27086
  */
@@ -26473,7 +27118,7 @@
26473
27118
  var rest_excludes$s = new Set(['$$slots', '$$events', '$$legacy', 'children']);
26474
27119
 
26475
27120
  function Row$1($$anchor, $$props) {
26476
- push($$props, true);
27121
+ push$1($$props, true);
26477
27122
 
26478
27123
  let restProps = rest_props($$props, rest_excludes$s);
26479
27124
  let element;
@@ -26499,7 +27144,7 @@
26499
27144
  () => element
26500
27145
  );
26501
27146
 
26502
- return pop($$exports);
27147
+ return pop$1($$exports);
26503
27148
  }
26504
27149
 
26505
27150
  var rest_excludes$r = new Set([
@@ -26516,7 +27161,7 @@
26516
27161
  var root$p = from_html(`<section><!></section>`);
26517
27162
 
26518
27163
  function Section($$anchor, $$props) {
26519
- push($$props, true);
27164
+ push$1($$props, true);
26520
27165
 
26521
27166
  /**
26522
27167
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -26575,13 +27220,13 @@
26575
27220
  action(section, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
26576
27221
  append($$anchor, section);
26577
27222
 
26578
- return pop($$exports);
27223
+ return pop$1($$exports);
26579
27224
  }
26580
27225
 
26581
27226
  var rest_excludes$q = new Set(['$$slots', '$$events', '$$legacy', 'children']);
26582
27227
 
26583
27228
  function Title($$anchor, $$props) {
26584
- push($$props, true);
27229
+ push$1($$props, true);
26585
27230
 
26586
27231
  let restProps = rest_props($$props, rest_excludes$q);
26587
27232
  let element;
@@ -26607,7 +27252,7 @@
26607
27252
  () => element
26608
27253
  );
26609
27254
 
26610
- return pop($$exports);
27255
+ return pop$1($$exports);
26611
27256
  }
26612
27257
 
26613
27258
  /**
@@ -28250,7 +28895,7 @@
28250
28895
  var root$o = from_html(`<aside><!></aside>`);
28251
28896
 
28252
28897
  function Drawer($$anchor, $$props) {
28253
- push($$props, true);
28898
+ push$1($$props, true);
28254
28899
 
28255
28900
  const { FocusTrap } = domFocusTrap;
28256
28901
 
@@ -28472,7 +29117,7 @@
28472
29117
  action(aside, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
28473
29118
  append($$anchor, aside);
28474
29119
 
28475
- return pop($$exports);
29120
+ return pop$1($$exports);
28476
29121
  /**
28477
29122
  * An array of Action or [Action, ActionProps] to be applied to the element.
28478
29123
  */
@@ -28505,7 +29150,7 @@
28505
29150
  var rest_excludes$o = new Set(['$$slots', '$$events', '$$legacy', 'children']);
28506
29151
 
28507
29152
  function AppContent($$anchor, $$props) {
28508
- push($$props, true);
29153
+ push$1($$props, true);
28509
29154
 
28510
29155
  let restProps = rest_props($$props, rest_excludes$o);
28511
29156
  let element;
@@ -28531,13 +29176,13 @@
28531
29176
  () => element
28532
29177
  );
28533
29178
 
28534
- return pop($$exports);
29179
+ return pop$1($$exports);
28535
29180
  }
28536
29181
 
28537
29182
  var rest_excludes$n = new Set(['$$slots', '$$events', '$$legacy', 'children']);
28538
29183
 
28539
29184
  function Content($$anchor, $$props) {
28540
- push($$props, true);
29185
+ push$1($$props, true);
28541
29186
 
28542
29187
  let restProps = rest_props($$props, rest_excludes$n);
28543
29188
  let element;
@@ -28563,7 +29208,7 @@
28563
29208
  () => element
28564
29209
  );
28565
29210
 
28566
- return pop($$exports);
29211
+ return pop$1($$exports);
28567
29212
  }
28568
29213
 
28569
29214
  var rest_excludes$m = new Set([
@@ -28579,7 +29224,7 @@
28579
29224
  ]);
28580
29225
 
28581
29226
  function Scrim($$anchor, $$props) {
28582
- push($$props, true);
29227
+ push$1($$props, true);
28583
29228
 
28584
29229
  /**
28585
29230
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -28670,7 +29315,7 @@
28670
29315
 
28671
29316
  append($$anchor, fragment);
28672
29317
 
28673
- return pop($$exports);
29318
+ return pop$1($$exports);
28674
29319
  }
28675
29320
 
28676
29321
  /**
@@ -28826,7 +29471,7 @@
28826
29471
  var root_2$7 = from_html(`<div class="mdc-icon-button__ripple"></div> <!> <!><!>`, 1);
28827
29472
 
28828
29473
  function IconButton($$anchor, $$props) {
28829
- push($$props, true);
29474
+ push$1($$props, true);
28830
29475
 
28831
29476
  let uninitializedValue = () => {};
28832
29477
 
@@ -29195,7 +29840,7 @@
29195
29840
 
29196
29841
  append($$anchor, fragment);
29197
29842
 
29198
- return pop($$exports);
29843
+ return pop$1($$exports);
29199
29844
  }
29200
29845
 
29201
29846
  var rest_excludes$k = new Set([
@@ -29228,7 +29873,7 @@
29228
29873
  ]);
29229
29874
 
29230
29875
  function List($$anchor, $$props) {
29231
- push($$props, true);
29876
+ push$1($$props, true);
29232
29877
 
29233
29878
  const { closest, matches } = ponyfill;
29234
29879
 
@@ -29775,7 +30420,7 @@
29775
30420
 
29776
30421
  append($$anchor, fragment);
29777
30422
 
29778
- return pop($$exports);
30423
+ return pop$1($$exports);
29779
30424
  }
29780
30425
 
29781
30426
  let counter$2 = 0;
@@ -29808,7 +30453,7 @@
29808
30453
  var root_1$8 = from_html(`<!><!>`, 1);
29809
30454
 
29810
30455
  function Item($$anchor, $$props) {
29811
- push($$props, true);
30456
+ push$1($$props, true);
29812
30457
 
29813
30458
  let uninitializedValue = () => {};
29814
30459
 
@@ -30284,13 +30929,13 @@
30284
30929
 
30285
30930
  append($$anchor, fragment);
30286
30931
 
30287
- return pop($$exports);
30932
+ return pop$1($$exports);
30288
30933
  }
30289
30934
 
30290
30935
  var rest_excludes$i = new Set(['$$slots', '$$events', '$$legacy', 'children']);
30291
30936
 
30292
30937
  function Text$1($$anchor, $$props) {
30293
- push($$props, true);
30938
+ push$1($$props, true);
30294
30939
 
30295
30940
  let restProps = rest_props($$props, rest_excludes$i);
30296
30941
  let element;
@@ -30316,13 +30961,13 @@
30316
30961
  () => element
30317
30962
  );
30318
30963
 
30319
- return pop($$exports);
30964
+ return pop$1($$exports);
30320
30965
  }
30321
30966
 
30322
30967
  var rest_excludes$h = new Set(['$$slots', '$$events', '$$legacy', 'children']);
30323
30968
 
30324
30969
  function Meta($$anchor, $$props) {
30325
- push($$props, true);
30970
+ push$1($$props, true);
30326
30971
 
30327
30972
  let restProps = rest_props($$props, rest_excludes$h);
30328
30973
  let element;
@@ -30348,7 +30993,7 @@
30348
30993
  () => element
30349
30994
  );
30350
30995
 
30351
- return pop($$exports);
30996
+ return pop$1($$exports);
30352
30997
  }
30353
30998
 
30354
30999
  var rest_excludes$g = new Set([
@@ -30368,7 +31013,7 @@
30368
31013
  ]);
30369
31014
 
30370
31015
  function Separator($$anchor, $$props) {
30371
- push($$props, true);
31016
+ push$1($$props, true);
30372
31017
 
30373
31018
  /**
30374
31019
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -30463,7 +31108,7 @@
30463
31108
 
30464
31109
  append($$anchor, fragment);
30465
31110
 
30466
- return pop($$exports);
31111
+ return pop$1($$exports);
30467
31112
  }
30468
31113
 
30469
31114
  /**
@@ -31183,7 +31828,7 @@
31183
31828
  var root$l = from_html(`<div><!></div>`);
31184
31829
 
31185
31830
  function MenuSurface($$anchor, $$props) {
31186
- push($$props, true);
31831
+ push$1($$props, true);
31187
31832
 
31188
31833
  /**
31189
31834
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -31606,7 +32251,7 @@
31606
32251
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
31607
32252
  append($$anchor, div);
31608
32253
 
31609
- return pop($$exports);
32254
+ return pop$1($$exports);
31610
32255
  /**
31611
32256
  * An array of Action or [Action, ActionProps] to be applied to the element.
31612
32257
  */
@@ -31890,7 +32535,7 @@
31890
32535
  ]);
31891
32536
 
31892
32537
  function Menu($$anchor, $$props) {
31893
- push($$props, true);
32538
+ push$1($$props, true);
31894
32539
 
31895
32540
  const { closest } = ponyfill;
31896
32541
 
@@ -32192,7 +32837,7 @@
32192
32837
  );
32193
32838
  }
32194
32839
 
32195
- return pop($$exports);
32840
+ return pop$1($$exports);
32196
32841
  }
32197
32842
 
32198
32843
  const nymph = new Nymph(
@@ -33054,7 +33699,7 @@
33054
33699
  var root$j = from_html(`<div><!></div>`);
33055
33700
 
33056
33701
  function Paper($$anchor, $$props) {
33057
- push($$props, true);
33702
+ push$1($$props, true);
33058
33703
 
33059
33704
  /**
33060
33705
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -33122,7 +33767,7 @@
33122
33767
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
33123
33768
  append($$anchor, div);
33124
33769
 
33125
- return pop($$exports);
33770
+ return pop$1($$exports);
33126
33771
  }
33127
33772
 
33128
33773
  /**
@@ -33485,7 +34130,7 @@
33485
34130
  var root_1$7 = from_html(`<div><div><table><!></table></div> <!> <!></div>`);
33486
34131
 
33487
34132
  function DataTable($$anchor, $$props) {
33488
- push($$props, true);
34133
+ push$1($$props, true);
33489
34134
  const $progressClosed = () => store_get(progressClosed, '$progressClosed', $$stores);
33490
34135
  const [$$stores, $$cleanup] = setup_stores();
33491
34136
  const { closest } = ponyfill;
@@ -33946,7 +34591,7 @@
33946
34591
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
33947
34592
  append($$anchor, div);
33948
34593
 
33949
- var $$pop = pop($$exports);
34594
+ var $$pop = pop$1($$exports);
33950
34595
 
33951
34596
  $$cleanup();
33952
34597
 
@@ -33957,7 +34602,7 @@
33957
34602
  var root$h = from_html(`<thead><!></thead>`);
33958
34603
 
33959
34604
  function Head($$anchor, $$props) {
33960
- push($$props, true);
34605
+ push$1($$props, true);
33961
34606
 
33962
34607
  /**
33963
34608
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -34051,7 +34696,7 @@
34051
34696
  action(thead, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
34052
34697
  append($$anchor, thead);
34053
34698
 
34054
- return pop($$exports);
34699
+ return pop$1($$exports);
34055
34700
  }
34056
34701
 
34057
34702
  var rest_excludes$a = new Set([
@@ -34066,7 +34711,7 @@
34066
34711
  var root$g = from_html(`<tbody><!></tbody>`);
34067
34712
 
34068
34713
  function Body($$anchor, $$props) {
34069
- push($$props, true);
34714
+ push$1($$props, true);
34070
34715
 
34071
34716
  /**
34072
34717
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -34145,7 +34790,7 @@
34145
34790
  action(tbody, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
34146
34791
  append($$anchor, tbody);
34147
34792
 
34148
- return pop($$exports);
34793
+ return pop$1($$exports);
34149
34794
  }
34150
34795
 
34151
34796
  let counter$1 = 0;
@@ -34163,7 +34808,7 @@
34163
34808
  var root$f = from_html(`<tr><!></tr>`);
34164
34809
 
34165
34810
  function Row($$anchor, $$props) {
34166
- push($$props, true);
34811
+ push$1($$props, true);
34167
34812
 
34168
34813
  /**
34169
34814
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -34338,7 +34983,7 @@
34338
34983
  action(tr, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
34339
34984
  append($$anchor, tr);
34340
34985
 
34341
- return pop($$exports);
34986
+ return pop$1($$exports);
34342
34987
  /**
34343
34988
  * An array of Action or [Action, ActionProps] to be applied to the element.
34344
34989
  */
@@ -34375,7 +35020,7 @@
34375
35020
  var root_2$6 = from_html(`<td><!></td>`);
34376
35021
 
34377
35022
  function Cell$1($$anchor, $$props) {
34378
- push($$props, true);
35023
+ push$1($$props, true);
34379
35024
 
34380
35025
  const $sort = () => store_get(sort, '$sort', $$stores);
34381
35026
  const $sortDirection = () => store_get(sortDirection, '$sortDirection', $$stores);
@@ -34637,7 +35282,7 @@
34637
35282
 
34638
35283
  append($$anchor, fragment);
34639
35284
 
34640
- var $$pop = pop($$exports);
35285
+ var $$pop = pop$1($$exports);
34641
35286
 
34642
35287
  $$cleanup();
34643
35288
 
@@ -34669,7 +35314,7 @@
34669
35314
  var root_2$5 = from_html(`<div class="mdc-fab__ripple"></div> <!> <!><!>`, 1);
34670
35315
 
34671
35316
  function Fab($$anchor, $$props) {
34672
- push($$props, true);
35317
+ push$1($$props, true);
34673
35318
 
34674
35319
  /**
34675
35320
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -34867,7 +35512,7 @@
34867
35512
 
34868
35513
  append($$anchor, fragment);
34869
35514
 
34870
- return pop($$exports);
35515
+ return pop$1($$exports);
34871
35516
  }
34872
35517
 
34873
35518
  var root$c = from_html(`<section><div style="display: flex; justify-content: center; align-items: center;"><!></div></section>`);
@@ -34880,13 +35525,15 @@
34880
35525
  var root_7$4 = from_html(`<div class="solo-search-container solo-container"><!> <!> <!></div> <section><!> <!></section>`, 1);
34881
35526
 
34882
35527
  function Users($$anchor, $$props) {
34883
- push($$props, true);
35528
+ push$1($$props, true);
34884
35529
 
34885
- const $clientConfig = () => store_get($$props.clientConfig, '$clientConfig', $$stores);
34886
- const $user = () => store_get($$props.user, '$user', $$stores);
35530
+ const $clientConfig = () => store_get(clientConfig, '$clientConfig', $$stores);
35531
+ const $user = () => store_get(user, '$user', $$stores);
34887
35532
  const [$$stores, $$cleanup] = setup_stores();
34888
- let entitySearch = state(proxy($$props.params.query ?? ''));
35533
+ let entitySearch = user_derived(() => $$props.params.query ?? '');
34889
35534
  let failureMessage = state(void 0);
35535
+ const clientConfig = getContext('clientConfigStore');
35536
+ const user = getContext('userStore');
34890
35537
 
34891
35538
  user_effect(() => {
34892
35539
  if ($$props.params) {
@@ -34923,7 +35570,7 @@
34923
35570
  let entities = state(void 0);
34924
35571
 
34925
35572
  async function searchEntities() {
34926
- $$props.router.navigate(`/users/${encodeURIComponent(get(entitySearch))}`);
35573
+ push(`/users/${encodeURIComponent(get(entitySearch))}`);
34927
35574
  }
34928
35575
 
34929
35576
  function entitySearchKeyDown(event) {
@@ -34950,27 +35597,34 @@
34950
35597
  var div_1 = first_child(fragment_1);
34951
35598
  var node_2 = child(div_1);
34952
35599
 
34953
- Fab(node_2, {
34954
- href: '#/users/edit/+',
34955
- color: 'primary',
34956
- mini: true,
34957
- class: 'solo-fab',
34958
- title: 'New User',
34959
- children: ($$anchor, $$slotProps) => {
34960
- CommonIcon($$anchor, {
34961
- tag: 'svg',
34962
- viewBox: '0 0 24 24',
34963
- children: ($$anchor, $$slotProps) => {
34964
- var path = root_1$4();
35600
+ {
35601
+ let $0 = user_derived(() => [link]);
34965
35602
 
34966
- template_effect(() => set_attribute(path, 'd', mdiPlus));
34967
- append($$anchor, path);
34968
- },
34969
- $$slots: { default: true }
34970
- });
34971
- },
34972
- $$slots: { default: true }
34973
- });
35603
+ Fab(node_2, {
35604
+ href: '/users/edit/+',
35605
+ get use() {
35606
+ return get($0);
35607
+ },
35608
+ color: 'primary',
35609
+ mini: true,
35610
+ class: 'solo-fab',
35611
+ title: 'New User',
35612
+ children: ($$anchor, $$slotProps) => {
35613
+ CommonIcon($$anchor, {
35614
+ tag: 'svg',
35615
+ viewBox: '0 0 24 24',
35616
+ children: ($$anchor, $$slotProps) => {
35617
+ var path = root_1$4();
35618
+
35619
+ template_effect(() => set_attribute(path, 'd', mdiPlus));
35620
+ append($$anchor, path);
35621
+ },
35622
+ $$slots: { default: true }
35623
+ });
35624
+ },
35625
+ $$slots: { default: true }
35626
+ });
35627
+ }
34974
35628
 
34975
35629
  var node_3 = sibling(node_2, 2);
34976
35630
 
@@ -35005,7 +35659,7 @@
35005
35659
  },
35006
35660
 
35007
35661
  set value($$value) {
35008
- set(entitySearch, $$value, true);
35662
+ set(entitySearch, $$value);
35009
35663
  }
35010
35664
  });
35011
35665
 
@@ -35193,10 +35847,11 @@
35193
35847
  children: ($$anchor, $$slotProps) => {
35194
35848
  var a = root_6$4();
35195
35849
  var text_5 = child(a);
35850
+ action(a, ($$node) => link?.($$node));
35196
35851
 
35197
35852
  template_effect(
35198
35853
  ($0) => {
35199
- set_attribute(a, 'href', `#/users/edit/${$0 ?? ''}`);
35854
+ set_attribute(a, 'href', `/users/edit/${$0 ?? ''}`);
35200
35855
  set_text(text_5, get(curEntity).username);
35201
35856
  },
35202
35857
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -35221,10 +35876,11 @@
35221
35876
  children: ($$anchor, $$slotProps) => {
35222
35877
  var a_1 = root_6$4();
35223
35878
  var text_6 = child(a_1);
35879
+ action(a_1, ($$node) => link?.($$node));
35224
35880
 
35225
35881
  template_effect(
35226
35882
  ($0) => {
35227
- set_attribute(a_1, 'href', `#/users/edit/${$0 ?? ''}`);
35883
+ set_attribute(a_1, 'href', `/users/edit/${$0 ?? ''}`);
35228
35884
  set_text(text_6, get(curEntity).name);
35229
35885
  },
35230
35886
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -35251,10 +35907,11 @@
35251
35907
  children: ($$anchor, $$slotProps) => {
35252
35908
  var a_2 = root_6$4();
35253
35909
  var text_7 = child(a_2);
35910
+ action(a_2, ($$node) => link?.($$node));
35254
35911
 
35255
35912
  template_effect(
35256
35913
  ($0) => {
35257
- set_attribute(a_2, 'href', `#/users/edit/${$0 ?? ''}`);
35914
+ set_attribute(a_2, 'href', `/users/edit/${$0 ?? ''}`);
35258
35915
  set_text(text_7, get(curEntity).email);
35259
35916
  },
35260
35917
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -35341,7 +35998,7 @@
35341
35998
  }
35342
35999
 
35343
36000
  append($$anchor, fragment);
35344
- pop();
36001
+ pop$1();
35345
36002
  $$cleanup();
35346
36003
  }
35347
36004
 
@@ -35525,7 +36182,7 @@
35525
36182
  var root$b = from_html(`<span><span><!></span></span>`);
35526
36183
 
35527
36184
  function TabIndicator($$anchor, $$props) {
35528
- push($$props, true);
36185
+ push$1($$props, true);
35529
36186
 
35530
36187
  /**
35531
36188
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -35712,7 +36369,7 @@
35712
36369
  action(span, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
35713
36370
  append($$anchor, span);
35714
36371
 
35715
- return pop($$exports);
36372
+ return pop$1($$exports);
35716
36373
  }
35717
36374
 
35718
36375
  /**
@@ -35882,7 +36539,7 @@
35882
36539
  var root$a = from_html(`<span><!> <!></span> <!> <span class="mdc-tab__ripple"></span>`, 1);
35883
36540
 
35884
36541
  function Tab($$anchor, $$props) {
35885
- push($$props, true);
36542
+ push$1($$props, true);
35886
36543
 
35887
36544
  const tabIndicatorSnippet = ($$anchor) => {
35888
36545
  {
@@ -36209,7 +36866,7 @@
36209
36866
 
36210
36867
  append($$anchor, fragment_2);
36211
36868
 
36212
- return pop($$exports);
36869
+ return pop$1($$exports);
36213
36870
  }
36214
36871
 
36215
36872
  /**
@@ -36851,7 +37508,7 @@
36851
37508
  var root$9 = from_html(`<div><div><div><!></div></div></div>`);
36852
37509
 
36853
37510
  function TabScroller($$anchor, $$props) {
36854
- push($$props, true);
37511
+ push$1($$props, true);
36855
37512
 
36856
37513
  const { matches } = ponyfill;
36857
37514
 
@@ -37121,7 +37778,7 @@
37121
37778
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
37122
37779
  append($$anchor, div);
37123
37780
 
37124
- return pop($$exports);
37781
+ return pop$1($$exports);
37125
37782
  /**
37126
37783
  * An array of Action or [Action, ActionProps] to be applied to the element.
37127
37784
  */
@@ -37576,7 +38233,7 @@
37576
38233
  var root$8 = from_html(`<div><!></div>`);
37577
38234
 
37578
38235
  function TabBar($$anchor, $$props) {
37579
- push($$props, true);
38236
+ push$1($$props, true);
37580
38237
 
37581
38238
  /**
37582
38239
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -37845,7 +38502,7 @@
37845
38502
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
37846
38503
  append($$anchor, div);
37847
38504
 
37848
- return pop($$exports);
38505
+ return pop$1($$exports);
37849
38506
  }
37850
38507
 
37851
38508
  var rest_excludes$2 = new Set([
@@ -37860,7 +38517,7 @@
37860
38517
  var root$7 = from_html(`<div><!></div>`);
37861
38518
 
37862
38519
  function InnerGrid($$anchor, $$props) {
37863
- push($$props, true);
38520
+ push$1($$props, true);
37864
38521
 
37865
38522
  /**
37866
38523
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -37895,7 +38552,7 @@
37895
38552
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
37896
38553
  append($$anchor, div);
37897
38554
 
37898
- return pop($$exports);
38555
+ return pop$1($$exports);
37899
38556
  }
37900
38557
 
37901
38558
  var rest_excludes$1 = new Set([
@@ -37912,7 +38569,7 @@
37912
38569
  var root$6 = from_html(`<div><!></div>`);
37913
38570
 
37914
38571
  function LayoutGrid($$anchor, $$props) {
37915
- push($$props, true);
38572
+ push$1($$props, true);
37916
38573
 
37917
38574
  /**
37918
38575
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -37974,7 +38631,7 @@
37974
38631
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
37975
38632
  append($$anchor, div);
37976
38633
 
37977
- return pop($$exports);
38634
+ return pop$1($$exports);
37978
38635
  }
37979
38636
 
37980
38637
  var rest_excludes = new Set([
@@ -37993,7 +38650,7 @@
37993
38650
  var root$5 = from_html(`<div><!></div>`);
37994
38651
 
37995
38652
  function Cell($$anchor, $$props) {
37996
- push($$props, true);
38653
+ push$1($$props, true);
37997
38654
 
37998
38655
  /**
37999
38656
  * An array of Action or [Action, ActionProps] to be applied to the element.
@@ -38055,7 +38712,7 @@
38055
38712
  action(div, ($$node, $$action_arg) => useActions?.($$node, $$action_arg), use);
38056
38713
  append($$anchor, div);
38057
38714
 
38058
- return pop($$exports);
38715
+ return pop$1($$exports);
38059
38716
  }
38060
38717
 
38061
38718
  var root$4 = from_html(`<section><div style="display: flex; justify-content: center; align-items: center;"><!></div></section>`);
@@ -38138,11 +38795,11 @@
38138
38795
  );
38139
38796
 
38140
38797
  function UserEdit($$anchor, $$props) {
38141
- push($$props, true);
38798
+ push$1($$props, true);
38142
38799
 
38143
- const $user = () => store_get($$props.user, '$user', $$stores);
38800
+ const $user = () => store_get(user, '$user', $$stores);
38144
38801
  const $entity = () => store_get(entity, '$entity', $$stores);
38145
- const $clientConfig = () => store_get($$props.clientConfig, '$clientConfig', $$stores);
38802
+ const $clientConfig = () => store_get(clientConfig, '$clientConfig', $$stores);
38146
38803
  const [$$stores, $$cleanup] = setup_stores();
38147
38804
  let entity = writable(User.factorySync());
38148
38805
  let sysAdmin = state(false);
@@ -38166,6 +38823,8 @@
38166
38823
  let saving = state(false);
38167
38824
  let success = state(void 0);
38168
38825
  let loading = state(true);
38826
+ const clientConfig = getContext('clientConfigStore');
38827
+ const user = getContext('userStore');
38169
38828
 
38170
38829
  user_effect(() => {
38171
38830
  if ($$props.params) {
@@ -38521,24 +39180,21 @@
38521
39180
  const newEntity = $entity().guid == null;
38522
39181
 
38523
39182
  try {
38524
- if (await $entity().$save()) {
38525
- await readyEntity();
38526
- set(success, true);
38527
- set(passwordVerify, '');
38528
-
38529
- if (newEntity) {
38530
- $$props.router.navigate(`/users/edit/${encodeURIComponent($entity().guid || '')}`, { historyAPIMethod: 'replaceState' });
38531
- }
39183
+ await $entity().$save();
39184
+ await readyEntity();
39185
+ set(success, true);
39186
+ set(passwordVerify, '');
38532
39187
 
38533
- setTimeout(
38534
- () => {
38535
- set(success, undefined);
38536
- },
38537
- 1000
38538
- );
38539
- } else {
38540
- set(failureMessage, 'Error saving user.');
39188
+ if (newEntity) {
39189
+ replace(`/users/edit/${encodeURIComponent($entity().guid || '')}`);
38541
39190
  }
39191
+
39192
+ setTimeout(
39193
+ () => {
39194
+ set(success, undefined);
39195
+ },
39196
+ 1000
39197
+ );
38542
39198
  } catch(e) {
38543
39199
  console.log('error:', e);
38544
39200
  set(failureMessage, e?.message, true);
@@ -38554,11 +39210,8 @@
38554
39210
  set(saving, true);
38555
39211
 
38556
39212
  try {
38557
- if (await $entity().$delete()) {
38558
- $$props.router.navigate('', { historyAPIMethod: 'back' });
38559
- } else {
38560
- set(failureMessage, 'An error occurred.');
38561
- }
39213
+ await $entity().$delete();
39214
+ pop();
38562
39215
  } catch(e) {
38563
39216
  set(failureMessage, e?.message, true);
38564
39217
  }
@@ -38607,7 +39260,7 @@
38607
39260
 
38608
39261
  IconButton(node_2, {
38609
39262
  title: 'Back',
38610
- onclick: () => $$props.router.navigate('', { historyAPIMethod: 'back' }),
39263
+ onclick: () => pop(),
38611
39264
  children: ($$anchor, $$slotProps) => {
38612
39265
  CommonIcon($$anchor, {
38613
39266
  tag: 'svg',
@@ -39114,6 +39767,7 @@
39114
39767
  var fragment_30 = root_7$3();
39115
39768
  var a_1 = first_child(fragment_30);
39116
39769
  var text_7 = child(a_1);
39770
+ action(a_1, ($$node) => link?.($$node));
39117
39771
 
39118
39772
  var node_22 = sibling(a_1, 2);
39119
39773
 
@@ -39141,7 +39795,7 @@
39141
39795
 
39142
39796
  template_effect(
39143
39797
  ($0, $1) => {
39144
- set_attribute(a_1, 'href', `#/groups/edit/${$0 ?? ''}`);
39798
+ set_attribute(a_1, 'href', `/groups/edit/${$0 ?? ''}`);
39145
39799
  set_text(text_7, $1);
39146
39800
  },
39147
39801
  [
@@ -39594,10 +40248,11 @@
39594
40248
  children: ($$anchor, $$slotProps) => {
39595
40249
  var a_2 = root_12$1();
39596
40250
  var text_21 = child(a_2);
40251
+ action(a_2, ($$node) => link?.($$node));
39597
40252
 
39598
40253
  template_effect(
39599
40254
  ($0) => {
39600
- set_attribute(a_2, 'href', `#/groups/edit/${$0 ?? ''}`);
40255
+ set_attribute(a_2, 'href', `/groups/edit/${$0 ?? ''}`);
39601
40256
  set_text(text_21, get(curEntity).groupname);
39602
40257
  },
39603
40258
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -39622,10 +40277,11 @@
39622
40277
  children: ($$anchor, $$slotProps) => {
39623
40278
  var a_3 = root_12$1();
39624
40279
  var text_22 = child(a_3);
40280
+ action(a_3, ($$node) => link?.($$node));
39625
40281
 
39626
40282
  template_effect(
39627
40283
  ($0) => {
39628
- set_attribute(a_3, 'href', `#/groups/edit/${$0 ?? ''}`);
40284
+ set_attribute(a_3, 'href', `/groups/edit/${$0 ?? ''}`);
39629
40285
  set_text(text_22, get(curEntity).name);
39630
40286
  },
39631
40287
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -39652,10 +40308,11 @@
39652
40308
  children: ($$anchor, $$slotProps) => {
39653
40309
  var a_4 = root_12$1();
39654
40310
  var text_23 = child(a_4);
40311
+ action(a_4, ($$node) => link?.($$node));
39655
40312
 
39656
40313
  template_effect(
39657
40314
  ($0) => {
39658
- set_attribute(a_4, 'href', `#/groups/edit/${$0 ?? ''}`);
40315
+ set_attribute(a_4, 'href', `/groups/edit/${$0 ?? ''}`);
39659
40316
  set_text(text_23, get(curEntity).email);
39660
40317
  },
39661
40318
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -40951,7 +41608,7 @@
40951
41608
  });
40952
41609
 
40953
41610
  append($$anchor, fragment);
40954
- pop();
41611
+ pop$1();
40955
41612
  $$cleanup();
40956
41613
  }
40957
41614
 
@@ -40965,13 +41622,15 @@
40965
41622
  var root_7$2 = from_html(`<div class="solo-search-container solo-container"><!> <!> <!></div> <section><!> <!></section>`, 1);
40966
41623
 
40967
41624
  function Groups($$anchor, $$props) {
40968
- push($$props, true);
41625
+ push$1($$props, true);
40969
41626
 
40970
- const $clientConfig = () => store_get($$props.clientConfig, '$clientConfig', $$stores);
40971
- const $user = () => store_get($$props.user, '$user', $$stores);
41627
+ const $clientConfig = () => store_get(clientConfig, '$clientConfig', $$stores);
41628
+ const $user = () => store_get(user, '$user', $$stores);
40972
41629
  const [$$stores, $$cleanup] = setup_stores();
40973
- let entitySearch = state(proxy($$props.params.query ?? ''));
41630
+ let entitySearch = user_derived(() => $$props.params.query ?? '');
40974
41631
  let failureMessage = state(void 0);
41632
+ const clientConfig = getContext('clientConfigStore');
41633
+ const user = getContext('userStore');
40975
41634
 
40976
41635
  user_effect(() => {
40977
41636
  if ($$props.params) {
@@ -41008,7 +41667,7 @@
41008
41667
  let entities = state(void 0);
41009
41668
 
41010
41669
  async function searchEntities() {
41011
- $$props.router.navigate(`/groups/${encodeURIComponent(get(entitySearch))}`);
41670
+ push(`/groups/${encodeURIComponent(get(entitySearch))}`);
41012
41671
  }
41013
41672
 
41014
41673
  function entitySearchKeyDown(event) {
@@ -41035,27 +41694,34 @@
41035
41694
  var div_1 = first_child(fragment_1);
41036
41695
  var node_2 = child(div_1);
41037
41696
 
41038
- Fab(node_2, {
41039
- href: '#/groups/edit/+',
41040
- color: 'primary',
41041
- mini: true,
41042
- class: 'solo-fab',
41043
- title: 'New Group',
41044
- children: ($$anchor, $$slotProps) => {
41045
- CommonIcon($$anchor, {
41046
- tag: 'svg',
41047
- viewBox: '0 0 24 24',
41048
- children: ($$anchor, $$slotProps) => {
41049
- var path = root_1$2();
41697
+ {
41698
+ let $0 = user_derived(() => [link]);
41050
41699
 
41051
- template_effect(() => set_attribute(path, 'd', mdiPlus));
41052
- append($$anchor, path);
41053
- },
41054
- $$slots: { default: true }
41055
- });
41056
- },
41057
- $$slots: { default: true }
41058
- });
41700
+ Fab(node_2, {
41701
+ href: '/groups/edit/+',
41702
+ get use() {
41703
+ return get($0);
41704
+ },
41705
+ color: 'primary',
41706
+ mini: true,
41707
+ class: 'solo-fab',
41708
+ title: 'New Group',
41709
+ children: ($$anchor, $$slotProps) => {
41710
+ CommonIcon($$anchor, {
41711
+ tag: 'svg',
41712
+ viewBox: '0 0 24 24',
41713
+ children: ($$anchor, $$slotProps) => {
41714
+ var path = root_1$2();
41715
+
41716
+ template_effect(() => set_attribute(path, 'd', mdiPlus));
41717
+ append($$anchor, path);
41718
+ },
41719
+ $$slots: { default: true }
41720
+ });
41721
+ },
41722
+ $$slots: { default: true }
41723
+ });
41724
+ }
41059
41725
 
41060
41726
  var node_3 = sibling(node_2, 2);
41061
41727
 
@@ -41090,7 +41756,7 @@
41090
41756
  },
41091
41757
 
41092
41758
  set value($$value) {
41093
- set(entitySearch, $$value, true);
41759
+ set(entitySearch, $$value);
41094
41760
  }
41095
41761
  });
41096
41762
 
@@ -41278,10 +41944,11 @@
41278
41944
  children: ($$anchor, $$slotProps) => {
41279
41945
  var a = root_6$2();
41280
41946
  var text_5 = child(a);
41947
+ action(a, ($$node) => link?.($$node));
41281
41948
 
41282
41949
  template_effect(
41283
41950
  ($0) => {
41284
- set_attribute(a, 'href', `#/groups/edit/${$0 ?? ''}`);
41951
+ set_attribute(a, 'href', `/groups/edit/${$0 ?? ''}`);
41285
41952
  set_text(text_5, get(curEntity).groupname);
41286
41953
  },
41287
41954
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -41306,10 +41973,11 @@
41306
41973
  children: ($$anchor, $$slotProps) => {
41307
41974
  var a_1 = root_6$2();
41308
41975
  var text_6 = child(a_1);
41976
+ action(a_1, ($$node) => link?.($$node));
41309
41977
 
41310
41978
  template_effect(
41311
41979
  ($0) => {
41312
- set_attribute(a_1, 'href', `#/groups/edit/${$0 ?? ''}`);
41980
+ set_attribute(a_1, 'href', `/groups/edit/${$0 ?? ''}`);
41313
41981
  set_text(text_6, get(curEntity).name);
41314
41982
  },
41315
41983
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -41336,10 +42004,11 @@
41336
42004
  children: ($$anchor, $$slotProps) => {
41337
42005
  var a_2 = root_6$2();
41338
42006
  var text_7 = child(a_2);
42007
+ action(a_2, ($$node) => link?.($$node));
41339
42008
 
41340
42009
  template_effect(
41341
42010
  ($0) => {
41342
- set_attribute(a_2, 'href', `#/groups/edit/${$0 ?? ''}`);
42011
+ set_attribute(a_2, 'href', `/groups/edit/${$0 ?? ''}`);
41343
42012
  set_text(text_7, get(curEntity).email);
41344
42013
  },
41345
42014
  [() => encodeURIComponent(get(curEntity).guid || '')]
@@ -41426,7 +42095,7 @@
41426
42095
  }
41427
42096
 
41428
42097
  append($$anchor, fragment);
41429
- pop();
42098
+ pop$1();
41430
42099
  $$cleanup();
41431
42100
  }
41432
42101
 
@@ -41448,11 +42117,11 @@
41448
42117
  var root_15 = from_html(`<div style="display: flex; align-items: center; padding: 12px;"><!> <h2 style="margin: 0px 12px 0px;" class="mdc-typography--headline5"> </h2></div> <!> <!> <section><!> <!> <!> <!> <div style="margin-top: 36px;"><!> <!> <!></div></section>`, 1);
41449
42118
 
41450
42119
  function GroupEdit($$anchor, $$props) {
41451
- push($$props, true);
42120
+ push$1($$props, true);
41452
42121
 
41453
42122
  const $entity = () => store_get(entity, '$entity', $$stores);
41454
- const $clientConfig = () => store_get($$props.clientConfig, '$clientConfig', $$stores);
41455
- const $user = () => store_get($$props.user, '$user', $$stores);
42123
+ const $clientConfig = () => store_get(clientConfig, '$clientConfig', $$stores);
42124
+ const $user = () => store_get(user, '$user', $$stores);
41456
42125
  const [$$stores, $$cleanup] = setup_stores();
41457
42126
  let entity = writable(Group.factorySync());
41458
42127
  let activeTab = state('General');
@@ -41469,6 +42138,8 @@
41469
42138
  let saving = state(false);
41470
42139
  let success = state(void 0);
41471
42140
  let loading = state(true);
42141
+ const clientConfig = getContext('clientConfigStore');
42142
+ const user = getContext('userStore');
41472
42143
 
41473
42144
  user_effect(() => {
41474
42145
  if ($$props.params) {
@@ -41691,23 +42362,20 @@
41691
42362
  const newEntity = $entity().guid == null;
41692
42363
 
41693
42364
  try {
41694
- if (await $entity().$save()) {
41695
- await readyEntity();
41696
- set(success, true);
41697
-
41698
- if (newEntity) {
41699
- $$props.router.navigate(`/groups/edit/${encodeURIComponent($entity().guid || '')}`, { historyAPIMethod: 'replaceState' });
41700
- }
42365
+ await $entity().$save();
42366
+ await readyEntity();
42367
+ set(success, true);
41701
42368
 
41702
- setTimeout(
41703
- () => {
41704
- set(success, undefined);
41705
- },
41706
- 1000
41707
- );
41708
- } else {
41709
- set(failureMessage, 'Error saving group.');
42369
+ if (newEntity) {
42370
+ replace(`/groups/edit/${encodeURIComponent($entity().guid || '')}`);
41710
42371
  }
42372
+
42373
+ setTimeout(
42374
+ () => {
42375
+ set(success, undefined);
42376
+ },
42377
+ 1000
42378
+ );
41711
42379
  } catch(e) {
41712
42380
  console.log('error:', e);
41713
42381
  set(failureMessage, e?.message, true);
@@ -41723,11 +42391,8 @@
41723
42391
  set(saving, true);
41724
42392
 
41725
42393
  try {
41726
- if (await $entity().$delete()) {
41727
- $$props.router.navigate('', { historyAPIMethod: 'back' });
41728
- } else {
41729
- set(failureMessage, 'An error occurred.');
41730
- }
42394
+ await $entity().$delete();
42395
+ pop();
41731
42396
  } catch(e) {
41732
42397
  set(failureMessage, e?.message, true);
41733
42398
  }
@@ -41756,7 +42421,7 @@
41756
42421
 
41757
42422
  IconButton(node_2, {
41758
42423
  title: 'Back',
41759
- onclick: () => $$props.router.navigate('', { historyAPIMethod: 'back' }),
42424
+ onclick: () => pop(),
41760
42425
  children: ($$anchor, $$slotProps) => {
41761
42426
  CommonIcon($$anchor, {
41762
42427
  tag: 'svg',
@@ -41787,10 +42452,11 @@
41787
42452
  var div_2 = root_2$1();
41788
42453
  var a = sibling(child(div_2));
41789
42454
  var text_1 = child(a);
42455
+ action(a, ($$node) => link?.($$node));
41790
42456
 
41791
42457
  template_effect(
41792
42458
  ($0, $1) => {
41793
- set_attribute(a, 'href', `#/users/edit/${$0 ?? ''}`);
42459
+ set_attribute(a, 'href', `/users/edit/${$0 ?? ''}`);
41794
42460
  set_text(text_1, $1);
41795
42461
  },
41796
42462
  [
@@ -42344,6 +43010,7 @@
42344
43010
  var fragment_37 = root_7$1();
42345
43011
  var a_2 = first_child(fragment_37);
42346
43012
  var text_11 = child(a_2);
43013
+ action(a_2, ($$node) => link?.($$node));
42347
43014
 
42348
43015
  var node_22 = sibling(a_2, 2);
42349
43016
 
@@ -42371,7 +43038,7 @@
42371
43038
 
42372
43039
  template_effect(
42373
43040
  ($0, $1) => {
42374
- set_attribute(a_2, 'href', `#/groups/edit/${$0 ?? ''}`);
43041
+ set_attribute(a_2, 'href', `/groups/edit/${$0 ?? ''}`);
42375
43042
  set_text(text_11, $1);
42376
43043
  },
42377
43044
  [
@@ -42926,7 +43593,7 @@
42926
43593
  }
42927
43594
 
42928
43595
  append($$anchor, fragment);
42929
- pop();
43596
+ pop$1();
42930
43597
  $$cleanup();
42931
43598
  }
42932
43599
 
@@ -42948,7 +43615,7 @@
42948
43615
  var root_7 = from_html(`<!> <div class="drawer-container"><!> <!> <!></div>`, 1);
42949
43616
 
42950
43617
  function App($$anchor, $$props) {
42951
- push($$props, true);
43618
+ push$1($$props, true);
42952
43619
 
42953
43620
  const $user = () => store_get(user, '$user', $$stores);
42954
43621
  const $clientConfig = () => store_get(clientConfig, '$clientConfig', $$stores);
@@ -42965,6 +43632,9 @@
42965
43632
  let tilmeldAdmin = state(void 0);
42966
43633
  let accountOpen = state(false);
42967
43634
 
43635
+ setContext('clientConfigStore', clientConfig);
43636
+ setContext('userStore', user);
43637
+
42968
43638
  user_effect(() => {
42969
43639
  if ($user()) {
42970
43640
  $user().$gatekeeper('tilmeld/admin').then((value) => set(tilmeldAdmin, value, true));
@@ -42975,77 +43645,31 @@
42975
43645
  }
42976
43646
  });
42977
43647
 
42978
- const router = new Navigo('/', { hash: true });
42979
- let CurrentRoute = state(proxy(Intro));
42980
- let params = state(proxy({}));
42981
-
42982
- router.hooks({
42983
- before(done, match) {
42984
- if (mainContent) {
42985
- set(drawerOpen, false);
42986
- mainContent.scrollTop = 0;
42987
- }
42988
-
42989
- set(currentMatch, match, true);
42990
- done();
42991
- }
42992
- });
42993
-
42994
- router.on({
42995
- '/': () => {
42996
- set(CurrentRoute, Intro, true);
42997
- set(params, {}, true);
42998
- },
42999
-
43000
- '/users/edit/:guid': ({ data }) => {
43001
- set(CurrentRoute, UserEdit, true);
43002
- set(params, data, true);
43003
- },
43004
-
43005
- '/users/': () => {
43006
- set(CurrentRoute, Users, true);
43007
- set(params, {}, true);
43008
- },
43009
-
43010
- '/users/:query?': ({ data }) => {
43011
- set(CurrentRoute, Users, true);
43012
- set(params, data, true);
43013
- },
43014
-
43015
- '/groups/edit/:guid': ({ data }) => {
43016
- set(CurrentRoute, GroupEdit, true);
43017
- set(params, data, true);
43018
- },
43648
+ let currentRoute = state('/');
43019
43649
 
43020
- '/groups/': () => {
43021
- set(CurrentRoute, Groups, true);
43022
- set(params, {}, true);
43023
- },
43024
-
43025
- '/groups/:query?': ({ data }) => {
43026
- set(CurrentRoute, Groups, true);
43027
- set(params, data, true);
43028
- }
43029
- });
43650
+ const routes = {
43651
+ '/': Intro,
43652
+ '/users/edit/:guid': UserEdit,
43653
+ '/users/:query?': Users,
43654
+ '/groups/edit/:guid': GroupEdit,
43655
+ '/groups/:query?': Groups,
43656
+ '*': NotFound
43657
+ };
43030
43658
 
43031
- router.notFound(({ hashString }) => {
43032
- if (hashString === '') {
43033
- router.navigate('/', { historyAPIMethod: 'replaceState' });
43034
- } else {
43035
- set(CurrentRoute, NotFound, true);
43036
- set(params, {}, true);
43659
+ function onRouteLoaded(detail) {
43660
+ if (mainContent) {
43661
+ set(drawerOpen, false);
43662
+ mainContent.scrollTop = 0;
43037
43663
  }
43038
- });
43039
43664
 
43040
- let currentMatch = state(proxy(router.getCurrentLocation()));
43041
-
43042
- router.resolve();
43665
+ set(currentRoute, `${detail?.route ?? '/'}`);
43666
+ }
43043
43667
 
43044
43668
  const sections = [
43045
43669
  { name: 'Introduction', href: '/', absolute: true, indent: 0 },
43046
43670
  { name: 'sep1', separator: true },
43047
- { name: 'Users', href: 'users/', indent: 0 },
43048
- { name: 'Groups', href: 'groups/', indent: 0 }
43671
+ { name: 'Users', href: '/users/', indent: 0 },
43672
+ { name: 'Groups', href: '/groups/', indent: 0 }
43049
43673
  ];
43050
43674
 
43051
43675
  const onLogin = (currentUser) => {
@@ -43343,36 +43967,41 @@
43343
43967
 
43344
43968
  var alternate = ($$anchor) => {
43345
43969
  {
43346
- let $0 = user_derived(() => !('href' in get(section)));
43347
- let $1 = user_derived(() => 'href' in get(section) ? `#${get(section).href}` : undefined);
43970
+ let $0 = user_derived(() => [link]);
43971
+ let $1 = user_derived(() => !('href' in get(section)));
43972
+ let $2 = user_derived(() => 'href' in get(section) ? get(section).href : undefined);
43348
43973
 
43349
- let $2 = user_derived(() => get(section).absolute
43350
- ? `${get(currentMatch).route.path}/` === get(section).href
43351
- : `${get(currentMatch).route.path}/`.startsWith(get(section).href ?? '!'));
43974
+ let $3 = user_derived(() => get(section).absolute
43975
+ ? `${get(currentRoute)}` === get(section).href
43976
+ : `${get(currentRoute)}/`.startsWith(get(section).href ?? '!'));
43352
43977
 
43353
- let $3 = user_derived(() => get(section).indent
43978
+ let $4 = user_derived(() => get(section).indent
43354
43979
  ? 'margin-left: ' + get(section).indent * 25 + 'px;'
43355
43980
  : '');
43356
43981
 
43357
43982
  bind_this(
43358
43983
  Item($$anchor, {
43359
43984
  tag: 'a',
43360
- get nonInteractive() {
43985
+ get use() {
43361
43986
  return get($0);
43362
43987
  },
43363
43988
 
43364
- get href() {
43989
+ get nonInteractive() {
43365
43990
  return get($1);
43366
43991
  },
43367
43992
 
43368
- get activated() {
43993
+ get href() {
43369
43994
  return get($2);
43370
43995
  },
43371
43996
 
43372
- get style() {
43997
+ get activated() {
43373
43998
  return get($3);
43374
43999
  },
43375
44000
 
44001
+ get style() {
44002
+ return get($4);
44003
+ },
44004
+
43376
44005
  children: ($$anchor, $$slotProps) => {
43377
44006
  Text$1($$anchor, {
43378
44007
  class: 'mdc-theme--on-secondary',
@@ -43492,30 +44121,12 @@
43492
44121
 
43493
44122
  {
43494
44123
  var consequent_5 = ($$anchor) => {
43495
- var fragment_30 = comment();
43496
- var node_20 = first_child(fragment_30);
43497
-
43498
- component(node_20, () => get(CurrentRoute), ($$anchor, CurrentRoute_1) => {
43499
- CurrentRoute_1($$anchor, {
43500
- get router() {
43501
- return router;
43502
- },
43503
-
43504
- get params() {
43505
- return get(params);
43506
- },
43507
-
43508
- get clientConfig() {
43509
- return clientConfig;
43510
- },
43511
-
43512
- get user() {
43513
- return user;
43514
- }
43515
- });
44124
+ Router($$anchor, {
44125
+ get routes() {
44126
+ return routes;
44127
+ },
44128
+ onRouteLoaded
43516
44129
  });
43517
-
43518
- append($$anchor, fragment_30);
43519
44130
  };
43520
44131
 
43521
44132
  var alternate_2 = ($$anchor) => {
@@ -43534,9 +44145,9 @@
43534
44145
 
43535
44146
  var consequent_7 = ($$anchor) => {
43536
44147
  var section_1 = root_4();
43537
- var node_21 = child(section_1);
44148
+ var node_20 = child(section_1);
43538
44149
 
43539
- Login(node_21, {
44150
+ Login(node_20, {
43540
44151
  get User() {
43541
44152
  return User;
43542
44153
  },
@@ -43569,9 +44180,9 @@
43569
44180
  });
43570
44181
  }
43571
44182
 
43572
- var node_22 = sibling(node_18, 2);
44183
+ var node_21 = sibling(node_18, 2);
43573
44184
 
43574
- Account(node_22, {
44185
+ Account(node_21, {
43575
44186
  get User() {
43576
44187
  return User;
43577
44188
  },
@@ -43598,7 +44209,7 @@
43598
44209
  $$slots: { default: true }
43599
44210
  });
43600
44211
  append($$anchor, fragment);
43601
- pop();
44212
+ pop$1();
43602
44213
  $$cleanup();
43603
44214
  }
43604
44215