@feedlog-ai/webcomponents 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/feedlog-badge_3.cjs.entry.js +119 -0
- package/dist/cjs/feedlog-card.cjs.entry.js +17 -0
- package/dist/cjs/feedlog-github-issues-client.cjs.entry.js +520 -0
- package/dist/cjs/feedlog-github-issues.cjs.entry.js +81 -0
- package/dist/cjs/feedlog-toolkit.cjs.js +24 -0
- package/dist/cjs/index-5lluu_3h.js +3144 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/collection/collection-manifest.json +17 -0
- package/dist/collection/components/feedlog-badge/feedlog-badge.css +86 -0
- package/dist/collection/components/feedlog-badge/feedlog-badge.js +53 -0
- package/dist/collection/components/feedlog-badge/feedlog-badge.stories.js +38 -0
- package/dist/collection/components/feedlog-button/feedlog-button.css +155 -0
- package/dist/collection/components/feedlog-button/feedlog-button.js +154 -0
- package/dist/collection/components/feedlog-button/feedlog-button.stories.js +82 -0
- package/dist/collection/components/feedlog-card/feedlog-card.css +47 -0
- package/dist/collection/components/feedlog-card/feedlog-card.js +23 -0
- package/dist/collection/components/feedlog-card/feedlog-card.stories.js +22 -0
- package/dist/collection/components/feedlog-github-issues/feedlog-github-issues.css +69 -0
- package/dist/collection/components/feedlog-github-issues/feedlog-github-issues.js +308 -0
- package/dist/collection/components/feedlog-github-issues/feedlog-github-issues.stories.js +211 -0
- package/dist/collection/components/feedlog-github-issues-client/feedlog-github-issues-client.js +395 -0
- package/dist/collection/components/feedlog-issues-list/feedlog-issues-list.css +218 -0
- package/dist/collection/components/feedlog-issues-list/feedlog-issues-list.js +139 -0
- package/dist/collection/components/index.js +6 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/feedlog-badge.d.ts +11 -0
- package/dist/components/feedlog-badge.js +1 -0
- package/dist/components/feedlog-button.d.ts +11 -0
- package/dist/components/feedlog-button.js +1 -0
- package/dist/components/feedlog-card.d.ts +11 -0
- package/dist/components/feedlog-card.js +1 -0
- package/dist/components/feedlog-github-issues-client.d.ts +11 -0
- package/dist/components/feedlog-github-issues-client.js +1 -0
- package/dist/components/feedlog-github-issues.d.ts +11 -0
- package/dist/components/feedlog-github-issues.js +1 -0
- package/dist/components/feedlog-issues-list.d.ts +11 -0
- package/dist/components/feedlog-issues-list.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-CHtSMTyP.js +1 -0
- package/dist/components/p-CPOiBAxu.js +1 -0
- package/dist/components/p-DMcNh5Ys.js +1 -0
- package/dist/components/p-DMdb-G26.js +1 -0
- package/dist/esm/feedlog-badge_3.entry.js +115 -0
- package/dist/esm/feedlog-card.entry.js +15 -0
- package/dist/esm/feedlog-github-issues-client.entry.js +518 -0
- package/dist/esm/feedlog-github-issues.entry.js +79 -0
- package/dist/esm/feedlog-toolkit.js +20 -0
- package/dist/esm/index-CkB6Yzeb.js +3135 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/feedlog-toolkit/feedlog-toolkit.css +1 -0
- package/dist/feedlog-toolkit/feedlog-toolkit.esm.js +1 -0
- package/dist/feedlog-toolkit/index.esm.js +0 -0
- package/dist/feedlog-toolkit/p-2f7954f7.entry.js +1 -0
- package/dist/feedlog-toolkit/p-399e0281.entry.js +1 -0
- package/dist/feedlog-toolkit/p-CkB6Yzeb.js +2 -0
- package/dist/feedlog-toolkit/p-b3d26272.entry.js +1 -0
- package/dist/feedlog-toolkit/p-cdb2b098.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/feedlog-badge/feedlog-badge.d.ts +12 -0
- package/dist/types/components/feedlog-badge/feedlog-badge.stories.d.ts +9 -0
- package/dist/types/components/feedlog-button/feedlog-button.d.ts +30 -0
- package/dist/types/components/feedlog-button/feedlog-button.stories.d.ts +13 -0
- package/dist/types/components/feedlog-card/feedlog-card.d.ts +8 -0
- package/dist/types/components/feedlog-card/feedlog-card.stories.d.ts +9 -0
- package/dist/types/components/feedlog-github-issues/feedlog-github-issues.d.ts +67 -0
- package/dist/types/components/feedlog-github-issues/feedlog-github-issues.stories.d.ts +11 -0
- package/dist/types/components/feedlog-github-issues-client/feedlog-github-issues-client.d.ts +77 -0
- package/dist/types/components/feedlog-issues-list/feedlog-issues-list.d.ts +31 -0
- package/dist/types/components/index.d.ts +6 -0
- package/dist/types/components.d.ts +532 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1810 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +48 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* Heart icon SVG component (filled)
|
|
4
|
+
*/
|
|
5
|
+
const HeartFilledIcon = () => (h("svg", { class: "upvote-icon filled", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", stroke: "none" }, h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
6
|
+
/**
|
|
7
|
+
* Heart icon SVG component (outline)
|
|
8
|
+
*/
|
|
9
|
+
const HeartOutlineIcon = () => (h("svg", { class: "upvote-icon outline", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
10
|
+
/**
|
|
11
|
+
* Feedlog Issues List Component
|
|
12
|
+
*
|
|
13
|
+
* A component for displaying a list of GitHub issues with support for bugs and enhancements.
|
|
14
|
+
*/
|
|
15
|
+
export class FeedlogIssuesList {
|
|
16
|
+
constructor() {
|
|
17
|
+
/**
|
|
18
|
+
* Array of issues to display
|
|
19
|
+
*/
|
|
20
|
+
this.issues = [];
|
|
21
|
+
/**
|
|
22
|
+
* Theme variant: 'light' or 'dark'
|
|
23
|
+
*/
|
|
24
|
+
this.theme = 'light';
|
|
25
|
+
this.handleUpvote = (event, issue) => {
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
this.feedlogUpvote.emit({
|
|
28
|
+
issueId: issue.id,
|
|
29
|
+
currentUpvoted: issue.hasUpvoted,
|
|
30
|
+
currentCount: issue.upvoteCount,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h(Host, { key: '5cef6f5476239d0f8096664c04690aa4c3383bd0', class: this.theme === 'dark' ? 'dark' : '' }, h("div", { key: 'd72fffe457f0497dbbbe0c64dab3282f76a49217', class: "issues-list" }, this.issues.length === 0 ? (h("div", { class: "empty-state" }, h("p", null, "No issues found"))) : (this.issues.map(issue => (h("div", { key: issue.id, class: "issue-card" }, h("div", { class: "issue-content" }, h("div", { class: "issue-header" }, h("div", { class: "issue-type-badge" }, issue.type === 'bug' ? (h("feedlog-badge", { variant: "destructive" }, "Bug")) : (h("feedlog-badge", { variant: "enhancement" }, "Enhancement"))), issue.pinnedAt && (h("div", { class: "pinned-indicator", title: "Pinned issue" }, "\uD83D\uDCCC"))), h("div", { class: "issue-main" }, h("div", { class: "issue-details" }, h("h3", { class: "issue-title" }, issue.title), h("p", { class: "issue-body" }, issue.body), h("div", { class: "issue-repository" }, h("span", { class: "repo-name" }, issue.repository.owner, "/", issue.repository.name))), h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: (e) => this.handleUpvote(e, issue), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, issue.hasUpvoted ? h(HeartFilledIcon, null) : h(HeartOutlineIcon, null), h("span", { class: "upvote-count" }, issue.upvoteCount))), h("div", { class: "issue-footer" }, h("span", { class: "issue-date", title: `Updated: ${issue.updatedAt}` }, "Updated ", this.formatDate(issue.updatedAt)), h("span", { class: "issue-date", title: `Created: ${issue.createdAt}` }, "Created ", this.formatDate(issue.createdAt)))))))))));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Format an ISO date string to a relative time string
|
|
39
|
+
*/
|
|
40
|
+
formatDate(dateString) {
|
|
41
|
+
try {
|
|
42
|
+
const date = new Date(dateString);
|
|
43
|
+
const now = new Date();
|
|
44
|
+
const seconds = Math.floor((now.getTime() - date.getTime()) / 1000);
|
|
45
|
+
if (seconds < 60)
|
|
46
|
+
return 'just now';
|
|
47
|
+
if (seconds < 3600)
|
|
48
|
+
return `${Math.floor(seconds / 60)}m ago`;
|
|
49
|
+
if (seconds < 86400)
|
|
50
|
+
return `${Math.floor(seconds / 3600)}h ago`;
|
|
51
|
+
if (seconds < 604800)
|
|
52
|
+
return `${Math.floor(seconds / 86400)}d ago`;
|
|
53
|
+
if (seconds < 2592000)
|
|
54
|
+
return `${Math.floor(seconds / 604800)}w ago`;
|
|
55
|
+
return date.toLocaleDateString();
|
|
56
|
+
}
|
|
57
|
+
catch (_a) {
|
|
58
|
+
return 'unknown date';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static get is() { return "feedlog-issues-list"; }
|
|
62
|
+
static get encapsulation() { return "shadow"; }
|
|
63
|
+
static get originalStyleUrls() {
|
|
64
|
+
return {
|
|
65
|
+
"$": ["feedlog-issues-list.css"]
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
static get styleUrls() {
|
|
69
|
+
return {
|
|
70
|
+
"$": ["feedlog-issues-list.css"]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
static get properties() {
|
|
74
|
+
return {
|
|
75
|
+
"issues": {
|
|
76
|
+
"type": "unknown",
|
|
77
|
+
"mutable": false,
|
|
78
|
+
"complexType": {
|
|
79
|
+
"original": "FeedlogIssue[]",
|
|
80
|
+
"resolved": "FeedlogIssue[]",
|
|
81
|
+
"references": {
|
|
82
|
+
"FeedlogIssue": {
|
|
83
|
+
"location": "import",
|
|
84
|
+
"path": "@feedlog-ai/core",
|
|
85
|
+
"id": "../core/dist/index.d.ts::FeedlogIssue"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "Array of issues to display"
|
|
94
|
+
},
|
|
95
|
+
"getter": false,
|
|
96
|
+
"setter": false,
|
|
97
|
+
"defaultValue": "[]"
|
|
98
|
+
},
|
|
99
|
+
"theme": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "'light' | 'dark'",
|
|
104
|
+
"resolved": "\"dark\" | \"light\"",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Theme variant: 'light' or 'dark'"
|
|
112
|
+
},
|
|
113
|
+
"getter": false,
|
|
114
|
+
"setter": false,
|
|
115
|
+
"reflect": false,
|
|
116
|
+
"attribute": "theme",
|
|
117
|
+
"defaultValue": "'light'"
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
static get events() {
|
|
122
|
+
return [{
|
|
123
|
+
"method": "feedlogUpvote",
|
|
124
|
+
"name": "feedlogUpvote",
|
|
125
|
+
"bubbles": true,
|
|
126
|
+
"cancelable": true,
|
|
127
|
+
"composed": true,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": "Event emitted when an issue is upvoted"
|
|
131
|
+
},
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "{\n issueId: string;\n currentUpvoted: boolean;\n currentCount: number;\n }",
|
|
134
|
+
"resolved": "{ issueId: string; currentUpvoted: boolean; currentCount: number; }",
|
|
135
|
+
"references": {}
|
|
136
|
+
}
|
|
137
|
+
}];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './feedlog-card/feedlog-card';
|
|
2
|
+
export * from './feedlog-badge/feedlog-badge';
|
|
3
|
+
export * from './feedlog-button/feedlog-button';
|
|
4
|
+
export * from './feedlog-github-issues/feedlog-github-issues';
|
|
5
|
+
export * from './feedlog-github-issues-client/feedlog-github-issues-client';
|
|
6
|
+
export * from './feedlog-issues-list/feedlog-issues-list';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface FeedlogBadge extends Components.FeedlogBadge, HTMLElement {}
|
|
4
|
+
export const FeedlogBadge: {
|
|
5
|
+
prototype: FeedlogBadge;
|
|
6
|
+
new (): FeedlogBadge;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as o,d as s}from"./p-CHtSMTyP.js";const t=o,p=s;export{t as FeedlogBadge,p as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface FeedlogButton extends Components.FeedlogButton, HTMLElement {}
|
|
4
|
+
export const FeedlogButton: {
|
|
5
|
+
prototype: FeedlogButton;
|
|
6
|
+
new (): FeedlogButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as o,d as s}from"./p-DMdb-G26.js";const p=o,r=s;export{p as FeedlogButton,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface FeedlogCard extends Components.FeedlogCard, HTMLElement {}
|
|
4
|
+
export const FeedlogCard: {
|
|
5
|
+
prototype: FeedlogCard;
|
|
6
|
+
new (): FeedlogCard;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as o,H as d,h as a}from"./index.js";const r=o(class extends d{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}render(){return a("div",{key:"293a80e66adedfc1af29daf72390a4f464321b96",class:"feedlog-card"},a("slot",{key:"b7e5a827f89035e791d9c756db0f66198e6c5a38",name:"header"}),a("slot",{key:"da89fee0a01068c8438564848f218faa9c5d849e",name:"content"}),a("slot",{key:"30b05e80e4189c0f73810a48f64e072dfac83267",name:"footer"}))}static get style(){return':host{display:block;font-family:ui-monospace, SFMono-Regular, \'SF Mono\', Menlo, Consolas, \'Liberation Mono\', monospace;--feedlog-card:#ffffff;--feedlog-card-foreground:oklch(0.145 0 0);--feedlog-border:rgba(0, 0, 0, 0.1);--feedlog-radius:0.625rem;--feedlog-card-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);--feedlog-card-hover-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)}:host(.dark){--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-border:oklch(0.269 0 0);--feedlog-card-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);--feedlog-card-hover-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3)}.feedlog-card{background-color:var(--feedlog-card);color:var(--feedlog-card-foreground);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:var(--feedlog-card-shadow);transition:box-shadow 0.15s ease;position:relative}.feedlog-card:hover{box-shadow:var(--feedlog-card-hover-shadow)}::slotted([slot="header"]){display:block}::slotted([slot="content"]){display:block}::slotted([slot="footer"]){display:block}'}},[257,"feedlog-card"]);function l(){"undefined"!=typeof customElements&&["feedlog-card"].forEach((o=>{"feedlog-card"===o&&(customElements.get(e(o))||customElements.define(e(o),r))}))}l();const s=r,f=l;export{s as FeedlogCard,f as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface FeedlogGithubIssuesClient extends Components.FeedlogGithubIssuesClient, HTMLElement {}
|
|
4
|
+
export const FeedlogGithubIssuesClient: {
|
|
5
|
+
prototype: FeedlogGithubIssuesClient;
|
|
6
|
+
new (): FeedlogGithubIssuesClient;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as e,H as s,c as i,h as o}from"./index.js";import{d as r}from"./p-CHtSMTyP.js";import{d as n}from"./p-DMdb-G26.js";import{d as h}from"./p-CPOiBAxu.js";import{d as a}from"./p-DMcNh5Ys.js";function u(t){if("string"!=typeof t)return"";let e=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");return e=e.replace(/\s*on\w+\s*=\s*["'][^"']*["']/gi,""),e=e.replace(/\s*on\w+\s*=\s*[^\s>]*/gi,""),e=e.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,""),e=e.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,""),e=e.replace(/<(embed|object)\b[^<]*>/gi,""),e=e.replace(/javascript:/gi,""),e=e.replace(/data:(?!image\/(?:png|jpg|jpeg|gif|webp);)/gi,""),e}class c extends Error{constructor(t,e,s){super(t),this.statusCode=e,this.originalError=s,this.name="FeedlogError",Object.setPrototypeOf(this,c.prototype)}}class d extends c{constructor(t){super(t),this.name="FeedlogValidationError",Object.setPrototypeOf(this,d.prototype)}}class l extends c{constructor(t,e,s){super(t,e,s),this.name="FeedlogNetworkError",Object.setPrototypeOf(this,l.prototype)}}class p extends c{constructor(t="Request timed out"){super(t),this.name="FeedlogTimeoutError",Object.setPrototypeOf(this,p.prototype)}}class f{constructor(t={}){this.config={credentials:"include",...t},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 l("Failed to fetch issues: "+s.statusText,s.status);const i=await s.json();return this.validateIssuesResponse(i)}catch(t){if(t instanceof c)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new l("Network error: Unable to reach API",void 0,t);throw new c("Failed to fetch issues: "+(t instanceof Error?t.message:"Unknown error"),void 0,t)}}async toggleUpvote(t){if(!t||"string"!=typeof t)throw new d("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"});if(404===s.status)throw new l("Issue not found",404);if(401===s.status)throw new l("Unauthorized",401);if(403===s.status)throw new l("Forbidden: Domain not allowed for this repository",403);if(!s.ok)throw new l("Failed to toggle upvote: "+s.statusText,s.status);const i=await s.json();return this.validateUpvoteResponse(i)}catch(t){if(t instanceof c)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new l("Network error: Unable to reach API",void 0,t);throw new c("Failed to toggle upvote: "+(t instanceof Error?t.message:"Unknown error"),void 0,t)}}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)}return t.type&&e.searchParams.set("type",t.type),t.cursor&&e.searchParams.set("cursor",t.cursor),void 0!==t.limit&&e.searchParams.set("limit",""+t.limit),""+e}getAuthHeaders(){return{"Content-Type":"application/json"}}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 p(`Request timed out after ${this.timeout}ms`);throw t}}validateIssuesResponse(t){if(!t||"object"!=typeof t)throw new d("Invalid API response: expected object");const e=t;if(!Array.isArray(e.issues))throw new d("Invalid API response: issues must be an array");if(!e.pagination||"object"!=typeof e.pagination)throw new d("Invalid API response: pagination is required");return{issues:e.issues.map((t=>this.validateIssue(t))),pagination:{cursor:e.pagination.cursor,hasMore:!!e.pagination.hasMore}}}validateIssue(t){if(!t||"object"!=typeof t)throw new d("Invalid issue: expected object");const e=t;if("string"!=typeof e.id)throw new d("Invalid issue: id is required and must be a string");if("string"!=typeof e.title)throw new d("Invalid issue: title is required and must be a string");if(!["bug","enhancement"].includes(e.type+""))throw new d('Invalid issue: type must be "bug" or "enhancement"');if(!["open","closed"].includes(e.status+""))throw new d('Invalid issue: status must be "open" or "closed"');if(!e.repository||"object"!=typeof e.repository)throw new d("Invalid issue: repository is required");const s=e.repository;if("string"!=typeof s.id||"string"!=typeof s.name||"string"!=typeof s.owner)throw new d("Invalid issue: repository must have id, name, and owner");const i=u(e.title+""),o=u((e.body||"")+"");return{id:e.id+"",type:e.type||"bug",status:e.status||"open",pinnedAt:e.pinnedAt?e.pinnedAt+"":null,revision:Number(e.revision)||1,title:i,body:o,repository:{id:s.id+"",name:s.name+"",owner:s.owner+""},updatedAt:e.updatedAt+""||(new Date).toISOString(),createdAt:e.createdAt+""||(new Date).toISOString(),upvoteCount:Number(e.upvoteCount)||0,hasUpvoted:!!e.hasUpvoted}}validateUpvoteResponse(t){if(!t||"object"!=typeof t)throw new d("Invalid upvote response: expected object");const e=t;if("boolean"!=typeof e.upvoted)throw new d("Invalid upvote response: upvoted must be a boolean");if("number"!=typeof e.upvoteCount)throw new d("Invalid upvote response: upvoteCount must be a number");if("string"!=typeof e.anonymousUserId)throw new d("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 g=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=i(this,"feedlogUpvote"),this.feedlogThemeChange=i(this,"feedlogThemeChange"),this.feedlogError=i(this,"feedlogError"),this.maxWidth="42rem",this.theme="light",this.showThemeToggle=!0,this.issues=[],this.loading=!0,this.error=null,this.cursor=null,this.hasMore=!1,this.isLoadingMore=!1,this.sdk=null,this.handleUpvote=async t=>{if(!this.sdk)return;const{issueId:e,currentUpvoted:s,currentCount:i}=t.detail;this.issues=this.issues.map((t=>t.id===e?Object.assign(Object.assign({},t),{hasUpvoted:!s,upvoteCount:s?i-1:i+1}):t));try{const t=await this.sdk.toggleUpvote(e);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){this.issues=this.issues.map((t=>t.id===e?Object.assign(Object.assign({},t),{hasUpvoted:s,upvoteCount:i}):t)),this.feedlogError.emit({error:t instanceof Error?t.message:"Failed to toggle upvote"})}},this.handleThemeChange=t=>{this.theme=t.detail,this.feedlogThemeChange.emit(t.detail)}}componentWillLoad(){this.previousRepos=this.repos,this.previousType=this.type,this.previousLimit=this.limit,this.initializeSDK(),this.fetchIssues()}componentDidUpdate(){(JSON.stringify(this.previousRepos)!==JSON.stringify(this.repos)||this.previousType!==this.type||this.previousLimit!==this.limit)&&(this.cursor=null,this.hasMore=!1,this.issues=[],this.fetchIssues(),this.previousRepos=this.repos,this.previousType=this.type,this.previousLimit=this.limit)}initializeSDK(){try{this.sdk=new f(Object.assign({},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})}}parseRepos(){if(!this.repos)return[];if("string"==typeof this.repos)try{const t=JSON.parse(this.repos);return Array.isArray(t)?t:[this.repos]}catch(t){return[this.repos]}return Array.isArray(this.repos)?this.repos:[]}async fetchIssues(){if(!this.sdk)return;const t=this.parseRepos();if(0===t.length)return this.error="At least one repository is required",this.loading=!1,void this.feedlogError.emit({error:"At least one repository is required"});try{this.loading=!0,this.error=null;const e={repositoryIds:t};this.type&&(e.type=this.type),this.limit&&(e.limit=this.limit),this.cursor&&(e.cursor=this.cursor);const s=await this.sdk.fetchIssues(e);this.issues=s.issues,this.cursor=s.pagination.cursor,this.hasMore=s.pagination.hasMore}catch(t){const e=t instanceof Error?t.message:"Failed to fetch issues";this.error=e,this.issues=[],this.feedlogError.emit({error:e,code:null==t?void 0:t.statusCode})}finally{this.loading=!1,this.isLoadingMore=!1}}async loadMore(){if(this.sdk&&this.hasMore&&!this.isLoadingMore&&!this.loading){this.isLoadingMore=!0;try{const t={repositoryIds:this.parseRepos()};this.type&&(t.type=this.type),this.limit&&(t.limit=this.limit),this.cursor&&(t.cursor=this.cursor);const e=await this.sdk.fetchIssues(t);this.issues=[...this.issues,...e.issues],this.cursor=e.pagination.cursor,this.hasMore=e.pagination.hasMore}catch(t){this.feedlogError.emit({error:t instanceof Error?t.message:"Failed to load more issues",code:null==t?void 0:t.statusCode})}finally{this.isLoadingMore=!1}}}render(){return o("feedlog-github-issues",{key:"38b9e7ec8a5473acbab39df1d0476fcb357866bf",issues:this.issues,maxWidth:this.maxWidth,theme:this.theme,showThemeToggle:this.showThemeToggle,loading:this.loading,error:this.error,hasMore:this.hasMore,isLoadingMore:this.isLoadingMore,onFeedlogUpvote:this.handleUpvote,onFeedlogThemeChange:this.handleThemeChange,onFeedlogLoadMore:async()=>this.loadMore()})}},[1,"feedlog-github-issues-client",{repos:[1],type:[1],limit:[2],endpoint:[1],maxWidth:[1,"max-width"],theme:[1],showThemeToggle:[4,"show-theme-toggle"],issues:[32],loading:[32],error:[32],cursor:[32],hasMore:[32],isLoadingMore:[32]}]);function w(){"undefined"!=typeof customElements&&["feedlog-github-issues-client","feedlog-badge","feedlog-button","feedlog-github-issues","feedlog-issues-list"].forEach((e=>{switch(e){case"feedlog-github-issues-client":customElements.get(t(e))||customElements.define(t(e),g);break;case"feedlog-badge":customElements.get(t(e))||r();break;case"feedlog-button":customElements.get(t(e))||n();break;case"feedlog-github-issues":customElements.get(t(e))||h();break;case"feedlog-issues-list":customElements.get(t(e))||a()}}))}w();const m=g,b=w;export{m as FeedlogGithubIssuesClient,b as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface FeedlogGithubIssues extends Components.FeedlogGithubIssues, HTMLElement {}
|
|
4
|
+
export const FeedlogGithubIssues: {
|
|
5
|
+
prototype: FeedlogGithubIssues;
|
|
6
|
+
new (): FeedlogGithubIssues;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as o,d as s}from"./p-CPOiBAxu.js";const p=o,r=s;export{p as FeedlogGithubIssues,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface FeedlogIssuesList extends Components.FeedlogIssuesList, HTMLElement {}
|
|
4
|
+
export const FeedlogIssuesList: {
|
|
5
|
+
prototype: FeedlogIssuesList;
|
|
6
|
+
new (): FeedlogIssuesList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as s,d as o}from"./p-DMcNh5Ys.js";const p=s,r=o;export{p as FeedlogIssuesList,r as defineCustomElement}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
|
3
|
+
* if the path needs to be customized.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAssetPath: (path: string) => string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to manually set the base path where assets can be found.
|
|
9
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
10
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
11
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
12
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
13
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
14
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
15
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
16
|
+
*/
|
|
17
|
+
export declare const setAssetPath: (path: string) => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
21
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
22
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
23
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
24
|
+
* will result in the same behavior.
|
|
25
|
+
*/
|
|
26
|
+
export declare const setNonce: (nonce: string) => void
|
|
27
|
+
|
|
28
|
+
export interface SetPlatformOptions {
|
|
29
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
30
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
31
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
34
|
+
|
|
35
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=":root{--feedlog-font-size:16px;--feedlog-background:#ffffff;--feedlog-foreground:oklch(0.145 0 0);--feedlog-card:#ffffff;--feedlog-card-foreground:oklch(0.145 0 0);--feedlog-popover:oklch(1 0 0);--feedlog-popover-foreground:oklch(0.145 0 0);--feedlog-primary:#030213;--feedlog-primary-foreground:oklch(1 0 0);--feedlog-secondary:oklch(0.95 0.0058 264.53);--feedlog-secondary-foreground:#030213;--feedlog-muted:#ececf0;--feedlog-muted-foreground:#717182;--feedlog-accent:#e9ebef;--feedlog-accent-foreground:#030213;--feedlog-destructive:#d4183d;--feedlog-destructive-foreground:#ffffff;--feedlog-border:rgba(0, 0, 0, 0.1);--feedlog-input:transparent;--feedlog-input-background:#f3f3f5;--feedlog-switch-background:#cbced4;--feedlog-ring:oklch(0.708 0 0);--feedlog-radius:0.625rem;--feedlog-blue-100:oklch(0.932 0.032 255.585);--feedlog-blue-400:oklch(0.707 0.165 254.624);--feedlog-blue-500:oklch(0.623 0.214 259.815);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-blue-700:oklch(0.488 0.243 264.376);--feedlog-blue-900:oklch(0.379 0.146 265.522);--feedlog-font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace}.dark{--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-popover:oklch(0.145 0 0);--feedlog-popover-foreground:oklch(0.985 0 0);--feedlog-primary:oklch(0.985 0 0);--feedlog-primary-foreground:oklch(0.205 0 0);--feedlog-secondary:oklch(0.269 0 0);--feedlog-secondary-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-accent:oklch(0.269 0 0);--feedlog-accent-foreground:oklch(0.985 0 0);--feedlog-destructive:oklch(0.396 0.141 25.723);--feedlog-destructive-foreground:oklch(0.637 0.237 25.331);--feedlog-border:oklch(0.269 0 0);--feedlog-input:oklch(0.269 0 0);--feedlog-ring:oklch(0.439 0 0)}";var e,n,i,r,s,o,l,f,c,h,u,a,d,p,g,v,b,m=Object.create,w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyNames,k=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty,S=t=>{throw TypeError(t)},j=(t,e)=>function(){return e||(0,t[$(t)[0]])((e={exports:{}}).exports,e),e.exports},M=(t,e,n)=>e.has(t)||S("Cannot "+n),E=(t,e,n)=>(M(t,e,"read from private field"),n?n.call(t):e.get(t)),x=(t,e,n)=>e.has(t)?S("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),P=(t,e,n)=>(M(t,e,"write to private field"),e.set(t,n),n),W=(t,e,n)=>(M(t,e,"access private method"),n),R=j({"node_modules/balanced-match/index.js"(t,e){function n(t,e,n){t instanceof RegExp&&(t=i(t,n)),e instanceof RegExp&&(e=i(e,n));var s=r(t,e,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+t.length,s[1]),post:n.slice(s[1]+e.length)}}function i(t,e){var n=e.match(t);return n?n[0]:null}function r(t,e,n){var i,r,s,o,l,f=n.indexOf(t),c=n.indexOf(e,f+1),h=f;if(f>=0&&c>0){if(t===e)return[f,c];for(i=[],s=n.length;h>=0&&!l;)h==f?(i.push(h),f=n.indexOf(t,h+1)):1==i.length?l=[i.pop(),c]:((r=i.pop())<s&&(s=r,o=c),c=n.indexOf(e,h+1)),h=f<c&&f>=0?f:c;i.length&&(l=[s,o])}return l}e.exports=n,n.range=r}}),N=j({"node_modules/brace-expansion/index.js"(t,e){var n=R();e.exports=function(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),g(function(t){return t.split("\\\\").join(i).split("\\{").join(r).split("\\}").join(s).split("\\,").join(o).split("\\.").join(l)}(t),!0).map(c)):[]};var i="\0SLASH"+Math.random()+"\0",r="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function f(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function c(t){return t.split(i).join("\\").split(r).join("{").split(s).join("}").split(o).join(",").split(l).join(".")}function h(t){if(!t)return[""];var e=[],i=n("{","}",t);if(!i)return t.split(",");var r=i.body,s=i.post,o=i.pre.split(",");o[o.length-1]+="{"+r+"}";var l=h(s);return s.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),e.push.apply(e,o),e}function u(t){return"{"+t+"}"}function a(t){return/^-?0\d/.test(t)}function d(t,e){return t<=e}function p(t,e){return t>=e}function g(t,e){var i=[],r=n("{","}",t);if(!r)return[t];var o=r.pre,l=r.post.length?g(r.post,!1):[""];if(/\$$/.test(r.pre))for(var c=0;c<l.length;c++)i.push(A=o+"{"+r.body+"}"+l[c]);else{var v,b,m=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),w=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),y=m||w,$=r.body.indexOf(",")>=0;if(!y&&!$)return r.post.match(/,(?!,).*\}/)?g(t=r.pre+"{"+r.body+s+r.post):[t];if(y)v=r.body.split(/\.\./);else if(1===(v=h(r.body)).length&&1===(v=g(v[0],!1).map(u)).length)return l.map((function(t){return r.pre+v[0]+t}));if(y){var k=f(v[0]),O=f(v[1]),S=Math.max(v[0].length,v[1].length),j=3==v.length?Math.abs(f(v[2])):1,M=d;O<k&&(j*=-1,M=p);var E=v.some(a);b=[];for(var x=k;M(x,O);x+=j){var P;if(w)"\\"===(P=String.fromCharCode(x))&&(P="");else if(P=x+"",E){var W=S-P.length;if(W>0){var R=Array(W+1).join("0");P=x<0?"-"+R+P.slice(1):R+P}}b.push(P)}}else{b=[];for(var N=0;N<v.length;N++)b.push.apply(b,g(v[N],!1))}for(N=0;N<b.length;N++)for(c=0;c<l.length;c++){var A=o+b[N]+l[c];(!e||y||A)&&i.push(A)}}return i}}}),A=(t,e)=>{var n;Object.entries(null!=(n=e.i.t)?n:{}).map((([n,[i]])=>{if(31&i||32&i){const i=t[n],r=function(t,e){for(;t;){const n=Object.getOwnPropertyDescriptor(t,e);if(null==n?void 0:n.get)return n;t=Object.getPrototypeOf(t)}}(Object.getPrototypeOf(t),n)||Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(t,n,{get(){return r.get.call(this)},set(t){r.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.o.has(n)?e.o.get(n):i}}))},C=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},z=(t,e)=>e in t,L=(t,e)=>(0,console.error)(t,e),_=new Map,T="undefined"!=typeof window?window:{},F=T.HTMLElement||class{},D={l:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,i)=>t.addEventListener(e,n,i),rel:(t,e,n,i)=>t.removeEventListener(e,n,i),ce:(t,e)=>new CustomEvent(t,e)},U=(()=>{try{return!!T.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),G=!!U&&(()=>!!T.document&&Object.getOwnPropertyDescriptor(T.document.adoptedStyleSheets,"length").writable)(),I=!1,Z=[],H=[],V=(t,e)=>n=>{t.push(n),I||(I=!0,e&&4&D.l?J(B):D.raf(B))},q=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){L(t)}t.length=0},B=()=>{q(Z),q(H),(I=Z.length>0)&&D.raf(B)},J=t=>Promise.resolve(void 0).then(t),Y=V(H,!0),K=t=>{const e=new URL(t,D.h);return e.origin!==T.location.origin?e.href:e.pathname},Q=t=>D.h=t,X=t=>"object"==(t=typeof t)||"function"===t,tt=((t,e,n)=>(n=null!=t?m(k(t)):{},((t,e,n,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let n of $(e))O.call(t,n)||undefined===n||w(t,n,{get:()=>e[n],enumerable:!(i=y(e,n))||i.enumerable});return t})(w(n,"default",{value:t,enumerable:!0}),t)))(N()),et=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},nt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},it=t=>t.replace(/[[\]\\-]/g,"\\$&"),rt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),st=t=>t.join(""),ot=(t,e)=>{const n=e;if("["!==t.charAt(n))throw Error("not in a brace expression");const i=[],r=[];let s=n+1,o=!1,l=!1,f=!1,c=!1,h=n,u="";t:for(;s<t.length;){const e=t.charAt(s);if("!"!==e&&"^"!==e||s!==n+1){if("]"===e&&o&&!f){h=s+1;break}if(o=!0,"\\"!==e||f){if("["===e&&!f)for(const[e,[o,f,c]]of Object.entries(nt))if(t.startsWith(e,s)){if(u)return["$.",!1,t.length-n,!0];s+=e.length,c?r.push(o):i.push(o),l=l||f;continue t}f=!1,u?(e>u?i.push(it(u)+"-"+it(e)):e===u&&i.push(it(e)),u="",s++):t.startsWith("-]",s+1)?(i.push(it(e+"-")),s+=2):t.startsWith("-",s+1)?(u=e,s+=2):(i.push(it(e)),s++)}else f=!0,s++}else c=!0,s++}if(h<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,t.length-n,!0];if(0===r.length&&1===i.length&&/^\\?.$/.test(i[0])&&!c){const t=2===i[0].length?i[0].slice(-1):i[0];return[rt(t),!1,h-n,!1]}const a="["+(c?"^":"")+st(i)+"]",d="["+(c?"":"^")+st(r)+"]";return[i.length&&r.length?"("+a+"|"+d+")":i.length?a:d,l,h-n,!0]},lt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),ft=new Set(["!","?","+","*","@"]),ct=t=>ft.has(t),ht="(?!\\.)",ut=new Set(["[","."]),at=new Set(["..","."]),dt=new Set("().*{}+?[]^$\\!"),pt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),gt="[^/]",vt=gt+"*?",bt=gt+"+?",mt=class t{constructor(t,d,p={}){x(this,a),((t,e,n)=>{((t,e,n)=>{e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,e+"",n)})(this,"type"),x(this,e),x(this,n),x(this,i,!1),x(this,r,[]),x(this,s),x(this,o),x(this,l),x(this,f,!1),x(this,c),x(this,h),x(this,u,!1),this.type=t,t&&P(this,n,!0),P(this,s,d),P(this,e,E(this,s)?E(E(this,s),e):this),P(this,c,E(this,e)===this?p:E(E(this,e),c)),P(this,l,E(this,e)===this?[]:E(E(this,e),l)),"!"!==t||E(E(this,e),f)||E(this,l).push(this),P(this,o,E(this,s)?E(E(this,s),r).length:0)}get hasMagic(){if(void 0!==E(this,n))return E(this,n);for(const t of E(this,r))if("string"!=typeof t&&(t.type||t.hasMagic))return P(this,n,!0);return E(this,n)}toString(){return void 0!==E(this,h)?E(this,h):P(this,h,this.type?this.type+"("+E(this,r).map((t=>t+"")).join("|")+")":E(this,r).map((t=>t+"")).join(""))}push(...e){for(const n of e)if(""!==n){if("string"!=typeof n&&!(n instanceof t&&E(n,s)===this))throw Error("invalid part: "+n);E(this,r).push(n)}}toJSON(){var t;const n=null===this.type?E(this,r).slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...E(this,r).map((t=>t.toJSON()))];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===E(this,e)||E(E(this,e),f)&&"!"===(null==(t=E(this,s))?void 0:t.type))&&n.push({}),n}isStart(){var n;if(E(this,e)===this)return!0;if(!(null==(n=E(this,s))?void 0:n.isStart()))return!1;if(0===E(this,o))return!0;const i=E(this,s);for(let e=0;e<E(this,o);e++){const n=E(i,r)[e];if(!(n instanceof t&&"!"===n.type))return!1}return!0}isEnd(){var t,n,i;if(E(this,e)===this)return!0;if("!"===(null==(t=E(this,s))?void 0:t.type))return!0;if(!(null==(n=E(this,s))?void 0:n.isEnd()))return!1;if(!this.type)return null==(i=E(this,s))?void 0:i.isEnd();const l=E(this,s)?E(E(this,s),r).length:0;return E(this,o)===l-1}copyIn(t){this.push("string"==typeof t?t:t.clone(this))}clone(e){const n=new t(this.type,e);for(const t of E(this,r))n.copyIn(t);return n}static fromGlob(e,n={}){var i;const r=new t(null,void 0,n);return W(i=t,p,g).call(i,e,r,0,n),r}toMMPattern(){if(this!==E(this,e))return E(this,e).toMMPattern();const t=""+this,[i,r,s,o]=this.toRegExpSource();if(!(s||E(this,n)||E(this,c).nocase&&!E(this,c).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const l=(E(this,c).nocase?"i":"")+(o?"u":"");return Object.assign(RegExp(`^${i}$`,l),{_src:i,_glob:t})}get options(){return E(this,c)}toRegExpSource(o){var l;const h=null!=o?o:!!E(this,c).dot;if(E(this,e)===this&&W(this,a,d).call(this),!this.type){const c=this.isStart()&&this.isEnd(),u=E(this,r).map((e=>{var r;const[s,l,f,h]="string"==typeof e?W(r=t,p,b).call(r,e,E(this,n),c):e.toRegExpSource(o);return P(this,n,E(this,n)||f),P(this,i,E(this,i)||h),s})).join("");let a="";if(this.isStart()&&"string"==typeof E(this,r)[0]&&(1!==E(this,r).length||!at.has(E(this,r)[0]))){const t=ut,e=h&&t.has(u.charAt(0))||u.startsWith("\\.")&&t.has(u.charAt(2))||u.startsWith("\\.\\.")&&t.has(u.charAt(4)),n=!h&&!o&&t.has(u.charAt(0));a=e?"(?!(?:^|/)\\.\\.?(?:$|/))":n?ht:""}let d="";return this.isEnd()&&E(E(this,e),f)&&"!"===(null==(l=E(this,s))?void 0:l.type)&&(d="(?:$|\\/)"),[a+u+d,lt(u),P(this,n,!!E(this,n)),E(this,i)]}const g="*"===this.type||"+"===this.type,m="!"===this.type?"(?:(?!(?:":"(?:";let w=W(this,a,v).call(this,h);if(this.isStart()&&this.isEnd()&&!w&&"!"!==this.type){const t=""+this;return P(this,r,[t]),this.type=null,P(this,n,void 0),[t,lt(""+this),!1,!1]}let y=!g||o||h?"":W(this,a,v).call(this,!0);y===w&&(y=""),y&&(w=`(?:${w})(?:${y})*?`);let $="";return $="!"===this.type&&E(this,u)?(this.isStart()&&!h?ht:"")+bt:m+w+("!"===this.type?"))"+(!this.isStart()||h||o?"":ht)+vt+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&y?")":"*"===this.type&&y?")?":")"+this.type),[$,lt(w),P(this,n,!!E(this,n)),E(this,i)]}};e=new WeakMap,n=new WeakMap,i=new WeakMap,r=new WeakMap,s=new WeakMap,o=new WeakMap,l=new WeakMap,f=new WeakMap,c=new WeakMap,h=new WeakMap,u=new WeakMap,a=new WeakSet,d=function(){if(this!==E(this,e))throw Error("should only call on root");if(E(this,f))return this;let t;for(P(this,f,!0);t=E(this,l).pop();){if("!"!==t.type)continue;let e=t,n=E(e,s);for(;n;){for(let i=E(e,o)+1;!n.type&&i<E(n,r).length;i++)for(const e of E(t,r)){if("string"==typeof e)throw Error("string part in extglob AST??");e.copyIn(E(n,r)[i])}e=n,n=E(e,s)}}return this},p=new WeakSet,g=function(t,e,i,s){var o,l;let f=!1,c=!1,h=-1,a=!1;if(null===e.type){let n=i,r="";for(;n<t.length;){const i=t.charAt(n++);if(f||"\\"===i)f=!f,r+=i;else if(c)n===h+1?"^"!==i&&"!"!==i||(a=!0):"]"!==i||n===h+2&&a||(c=!1),r+=i;else if("["!==i)if(s.noext||!ct(i)||"("!==t.charAt(n))r+=i;else{e.push(r),r="";const l=new mt(i,e);n=W(o=mt,p,g).call(o,t,l,n,s),e.push(l)}else c=!0,h=n,a=!1,r+=i}return e.push(r),n}let d=i+1,v=new mt(null,e);const b=[];let m="";for(;d<t.length;){const n=t.charAt(d++);if(f||"\\"===n)f=!f,m+=n;else if(c)d===h+1?"^"!==n&&"!"!==n||(a=!0):"]"!==n||d===h+2&&a||(c=!1),m+=n;else if("["!==n)if(ct(n)&&"("===t.charAt(d)){v.push(m),m="";const e=new mt(n,v);v.push(e),d=W(l=mt,p,g).call(l,t,e,d,s)}else if("|"!==n){if(")"===n)return""===m&&0===E(e,r).length&&P(e,u,!0),v.push(m),m="",e.push(...b,v),d;m+=n}else v.push(m),m="",b.push(v),v=new mt(null,e);else c=!0,h=d,a=!1,m+=n}return e.type=null,P(e,n,void 0),P(e,r,[t.substring(i-1)]),d},v=function(t){return E(this,r).map((e=>{if("string"==typeof e)throw Error("string type in extglob ast??");const[n,r,s,o]=e.toRegExpSource(t);return P(this,i,E(this,i)||o),n})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")},b=function(t,e,n=!1){let i=!1,r="",s=!1;for(let o=0;o<t.length;o++){const l=t.charAt(o);if(i)i=!1,r+=(dt.has(l)?"\\":"")+l;else if("\\"!==l){if("["===l){const[n,i,l,f]=ot(t,o);if(l){r+=n,s=s||i,o+=l-1,e=e||f;continue}}"*"!==l?"?"!==l?r+=pt(l):(r+=gt,e=!0):(r+=n&&"*"===t?bt:vt,e=!0)}else o===t.length-1?r+="\\\\":i=!0}return[r,lt(t),!!e,s]},x(mt,p);var wt=mt,yt=(t,e,n={})=>(et(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Vt(e,n).match(t)),$t=/^\*+([^+@!?\*\[\(]*)$/,kt=t=>e=>!e.startsWith(".")&&e.endsWith(t),Ot=t=>e=>e.endsWith(t),St=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),jt=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Mt=/^\*+\.\*+$/,Et=t=>!t.startsWith(".")&&t.includes("."),xt=t=>"."!==t&&".."!==t&&t.includes("."),Pt=/^\.\*+$/,Wt=t=>"."!==t&&".."!==t&&t.startsWith("."),Rt=/^\*+$/,Nt=t=>0!==t.length&&!t.startsWith("."),At=t=>0!==t.length&&"."!==t&&".."!==t,Ct=/^\?+([^+@!?\*\[\(]*)?$/,zt=([t,e=""])=>{const n=Ft([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Lt=([t,e=""])=>{const n=Dt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},_t=([t,e=""])=>{const n=Dt([t]);return e?t=>n(t)&&t.endsWith(e):n},Tt=([t,e=""])=>{const n=Ft([t]);return e?t=>n(t)&&t.endsWith(e):n},Ft=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},Dt=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},Ut="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";yt.sep="win32"===Ut?"\\":"/";var Gt=Symbol("globstar **");yt.GLOBSTAR=Gt,yt.filter=(t,e={})=>n=>yt(n,t,e);var It=(t,e={})=>Object.assign({},t,e);yt.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return yt;const e=yt;return Object.assign(((n,i,r={})=>e(n,i,It(t,r))),{Minimatch:class extends e.Minimatch{constructor(e,n={}){super(e,It(t,n))}static defaults(n){return e.defaults(It(t,n)).Minimatch}},AST:class extends e.AST{constructor(e,n,i={}){super(e,n,It(t,i))}static fromGlob(n,i={}){return e.AST.fromGlob(n,It(t,i))}},unescape:(n,i={})=>e.unescape(n,It(t,i)),escape:(n,i={})=>e.escape(n,It(t,i)),filter:(n,i={})=>e.filter(n,It(t,i)),defaults:n=>e.defaults(It(t,n)),makeRe:(n,i={})=>e.makeRe(n,It(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,It(t,i)),match:(n,i,r={})=>e.match(n,i,It(t,r)),sep:e.sep,GLOBSTAR:Gt})};var Zt=(t,e={})=>(et(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,tt.default)(t));yt.braceExpand=Zt,yt.makeRe=(t,e={})=>new Vt(t,e).makeRe(),yt.match=(t,e,n={})=>{const i=new Vt(e,n);return t=t.filter((t=>i.match(t))),i.options.nonull&&!t.length&&t.push(e),t};var Ht=/[?*]|[+@!]\(.*?\)|\[|\]/,Vt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){et(t),this.options=e=e||{},this.pattern=t,this.platform=e.platform||Ut,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const n=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((t=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&Ht.test(t[2])||Ht.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))];if(n)return[t[0],...t.slice(1).map((t=>this.parse(t)))]}return t.map((t=>this.parse(t)))}));if(this.debug(this.pattern,i),this.set=i.filter((t=>-1===t.indexOf(!1))),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)"**"===t[e][n]&&(t[e][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t}))}levelOneOptimize(t){return t.map((t=>0===(t=t.reduce(((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)}),[])).length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const i=t[n];1===n&&""===i&&""===t[0]||"."!==i&&""!==i||(e=!0,t.splice(n,1),n--)}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let n=0;for(;-1!==(n=t.indexOf("..",n+1));){const i=t[n-1];i&&"."!==i&&".."!==i&&"**"!==i&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let i=-1;for(;-1!==(i=n.indexOf("**",i+1));){let r=i;for(;"**"===n[r+1];)r++;r>i&&n.splice(i+1,r-i);const s=n[i+2],o=n[i+3];if(".."!==n[i+1])continue;if(!s||"."===s||".."===s||!o||"."===o||".."===o)continue;e=!0,n.splice(i,1);const l=n.slice(0);l[i]="**",t.push(l),i--}if(!this.preserveMultipleSlashes){for(let t=1;t<n.length-1;t++){const i=n[t];1===t&&""===i&&""===n[0]||"."!==i&&""!==i||(e=!0,n.splice(t,1),t--)}"."!==n[0]||2!==n.length||"."!==n[1]&&""!==n[1]||(e=!0,n.pop())}let r=0;for(;-1!==(r=n.indexOf("..",r+1));){const t=n[r-1];t&&"."!==t&&".."!==t&&"**"!==t&&(e=!0,n.splice(r-1,2,...1===r&&"**"===n[r+1]?["."]:[]),0===n.length&&n.push(""),r-=2)}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const i=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);i&&(t[e]=i,t[n]=[])}return t.filter((t=>t.length))}partsMatch(t,e,n=!1){let i=0,r=0,s=[],o="";for(;i<t.length&&r<e.length;)if(t[i]===e[r])s.push("b"===o?e[r]:t[i]),i++,r++;else if(n&&"**"===t[i]&&e[r]===t[i+1])s.push(t[i]),i++;else if(n&&"**"===e[r]&&t[i]===e[r+1])s.push(e[r]),r++;else if("*"!==t[i]||!e[r]||!this.options.dot&&e[r].startsWith(".")||"**"===e[r]){if("*"!==e[r]||!t[i]||!this.options.dot&&t[i].startsWith(".")||"**"===t[i])return!1;if("a"===o)return!1;o="b",s.push(e[r]),i++,r++}else{if("b"===o)return!1;o="a",s.push(t[i]),i++,r++}return t.length===e.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let i=0;i<t.length&&"!"===t.charAt(i);i++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const i=this.options;if(this.isWindows){const n="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),i=!n&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),r="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),s=i?3:n?0:void 0,o=!r&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:r?0:void 0;if("number"==typeof s&&"number"==typeof o){const[n,i]=[t[s],e[o]];n.toLowerCase()===i.toLowerCase()&&(e[o]=n,o>s?e=e.slice(o):s>o&&(t=t.slice(s)))}}const{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var s=0,o=0,l=t.length,f=e.length;s<l&&o<f;s++,o++){this.debug("matchOne loop");var c=e[o],h=t[s];if(this.debug(e,c,h),!1===c)return!1;if(c===Gt){this.debug("GLOBSTAR",[e,c,h]);var u=s,a=o+1;if(a===f){for(this.debug("** at the end");s<l;s++)if("."===t[s]||".."===t[s]||!i.dot&&"."===t[s].charAt(0))return!1;return!0}for(;u<l;){var d=t[u];if(this.debug("\nglobstar while",t,u,e,a,d),this.matchOne(t.slice(u),e.slice(a),n))return this.debug("globstar found match!",u,l,d),!0;if("."===d||".."===d||!i.dot&&"."===d.charAt(0)){this.debug("dot detected!",t,u,e,a);break}this.debug("globstar swallow a segment, and continue"),u++}return!(!n||(this.debug("\n>>> no match, partial?",t,u,e,a),u!==l))}let r;if("string"==typeof c?(r=h===c,this.debug("string match",c,h,r)):(r=c.test(h),this.debug("pattern match",c,h,r)),!r)return!1}if(s===l&&o===f)return!0;if(s===l)return n;if(o===f)return s===l-1&&""===t[s];throw Error("wtf?")}braceExpand(){return Zt(this.pattern,this.options)}parse(t){et(t);const e=this.options;if("**"===t)return Gt;if(""===t)return"";let n,i=null;(n=t.match(Rt))?i=e.dot?At:Nt:(n=t.match($t))?i=(e.nocase?e.dot?jt:St:e.dot?Ot:kt)(n[1]):(n=t.match(Ct))?i=(e.nocase?e.dot?Lt:zt:e.dot?_t:Tt)(n):(n=t.match(Mt))?i=e.dot?xt:Et:(n=t.match(Pt))&&(i=Wt);const r=wt.fromGlob(t,this.options).toMMPattern();return i&&"object"==typeof r&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(e.nocase?["i"]:[]);let r=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))i.add(e);return"string"==typeof t?(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))(t):t===Gt?Gt:t._src}));return e.forEach(((t,i)=>{const r=e[i+1],s=e[i-1];t===Gt&&s!==Gt&&(void 0===s?void 0!==r&&r!==Gt?e[i+1]="(?:\\/|"+n+"\\/)?"+r:e[i]=n:void 0===r?e[i-1]=s+"(?:\\/|"+n+")?":r!==Gt&&(e[i-1]=s+"(?:\\/|\\/"+n+"\\/)"+r,e[i+1]=Gt))})),e.filter((t=>t!==Gt)).join("/")})).join("|");const[s,o]=t.length>1?["(?:",")"]:["",""];r="^"+s+r+o+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=RegExp(r,[...i].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const r=this.set;this.debug(this.pattern,"set",r);let s=i[i.length-1];if(!s)for(let t=i.length-2;!s&&t>=0;t--)s=i[t];for(let t=0;t<r.length;t++){const o=r[t];let l=i;if(n.matchBase&&1===o.length&&(l=[s]),this.matchOne(l,o,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return yt.defaults(t).Minimatch}};yt.AST=wt,yt.Minimatch=Vt,yt.escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),yt.unescape=lt,((t,e)=>{for(var n in e)w(t,n,{get:e[n],enumerable:!0})})({},{err:()=>Bt,map:()=>Jt,ok:()=>qt,unwrap:()=>Kt,unwrapErr:()=>Qt});var qt=t=>({isOk:!0,isErr:!1,value:t}),Bt=t=>({isOk:!1,isErr:!0,value:t});function Jt(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>qt(t))):qt(n)}if(t.isErr)return Bt(t.value);throw"should never get here"}var Yt,Kt=t=>{if(t.isOk)return t.value;throw t.value},Qt=t=>{if(t.isErr)return t.value;throw t.value};function Xt(){var e;const n=this.attachShadow({mode:"open"});if(void 0===Yt&&(Yt=null!=(e=function(t){if(!U)return;const e=new CSSStyleSheet;return e.replaceSync(t),e}(t))?e:null),Yt)G?n.adoptedStyleSheets.push(Yt):n.adoptedStyleSheets=[...n.adoptedStyleSheets,Yt];else if(!U){const e=document.createElement("style");e.innerHTML=t,n.prepend(e)}}var te=new WeakMap,ee=t=>"sc-"+t.u,ne=(t,e,...n)=>{let i=null,r=null,s=!1,o=!1;const l=[],f=e=>{for(let n=0;n<e.length;n++)i=e[n],Array.isArray(i)?f(i):null!=i&&"boolean"!=typeof i&&((s="function"!=typeof t&&!X(i))&&(i+=""),s&&o?l[l.length-1].p+=i:l.push(s?ie(null,i):i),o=s)};if(f(n),e){e.key&&(r=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,l,se);const c=ie(t,null);return c.v=e,l.length>0&&(c.m=l),c.$=r,c},ie=(t,e)=>({l:0,k:t,p:e,O:null,m:null,v:null,$:null}),re={},se={forEach:(t,e)=>t.map(oe).forEach(e),map:(t,e)=>t.map(oe).map(e).map(le)},oe=t=>({vattrs:t.v,vchildren:t.m,vkey:t.$,vname:t.S,vtag:t.k,vtext:t.p}),le=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),ne(t.vtag,e,...t.vchildren||[])}const e=ie(t.vtag,t.vtext);return e.v=t.vattrs,e.m=t.vchildren,e.$=t.vkey,e.S=t.vname,e},fe=t=>{const e=(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t);return RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,"g")};fe("::slotted"),fe(":host"),fe(":host-context");var ce,he=(t,e)=>null==t||X(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,ue=(t,e)=>{const n=t;return{emit:t=>ae(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},ae=(t,e,n)=>{const i=D.ce(e,n);return t.dispatchEvent(i),i},de=(t,e,n,i,r,s)=>{if(n===i)return;let o=z(t,e),l=e.toLowerCase();if("class"===e){const e=t.classList,r=ge(n);let s=ge(i);e.remove(...r.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!r.includes(t))))}else if("style"===e){for(const e in n)i&&null!=i[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in i)n&&i[e]===n[e]||(e.includes("-")?t.style.setProperty(e,i[e]):t.style[e]=i[e])}else if("key"===e);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){const l=X(i);if((o||l&&null!==i)&&!r)try{if(t.tagName.includes("-"))t[e]!==i&&(t[e]=i);else{const r=null==i?"":i;"list"===e?o=!1:null!=n&&t[e]==r||("function"==typeof t.__lookupSetter__(e)?t[e]=r:t.setAttribute(e,r))}}catch(t){}null==i||!1===i?!1===i&&""!==t.getAttribute(e)||t.removeAttribute(e):(!o||4&s||r)&&!l&&1===t.nodeType&&t.setAttribute(e,i=!0===i?"":i)}else if(e="-"===e[2]?e.slice(3):z(T,l)?l.slice(2):l[2]+e.slice(3),n||i){const r=e.endsWith(ve);e=e.replace(be,""),n&&D.rel(t,e,n,r),i&&D.ael(t,e,i,r)}},pe=/\s/,ge=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(pe):[]),ve="Capture",be=RegExp(ve+"$"),me=(t,e,n)=>{const i=11===e.O.nodeType&&e.O.host?e.O.host:e.O,r=t&&t.v||{},s=e.v||{};for(const t of we(Object.keys(r)))t in s||de(i,t,r[t],void 0,n,e.l);for(const t of we(Object.keys(s)))de(i,t,r[t],s[t],n,e.l)};function we(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var ye=!1,$e=(t,e,n)=>{const i=e.m[n];let r,s,o=0;if(null!==i.p)r=i.O=T.document.createTextNode(i.p);else{if(ye||(ye="svg"===i.k),!T.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(r=i.O=T.document.createElementNS(ye?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.k),ye&&"foreignObject"===i.k&&(ye=!1),me(null,i,ye),i.m){const e="template"===i.k?r.content:r;for(o=0;o<i.m.length;++o)s=$e(t,i,o),s&&e.appendChild(s)}"svg"===i.k?ye=!1:"foreignObject"===r.tagName&&(ye=!0)}return r["s-hn"]=ce,r},ke=(t,e,n,i,r,s)=>{let o,l=t;for(l.shadowRoot&&l.tagName===ce&&(l=l.shadowRoot),"template"===n.k&&(l=l.content);r<=s;++r)i[r]&&(o=$e(null,n,r),o&&(i[r].O=o,Me(l,o,e)))},Oe=(t,e,n)=>{for(let i=e;i<=n;++i){const e=t[i];if(e){const t=e.O;t&&t.remove()}}},Se=(t,e,n=!1)=>t.k===e.k&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),je=(t,e,n=!1)=>{const i=e.O=t.O,r=t.m,s=e.m,o=e.k,l=e.p;null===l?(me(t,e,ye="svg"===o||"foreignObject"!==o&&ye),null!==r&&null!==s?((t,e,n,i,r=!1)=>{let s,o,l=0,f=0,c=0,h=0,u=e.length-1,a=e[0],d=e[u],p=i.length-1,g=i[0],v=i[p];const b="template"===n.k?t.content:t;for(;l<=u&&f<=p;)if(null==a)a=e[++l];else if(null==d)d=e[--u];else if(null==g)g=i[++f];else if(null==v)v=i[--p];else if(Se(a,g,r))je(a,g,r),a=e[++l],g=i[++f];else if(Se(d,v,r))je(d,v,r),d=e[--u],v=i[--p];else if(Se(a,v,r))je(a,v,r),Me(b,a.O,d.O.nextSibling),a=e[++l],v=i[--p];else if(Se(d,g,r))je(d,g,r),Me(b,d.O,a.O),d=e[--u],g=i[++f];else{for(c=-1,h=l;h<=u;++h)if(e[h]&&null!==e[h].$&&e[h].$===g.$){c=h;break}c>=0?(o=e[c],o.k!==g.k?s=$e(e&&e[f],n,c):(je(o,g,r),e[c]=void 0,s=o.O),g=i[++f]):(s=$e(e&&e[f],n,f),g=i[++f]),s&&Me(a.O.parentNode,s,a.O)}l>u?ke(t,null==i[p+1]?null:i[p+1].O,n,i,f,p):f>p&&Oe(e,l,u)})(i,r,e,s,n):null!==s?(null!==t.p&&(i.textContent=""),ke(i,null,e,s,0,s.length-1)):!n&&null!==r&&Oe(r,0,r.length-1),ye&&"svg"===o&&(ye=!1)):t.p!==l&&(i.data=l)},Me=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),Ee=(t,e,n=!1)=>{const i=t.$hostElement$,r=t.j||ie(null,null),s=(t=>t&&t.k===re)(e)?e:ne(null,null,e);if(ce=i.tagName,n&&s.v)for(const t of Object.keys(s.v))i.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.v[t]=i[t]);s.k=null,s.l|=4,t.j=s,s.O=r.O=i.shadowRoot||i,je(r,s,n)},xe=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((i=>t.M=()=>{e["s-p"].splice(n-1,1),i()})))}},Pe=(t,e)=>{if(t.l|=16,4&t.l)return void(t.l|=512);xe(t,t.P);const n=()=>We(t,e);if(!e)return Y(n);queueMicrotask((()=>{n()}))},We=(t,e)=>{const n=t.$hostElement$,i=n;if(!i)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let r;return r=_e(i,e?"componentWillLoad":"componentWillUpdate",void 0,n),r=Re(r,(()=>_e(i,"componentWillRender",void 0,n))),Re(r,(()=>Ae(t,i,e)))},Re=(t,e)=>Ne(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Ne=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Ae=async(t,e,n)=>{var i;const r=t.$hostElement$,s=r["s-rc"];n&&(t=>{const e=t.i,n=t.$hostElement$,i=e.l,r=((t,e)=>{var n,i,r;const s=ee(e),o=_.get(s);if(!T.document)return s;if(t=11===t.nodeType?t:T.document,o)if("string"==typeof o){let r,l=te.get(t=t.head||t);if(l||te.set(t,l=new Set),!l.has(s)){r=T.document.createElement("style"),r.innerHTML=o;const f=null!=(n=D.W)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=T.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=f&&r.setAttribute("nonce",f),!(1&e.l))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(r,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(U){const e=new(null!=(i=t.defaultView)?i:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(o),G?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=o+e.innerHTML:t.prepend(r)}else t.append(r);1&e.l&&t.insertBefore(r,null),4&e.l&&(r.innerHTML+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),l&&l.add(s)}}else{let e=te.get(t);if(e||te.set(t,e=new Set),!e.has(s)){const n=null!=(r=t.defaultView)?r:t.ownerDocument.defaultView;let i;if(o.constructor===n.CSSStyleSheet)i=o;else{i=new n.CSSStyleSheet;for(let t=0;t<o.cssRules.length;t++)i.insertRule(o.cssRules[t].cssText,t)}G?t.adoptedStyleSheets.push(i):t.adoptedStyleSheets=[...t.adoptedStyleSheets,i],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&i&&(n["s-sc"]=r,n.classList.add(r+"-h"))})(t);Ce(t,e,r,n),s&&(s.map((t=>t())),r["s-rc"]=void 0);{const e=null!=(i=r["s-p"])?i:[],n=()=>ze(t);0===e.length?n():(Promise.all(e).then(n),t.l|=4,e.length=0)}},Ce=(t,e,n,i)=>{try{e=e.render(),t.l&=-17,t.l|=2,Ee(t,e,i)}catch(e){L(e,t.$hostElement$)}return null},ze=t=>{const e=t.$hostElement$,n=e,i=t.P;_e(n,"componentDidRender",void 0,e),64&t.l?_e(n,"componentDidUpdate",void 0,e):(t.l|=64,Te(e),_e(n,"componentDidLoad",void 0,e),t.R(e),i||Le()),t.M&&(t.M(),t.M=void 0),512&t.l&&J((()=>Pe(t,!1))),t.l&=-517},Le=()=>{J((()=>ae(T,"appload",{detail:{namespace:"feedlog-toolkit"}})))},_e=(t,e,n,i)=>{if(t&&t[e])try{return t[e](n)}catch(t){L(t,i)}},Te=t=>t.classList.add("hydrated"),Fe=(t,e,n,i)=>{const r=C(t);if(!r)return;const s=t,o=r.o.get(e),l=r.l,f=s;if(!((n=he(n,i.t[e][0]))===o||Number.isNaN(o)&&Number.isNaN(n)||(r.o.set(e,n),2!=(18&l)))){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,o,e))return;Pe(r,!1)}},De=(t,e)=>{var n,i;const r=t.prototype;if(e.t){const s=Object.entries(null!=(n=e.t)?n:{});s.map((([t,[n]])=>{if(31&n||32&n){const{get:i,set:s}=Object.getOwnPropertyDescriptor(r,t)||{};i&&(e.t[t][0]|=2048),s&&(e.t[t][0]|=4096),Object.defineProperty(r,t,{get(){return i?i.apply(this):((t,e)=>C(this).o.get(e))(0,t)},configurable:!0,enumerable:!0}),Object.defineProperty(r,t,{set(i){const r=C(this);if(r){if(s)return void 0===(32&n?this[t]:r.$hostElement$[t])&&r.o.get(t)&&(i=r.o.get(t)),s.call(this,he(i,n)),void Fe(this,t,i=32&n?this[t]:r.$hostElement$[t],e);Fe(this,t,i,e)}}})}}));{const n=new Map;r.attributeChangedCallback=function(t,i,o){D.jmp((()=>{var l;const f=n.get(t),c=C(this);if(this.hasOwnProperty(f),r.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==o)return;if(null==f){const n=null==c?void 0:c.l;if(c&&n&&!(8&n)&&o!==i){const r=this,s=null==(l=e.N)?void 0:l[t];null==s||s.forEach((e=>{const[[s,l]]=Object.entries(e);null!=r[s]&&(128&n||1&l)&&r[s].call(r,o,i,t)}))}return}const h=s.find((([t])=>t===f));h&&4&h[1][0]&&(o=null!==o&&"false"!==o);const u=Object.getOwnPropertyDescriptor(r,f);o==this[f]||u.get&&!u.set||(this[f]=o)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=e.N)?i:{}),...s.filter((([t,e])=>31&e[0])).map((([t,e])=>{const i=e[1]||t;return n.set(i,t),i}))]))}}return t},Ue=(t,e)=>{const n={l:e[0],u:e[1]};n.t=e[2];const i=t.prototype.connectedCallback,r=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const n={l:0,$hostElement$:t,i:e,o:new Map,A:new Map};n.C=new Promise((t=>n.R=t)),t["s-p"]=[],t["s-rc"]=[];const i=n;t.__stencil__getHostRef=()=>i,512&e.l&&A(t,n)})(this,n)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!C(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&D.l)){const e=C(t);if(!e)return;const n=e.i,i=()=>{};if(1&e.l)(null==e?void 0:e.L)||(null==e?void 0:e.C)&&e.C.then((()=>{}));else{e.l|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){xe(e,e.P=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&e in t&&t[e]!==Object.prototype[e]){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let i;if(!(32&e.l)&&(e.l|=32,i=t.constructor,customElements.whenDefined(t.localName).then((()=>e.l|=128)),i&&i.style)){let t;"string"==typeof i.style&&(t=i.style);const e=ee(n);if(!_.has(e)){const i=()=>{};((t,e,n)=>{let i=_.get(t);U&&n?(i=i||new CSSStyleSheet,"string"==typeof i?i=e:i.replaceSync(e)):i=e,_.set(t,i)})(e,t,!!(1&n.l)),i()}}const r=e.P,s=()=>Pe(e,!0);r&&r["s-rc"]?r["s-rc"].push(s):s()})(t,e,n)}i()}})(this),i&&i.call(this)},disconnectedCallback(){(async t=>{te.has(t)&&te.delete(t),t.shadowRoot&&te.has(t.shadowRoot)&&te.delete(t.shadowRoot)})(this),r&&r.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${n.u}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else Xt.call(this,n)}}),t.is=n.u,De(t,n)},Ge=t=>D.W=t,Ie=t=>Object.assign(D,t);function Ze(t,e){Ee({$hostElement$:e},t)}function He(t){return t}export{F as H,re as a,ue as c,K as getAssetPath,ne as h,Ue as p,Ze as render,Q as setAssetPath,Ge as setNonce,Ie as setPlatformOptions,He as t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as d,H as o,h as a}from"./index.js";const r=d(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.variant="default"}render(){return a("span",{key:"482a74feb8d254a75383c30c7b39790edd04a05b",class:`badge badge-${this.variant}`},a("slot",{key:"8d2db3fe0c2bc58e17829db4de7d0233189bb101"}))}static get style(){return":host{display:inline-block;--feedlog-badge-font-size:0.75rem;--feedlog-badge-font-weight:500;--feedlog-badge-padding-x:0.5rem;--feedlog-badge-padding-y:0.125rem;--feedlog-badge-border-radius:calc(0.625rem - 2px);--feedlog-blue-500:oklch(0.623 0.214 259.815);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-blue-700:oklch(0.488 0.243 264.376);--feedlog-destructive:#d4183d;--feedlog-destructive-hover:#b91c1c}:host(.dark){--feedlog-blue-500:oklch(0.623 0.214 259.815);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-destructive:oklch(0.396 0.141 25.723);--feedlog-destructive-hover:oklch(0.45 0.16 25.723)}.badge{display:inline-flex;align-items:center;justify-content:center;font-size:var(--feedlog-badge-font-size);font-weight:var(--feedlog-badge-font-weight);padding:var(--feedlog-badge-padding-y) var(--feedlog-badge-padding-x);border-radius:var(--feedlog-badge-border-radius);white-space:nowrap;transition:background-color 0.15s ease;font-family:inherit}.badge-default{background-color:var(--feedlog-blue-600);color:#ffffff}.badge-default:hover{background-color:var(--feedlog-blue-700)}:host(.dark) .badge-default{background-color:var(--feedlog-blue-500)}:host(.dark) .badge-default:hover{background-color:var(--feedlog-blue-600)}.badge-enhancement{background-color:var(--feedlog-blue-600);color:#ffffff}.badge-enhancement:hover{background-color:var(--feedlog-blue-700)}:host(.dark) .badge-enhancement{background-color:var(--feedlog-blue-500)}:host(.dark) .badge-enhancement:hover{background-color:var(--feedlog-blue-600)}.badge-destructive{background-color:var(--feedlog-destructive);color:#ffffff}.badge-destructive:hover{background-color:var(--feedlog-destructive-hover)}"}},[257,"feedlog-badge",{variant:[1]}]);function l(){"undefined"!=typeof customElements&&["feedlog-badge"].forEach((d=>{"feedlog-badge"===d&&(customElements.get(e(d))||customElements.define(e(d),r))}))}l();export{r as F,l as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as s,H as t,c as o,h as i,a}from"./index.js";import{d}from"./p-CHtSMTyP.js";import{d as r}from"./p-DMdb-G26.js";import{d as l}from"./p-DMcNh5Ys.js";const n=()=>i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("circle",{cx:"12",cy:"12",r:"4"}),i("path",{d:"M12 2v2"}),i("path",{d:"M12 20v2"}),i("path",{d:"m4.93 4.93 1.41 1.41"}),i("path",{d:"m17.66 17.66 1.41 1.41"}),i("path",{d:"M2 12h2"}),i("path",{d:"M20 12h2"}),i("path",{d:"m6.34 17.66-1.41 1.41"}),i("path",{d:"m19.07 4.93-1.41 1.41"})),c=()=>i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})),h=s(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=o(this,"feedlogUpvote"),this.feedlogThemeChange=o(this,"feedlogThemeChange"),this.feedlogLoadMore=o(this,"feedlogLoadMore"),this.issues=[],this.maxWidth="42rem",this.theme="light",this.loading=!1,this.error=null,this.showThemeToggle=!0,this.hasMore=!1,this.isLoadingMore=!1,this.currentTheme="light",this.handleUpvote=e=>{this.feedlogUpvote.emit(e.detail)},this.toggleTheme=()=>{this.currentTheme="dark"===this.currentTheme?"light":"dark",this.theme=this.currentTheme,this.feedlogThemeChange.emit(this.currentTheme)},this.handleLoadMore=()=>{this.feedlogLoadMore.emit()}}componentWillLoad(){this.currentTheme=this.theme}render(){return i(a,{key:"8f238ab41f45799062270c84188596d770d6bde0",class:"dark"===this.currentTheme?"dark":""},i("div",{key:"af0c2155ef3cdc12f228ec804ee906afd7d75477",class:"github-issues-container",style:{maxWidth:this.maxWidth}},i("header",{key:"ccf9a063df220f7a48e3600cb22df8203960a45b",class:"issues-header"},i("div",{key:"c261d6b0c8168a66faef9ec2fb381619f5175070",class:"header-content"},i("h1",{key:"19203aa63dab0648b0a2865fe812233bfbbc225a",class:"issues-title"},"GitHub Issues"),i("p",{key:"e717a4e64cc747c81ad7a9e1cec234c247bfc329",class:"issues-subtitle"},"Track bugs and enhancements for your project")),this.showThemeToggle&&i("feedlog-button",{key:"21057c7d384c53262e699e0384234077b0b36314",variant:"outline",size:"sm",onFeedlogClick:this.toggleTheme},i("dark"===this.currentTheme?n:c,null))),this.loading&&i("div",{key:"2059c491247e0a48a81d802d9757d9fa97ac1a72",class:"loading-state"},i("p",{key:"5654904e73b05bd5a05aa0243506e4bf074e5486"},"Loading issues...")),this.error&&i("div",{key:"7d2e09e0055e5d834aa870ed47bd4ebaba64dff1",class:"error-state"},i("p",{key:"d4cc2bb872c81234b4e81a4ec4ce21aff368ad74"},"Error: ",this.error)),!this.loading&&!this.error&&i("div",{key:"e25eb90f7098416837a26a44e5811888530220a4"},i("feedlog-issues-list",{key:"a8e7ec5c5861cb31456738107b93f6e7adebbbe9",issues:this.issues,theme:this.currentTheme,onFeedlogUpvote:this.handleUpvote}),this.hasMore&&i("div",{key:"0d935e9247f44bff0700fce487d0bc4ccd104f2a",class:"load-more-container"},i("feedlog-button",{key:"2858d701f5e3d219c39a6a28a7475c619464bc72",onFeedlogClick:this.handleLoadMore,disabled:this.isLoadingMore,variant:"outline"},this.isLoadingMore?"Loading...":"Load More Issues")))))}static get style(){return":host{display:block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-background:#ffffff;--feedlog-foreground:oklch(0.145 0 0);--feedlog-muted-foreground:#717182;--feedlog-destructive:#d4183d;--feedlog-padding:2rem}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-destructive:oklch(0.637 0.237 25.331)}.github-issues-container{min-height:100vh;background-color:var(--feedlog-background);padding:var(--feedlog-padding);margin:0 auto}.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,.error-state{padding:2rem;text-align:center;color:var(--feedlog-muted-foreground)}.error-state{color:var(--feedlog-destructive)}.load-more-container{display:flex;justify-content:center;padding:2rem 0;gap:1rem}"}},[1,"feedlog-github-issues",{issues:[16],maxWidth:[1,"max-width"],theme:[1025],loading:[4],error:[1],showThemeToggle:[4,"show-theme-toggle"],hasMore:[4,"has-more"],isLoadingMore:[4,"is-loading-more"],currentTheme:[32]}]);function f(){"undefined"!=typeof customElements&&["feedlog-github-issues","feedlog-badge","feedlog-button","feedlog-issues-list"].forEach((s=>{switch(s){case"feedlog-github-issues":customElements.get(e(s))||customElements.define(e(s),h);break;case"feedlog-badge":customElements.get(e(s))||d();break;case"feedlog-button":customElements.get(e(s))||r();break;case"feedlog-issues-list":customElements.get(e(s))||l()}}))}f();export{h as F,f as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as o,H as r,c as t,h as s,a as d}from"./index.js";import{d as l}from"./p-CHtSMTyP.js";const a=()=>s("svg",{class:"upvote-icon filled",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"},s("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})),i=()=>s("svg",{class:"upvote-icon outline",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},s("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})),n=o(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=t(this,"feedlogUpvote"),this.issues=[],this.theme="light",this.handleUpvote=(e,o)=>{e.stopPropagation(),this.feedlogUpvote.emit({issueId:o.id,currentUpvoted:o.hasUpvoted,currentCount:o.upvoteCount})}}render(){return s(d,{key:"5cef6f5476239d0f8096664c04690aa4c3383bd0",class:"dark"===this.theme?"dark":""},s("div",{key:"d72fffe457f0497dbbbe0c64dab3282f76a49217",class:"issues-list"},0===this.issues.length?s("div",{class:"empty-state"},s("p",null,"No issues found")):this.issues.map((e=>s("div",{key:e.id,class:"issue-card"},s("div",{class:"issue-content"},s("div",{class:"issue-header"},s("div",{class:"issue-type-badge"},"bug"===e.type?s("feedlog-badge",{variant:"destructive"},"Bug"):s("feedlog-badge",{variant:"enhancement"},"Enhancement")),e.pinnedAt&&s("div",{class:"pinned-indicator",title:"Pinned issue"},"📌")),s("div",{class:"issue-main"},s("div",{class:"issue-details"},s("h3",{class:"issue-title"},e.title),s("p",{class:"issue-body"},e.body),s("div",{class:"issue-repository"},s("span",{class:"repo-name"},e.repository.owner,"/",e.repository.name))),s("button",{class:"upvote-button "+(e.hasUpvoted?"upvoted":""),onClick:o=>this.handleUpvote(o,e),title:e.hasUpvoted?"Remove upvote":"Upvote this issue"},s(e.hasUpvoted?a:i,null),s("span",{class:"upvote-count"},e.upvoteCount))),s("div",{class:"issue-footer"},s("span",{class:"issue-date",title:`Updated: ${e.updatedAt}`},"Updated ",this.formatDate(e.updatedAt)),s("span",{class:"issue-date",title:`Created: ${e.createdAt}`},"Created ",this.formatDate(e.createdAt)))))))))}formatDate(e){try{const o=new Date(e),r=new Date,t=Math.floor((r.getTime()-o.getTime())/1e3);return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:t<604800?`${Math.floor(t/86400)}d ago`:t<2592e3?`${Math.floor(t/604800)}w ago`:o.toLocaleDateString()}catch(e){return"unknown date"}}static get style(){return":host{display:block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-background:#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}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-border:oklch(0.269 0 0);--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-blue-900-30:color-mix(in oklab, oklch(0.379 0.146 265.522) 30%, transparent);--feedlog-red-900-30:color-mix(in oklab, oklch(0.396 0.141 25.723) 30%, transparent)}.issues-list{display:flex;flex-direction:column;gap:var(--feedlog-gap)}.empty-state{text-align:center;padding:3rem 1.5rem;color:var(--feedlog-muted-foreground);font-size:0.875rem}.issue-card{background-color:var(--feedlog-card);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);transition:box-shadow 0.15s ease;position:relative}.issue-card:hover{box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)}.issue-content{padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.issue-header{display:flex;align-items:center;gap:0.5rem;justify-content:space-between}.issue-type-badge{width:fit-content}.pinned-indicator{font-size:1rem;opacity:0.7}.issue-main{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.issue-details{flex:1;min-width:0}.issue-title{color:var(--feedlog-card-foreground);font-size:0.875rem;font-weight:600;margin:0 0 0.375rem 0;line-height:1.4;word-break:break-word}.issue-body{color:var(--feedlog-muted-foreground);font-size:0.75rem;line-height:1.625;margin:0 0 0.75rem 0;word-break:break-word;white-space:pre-wrap}.issue-repository{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;color:var(--feedlog-muted-foreground);margin-bottom:0.5rem}.repo-name{font-weight:500}.github-number{color:var(--feedlog-blue-600);font-weight:600}:host(.dark) .github-number{color:var(--feedlog-blue-400)}.upvote-button{display:flex;flex-direction:column;align-items:center;gap:0.125rem;padding:0.5rem 0.75rem;border-radius:0.5rem;background-color:var(--feedlog-muted);border:1px solid transparent;cursor:pointer;transition:all 0.15s ease;flex-shrink:0;font-size:0.75rem;font-weight:600}.upvote-button:hover{background-color:var(--feedlog-blue-100);border-color:var(--feedlog-blue-400)}.upvote-button.upvoted{background-color:var(--feedlog-red-100);border-color:var(--feedlog-red-400)}.upvote-button.upvoted:hover{background-color:var(--feedlog-red-100);border-color:var(--feedlog-red-600)}:host(.dark) .upvote-button:hover{background-color:var(--feedlog-blue-900-30);border-color:var(--feedlog-blue-600)}:host(.dark) .upvote-button.upvoted{background-color:var(--feedlog-red-900-30);border-color:var(--feedlog-red-600)}.upvote-icon{width:1rem;height:1rem;stroke-width:2}.upvote-icon.filled{color:var(--feedlog-red-600)}.upvote-icon.outline{color:var(--feedlog-blue-600)}:host(.dark) .upvote-icon.outline{color:var(--feedlog-blue-400)}.upvote-count{font-size:0.75rem;font-weight:600;color:var(--feedlog-card-foreground)}.issue-footer{display:flex;flex-direction:column;gap:0.25rem;font-size:0.75rem}.issue-date{color:var(--feedlog-muted-foreground);cursor:help}"}},[1,"feedlog-issues-list",{issues:[16],theme:[1]}]);function c(){"undefined"!=typeof customElements&&["feedlog-issues-list","feedlog-badge"].forEach((o=>{switch(o){case"feedlog-issues-list":customElements.get(e(o))||customElements.define(e(o),n);break;case"feedlog-badge":customElements.get(e(o))||l()}}))}c();export{n as F,c as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as o,H as r,c as t,h as n}from"./index.js";const d=o(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.feedlogClick=t(this,"feedlogClick"),this.variant="default",this.size="default",this.disabled=!1,this.type="button",this.handleClick=e=>{this.disabled||this.feedlogClick.emit(e)}}render(){return n("button",{key:"6cdd8347def51592707b1fb9aab0dc565ca0f76f",type:this.type,class:`button button-${this.variant} ${"default"===this.size?"button-size-default":`button-size-${this.size}`}`,disabled:this.disabled,onClick:this.handleClick},n("slot",{key:"3f3845195fa4b8a551473ecf1d5702321a31763e"}))}static get style(){return":host{display:inline-block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-background:#ffffff;--feedlog-foreground:oklch(0.145 0 0);--feedlog-primary:#030213;--feedlog-primary-foreground:oklch(1 0 0);--feedlog-secondary:oklch(0.95 0.0058 264.53);--feedlog-secondary-foreground:#030213;--feedlog-muted:#ececf0;--feedlog-accent:#e9ebef;--feedlog-accent-foreground:#030213;--feedlog-border:rgba(0, 0, 0, 0.1);--feedlog-input:transparent;--feedlog-ring:oklch(0.708 0 0);--feedlog-destructive:#d4183d;--feedlog-radius:0.625rem}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-primary:oklch(0.985 0 0);--feedlog-primary-foreground:oklch(0.205 0 0);--feedlog-secondary:oklch(0.269 0 0);--feedlog-secondary-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-accent:oklch(0.269 0 0);--feedlog-accent-foreground:oklch(0.985 0 0);--feedlog-border:oklch(0.269 0 0);--feedlog-input:oklch(0.269 0 0);--feedlog-ring:oklch(0.439 0 0);--feedlog-destructive:oklch(0.396 0.141 25.723)}button{display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;white-space:nowrap;font-size:0.875rem;font-weight:500;border-radius:calc(var(--feedlog-radius) - 2px);border:1px solid transparent;cursor:pointer;transition:all 0.15s ease;outline:none;font-family:inherit}button:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}button:focus-visible{border-color:var(--feedlog-ring);box-shadow:0 0 0 3px color-mix(in oklab, var(--feedlog-ring) 50%, transparent)}.button-default{background-color:var(--feedlog-primary);color:var(--feedlog-primary-foreground);border-color:transparent}.button-default:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-primary) 90%, transparent)}.button-outline{background-color:var(--feedlog-background);color:var(--feedlog-foreground);border-color:var(--feedlog-border)}.button-outline:hover:not(:disabled){background-color:var(--feedlog-accent);color:var(--feedlog-accent-foreground)}:host(.dark) .button-outline{background-color:transparent;border-color:var(--feedlog-input)}:host(.dark) .button-outline:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-accent) 50%, transparent)}.button-ghost{background-color:transparent;color:var(--feedlog-foreground);border-color:transparent}.button-ghost:hover:not(:disabled){background-color:var(--feedlog-accent);color:var(--feedlog-accent-foreground)}.button-destructive{background-color:var(--feedlog-destructive);color:#ffffff;border-color:transparent}.button-destructive:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-destructive) 90%, transparent)}:host(.dark) .button-destructive{background-color:color-mix(in oklab, var(--feedlog-destructive) 60%, transparent)}.button-size-sm{height:2rem;padding:0 0.75rem;font-size:0.75rem}.button-size-sm:has(svg:only-child){width:2rem;padding:0}.button-size-default{height:2.25rem;padding:0.5rem 1rem}.button-size-lg{height:2.5rem;padding:0.625rem 1.5rem;font-size:1rem}button svg{pointer-events:none;flex-shrink:0;width:1rem;height:1rem}"}},[257,"feedlog-button",{variant:[1],size:[1],disabled:[4],type:[1]}]);function l(){"undefined"!=typeof customElements&&["feedlog-button"].forEach((o=>{"feedlog-button"===o&&(customElements.get(e(o))||customElements.define(e(o),d))}))}l();export{d as F,l as d}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { r as registerInstance, h, c as createEvent, H as Host } from './index-CkB6Yzeb.js';
|
|
2
|
+
|
|
3
|
+
const feedlogBadgeCss = () => `:host{display:inline-block;--feedlog-badge-font-size:0.75rem;--feedlog-badge-font-weight:500;--feedlog-badge-padding-x:0.5rem;--feedlog-badge-padding-y:0.125rem;--feedlog-badge-border-radius:calc(0.625rem - 2px);--feedlog-blue-500:oklch(0.623 0.214 259.815);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-blue-700:oklch(0.488 0.243 264.376);--feedlog-destructive:#d4183d;--feedlog-destructive-hover:#b91c1c}:host(.dark){--feedlog-blue-500:oklch(0.623 0.214 259.815);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-destructive:oklch(0.396 0.141 25.723);--feedlog-destructive-hover:oklch(0.45 0.16 25.723)}.badge{display:inline-flex;align-items:center;justify-content:center;font-size:var(--feedlog-badge-font-size);font-weight:var(--feedlog-badge-font-weight);padding:var(--feedlog-badge-padding-y) var(--feedlog-badge-padding-x);border-radius:var(--feedlog-badge-border-radius);white-space:nowrap;transition:background-color 0.15s ease;font-family:inherit}.badge-default{background-color:var(--feedlog-blue-600);color:#ffffff}.badge-default:hover{background-color:var(--feedlog-blue-700)}:host(.dark) .badge-default{background-color:var(--feedlog-blue-500)}:host(.dark) .badge-default:hover{background-color:var(--feedlog-blue-600)}.badge-enhancement{background-color:var(--feedlog-blue-600);color:#ffffff}.badge-enhancement:hover{background-color:var(--feedlog-blue-700)}:host(.dark) .badge-enhancement{background-color:var(--feedlog-blue-500)}:host(.dark) .badge-enhancement:hover{background-color:var(--feedlog-blue-600)}.badge-destructive{background-color:var(--feedlog-destructive);color:#ffffff}.badge-destructive:hover{background-color:var(--feedlog-destructive-hover)}`;
|
|
4
|
+
|
|
5
|
+
const FeedlogBadge = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
/**
|
|
9
|
+
* Badge variant style
|
|
10
|
+
*/
|
|
11
|
+
this.variant = 'default';
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h("span", { key: '482a74feb8d254a75383c30c7b39790edd04a05b', class: `badge badge-${this.variant}` }, h("slot", { key: '8d2db3fe0c2bc58e17829db4de7d0233189bb101' })));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
FeedlogBadge.style = feedlogBadgeCss();
|
|
18
|
+
|
|
19
|
+
const feedlogButtonCss = () => `:host{display:inline-block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-background:#ffffff;--feedlog-foreground:oklch(0.145 0 0);--feedlog-primary:#030213;--feedlog-primary-foreground:oklch(1 0 0);--feedlog-secondary:oklch(0.95 0.0058 264.53);--feedlog-secondary-foreground:#030213;--feedlog-muted:#ececf0;--feedlog-accent:#e9ebef;--feedlog-accent-foreground:#030213;--feedlog-border:rgba(0, 0, 0, 0.1);--feedlog-input:transparent;--feedlog-ring:oklch(0.708 0 0);--feedlog-destructive:#d4183d;--feedlog-radius:0.625rem}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-primary:oklch(0.985 0 0);--feedlog-primary-foreground:oklch(0.205 0 0);--feedlog-secondary:oklch(0.269 0 0);--feedlog-secondary-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-accent:oklch(0.269 0 0);--feedlog-accent-foreground:oklch(0.985 0 0);--feedlog-border:oklch(0.269 0 0);--feedlog-input:oklch(0.269 0 0);--feedlog-ring:oklch(0.439 0 0);--feedlog-destructive:oklch(0.396 0.141 25.723)}button{display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;white-space:nowrap;font-size:0.875rem;font-weight:500;border-radius:calc(var(--feedlog-radius) - 2px);border:1px solid transparent;cursor:pointer;transition:all 0.15s ease;outline:none;font-family:inherit}button:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}button:focus-visible{border-color:var(--feedlog-ring);box-shadow:0 0 0 3px color-mix(in oklab, var(--feedlog-ring) 50%, transparent)}.button-default{background-color:var(--feedlog-primary);color:var(--feedlog-primary-foreground);border-color:transparent}.button-default:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-primary) 90%, transparent)}.button-outline{background-color:var(--feedlog-background);color:var(--feedlog-foreground);border-color:var(--feedlog-border)}.button-outline:hover:not(:disabled){background-color:var(--feedlog-accent);color:var(--feedlog-accent-foreground)}:host(.dark) .button-outline{background-color:transparent;border-color:var(--feedlog-input)}:host(.dark) .button-outline:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-accent) 50%, transparent)}.button-ghost{background-color:transparent;color:var(--feedlog-foreground);border-color:transparent}.button-ghost:hover:not(:disabled){background-color:var(--feedlog-accent);color:var(--feedlog-accent-foreground)}.button-destructive{background-color:var(--feedlog-destructive);color:#ffffff;border-color:transparent}.button-destructive:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-destructive) 90%, transparent)}:host(.dark) .button-destructive{background-color:color-mix(in oklab, var(--feedlog-destructive) 60%, transparent)}.button-size-sm{height:2rem;padding:0 0.75rem;font-size:0.75rem}.button-size-sm:has(svg:only-child){width:2rem;padding:0}.button-size-default{height:2.25rem;padding:0.5rem 1rem}.button-size-lg{height:2.5rem;padding:0.625rem 1.5rem;font-size:1rem}button svg{pointer-events:none;flex-shrink:0;width:1rem;height:1rem}`;
|
|
20
|
+
|
|
21
|
+
const FeedlogButton = class {
|
|
22
|
+
constructor(hostRef) {
|
|
23
|
+
registerInstance(this, hostRef);
|
|
24
|
+
this.feedlogClick = createEvent(this, "feedlogClick");
|
|
25
|
+
/**
|
|
26
|
+
* Button variant style
|
|
27
|
+
*/
|
|
28
|
+
this.variant = 'default';
|
|
29
|
+
/**
|
|
30
|
+
* Button size
|
|
31
|
+
*/
|
|
32
|
+
this.size = 'default';
|
|
33
|
+
/**
|
|
34
|
+
* Disabled state
|
|
35
|
+
*/
|
|
36
|
+
this.disabled = false;
|
|
37
|
+
/**
|
|
38
|
+
* Button type
|
|
39
|
+
*/
|
|
40
|
+
this.type = 'button';
|
|
41
|
+
this.handleClick = (event) => {
|
|
42
|
+
if (!this.disabled) {
|
|
43
|
+
this.feedlogClick.emit(event);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
const sizeClass = this.size === 'default' ? 'button-size-default' : `button-size-${this.size}`;
|
|
49
|
+
return (h("button", { key: '6cdd8347def51592707b1fb9aab0dc565ca0f76f', type: this.type, class: `button button-${this.variant} ${sizeClass}`, disabled: this.disabled, onClick: this.handleClick }, h("slot", { key: '3f3845195fa4b8a551473ecf1d5702321a31763e' })));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
FeedlogButton.style = feedlogButtonCss();
|
|
53
|
+
|
|
54
|
+
const feedlogIssuesListCss = () => `:host{display:block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-background:#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}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-border:oklch(0.269 0 0);--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-blue-900-30:color-mix(in oklab, oklch(0.379 0.146 265.522) 30%, transparent);--feedlog-red-900-30:color-mix(in oklab, oklch(0.396 0.141 25.723) 30%, transparent)}.issues-list{display:flex;flex-direction:column;gap:var(--feedlog-gap)}.empty-state{text-align:center;padding:3rem 1.5rem;color:var(--feedlog-muted-foreground);font-size:0.875rem}.issue-card{background-color:var(--feedlog-card);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);transition:box-shadow 0.15s ease;position:relative}.issue-card:hover{box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)}.issue-content{padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.issue-header{display:flex;align-items:center;gap:0.5rem;justify-content:space-between}.issue-type-badge{width:fit-content}.pinned-indicator{font-size:1rem;opacity:0.7}.issue-main{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.issue-details{flex:1;min-width:0}.issue-title{color:var(--feedlog-card-foreground);font-size:0.875rem;font-weight:600;margin:0 0 0.375rem 0;line-height:1.4;word-break:break-word}.issue-body{color:var(--feedlog-muted-foreground);font-size:0.75rem;line-height:1.625;margin:0 0 0.75rem 0;word-break:break-word;white-space:pre-wrap}.issue-repository{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;color:var(--feedlog-muted-foreground);margin-bottom:0.5rem}.repo-name{font-weight:500}.github-number{color:var(--feedlog-blue-600);font-weight:600}:host(.dark) .github-number{color:var(--feedlog-blue-400)}.upvote-button{display:flex;flex-direction:column;align-items:center;gap:0.125rem;padding:0.5rem 0.75rem;border-radius:0.5rem;background-color:var(--feedlog-muted);border:1px solid transparent;cursor:pointer;transition:all 0.15s ease;flex-shrink:0;font-size:0.75rem;font-weight:600}.upvote-button:hover{background-color:var(--feedlog-blue-100);border-color:var(--feedlog-blue-400)}.upvote-button.upvoted{background-color:var(--feedlog-red-100);border-color:var(--feedlog-red-400)}.upvote-button.upvoted:hover{background-color:var(--feedlog-red-100);border-color:var(--feedlog-red-600)}:host(.dark) .upvote-button:hover{background-color:var(--feedlog-blue-900-30);border-color:var(--feedlog-blue-600)}:host(.dark) .upvote-button.upvoted{background-color:var(--feedlog-red-900-30);border-color:var(--feedlog-red-600)}.upvote-icon{width:1rem;height:1rem;stroke-width:2}.upvote-icon.filled{color:var(--feedlog-red-600)}.upvote-icon.outline{color:var(--feedlog-blue-600)}:host(.dark) .upvote-icon.outline{color:var(--feedlog-blue-400)}.upvote-count{font-size:0.75rem;font-weight:600;color:var(--feedlog-card-foreground)}.issue-footer{display:flex;flex-direction:column;gap:0.25rem;font-size:0.75rem}.issue-date{color:var(--feedlog-muted-foreground);cursor:help}`;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Heart icon SVG component (filled)
|
|
58
|
+
*/
|
|
59
|
+
const HeartFilledIcon = () => (h("svg", { class: "upvote-icon filled", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", stroke: "none" }, h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
60
|
+
/**
|
|
61
|
+
* Heart icon SVG component (outline)
|
|
62
|
+
*/
|
|
63
|
+
const HeartOutlineIcon = () => (h("svg", { class: "upvote-icon outline", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
64
|
+
const FeedlogIssuesList = class {
|
|
65
|
+
constructor(hostRef) {
|
|
66
|
+
registerInstance(this, hostRef);
|
|
67
|
+
this.feedlogUpvote = createEvent(this, "feedlogUpvote");
|
|
68
|
+
/**
|
|
69
|
+
* Array of issues to display
|
|
70
|
+
*/
|
|
71
|
+
this.issues = [];
|
|
72
|
+
/**
|
|
73
|
+
* Theme variant: 'light' or 'dark'
|
|
74
|
+
*/
|
|
75
|
+
this.theme = 'light';
|
|
76
|
+
this.handleUpvote = (event, issue) => {
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
this.feedlogUpvote.emit({
|
|
79
|
+
issueId: issue.id,
|
|
80
|
+
currentUpvoted: issue.hasUpvoted,
|
|
81
|
+
currentCount: issue.upvoteCount,
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
return (h(Host, { key: '5cef6f5476239d0f8096664c04690aa4c3383bd0', class: this.theme === 'dark' ? 'dark' : '' }, h("div", { key: 'd72fffe457f0497dbbbe0c64dab3282f76a49217', class: "issues-list" }, this.issues.length === 0 ? (h("div", { class: "empty-state" }, h("p", null, "No issues found"))) : (this.issues.map(issue => (h("div", { key: issue.id, class: "issue-card" }, h("div", { class: "issue-content" }, h("div", { class: "issue-header" }, h("div", { class: "issue-type-badge" }, issue.type === 'bug' ? (h("feedlog-badge", { variant: "destructive" }, "Bug")) : (h("feedlog-badge", { variant: "enhancement" }, "Enhancement"))), issue.pinnedAt && (h("div", { class: "pinned-indicator", title: "Pinned issue" }, "\uD83D\uDCCC"))), h("div", { class: "issue-main" }, h("div", { class: "issue-details" }, h("h3", { class: "issue-title" }, issue.title), h("p", { class: "issue-body" }, issue.body), h("div", { class: "issue-repository" }, h("span", { class: "repo-name" }, issue.repository.owner, "/", issue.repository.name))), h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: (e) => this.handleUpvote(e, issue), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, issue.hasUpvoted ? h(HeartFilledIcon, null) : h(HeartOutlineIcon, null), h("span", { class: "upvote-count" }, issue.upvoteCount))), h("div", { class: "issue-footer" }, h("span", { class: "issue-date", title: `Updated: ${issue.updatedAt}` }, "Updated ", this.formatDate(issue.updatedAt)), h("span", { class: "issue-date", title: `Created: ${issue.createdAt}` }, "Created ", this.formatDate(issue.createdAt)))))))))));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Format an ISO date string to a relative time string
|
|
90
|
+
*/
|
|
91
|
+
formatDate(dateString) {
|
|
92
|
+
try {
|
|
93
|
+
const date = new Date(dateString);
|
|
94
|
+
const now = new Date();
|
|
95
|
+
const seconds = Math.floor((now.getTime() - date.getTime()) / 1000);
|
|
96
|
+
if (seconds < 60)
|
|
97
|
+
return 'just now';
|
|
98
|
+
if (seconds < 3600)
|
|
99
|
+
return `${Math.floor(seconds / 60)}m ago`;
|
|
100
|
+
if (seconds < 86400)
|
|
101
|
+
return `${Math.floor(seconds / 3600)}h ago`;
|
|
102
|
+
if (seconds < 604800)
|
|
103
|
+
return `${Math.floor(seconds / 86400)}d ago`;
|
|
104
|
+
if (seconds < 2592000)
|
|
105
|
+
return `${Math.floor(seconds / 604800)}w ago`;
|
|
106
|
+
return date.toLocaleDateString();
|
|
107
|
+
}
|
|
108
|
+
catch (_a) {
|
|
109
|
+
return 'unknown date';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
FeedlogIssuesList.style = feedlogIssuesListCss();
|
|
114
|
+
|
|
115
|
+
export { FeedlogBadge as feedlog_badge, FeedlogButton as feedlog_button, FeedlogIssuesList as feedlog_issues_list };
|