@feedlog-ai/webcomponents 0.0.42 → 0.0.44
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/README.md +6 -0
- package/dist/{esm/purify.es-B8AIqnOZ.js → cjs/browser-MBNPN4qV.js} +49 -3
- package/dist/cjs/feedlog-button_3.cjs.entry.js +6 -5
- package/dist/cjs/feedlog-issues-client.cjs.entry.js +48 -72
- package/dist/cjs/feedlog-issues.cjs.entry.js +1 -1
- package/dist/cjs/feedlog-toolkit.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/feedlog-issue/feedlog-issue.js +5 -4
- package/dist/collection/components/feedlog-issues/feedlog-issues.js +4 -4
- package/dist/collection/components/feedlog-issues-client/feedlog-issues-client.js +47 -26
- package/dist/collection/components/feedlog-issues-list/feedlog-issues-list.js +3 -3
- package/dist/collection/utils/markdown.js +2 -1
- package/dist/components/feedlog-badge.js +1 -1
- package/dist/components/feedlog-button.js +1 -1
- package/dist/components/feedlog-card.js +1 -1
- package/dist/components/feedlog-issue.js +1 -1
- package/dist/components/feedlog-issues-client.js +1 -1
- package/dist/components/feedlog-issues-list.js +1 -1
- package/dist/components/feedlog-issues.js +1 -1
- package/dist/components/{p-DLNSSGDc.js → p-B-jbJSEa.js} +1 -1
- package/dist/components/p-BWpmSn38.js +1 -0
- package/dist/components/{p-DzATWlAC.js → p-C-bUP9VO.js} +1 -1
- package/dist/components/{p-DMdb-G26.js → p-CIASvKvr.js} +1 -1
- package/dist/components/p-Du-VNLmx.js +2 -0
- package/dist/{cjs/purify.es-CfCgypMZ.js → esm/browser-BFRt9b48.js} +46 -5
- package/dist/esm/feedlog-button_3.entry.js +6 -5
- package/dist/esm/feedlog-issues-client.entry.js +47 -71
- package/dist/esm/feedlog-issues.entry.js +1 -1
- package/dist/esm/feedlog-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/feedlog-toolkit/feedlog-toolkit.esm.js +1 -1
- package/dist/feedlog-toolkit/p-87583f75.entry.js +1 -0
- package/dist/feedlog-toolkit/{p-2901a753.entry.js → p-97d28b9d.entry.js} +1 -1
- package/dist/feedlog-toolkit/p-BFRt9b48.js +2 -0
- package/dist/feedlog-toolkit/{p-a7dcf9b6.entry.js → p-e8eb4cf5.entry.js} +1 -1
- package/dist/types/components/feedlog-issue/feedlog-issue.d.ts +2 -2
- package/dist/types/components/feedlog-issues/feedlog-issues.d.ts +2 -2
- package/dist/types/components/feedlog-issues-client/feedlog-issues-client.d.ts +4 -4
- package/dist/types/components/feedlog-issues-list/feedlog-issues-list.d.ts +2 -2
- package/dist/types/components.d.ts +14 -14
- package/dist/types/utils/markdown.d.ts +1 -0
- package/hydrate/index.js +97 -76
- package/hydrate/index.mjs +97 -76
- package/package.json +7 -4
- package/dist/components/p-RVHxnHRU.js +0 -1
- package/dist/components/p-TX_JzdfG.js +0 -3
- package/dist/feedlog-toolkit/p-0a9a5af2.entry.js +0 -1
- package/dist/feedlog-toolkit/p-B8AIqnOZ.js +0 -2
|
@@ -1,49 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-CgNWSmzU.js';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
function getDefaultExportFromCjs (x) {
|
|
5
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function getAugmentedNamespace(n) {
|
|
9
|
-
if (n.__esModule) return n;
|
|
10
|
-
var f = n.default;
|
|
11
|
-
if (typeof f == "function") {
|
|
12
|
-
var a = function a () {
|
|
13
|
-
if (this instanceof a) {
|
|
14
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
15
|
-
}
|
|
16
|
-
return f.apply(this, arguments);
|
|
17
|
-
};
|
|
18
|
-
a.prototype = f.prototype;
|
|
19
|
-
} else a = {};
|
|
20
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
21
|
-
Object.keys(n).forEach(function (k) {
|
|
22
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
23
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () {
|
|
26
|
-
return n[k];
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
return a;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var require$$0 = /*@__PURE__*/getAugmentedNamespace(purify_es);
|
|
34
|
-
|
|
35
|
-
var browser;
|
|
36
|
-
var hasRequiredBrowser;
|
|
37
|
-
|
|
38
|
-
function requireBrowser () {
|
|
39
|
-
if (hasRequiredBrowser) return browser;
|
|
40
|
-
hasRequiredBrowser = 1;
|
|
41
|
-
browser = self.DOMPurify || (self.DOMPurify = require$$0.default || require$$0);
|
|
42
|
-
return browser;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var browserExports = requireBrowser();
|
|
46
|
-
var DOMPurify = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
2
|
+
import { D as DOMPurify } from './browser-BFRt9b48.js';
|
|
47
3
|
|
|
48
4
|
/**
|
|
49
5
|
* HTML and XSS sanitization utilities
|
|
@@ -108,7 +64,7 @@ class FeedlogTimeoutError extends FeedlogError {
|
|
|
108
64
|
class FeedlogSDK {
|
|
109
65
|
constructor(config) {
|
|
110
66
|
this.config = {
|
|
111
|
-
credentials: '
|
|
67
|
+
credentials: 'same-origin',
|
|
112
68
|
...config,
|
|
113
69
|
};
|
|
114
70
|
this.apiKey = this.config.apiKey;
|
|
@@ -405,13 +361,17 @@ const FeedlogIssuesClient = class {
|
|
|
405
361
|
if (!this.sdk || this.isDisconnected) {
|
|
406
362
|
return;
|
|
407
363
|
}
|
|
408
|
-
const { issueId,
|
|
364
|
+
const { issueId, upvoted, upvoteCount } = event.detail;
|
|
365
|
+
const currentIssue = this.issues.find(issue => issue.id === issueId);
|
|
366
|
+
if (!currentIssue) {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
409
369
|
// Track request to handle race conditions
|
|
410
370
|
const requestId = (this.upvoteRequestIds.get(issueId) || 0) + 1;
|
|
411
371
|
this.upvoteRequestIds.set(issueId, requestId);
|
|
412
372
|
// Optimistic update
|
|
413
373
|
this.issues = this.issues.map(issue => issue.id === issueId
|
|
414
|
-
? Object.assign(Object.assign({}, issue), { hasUpvoted:
|
|
374
|
+
? Object.assign(Object.assign({}, issue), { hasUpvoted: upvoted, upvoteCount }) : issue);
|
|
415
375
|
try {
|
|
416
376
|
const result = await this.sdk.toggleUpvote(issueId);
|
|
417
377
|
// Ignore if component disconnected or request is stale
|
|
@@ -434,16 +394,13 @@ const FeedlogIssuesClient = class {
|
|
|
434
394
|
}
|
|
435
395
|
// Revert optimistic update on error
|
|
436
396
|
this.issues = this.issues.map(issue => issue.id === issueId
|
|
437
|
-
? Object.assign(Object.assign({}, issue), { hasUpvoted:
|
|
397
|
+
? Object.assign(Object.assign({}, issue), { hasUpvoted: currentIssue.hasUpvoted, upvoteCount: currentIssue.upvoteCount }) : issue);
|
|
438
398
|
const errorMsg = err instanceof Error ? err.message : 'Failed to toggle upvote';
|
|
439
399
|
this.feedlogError.emit({ error: errorMsg });
|
|
440
400
|
}
|
|
441
401
|
};
|
|
442
402
|
}
|
|
443
403
|
componentWillLoad() {
|
|
444
|
-
this.previousType = this.type;
|
|
445
|
-
this.previousLimit = this.limit;
|
|
446
|
-
this.previousSortBy = this.sortBy;
|
|
447
404
|
this.initializeSDK();
|
|
448
405
|
// Return the promise so SSR waits for the fetch before serializing HTML.
|
|
449
406
|
// During client hydration, skip fetch if we already have server-rendered data.
|
|
@@ -457,25 +414,27 @@ const FeedlogIssuesClient = class {
|
|
|
457
414
|
this.isDisconnected = true;
|
|
458
415
|
this.fetchRequestId++;
|
|
459
416
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
this.cursor = null;
|
|
470
|
-
this.hasMore = false;
|
|
471
|
-
this.issues = [];
|
|
472
|
-
void this.fetchIssues().catch(() => {
|
|
473
|
-
/* errors handled inside fetchIssues */
|
|
474
|
-
});
|
|
475
|
-
this.previousType = this.type;
|
|
476
|
-
this.previousLimit = this.limit;
|
|
477
|
-
this.previousSortBy = this.sortBy;
|
|
417
|
+
handleQueryParamChange(newValue, oldValue) {
|
|
418
|
+
if (newValue === oldValue) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
void this.resetAndRefetchIssues();
|
|
422
|
+
}
|
|
423
|
+
handleSdkConfigChange(newValue, oldValue) {
|
|
424
|
+
if (newValue === oldValue) {
|
|
425
|
+
return;
|
|
478
426
|
}
|
|
427
|
+
this.initializeSDK();
|
|
428
|
+
void this.resetAndRefetchIssues();
|
|
429
|
+
}
|
|
430
|
+
async resetAndRefetchIssues() {
|
|
431
|
+
// Invalidate any in-flight requests and reset derived state before reloading.
|
|
432
|
+
this.fetchRequestId++;
|
|
433
|
+
this.cursor = null;
|
|
434
|
+
this.hasMore = false;
|
|
435
|
+
this.issues = [];
|
|
436
|
+
this.upvoteRequestIds.clear();
|
|
437
|
+
await this.fetchIssues();
|
|
479
438
|
}
|
|
480
439
|
initializeSDK() {
|
|
481
440
|
try {
|
|
@@ -590,9 +549,26 @@ const FeedlogIssuesClient = class {
|
|
|
590
549
|
const style = hostBg
|
|
591
550
|
? { '--feedlog-background': hostBg }
|
|
592
551
|
: undefined;
|
|
593
|
-
return (h("feedlog-issues", { key: '
|
|
552
|
+
return (h("feedlog-issues", { key: 'd98b8366830171a8a09d01cc9e2b19a19850a5fd', style: style, issues: this.issues, limit: this.limit, maxWidth: this.maxWidth, theme: this.theme, heading: this.heading, subtitle: this.subtitle, emptyStateTitle: this.emptyStateTitle, emptyStateMessage: this.emptyStateMessage, getIssueUrl: this.getIssueUrl, loading: this.loading, error: this.error, hasMore: this.hasMore, isLoadingMore: this.isLoadingMore, onFeedlogUpvote: this.handleUpvote, onFeedlogLoadMore: async () => this.loadMore() }));
|
|
594
553
|
}
|
|
595
554
|
get el() { return getElement(this); }
|
|
555
|
+
static get watchers() { return {
|
|
556
|
+
"type": [{
|
|
557
|
+
"handleQueryParamChange": 0
|
|
558
|
+
}],
|
|
559
|
+
"limit": [{
|
|
560
|
+
"handleQueryParamChange": 0
|
|
561
|
+
}],
|
|
562
|
+
"sortBy": [{
|
|
563
|
+
"handleQueryParamChange": 0
|
|
564
|
+
}],
|
|
565
|
+
"apiKey": [{
|
|
566
|
+
"handleSdkConfigChange": 0
|
|
567
|
+
}],
|
|
568
|
+
"endpoint": [{
|
|
569
|
+
"handleSdkConfigChange": 0
|
|
570
|
+
}]
|
|
571
|
+
}; }
|
|
596
572
|
};
|
|
597
573
|
|
|
598
574
|
export { FeedlogIssuesClient as feedlog_issues_client };
|
|
@@ -54,7 +54,7 @@ const FeedlogIssues = class {
|
|
|
54
54
|
const containerStyle = {
|
|
55
55
|
maxWidth: this.maxWidth,
|
|
56
56
|
};
|
|
57
|
-
return (h(Host, { key: '
|
|
57
|
+
return (h(Host, { key: 'efed57e0c474b689a24e202f0fb6b67afd310572', class: this.theme === 'dark' ? 'dark' : '' }, h("div", { key: 'ddb7185c3ace088f2883b2dcd193beb8af213cf3', class: "issues-container", style: containerStyle }, (this.heading || this.subtitle) && (h("header", { key: '59aeafb96ac34de3ed7d0ecbd20f958dbc4d9ce9', class: "issues-header" }, h("div", { key: 'cba96e346d2e09c28cf253bca55e5bc822f69762', class: "header-content" }, this.heading && h("h1", { key: '7ce0ea76eb114c453a46592f2e5b1ea81b406cc4', class: "issues-title" }, this.heading), this.subtitle && h("p", { key: 'a83fbcc2baab2aeb2b72ff3dbfc03cd3c77a0278', class: "issues-subtitle" }, this.subtitle)))), this.loading && (h("div", { key: 'cf24d3838ef214697abfc2d8a03182e08e0ed6e7', class: "loading-state", role: "status", "aria-label": "Loading issues" }, h("div", { key: 'd2a1547e4cbd7f41518153d7a8ea757beb384088', class: "loading-skeletons" }, [1, 2, 3].map(i => (h("div", { key: i, class: "skeleton-card" }, h("div", { class: "skeleton-content" }, h("div", { class: "skeleton-header" }, h("div", { class: "skeleton-badge" }), h("div", { class: "skeleton-timestamp" })), h("div", { class: "skeleton-main" }, h("div", { class: "skeleton-title" }), h("div", { class: "skeleton-body" }, h("div", { class: "skeleton-line" }), h("div", { class: "skeleton-line short" })), h("div", { class: "skeleton-repo" })), h("div", { class: "skeleton-footer" }, h("div", { class: "skeleton-upvote" }))))))))), this.error && (h("div", { key: '79c70736a6ba731432ef2ba84c5902e52a2ed864', class: "error-state", role: "alert" }, h("div", { key: '31e987295d26e65c09187ae45e7305a46db27b32', class: "error-state-content" }, this.renderErrorIcon(), h("h2", { key: 'c030fb77e635ee6e50b9bebe16d8a97f75e2921c', class: "error-state-title" }, "Something went wrong"), h("p", { key: '5c725c8d65d304e58c06ce574366f7ab6f18ea59', class: "error-state-message" }, this.error)))), !this.loading && !this.error && (h("div", { key: '4217556c83dbd193eeed23ec50c40ec5fedbf420' }, this.renderIssuesList(), this.hasMore && (h("div", { key: 'df669ef16de0c2316715b97edd9c9af935e96464', class: "load-more-container" }, h("feedlog-button", { key: 'ba1498e81606245a55d0f428e8b3b7b0bf609367', onFeedlogClick: this.handleLoadMore, disabled: this.isLoadingMore, variant: "outline" }, this.isLoadingMore ? 'Loading...' : 'Load More Issues'))))))));
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
FeedlogIssues.style = feedlogIssuesCss();
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["feedlog-card",[[257,"feedlog-card"]]],["feedlog-badge",[[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-button_3",[[1,"feedlog-issues-list",{"issues":[16],"limit":[2],"theme":[1],"getIssueUrl":[16],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"currentPage":[32]},null,{"issues":[{"resetPage":0}],"limit":[{"resetPage":0}]}],[257,"feedlog-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1]}],[257,"feedlog-issue",{"issue":[16],"issueUrl":[1,"issue-url"],"theme":[1]}]]],["feedlog-issues",[[1,"feedlog-issues",{"issues":[16],"maxWidth":[1,"max-width"],"limit":[2],"theme":[
|
|
19
|
+
return bootstrapLazy([["feedlog-card",[[257,"feedlog-card"]]],["feedlog-badge",[[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-button_3",[[1,"feedlog-issues-list",{"issues":[16],"limit":[2],"theme":[1],"getIssueUrl":[16],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"currentPage":[32]},null,{"issues":[{"resetPage":0}],"limit":[{"resetPage":0}]}],[257,"feedlog-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1]}],[257,"feedlog-issue",{"issue":[16],"issueUrl":[1,"issue-url"],"theme":[1]}]]],["feedlog-issues",[[1,"feedlog-issues",{"issues":[16],"maxWidth":[1,"max-width"],"limit":[2],"theme":[1],"heading":[1],"subtitle":[1],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"loading":[4],"error":[1],"hasMore":[4,"has-more"],"isLoadingMore":[4,"is-loading-more"],"getIssueUrl":[16]}]]],["feedlog-issues-client",[[1,"feedlog-issues-client",{"apiKey":[1,"api-key"],"type":[1],"limit":[2],"sortBy":[1,"sort-by"],"endpoint":[1],"maxWidth":[1,"max-width"],"theme":[1],"heading":[1],"subtitle":[1],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"getIssueUrl":[16],"issues":[32],"loading":[32],"error":[32],"cursor":[32],"hasMore":[32],"isLoadingMore":[32]},null,{"type":[{"handleQueryParamChange":0}],"limit":[{"handleQueryParamChange":0}],"sortBy":[{"handleQueryParamChange":0}],"apiKey":[{"handleSdkConfigChange":0}],"endpoint":[{"handleSdkConfigChange":0}]}]]]], options);
|
|
20
20
|
});
|
package/dist/esm/loader.js
CHANGED
|
@@ -4,7 +4,7 @@ export { s as setNonce } from './index-CgNWSmzU.js';
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["feedlog-card",[[257,"feedlog-card"]]],["feedlog-badge",[[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-button_3",[[1,"feedlog-issues-list",{"issues":[16],"limit":[2],"theme":[1],"getIssueUrl":[16],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"currentPage":[32]},null,{"issues":[{"resetPage":0}],"limit":[{"resetPage":0}]}],[257,"feedlog-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1]}],[257,"feedlog-issue",{"issue":[16],"issueUrl":[1,"issue-url"],"theme":[1]}]]],["feedlog-issues",[[1,"feedlog-issues",{"issues":[16],"maxWidth":[1,"max-width"],"limit":[2],"theme":[
|
|
7
|
+
return bootstrapLazy([["feedlog-card",[[257,"feedlog-card"]]],["feedlog-badge",[[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-button_3",[[1,"feedlog-issues-list",{"issues":[16],"limit":[2],"theme":[1],"getIssueUrl":[16],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"currentPage":[32]},null,{"issues":[{"resetPage":0}],"limit":[{"resetPage":0}]}],[257,"feedlog-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1]}],[257,"feedlog-issue",{"issue":[16],"issueUrl":[1,"issue-url"],"theme":[1]}]]],["feedlog-issues",[[1,"feedlog-issues",{"issues":[16],"maxWidth":[1,"max-width"],"limit":[2],"theme":[1],"heading":[1],"subtitle":[1],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"loading":[4],"error":[1],"hasMore":[4,"has-more"],"isLoadingMore":[4,"is-loading-more"],"getIssueUrl":[16]}]]],["feedlog-issues-client",[[1,"feedlog-issues-client",{"apiKey":[1,"api-key"],"type":[1],"limit":[2],"sortBy":[1,"sort-by"],"endpoint":[1],"maxWidth":[1,"max-width"],"theme":[1],"heading":[1],"subtitle":[1],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"getIssueUrl":[16],"issues":[32],"loading":[32],"error":[32],"cursor":[32],"hasMore":[32],"isLoadingMore":[32]},null,{"type":[{"handleQueryParamChange":0}],"limit":[{"handleQueryParamChange":0}],"sortBy":[{"handleQueryParamChange":0}],"apiKey":[{"handleSdkConfigChange":0}],"endpoint":[{"handleSdkConfigChange":0}]}]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,g as t,b as a}from"./p-CgNWSmzU.js";export{s as setNonce}from"./p-CgNWSmzU.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),e(s)})().then((async e=>(await t(),a([["p-32663f65",[[257,"feedlog-card"]]],["p-da0268a8",[[257,"feedlog-badge",{variant:[1]}]]],["p-
|
|
1
|
+
import{p as e,g as t,b as a}from"./p-CgNWSmzU.js";export{s as setNonce}from"./p-CgNWSmzU.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),e(s)})().then((async e=>(await t(),a([["p-32663f65",[[257,"feedlog-card"]]],["p-da0268a8",[[257,"feedlog-badge",{variant:[1]}]]],["p-e8eb4cf5",[[1,"feedlog-issues-list",{issues:[16],limit:[2],theme:[1],getIssueUrl:[16],emptyStateTitle:[1,"empty-state-title"],emptyStateMessage:[1,"empty-state-message"],currentPage:[32]},null,{issues:[{resetPage:0}],limit:[{resetPage:0}]}],[257,"feedlog-button",{variant:[1],size:[1],disabled:[4],type:[1]}],[257,"feedlog-issue",{issue:[16],issueUrl:[1,"issue-url"],theme:[1]}]]],["p-97d28b9d",[[1,"feedlog-issues",{issues:[16],maxWidth:[1,"max-width"],limit:[2],theme:[1],heading:[1],subtitle:[1],emptyStateTitle:[1,"empty-state-title"],emptyStateMessage:[1,"empty-state-message"],loading:[4],error:[1],hasMore:[4,"has-more"],isLoadingMore:[4,"is-loading-more"],getIssueUrl:[16]}]]],["p-87583f75",[[1,"feedlog-issues-client",{apiKey:[1,"api-key"],type:[1],limit:[2],sortBy:[1,"sort-by"],endpoint:[1],maxWidth:[1,"max-width"],theme:[1],heading:[1],subtitle:[1],emptyStateTitle:[1,"empty-state-title"],emptyStateMessage:[1,"empty-state-message"],getIssueUrl:[16],issues:[32],loading:[32],error:[32],cursor:[32],hasMore:[32],isLoadingMore:[32]},null,{type:[{handleQueryParamChange:0}],limit:[{handleQueryParamChange:0}],sortBy:[{handleQueryParamChange:0}],apiKey:[{handleSdkConfigChange:0}],endpoint:[{handleSdkConfigChange:0}]}]]]],e))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as s,a as i}from"./p-CgNWSmzU.js";import{D as o}from"./p-BFRt9b48.js";function r(t){return"string"!=typeof t?"":o.sanitize(t,{USE_PROFILES:{html:!0}})}class n extends Error{constructor(t,e,s){super(t),this.statusCode=e,this.originalError=s,this.name="FeedlogError",Object.setPrototypeOf(this,n.prototype)}}class h extends n{constructor(t){super(t),this.name="FeedlogValidationError",Object.setPrototypeOf(this,h.prototype)}}class a extends n{constructor(t,e,s){super(t,e,s),this.name="FeedlogNetworkError",Object.setPrototypeOf(this,a.prototype)}}class u extends n{constructor(t="Request timed out"){super(t),this.name="FeedlogTimeoutError",Object.setPrototypeOf(this,u.prototype)}}class l{constructor(t){if(this.config={credentials:"same-origin",...t},this.apiKey=this.config.apiKey,!this.apiKey)throw new h("apiKey is required in FeedlogSDKConfig");this.endpoint=this.config.endpoint||"https://api.feedlog.app",this.timeout=this.config.timeout||3e4,this.endpoint=this.endpoint.replace(/\/$/,"")}async fetchIssues(t={}){try{const e=this.buildIssuesUrl(t),s=await this.fetchWithTimeout(e,{method:"GET",headers:this.getAuthHeaders(),credentials:this.config.credentials||"include"});if(!s.ok)throw new a(`Failed to fetch issues: ${s.statusText}`,s.status);const i=await s.json();return this.validateIssuesResponse(i)}catch(t){this.wrapFetchError(t,"Failed to fetch issues")}}async toggleUpvote(t){if(!t||"string"!=typeof t)throw new h("Issue ID is required");try{const e=`${this.endpoint}/api/issues/${encodeURIComponent(t)}/upvote`,s=await this.fetchWithTimeout(e,{method:"POST",headers:this.getAuthHeaders(),credentials:this.config.credentials||"include",body:JSON.stringify({})});if(404===s.status)throw new a("Issue not found",404);if(401===s.status)throw new a("Unauthorized",401);if(403===s.status)throw new a("Forbidden: Domain not allowed for this repository",403);if(!s.ok)throw new a(`Failed to toggle upvote: ${s.statusText}`,s.status);const i=await s.json();return this.validateUpvoteResponse(i)}catch(t){this.wrapFetchError(t,"Failed to toggle upvote")}}buildIssuesUrl(t){const e=new URL(`${this.endpoint}/api/issues`);if(t.repositoryIds){const s=Array.isArray(t.repositoryIds)?t.repositoryIds:[t.repositoryIds];for(const t of s)e.searchParams.append("repositoryIds",t)}if(t.type&&e.searchParams.set("type",t.type),t.sortBy&&e.searchParams.set("sortBy",t.sortBy),t.cursor&&e.searchParams.set("cursor",t.cursor),void 0!==t.limit){const s=Number(t.limit),i=Number.isFinite(s)?Math.max(1,Math.min(100,Math.floor(s))):10;e.searchParams.set("limit",String(i))}return e.toString()}getAuthHeaders(){return{"Content-Type":"application/json","x-api-key":this.apiKey}}wrapFetchError(t,e){if(t instanceof n)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new a("Network error: Unable to reach API",void 0,t);throw new n(`${e}: ${t instanceof Error?t.message:"Unknown error"}`,void 0,t)}async fetchWithTimeout(t,e){const s=new AbortController,i=setTimeout((()=>s.abort()),this.timeout);try{const o=await fetch(t,{...e,signal:s.signal});return clearTimeout(i),o}catch(t){if(clearTimeout(i),t instanceof Error&&"AbortError"===t.name)throw new u(`Request timed out after ${this.timeout}ms`);throw t}}validateIssuesResponse(t){if(!t||"object"!=typeof t)throw new h("Invalid API response: expected object");const e=t;if(!Array.isArray(e.issues))throw new h("Invalid API response: issues must be an array");if(!e.pagination||"object"!=typeof e.pagination)throw new h("Invalid API response: pagination is required");return{issues:e.issues.map((t=>this.validateIssue(t))),pagination:{cursor:e.pagination.cursor,hasMore:Boolean(e.pagination.hasMore)}}}validateIssue(t){if(!t||"object"!=typeof t)throw new h("Invalid issue: expected object");const e=t;if("string"!=typeof e.id)throw new h("Invalid issue: id is required and must be a string");if(!["bug","enhancement"].includes(String(e.type)))throw new h('Invalid issue: type must be "bug" or "enhancement"');if(!["open","in_progress","closed"].includes(String(e.status)))throw new h('Invalid issue: status must be "open", "in_progress", or "closed"');if(!e.repository||"object"!=typeof e.repository)throw new h("Invalid issue: repository is required");const s=e.repository;if("string"!=typeof s.id)throw new h("Invalid issue: repository must have id");const i=null!==e.githubIssueLink&&"string"==typeof e.githubIssueLink?String(e.githubIssueLink):null,o=e.title,n=null!=o&&""!==o?r(String(o)):null,a=e.body,u=null!=a&&""!==a?r(String(a)):null,l=s.name,d=null!=l&&""!==l?String(l):null,c=s.description,p=null!=c&&""!==c?r(String(c)):null,f="number"==typeof e.revision&&Number.isFinite(e.revision)?e.revision:1,g="number"==typeof e.upvoteCount&&Number.isFinite(e.upvoteCount)?e.upvoteCount:0,w="string"==typeof e.updatedAt&&e.updatedAt.length>0?e.updatedAt:(new Date).toISOString(),y="string"==typeof e.createdAt&&e.createdAt.length>0?e.createdAt:(new Date).toISOString();return{id:String(e.id),githubIssueLink:i,type:e.type||"bug",status:e.status||"open",pinnedAt:e.pinnedAt?String(e.pinnedAt):null,revision:f,title:n,body:u,repository:{id:String(s.id),name:d,description:p},updatedAt:w,createdAt:y,upvoteCount:g,hasUpvoted:Boolean(e.hasUpvoted)}}validateUpvoteResponse(t){if(!t||"object"!=typeof t)throw new h("Invalid upvote response: expected object");const e=t;if("boolean"!=typeof e.upvoted)throw new h("Invalid upvote response: upvoted must be a boolean");if("number"!=typeof e.upvoteCount)throw new h("Invalid upvote response: upvoteCount must be a number");if("string"!=typeof e.anonymousUserId)throw new h("Invalid upvote response: anonymousUserId must be a string");return{upvoted:e.upvoted,upvoteCount:e.upvoteCount,anonymousUserId:e.anonymousUserId}}getEndpoint(){return this.endpoint}getTimeout(){return this.timeout}}const d=class{constructor(s){t(this,s),this.feedlogUpvote=e(this,"feedlogUpvote"),this.feedlogError=e(this,"feedlogError"),this.maxWidth="42rem",this.theme="light",this.issues=[],this.loading=!0,this.error=null,this.cursor=null,this.hasMore=!1,this.isLoadingMore=!1,this.sdk=null,this.fetchRequestId=0,this.isDisconnected=!1,this.upvoteRequestIds=new Map,this.handleUpvote=async t=>{if(!this.sdk||this.isDisconnected)return;const{issueId:e,upvoted:s,upvoteCount:i}=t.detail,o=this.issues.find((t=>t.id===e));if(!o)return;const r=(this.upvoteRequestIds.get(e)||0)+1;this.upvoteRequestIds.set(e,r),this.issues=this.issues.map((t=>t.id===e?Object.assign(Object.assign({},t),{hasUpvoted:s,upvoteCount:i}):t));try{const t=await this.sdk.toggleUpvote(e);if(this.isDisconnected||this.upvoteRequestIds.get(e)!==r)return;this.issues=this.issues.map((s=>s.id===e?Object.assign(Object.assign({},s),{hasUpvoted:t.upvoted,upvoteCount:t.upvoteCount}):s)),this.feedlogUpvote.emit({issueId:e,upvoted:t.upvoted,upvoteCount:t.upvoteCount})}catch(t){if(this.isDisconnected||this.upvoteRequestIds.get(e)!==r)return;this.issues=this.issues.map((t=>t.id===e?Object.assign(Object.assign({},t),{hasUpvoted:o.hasUpvoted,upvoteCount:o.upvoteCount}):t));const s=t instanceof Error?t.message:"Failed to toggle upvote";this.feedlogError.emit({error:s})}}}componentWillLoad(){if(this.initializeSDK(),!(this.issues.length>0)||this.loading)return this.fetchIssues()}disconnectedCallback(){this.isDisconnected=!0,this.fetchRequestId++}handleQueryParamChange(t,e){t!==e&&this.resetAndRefetchIssues()}handleSdkConfigChange(t,e){t!==e&&(this.initializeSDK(),this.resetAndRefetchIssues())}async resetAndRefetchIssues(){this.fetchRequestId++,this.cursor=null,this.hasMore=!1,this.issues=[],this.upvoteRequestIds.clear(),await this.fetchIssues()}initializeSDK(){try{if(!this.apiKey)throw new Error("API key is required for the Feedlog SDK");this.sdk=new l(Object.assign({apiKey:this.apiKey},this.endpoint&&{endpoint:this.endpoint})),this.error=null}catch(t){const e=t instanceof Error?t.message:"Failed to initialize SDK";this.error=e,this.feedlogError.emit({error:e})}}buildFetchParams(){const t={};return this.type&&(t.type=this.type),this.sortBy&&(t.sortBy=this.sortBy),this.limit&&(t.limit=this.limit),this.cursor&&(t.cursor=this.cursor),t}async fetchIssues(){if(!this.sdk)return;const t=this.fetchRequestId;try{this.loading=!0,this.error=null;const e=this.buildFetchParams(),s=await this.sdk.fetchIssues(e);if(this.isDisconnected||t!==this.fetchRequestId)return;this.issues=s.issues,this.cursor=s.pagination.cursor,this.hasMore=s.pagination.hasMore}catch(e){if(this.isDisconnected||t!==this.fetchRequestId)return;const s=e instanceof Error?e.message:"Couldn't load updates";this.error=s,this.issues=[],this.feedlogError.emit({error:s,code:null==e?void 0:e.statusCode})}finally{this.isDisconnected||t!==this.fetchRequestId||(this.loading=!1,this.isLoadingMore=!1)}}async loadMore(){if(!this.sdk||!this.hasMore||this.isLoadingMore||this.loading)return;const t=this.fetchRequestId;this.isLoadingMore=!0;try{const e=this.buildFetchParams(),s=await this.sdk.fetchIssues(e);if(this.isDisconnected||t!==this.fetchRequestId)return;this.issues=[...this.issues,...s.issues],this.cursor=s.pagination.cursor,this.hasMore=s.pagination.hasMore}catch(e){if(this.isDisconnected||t!==this.fetchRequestId)return;const s=e instanceof Error?e.message:"Failed to load more issues";this.feedlogError.emit({error:s,code:null==e?void 0:e.statusCode})}finally{this.isDisconnected||t!==this.fetchRequestId||(this.isLoadingMore=!1)}}render(){var t,e;const i=null===(e=null===(t=this.el)||void 0===t?void 0:t.style)||void 0===e?void 0:e.getPropertyValue("--feedlog-background");return s("feedlog-issues",{key:"d98b8366830171a8a09d01cc9e2b19a19850a5fd",style:i?{"--feedlog-background":i}:void 0,issues:this.issues,limit:this.limit,maxWidth:this.maxWidth,theme:this.theme,heading:this.heading,subtitle:this.subtitle,emptyStateTitle:this.emptyStateTitle,emptyStateMessage:this.emptyStateMessage,getIssueUrl:this.getIssueUrl,loading:this.loading,error:this.error,hasMore:this.hasMore,isLoadingMore:this.isLoadingMore,onFeedlogUpvote:this.handleUpvote,onFeedlogLoadMore:async()=>this.loadMore()})}get el(){return i(this)}static get watchers(){return{type:[{handleQueryParamChange:0}],limit:[{handleQueryParamChange:0}],sortBy:[{handleQueryParamChange:0}],apiKey:[{handleSdkConfigChange:0}],endpoint:[{handleSdkConfigChange:0}]}}};export{d as feedlog_issues_client}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as o,h as t,H as s}from"./p-CgNWSmzU.js";const r=class{constructor(t){e(this,t),this.feedlogUpvote=o(this,"feedlogUpvote"),this.feedlogLoadMore=o(this,"feedlogLoadMore"),this.issues=[],this.maxWidth="42rem",this.theme="light",this.loading=!1,this.error=null,this.hasMore=!1,this.isLoadingMore=!1,this.handleUpvote=e=>{e.stopPropagation(),this.feedlogUpvote.emit(e.detail)},this.handleLoadMore=()=>{this.feedlogLoadMore.emit()}}renderErrorIcon(){return t("svg",{class:"error-icon",xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},t("circle",{cx:"12",cy:"12",r:"10"}),t("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),t("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"}))}renderIssuesList(){var e,o;return t("feedlog-issues-list",{issues:this.issues,limit:this.limit,theme:this.theme,getIssueUrl:this.getIssueUrl,emptyStateTitle:null!==(e=this.emptyStateTitle)&&void 0!==e?e:"No updates yet",emptyStateMessage:null!==(o=this.emptyStateMessage)&&void 0!==o?o:"Check back later for new updates.",onFeedlogUpvote:e=>this.handleUpvote(e)})}render(){return t(s,{key:"
|
|
1
|
+
import{r as e,c as o,h as t,H as s}from"./p-CgNWSmzU.js";const r=class{constructor(t){e(this,t),this.feedlogUpvote=o(this,"feedlogUpvote"),this.feedlogLoadMore=o(this,"feedlogLoadMore"),this.issues=[],this.maxWidth="42rem",this.theme="light",this.loading=!1,this.error=null,this.hasMore=!1,this.isLoadingMore=!1,this.handleUpvote=e=>{e.stopPropagation(),this.feedlogUpvote.emit(e.detail)},this.handleLoadMore=()=>{this.feedlogLoadMore.emit()}}renderErrorIcon(){return t("svg",{class:"error-icon",xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},t("circle",{cx:"12",cy:"12",r:"10"}),t("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),t("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"}))}renderIssuesList(){var e,o;return t("feedlog-issues-list",{issues:this.issues,limit:this.limit,theme:this.theme,getIssueUrl:this.getIssueUrl,emptyStateTitle:null!==(e=this.emptyStateTitle)&&void 0!==e?e:"No updates yet",emptyStateMessage:null!==(o=this.emptyStateMessage)&&void 0!==o?o:"Check back later for new updates.",onFeedlogUpvote:e=>this.handleUpvote(e)})}render(){return t(s,{key:"efed57e0c474b689a24e202f0fb6b67afd310572",class:"dark"===this.theme?"dark":""},t("div",{key:"ddb7185c3ace088f2883b2dcd193beb8af213cf3",class:"issues-container",style:{maxWidth:this.maxWidth}},(this.heading||this.subtitle)&&t("header",{key:"59aeafb96ac34de3ed7d0ecbd20f958dbc4d9ce9",class:"issues-header"},t("div",{key:"cba96e346d2e09c28cf253bca55e5bc822f69762",class:"header-content"},this.heading&&t("h1",{key:"7ce0ea76eb114c453a46592f2e5b1ea81b406cc4",class:"issues-title"},this.heading),this.subtitle&&t("p",{key:"a83fbcc2baab2aeb2b72ff3dbfc03cd3c77a0278",class:"issues-subtitle"},this.subtitle))),this.loading&&t("div",{key:"cf24d3838ef214697abfc2d8a03182e08e0ed6e7",class:"loading-state",role:"status","aria-label":"Loading issues"},t("div",{key:"d2a1547e4cbd7f41518153d7a8ea757beb384088",class:"loading-skeletons"},[1,2,3].map((e=>t("div",{key:e,class:"skeleton-card"},t("div",{class:"skeleton-content"},t("div",{class:"skeleton-header"},t("div",{class:"skeleton-badge"}),t("div",{class:"skeleton-timestamp"})),t("div",{class:"skeleton-main"},t("div",{class:"skeleton-title"}),t("div",{class:"skeleton-body"},t("div",{class:"skeleton-line"}),t("div",{class:"skeleton-line short"})),t("div",{class:"skeleton-repo"})),t("div",{class:"skeleton-footer"},t("div",{class:"skeleton-upvote"})))))))),this.error&&t("div",{key:"79c70736a6ba731432ef2ba84c5902e52a2ed864",class:"error-state",role:"alert"},t("div",{key:"31e987295d26e65c09187ae45e7305a46db27b32",class:"error-state-content"},this.renderErrorIcon(),t("h2",{key:"c030fb77e635ee6e50b9bebe16d8a97f75e2921c",class:"error-state-title"},"Something went wrong"),t("p",{key:"5c725c8d65d304e58c06ce574366f7ab6f18ea59",class:"error-state-message"},this.error))),!this.loading&&!this.error&&t("div",{key:"4217556c83dbd193eeed23ec50c40ec5fedbf420"},this.renderIssuesList(),this.hasMore&&t("div",{key:"df669ef16de0c2316715b97edd9c9af935e96464",class:"load-more-container"},t("feedlog-button",{key:"ba1498e81606245a55d0f428e8b3b7b0bf609367",onFeedlogClick:this.handleLoadMore,disabled:this.isLoadingMore,variant:"outline"},this.isLoadingMore?"Loading...":"Load More Issues")))))}};r.style=":host{display:block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-theme-bg:#ffffff;--feedlog-foreground:oklch(0.145 0 0);--feedlog-card:#ffffff;--feedlog-card-foreground:oklch(0.145 0 0);--feedlog-muted:#ececf0;--feedlog-muted-foreground:#717182;--feedlog-border:rgba(0, 0, 0, 0.1);--feedlog-accent-color:#2563eb;--feedlog-destructive:#d4183d;--feedlog-blue-400:oklch(0.707 0.165 254.624);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-blue-100:oklch(0.932 0.032 255.585);--feedlog-red-100:#fce7f3;--feedlog-red-400:#f472b6;--feedlog-red-600:#db2777;--feedlog-radius:0.625rem;--feedlog-gap:0.5rem;--feedlog-padding:2rem;--feedlog-min-height:100%;--feedlog-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08)}:host(.dark){--feedlog-theme-bg:oklch(0.18 0.01 260);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.24 0.01 260);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.32 0.01 260);--feedlog-muted-foreground:oklch(0.72 0.02 260);--feedlog-border:oklch(0.34 0.01 260);--feedlog-accent-color:#3b82f6;--feedlog-destructive:oklch(0.396 0.141 25.723);--feedlog-blue-400:oklch(0.707 0.165 254.624);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.3)}.issues-container{min-height:var(--feedlog-min-height);background-color:var(--feedlog-background, var(--feedlog-theme-bg, #ffffff));padding:var(--feedlog-padding);margin:0 auto;border-radius:var(--feedlog-radius)}.issues-header{margin-bottom:1.5rem;display:flex;align-items:flex-start;justify-content:space-between}.header-content{flex:1}.issues-title{color:var(--feedlog-foreground);margin:0 0 0.25rem 0;font-size:1.5rem;font-weight:500;line-height:1.5}.issues-subtitle{color:var(--feedlog-muted-foreground);font-size:0.875rem;margin:0}.loading-state{padding:0}.loading-skeletons{display:flex;flex-direction:column;gap:var(--feedlog-gap)}.skeleton-card{background-color:var(--feedlog-card);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:var(--feedlog-shadow);position:relative;overflow:hidden}.skeleton-card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--feedlog-muted)}.skeleton-content{padding:1.25rem;padding-left:calc(1.25rem + 3px);display:flex;flex-direction:column;gap:0.875rem}.skeleton-header{display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.skeleton-badge{width:4.5rem;height:1.25rem;border-radius:0.375rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite}.skeleton-timestamp{width:3rem;height:0.75rem;border-radius:0.25rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.2s}.skeleton-main{display:flex;flex-direction:column;gap:0.5rem}.skeleton-title{height:0.9375rem;border-radius:0.25rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.1s;width:85%}.skeleton-body{display:flex;flex-direction:column;gap:0.375rem}.skeleton-line{height:0.8125rem;border-radius:0.25rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.15s;width:100%}.skeleton-line.short{width:70%}.skeleton-repo{width:6rem;height:0.75rem;border-radius:0.25rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.25s}.skeleton-footer{display:flex;justify-content:flex-end}.skeleton-upvote{width:2.5rem;height:2rem;border-radius:0.5rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.3s}@keyframes skeleton-pulse{0%,100%{opacity:1}50%{opacity:0.5}}.error-state{display:flex;align-items:center;justify-content:center;padding:3rem 2rem;min-height:12rem}.error-state-content{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:20rem;padding:2rem}.error-icon{color:var(--feedlog-muted-foreground);opacity:0.8;margin-bottom:1rem}.error-state-title{margin:0 0 0.5rem 0;font-size:1.125rem;font-weight:600;color:var(--feedlog-foreground);line-height:1.4}.error-state-message{margin:0 0 1.25rem 0;font-size:0.875rem;color:var(--feedlog-muted-foreground);line-height:1.5}.load-more-container{display:flex;justify-content:center;padding:2rem 0;gap:1rem}";export{r as feedlog_issues}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}
|
|
2
|
+
/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:n,setPrototypeOf:i,isFrozen:o,getPrototypeOf:r,getOwnPropertyDescriptor:a}=Object;let{freeze:l,seal:s,create:c}=Object,{apply:u,construct:f}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e){return e}),s||(s=function(e){return e}),u||(u=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return e.apply(t,i)}),f||(f=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const p=_(Array.prototype.forEach),m=_(Array.prototype.lastIndexOf),d=_(Array.prototype.pop),h=_(Array.prototype.push),g=_(Array.prototype.splice),y=_(String.prototype.toLowerCase),b=_(String.prototype.toString),w=_(String.prototype.match),v=_(String.prototype.replace),x=_(String.prototype.indexOf),T=_(String.prototype.trim),A=_(Object.prototype.hasOwnProperty),k=_(RegExp.prototype.test),S=(E=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f(E,t)});var E;function _(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return u(e,t,i)}}function R(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y;i&&i(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(o(t)||(t[r]=e),i=e)}e[i]=!0}return e}function O(e){for(let t=0;t<e.length;t++)A(e,t)||(e[t]=null);return e}function z(e){const t=c(null);for(const[i,o]of n(e))A(e,i)&&(t[i]=Array.isArray(o)?O(o):o&&"object"==typeof o&&o.constructor===Object?z(o):o);return t}function D(e,t){for(;null!==e;){const n=a(e,t);if(n){if(n.get)return _(n.get);if("function"==typeof n.value)return _(n.value)}e=r(e)}return function(){return null}}const L=l(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M=l(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=l(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=l(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),P=l(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),N=l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),C=l(["#text"]),j=l(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),U=l(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),B=l(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),W=l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),q=s(/<%[\w\W]*|[\w\W]*%>/gm),Y=s(/\$\{[\w\W]*/gm),G=s(/^data-[\-\w.\u00B7-\uFFFF]+$/),X=s(/^aria-[\-\w]+$/),$=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K=s(/^(?:\w+script|data):/i),V=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=s(/^html$/i),Q=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:X,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:Q,DATA_ATTR:G,DOCTYPE_NAME:J,ERB_EXPR:q,IS_ALLOWED_URI:$,IS_SCRIPT_OR_DATA:K,MUSTACHE_EXPR:H,TMPLIT_EXPR:Y});const ee=function(){return"undefined"==typeof window?null:window};var te,ne,ie=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ee();const i=t=>e(t);if(i.version="3.3.3",i.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return i.isSupported=!1,i;let{document:o}=t;const r=o,a=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:u,Node:f,Element:E,NodeFilter:_,NamedNodeMap:O=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:H,DOMParser:q,trustedTypes:Y}=t,G=E.prototype,X=D(G,"cloneNode"),K=D(G,"remove"),V=D(G,"nextSibling"),Q=D(G,"childNodes"),te=D(G,"parentNode");if("function"==typeof u){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let ne,ie="";const{implementation:oe,createNodeIterator:re,createDocumentFragment:ae,getElementsByTagName:le}=o,{importNode:se}=r;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};i.isSupported="function"==typeof n&&"function"==typeof te&&oe&&void 0!==oe.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:fe,TMPLIT_EXPR:pe,DATA_ATTR:me,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:ye}=Z;let{IS_ALLOWED_URI:be}=Z,we=null;const ve=R({},[...L,...M,...F,...P,...C]);let xe=null;const Te=R({},[...j,...U,...B,...W]);let Ae=Object.seal(c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ke=null,Se=null;const Ee=Object.seal(c(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let _e=!0,Re=!0,Oe=!1,ze=!0,De=!1,Le=!0,Me=!1,Fe=!1,Ie=!1,Pe=!1,Ne=!1,Ce=!1,je=!0,Ue=!1,Be=!0,We=!1,He={},qe=null;const Ye=R({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Xe=R({},["audio","video","img","source","image","track"]);let $e=null;const Ke=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ve="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let Ze=Qe,et=!1,tt=null;const nt=R({},[Ve,Je,Qe],b);let it=R({},["mi","mo","mn","ms","mtext"]),ot=R({},["annotation-xml"]);const rt=R({},["title","style","font","a","script"]);let at=null;const lt=["application/xhtml+xml","text/html"];let st=null,ct=null;const ut=o.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=z(e),at=-1===lt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,st="application/xhtml+xml"===at?b:y,we=A(e,"ALLOWED_TAGS")?R({},e.ALLOWED_TAGS,st):ve,xe=A(e,"ALLOWED_ATTR")?R({},e.ALLOWED_ATTR,st):Te,tt=A(e,"ALLOWED_NAMESPACES")?R({},e.ALLOWED_NAMESPACES,b):nt,$e=A(e,"ADD_URI_SAFE_ATTR")?R(z(Ke),e.ADD_URI_SAFE_ATTR,st):Ke,Ge=A(e,"ADD_DATA_URI_TAGS")?R(z(Xe),e.ADD_DATA_URI_TAGS,st):Xe,qe=A(e,"FORBID_CONTENTS")?R({},e.FORBID_CONTENTS,st):Ye,ke=A(e,"FORBID_TAGS")?R({},e.FORBID_TAGS,st):z({}),Se=A(e,"FORBID_ATTR")?R({},e.FORBID_ATTR,st):z({}),He=!!A(e,"USE_PROFILES")&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,Re=!1!==e.ALLOW_DATA_ATTR,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ze=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,De=e.SAFE_FOR_TEMPLATES||!1,Le=!1!==e.SAFE_FOR_XML,Me=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Ce=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,je=!1!==e.SANITIZE_DOM,Ue=e.SANITIZE_NAMED_PROPS||!1,Be=!1!==e.KEEP_CONTENT,We=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||$,Ze=e.NAMESPACE||Qe,it=e.MATHML_TEXT_INTEGRATION_POINTS||it,ot=e.HTML_INTEGRATION_POINTS||ot,Ae=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ae.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ae.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ae.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(Re=!1),Ne&&(Pe=!0),He&&(we=R({},C),xe=c(null),!0===He.html&&(R(we,L),R(xe,j)),!0===He.svg&&(R(we,M),R(xe,U),R(xe,W)),!0===He.svgFilters&&(R(we,F),R(xe,U),R(xe,W)),!0===He.mathMl&&(R(we,P),R(xe,B),R(xe,W))),A(e,"ADD_TAGS")||(Ee.tagCheck=null),A(e,"ADD_ATTR")||(Ee.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Ee.tagCheck=e.ADD_TAGS:(we===ve&&(we=z(we)),R(we,e.ADD_TAGS,st))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Ee.attributeCheck=e.ADD_ATTR:(xe===Te&&(xe=z(xe)),R(xe,e.ADD_ATTR,st))),e.ADD_URI_SAFE_ATTR&&R($e,e.ADD_URI_SAFE_ATTR,st),e.FORBID_CONTENTS&&(qe===Ye&&(qe=z(qe)),R(qe,e.FORBID_CONTENTS,st)),e.ADD_FORBID_CONTENTS&&(qe===Ye&&(qe=z(qe)),R(qe,e.ADD_FORBID_CONTENTS,st)),Be&&(we["#text"]=!0),Me&&R(we,["html","head","body"]),we.table&&(R(we,["tbody"]),delete ke.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ne=e.TRUSTED_TYPES_POLICY,ie=ne.createHTML("")}else void 0===ne&&(ne=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(Y,a)),null!==ne&&"string"==typeof ie&&(ie=ne.createHTML(""));l&&l(e),ct=e}},mt=R({},[...M,...F,...I]),dt=R({},[...P,...N]),ht=function(e){h(i.removed,{element:e});try{te(e).removeChild(e)}catch(t){K(e)}},gt=function(e,t){try{h(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Pe||Ne)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},yt=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=w(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===at&&Ze===Qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=ne?ne.createHTML(e):e;if(Ze===Qe)try{t=(new q).parseFromString(i,at)}catch(e){}if(!t||!t.documentElement){t=oe.createDocument(Ze,"template",null);try{t.documentElement.innerHTML=et?ie:i}catch(e){}}const r=t.body||t.documentElement;return e&&n&&r.insertBefore(o.createTextNode(n),r.childNodes[0]||null),Ze===Qe?le.call(t,Me?"html":"body")[0]:Me?t.documentElement:r},bt=function(e){return re.call(e.ownerDocument||e,e,_.SHOW_ELEMENT|_.SHOW_COMMENT|_.SHOW_TEXT|_.SHOW_PROCESSING_INSTRUCTION|_.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof H&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof O)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof f&&e instanceof f};function xt(e,t,n){p(e,(e=>{e.call(i,t,n,ct)}))}const Tt=function(e){let t=null;if(xt(ce.beforeSanitizeElements,e,null),wt(e))return ht(e),!0;const n=st(e.nodeName);if(xt(ce.uponSanitizeElement,e,{tagName:n,allowedTags:we}),Le&&e.hasChildNodes()&&!vt(e.firstElementChild)&&k(/<[/\w!]/g,e.innerHTML)&&k(/<[/\w!]/g,e.textContent))return ht(e),!0;if(7===e.nodeType)return ht(e),!0;if(Le&&8===e.nodeType&&k(/<[/\w]/g,e.data))return ht(e),!0;if(!(Ee.tagCheck instanceof Function&&Ee.tagCheck(n))&&(!we[n]||ke[n])){if(!ke[n]&&kt(n)){if(Ae.tagNameCheck instanceof RegExp&&k(Ae.tagNameCheck,n))return!1;if(Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(n))return!1}if(Be&&!qe[n]){const t=te(e)||e.parentNode,n=Q(e)||e.childNodes;if(n&&t)for(let i=n.length-1;i>=0;--i){const o=X(n[i],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,V(e))}}return ht(e),!0}return e instanceof E&&!function(e){let t=te(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});const n=y(e.tagName),i=y(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Je?t.namespaceURI===Qe?"svg"===n:t.namespaceURI===Ve?"svg"===n&&("annotation-xml"===i||it[i]):Boolean(mt[n]):e.namespaceURI===Ve?t.namespaceURI===Qe?"math"===n:t.namespaceURI===Je?"math"===n&&ot[i]:Boolean(dt[n]):e.namespaceURI===Qe?!(t.namespaceURI===Je&&!ot[i])&&!(t.namespaceURI===Ve&&!it[i])&&!dt[n]&&(rt[n]||!mt[n]):!("application/xhtml+xml"!==at||!tt[e.namespaceURI]))}(e)?(ht(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!k(/<\/no(script|embed|frames)/i,e.innerHTML)?(De&&3===e.nodeType&&(t=e.textContent,p([ue,fe,pe],(e=>{t=v(t,e," ")})),e.textContent!==t&&(h(i.removed,{element:e.cloneNode()}),e.textContent=t)),xt(ce.afterSanitizeElements,e,null),!1):(ht(e),!0)},At=function(e,t,n){if(Se[t])return!1;if(je&&("id"===t||"name"===t)&&(n in o||n in ut))return!1;if(Re&&!Se[t]&&k(me,t));else if(_e&&k(de,t));else if(Ee.attributeCheck instanceof Function&&Ee.attributeCheck(t,e));else if(!xe[t]||Se[t]){if(!(kt(e)&&(Ae.tagNameCheck instanceof RegExp&&k(Ae.tagNameCheck,e)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(e))&&(Ae.attributeNameCheck instanceof RegExp&&k(Ae.attributeNameCheck,t)||Ae.attributeNameCheck instanceof Function&&Ae.attributeNameCheck(t,e))||"is"===t&&Ae.allowCustomizedBuiltInElements&&(Ae.tagNameCheck instanceof RegExp&&k(Ae.tagNameCheck,n)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(n))))return!1}else if($e[t]);else if(k(be,v(n,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==x(n,"data:")||!Ge[e])if(Oe&&!k(he,v(n,ge,"")));else if(n)return!1;return!0},kt=function(e){return"annotation-xml"!==e&&w(e,ye)},St=function(e){xt(ce.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||wt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let o=t.length;for(;o--;){const r=t[o],{name:a,namespaceURI:l,value:s}=r,c=st(a),u=s;let f="value"===a?u:T(u);if(n.attrName=c,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,xt(ce.uponSanitizeAttribute,e,n),f=n.attrValue,!Ue||"id"!==c&&"name"!==c||(gt(a,e),f="user-content-"+f),Le&&k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){gt(a,e);continue}if("attributename"===c&&w(f,"href")){gt(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){gt(a,e);continue}if(!ze&&k(/\/>/i,f)){gt(a,e);continue}De&&p([ue,fe,pe],(e=>{f=v(f,e," ")}));const m=st(e.nodeName);if(At(m,c,f)){if(ne&&"object"==typeof Y&&"function"==typeof Y.getAttributeType)if(l);else switch(Y.getAttributeType(m,c)){case"TrustedHTML":f=ne.createHTML(f);break;case"TrustedScriptURL":f=ne.createScriptURL(f)}if(f!==u)try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),wt(e)?ht(e):d(i.removed)}catch(t){gt(a,e)}}else gt(a,e)}xt(ce.afterSanitizeAttributes,e,null)},Et=function e(t){let n=null;const i=bt(t);for(xt(ce.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)xt(ce.uponSanitizeShadowNode,n,null),Tt(n),St(n),n.content instanceof s&&e(n.content);xt(ce.afterSanitizeShadowDOM,t,null)};return i.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,a=null,l=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!i.isSupported)return e;if(Fe||pt(t),i.removed=[],"string"==typeof e&&(We=!1),We){if(e.nodeName){const t=st(e.nodeName);if(!we[t]||ke[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof f)n=yt("\x3c!----\x3e"),o=n.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!Pe&&!De&&!Me&&-1===e.indexOf("<"))return ne&&Ce?ne.createHTML(e):e;if(n=yt(e),!n)return Pe?null:Ce?ie:""}n&&Ie&&ht(n.firstChild);const c=bt(We?e:n);for(;a=c.nextNode();)Tt(a),St(a),a.content instanceof s&&Et(a.content);if(We)return e;if(Pe){if(Ne)for(l=ae.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(xe.shadowroot||xe.shadowrootmode)&&(l=se.call(r,l,!0)),l}let u=Me?n.outerHTML:n.innerHTML;return Me&&we["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&k(J,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),De&&p([ue,fe,pe],(e=>{u=v(u,e," ")})),ne&&Ce?ne.createHTML(u):u},i.setConfig=function(){pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Fe=!0},i.clearConfig=function(){ct=null,Fe=!1},i.isValidAttribute=function(e,t,n){ct||pt({});const i=st(e),o=st(t);return At(i,o,n)},i.addHook=function(e,t){"function"==typeof t&&h(ce[e],t)},i.removeHook=function(e,t){if(void 0!==t){const n=m(ce[e],t);return-1===n?void 0:g(ce[e],n,1)[0]}return d(ce[e])},i.removeHooks=function(e){ce[e]=[]},i.removeAllHooks=function(){ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},i}(),oe=t(Object.freeze({__proto__:null,default:ie})),re=e(ne?te:(ne=1,te=self.DOMPurify||(self.DOMPurify=oe.default||oe)));export{re as D}
|