@telia-ace/alliance-ui 4.0.0-next.6 → 4.0.0-next.8
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/{chunk-TJ37YT5S.js → chunk-7XXQGMWO.js} +18 -16
- package/dist/{chunk-54QIKEP4.js → chunk-ALNVSJXY.js} +1 -1
- package/dist/{chunk-USRN3KLA.js → chunk-BJWFPFCA.js} +1 -1
- package/dist/chunk-DCXN3PRQ.js +7 -0
- package/dist/{chunk-LZEZ2U5O.js → chunk-WI5TQSZT.js} +1 -1
- package/dist/components/alliance-link/index.js +1 -1
- package/dist/components/alliance-modal/index.js +1 -1
- package/dist/components/alliance-table/index.js +1 -1
- package/dist/components/alliance-view/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-W3TP4NYJ.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as r,b as p,c as
|
|
1
|
+
import{a as r,b as p,c as n,e as l,g as b,h as e,j as u}from"./chunk-CNFJFZ6D.js";import{a}from"./chunk-JFKSI6I7.js";import{close as y}from"@teliads/components/icons";import{LitElement as m,css as f,html as i,unsafeCSS as t}from"lit";import{property as d,state as $}from"lit/decorators.js";import{repeat as v}from"lit/directives/repeat.js";var o=class extends m{constructor(){super();this.containStyling=()=>this.contain?i`<style>
|
|
2
2
|
:host {
|
|
3
3
|
height: 500px;
|
|
4
4
|
position: static;
|
|
@@ -26,7 +26,7 @@ import{a as r,b as p,c as a,e as l,g,h as e,j as u}from"./chunk-CNFJFZ6D.js";imp
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.header {
|
|
29
|
-
border-bottom: ${t(r.widthXs)} solid ${t(
|
|
29
|
+
border-bottom: ${t(r.widthXs)} solid ${t(n.gray200)};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.body {
|
|
@@ -38,7 +38,7 @@ import{a as r,b as p,c as a,e as l,g,h as e,j as u}from"./chunk-CNFJFZ6D.js";imp
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.footer {
|
|
41
|
-
border-top: ${t(r.widthXs)} solid ${t(
|
|
41
|
+
border-top: ${t(r.widthXs)} solid ${t(n.gray200)};
|
|
42
42
|
padding: ${t(e.spacing24)};
|
|
43
43
|
}
|
|
44
44
|
</style>`:i`<style>
|
|
@@ -68,8 +68,8 @@ import{a as r,b as p,c as a,e as l,g,h as e,j as u}from"./chunk-CNFJFZ6D.js";imp
|
|
|
68
68
|
@click=${this.onCloseClick}
|
|
69
69
|
><telia-icon size="md" svg="${y.svg}"
|
|
70
70
|
/></telia-button>`;this.footer=()=>this.actions.length?i`
|
|
71
|
-
<div class="footer">
|
|
72
|
-
${v(this.actions,({disabled:s,variant:c,action:h,label:
|
|
71
|
+
<div class="footer" data-testid="modal-footer">
|
|
72
|
+
${v(this.actions,({disabled:s,variant:c,action:h,label:g})=>i`
|
|
73
73
|
<telia-button
|
|
74
74
|
disabled="${s?"true":"false"}"
|
|
75
75
|
variant="${c||"primary"}"
|
|
@@ -77,11 +77,11 @@ import{a as r,b as p,c as a,e as l,g,h as e,j as u}from"./chunk-CNFJFZ6D.js";imp
|
|
|
77
77
|
@click=${()=>this.action(h)}
|
|
78
78
|
data-testid="${h}-action-button"
|
|
79
79
|
>
|
|
80
|
-
${
|
|
80
|
+
${g}
|
|
81
81
|
</telia-button>
|
|
82
82
|
`)}
|
|
83
83
|
</div>
|
|
84
|
-
`:"";this.onBackdropClick=()=>{if(!this.required)return this.action("close")};this.onCloseClick=()=>{if(!this.required)return this.action("close")};this.onKeyDown=s=>{s.defaultPrevented||!this.required&&s.key==="Escape"&&this.action("close")};this.onSubHeaderSlotChange=()=>{this.hasSubHeader=!0};this.action=s=>{let c=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{action:s},cancelable:!0});return this.dispatchEvent(c)};this.header="",this.actions=[],this.required=!1,this.scrollMode="outside",this.hasSubHeader=!1}static{this.styles
|
|
84
|
+
`:"";this.onBackdropClick=()=>{if(!this.required)return this.action("close")};this.onCloseClick=()=>{if(!this.required)return this.action("close")};this.onKeyDown=s=>{s.defaultPrevented||!this.required&&s.key==="Escape"&&this.action("close")};this.onSubHeaderSlotChange=()=>{this.hasSubHeader=!0};this.action=s=>{let c=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{action:s},cancelable:!0});return this.dispatchEvent(c)};this.header="",this.actions=[],this.required=!1,this.scrollMode="outside",this.hasSubHeader=!1}static{this.styles=f`
|
|
85
85
|
:host {
|
|
86
86
|
display: block;
|
|
87
87
|
inset: 0;
|
|
@@ -91,7 +91,7 @@ import{a as r,b as p,c as a,e as l,g,h as e,j as u}from"./chunk-CNFJFZ6D.js";imp
|
|
|
91
91
|
.backdrop {
|
|
92
92
|
inset: 0;
|
|
93
93
|
z-index: ${t(Number.parseInt(l.modal)-1)};
|
|
94
|
-
background-color: ${t(
|
|
94
|
+
background-color: ${t(n.black)};
|
|
95
95
|
opacity: 0.3;
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -104,9 +104,9 @@ import{a as r,b as p,c as a,e as l,g,h as e,j as u}from"./chunk-CNFJFZ6D.js";imp
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
dialog {
|
|
107
|
-
background-color: ${t(
|
|
107
|
+
background-color: ${t(n.white)};
|
|
108
108
|
border-radius: ${t(r.radiusLg)};
|
|
109
|
-
box-shadow: ${t(
|
|
109
|
+
box-shadow: ${t(b.md)};
|
|
110
110
|
z-index: ${t(Number.parseInt(l.modal))};
|
|
111
111
|
max-width: ${t(p.breakpointLg)};
|
|
112
112
|
position: static;
|
|
@@ -141,7 +141,7 @@ import{a as r,b as p,c as a,e as l,g,h as e,j as u}from"./chunk-CNFJFZ6D.js";imp
|
|
|
141
141
|
|
|
142
142
|
.sub-header {
|
|
143
143
|
padding: ${t(e.spacing24)} ${t(e.spacing32)};
|
|
144
|
-
border-bottom: ${t(r.widthXs)} solid ${t(
|
|
144
|
+
border-bottom: ${t(r.widthXs)} solid ${t(n.gray200)};
|
|
145
145
|
display: none;
|
|
146
146
|
}
|
|
147
147
|
|
|
@@ -159,17 +159,19 @@ import{a as r,b as p,c as a,e as l,g,h as e,j as u}from"./chunk-CNFJFZ6D.js";imp
|
|
|
159
159
|
<div class="backdrop" @click=${this.onBackdropClick}></div>
|
|
160
160
|
<div class="container">
|
|
161
161
|
<dialog open autofocus>
|
|
162
|
-
<div class="header">
|
|
163
|
-
<telia-heading tag="h3" variant="title-100"
|
|
162
|
+
<div class="header" data-testid="modal-heading">
|
|
163
|
+
<telia-heading tag="h3" variant="title-100">
|
|
164
|
+
${this.header}
|
|
165
|
+
</telia-heading>
|
|
164
166
|
${this.closeButton()}
|
|
165
167
|
</div>
|
|
166
|
-
<div class="sub-header">
|
|
168
|
+
<div class="sub-header" data-testid="modal-sub-header">
|
|
167
169
|
<slot name="sub-header" @slotchange=${this.onSubHeaderSlotChange}></slot>
|
|
168
170
|
</div>
|
|
169
|
-
<div class="body">
|
|
171
|
+
<div class="body" data-testid="modal-body">
|
|
170
172
|
<slot></slot>
|
|
171
173
|
</div>
|
|
172
174
|
${this.footer()}
|
|
173
175
|
</dialog>
|
|
174
176
|
</div>
|
|
175
|
-
`}};
|
|
177
|
+
`}};a([d({type:String,attribute:"header"})],o.prototype,"header",2),a([d({type:Array})],o.prototype,"actions",2),a([d({type:Boolean,attribute:"required"})],o.prototype,"required",2),a([d({type:String,attribute:"scroll-mode"})],o.prototype,"scrollMode",2),a([$()],o.prototype,"hasSubHeader",2),a([d({type:Boolean,attribute:"contain"})],o.prototype,"contain",2);export{o as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{a as p}from"./chunk-DCXN3PRQ.js";import{a as t}from"./chunk-JFKSI6I7.js";import{LitElement as c,css as h,html as l}from"lit";import{property as i}from"lit/decorators.js";var m="alliance-view-",u="app-view",y=(a=>(a.Main="main",a.Aside="aside",a.Body="body",a))(y||{});function f(r){return`${m}${r}`}function w(r,d){class e extends c{static{this.styles=h`
|
|
2
2
|
.loader {
|
|
3
3
|
background-color: rgba(255, 255, 255, 0.4);
|
|
4
4
|
z-index: var(--layer-dropdown);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as s,c as l}from"./chunk-
|
|
1
|
+
import{b as s,c as l}from"./chunk-DCXN3PRQ.js";import{a as e}from"./chunk-JFKSI6I7.js";import{LitElement as o,css as p,html as u}from"lit";import{property as r}from"lit/decorators.js";function d(i=""){return location.href.replace(location.origin,"").startsWith(i)}var t=class extends o{constructor(){super();this.navigate=()=>{this.active||(history.pushState({},"",this._href),window.dispatchEvent(new Event("popstate")))};this.clickHandler=a=>{!this.app||this.download||(a.preventDefault(),this.navigate())};this.updateActive=()=>{this.active=d(this._href)};this.computeHref=()=>{if(this.app){this._href=this.href=s(this.app,this.capability,this.args),this.updateActive();return}if(this.href){this.capability="",this._href=this.href;return}throw new Error("The <alliance-link> component requires either the 'app' property or 'href' property!")};this.args={},this.download=!1,this.target="_self",this.href=this._href="",this.capability="launch",this.active=!1}static{this.styles=p`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import g from"crypto";function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var v={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function h(e,t){function n(r,i,a){if(!(typeof document>"u")){a=d({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in a)a[c]&&(s+="; "+c,a[c]!==!0&&(s+="="+a[c].split(";")[0]));return document.cookie=r+"="+e.write(i,r)+s}}function o(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var i=document.cookie?document.cookie.split("; "):[],a={},s=0;s<i.length;s++){var c=i[s].split("="),N=c.slice(1).join("=");try{var m=decodeURIComponent(c[0]);if(a[m]=e.read(N,m),r===m)break}catch{}}return r?a[r]:a}}return Object.create({set:n,get:o,remove:function(r,i){n(r,"",d({},i,{expires:-1}))},withAttributes:function(r){return h(this.converter,d({},this.attributes,r))},withConverter:function(r){return h(d({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var z=h(v,{path:"/"});var E=(e=>(e[e.AlreadyInitialized=1e3]="AlreadyInitialized",e[e.NoAppName=1001]="NoAppName",e[e.MissingAppController=1002]="MissingAppController",e[e.MissingCapabilityOnApp=1003]="MissingCapabilityOnApp",e[e.MissingManagedObjectProvider=1004]="MissingManagedObjectProvider",e[e.NoManifest=1005]="NoManifest",e[e.NoRootElement=1006]="NoRootElement",e[e.NoView=1007]="NoView",e[e.CookieKeyNotDefined=1008]="CookieKeyNotDefined",e[e.CookieCategoryNotAllowed=1009]="CookieCategoryNotAllowed",e[e.StorageKeyNotDefined=1010]="StorageKeyNotDefined",e[e.StorageCategoryNotAllowed=1011]="StorageCategoryNotAllowed",e[e.LocalizationTemplateNotDefined=1012]="LocalizationTemplateNotDefined",e[e.NonViewOperation=1013]="NonViewOperation",e))(E||{}),k=(e=>(e[e.CurrentUserMissingProvider=2e3]="CurrentUserMissingProvider",e[e.CurrentUserGatewayNotStarted=2001]="CurrentUserGatewayNotStarted",e[e.CurrentUserMissingBackend=2002]="CurrentUserMissingBackend",e[e.CurrentUserMissingInDatabase=2003]="CurrentUserMissingInDatabase",e))(k||{});function b(e){if(!y(e))throw new Error("Parameter was not an error")}function y(e){return!!e&&typeof e=="object"&&j(e)==="[object Error]"||e instanceof Error}function j(e){return Object.prototype.toString.call(e)}var O="Layerr",T=O;function U(){return T}function $(e){let t,n="";if(e.length===0)t={};else if(y(e[0]))t={cause:e[0]},n=e.slice(1).join(" ")||"";else if(e[0]&&typeof e[0]=="object")t=Object.assign({},e[0]),n=e.slice(1).join(" ")||"";else if(typeof e[0]=="string")t={},n=n=e.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:t,shortMessage:n}}var u=class l extends Error{constructor(t,n){let o=[...arguments],{options:r,shortMessage:i}=$(o),a=i;if(r.cause&&(a=`${a}: ${r.cause.message}`),super(a),this.message=a,r.name&&typeof r.name=="string"?this.name=r.name:this.name=U(),r.cause&&Object.defineProperty(this,"_cause",{value:r.cause}),Object.defineProperty(this,"_info",{value:{}}),r.info&&typeof r.info=="object"&&Object.assign(this._info,r.info),Error.captureStackTrace){let s=r.constructorOpt||this.constructor;Error.captureStackTrace(this,s)}}static cause(t){return b(t),t._cause&&y(t._cause)?t._cause:null}static fullStack(t){b(t);let n=l.cause(t);return n?`${t.stack}
|
|
2
|
+
caused by: ${l.fullStack(n)}`:t.stack??""}static info(t){b(t);let n={},o=l.cause(t);return o&&Object.assign(n,l.info(o)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}},C="0123456789ABCDEFGHJKMNPQRSTVWXYZ",p=32,w=0xffffffffffff,A=10,I=16,f=Object.freeze({source:"ulid"});function M(e){let t=e||_(),n=t&&(t.crypto||t.msCrypto)||(typeof g<"u"?g:null);if(typeof n?.getRandomValues=="function")return()=>{let o=new Uint8Array(1);return n.getRandomValues(o),o[0]/255};if(typeof n?.randomBytes=="function")return()=>n.randomBytes(1).readUInt8()/255;if(g?.randomBytes)return()=>g.randomBytes(1).readUInt8()/255;throw new u({info:{code:"PRNG_DETECT",...f}},"Failed to find a reliable PRNG")}function _(){return D()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function R(e,t){let n="";for(;e>0;e--)n=L(t)+n;return n}function S(e,t){if(isNaN(e))throw new u({info:{code:"ENC_TIME_NAN",...f}},`Time must be a number: ${e}`);if(e>w)throw new u({info:{code:"ENC_TIME_SIZE_EXCEED",...f}},`Cannot encode a time larger than ${w}: ${e}`);if(e<0)throw new u({info:{code:"ENC_TIME_NEG",...f}},`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new u({info:{code:"ENC_TIME_TYPE",...f}},`Time must be an integer: ${e}`);let n,o="";for(let r=t;r>0;r--)n=e%p,o=C.charAt(n)+o,e=(e-n)/p;return o}function D(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function L(e){let t=Math.floor(e()*p);return t===p&&(t=p-1),C.charAt(t)}function P(e,t){let n=t||M(),o=isNaN(e)?Date.now():e;return S(o,A)+R(I,n)}function G(){return P().toLowerCase()}function x(e){let t=Object.entries(e).reduce((n,o)=>{let[r,i]=o;return typeof i>"u"||(typeof i=="object"&&i!==null?n[r]=JSON.stringify(i):n[r]=i),n},{});return Object.keys(t).length?`?${new URLSearchParams(t)}`:""}function F(e="",t="",n={}){let o=B().replace(location.origin,""),r=x(n);return e?t?`${o}/${e}/${t}${r}`:`${o}/${e}${r}`:`${o}${r}`}function B(){return globalThis.__ALLIANCE_RUNTIME_ROOT_URL?globalThis.__ALLIANCE_RUNTIME_ROOT_URL:window.origin}function K(e){return t=>{t.key==="Enter"&&e(t)}}export{G as a,F as b,K as c};
|
|
3
|
+
/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
js-cookie/dist/js.cookie.mjs:
|
|
6
|
+
(*! js-cookie v3.0.5 | MIT *)
|
|
7
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-BJWFPFCA.js";import"../../chunk-DCXN3PRQ.js";import"../../chunk-JFKSI6I7.js";export{a as Link};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-7XXQGMWO.js";import"../../chunk-H7ZWVNSK.js";import"../../chunk-BDQXACZ6.js";import"../../chunk-JZJUYJ7F.js";import"../../chunk-CNFJFZ6D.js";import"../../chunk-JFKSI6I7.js";export{a as Modal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../../chunk-WI5TQSZT.js";import"../../chunk-H7ZWVNSK.js";import"../../chunk-CNFJFZ6D.js";import"../../chunk-JFKSI6I7.js";export{a as Table,b as TableBody,c as TableData,d as TableHead,e as TableRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../../chunk-ALNVSJXY.js";import"../../chunk-DCXN3PRQ.js";import"../../chunk-JFKSI6I7.js";export{c as ViewElementType,e as registerViewElement,a as viewElementPrefix,b as viewElementSelector,d as viewElementTag};
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p,b as i,c as m,d as f,e as c}from"../chunk-
|
|
1
|
+
import{a as p,b as i,c as m,d as f,e as c}from"../chunk-WI5TQSZT.js";import{a as s}from"../chunk-3Y6W4IDL.js";import{a as b,b as x,c as y,d as h,e as P}from"../chunk-ALNVSJXY.js";import{a as t}from"../chunk-BJWFPFCA.js";import"../chunk-DCXN3PRQ.js";import{a as e}from"../chunk-7XXQGMWO.js";import"../chunk-H7ZWVNSK.js";import{a as r,b as a,c as n}from"../chunk-ERBUEZ5O.js";import"../chunk-AZ6GENL6.js";import"../chunk-BDQXACZ6.js";import"../chunk-JZJUYJ7F.js";import{a as l}from"../chunk-ZO3TGBYT.js";import"../chunk-QLXKAVKR.js";import"../chunk-CNFJFZ6D.js";import"../chunk-JFKSI6I7.js";var g=[["link",t],["modal",e],["unauthorized",s],["page-selector",r],["paginator-button",n],["paginator",a],["pop-over",l],["table",p],["tb",i],["td",m],["th",f],["tr",c]];for(let[u,d]of g){let o=`alliance-${u}`;customElements.get(o)||customElements.define(o,d)}export{y as ViewElementType,P as registerViewElement,b as viewElementPrefix,x as viewElementSelector,h as viewElementTag};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/alliance-ui",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.8",
|
|
4
4
|
"description": "UI components used by ACE Alliance apps.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lit": "^3.3.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@telia-ace/alliance-internal-client-utilities": "^4.0.0-next.
|
|
33
|
+
"@telia-ace/alliance-internal-client-utilities": "^4.0.0-next.8"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
package/dist/chunk-W3TP4NYJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import f from"crypto";var y=(e=>(e[e.AlreadyInitialized=1e3]="AlreadyInitialized",e[e.NoAppName=1001]="NoAppName",e[e.MissingAppController=1002]="MissingAppController",e[e.MissingCapabilityOnApp=1003]="MissingCapabilityOnApp",e[e.MissingManagedObjectProvider=1004]="MissingManagedObjectProvider",e[e.NoManifest=1005]="NoManifest",e[e.NoRootElement=1006]="NoRootElement",e[e.NoView=1007]="NoView",e[e.CookieKeyNotDefined=1008]="CookieKeyNotDefined",e[e.CookieCategoryNotAllowed=1009]="CookieCategoryNotAllowed",e[e.StorageKeyNotDefined=1010]="StorageKeyNotDefined",e[e.StorageCategoryNotAllowed=1011]="StorageCategoryNotAllowed",e[e.LocalizationTemplateNotDefined=1012]="LocalizationTemplateNotDefined",e[e.NonViewOperation=1013]="NonViewOperation",e))(y||{}),h=(e=>(e[e.CurrentUserMissingProvider=2e3]="CurrentUserMissingProvider",e[e.CurrentUserGatewayNotStarted=2001]="CurrentUserGatewayNotStarted",e[e.CurrentUserMissingBackend=2002]="CurrentUserMissingBackend",e[e.CurrentUserMissingInDatabase=2003]="CurrentUserMissingInDatabase",e))(h||{});function d(e){if(!p(e))throw new Error("Parameter was not an error")}function p(e){return!!e&&typeof e=="object"&&N(e)==="[object Error]"||e instanceof Error}function N(e){return Object.prototype.toString.call(e)}var w="Layerr",C=w;function E(){return C}function k(e){let t,r="";if(e.length===0)t={};else if(p(e[0]))t={cause:e[0]},r=e.slice(1).join(" ")||"";else if(e[0]&&typeof e[0]=="object")t=Object.assign({},e[0]),r=e.slice(1).join(" ")||"";else if(typeof e[0]=="string")t={},r=r=e.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:t,shortMessage:r}}var i=class s extends Error{constructor(t,r){let o=[...arguments],{options:n,shortMessage:a}=k(o),u=a;if(n.cause&&(u=`${u}: ${n.cause.message}`),super(u),this.message=u,n.name&&typeof n.name=="string"?this.name=n.name:this.name=E(),n.cause&&Object.defineProperty(this,"_cause",{value:n.cause}),Object.defineProperty(this,"_info",{value:{}}),n.info&&typeof n.info=="object"&&Object.assign(this._info,n.info),Error.captureStackTrace){let m=n.constructorOpt||this.constructor;Error.captureStackTrace(this,m)}}static cause(t){return d(t),t._cause&&p(t._cause)?t._cause:null}static fullStack(t){d(t);let r=s.cause(t);return r?`${t.stack}
|
|
2
|
-
caused by: ${s.fullStack(r)}`:t.stack??""}static info(t){d(t);let r={},o=s.cause(t);return o&&Object.assign(r,s.info(o)),t._info&&Object.assign(r,t._info),r}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}},b="0123456789ABCDEFGHJKMNPQRSTVWXYZ",c=32,g=0xffffffffffff,$=10,T=16,l=Object.freeze({source:"ulid"});function j(e){let t=e||O(),r=t&&(t.crypto||t.msCrypto)||(typeof f<"u"?f:null);if(typeof r?.getRandomValues=="function")return()=>{let o=new Uint8Array(1);return r.getRandomValues(o),o[0]/255};if(typeof r?.randomBytes=="function")return()=>r.randomBytes(1).readUInt8()/255;if(f?.randomBytes)return()=>f.randomBytes(1).readUInt8()/255;throw new i({info:{code:"PRNG_DETECT",...l}},"Failed to find a reliable PRNG")}function O(){return U()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function A(e,t){let r="";for(;e>0;e--)r=v(t)+r;return r}function M(e,t){if(isNaN(e))throw new i({info:{code:"ENC_TIME_NAN",...l}},`Time must be a number: ${e}`);if(e>g)throw new i({info:{code:"ENC_TIME_SIZE_EXCEED",...l}},`Cannot encode a time larger than ${g}: ${e}`);if(e<0)throw new i({info:{code:"ENC_TIME_NEG",...l}},`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new i({info:{code:"ENC_TIME_TYPE",...l}},`Time must be an integer: ${e}`);let r,o="";for(let n=t;n>0;n--)r=e%c,o=b.charAt(r)+o,e=(e-r)/c;return o}function U(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function v(e){let t=Math.floor(e()*c);return t===c&&(t=c-1),b.charAt(t)}function _(e,t){let r=t||j(),o=isNaN(e)?Date.now():e;return M(o,$)+A(T,r)}function D(){return _().toLowerCase()}function I(e){let t=Object.entries(e).reduce((r,o)=>{let[n,a]=o;return typeof a>"u"||(typeof a=="object"&&a!==null?r[n]=JSON.stringify(a):r[n]=a),r},{});return Object.keys(t).length?`?${new URLSearchParams(t)}`:""}function L(e="",t="",r={}){let o=S().replace(location.origin,""),n=I(r);return e?t?`${o}/${e}/${t}${n}`:`${o}/${e}${n}`:`${o}${n}`}function S(){return globalThis.__ALLIANCE_RUNTIME_ROOT_URL?globalThis.__ALLIANCE_RUNTIME_ROOT_URL:window.origin}function P(e){return t=>{t.key==="Enter"&&e(t)}}export{D as a,L as b,P as c};
|