@htmlbricks/hb-messages-box 0.16.66 → 0.16.67

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/extra/docs.ts CHANGED
@@ -37,7 +37,98 @@ const defaultExampleMessages: Component["messages"] = [
37
37
  authorId: "2",
38
38
  },
39
39
  ];
40
+ const moreExampleMessages: Component["messages"] = [
41
+ ...defaultExampleMessages,
42
+ {
43
+ id: "3",
44
+ text: "How are you?",
45
+ timestamp: new Date(Date.now()),
46
+ type: "text",
47
+ status: "received",
48
+ authorId: "2",
49
+ },
50
+ {
51
+ id: "4",
52
+ text: "I'm fine, thanks",
53
+ timestamp: new Date(Date.now()),
54
+ type: "text",
55
+ status: "sent",
56
+ authorId: "1",
57
+ },
58
+ {
59
+ id: "5",
40
60
 
61
+ text: "What about you?",
62
+ timestamp: new Date(Date.now()),
63
+ type: "text",
64
+ status: "received",
65
+ authorId: "2",
66
+ },
67
+ {
68
+ id: "6",
69
+ text: "I'm fine too, thanks for asking",
70
+ timestamp: new Date(Date.now()),
71
+ type: "text",
72
+ status: "sent",
73
+ authorId: "1",
74
+ },
75
+ {
76
+ id: "7",
77
+ text: "You're welcome",
78
+ timestamp: new Date(Date.now()),
79
+ type: "text",
80
+ status: "received",
81
+ authorId: "2",
82
+ },
83
+ {
84
+ id: "8",
85
+ text: "Bye",
86
+ timestamp: new Date(Date.now()),
87
+ type: "text",
88
+ status: "sent",
89
+ authorId: "1",
90
+ },
91
+ {
92
+ id: "9",
93
+ text: "Bye",
94
+ timestamp: new Date(Date.now()),
95
+ type: "text",
96
+ status: "received",
97
+ authorId: "2",
98
+ },
99
+ {
100
+ id: "10",
101
+ text: "See you later",
102
+ timestamp: new Date(Date.now()),
103
+ type: "text",
104
+ status: "sent",
105
+ authorId: "1",
106
+ },
107
+ {
108
+ id: "11",
109
+ text: "See you later",
110
+ timestamp: new Date(Date.now()),
111
+ type: "text",
112
+ status: "received",
113
+ authorId: "2",
114
+ },
115
+ {
116
+ id: "12",
117
+ text: "Bye",
118
+ timestamp: new Date(Date.now()),
119
+ type: "text",
120
+ status: "sent",
121
+ authorId: "1",
122
+ },
123
+ {
124
+ id: "13",
125
+ text: "Bye",
126
+ timestamp: new Date(Date.now()),
127
+ type: "text",
128
+ status: "received",
129
+ authorId: "2",
130
+ },
131
+ ];
41
132
  const defaultExampleAuthors: Component["authors"] = [
42
133
  {
43
134
  id: "1",
@@ -70,6 +161,13 @@ const examples: { name: string; description?: string; data: Component }[] = [
70
161
  authors: defaultExampleAuthors,
71
162
  },
72
163
  },
164
+ {
165
+ name: "moreMessages",
166
+ data: {
167
+ messages: moreExampleMessages,
168
+ authors: defaultExampleAuthors,
169
+ },
170
+ },
73
171
  ];
74
172
  export const componentSetup: ComponentSetup & { examples: { name: string; description?: string; data: Component }[] } = {
75
173
  definitions: null as any,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@htmlbricks/hb-messages-box",
3
3
  "displayName": "Svelte-Bootstrap messages-box",
4
4
  "description": "Svelte-Bootstrap messages-box",
5
- "version": "0.16.66",
5
+ "version": "0.16.67",
6
6
  "main": "release/release.js",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -30,7 +30,7 @@
30
30
  "prepublish": "npm run build:release"
31
31
  },
32
32
  "devDependencies": {
33
- "@htmlbricks/hb-jsutils": "^0.16.66",
33
+ "@htmlbricks/hb-jsutils": "^0.16.67",
34
34
  "@htmlbricks/manifester": "^0.0.22",
35
35
  "@rollup/plugin-alias": "^3.1.2",
36
36
  "@rollup/plugin-commonjs": "^18.0.0",
@@ -75,7 +75,7 @@
75
75
  "webcomponents"
76
76
  ],
77
77
  "contributors": [],
78
- "gitHead": "baafacb74cae942a052b9fa04fca54cf7a7234eb",
78
+ "gitHead": "22a7b71ddcbd2581556a300f804a98d60d92aff7",
79
79
  "dependencies": {
80
80
  "style-to-object": "^0.3.0"
81
81
  }
package/release/docs.js CHANGED
@@ -1,3 +1,12 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
1
10
  export var storybookArgs = {
2
11
  messages: { control: { type: "object" } },
3
12
  authors: { control: { type: "object" } },
@@ -31,6 +40,96 @@ var defaultExampleMessages = [
31
40
  authorId: "2"
32
41
  },
33
42
  ];
43
+ var moreExampleMessages = __spreadArray(__spreadArray([], defaultExampleMessages, true), [
44
+ {
45
+ id: "3",
46
+ text: "How are you?",
47
+ timestamp: new Date(Date.now()),
48
+ type: "text",
49
+ status: "received",
50
+ authorId: "2"
51
+ },
52
+ {
53
+ id: "4",
54
+ text: "I'm fine, thanks",
55
+ timestamp: new Date(Date.now()),
56
+ type: "text",
57
+ status: "sent",
58
+ authorId: "1"
59
+ },
60
+ {
61
+ id: "5",
62
+ text: "What about you?",
63
+ timestamp: new Date(Date.now()),
64
+ type: "text",
65
+ status: "received",
66
+ authorId: "2"
67
+ },
68
+ {
69
+ id: "6",
70
+ text: "I'm fine too, thanks for asking",
71
+ timestamp: new Date(Date.now()),
72
+ type: "text",
73
+ status: "sent",
74
+ authorId: "1"
75
+ },
76
+ {
77
+ id: "7",
78
+ text: "You're welcome",
79
+ timestamp: new Date(Date.now()),
80
+ type: "text",
81
+ status: "received",
82
+ authorId: "2"
83
+ },
84
+ {
85
+ id: "8",
86
+ text: "Bye",
87
+ timestamp: new Date(Date.now()),
88
+ type: "text",
89
+ status: "sent",
90
+ authorId: "1"
91
+ },
92
+ {
93
+ id: "9",
94
+ text: "Bye",
95
+ timestamp: new Date(Date.now()),
96
+ type: "text",
97
+ status: "received",
98
+ authorId: "2"
99
+ },
100
+ {
101
+ id: "10",
102
+ text: "See you later",
103
+ timestamp: new Date(Date.now()),
104
+ type: "text",
105
+ status: "sent",
106
+ authorId: "1"
107
+ },
108
+ {
109
+ id: "11",
110
+ text: "See you later",
111
+ timestamp: new Date(Date.now()),
112
+ type: "text",
113
+ status: "received",
114
+ authorId: "2"
115
+ },
116
+ {
117
+ id: "12",
118
+ text: "Bye",
119
+ timestamp: new Date(Date.now()),
120
+ type: "text",
121
+ status: "sent",
122
+ authorId: "1"
123
+ },
124
+ {
125
+ id: "13",
126
+ text: "Bye",
127
+ timestamp: new Date(Date.now()),
128
+ type: "text",
129
+ status: "received",
130
+ authorId: "2"
131
+ },
132
+ ], false);
34
133
  var defaultExampleAuthors = [
35
134
  {
36
135
  id: "1",
@@ -62,6 +161,13 @@ var examples = [
62
161
  authors: defaultExampleAuthors
63
162
  }
64
163
  },
164
+ {
165
+ name: "moreMessages",
166
+ data: {
167
+ messages: moreExampleMessages,
168
+ authors: defaultExampleAuthors
169
+ }
170
+ },
65
171
  ];
66
172
  export var componentSetup = {
67
173
  definitions: null,
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../extra/docs.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,IAAM,aAAa,GAAG;IAC5B,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACzC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACxC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACxC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IACtC,WAAW,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;CAC3C,CAAC;AAEF,IAAM,OAAO,GAAa,EAAE,CAAC;AAC7B,MAAM,CAAC,IAAM,QAAQ,GAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC,CAAC;AACrG,M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AE,IAAW;IACnB,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE,IAAW;IAClB,SAAS,WAAA;IACT,IAAI,EAAE,aAAa;IACnB,QAAQ,UAAA;IACR,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAChF,UAAU,EAAE,WAAW;IACvB,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,CAAC,OAAO,CAAC;IACf,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,oBAAoB;IAC9B,QAAQ,EAAE,6BAA6B;IACvC,OAAO,EAAE,IAAW;CACpB,CAAC"}
package/release/docs.ts CHANGED
@@ -37,7 +37,98 @@ const defaultExampleMessages: Component["messages"] = [
37
37
  authorId: "2",
38
38
  },
39
39
  ];
40
+ const moreExampleMessages: Component["messages"] = [
41
+ ...defaultExampleMessages,
42
+ {
43
+ id: "3",
44
+ text: "How are you?",
45
+ timestamp: new Date(Date.now()),
46
+ type: "text",
47
+ status: "received",
48
+ authorId: "2",
49
+ },
50
+ {
51
+ id: "4",
52
+ text: "I'm fine, thanks",
53
+ timestamp: new Date(Date.now()),
54
+ type: "text",
55
+ status: "sent",
56
+ authorId: "1",
57
+ },
58
+ {
59
+ id: "5",
40
60
 
61
+ text: "What about you?",
62
+ timestamp: new Date(Date.now()),
63
+ type: "text",
64
+ status: "received",
65
+ authorId: "2",
66
+ },
67
+ {
68
+ id: "6",
69
+ text: "I'm fine too, thanks for asking",
70
+ timestamp: new Date(Date.now()),
71
+ type: "text",
72
+ status: "sent",
73
+ authorId: "1",
74
+ },
75
+ {
76
+ id: "7",
77
+ text: "You're welcome",
78
+ timestamp: new Date(Date.now()),
79
+ type: "text",
80
+ status: "received",
81
+ authorId: "2",
82
+ },
83
+ {
84
+ id: "8",
85
+ text: "Bye",
86
+ timestamp: new Date(Date.now()),
87
+ type: "text",
88
+ status: "sent",
89
+ authorId: "1",
90
+ },
91
+ {
92
+ id: "9",
93
+ text: "Bye",
94
+ timestamp: new Date(Date.now()),
95
+ type: "text",
96
+ status: "received",
97
+ authorId: "2",
98
+ },
99
+ {
100
+ id: "10",
101
+ text: "See you later",
102
+ timestamp: new Date(Date.now()),
103
+ type: "text",
104
+ status: "sent",
105
+ authorId: "1",
106
+ },
107
+ {
108
+ id: "11",
109
+ text: "See you later",
110
+ timestamp: new Date(Date.now()),
111
+ type: "text",
112
+ status: "received",
113
+ authorId: "2",
114
+ },
115
+ {
116
+ id: "12",
117
+ text: "Bye",
118
+ timestamp: new Date(Date.now()),
119
+ type: "text",
120
+ status: "sent",
121
+ authorId: "1",
122
+ },
123
+ {
124
+ id: "13",
125
+ text: "Bye",
126
+ timestamp: new Date(Date.now()),
127
+ type: "text",
128
+ status: "received",
129
+ authorId: "2",
130
+ },
131
+ ];
41
132
  const defaultExampleAuthors: Component["authors"] = [
42
133
  {
43
134
  id: "1",
@@ -70,6 +161,13 @@ const examples: { name: string; description?: string; data: Component }[] = [
70
161
  authors: defaultExampleAuthors,
71
162
  },
72
163
  },
164
+ {
165
+ name: "moreMessages",
166
+ data: {
167
+ messages: moreExampleMessages,
168
+ authors: defaultExampleAuthors,
169
+ },
170
+ },
73
171
  ];
74
172
  export const componentSetup: ComponentSetup & { examples: { name: string; description?: string; data: Component }[] } = {
75
173
  definitions: null as any,
@@ -240,7 +240,7 @@
240
240
  {
241
241
  "id": "1",
242
242
  "text": "Hello",
243
- "timestamp": "2023-01-04T23:37:33.558Z",
243
+ "timestamp": "2023-01-05T01:37:54.618Z",
244
244
  "type": "text",
245
245
  "status": "sent",
246
246
  "authorId": "1"
@@ -248,7 +248,7 @@
248
248
  {
249
249
  "id": "2",
250
250
  "text": "Hi",
251
- "timestamp": "2023-01-04T23:38:09.558Z",
251
+ "timestamp": "2023-01-05T01:38:30.618Z",
252
252
  "type": "text",
253
253
  "status": "received",
254
254
  "authorId": "2"
@@ -279,7 +279,7 @@
279
279
  {
280
280
  "id": "1",
281
281
  "text": "Hello",
282
- "timestamp": "2023-01-04T23:37:33.558Z",
282
+ "timestamp": "2023-01-05T01:37:54.618Z",
283
283
  "type": "text",
284
284
  "status": "sent",
285
285
  "authorId": "1"
@@ -287,7 +287,133 @@
287
287
  {
288
288
  "id": "2",
289
289
  "text": "Hi",
290
- "timestamp": "2023-01-04T23:38:09.558Z",
290
+ "timestamp": "2023-01-05T01:38:30.618Z",
291
+ "type": "text",
292
+ "status": "received",
293
+ "authorId": "2"
294
+ }
295
+ ],
296
+ "authors": [
297
+ {
298
+ "id": "1",
299
+ "name": "John",
300
+ "avatar": "https://i.pravatar.cc/300?img=1",
301
+ "status": "online",
302
+ "me": true
303
+ },
304
+ {
305
+ "id": "2",
306
+ "name": "Mary",
307
+ "avatar": "https://i.pravatar.cc/300?img=2",
308
+ "status": "online"
309
+ }
310
+ ]
311
+ }
312
+ },
313
+ {
314
+ "name": "moreMessages",
315
+ "data": {
316
+ "messages": [
317
+ {
318
+ "id": "1",
319
+ "text": "Hello",
320
+ "timestamp": "2023-01-05T01:37:54.618Z",
321
+ "type": "text",
322
+ "status": "sent",
323
+ "authorId": "1"
324
+ },
325
+ {
326
+ "id": "2",
327
+ "text": "Hi",
328
+ "timestamp": "2023-01-05T01:38:30.618Z",
329
+ "type": "text",
330
+ "status": "received",
331
+ "authorId": "2"
332
+ },
333
+ {
334
+ "id": "3",
335
+ "text": "How are you?",
336
+ "timestamp": "2023-01-05T01:38:30.618Z",
337
+ "type": "text",
338
+ "status": "received",
339
+ "authorId": "2"
340
+ },
341
+ {
342
+ "id": "4",
343
+ "text": "I'm fine, thanks",
344
+ "timestamp": "2023-01-05T01:38:30.618Z",
345
+ "type": "text",
346
+ "status": "sent",
347
+ "authorId": "1"
348
+ },
349
+ {
350
+ "id": "5",
351
+ "text": "What about you?",
352
+ "timestamp": "2023-01-05T01:38:30.618Z",
353
+ "type": "text",
354
+ "status": "received",
355
+ "authorId": "2"
356
+ },
357
+ {
358
+ "id": "6",
359
+ "text": "I'm fine too, thanks for asking",
360
+ "timestamp": "2023-01-05T01:38:30.618Z",
361
+ "type": "text",
362
+ "status": "sent",
363
+ "authorId": "1"
364
+ },
365
+ {
366
+ "id": "7",
367
+ "text": "You're welcome",
368
+ "timestamp": "2023-01-05T01:38:30.618Z",
369
+ "type": "text",
370
+ "status": "received",
371
+ "authorId": "2"
372
+ },
373
+ {
374
+ "id": "8",
375
+ "text": "Bye",
376
+ "timestamp": "2023-01-05T01:38:30.618Z",
377
+ "type": "text",
378
+ "status": "sent",
379
+ "authorId": "1"
380
+ },
381
+ {
382
+ "id": "9",
383
+ "text": "Bye",
384
+ "timestamp": "2023-01-05T01:38:30.618Z",
385
+ "type": "text",
386
+ "status": "received",
387
+ "authorId": "2"
388
+ },
389
+ {
390
+ "id": "10",
391
+ "text": "See you later",
392
+ "timestamp": "2023-01-05T01:38:30.618Z",
393
+ "type": "text",
394
+ "status": "sent",
395
+ "authorId": "1"
396
+ },
397
+ {
398
+ "id": "11",
399
+ "text": "See you later",
400
+ "timestamp": "2023-01-05T01:38:30.618Z",
401
+ "type": "text",
402
+ "status": "received",
403
+ "authorId": "2"
404
+ },
405
+ {
406
+ "id": "12",
407
+ "text": "Bye",
408
+ "timestamp": "2023-01-05T01:38:30.618Z",
409
+ "type": "text",
410
+ "status": "sent",
411
+ "authorId": "1"
412
+ },
413
+ {
414
+ "id": "13",
415
+ "text": "Bye",
416
+ "timestamp": "2023-01-05T01:38:30.618Z",
291
417
  "type": "text",
292
418
  "status": "received",
293
419
  "authorId": "2"
@@ -329,5 +455,5 @@
329
455
  "size": {},
330
456
  "iifePath": "release/release.js",
331
457
  "repoName": "@htmlbricks/hb-messages-box",
332
- "version": "0.16.66"
458
+ "version": "0.16.67"
333
459
  }
@@ -1,2 +1,2 @@
1
- var release=function(){"use strict";function t(){}function e(t){return t()}function o(){return Object.create(null)}function n(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let i,a;function l(t,e){return i||(i=document.createElement("a")),i.href=e,t===i.href}function c(t,e){t.appendChild(e)}function d(t,e,o){t.insertBefore(e,o||null)}function f(t){t.parentNode.removeChild(t)}function u(t){return document.createElement(t)}function p(t){return document.createTextNode(t)}function g(){return p(" ")}function m(){return p("")}function h(t,e,o,n){return t.addEventListener(e,o,n),()=>t.removeEventListener(e,o,n)}function b(t,e,o){null==o?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o)}function x(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function v(t,e){t.value=null==e?"":e}function y(t,e,o,n){null===o?t.style.removeProperty(e):t.style.setProperty(e,o,n?"important":"")}function $(t){const e={};for(const o of t)e[o.name]=o.value;return e}function w(t){a=t}function k(){if(!a)throw new Error("Function called outside component initialization");return a}function E(){const t=k();return(e,o,{cancelable:n=!1}={})=>{const r=t.$$.callbacks[e];if(r){const s=function(t,e,{bubbles:o=!1,cancelable:n=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,o,n,e),r}(e,o,{cancelable:n});return r.slice().forEach((e=>{e.call(t,s)})),!s.defaultPrevented}return!0}}const _=[],S=[],L=[],C=[],z=Promise.resolve();let D=!1;function T(t){L.push(t)}const j=new Set;let O=0;function A(){const t=a;do{for(;O<_.length;){const t=_[O];O++,w(t),M(t.$$)}for(w(null),_.length=0,O=0;S.length;)S.pop()();for(let t=0;t<L.length;t+=1){const e=L[t];j.has(e)||(j.add(e),e())}L.length=0}while(_.length);for(;C.length;)C.pop()();D=!1,j.clear(),w(t)}function M(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const N=new Set;function P(t,e){t&&t.i&&(N.delete(t),t.i(e))}function R(t,e){t.d(1),e.delete(t.key)}function I(t,e){-1===t.$$.dirty[0]&&(_.push(t),D||(D=!0,z.then(A)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function F(s,i,l,c,d,u,p,g=[-1]){const m=a;w(s);const h=s.$$={fragment:null,ctx:null,props:u,update:t,not_equal:d,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(m?m.$$.context:[])),callbacks:o(),dirty:g,skip_bound:!1,root:i.target||m.$$.root};p&&p(h.root);let b=!1;if(h.ctx=l?l(s,i.props||{},((t,e,...o)=>{const n=o.length?o[0]:e;return h.ctx&&d(h.ctx[t],h.ctx[t]=n)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](n),b&&I(s,t)),e})):[],h.update(),b=!0,n(h.before_update),h.fragment=!!c&&c(h.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);h.fragment&&h.fragment.l(t),t.forEach(f)}else h.fragment&&h.fragment.c();i.intro&&P(s.$$.fragment),function(t,o,s,i){const{fragment:a,on_mount:l,on_destroy:c,after_update:d}=t.$$;a&&a.m(o,s),i||T((()=>{const o=l.map(e).filter(r);c?c.push(...o):n(o),t.$$.on_mount=[]})),d.forEach(T)}(s,i.target,i.anchor,i.customElement),A()}w(m)}let H;"function"==typeof HTMLElement&&(H=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,o){this[t]=o}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){!function(t,e){const o=t.$$;null!==o.fragment&&(n(o.on_destroy),o.fragment&&o.fragment.d(e),o.on_destroy=o.fragment=null,o.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(e),()=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var J=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,W=/\n/g,B=/^\s*/,q=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,K=/^:\s*/,V=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,G=/^[;\s]*/,Q=/^\s+|\s+$/g,U="";function X(t){return t?t.replace(Q,U):U}var Y,Z=function(t,e){var o,n=null;if(!t||"string"!=typeof t)return n;for(var r,s,i=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var o=1,n=1;function r(t){var e=t.match(W);e&&(o+=e.length);var r=t.lastIndexOf("\n");n=~r?t.length-r:n+t.length}function s(){var t={line:o,column:n};return function(e){return e.position=new i(t),c(),e}}function i(t){this.start=t,this.end={line:o,column:n},this.source=e.source}function a(r){var s=new Error(e.source+":"+o+":"+n+": "+r);if(s.reason=r,s.filename=e.source,s.line=o,s.column=n,s.source=t,!e.silent)throw s}function l(e){var o=e.exec(t);if(o){var n=o[0];return r(n),t=t.slice(n.length),o}}function c(){l(B)}function d(t){var e;for(t=t||[];e=f();)!1!==e&&t.push(e);return t}function f(){var e=s();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var o=2;U!=t.charAt(o)&&("*"!=t.charAt(o)||"/"!=t.charAt(o+1));)++o;if(o+=2,U===t.charAt(o-1))return a("End of comment missing");var i=t.slice(2,o-2);return n+=2,r(i),t=t.slice(o),n+=2,e({type:"comment",comment:i})}}function u(){var t=s(),e=l(q);if(e){if(f(),!l(K))return a("property missing ':'");var o=l(V),n=t({type:"declaration",property:X(e[0].replace(J,U)),value:o?X(o[0].replace(J,U)):U});return l(G),n}}return i.prototype.content=t,c(),function(){var t,e=[];for(d(e);t=u();)!1!==t&&(e.push(t),d(e));return e}()}(t),a="function"==typeof e,l=0,c=i.length;l<c;l++)r=(o=i[l]).property,s=o.value,a?e(r,s,o):s&&(n||(n={}),n[r]=s);return n};function tt(t,e,o){const n=t.slice();return n[0]=e[o],n}function et(t){let e,o,n,r,s,i,a,m,h,v,y,$,w,k,E,_,S,L,C,z,D=t[0].author.name+"",T=t[0].dateString+"",j=t[0].text+"";return{c(){e=u("div"),o=u("img"),r=g(),s=u("div"),i=u("div"),a=u("h4"),m=p(D),h=g(),v=u("h5"),y=u("i"),$=p(T),w=g(),k=u("hr"),E=g(),_=u("div"),S=p(j),L=g(),C=u("br"),z=g(),b(o,"alt",""),b(o,"class","img-circle medium-image"),l(o.src,n=t[0].author.avatar)||b(o,"src",n),b(y,"class","fa fa-clock-o"),b(i,"class","message-info"),b(_,"class","message-text"),b(s,"class","message-body"),b(e,"class","message info")},m(t,n){d(t,e,n),c(e,o),c(e,r),c(e,s),c(s,i),c(i,a),c(a,m),c(i,h),c(i,v),c(v,y),c(v,$),c(s,w),c(s,k),c(s,E),c(s,_),c(_,S),c(e,L),c(e,C),c(e,z)},p(t,e){2&e&&!l(o.src,n=t[0].author.avatar)&&b(o,"src",n),2&e&&D!==(D=t[0].author.name+"")&&x(m,D),2&e&&T!==(T=t[0].dateString+"")&&x($,T),2&e&&j!==(j=t[0].text+"")&&x(S,j)},d(t){t&&f(e)}}}function ot(t){let e,o,n,r,s,i,a,m,h,v,y,$,w,k,E,_,S,L,C,z,D,T=t[0].author.name+"",j=t[0].dateString+"",O=t[0].text+"";return{c(){e=u("div"),o=u("img"),r=g(),s=u("div"),i=u("div"),a=u("div"),m=u("h4"),h=p(T),v=g(),y=u("h5"),$=u("i"),w=p(j),k=g(),E=u("hr"),_=g(),S=u("div"),L=p(O),C=g(),z=u("br"),D=g(),b(o,"alt",""),b(o,"class","img-circle medium-image"),l(o.src,n=t[0].author.avatar)||b(o,"src",n),b($,"class","fa fa-clock-o"),b(a,"class","message-info"),b(S,"class","message-text"),b(i,"class","message-body-inner"),b(s,"class","message-body"),b(e,"class","message my-message")},m(t,n){d(t,e,n),c(e,o),c(e,r),c(e,s),c(s,i),c(i,a),c(a,m),c(m,h),c(a,v),c(a,y),c(y,$),c(y,w),c(i,k),c(i,E),c(i,_),c(i,S),c(S,L),c(e,C),c(e,z),c(e,D)},p(t,e){2&e&&!l(o.src,n=t[0].author.avatar)&&b(o,"src",n),2&e&&T!==(T=t[0].author.name+"")&&x(h,T),2&e&&j!==(j=t[0].dateString+"")&&x(w,j),2&e&&O!==(O=t[0].text+"")&&x(L,O)},d(t){t&&f(e)}}}function nt(t,e){let o,n;function r(t,e){return t[0].author.me?ot:et}let s=r(e),i=s(e);return{key:t,first:null,c(){o=m(),i.c(),n=m(),this.first=o},m(t,e){d(t,o,e),i.m(t,e),d(t,n,e)},p(t,o){s===(s=r(e=t))&&i?i.p(e,o):(i.d(1),i=s(e),i&&(i.c(),i.m(n.parentNode,n)))},d(t){t&&f(o),i.d(t),t&&f(n)}}}function rt(t){let e;return{c(){e=u("i"),b(e,"class","bi bi-file-earmark-check-fill")},m(t,o){d(t,e,o)},d(t){t&&f(e)}}}function st(t){let e;return{c(){e=u("i"),b(e,"class","bi bi-paperclip")},m(t,o){d(t,e,o)},d(t){t&&f(e)}}}function it(e){let o,r,s,i,a,l,p,m,x,$,w,k,E,_,S,L,C,z,D=[],T=new Map,j=e[1];const O=t=>t[0].id;for(let t=0;t<j.length;t+=1){let o=tt(e,j,t),n=O(o);T.set(n,D[t]=nt(n,o))}function A(t,e){return t[3]?rt:st}let M=A(e),N=M(e);return{c(){o=u("link"),r=g(),s=u("div"),i=u("div");for(let t=0;t<D.length;t+=1)D[t].c();a=g(),l=u("div"),p=u("textarea"),m=g(),x=u("label"),$=u("input"),k=g(),N.c(),E=g(),_=u("button"),S=u("i"),this.c=t,b(o,"rel","stylesheet"),b(o,"href","https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css"),b(i,"class","chat-body"),b(p,"class","send-message-text"),b($,"type","file"),$.disabled=w=!!e[3],b(x,"class","upload-file"),y(x,"opacity",e[3]?"0.5":"0.25"),b(S,"class","bi bi-send-fill"),b(_,"type","button"),b(_,"class","send-message-button btn-info"),_.disabled=L=!e[2]?.length&&!e[3],y(_,"opacity",e[2]?.length||e[3]?"1":"0.25"),b(l,"class","chat-footer"),b(s,"class","message-chat")},m(t,n){c(document.head,o),d(t,r,n),d(t,s,n),c(s,i);for(let t=0;t<D.length;t+=1)D[t].m(i,null);c(s,a),c(s,l),c(l,p),v(p,e[2]),c(l,m),c(l,x),c(x,$),c(x,k),N.m(x,null),c(l,E),c(l,_),c(_,S),C||(z=[h(p,"input",e[10]),h($,"change",e[11]),h(_,"click",e[12])],C=!0)},p(t,[e]){2&e&&(j=t[1],D=function(t,e,o,n,r,s,i,a,l,c,d,f){let u=t.length,p=s.length,g=u;const m={};for(;g--;)m[t[g].key]=g;const h=[],b=new Map,x=new Map;for(g=p;g--;){const t=f(r,s,g),a=o(t);let l=i.get(a);l?n&&l.p(t,e):(l=c(a,t),l.c()),b.set(a,h[g]=l),a in m&&x.set(a,Math.abs(g-m[a]))}const v=new Set,y=new Set;function $(t){P(t,1),t.m(a,d),i.set(t.key,t),d=t.first,p--}for(;u&&p;){const e=h[p-1],o=t[u-1],n=e.key,r=o.key;e===o?(d=e.first,u--,p--):b.has(r)?!i.has(n)||v.has(n)?$(e):y.has(r)?u--:x.get(n)>x.get(r)?(y.add(n),$(e)):(v.add(r),u--):(l(o,i),u--)}for(;u--;){const e=t[u];b.has(e.key)||l(e,i)}for(;p;)$(h[p-1]);return h}(D,e,O,1,t,j,T,i,R,nt,null,tt)),4&e&&v(p,t[2]),8&e&&w!==(w=!!t[3])&&($.disabled=w),M!==(M=A(t))&&(N.d(1),N=M(t),N&&(N.c(),N.m(x,null))),8&e&&y(x,"opacity",t[3]?"0.5":"0.25"),12&e&&L!==(L=!t[2]?.length&&!t[3])&&(_.disabled=L),12&e&&y(_,"opacity",t[2]?.length||t[3]?"1":"0.25")},i:t,o:t,d(t){f(o),t&&f(r),t&&f(s);for(let t=0;t<D.length;t+=1)D[t].d();N.d(),C=!1,n(z)}}}function at(t,e,o){const n=k(),r=E();let s,i,{id:a}=e,{style:l}=e,{messages:c}=e,{authors:d}=e,{options:f}=e,{message:u}=e,p=[];const g={};function m(){if(!(null==s?void 0:s.length)&&!i)return console.warn("no message to send");var t,e;console.log("send message "+s),r(t="sendMessage",e={text:s,id:a,file:i}),n.dispatchEvent&&n.dispatchEvent(new CustomEvent(t,{detail:e})),s&&(o(0,u=""),o(2,s=""))}return t.$$set=t=>{"id"in t&&o(5,a=t.id),"style"in t&&o(9,l=t.style),"messages"in t&&o(6,c=t.messages),"authors"in t&&o(7,d=t.authors),"options"in t&&o(8,f=t.options),"message"in t&&o(0,u=t.message)},t.$$.update=()=>{if(995&t.$$.dirty){if(a||o(5,a=""),l&&Z(l),"string"==typeof f)try{o(8,f=JSON.parse(f))}catch(t){console.error("error parsing options",t)}if(f||o(8,f=g),"string"==typeof c)try{o(6,c=JSON.parse(c))}catch(t){console.error("error parsing messages",t)}if("string"==typeof d)try{o(7,d=JSON.parse(d))}catch(t){console.error("error parsing authors",t)}if((null==c?void 0:c.length)&&(null==d?void 0:d.length)){console.log("reload messages");const t=[];for(const e of c){const o=d.find((t=>t.id===e.authorId));if(o){const n=new Date(e.timestamp).toDateString()===(new Date).toDateString(),r=new Date(e.timestamp),s=r.toLocaleTimeString().split(":")[0]+":"+r.toLocaleTimeString().split(":")[1],i=r.toLocaleString().split(" ")[0]+" "+r.toLocaleTimeString().split(":")[0]+":"+r.toLocaleTimeString().split(":")[1],a=n?s:i;t.push(Object.assign(Object.assign({},e),{author:o,dateString:a}))}}o(1,p=t)}u&&o(2,s=u),console.info("messages are",p)}},[u,p,s,i,m,a,c,d,f,l,function(){s=this.value,o(2,s)},function(){i=this.value,o(3,i)},()=>m()]}(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var o,n,r="";if(t&&(null==e?void 0:e.length)&&(null===(o=Object.keys(t))||void 0===o?void 0:o.length)&&(null===(n=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===n?void 0:n.length))for(var s=function(o){(null==e?void 0:e.filter((function(e){return e.name===o&&e.defaultValue!==t[o]})))&&(r+="".concat(o,":").concat(t[o],";"))},i=0,a=Object.keys(t);i<a.length;i++)s(a[i]);return r},e.addComponent=function(t){var e,o=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!o)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var n=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(o+"-script"))try{var r=document.createElement("script");r.id=o+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(n),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var o=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,o){return t.getDictionaryWord(e,this.dictionary,o||this.lang)},t.prototype.translateDate=function(e,o,n){return t.formatDate(e,o,n||this.lang)},t.getDefaultLang=function(){var t,e,o,n,r,s="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(o=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===o?void 0:o.length)&&(s=null===(r=null===(n=navigator.languages[0])||void 0===n?void 0:n.split("-")[0])||void 0===r?void 0:r.toLowerCase()),s},t.getDictionaryWord=function(e,o,n){var r;if(!e)throw new Error("no wordKey provided");if(!o)throw new Error("no dictionary provided");if(n&&(null===(r=o[n])||void 0===r?void 0:r[e]))return o[n][e];var s="",i=t.getDefaultLang();if(!n||i!==n){var a=null==o?void 0:o[i];(null==a?void 0:a[e])&&(s=a[e])}return s},t.formatDate=function(e,o,n){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(n||t.getDefaultLang(),o).format(e)},t}();e.LanguageTranslator=o})(Y={exports:{}},Y.exports);class lt extends H{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{font-family:"Roboto", sans-serif;margin-top:20px;background:#eee}.medium-image{width:45px;height:45px;margin-right:5px}.img-circle{border-radius:50%}@media screen and (min-color-index: 0) and (-webkit-min-device-pixel-ratio: 0){}.message-body{background-color:#fbfcff;height:100%;width:calc(100% - 305px);float:right}.message-chat{width:100%;overflow:hidden}.chat-body{width:calc(100% + 17px);min-height:290px;height:calc(100vh - 320px);background-color:#fbfcff;margin-bottom:30px;padding:30px 5px 5px 5px;overflow-y:scroll}.message{position:relative;width:100%}.message br{clear:both}.message .message-body{position:relative;width:auto;max-width:calc(100% - 150px);float:left;background-color:#fff;border-radius:4px;border:1px solid #dbe3e8;margin:0 5px 20px 15px;color:#788288}.message:after{content:"";position:absolute;top:11px;left:63px;float:left;z-index:100;border-top:10px solid transparent;border-left:none;border-bottom:10px solid transparent;border-right:13px solid #fff}.message:before{content:"";position:absolute;top:10px;left:62px;float:left;z-index:99;border-top:11px solid transparent;border-left:none;border-bottom:11px solid transparent;border-right:13px solid #dbe3e8}.message .medium-image{float:left;margin-left:10px}.message .message-info{width:100%;height:22px}.message .message-info>h5>i{font-size:11px;font-weight:700;margin:0 2px 0 0;color:#a2b8c5}.message .message-info>h5{color:#a2b8c5;margin:8px 0 0 0;font-size:12px;float:right;padding-right:10px}.message .message-info>h4{font-size:14px;font-weight:600;margin:7px 13px 0 10px;color:#65addd;float:left}.message hr{margin:4px 2%;width:96%;opacity:0.75}.message .message-text{text-align:left;padding:3px 13px 10px 13px;font-size:14px}.message.my-message .message-body{float:right;margin:0 15px 20px 5px}.message.my-message:after{content:"";position:absolute;top:11px;left:auto;right:63px;float:left;z-index:100;border-top:10px solid transparent;border-left:13px solid #fff;border-bottom:10px solid transparent;border-right:none}.message.my-message:before{content:"";position:absolute;top:10px;left:auto;right:62px;float:left;z-index:99;border-top:11px solid transparent;border-left:13px solid #dbe3e8;border-bottom:11px solid transparent;border-right:none}.message.my-message .medium-image{float:right;margin-left:5px;margin-right:10px}.message.my-message .message-info>h5{float:left;padding-left:10px;padding-right:0}.message.my-message .message-info>h4{float:right}.message.info .message-body{background-color:#2da9e9;border:1px solid #2da9e9;color:#fff}.message.info:after,.message.info:before{border-right:13px solid #2da9e9}.message.info .message-info>h4{color:#fff}.message.info .message-info>h5,.message.info .message-info>h5>i{color:#fff;opacity:0.9}.chat-footer{position:relative;padding:0 80px}.chat-footer .send-message-text{position:relative;display:block;width:calc(100% - 30px);min-height:55px;max-height:75px;background-color:#fff;border-radius:5px;font-size:13px;resize:vertical;outline:none;border:1px solid #e0e6eb;font-family:"Roboto", sans-serif}.chat-footer .send-message-button{display:block;position:absolute;width:35px;height:35px;right:0px;top:0;bottom:0;margin:auto;border:1px solid rgba(0, 0, 0, 0.05);outline:none;font-weight:600;border-radius:50%;padding:0;opacity:0.5;background-color:inherit}.chat-footer .send-message-button>i{font-size:16px;margin:0 0 0 -2px}.chat-footer label.upload-file input[type=file]{position:fixed;top:-1000px}.chat-footer .upload-file{display:block;position:absolute;right:60px;height:30px;font-size:20px;top:0;bottom:0;margin:auto}@media screen and (max-width: 767px){.message-body{width:100%;margin:20px 0;border:1px solid #dce2e9;background-color:#fff}.message .message-body{max-width:calc(100% - 85px)}.chat-footer{padding:0px 80px 0px 0px}}.profile-main .profile-info>div h4{font-size:16px;margin-bottom:0}.profile-main .profile-info>div h5{margin-top:5px;font-weight:500}@media screen and (max-width: 767px){}</style>',F(this,{target:this.shadowRoot,props:$(this.attributes),customElement:!0},at,it,s,{id:5,style:9,messages:6,authors:7,options:8,message:0},null),t&&(t.target&&d(t.target,this,t.anchor),t.props&&(this.$set(t.props),A()))}static get observedAttributes(){return["id","style","messages","authors","options","message"]}get id(){return this.$$.ctx[5]}set id(t){this.$$set({id:t}),A()}get style(){return this.$$.ctx[9]}set style(t){this.$$set({style:t}),A()}get messages(){return this.$$.ctx[6]}set messages(t){this.$$set({messages:t}),A()}get authors(){return this.$$.ctx[7]}set authors(t){this.$$set({authors:t}),A()}get options(){return this.$$.ctx[8]}set options(t){this.$$set({options:t}),A()}get message(){return this.$$.ctx[0]}set message(t){this.$$set({message:t}),A()}}return customElements.define("hb-messages-box",lt),lt}();
1
+ var release=function(){"use strict";function t(){}function e(t){return t()}function o(){return Object.create(null)}function n(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let i,a;function l(t,e){return i||(i=document.createElement("a")),i.href=e,t===i.href}function c(t,e){t.appendChild(e)}function d(t,e,o){t.insertBefore(e,o||null)}function f(t){t.parentNode.removeChild(t)}function u(t){return document.createElement(t)}function p(t){return document.createTextNode(t)}function g(){return p(" ")}function h(){return p("")}function m(t,e,o,n){return t.addEventListener(e,o,n),()=>t.removeEventListener(e,o,n)}function b(t,e,o){null==o?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o)}function x(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function v(t,e){t.value=null==e?"":e}function y(t,e,o,n){null===o?t.style.removeProperty(e):t.style.setProperty(e,o,n?"important":"")}function $(t){const e={};for(const o of t)e[o.name]=o.value;return e}function w(t){a=t}function k(){if(!a)throw new Error("Function called outside component initialization");return a}function E(){const t=k();return(e,o,{cancelable:n=!1}={})=>{const r=t.$$.callbacks[e];if(r){const s=function(t,e,{bubbles:o=!1,cancelable:n=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,o,n,e),r}(e,o,{cancelable:n});return r.slice().forEach((e=>{e.call(t,s)})),!s.defaultPrevented}return!0}}const _=[],S=[],L=[],C=[],D=Promise.resolve();let T=!1;function z(t){L.push(t)}const j=new Set;let O=0;function A(){const t=a;do{for(;O<_.length;){const t=_[O];O++,w(t),M(t.$$)}for(w(null),_.length=0,O=0;S.length;)S.pop()();for(let t=0;t<L.length;t+=1){const e=L[t];j.has(e)||(j.add(e),e())}L.length=0}while(_.length);for(;C.length;)C.pop()();T=!1,j.clear(),w(t)}function M(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(z)}}const N=new Set;function P(t,e){t&&t.i&&(N.delete(t),t.i(e))}function R(t,e){t.d(1),e.delete(t.key)}function I(t,e){-1===t.$$.dirty[0]&&(_.push(t),T||(T=!0,D.then(A)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function F(s,i,l,c,d,u,p,g=[-1]){const h=a;w(s);const m=s.$$={fragment:null,ctx:null,props:u,update:t,not_equal:d,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(h?h.$$.context:[])),callbacks:o(),dirty:g,skip_bound:!1,root:i.target||h.$$.root};p&&p(m.root);let b=!1;if(m.ctx=l?l(s,i.props||{},((t,e,...o)=>{const n=o.length?o[0]:e;return m.ctx&&d(m.ctx[t],m.ctx[t]=n)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](n),b&&I(s,t)),e})):[],m.update(),b=!0,n(m.before_update),m.fragment=!!c&&c(m.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);m.fragment&&m.fragment.l(t),t.forEach(f)}else m.fragment&&m.fragment.c();i.intro&&P(s.$$.fragment),function(t,o,s,i){const{fragment:a,on_mount:l,on_destroy:c,after_update:d}=t.$$;a&&a.m(o,s),i||z((()=>{const o=l.map(e).filter(r);c?c.push(...o):n(o),t.$$.on_mount=[]})),d.forEach(z)}(s,i.target,i.anchor,i.customElement),A()}w(h)}let H;"function"==typeof HTMLElement&&(H=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,o){this[t]=o}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){!function(t,e){const o=t.$$;null!==o.fragment&&(n(o.on_destroy),o.fragment&&o.fragment.d(e),o.on_destroy=o.fragment=null,o.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(e),()=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var J=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,W=/\n/g,B=/^\s*/,q=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,K=/^:\s*/,V=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,G=/^[;\s]*/,Q=/^\s+|\s+$/g,U="";function X(t){return t?t.replace(Q,U):U}var Y,Z=function(t,e){var o,n=null;if(!t||"string"!=typeof t)return n;for(var r,s,i=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var o=1,n=1;function r(t){var e=t.match(W);e&&(o+=e.length);var r=t.lastIndexOf("\n");n=~r?t.length-r:n+t.length}function s(){var t={line:o,column:n};return function(e){return e.position=new i(t),c(),e}}function i(t){this.start=t,this.end={line:o,column:n},this.source=e.source}function a(r){var s=new Error(e.source+":"+o+":"+n+": "+r);if(s.reason=r,s.filename=e.source,s.line=o,s.column=n,s.source=t,!e.silent)throw s}function l(e){var o=e.exec(t);if(o){var n=o[0];return r(n),t=t.slice(n.length),o}}function c(){l(B)}function d(t){var e;for(t=t||[];e=f();)!1!==e&&t.push(e);return t}function f(){var e=s();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var o=2;U!=t.charAt(o)&&("*"!=t.charAt(o)||"/"!=t.charAt(o+1));)++o;if(o+=2,U===t.charAt(o-1))return a("End of comment missing");var i=t.slice(2,o-2);return n+=2,r(i),t=t.slice(o),n+=2,e({type:"comment",comment:i})}}function u(){var t=s(),e=l(q);if(e){if(f(),!l(K))return a("property missing ':'");var o=l(V),n=t({type:"declaration",property:X(e[0].replace(J,U)),value:o?X(o[0].replace(J,U)):U});return l(G),n}}return i.prototype.content=t,c(),function(){var t,e=[];for(d(e);t=u();)!1!==t&&(e.push(t),d(e));return e}()}(t),a="function"==typeof e,l=0,c=i.length;l<c;l++)r=(o=i[l]).property,s=o.value,a?e(r,s,o):s&&(n||(n={}),n[r]=s);return n};function tt(t,e,o){const n=t.slice();return n[0]=e[o],n}function et(t){let e,o,n,r,s,i,a,h,m,v,y,$,w,k,E,_,S,L,C,D,T=t[0].author.name+"",z=t[0].dateString+"",j=t[0].text+"";return{c(){e=u("div"),o=u("img"),r=g(),s=u("div"),i=u("div"),a=u("h4"),h=p(T),m=g(),v=u("h5"),y=u("i"),$=p(z),w=g(),k=u("hr"),E=g(),_=u("div"),S=p(j),L=g(),C=u("br"),D=g(),b(o,"alt",""),b(o,"class","img-circle medium-image"),l(o.src,n=t[0].author.avatar)||b(o,"src",n),b(y,"class","fa fa-clock-o"),b(i,"class","message-info"),b(_,"class","message-text"),b(s,"class","message-body"),b(e,"class","message info")},m(t,n){d(t,e,n),c(e,o),c(e,r),c(e,s),c(s,i),c(i,a),c(a,h),c(i,m),c(i,v),c(v,y),c(v,$),c(s,w),c(s,k),c(s,E),c(s,_),c(_,S),c(e,L),c(e,C),c(e,D)},p(t,e){2&e&&!l(o.src,n=t[0].author.avatar)&&b(o,"src",n),2&e&&T!==(T=t[0].author.name+"")&&x(h,T),2&e&&z!==(z=t[0].dateString+"")&&x($,z),2&e&&j!==(j=t[0].text+"")&&x(S,j)},d(t){t&&f(e)}}}function ot(t){let e,o,n,r,s,i,a,h,m,v,y,$,w,k,E,_,S,L,C,D,T,z=t[0].author.name+"",j=t[0].dateString+"",O=t[0].text+"";return{c(){e=u("div"),o=u("img"),r=g(),s=u("div"),i=u("div"),a=u("div"),h=u("h4"),m=p(z),v=g(),y=u("h5"),$=u("i"),w=p(j),k=g(),E=u("hr"),_=g(),S=u("div"),L=p(O),C=g(),D=u("br"),T=g(),b(o,"alt",""),b(o,"class","img-circle medium-image"),l(o.src,n=t[0].author.avatar)||b(o,"src",n),b($,"class","fa fa-clock-o"),b(a,"class","message-info"),b(S,"class","message-text"),b(i,"class","message-body-inner"),b(s,"class","message-body"),b(e,"class","message my-message")},m(t,n){d(t,e,n),c(e,o),c(e,r),c(e,s),c(s,i),c(i,a),c(a,h),c(h,m),c(a,v),c(a,y),c(y,$),c(y,w),c(i,k),c(i,E),c(i,_),c(i,S),c(S,L),c(e,C),c(e,D),c(e,T)},p(t,e){2&e&&!l(o.src,n=t[0].author.avatar)&&b(o,"src",n),2&e&&z!==(z=t[0].author.name+"")&&x(m,z),2&e&&j!==(j=t[0].dateString+"")&&x(w,j),2&e&&O!==(O=t[0].text+"")&&x(L,O)},d(t){t&&f(e)}}}function nt(t,e){let o,n;function r(t,e){return t[0].author.me?ot:et}let s=r(e),i=s(e);return{key:t,first:null,c(){o=h(),i.c(),n=h(),this.first=o},m(t,e){d(t,o,e),i.m(t,e),d(t,n,e)},p(t,o){s===(s=r(e=t))&&i?i.p(e,o):(i.d(1),i=s(e),i&&(i.c(),i.m(n.parentNode,n)))},d(t){t&&f(o),i.d(t),t&&f(n)}}}function rt(t){let e;return{c(){e=u("i"),b(e,"class","bi bi-file-earmark-check-fill")},m(t,o){d(t,e,o)},d(t){t&&f(e)}}}function st(t){let e;return{c(){e=u("i"),b(e,"class","bi bi-paperclip")},m(t,o){d(t,e,o)},d(t){t&&f(e)}}}function it(e){let o,r,s,i,a,l,p,h,x,$,w,k,E,_,S,L,C,D,T=[],z=new Map,j=e[1];const O=t=>t[0].id;for(let t=0;t<j.length;t+=1){let o=tt(e,j,t),n=O(o);z.set(n,T[t]=nt(n,o))}function A(t,e){return t[3]?rt:st}let M=A(e),N=M(e);return{c(){o=u("link"),r=g(),s=u("div"),i=u("div");for(let t=0;t<T.length;t+=1)T[t].c();a=g(),l=u("div"),p=u("textarea"),h=g(),x=u("label"),$=u("input"),k=g(),N.c(),E=g(),_=u("button"),S=u("i"),this.c=t,b(o,"rel","stylesheet"),b(o,"href","https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css"),b(i,"class","chat-body"),b(p,"class","send-message-text"),b($,"type","file"),$.disabled=w=!!e[3],b(x,"class","upload-file"),y(x,"opacity",e[3]?"0.5":"0.25"),b(S,"class","bi bi-send-fill"),b(_,"type","button"),b(_,"class","send-message-button btn-info"),_.disabled=L=!e[2]?.length&&!e[3],y(_,"opacity",e[2]?.length||e[3]?"1":"0.25"),b(l,"class","chat-footer"),b(s,"class","message-chat")},m(t,n){c(document.head,o),d(t,r,n),d(t,s,n),c(s,i);for(let t=0;t<T.length;t+=1)T[t].m(i,null);c(s,a),c(s,l),c(l,p),v(p,e[2]),c(l,h),c(l,x),c(x,$),c(x,k),N.m(x,null),c(l,E),c(l,_),c(_,S),C||(D=[m(p,"input",e[10]),m($,"change",e[11]),m(_,"click",e[12])],C=!0)},p(t,[e]){2&e&&(j=t[1],T=function(t,e,o,n,r,s,i,a,l,c,d,f){let u=t.length,p=s.length,g=u;const h={};for(;g--;)h[t[g].key]=g;const m=[],b=new Map,x=new Map;for(g=p;g--;){const t=f(r,s,g),a=o(t);let l=i.get(a);l?n&&l.p(t,e):(l=c(a,t),l.c()),b.set(a,m[g]=l),a in h&&x.set(a,Math.abs(g-h[a]))}const v=new Set,y=new Set;function $(t){P(t,1),t.m(a,d),i.set(t.key,t),d=t.first,p--}for(;u&&p;){const e=m[p-1],o=t[u-1],n=e.key,r=o.key;e===o?(d=e.first,u--,p--):b.has(r)?!i.has(n)||v.has(n)?$(e):y.has(r)?u--:x.get(n)>x.get(r)?(y.add(n),$(e)):(v.add(r),u--):(l(o,i),u--)}for(;u--;){const e=t[u];b.has(e.key)||l(e,i)}for(;p;)$(m[p-1]);return m}(T,e,O,1,t,j,z,i,R,nt,null,tt)),4&e&&v(p,t[2]),8&e&&w!==(w=!!t[3])&&($.disabled=w),M!==(M=A(t))&&(N.d(1),N=M(t),N&&(N.c(),N.m(x,null))),8&e&&y(x,"opacity",t[3]?"0.5":"0.25"),12&e&&L!==(L=!t[2]?.length&&!t[3])&&(_.disabled=L),12&e&&y(_,"opacity",t[2]?.length||t[3]?"1":"0.25")},i:t,o:t,d(t){f(o),t&&f(r),t&&f(s);for(let t=0;t<T.length;t+=1)T[t].d();N.d(),C=!1,n(D)}}}function at(t,e,o){const n=k(),r=E();let s,i,{id:a}=e,{style:l}=e,{messages:c}=e,{authors:d}=e,{options:f}=e,{message:u}=e,p=[];const g={};function h(){if(!(null==s?void 0:s.length)&&!i)return console.warn("no message to send");var t,e;console.log("send message "+s),r(t="sendMessage",e={text:s,id:a,file:i}),n.dispatchEvent&&n.dispatchEvent(new CustomEvent(t,{detail:e})),s&&(o(0,u=""),o(2,s=""))}return t.$$set=t=>{"id"in t&&o(5,a=t.id),"style"in t&&o(9,l=t.style),"messages"in t&&o(6,c=t.messages),"authors"in t&&o(7,d=t.authors),"options"in t&&o(8,f=t.options),"message"in t&&o(0,u=t.message)},t.$$.update=()=>{if(995&t.$$.dirty){if(a||o(5,a=""),l&&Z(l),"string"==typeof f)try{o(8,f=JSON.parse(f))}catch(t){console.error("error parsing options",t)}if(f||o(8,f=g),"string"==typeof c)try{o(6,c=JSON.parse(c))}catch(t){console.error("error parsing messages",t)}if("string"==typeof d)try{o(7,d=JSON.parse(d))}catch(t){console.error("error parsing authors",t)}if((null==c?void 0:c.length)&&(null==d?void 0:d.length)){console.log("reload messages");const t=[];for(const e of c){const o=d.find((t=>t.id===e.authorId));if(o){const n=new Date(e.timestamp).toDateString()===(new Date).toDateString(),r=new Date(e.timestamp),s=r.toLocaleTimeString().split(":")[0]+":"+r.toLocaleTimeString().split(":")[1],i=r.toLocaleString().split(" ")[0]+" "+r.toLocaleTimeString().split(":")[0]+":"+r.toLocaleTimeString().split(":")[1],a=n?s:i;t.push(Object.assign(Object.assign({},e),{author:o,dateString:a}))}}o(1,p=t)}u&&o(2,s=u),console.info("messages are",p)}},[u,p,s,i,h,a,c,d,f,l,function(){s=this.value,o(2,s)},function(){i=this.value,o(3,i)},()=>h()]}(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var o,n,r="";if(t&&(null==e?void 0:e.length)&&(null===(o=Object.keys(t))||void 0===o?void 0:o.length)&&(null===(n=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===n?void 0:n.length))for(var s=function(o){(null==e?void 0:e.filter((function(e){return e.name===o&&e.defaultValue!==t[o]})))&&(r+="".concat(o,":").concat(t[o],";"))},i=0,a=Object.keys(t);i<a.length;i++)s(a[i]);return r},e.addComponent=function(t){var e,o=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!o)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var n=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(o+"-script"))try{var r=document.createElement("script");r.id=o+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(n),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var o=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,o){return t.getDictionaryWord(e,this.dictionary,o||this.lang)},t.prototype.translateDate=function(e,o,n){return t.formatDate(e,o,n||this.lang)},t.getDefaultLang=function(){var t,e,o,n,r,s="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(o=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===o?void 0:o.length)&&(s=null===(r=null===(n=navigator.languages[0])||void 0===n?void 0:n.split("-")[0])||void 0===r?void 0:r.toLowerCase()),s},t.getDictionaryWord=function(e,o,n){var r;if(!e)throw new Error("no wordKey provided");if(!o)throw new Error("no dictionary provided");if(n&&(null===(r=o[n])||void 0===r?void 0:r[e]))return o[n][e];var s="",i=t.getDefaultLang();if(!n||i!==n){var a=null==o?void 0:o[i];(null==a?void 0:a[e])&&(s=a[e])}return s},t.formatDate=function(e,o,n){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(n||t.getDefaultLang(),o).format(e)},t}();e.LanguageTranslator=o})(Y={exports:{}},Y.exports);class lt extends H{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{font-family:"Roboto", sans-serif;margin-top:20px;background:#eee}.medium-image{width:45px;height:45px;margin-right:5px}.img-circle{border-radius:50%}.message-body{background-color:#fbfcff;height:100%;width:calc(100% - 305px);float:right}.message-chat{width:100%;overflow-x:hidden;overflow-y:scroll}.chat-body{width:100%;min-height:290px;background-color:#fbfcff;margin-bottom:30px;max-height:calc(100% - 100px);position:absolute;overflow-x:hidden}.message{position:relative;width:100%}.message br{clear:both}.message .message-body{position:relative;width:auto;max-width:calc(100% - 150px);float:left;background-color:#fff;border-radius:4px;border:1px solid #dbe3e8;margin:0 5px 20px 15px;color:#788288;overflow-x:hidden}.message:after{content:"";position:absolute;top:11px;left:63px;float:left;z-index:100;border-top:10px solid transparent;border-left:none;border-bottom:10px solid transparent;border-right:13px solid #fff}.message:before{content:"";position:absolute;top:10px;left:62px;float:left;z-index:99;border-top:11px solid transparent;border-left:none;border-bottom:11px solid transparent;border-right:13px solid #dbe3e8}.message .medium-image{float:left;margin-left:10px}.message .message-info{width:100%;height:22px}.message .message-info>h5>i{font-size:11px;font-weight:700;margin:0 2px 0 0;color:#a2b8c5}.message .message-info>h5{color:#a2b8c5;margin:8px 0 0 0;font-size:12px;float:right;padding-right:10px}.message .message-info>h4{font-size:14px;font-weight:600;margin:7px 13px 0 10px;color:#65addd;float:left}.message hr{margin:4px 2%;width:96%;opacity:0.75}.message .message-text{text-align:left;padding:3px 13px 10px 13px;font-size:14px}.message.my-message .message-body{float:right;margin:0 15px 20px 5px}.message.my-message:after{content:"";position:absolute;top:11px;left:auto;right:63px;float:left;z-index:100;border-top:10px solid transparent;border-left:13px solid #fff;border-bottom:10px solid transparent;border-right:none}.message.my-message:before{content:"";position:absolute;top:10px;left:auto;right:62px;float:left;z-index:99;border-top:11px solid transparent;border-left:13px solid #dbe3e8;border-bottom:11px solid transparent;border-right:none}.message.my-message .medium-image{float:right;margin-left:5px;margin-right:10px}.message.my-message .message-info>h5{float:left;padding-left:10px;padding-right:0}.message.my-message .message-info>h4{float:right}.message.info .message-body{background-color:#2da9e9;border:1px solid #2da9e9;color:#fff}.message.info:after,.message.info:before{border-right:13px solid #2da9e9}.message.info .message-info>h4{color:#fff}.message.info .message-info>h5,.message.info .message-info>h5>i{color:#fff;opacity:0.9}.chat-footer{position:absolute;width:calc(100% - 200px);top:calc(100% - 80px);padding:0px 80px 0px 80px;max-width:100%;overflow-x:hidden}.chat-footer .send-message-text{position:relative;display:block;width:calc(100% - 30px);min-height:55px;max-height:75px;background-color:#fff;border-radius:5px;font-size:13px;resize:vertical;outline:none;border:1px solid #e0e6eb;font-family:"Roboto", sans-serif}.chat-footer .send-message-button{display:block;position:absolute;width:35px;height:35px;right:10px;top:0;bottom:0;margin:auto;border:1px solid rgba(0, 0, 0, 0.05);outline:none;font-weight:600;border-radius:50%;padding:0;opacity:0.5;background-color:inherit}.chat-footer .send-message-button>i{font-size:16px;margin:0 0 0 -2px}.chat-footer label.upload-file input[type=file]{position:fixed;top:-1000px}.chat-footer .upload-file{display:block;position:absolute;right:60px;height:30px;font-size:20px;top:0;bottom:0;margin:auto}@media screen and (max-width: 767px){.message-body{width:100%;margin:20px 0;border:1px solid #dce2e9;background-color:#fff}.message .message-body{max-width:calc(100% - 85px)}.chat-footer{width:calc(100% - 100px);padding:0px 80px 0px 0px}.chat-footer .send-message-button{right:10px}.chat-footer .upload-file{right:60px}}</style>',F(this,{target:this.shadowRoot,props:$(this.attributes),customElement:!0},at,it,s,{id:5,style:9,messages:6,authors:7,options:8,message:0},null),t&&(t.target&&d(t.target,this,t.anchor),t.props&&(this.$set(t.props),A()))}static get observedAttributes(){return["id","style","messages","authors","options","message"]}get id(){return this.$$.ctx[5]}set id(t){this.$$set({id:t}),A()}get style(){return this.$$.ctx[9]}set style(t){this.$$set({style:t}),A()}get messages(){return this.$$.ctx[6]}set messages(t){this.$$set({messages:t}),A()}get authors(){return this.$$.ctx[7]}set authors(t){this.$$set({authors:t}),A()}get options(){return this.$$.ctx[8]}set options(t){this.$$set({options:t}),A()}get message(){return this.$$.ctx[0]}set message(t){this.$$set({message:t}),A()}}return customElements.define("hb-messages-box",lt),lt}();
2
2
  //# sourceMappingURL=release.js.map