@canton-network/core-wallet-ui-components 0.27.0 → 0.27.1

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/index.cjs CHANGED
@@ -20,7 +20,7 @@
20
20
  -webkit-text-size-adjust: 100%;
21
21
  -webkit-tap-highlight-color: transparent;
22
22
  }
23
- `];let v=Zr;const Ar=["/login","/wallets","/settings","/transactions","/approve","/","/404","/callback"];function ra(t){return Ar.includes(t)}const ea=Ar.filter(t=>t!=="/").sort((t,r)=>r.length-t.length);function ue(t){if(!t||t==="/")return"/";const r=t.replace(/\/+$/,"")||"/";return r==="/index.html"?"/":r.endsWith("/index.html")?r.slice(0,-11)||"/":r}function fe(t){const r=ue(t);if(r==="/")return"/";for(const e of ea)if(r===e||r.endsWith(`${e}`))return e;return null}function oa(t){const r=ue(t),e=fe(r);return e===null||e==="/"?r==="/"?"":r:r.slice(0,-e.length)||""}function pt(t,r=window.location.pathname){const e=oa(r),o=t.startsWith("/")?t:`/${t}`;return e?o==="/"?`${e}/`:`${e}${o}`:o}function aa(t,r=window.location.pathname){return pt(t==="/"?"/":`${t}/`,r)}var na=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,sr=(t,r,e,o)=>{for(var a=o>1?void 0:o?ia(r,e):r,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(o?n(r,e,a):n(a))||a);return o&&a&&na(r,e,a),a};class he extends Event{constructor(){super("logout",{bubbles:!0,composed:!0})}}exports.AppHeader=class extends v{constructor(){super(...arguments),this.iconSrc="images/icon.png",this.menuOpen=!1,this.darkMode=localStorage.getItem("theme")==="dark"}connectedCallback(){super.connectedCallback(),this.updateThemeAttribute()}updateThemeAttribute(){this.darkMode?this.setAttribute("theme","dark"):this.removeAttribute("theme")}toggleMenu(){this.menuOpen=!this.menuOpen}toggleTheme(){this.darkMode=!this.darkMode,localStorage.setItem("theme",this.darkMode?"dark":"light"),this.updateThemeAttribute()}navigateTo(r){window.location.href=pt(r)}async logout(){try{console.log("Logging out..."),this.dispatchEvent(new he)}catch(r){console.error("Error during logout:",r)}}render(){return p.html`
23
+ `];let v=Zr;const Ar=["/login","/wallets","/settings","/transactions","/approve","/","/404","/callback"];function ra(t){return Ar.includes(t)}const ea=Ar.filter(t=>t!=="/").sort((t,r)=>r.length-t.length);function ue(t){if(!t||t==="/")return"/";if(t.length>1e3)throw new Error("Path is too long");const r=t.replace(/\/+$/,"")||"/";return r==="/index.html"?"/":r.endsWith("/index.html")?r.slice(0,-11)||"/":r}function fe(t){const r=ue(t);if(r==="/")return"/";for(const e of ea)if(r===e||r.endsWith(`${e}`))return e;return null}function oa(t){const r=ue(t),e=fe(r);return e===null||e==="/"?r==="/"?"":r:r.slice(0,-e.length)||""}function pt(t,r=window.location.pathname){const e=oa(r),o=t.startsWith("/")?t:`/${t}`;return e?o==="/"?`${e}/`:`${e}${o}`:o}function aa(t,r=window.location.pathname){return pt(t==="/"?"/":`${t}/`,r)}var na=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,sr=(t,r,e,o)=>{for(var a=o>1?void 0:o?ia(r,e):r,i=t.length-1,n;i>=0;i--)(n=t[i])&&(a=(o?n(r,e,a):n(a))||a);return o&&a&&na(r,e,a),a};class he extends Event{constructor(){super("logout",{bubbles:!0,composed:!0})}}exports.AppHeader=class extends v{constructor(){super(...arguments),this.iconSrc="images/icon.png",this.menuOpen=!1,this.darkMode=localStorage.getItem("theme")==="dark"}connectedCallback(){super.connectedCallback(),this.updateThemeAttribute()}updateThemeAttribute(){this.darkMode?this.setAttribute("theme","dark"):this.removeAttribute("theme")}toggleMenu(){this.menuOpen=!this.menuOpen}toggleTheme(){this.darkMode=!this.darkMode,localStorage.setItem("theme",this.darkMode?"dark":"light"),this.updateThemeAttribute()}navigateTo(r){window.location.href=pt(r)}async logout(){try{console.log("Logging out..."),this.dispatchEvent(new he)}catch(r){console.error("Error during logout:",r)}}render(){return p.html`
24
24
  <header>
25
25
  <div class="logo-box" @click=${()=>this.navigateTo("/")}>
26
26
  <img src=${this.iconSrc} alt="App Icon" />Wallet Gateway