zen-wdg 2.1.3 β 2.2.0
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/widgets/z-marked-widget.vue.d.ts +15 -0
- package/dist/widgets/z-todo-widget.vue.d.ts +11 -0
- package/dist/zen-wdg.css +1 -1
- package/dist/zen-wdg.es.js +357 -31
- package/dist/zen-wdg.umd.js +1 -1
- package/package.json +1 -1
- package/src/index.js +13 -2
- package/src/widgets/z-marked-widget.vue +310 -0
- package/src/widgets/z-search-widget.vue +0 -1
- package/src/widgets/z-todo-widget.vue +157 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
small: boolean;
|
|
3
|
+
theme: string;
|
|
4
|
+
categories: unknown[];
|
|
5
|
+
open: string;
|
|
6
|
+
useStorage: boolean;
|
|
7
|
+
$props: {
|
|
8
|
+
readonly small?: boolean | undefined;
|
|
9
|
+
readonly theme?: string | undefined;
|
|
10
|
+
readonly categories?: unknown[] | undefined;
|
|
11
|
+
readonly open?: string | undefined;
|
|
12
|
+
readonly useStorage?: boolean | undefined;
|
|
13
|
+
};
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {
|
|
2
|
+
newTask: string;
|
|
3
|
+
pendingTasks: never[];
|
|
4
|
+
completedTasks: never[];
|
|
5
|
+
}, {}, {
|
|
6
|
+
addTask(): void;
|
|
7
|
+
completeTask(index: any): void;
|
|
8
|
+
deleteTask(index: any): void;
|
|
9
|
+
deleteCompleted(index: any): void;
|
|
10
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
package/dist/zen-wdg.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.clock-container[data-v-e9445086]{display:flex;justify-content:center;align-items:center;height:100%;width:100%}.clock[data-v-e9445086]{text-align:center;font-family:Arial,sans-serif;color:#333;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:15px;padding:20px;width:100%}.time[data-v-e9445086]{font-size:4em;font-weight:700;color:#fff;display:flex;justify-content:center}.date[data-v-e9445086]{font-size:1.2em;color:#fff;margin-top:10px}@media (max-width: 500px){.time[data-v-e9445086]{font-size:3em}.date[data-v-e9445086]{font-size:1em}}input[data-v-2ad90286]{padding:.5rem 1rem;border:none}.full-width[data-v-2ad90286]{width:100%}input[data-v-2ad90286]:focus{outline:none}.round[data-v-2ad90286]{border-radius:.2rem}.rounded[data-v-2ad90286]{border-radius:10rem}button[data-v-10678914]{cursor:pointer;border:none;padding:.5rem;display:flex;align-items:center;justify-content:center;gap:.5rem;transition:.5s ease-in-out background}.w-full[data-v-10678914]{width:100%}.bound[data-v-10678914]{border-radius:.2rem}.bounded[data-v-10678914]{border-radius:50%}.flat[data-v-10678914]{padding:0;line-height:0;background-color:transparent}.search[data-v-
|
|
1
|
+
.clock-container[data-v-e9445086]{display:flex;justify-content:center;align-items:center;height:100%;width:100%}.clock[data-v-e9445086]{text-align:center;font-family:Arial,sans-serif;color:#333;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:15px;padding:20px;width:100%}.time[data-v-e9445086]{font-size:4em;font-weight:700;color:#fff;display:flex;justify-content:center}.date[data-v-e9445086]{font-size:1.2em;color:#fff;margin-top:10px}@media (max-width: 500px){.time[data-v-e9445086]{font-size:3em}.date[data-v-e9445086]{font-size:1em}}input[data-v-2ad90286]{padding:.5rem 1rem;border:none}.full-width[data-v-2ad90286]{width:100%}input[data-v-2ad90286]:focus{outline:none}.round[data-v-2ad90286]{border-radius:.2rem}.rounded[data-v-2ad90286]{border-radius:10rem}button[data-v-10678914]{cursor:pointer;border:none;padding:.5rem;display:flex;align-items:center;justify-content:center;gap:.5rem;transition:.5s ease-in-out background}.w-full[data-v-10678914]{width:100%}.bound[data-v-10678914]{border-radius:.2rem}.bounded[data-v-10678914]{border-radius:50%}.flat[data-v-10678914]{padding:0;line-height:0;background-color:transparent}.search[data-v-50392e2c]{background-color:var(--bg-color);display:flex;align-items:center;padding:.2rem 1rem;border-radius:5rem;border:.01rem solid var(--orange);box-shadow:0 0 .4rem var(--border-color)}.search img[data-v-50392e2c]{width:20px}.todo-widget[data-v-edabf7fa]{width:100%;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:16px;padding:20px;color:#fff;box-shadow:0 4px 10px #0000004d;max-width:500px;margin:0 auto}.title[data-v-edabf7fa]{margin-bottom:16px;text-align:center}.todo-form[data-v-edabf7fa]{display:flex;gap:10px;margin-bottom:20px}.todo-form input[data-v-edabf7fa]{flex:1;padding:10px 12px;border:none;border-radius:8px;background-color:#2a2a2a;color:#fff}.todo-form button[data-v-edabf7fa]{background-color:#007bff;color:#fff;border:none;border-radius:8px;padding:10px 16px;cursor:pointer}.task-section[data-v-edabf7fa]{margin-bottom:20px}.task-section h3[data-v-edabf7fa]{margin-bottom:8px;font-size:1rem;color:#ccc}.task-section ul[data-v-edabf7fa]{list-style:none;padding:0}.task-section li[data-v-edabf7fa]{background-color:#292929;padding:10px 12px;border-radius:10px;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.actions button[data-v-edabf7fa]{margin-left:8px;background:none;border:none;color:#bbb;cursor:pointer;font-size:1rem}.actions button[data-v-edabf7fa]:hover{color:#fff}.empty[data-v-edabf7fa]{font-size:.9rem;color:#666}.done[data-v-edabf7fa]{text-decoration:line-through;color:#777}.tabs[data-v-5fb970f5]{width:auto;display:flex;gap:10px;margin-bottom:20px;flex-wrap:wrap;background:#dcdcdc66;padding:.2rem;border-radius:.6rem;align-self:start}.container-tab[data-v-5fb970f5]{position:relative}.tab[data-v-5fb970f5]{padding:8px 2rem;border:none;cursor:pointer;transition:.3s;font-weight:600;background-color:transparent;color:#444}.tab.active[data-v-5fb970f5]{background-color:#066d5a;color:#fff;border-radius:.5rem}.grid[data-v-5fb970f5]{display:flex;flex-wrap:wrap;gap:1.4rem}.card[data-v-5fb970f5]{position:relative;flex:1 1 100px}.card.small[data-v-5fb970f5]{flex:1 1 25%;min-width:140px;max-width:170px}.card-link[data-v-5fb970f5]{height:106px;padding:16px;border-radius:1rem;box-shadow:0 2px 4px #0000004d;background-color:#c8c8c84d;backdrop-filter:blur(.2rem);text-align:center;cursor:pointer;text-decoration:none;color:#202020;display:flex;justify-content:center;flex-direction:column}.option-app[data-v-5fb970f5]{display:none;position:absolute;top:10px;right:10px;z-index:2;gap:.4rem}.card:hover .option-app[data-v-5fb970f5]{display:flex;justify-content:center;align-items:center}.delete-app[data-v-5fb970f5],.edit-app[data-v-5fb970f5]{cursor:pointer;border-radius:.2rem;width:23px;height:23px;border:none;font-size:.8rem}.edit-app[data-v-5fb970f5]{font-size:1rem}.card-link img[data-v-5fb970f5]{width:100%;max-width:40px;border-radius:.4rem;margin-bottom:8px}.card-link img.small[data-v-5fb970f5]{max-width:50px}.column[data-v-5fb970f5]{display:flex;flex-direction:column;align-items:center;gap:5px}.add[data-v-5fb970f5]{width:50px;height:50px;background:gray;border-radius:.5rem;display:flex;justify-content:center;font-size:2rem;line-height:50px;color:#fff;user-select:none}
|
package/dist/zen-wdg.es.js
CHANGED
|
@@ -17,7 +17,27 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
|
|
20
|
+
var __async = (__this, __arguments, generator) => {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
var fulfilled = (value) => {
|
|
23
|
+
try {
|
|
24
|
+
step(generator.next(value));
|
|
25
|
+
} catch (e) {
|
|
26
|
+
reject(e);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var rejected = (value) => {
|
|
30
|
+
try {
|
|
31
|
+
step(generator.throw(value));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
reject(e);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
import { createElementBlock, openBlock, createElementVNode, createTextVNode, toDisplayString, normalizeClass, withKeys, defineComponent, ref, shallowRef, onMounted, watch, onUnmounted, h, nextTick, resolveComponent, normalizeStyle, createBlock, createCommentVNode, createVNode, withModifiers, withDirectives, vModelText, Fragment, renderList, reactive, unref, defineCustomElement } from "vue";
|
|
21
41
|
const _export_sfc = (sfc, props) => {
|
|
22
42
|
const target = sfc.__vccOpts || sfc;
|
|
23
43
|
for (const [key, val] of props) {
|
|
@@ -25,7 +45,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
25
45
|
}
|
|
26
46
|
return target;
|
|
27
47
|
};
|
|
28
|
-
const _sfc_main$
|
|
48
|
+
const _sfc_main$5 = {
|
|
29
49
|
name: "ZClockWidget",
|
|
30
50
|
data() {
|
|
31
51
|
return {
|
|
@@ -76,26 +96,26 @@ const _sfc_main$3 = {
|
|
|
76
96
|
}
|
|
77
97
|
}
|
|
78
98
|
};
|
|
79
|
-
const _hoisted_1$
|
|
80
|
-
const _hoisted_2$
|
|
81
|
-
const _hoisted_3 = { class: "time" };
|
|
82
|
-
const _hoisted_4 = { class: "date" };
|
|
83
|
-
function _sfc_render$
|
|
84
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
85
|
-
createElementVNode("div", _hoisted_2$
|
|
86
|
-
createElementVNode("div", _hoisted_3, [
|
|
99
|
+
const _hoisted_1$4 = { class: "clock-container" };
|
|
100
|
+
const _hoisted_2$3 = { class: "clock" };
|
|
101
|
+
const _hoisted_3$2 = { class: "time" };
|
|
102
|
+
const _hoisted_4$2 = { class: "date" };
|
|
103
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
104
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
105
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
106
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
87
107
|
createElementVNode("span", null, toDisplayString($data.hours), 1),
|
|
88
108
|
_cache[0] || (_cache[0] = createTextVNode(":", -1)),
|
|
89
109
|
createElementVNode("span", null, toDisplayString($data.minutes), 1)
|
|
90
110
|
]),
|
|
91
|
-
createElementVNode("div", _hoisted_4, [
|
|
111
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
92
112
|
createElementVNode("span", null, toDisplayString($data.dayOfWeek) + ", " + toDisplayString($data.day) + " " + toDisplayString($data.month) + " " + toDisplayString($data.year), 1)
|
|
93
113
|
])
|
|
94
114
|
])
|
|
95
115
|
]);
|
|
96
116
|
}
|
|
97
|
-
const ZClockWidget = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
98
|
-
const _sfc_main$
|
|
117
|
+
const ZClockWidget = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-e9445086"]]);
|
|
118
|
+
const _sfc_main$4 = {
|
|
99
119
|
data() {
|
|
100
120
|
return {};
|
|
101
121
|
},
|
|
@@ -126,8 +146,8 @@ const _sfc_main$2 = {
|
|
|
126
146
|
}
|
|
127
147
|
}
|
|
128
148
|
};
|
|
129
|
-
const _hoisted_1$
|
|
130
|
-
function _sfc_render$
|
|
149
|
+
const _hoisted_1$3 = ["placeholder", "value"];
|
|
150
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
131
151
|
return openBlock(), createElementBlock("input", {
|
|
132
152
|
placeholder: $props.placeholder,
|
|
133
153
|
value: $props.modelValue,
|
|
@@ -138,9 +158,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
138
158
|
{ "round": $props.round },
|
|
139
159
|
{ "rounded": $props.rounded }
|
|
140
160
|
])
|
|
141
|
-
}, null, 42, _hoisted_1$
|
|
161
|
+
}, null, 42, _hoisted_1$3);
|
|
142
162
|
}
|
|
143
|
-
const Input = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
163
|
+
const Input = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-2ad90286"]]);
|
|
144
164
|
const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
145
165
|
const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
146
166
|
const colonSeparated = value.split(":");
|
|
@@ -874,11 +894,11 @@ function sortIcons(icons) {
|
|
|
874
894
|
const prefix = icon.prefix;
|
|
875
895
|
const name = icon.name;
|
|
876
896
|
const providerStorage = storage2[provider] || (storage2[provider] = /* @__PURE__ */ Object.create(null));
|
|
877
|
-
const
|
|
897
|
+
const localStorage2 = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
|
|
878
898
|
let list;
|
|
879
|
-
if (name in
|
|
899
|
+
if (name in localStorage2.icons) {
|
|
880
900
|
list = result.loaded;
|
|
881
|
-
} else if (prefix === "" ||
|
|
901
|
+
} else if (prefix === "" || localStorage2.missing.has(name)) {
|
|
882
902
|
list = result.missing;
|
|
883
903
|
} else {
|
|
884
904
|
list = result.pending;
|
|
@@ -1788,7 +1808,7 @@ const Icon = defineComponent((props, { emit }) => {
|
|
|
1788
1808
|
],
|
|
1789
1809
|
emits: ["load"]
|
|
1790
1810
|
});
|
|
1791
|
-
const _sfc_main$
|
|
1811
|
+
const _sfc_main$3 = {
|
|
1792
1812
|
data() {
|
|
1793
1813
|
return {};
|
|
1794
1814
|
},
|
|
@@ -1842,7 +1862,7 @@ const _sfc_main$1 = {
|
|
|
1842
1862
|
},
|
|
1843
1863
|
methods: {}
|
|
1844
1864
|
};
|
|
1845
|
-
function _sfc_render$
|
|
1865
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1846
1866
|
const _component_Icon = resolveComponent("Icon");
|
|
1847
1867
|
return openBlock(), createElementBlock("button", {
|
|
1848
1868
|
class: normalizeClass(
|
|
@@ -1873,8 +1893,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1873
1893
|
}, null, 8, ["icon", "width", "height"])) : createCommentVNode("", true)
|
|
1874
1894
|
], 6);
|
|
1875
1895
|
}
|
|
1876
|
-
const Button = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1877
|
-
const _sfc_main = {
|
|
1896
|
+
const Button = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-10678914"]]);
|
|
1897
|
+
const _sfc_main$2 = {
|
|
1878
1898
|
name: "ZSearchWidget",
|
|
1879
1899
|
data() {
|
|
1880
1900
|
return {
|
|
@@ -1908,16 +1928,16 @@ const _sfc_main = {
|
|
|
1908
1928
|
}
|
|
1909
1929
|
}
|
|
1910
1930
|
};
|
|
1911
|
-
const _hoisted_1 = { class: "search" };
|
|
1912
|
-
const _hoisted_2 = ["src"];
|
|
1913
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1931
|
+
const _hoisted_1$2 = { class: "search" };
|
|
1932
|
+
const _hoisted_2$2 = ["src"];
|
|
1933
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1914
1934
|
const _component_Input = resolveComponent("Input");
|
|
1915
1935
|
const _component_Button = resolveComponent("Button");
|
|
1916
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1936
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
1917
1937
|
$props.logo ? (openBlock(), createElementBlock("img", {
|
|
1918
1938
|
key: 0,
|
|
1919
1939
|
src: $props.logo
|
|
1920
|
-
}, null, 8, _hoisted_2)) : createCommentVNode("", true),
|
|
1940
|
+
}, null, 8, _hoisted_2$2)) : createCommentVNode("", true),
|
|
1921
1941
|
createVNode(_component_Input, {
|
|
1922
1942
|
placeholder: "Search something",
|
|
1923
1943
|
full: "",
|
|
@@ -1935,15 +1955,321 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1935
1955
|
})
|
|
1936
1956
|
]);
|
|
1937
1957
|
}
|
|
1938
|
-
const ZSearchWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
1958
|
+
const ZSearchWidget = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-50392e2c"]]);
|
|
1959
|
+
const _sfc_main$1 = {
|
|
1960
|
+
name: "TodoWidget",
|
|
1961
|
+
data() {
|
|
1962
|
+
return {
|
|
1963
|
+
newTask: "",
|
|
1964
|
+
pendingTasks: [],
|
|
1965
|
+
completedTasks: []
|
|
1966
|
+
};
|
|
1967
|
+
},
|
|
1968
|
+
methods: {
|
|
1969
|
+
addTask() {
|
|
1970
|
+
if (this.newTask.trim()) {
|
|
1971
|
+
this.pendingTasks.push({ text: this.newTask.trim() });
|
|
1972
|
+
this.newTask = "";
|
|
1973
|
+
}
|
|
1974
|
+
},
|
|
1975
|
+
completeTask(index) {
|
|
1976
|
+
const task = this.pendingTasks.splice(index, 1)[0];
|
|
1977
|
+
this.completedTasks.push(task);
|
|
1978
|
+
},
|
|
1979
|
+
deleteTask(index) {
|
|
1980
|
+
this.pendingTasks.splice(index, 1);
|
|
1981
|
+
},
|
|
1982
|
+
deleteCompleted(index) {
|
|
1983
|
+
this.completedTasks.splice(index, 1);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
};
|
|
1987
|
+
const _hoisted_1$1 = { class: "todo-widget" };
|
|
1988
|
+
const _hoisted_2$1 = { class: "task-section" };
|
|
1989
|
+
const _hoisted_3$1 = {
|
|
1990
|
+
key: 0,
|
|
1991
|
+
class: "empty"
|
|
1992
|
+
};
|
|
1993
|
+
const _hoisted_4$1 = { class: "actions" };
|
|
1994
|
+
const _hoisted_5$1 = ["onClick"];
|
|
1995
|
+
const _hoisted_6$1 = ["onClick"];
|
|
1996
|
+
const _hoisted_7$1 = { class: "task-section completed" };
|
|
1997
|
+
const _hoisted_8$1 = {
|
|
1998
|
+
key: 0,
|
|
1999
|
+
class: "empty"
|
|
2000
|
+
};
|
|
2001
|
+
const _hoisted_9$1 = { class: "done" };
|
|
2002
|
+
const _hoisted_10 = ["onClick"];
|
|
2003
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2004
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
2005
|
+
_cache[5] || (_cache[5] = createElementVNode("h2", { class: "title" }, "π Mis Tareas", -1)),
|
|
2006
|
+
createElementVNode("form", {
|
|
2007
|
+
onSubmit: _cache[1] || (_cache[1] = withModifiers((...args) => $options.addTask && $options.addTask(...args), ["prevent"])),
|
|
2008
|
+
class: "todo-form"
|
|
2009
|
+
}, [
|
|
2010
|
+
withDirectives(createElementVNode("input", {
|
|
2011
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.newTask = $event),
|
|
2012
|
+
type: "text",
|
|
2013
|
+
placeholder: "Escribe una nueva tarea..."
|
|
2014
|
+
}, null, 512), [
|
|
2015
|
+
[vModelText, $data.newTask]
|
|
2016
|
+
]),
|
|
2017
|
+
_cache[2] || (_cache[2] = createElementVNode("button", { type: "submit" }, "Agregar", -1))
|
|
2018
|
+
], 32),
|
|
2019
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
2020
|
+
_cache[3] || (_cache[3] = createElementVNode("h3", null, "Tareas Pendientes", -1)),
|
|
2021
|
+
$data.pendingTasks.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_3$1, "Sin tareas.")) : createCommentVNode("", true),
|
|
2022
|
+
createElementVNode("ul", null, [
|
|
2023
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($data.pendingTasks, (task, index) => {
|
|
2024
|
+
return openBlock(), createElementBlock("li", { key: index }, [
|
|
2025
|
+
createElementVNode("span", null, toDisplayString(task.text), 1),
|
|
2026
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
2027
|
+
createElementVNode("button", {
|
|
2028
|
+
onClick: ($event) => $options.completeTask(index)
|
|
2029
|
+
}, "βοΈ", 8, _hoisted_5$1),
|
|
2030
|
+
createElementVNode("button", {
|
|
2031
|
+
onClick: ($event) => $options.deleteTask(index)
|
|
2032
|
+
}, "ποΈ", 8, _hoisted_6$1)
|
|
2033
|
+
])
|
|
2034
|
+
]);
|
|
2035
|
+
}), 128))
|
|
2036
|
+
])
|
|
2037
|
+
]),
|
|
2038
|
+
createElementVNode("div", _hoisted_7$1, [
|
|
2039
|
+
_cache[4] || (_cache[4] = createElementVNode("h3", null, "Completadas", -1)),
|
|
2040
|
+
$data.completedTasks.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_8$1, "Ninguna aΓΊn.")) : createCommentVNode("", true),
|
|
2041
|
+
createElementVNode("ul", null, [
|
|
2042
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($data.completedTasks, (task, index) => {
|
|
2043
|
+
return openBlock(), createElementBlock("li", {
|
|
2044
|
+
key: "c" + index
|
|
2045
|
+
}, [
|
|
2046
|
+
createElementVNode("span", _hoisted_9$1, toDisplayString(task.text), 1),
|
|
2047
|
+
createElementVNode("button", {
|
|
2048
|
+
onClick: ($event) => $options.deleteCompleted(index)
|
|
2049
|
+
}, "β", 8, _hoisted_10)
|
|
2050
|
+
]);
|
|
2051
|
+
}), 128))
|
|
2052
|
+
])
|
|
2053
|
+
])
|
|
2054
|
+
]);
|
|
2055
|
+
}
|
|
2056
|
+
const ZTodoWidget = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-edabf7fa"]]);
|
|
2057
|
+
const _hoisted_1 = { class: "tabs" };
|
|
2058
|
+
const _hoisted_2 = ["onClick"];
|
|
2059
|
+
const _hoisted_3 = { class: "grid" };
|
|
2060
|
+
const _hoisted_4 = { class: "option-app" };
|
|
2061
|
+
const _hoisted_5 = ["onClick"];
|
|
2062
|
+
const _hoisted_6 = ["onClick"];
|
|
2063
|
+
const _hoisted_7 = ["onClick"];
|
|
2064
|
+
const _hoisted_8 = { class: "column" };
|
|
2065
|
+
const _hoisted_9 = ["src", "alt", "onError"];
|
|
2066
|
+
const STORAGE_KEY = "bookmark_manager_state";
|
|
2067
|
+
const _sfc_main = {
|
|
2068
|
+
__name: "z-marked-widget",
|
|
2069
|
+
props: {
|
|
2070
|
+
theme: { type: String, default: "light" },
|
|
2071
|
+
small: { type: Boolean, default: false },
|
|
2072
|
+
categories: { type: Array, default: () => ["Personal", "Work", "Study"] },
|
|
2073
|
+
open: { type: String, default: "self" },
|
|
2074
|
+
useStorage: { type: Boolean, default: false }
|
|
2075
|
+
},
|
|
2076
|
+
setup(__props) {
|
|
2077
|
+
const props = __props;
|
|
2078
|
+
const defaultBookmarks = {
|
|
2079
|
+
Personal: [
|
|
2080
|
+
{ title: "Reddit", url: "https://reddit.com", logo: "https://www.google.com/s2/favicons?domain=reddit.com&sz=64" },
|
|
2081
|
+
{ title: "Spotify", url: "https://spotify.com", logo: "https://www.google.com/s2/favicons?domain=spotify.com&sz=64" },
|
|
2082
|
+
{ title: "Youtube", url: "https://youtube.com", logo: "https://www.google.com/s2/favicons?domain=youtube.com&sz=64" },
|
|
2083
|
+
{ title: "Instagram", url: "https://instagram.com", logo: "https://www.google.com/s2/favicons?domain=instagram.com&sz=64" },
|
|
2084
|
+
{ title: "Facebook", url: "https://facebook.com", logo: "https://www.google.com/s2/favicons?domain=facebook.com&sz=64" },
|
|
2085
|
+
{ title: "WhatsApp", url: "https://whatsapp.com", logo: "https://www.google.com/s2/favicons?domain=whatsapp.com&sz=64" },
|
|
2086
|
+
{ title: "Telegram", url: "https://web.telegram.org/", logo: "https://www.google.com/s2/favicons?domain=web.telegram.org&sz=64" },
|
|
2087
|
+
{ title: "Spotify", url: "https://spotify.com", logo: "https://www.google.com/s2/favicons?domain=spotify.com&sz=64" }
|
|
2088
|
+
],
|
|
2089
|
+
Work: [
|
|
2090
|
+
{ title: "GitHub", url: "https://github.com", logo: "https://www.google.com/s2/favicons?domain=github.com&sz=64" },
|
|
2091
|
+
{ title: "Notion", url: "https://notion.so", logo: "https://www.google.com/s2/favicons?domain=notion.so&sz=64" }
|
|
2092
|
+
],
|
|
2093
|
+
Study: [
|
|
2094
|
+
{ title: "MDN Web Docs", url: "https://developer.mozilla.org", logo: "https://www.google.com/s2/favicons?domain=mozilla.org&sz=64" },
|
|
2095
|
+
{ title: "FreeCodeCamp", url: "https://freecodecamp.org", logo: "https://www.google.com/s2/favicons?domain=freecodecamp.org&sz=64" }
|
|
2096
|
+
]
|
|
2097
|
+
};
|
|
2098
|
+
const state = reactive({
|
|
2099
|
+
bookmarks: props.useStorage ? JSON.parse(localStorage.getItem(STORAGE_KEY)) || defaultBookmarks : defaultBookmarks,
|
|
2100
|
+
activeTab: "Personal"
|
|
2101
|
+
});
|
|
2102
|
+
const categories = ref([...props.categories]);
|
|
2103
|
+
const small = ref(props.small);
|
|
2104
|
+
const theme = ref(props.theme);
|
|
2105
|
+
const open = ref(props.open);
|
|
2106
|
+
const useStorage = ref(props.useStorage);
|
|
2107
|
+
const currentBookmarks = computed(() => state.bookmarks[state.activeTab] || []);
|
|
2108
|
+
function saveState() {
|
|
2109
|
+
if (useStorage.value) {
|
|
2110
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(state.bookmarks));
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
function setActiveTab(tab) {
|
|
2114
|
+
state.activeTab = tab;
|
|
2115
|
+
}
|
|
2116
|
+
function openLink(url) {
|
|
2117
|
+
if (open.value === "self") {
|
|
2118
|
+
window.location.href = url;
|
|
2119
|
+
} else {
|
|
2120
|
+
window.open(url, "_blank");
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
function deleteBookmark(index) {
|
|
2124
|
+
return __async(this, null, function* () {
|
|
2125
|
+
if (confirm(`ΒΏEstΓ‘s seguro de eliminar ${state.bookmarks[state.activeTab][index].title}?`)) {
|
|
2126
|
+
state.bookmarks[state.activeTab].splice(index, 1);
|
|
2127
|
+
saveState();
|
|
2128
|
+
}
|
|
2129
|
+
});
|
|
2130
|
+
}
|
|
2131
|
+
function editBookmark(index) {
|
|
2132
|
+
return __async(this, null, function* () {
|
|
2133
|
+
const item = state.bookmarks[state.activeTab][index];
|
|
2134
|
+
const newTitle = prompt("Nuevo tΓtulo:", item.title);
|
|
2135
|
+
if (newTitle === null) return;
|
|
2136
|
+
const newUrl = prompt("Nueva URL:", item.url);
|
|
2137
|
+
if (newUrl === null) return;
|
|
2138
|
+
item.title = newTitle;
|
|
2139
|
+
item.url = newUrl;
|
|
2140
|
+
item.logo = `https://www.google.com/s2/favicons?domain=${new URL(newUrl).hostname}&sz=64`;
|
|
2141
|
+
saveState();
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
function addBookmarkPrompt() {
|
|
2145
|
+
const title = prompt("Nombre del marcador:");
|
|
2146
|
+
if (!title) return;
|
|
2147
|
+
const url = prompt("URL del marcador:");
|
|
2148
|
+
if (!url) return;
|
|
2149
|
+
const logo = `https://www.google.com/s2/favicons?domain=${new URL(url).hostname}&sz=64`;
|
|
2150
|
+
if (!state.bookmarks[state.activeTab]) {
|
|
2151
|
+
state.bookmarks[state.activeTab] = [];
|
|
2152
|
+
}
|
|
2153
|
+
state.bookmarks[state.activeTab].push({ title, url, logo });
|
|
2154
|
+
saveState();
|
|
2155
|
+
}
|
|
2156
|
+
function onImageError(event, title) {
|
|
2157
|
+
const img = event.target;
|
|
2158
|
+
img.style.display = "none";
|
|
2159
|
+
const iconContainer = img.parentNode;
|
|
2160
|
+
iconContainer.style.backgroundColor = "#066D5A";
|
|
2161
|
+
iconContainer.textContent = title.charAt(0).toUpperCase();
|
|
2162
|
+
}
|
|
2163
|
+
const iconContainerStyle = computed(() => ({
|
|
2164
|
+
position: "relative",
|
|
2165
|
+
width: small.value ? "50px" : "40px",
|
|
2166
|
+
height: small.value ? "50px" : "40px",
|
|
2167
|
+
marginBottom: "8px",
|
|
2168
|
+
borderRadius: ".4rem",
|
|
2169
|
+
display: "flex",
|
|
2170
|
+
alignItems: "center",
|
|
2171
|
+
justifyContent: "center",
|
|
2172
|
+
fontWeight: "bold",
|
|
2173
|
+
fontSize: "1.8rem",
|
|
2174
|
+
color: theme.value === "light" ? "#555" : "#eee",
|
|
2175
|
+
userSelect: "none"
|
|
2176
|
+
}));
|
|
2177
|
+
watch(() => state.bookmarks, () => saveState(), { deep: true });
|
|
2178
|
+
return (_ctx, _cache) => {
|
|
2179
|
+
return openBlock(), createElementBlock("div", null, [
|
|
2180
|
+
createElementVNode("div", _hoisted_1, [
|
|
2181
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(categories.value, (tab) => {
|
|
2182
|
+
return openBlock(), createElementBlock("div", {
|
|
2183
|
+
key: tab,
|
|
2184
|
+
class: "container-tab"
|
|
2185
|
+
}, [
|
|
2186
|
+
createElementVNode("button", {
|
|
2187
|
+
class: normalizeClass(["tab", { active: tab === state.activeTab }]),
|
|
2188
|
+
onClick: ($event) => setActiveTab(tab)
|
|
2189
|
+
}, toDisplayString(tab), 11, _hoisted_2)
|
|
2190
|
+
]);
|
|
2191
|
+
}), 128))
|
|
2192
|
+
]),
|
|
2193
|
+
createElementVNode("div", _hoisted_3, [
|
|
2194
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(currentBookmarks), (item, index) => {
|
|
2195
|
+
return openBlock(), createElementBlock("div", {
|
|
2196
|
+
key: index,
|
|
2197
|
+
class: normalizeClass(["card", small.value ? "small" : ""])
|
|
2198
|
+
}, [
|
|
2199
|
+
createElementVNode("div", _hoisted_4, [
|
|
2200
|
+
createElementVNode("button", {
|
|
2201
|
+
class: "edit-app",
|
|
2202
|
+
onClick: withModifiers(($event) => editBookmark(index), ["prevent"])
|
|
2203
|
+
}, "βοΈ", 8, _hoisted_5),
|
|
2204
|
+
createElementVNode("button", {
|
|
2205
|
+
class: "delete-app",
|
|
2206
|
+
onClick: withModifiers(($event) => deleteBookmark(index), ["prevent"])
|
|
2207
|
+
}, "ποΈ", 8, _hoisted_6)
|
|
2208
|
+
]),
|
|
2209
|
+
createElementVNode("a", {
|
|
2210
|
+
href: "#",
|
|
2211
|
+
class: "card-link",
|
|
2212
|
+
onClick: withModifiers(($event) => openLink(item.url), ["prevent"])
|
|
2213
|
+
}, [
|
|
2214
|
+
createElementVNode("div", _hoisted_8, [
|
|
2215
|
+
createElementVNode("div", {
|
|
2216
|
+
class: "icon-container",
|
|
2217
|
+
style: normalizeStyle(unref(iconContainerStyle)),
|
|
2218
|
+
ref_for: true,
|
|
2219
|
+
ref: "iconContainers"
|
|
2220
|
+
}, [
|
|
2221
|
+
createElementVNode("img", {
|
|
2222
|
+
src: item.logo,
|
|
2223
|
+
alt: item.title + " logo",
|
|
2224
|
+
class: normalizeClass({ small: small.value }),
|
|
2225
|
+
onError: ($event) => onImageError($event, item.title)
|
|
2226
|
+
}, null, 42, _hoisted_9)
|
|
2227
|
+
], 4),
|
|
2228
|
+
createTextVNode(" " + toDisplayString(item.title), 1)
|
|
2229
|
+
])
|
|
2230
|
+
], 8, _hoisted_7)
|
|
2231
|
+
], 2);
|
|
2232
|
+
}), 128)),
|
|
2233
|
+
unref(currentBookmarks).length < 8 ? (openBlock(), createElementBlock("div", {
|
|
2234
|
+
key: 0,
|
|
2235
|
+
class: normalizeClass(["card", small.value ? "small" : ""])
|
|
2236
|
+
}, [
|
|
2237
|
+
createElementVNode("a", {
|
|
2238
|
+
href: "#",
|
|
2239
|
+
class: "card-link",
|
|
2240
|
+
onClick: withModifiers(addBookmarkPrompt, ["prevent"])
|
|
2241
|
+
}, _cache[0] || (_cache[0] = [
|
|
2242
|
+
createElementVNode("div", { class: "column" }, [
|
|
2243
|
+
createElementVNode("span", { class: "add" }, "+"),
|
|
2244
|
+
createTextVNode(" Add ")
|
|
2245
|
+
], -1)
|
|
2246
|
+
]))
|
|
2247
|
+
], 2)) : createCommentVNode("", true)
|
|
2248
|
+
])
|
|
2249
|
+
]);
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
const ZMarkedWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5fb970f5"]]);
|
|
1939
2254
|
const ZClockElement = defineCustomElement(ZClockWidget);
|
|
1940
2255
|
const ZSearchElement = defineCustomElement(ZSearchWidget);
|
|
2256
|
+
const ZTodoElement = defineCustomElement(ZTodoWidget);
|
|
2257
|
+
const ZMarkedElement = defineCustomElement(ZMarkedWidget);
|
|
1941
2258
|
if (!customElements.get("z-clock-widget")) {
|
|
1942
2259
|
customElements.define("z-clock-widget", ZClockElement);
|
|
1943
2260
|
}
|
|
1944
2261
|
if (!customElements.get("z-search-widget")) {
|
|
1945
2262
|
customElements.define("z-search-widget", ZSearchElement);
|
|
1946
2263
|
}
|
|
2264
|
+
if (!customElements.get("z-todo-widget")) {
|
|
2265
|
+
customElements.define("z-todo-widget", ZTodoElement);
|
|
2266
|
+
}
|
|
2267
|
+
if (!customElements.get("z-marked-widget")) {
|
|
2268
|
+
customElements.define("z-search-widget", ZMarkedElement);
|
|
2269
|
+
}
|
|
1947
2270
|
export {
|
|
1948
|
-
ZClockWidget
|
|
2271
|
+
ZClockWidget,
|
|
2272
|
+
ZMarkedWidget,
|
|
2273
|
+
ZSearchWidget,
|
|
2274
|
+
ZTodoWidget
|
|
1949
2275
|
};
|
package/dist/zen-wdg.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZenWdg={},e.Vue)}(this,function(e,t){"use strict";var n=Object.defineProperty,o=Object.defineProperties,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,l=(e,t,o)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,a=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&l(e,n,t[n]);if(i)for(var n of i(t))s.call(t,n)&&l(e,n,t[n]);return e},u=(e,t)=>o(e,r(t));const f=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},d={class:"clock-container"},p={class:"clock"},h={class:"time"},g={class:"date"};const m=f({name:"ZClockWidget",data:()=>({hours:"00",minutes:"00",seconds:"00",dayOfWeek:"",day:"",month:"",year:""}),mounted(){this.updateClock(),setInterval(this.updateClock,1e3)},methods:{updateClock(){const e=new Date;this.hours=e.getHours().toString().padStart(2,"0"),this.minutes=e.getMinutes().toString().padStart(2,"0"),this.seconds=e.getSeconds().toString().padStart(2,"0"),this.dayOfWeek=this.getDayOfWeek(e.getDay()),this.day=e.getDate(),this.month=this.getMonthName(e.getMonth()),this.year=e.getFullYear()},getDayOfWeek:e=>["Domingo","Lunes","Martes","MiΓ©rcoles","Jueves","Viernes","SΓ‘bado"][e],getMonthName:e=>["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][e]}},[["render",function(e,n,o,r,i,c){return t.openBlock(),t.createElementBlock("div",d,[t.createElementVNode("div",p,[t.createElementVNode("div",h,[t.createElementVNode("span",null,t.toDisplayString(i.hours),1),n[0]||(n[0]=t.createTextVNode(":",-1)),t.createElementVNode("span",null,t.toDisplayString(i.minutes),1)]),t.createElementVNode("div",g,[t.createElementVNode("span",null,t.toDisplayString(i.dayOfWeek)+", "+t.toDisplayString(i.day)+" "+t.toDisplayString(i.month)+" "+t.toDisplayString(i.year),1)])])])}],["__scopeId","data-v-e9445086"]]),y={data:()=>({}),props:{placeholder:String,modelValue:{type:String,default:""},round:{type:Boolean,default:!1},full:{type:Boolean},rounded:{type:Boolean,default:!1}},methods:{onInput(e){this.$emit("update:modelValue",e.target.value)},onEnter(){this.$emit("enter-pressed",this.modelValue)}}},b=["placeholder","value"];const v=f(y,[["render",function(e,n,o,r,i,c){return t.openBlock(),t.createElementBlock("input",{placeholder:o.placeholder,value:o.modelValue,onInput:n[0]||(n[0]=(...e)=>c.onInput&&c.onInput(...e)),onKeydown:n[1]||(n[1]=t.withKeys((...e)=>c.onEnter&&c.onEnter(...e),["enter"])),class:t.normalizeClass([{"full-width":o.full},{round:o.round},{rounded:o.rounded}])},null,42,b)}],["__scopeId","data-v-2ad90286"]]),x=/^[a-z0-9]+(-[a-z0-9]+)*$/,k=(e,t,n,o="")=>{const r=e.split(":");if("@"===e.slice(0,1)){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const e=r.pop(),n=r.pop(),i={provider:r.length>0?r[0]:o,prefix:n,name:e};return t&&!w(i)?null:i}const i=r[0],c=i.split("-");if(c.length>1){const e={provider:o,prefix:c.shift(),name:c.join("-")};return t&&!w(e)?null:e}if(n&&""===o){const e={provider:o,prefix:"",name:i};return t&&!w(e,n)?null:e}return null},w=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name),S=Object.freeze({left:0,top:0,width:16,height:16}),j=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),E=Object.freeze(a(a({},S),j)),O=Object.freeze(u(a({},E),{body:"",hidden:!1}));function C(e,t){const n=function(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const o=((e.rotate||0)+(t.rotate||0))%4;return o&&(n.rotate=o),n}(e,t);for(const o in O)o in j?o in e&&!(o in n)&&(n[o]=j[o]):o in t?n[o]=t[o]:o in e&&(n[o]=e[o]);return n}function F(e,t,n){const o=e.icons,r=e.aliases||Object.create(null);let i={};function c(e){i=C(o[e]||r[e],i)}return c(t),n.forEach(c),C(e,i)}function I(e,t){const n=[];if("object"!=typeof e||"object"!=typeof e.icons)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});const o=function(e){const t=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);return Object.keys(t).concat(Object.keys(n)).forEach(function e(r){if(t[r])return o[r]=[];if(!(r in o)){o[r]=null;const t=n[r]&&n[r].parent,i=t&&e(t);i&&(o[r]=[t].concat(i))}return o[r]}),o}(e);for(const r in o){const i=o[r];i&&(t(r,F(e,r,i)),n.push(r))}return n}const T=a({provider:"",aliases:{},not_found:{}},S);function z(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function B(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!z(e,T))return null;const n=t.icons;for(const r in n){const e=n[r];if(!r||"string"!=typeof e.body||!z(e,O))return null}const o=t.aliases||Object.create(null);for(const r in o){const e=o[r],t=e.parent;if(!r||"string"!=typeof t||!n[t]&&!o[t]||!z(e,O))return null}return t}const M=Object.create(null);function V(e,t){const n=M[e]||(M[e]=Object.create(null));return n[t]||(n[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function N(e,t){return B(t)?I(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}let L=!1;function D(e){return"boolean"==typeof e&&(L=e),L}function P(e,t){const n=k(e,!0,L);if(!n)return!1;const o=V(n.provider,n.prefix);return t?function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]=a({},n),!0}catch(o){}return!1}(o,n.name,t):(o.missing.add(n.name),!0)}const _=Object.freeze({width:null,height:null}),A=Object.freeze(a(a({},_),j)),R=/(-?[0-9.]*[0-9]+[0-9.]*)/g,q=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function $(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const o=e.split(R);if(null===o||!o.length)return e;const r=[];let i=o.shift(),c=q.test(i);for(;;){if(c){const e=parseFloat(i);isNaN(e)?r.push(i):r.push(Math.ceil(e*t*n)/n)}else r.push(i);if(i=o.shift(),void 0===i)return r.join("");c=!c}}const W=/\sid="(\S+)"/g,U="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let H=0;const Z=Object.create(null);function J(e){return Z[e]||Z[""]}function Q(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const K=Object.create(null),Y=["https://api.simplesvg.com","https://api.unisvg.com"],G=[];for(;Y.length>0;)1===Y.length||Math.random()>.5?G.push(Y.shift()):G.push(Y.pop());function X(e,t){const n=Q(t);return null!==n&&(K[e]=n,!0)}function ee(e){return K[e]}K[""]=Q({resources:["https://api.iconify.design"].concat(G)});let te=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(t){}})();const ne={prepare:(e,t,n)=>{const o=[],r=function(e,t){const n=ee(e);if(!n)return 0;let o;if(n.maxURL){let e=0;n.resources.forEach(t=>{const n=t;e=Math.max(e,n.length)});const r=t+".json?icons=";o=n.maxURL-e-n.path.length-r.length}else o=0;return o}(e,t),i="icons";let c={type:i,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,l)=>{s+=n.length+1,s>=r&&l>0&&(o.push(c),c={type:i,provider:e,prefix:t,icons:[]},s=n.length),c.icons.push(n)}),o.push(c),o},send:(e,t,n)=>{if(!te)return void n("abort",424);let o=function(e){if("string"==typeof e){const t=ee(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,n=t.icons.join(",");o+=e+".json?"+new URLSearchParams({icons:n}).toString();break}case"custom":{const e=t.uri;o+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void n("abort",400)}let r=503;te(e+o).then(e=>{const t=e.status;if(200===t)return r=501,e.json();setTimeout(()=>{n(function(e){return 404===e}(t)?"abort":"next",t)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{n("success",e)}):setTimeout(()=>{404===e?n("abort",e):n("next",r)})}).catch(()=>{n("next",r)})}};function oe(e,t){e.forEach(e=>{const n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}let re=0;var ie={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ce(e,t,n,o){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let c;if(e.random){let t=e.resources.slice(0);for(c=[];t.length>1;){const e=Math.floor(Math.random()*t.length);c.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}c=c.concat(t)}else c=e.resources.slice(i).concat(e.resources.slice(0,i));const s=Date.now();let l,a="pending",u=0,f=null,d=[],p=[];function h(){f&&(clearTimeout(f),f=null)}function g(){"pending"===a&&(a="aborted"),h(),d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function m(e,t){t&&(p=[]),"function"==typeof e&&p.push(e)}function y(){a="failed",p.forEach(e=>{e(void 0,l)})}function b(){d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function v(){if("pending"!==a)return;h();const o=c.shift();if(void 0===o)return d.length?void(f=setTimeout(()=>{h(),"pending"===a&&(b(),y())},e.timeout)):void y();const r={status:"pending",resource:o,callback:(t,n)=>{!function(t,n,o){const r="success"!==n;switch(d=d.filter(e=>e!==t),a){case"pending":break;case"failed":if(r||!e.dataAfterTimeout)return;break;default:return}if("abort"===n)return l=o,void y();if(r)return l=o,void(d.length||(c.length?v():y()));if(h(),b(),!e.random){const n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}a="completed",p.forEach(e=>{e(o)})}(r,t,n)}};d.push(r),u++,f=setTimeout(v,e.rotate),n(o,t,r.callback)}return"function"==typeof o&&p.push(o),setTimeout(v),function(){return{startTime:s,payload:t,status:a,queriesSent:u,queriesPending:d.length,subscribe:m,abort:g}}}function se(e){const t=a(a({},ie),e);let n=[];function o(){n=n.filter(e=>"pending"===e().status)}return{query:function(e,r,i){const c=ce(t,e,r,(e,t)=>{o(),i&&i(e,t)});return n.push(c),c},find:function(e){return n.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:o}}function le(){}const ae=Object.create(null);function ue(e,t,n){let o,r;if("string"==typeof e){const t=J(e);if(!t)return n(void 0,424),le;r=t.send;const i=function(e){if(!ae[e]){const t=ee(e);if(!t)return;const n={config:t,redundancy:se(t)};ae[e]=n}return ae[e]}(e);i&&(o=i.redundancy)}else{const t=Q(e);if(t){o=se(t);const n=J(e.resources?e.resources[0]:"");n&&(r=n.send)}}return o&&r?o.query(t,r,n)().abort:(n(void 0,424),le)}function fe(){}function de(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const o=e.provider,r=e.prefix;t.forEach(t=>{const i=t.icons,c=i.pending.length;i.pending=i.pending.filter(t=>{if(t.prefix!==r)return!0;const c=t.name;if(e.icons[c])i.loaded.push({provider:o,prefix:r,name:c});else{if(!e.missing.has(c))return n=!0,!0;i.missing.push({provider:o,prefix:r,name:c})}return!1}),i.pending.length!==c&&(n||oe([e],t.id),t.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),t.abort))})}))}(e)}))}function pe(e,t,n){function o(){const n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&"object"==typeof n)try{if(!N(e,n).length)return void o()}catch(r){console.error(r)}o(),de(e)}function he(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function ge(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:n}=e,o=e.iconsToLoad;if(delete e.iconsToLoad,!o||!o.length)return;const r=e.loadIcon;if(e.loadIcons&&(o.length>1||!r))return void he(e.loadIcons(o,n,t),t=>{pe(e,o,t)});if(r)return void o.forEach(o=>{he(r(o,n,t),t=>{pe(e,[o],t?{prefix:n,icons:{[o]:t}}:null)})});const{valid:i,invalid:c}=function(e){const t=[],n=[];return e.forEach(e=>{(e.match(x)?t:n).push(e)}),{valid:t,invalid:n}}(o);if(c.length&&pe(e,c,null),!i.length)return;const s=n.match(x)?J(t):null;if(!s)return void pe(e,i,null);s.prepare(t,n,i).forEach(n=>{ue(t,n,t=>{pe(e,n.icons,t)})})}))}const me=(e,t)=>{const n=function(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name));let o={provider:"",prefix:"",name:""};return e.forEach(e=>{if(o.name===e.name&&o.prefix===e.prefix&&o.provider===e.provider)return;o=e;const r=e.provider,i=e.prefix,c=e.name,s=n[r]||(n[r]=Object.create(null)),l=s[i]||(s[i]=V(r,i));let a;a=c in l.icons?t.loaded:""===i||l.missing.has(c)?t.missing:t.pending;const u={provider:r,prefix:i,name:c};a.push(u)}),t}(function(e,t=!0,n=!1){const o=[];return e.forEach(e=>{const r="string"==typeof e?k(e,t,n):e;r&&o.push(r)}),o}(e,!0,D()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,fe)}),()=>{e=!1}}const o=Object.create(null),r=[];let i,c;return n.pending.forEach(e=>{const{provider:t,prefix:n}=e;if(n===c&&t===i)return;i=t,c=n,r.push(V(t,n));const s=o[t]||(o[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{const{provider:t,prefix:n,name:r}=e,i=V(t,n),c=i.pendingIcons||(i.pendingIcons=new Set);c.has(r)||(c.add(r),o[t][n].push(r))}),r.forEach(e=>{const t=o[e.provider][e.prefix];t.length&&ge(e,t)}),t?function(e,t,n){const o=re++,r=oe.bind(null,n,o);if(!t.pending.length)return r;const i={id:o,icons:t,callback:e,abort:r};return n.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(i)}),r}(t,n,r):fe};const ye=/[\s,]+/;function be(e,t){t.split(ye).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function ve(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(e){for(;e<0;)e+=4;return e%4}if(""===n){const t=parseInt(e);return isNaN(t)?0:o(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let r=parseFloat(e.slice(0,e.length-n.length));return isNaN(r)?0:(r/=t,r%1==0?o(r):0)}}return t}const xe=u(a({},A),{inline:!1}),ke={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},we={display:"inline-block"},Se={backgroundColor:"currentColor"},je={backgroundColor:"transparent"},Ee={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Oe={webkitMask:Se,mask:Se,background:je};for(const _e in Oe){const e=Oe[_e];for(const t in Ee)e[_e+t]=Ee[t]}const Ce={};function Fe(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";Ce[e+"-flip"]=t,Ce[e.slice(0,1)+"-flip"]=t,Ce[e+"Flip"]=t});const Ie=(e,n)=>{const o=function(e,t){const n=a({},e);for(const o in t){const e=t[o],r=typeof e;o in _?(null===e||e&&("string"===r||"number"===r))&&(n[o]=e):r===typeof n[o]&&(n[o]="rotate"===o?e%4:e)}return n}(xe,n),r=a({},ke),i=n.mode||"svg",c={},s=n.style,l="object"!=typeof s||s instanceof Array?{}:s;for(let t in n){const e=n[t];if(void 0!==e)switch(t){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":o[t]=!0===e||"true"===e||1===e;break;case"flip":"string"==typeof e&&be(o,e);break;case"color":c.color=e;break;case"rotate":"string"==typeof e?o[t]=ve(e):"number"==typeof e&&(o[t]=e);break;case"ariaHidden":case"aria-hidden":!0!==e&&"true"!==e&&delete r["aria-hidden"];break;default:{const n=Ce[t];n?!0!==e&&"true"!==e&&1!==e||(o[n]=!0):void 0===xe[t]&&(r[t]=e)}}}const f=function(e,t){const n=a(a({},E),e),o=a(a({},A),t),r={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,o].forEach(e=>{const t=[],n=e.hFlip,o=e.vFlip;let c,s=e.rotate;switch(n?o?s+=2:(t.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),t.push("scale(-1 1)"),r.top=r.left=0):o&&(t.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),t.push("scale(1 -1)"),r.top=r.left=0),s<0&&(s-=4*Math.floor(s/4)),s%=4,s){case 1:c=r.height/2+r.top,t.unshift("rotate(90 "+c.toString()+" "+c.toString()+")");break;case 2:t.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:c=r.width/2+r.left,t.unshift("rotate(-90 "+c.toString()+" "+c.toString()+")")}s%2==1&&(r.left!==r.top&&(c=r.left,r.left=r.top,r.top=c),r.width!==r.height&&(c=r.width,r.width=r.height,r.height=c)),t.length&&(i=function(e,t,n){const o=function(e,t="defs"){let n="";const o=e.indexOf("<"+t);for(;o>=0;){const r=e.indexOf(">",o),i=e.indexOf("</"+t);if(-1===r||-1===i)break;const c=e.indexOf(">",i);if(-1===c)break;n+=e.slice(r+1,i).trim(),e=e.slice(0,o).trim()+e.slice(c+1)}return{defs:n,content:e}}(e);return r=o.defs,i=t+o.content+n,r?"<defs>"+r+"</defs>"+i:i;var r,i}(i,'<g transform="'+t.join(" ")+'">',"</g>"))});const c=o.width,s=o.height,l=r.width,u=r.height;let f,d;null===c?(d=null===s?"1em":"auto"===s?u:s,f=$(d,l/u)):(f="auto"===c?l:c,d=null===s?$(f,u/l):"auto"===s?u:s);const p={},h=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(p[e]=t.toString())};h("width",f),h("height",d);const g=[r.left,r.top,l,u];return p.viewBox=g.join(" "),{attributes:p,viewBox:g,body:i}}(e,o),d=f.attributes;if(o.inline&&(c.verticalAlign="-0.125em"),"svg"===i){r.style=a(a({},c),l),Object.assign(r,d);let e=0,o=n.id;return"string"==typeof o&&(o=o.replace(/-/g,"_")),r.innerHTML=function(e,t=U){const n=[];let o;for(;o=W.exec(e);)n.push(o[1]);if(!n.length)return e;const r="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach(n=>{const o="function"==typeof t?t(n):t+(H++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),"")}(f.body,o?()=>o+"ID"+e++:"iconifyVue"),t.h("svg",r)}const{body:p,width:h,height:g}=e,m="mask"===i||"bg"!==i&&-1!==p.indexOf("currentColor"),y=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in t)n+=" "+o+'="'+t[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}(p,u(a({},d),{width:h+"",height:g+""}));var b;return r.style=a(a(a(u(a({},c),{"--svg":(b=y,'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(b)+'")'),width:Fe(d.width),height:Fe(d.height)}),we),m?Se:je),l),t.h("span",r)};var Te;if(D(!0),Te=ne,Z[""]=Te,"undefined"!=typeof document&&"undefined"!=typeof window){const e=window;if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),L&&!t&&!e.prefix){let t=!1;return B(e)&&(e.prefix="",I(e,(e,n)=>{P(e,n)&&(t=!0)})),t}const n=e.prefix;return!!w({prefix:n,name:"a"})&&!!N(V(t,n),e)}(e))&&console.error(n)}catch(t){console.error(n)}})}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){const n="IconifyProviders["+e+"] is invalid.";try{const o=t[e];if("object"!=typeof o||!o||void 0===o.resources)continue;X(e,o)||console.error(n)}catch(Pe){console.error(n)}}}}const ze=u(a({},E),{body:""}),Be={data:()=>({}),components:{Icon:t.defineComponent((e,{emit:n})=>{const o=t.ref(null);function r(){var e,t;o.value&&(null==(t=(e=o.value).abort)||t.call(e),o.value=null)}const i=t.ref(!!e.ssr),c=t.ref(""),s=t.shallowRef(null);function l(){const i=e.icon;if("object"==typeof i&&null!==i&&"string"==typeof i.body)return c.value="",{data:i};let s;if("string"!=typeof i||null===(s=k(i,!1,!0)))return null;let l=function(e){const t="string"==typeof e?k(e,!0,L):e;if(t){const e=V(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}(s);if(!l){const e=o.value;return e&&e.name===i||(o.value=null===l?{name:i}:{name:i,abort:me([s],f)}),null}r(),c.value!==i&&(c.value=i,t.nextTick(()=>{n("load",i)}));const a=e.customise;if(a){l=Object.assign({},l);const e=a(l.body,s.name,s.prefix,s.provider);"string"==typeof e&&(l.body=e)}const u=["iconify"];return""!==s.prefix&&u.push("iconify--"+s.prefix),""!==s.provider&&u.push("iconify--"+s.provider),{data:l,classes:u}}function f(){var e;const t=l();t?t.data!==(null==(e=s.value)?void 0:e.data)&&(s.value=t):s.value=null}return i.value?f():t.onMounted(()=>{i.value=!0,f()}),t.watch(()=>e.icon,f),t.onUnmounted(r),()=>{const t=s.value;if(!t)return Ie(ze,e);let n=e;return t.classes&&(n=u(a({},e),{class:t.classes.join(" ")})),Ie(a(a({},E),t.data),n)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]})},props:{title:{type:String,required:!1},bound:{type:Boolean,default:!1},bounded:{type:Boolean,default:!1},flat:{type:Boolean,default:!1},iconLeft:{type:Boolean,required:!1,default:!1},iconRight:{type:Boolean,default:!1},icon:{type:String},size:{type:String},iconSize:{type:String},wFull:{type:Boolean,default:!1},noBg:{type:Boolean,default:!1},color:String},methods:{}};const Me={class:"search"},Ve=["src"];const Ne=f({name:"ZSearchWidget",data:()=>({text:""}),props:{searchTarget:{type:String,require:!1,default:"same"},logo:{type:String,require:!1}},components:{Input:v,Button:f(Be,[["render",function(e,n,o,r,i,c){const s=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass([{flat:o.flat},{bound:o.bound},{bounded:o.bounded},{"w-full":o.wFull},{transparent:o.noBg}]),style:t.normalizeStyle([{"font-size":o.size},{color:o.color}])},[o.iconLeft?(t.openBlock(),t.createBlock(s,{key:0,icon:o.icon,style:t.normalizeStyle({"font-size":o.iconSize})},null,8,["icon","style"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.title)+" ",1),o.icon&&!o.iconLeft?(t.openBlock(),t.createBlock(s,{key:1,icon:o.icon,width:o.iconSize,height:o.iconSize},null,8,["icon","width","height"])):t.createCommentVNode("",!0)],6)}],["__scopeId","data-v-10678914"]])},methods:{search(){const e=`https://astiango.co/?q=${encodeURIComponent(this.text)}`;"new"==this.searchTarget?chrome.tabs.create({url:e}):"same"==this.searchTarget&&chrome.tabs.update({url:e})}}},[["render",function(e,n,o,r,i,c){const s=t.resolveComponent("Input"),l=t.resolveComponent("Button");return t.openBlock(),t.createElementBlock("div",Me,[o.logo?(t.openBlock(),t.createElementBlock("img",{key:0,src:o.logo},null,8,Ve)):t.createCommentVNode("",!0),t.createVNode(s,{placeholder:"Search something",full:"",class:"bg",modelValue:i.text,"onUpdate:modelValue":n[0]||(n[0]=e=>i.text=e),onEnterPressed:n[1]||(n[1]=e=>c.search())},null,8,["modelValue"]),t.createVNode(l,{icon:"material-symbols-light:search-rounded",size:"25px",flat:"",class:"text-color",onClick:n[2]||(n[2]=e=>c.search())})])}],["__scopeId","data-v-365b4ae7"]]),Le=t.defineCustomElement(m),De=t.defineCustomElement(Ne);customElements.get("z-clock-widget")||customElements.define("z-clock-widget",Le),customElements.get("z-search-widget")||customElements.define("z-search-widget",De),e.ZClockWidget=m,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZenWdg={},e.Vue)}(this,function(e,t){"use strict";var n=Object.defineProperty,o=Object.defineProperties,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,o)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,a=(e,t)=>{for(var n in t||(t={}))s.call(t,n)&&c(e,n,t[n]);if(i)for(var n of i(t))l.call(t,n)&&c(e,n,t[n]);return e},u=(e,t)=>o(e,r(t)),d=(e,t,n)=>new Promise((o,r)=>{var i=e=>{try{l(n.next(e))}catch(t){r(t)}},s=e=>{try{l(n.throw(e))}catch(t){r(t)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);l((n=n.apply(e,t)).next())});const f=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},p={class:"clock-container"},m={class:"clock"},h={class:"time"},g={class:"date"};const v=f({name:"ZClockWidget",data:()=>({hours:"00",minutes:"00",seconds:"00",dayOfWeek:"",day:"",month:"",year:""}),mounted(){this.updateClock(),setInterval(this.updateClock,1e3)},methods:{updateClock(){const e=new Date;this.hours=e.getHours().toString().padStart(2,"0"),this.minutes=e.getMinutes().toString().padStart(2,"0"),this.seconds=e.getSeconds().toString().padStart(2,"0"),this.dayOfWeek=this.getDayOfWeek(e.getDay()),this.day=e.getDate(),this.month=this.getMonthName(e.getMonth()),this.year=e.getFullYear()},getDayOfWeek:e=>["Domingo","Lunes","Martes","MiΓ©rcoles","Jueves","Viernes","SΓ‘bado"][e],getMonthName:e=>["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][e]}},[["render",function(e,n,o,r,i,s){return t.openBlock(),t.createElementBlock("div",p,[t.createElementVNode("div",m,[t.createElementVNode("div",h,[t.createElementVNode("span",null,t.toDisplayString(i.hours),1),n[0]||(n[0]=t.createTextVNode(":",-1)),t.createElementVNode("span",null,t.toDisplayString(i.minutes),1)]),t.createElementVNode("div",g,[t.createElementVNode("span",null,t.toDisplayString(i.dayOfWeek)+", "+t.toDisplayString(i.day)+" "+t.toDisplayString(i.month)+" "+t.toDisplayString(i.year),1)])])])}],["__scopeId","data-v-e9445086"]]),y={data:()=>({}),props:{placeholder:String,modelValue:{type:String,default:""},round:{type:Boolean,default:!1},full:{type:Boolean},rounded:{type:Boolean,default:!1}},methods:{onInput(e){this.$emit("update:modelValue",e.target.value)},onEnter(){this.$emit("enter-pressed",this.modelValue)}}},b=["placeholder","value"];const k=f(y,[["render",function(e,n,o,r,i,s){return t.openBlock(),t.createElementBlock("input",{placeholder:o.placeholder,value:o.modelValue,onInput:n[0]||(n[0]=(...e)=>s.onInput&&s.onInput(...e)),onKeydown:n[1]||(n[1]=t.withKeys((...e)=>s.onEnter&&s.onEnter(...e),["enter"])),class:t.normalizeClass([{"full-width":o.full},{round:o.round},{rounded:o.rounded}])},null,42,b)}],["__scopeId","data-v-2ad90286"]]),w=/^[a-z0-9]+(-[a-z0-9]+)*$/,x=(e,t,n,o="")=>{const r=e.split(":");if("@"===e.slice(0,1)){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const e=r.pop(),n=r.pop(),i={provider:r.length>0?r[0]:o,prefix:n,name:e};return t&&!E(i)?null:i}const i=r[0],s=i.split("-");if(s.length>1){const e={provider:o,prefix:s.shift(),name:s.join("-")};return t&&!E(e)?null:e}if(n&&""===o){const e={provider:o,prefix:"",name:i};return t&&!E(e,n)?null:e}return null},E=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name),S=Object.freeze({left:0,top:0,width:16,height:16}),T=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),C=Object.freeze(a(a({},S),T)),N=Object.freeze(u(a({},C),{body:"",hidden:!1}));function B(e,t){const n=function(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const o=((e.rotate||0)+(t.rotate||0))%4;return o&&(n.rotate=o),n}(e,t);for(const o in N)o in T?o in e&&!(o in n)&&(n[o]=T[o]):o in t?n[o]=t[o]:o in e&&(n[o]=e[o]);return n}function z(e,t,n){const o=e.icons,r=e.aliases||Object.create(null);let i={};function s(e){i=B(o[e]||r[e],i)}return s(t),n.forEach(s),B(e,i)}function V(e,t){const n=[];if("object"!=typeof e||"object"!=typeof e.icons)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});const o=function(e){const t=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);return Object.keys(t).concat(Object.keys(n)).forEach(function e(r){if(t[r])return o[r]=[];if(!(r in o)){o[r]=null;const t=n[r]&&n[r].parent,i=t&&e(t);i&&(o[r]=[t].concat(i))}return o[r]}),o}(e);for(const r in o){const i=o[r];i&&(t(r,z(e,r,i)),n.push(r))}return n}const j=a({provider:"",aliases:{},not_found:{}},S);function O(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function F(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!O(e,j))return null;const n=t.icons;for(const r in n){const e=n[r];if(!r||"string"!=typeof e.body||!O(e,N))return null}const o=t.aliases||Object.create(null);for(const r in o){const e=o[r],t=e.parent;if(!r||"string"!=typeof t||!n[t]&&!o[t]||!O(e,N))return null}return t}const I=Object.create(null);function M(e,t){const n=I[e]||(I[e]=Object.create(null));return n[t]||(n[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function L(e,t){return F(t)?V(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}let D=!1;function _(e){return"boolean"==typeof e&&(D=e),D}function P(e,t){const n=x(e,!0,D);if(!n)return!1;const o=M(n.provider,n.prefix);return t?function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]=a({},n),!0}catch(o){}return!1}(o,n.name,t):(o.missing.add(n.name),!0)}const A=Object.freeze({width:null,height:null}),W=Object.freeze(a(a({},A),T)),R=/(-?[0-9.]*[0-9]+[0-9.]*)/g,U=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function $(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const o=e.split(R);if(null===o||!o.length)return e;const r=[];let i=o.shift(),s=U.test(i);for(;;){if(s){const e=parseFloat(i);isNaN(e)?r.push(i):r.push(Math.ceil(e*t*n)/n)}else r.push(i);if(i=o.shift(),void 0===i)return r.join("");s=!s}}const q=/\sid="(\S+)"/g,Z="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let H=0;const J=Object.create(null);function Q(e){return J[e]||J[""]}function K(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const Y=Object.create(null),G=["https://api.simplesvg.com","https://api.unisvg.com"],X=[];for(;G.length>0;)1===G.length||Math.random()>.5?X.push(G.shift()):X.push(G.pop());function ee(e,t){const n=K(t);return null!==n&&(Y[e]=n,!0)}function te(e){return Y[e]}Y[""]=K({resources:["https://api.iconify.design"].concat(X)});let ne=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(t){}})();const oe={prepare:(e,t,n)=>{const o=[],r=function(e,t){const n=te(e);if(!n)return 0;let o;if(n.maxURL){let e=0;n.resources.forEach(t=>{const n=t;e=Math.max(e,n.length)});const r=t+".json?icons=";o=n.maxURL-e-n.path.length-r.length}else o=0;return o}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},l=0;return n.forEach((n,c)=>{l+=n.length+1,l>=r&&c>0&&(o.push(s),s={type:i,provider:e,prefix:t,icons:[]},l=n.length),s.icons.push(n)}),o.push(s),o},send:(e,t,n)=>{if(!ne)return void n("abort",424);let o=function(e){if("string"==typeof e){const t=te(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,n=t.icons.join(",");o+=e+".json?"+new URLSearchParams({icons:n}).toString();break}case"custom":{const e=t.uri;o+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void n("abort",400)}let r=503;ne(e+o).then(e=>{const t=e.status;if(200===t)return r=501,e.json();setTimeout(()=>{n(function(e){return 404===e}(t)?"abort":"next",t)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{n("success",e)}):setTimeout(()=>{404===e?n("abort",e):n("next",r)})}).catch(()=>{n("next",r)})}};function re(e,t){e.forEach(e=>{const n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}let ie=0;var se={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function le(e,t,n,o){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let s;if(e.random){let t=e.resources.slice(0);for(s=[];t.length>1;){const e=Math.floor(Math.random()*t.length);s.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}s=s.concat(t)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const l=Date.now();let c,a="pending",u=0,d=null,f=[],p=[];function m(){d&&(clearTimeout(d),d=null)}function h(){"pending"===a&&(a="aborted"),m(),f.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),f=[]}function g(e,t){t&&(p=[]),"function"==typeof e&&p.push(e)}function v(){a="failed",p.forEach(e=>{e(void 0,c)})}function y(){f.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),f=[]}function b(){if("pending"!==a)return;m();const o=s.shift();if(void 0===o)return f.length?void(d=setTimeout(()=>{m(),"pending"===a&&(y(),v())},e.timeout)):void v();const r={status:"pending",resource:o,callback:(t,n)=>{!function(t,n,o){const r="success"!==n;switch(f=f.filter(e=>e!==t),a){case"pending":break;case"failed":if(r||!e.dataAfterTimeout)return;break;default:return}if("abort"===n)return c=o,void v();if(r)return c=o,void(f.length||(s.length?b():v()));if(m(),y(),!e.random){const n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}a="completed",p.forEach(e=>{e(o)})}(r,t,n)}};f.push(r),u++,d=setTimeout(b,e.rotate),n(o,t,r.callback)}return"function"==typeof o&&p.push(o),setTimeout(b),function(){return{startTime:l,payload:t,status:a,queriesSent:u,queriesPending:f.length,subscribe:g,abort:h}}}function ce(e){const t=a(a({},se),e);let n=[];function o(){n=n.filter(e=>"pending"===e().status)}return{query:function(e,r,i){const s=le(t,e,r,(e,t)=>{o(),i&&i(e,t)});return n.push(s),s},find:function(e){return n.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:o}}function ae(){}const ue=Object.create(null);function de(e,t,n){let o,r;if("string"==typeof e){const t=Q(e);if(!t)return n(void 0,424),ae;r=t.send;const i=function(e){if(!ue[e]){const t=te(e);if(!t)return;const n={config:t,redundancy:ce(t)};ue[e]=n}return ue[e]}(e);i&&(o=i.redundancy)}else{const t=K(e);if(t){o=ce(t);const n=Q(e.resources?e.resources[0]:"");n&&(r=n.send)}}return o&&r?o.query(t,r,n)().abort:(n(void 0,424),ae)}function fe(){}function pe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const o=e.provider,r=e.prefix;t.forEach(t=>{const i=t.icons,s=i.pending.length;i.pending=i.pending.filter(t=>{if(t.prefix!==r)return!0;const s=t.name;if(e.icons[s])i.loaded.push({provider:o,prefix:r,name:s});else{if(!e.missing.has(s))return n=!0,!0;i.missing.push({provider:o,prefix:r,name:s})}return!1}),i.pending.length!==s&&(n||re([e],t.id),t.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),t.abort))})}))}(e)}))}function me(e,t,n){function o(){const n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&"object"==typeof n)try{if(!L(e,n).length)return void o()}catch(r){console.error(r)}o(),pe(e)}function he(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function ge(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:n}=e,o=e.iconsToLoad;if(delete e.iconsToLoad,!o||!o.length)return;const r=e.loadIcon;if(e.loadIcons&&(o.length>1||!r))return void he(e.loadIcons(o,n,t),t=>{me(e,o,t)});if(r)return void o.forEach(o=>{he(r(o,n,t),t=>{me(e,[o],t?{prefix:n,icons:{[o]:t}}:null)})});const{valid:i,invalid:s}=function(e){const t=[],n=[];return e.forEach(e=>{(e.match(w)?t:n).push(e)}),{valid:t,invalid:n}}(o);if(s.length&&me(e,s,null),!i.length)return;const l=n.match(w)?Q(t):null;if(!l)return void me(e,i,null);l.prepare(t,n,i).forEach(n=>{de(t,n,t=>{me(e,n.icons,t)})})}))}const ve=(e,t)=>{const n=function(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name));let o={provider:"",prefix:"",name:""};return e.forEach(e=>{if(o.name===e.name&&o.prefix===e.prefix&&o.provider===e.provider)return;o=e;const r=e.provider,i=e.prefix,s=e.name,l=n[r]||(n[r]=Object.create(null)),c=l[i]||(l[i]=M(r,i));let a;a=s in c.icons?t.loaded:""===i||c.missing.has(s)?t.missing:t.pending;const u={provider:r,prefix:i,name:s};a.push(u)}),t}(function(e,t=!0,n=!1){const o=[];return e.forEach(e=>{const r="string"==typeof e?x(e,t,n):e;r&&o.push(r)}),o}(e,!0,_()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,fe)}),()=>{e=!1}}const o=Object.create(null),r=[];let i,s;return n.pending.forEach(e=>{const{provider:t,prefix:n}=e;if(n===s&&t===i)return;i=t,s=n,r.push(M(t,n));const l=o[t]||(o[t]=Object.create(null));l[n]||(l[n]=[])}),n.pending.forEach(e=>{const{provider:t,prefix:n,name:r}=e,i=M(t,n),s=i.pendingIcons||(i.pendingIcons=new Set);s.has(r)||(s.add(r),o[t][n].push(r))}),r.forEach(e=>{const t=o[e.provider][e.prefix];t.length&&ge(e,t)}),t?function(e,t,n){const o=ie++,r=re.bind(null,n,o);if(!t.pending.length)return r;const i={id:o,icons:t,callback:e,abort:r};return n.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(i)}),r}(t,n,r):fe};const ye=/[\s,]+/;function be(e,t){t.split(ye).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function ke(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(e){for(;e<0;)e+=4;return e%4}if(""===n){const t=parseInt(e);return isNaN(t)?0:o(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let r=parseFloat(e.slice(0,e.length-n.length));return isNaN(r)?0:(r/=t,r%1==0?o(r):0)}}return t}const we=u(a({},W),{inline:!1}),xe={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ee={display:"inline-block"},Se={backgroundColor:"currentColor"},Te={backgroundColor:"transparent"},Ce={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Ne={webkitMask:Se,mask:Se,background:Te};for(const dt in Ne){const e=Ne[dt];for(const t in Ce)e[dt+t]=Ce[t]}const Be={};function ze(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";Be[e+"-flip"]=t,Be[e.slice(0,1)+"-flip"]=t,Be[e+"Flip"]=t});const Ve=(e,n)=>{const o=function(e,t){const n=a({},e);for(const o in t){const e=t[o],r=typeof e;o in A?(null===e||e&&("string"===r||"number"===r))&&(n[o]=e):r===typeof n[o]&&(n[o]="rotate"===o?e%4:e)}return n}(we,n),r=a({},xe),i=n.mode||"svg",s={},l=n.style,c="object"!=typeof l||l instanceof Array?{}:l;for(let t in n){const e=n[t];if(void 0!==e)switch(t){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":o[t]=!0===e||"true"===e||1===e;break;case"flip":"string"==typeof e&&be(o,e);break;case"color":s.color=e;break;case"rotate":"string"==typeof e?o[t]=ke(e):"number"==typeof e&&(o[t]=e);break;case"ariaHidden":case"aria-hidden":!0!==e&&"true"!==e&&delete r["aria-hidden"];break;default:{const n=Be[t];n?!0!==e&&"true"!==e&&1!==e||(o[n]=!0):void 0===we[t]&&(r[t]=e)}}}const d=function(e,t){const n=a(a({},C),e),o=a(a({},W),t),r={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,o].forEach(e=>{const t=[],n=e.hFlip,o=e.vFlip;let s,l=e.rotate;switch(n?o?l+=2:(t.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),t.push("scale(-1 1)"),r.top=r.left=0):o&&(t.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),t.push("scale(1 -1)"),r.top=r.left=0),l<0&&(l-=4*Math.floor(l/4)),l%=4,l){case 1:s=r.height/2+r.top,t.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:t.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:s=r.width/2+r.left,t.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}l%2==1&&(r.left!==r.top&&(s=r.left,r.left=r.top,r.top=s),r.width!==r.height&&(s=r.width,r.width=r.height,r.height=s)),t.length&&(i=function(e,t,n){const o=function(e,t="defs"){let n="";const o=e.indexOf("<"+t);for(;o>=0;){const r=e.indexOf(">",o),i=e.indexOf("</"+t);if(-1===r||-1===i)break;const s=e.indexOf(">",i);if(-1===s)break;n+=e.slice(r+1,i).trim(),e=e.slice(0,o).trim()+e.slice(s+1)}return{defs:n,content:e}}(e);return r=o.defs,i=t+o.content+n,r?"<defs>"+r+"</defs>"+i:i;var r,i}(i,'<g transform="'+t.join(" ")+'">',"</g>"))});const s=o.width,l=o.height,c=r.width,u=r.height;let d,f;null===s?(f=null===l?"1em":"auto"===l?u:l,d=$(f,c/u)):(d="auto"===s?c:s,f=null===l?$(d,u/c):"auto"===l?u:l);const p={},m=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(p[e]=t.toString())};m("width",d),m("height",f);const h=[r.left,r.top,c,u];return p.viewBox=h.join(" "),{attributes:p,viewBox:h,body:i}}(e,o),f=d.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===i){r.style=a(a({},s),c),Object.assign(r,f);let e=0,o=n.id;return"string"==typeof o&&(o=o.replace(/-/g,"_")),r.innerHTML=function(e,t=Z){const n=[];let o;for(;o=q.exec(e);)n.push(o[1]);if(!n.length)return e;const r="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach(n=>{const o="function"==typeof t?t(n):t+(H++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),"")}(d.body,o?()=>o+"ID"+e++:"iconifyVue"),t.h("svg",r)}const{body:p,width:m,height:h}=e,g="mask"===i||"bg"!==i&&-1!==p.indexOf("currentColor"),v=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in t)n+=" "+o+'="'+t[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}(p,u(a({},f),{width:m+"",height:h+""}));var y;return r.style=a(a(a(u(a({},s),{"--svg":(y=v,'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(y)+'")'),width:ze(f.width),height:ze(f.height)}),Ee),g?Se:Te),c),t.h("span",r)};var je;if(_(!0),je=oe,J[""]=je,"undefined"!=typeof document&&"undefined"!=typeof window){const e=window;if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),D&&!t&&!e.prefix){let t=!1;return F(e)&&(e.prefix="",V(e,(e,n)=>{P(e,n)&&(t=!0)})),t}const n=e.prefix;return!!E({prefix:n,name:"a"})&&!!L(M(t,n),e)}(e))&&console.error(n)}catch(t){console.error(n)}})}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){const n="IconifyProviders["+e+"] is invalid.";try{const o=t[e];if("object"!=typeof o||!o||void 0===o.resources)continue;ee(e,o)||console.error(n)}catch(ut){console.error(n)}}}}const Oe=u(a({},C),{body:""}),Fe={data:()=>({}),components:{Icon:t.defineComponent((e,{emit:n})=>{const o=t.ref(null);function r(){var e,t;o.value&&(null==(t=(e=o.value).abort)||t.call(e),o.value=null)}const i=t.ref(!!e.ssr),s=t.ref(""),l=t.shallowRef(null);function c(){const i=e.icon;if("object"==typeof i&&null!==i&&"string"==typeof i.body)return s.value="",{data:i};let l;if("string"!=typeof i||null===(l=x(i,!1,!0)))return null;let c=function(e){const t="string"==typeof e?x(e,!0,D):e;if(t){const e=M(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}(l);if(!c){const e=o.value;return e&&e.name===i||(o.value=null===c?{name:i}:{name:i,abort:ve([l],d)}),null}r(),s.value!==i&&(s.value=i,t.nextTick(()=>{n("load",i)}));const a=e.customise;if(a){c=Object.assign({},c);const e=a(c.body,l.name,l.prefix,l.provider);"string"==typeof e&&(c.body=e)}const u=["iconify"];return""!==l.prefix&&u.push("iconify--"+l.prefix),""!==l.provider&&u.push("iconify--"+l.provider),{data:c,classes:u}}function d(){var e;const t=c();t?t.data!==(null==(e=l.value)?void 0:e.data)&&(l.value=t):l.value=null}return i.value?d():t.onMounted(()=>{i.value=!0,d()}),t.watch(()=>e.icon,d),t.onUnmounted(r),()=>{const t=l.value;if(!t)return Ve(Oe,e);let n=e;return t.classes&&(n=u(a({},e),{class:t.classes.join(" ")})),Ve(a(a({},C),t.data),n)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]})},props:{title:{type:String,required:!1},bound:{type:Boolean,default:!1},bounded:{type:Boolean,default:!1},flat:{type:Boolean,default:!1},iconLeft:{type:Boolean,required:!1,default:!1},iconRight:{type:Boolean,default:!1},icon:{type:String},size:{type:String},iconSize:{type:String},wFull:{type:Boolean,default:!1},noBg:{type:Boolean,default:!1},color:String},methods:{}};const Ie={class:"search"},Me=["src"];const Le=f({name:"ZSearchWidget",data:()=>({text:""}),props:{searchTarget:{type:String,require:!1,default:"same"},logo:{type:String,require:!1}},components:{Input:k,Button:f(Fe,[["render",function(e,n,o,r,i,s){const l=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass([{flat:o.flat},{bound:o.bound},{bounded:o.bounded},{"w-full":o.wFull},{transparent:o.noBg}]),style:t.normalizeStyle([{"font-size":o.size},{color:o.color}])},[o.iconLeft?(t.openBlock(),t.createBlock(l,{key:0,icon:o.icon,style:t.normalizeStyle({"font-size":o.iconSize})},null,8,["icon","style"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.title)+" ",1),o.icon&&!o.iconLeft?(t.openBlock(),t.createBlock(l,{key:1,icon:o.icon,width:o.iconSize,height:o.iconSize},null,8,["icon","width","height"])):t.createCommentVNode("",!0)],6)}],["__scopeId","data-v-10678914"]])},methods:{search(){const e=`https://astiango.co/?q=${encodeURIComponent(this.text)}`;"new"==this.searchTarget?chrome.tabs.create({url:e}):"same"==this.searchTarget&&chrome.tabs.update({url:e})}}},[["render",function(e,n,o,r,i,s){const l=t.resolveComponent("Input"),c=t.resolveComponent("Button");return t.openBlock(),t.createElementBlock("div",Ie,[o.logo?(t.openBlock(),t.createElementBlock("img",{key:0,src:o.logo},null,8,Me)):t.createCommentVNode("",!0),t.createVNode(l,{placeholder:"Search something",full:"",class:"bg",modelValue:i.text,"onUpdate:modelValue":n[0]||(n[0]=e=>i.text=e),onEnterPressed:n[1]||(n[1]=e=>s.search())},null,8,["modelValue"]),t.createVNode(c,{icon:"material-symbols-light:search-rounded",size:"25px",flat:"",class:"text-color",onClick:n[2]||(n[2]=e=>s.search())})])}],["__scopeId","data-v-50392e2c"]]),De={class:"todo-widget"},_e={class:"task-section"},Pe={key:0,class:"empty"},Ae={class:"actions"},We=["onClick"],Re=["onClick"],Ue={class:"task-section completed"},$e={key:0,class:"empty"},qe={class:"done"},Ze=["onClick"];const He=f({name:"TodoWidget",data:()=>({newTask:"",pendingTasks:[],completedTasks:[]}),methods:{addTask(){this.newTask.trim()&&(this.pendingTasks.push({text:this.newTask.trim()}),this.newTask="")},completeTask(e){const t=this.pendingTasks.splice(e,1)[0];this.completedTasks.push(t)},deleteTask(e){this.pendingTasks.splice(e,1)},deleteCompleted(e){this.completedTasks.splice(e,1)}}},[["render",function(e,n,o,r,i,s){return t.openBlock(),t.createElementBlock("div",De,[n[5]||(n[5]=t.createElementVNode("h2",{class:"title"},"π Mis Tareas",-1)),t.createElementVNode("form",{onSubmit:n[1]||(n[1]=t.withModifiers((...e)=>s.addTask&&s.addTask(...e),["prevent"])),class:"todo-form"},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=e=>i.newTask=e),type:"text",placeholder:"Escribe una nueva tarea..."},null,512),[[t.vModelText,i.newTask]]),n[2]||(n[2]=t.createElementVNode("button",{type:"submit"},"Agregar",-1))],32),t.createElementVNode("div",_e,[n[3]||(n[3]=t.createElementVNode("h3",null,"Tareas Pendientes",-1)),0===i.pendingTasks.length?(t.openBlock(),t.createElementBlock("div",Pe,"Sin tareas.")):t.createCommentVNode("",!0),t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.pendingTasks,(e,n)=>(t.openBlock(),t.createElementBlock("li",{key:n},[t.createElementVNode("span",null,t.toDisplayString(e.text),1),t.createElementVNode("div",Ae,[t.createElementVNode("button",{onClick:e=>s.completeTask(n)},"βοΈ",8,We),t.createElementVNode("button",{onClick:e=>s.deleteTask(n)},"ποΈ",8,Re)])]))),128))])]),t.createElementVNode("div",Ue,[n[4]||(n[4]=t.createElementVNode("h3",null,"Completadas",-1)),0===i.completedTasks.length?(t.openBlock(),t.createElementBlock("div",$e,"Ninguna aΓΊn.")):t.createCommentVNode("",!0),t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.completedTasks,(e,n)=>(t.openBlock(),t.createElementBlock("li",{key:"c"+n},[t.createElementVNode("span",qe,t.toDisplayString(e.text),1),t.createElementVNode("button",{onClick:e=>s.deleteCompleted(n)},"β",8,Ze)]))),128))])])])}],["__scopeId","data-v-edabf7fa"]]),Je={class:"tabs"},Qe=["onClick"],Ke={class:"grid"},Ye={class:"option-app"},Ge=["onClick"],Xe=["onClick"],et=["onClick"],tt={class:"column"},nt=["src","alt","onError"],ot="bookmark_manager_state",rt={__name:"z-marked-widget",props:{theme:{type:String,default:"light"},small:{type:Boolean,default:!1},categories:{type:Array,default:()=>["Personal","Work","Study"]},open:{type:String,default:"self"},useStorage:{type:Boolean,default:!1}},setup(e){const n=e,o={Personal:[{title:"Reddit",url:"https://reddit.com",logo:"https://www.google.com/s2/favicons?domain=reddit.com&sz=64"},{title:"Spotify",url:"https://spotify.com",logo:"https://www.google.com/s2/favicons?domain=spotify.com&sz=64"},{title:"Youtube",url:"https://youtube.com",logo:"https://www.google.com/s2/favicons?domain=youtube.com&sz=64"},{title:"Instagram",url:"https://instagram.com",logo:"https://www.google.com/s2/favicons?domain=instagram.com&sz=64"},{title:"Facebook",url:"https://facebook.com",logo:"https://www.google.com/s2/favicons?domain=facebook.com&sz=64"},{title:"WhatsApp",url:"https://whatsapp.com",logo:"https://www.google.com/s2/favicons?domain=whatsapp.com&sz=64"},{title:"Telegram",url:"https://web.telegram.org/",logo:"https://www.google.com/s2/favicons?domain=web.telegram.org&sz=64"},{title:"Spotify",url:"https://spotify.com",logo:"https://www.google.com/s2/favicons?domain=spotify.com&sz=64"}],Work:[{title:"GitHub",url:"https://github.com",logo:"https://www.google.com/s2/favicons?domain=github.com&sz=64"},{title:"Notion",url:"https://notion.so",logo:"https://www.google.com/s2/favicons?domain=notion.so&sz=64"}],Study:[{title:"MDN Web Docs",url:"https://developer.mozilla.org",logo:"https://www.google.com/s2/favicons?domain=mozilla.org&sz=64"},{title:"FreeCodeCamp",url:"https://freecodecamp.org",logo:"https://www.google.com/s2/favicons?domain=freecodecamp.org&sz=64"}]},r=t.reactive({bookmarks:n.useStorage&&JSON.parse(localStorage.getItem(ot))||o,activeTab:"Personal"}),i=t.ref([...n.categories]),s=t.ref(n.small),l=t.ref(n.theme),c=t.ref(n.open),a=t.ref(n.useStorage),u=computed(()=>r.bookmarks[r.activeTab]||[]);function f(){a.value&&localStorage.setItem(ot,JSON.stringify(r.bookmarks))}function p(){const e=prompt("Nombre del marcador:");if(!e)return;const t=prompt("URL del marcador:");if(!t)return;const n=`https://www.google.com/s2/favicons?domain=${new URL(t).hostname}&sz=64`;r.bookmarks[r.activeTab]||(r.bookmarks[r.activeTab]=[]),r.bookmarks[r.activeTab].push({title:e,url:t,logo:n}),f()}const m=computed(()=>({position:"relative",width:s.value?"50px":"40px",height:s.value?"50px":"40px",marginBottom:"8px",borderRadius:".4rem",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",fontSize:"1.8rem",color:"light"===l.value?"#555":"#eee",userSelect:"none"}));return t.watch(()=>r.bookmarks,()=>f(),{deep:!0}),(e,n)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",Je,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,e=>(t.openBlock(),t.createElementBlock("div",{key:e,class:"container-tab"},[t.createElementVNode("button",{class:t.normalizeClass(["tab",{active:e===r.activeTab}]),onClick:t=>function(e){r.activeTab=e}(e)},t.toDisplayString(e),11,Qe)]))),128))]),t.createElementVNode("div",Ke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(u),(e,n)=>(t.openBlock(),t.createElementBlock("div",{key:n,class:t.normalizeClass(["card",s.value?"small":""])},[t.createElementVNode("div",Ye,[t.createElementVNode("button",{class:"edit-app",onClick:t.withModifiers(e=>function(e){return d(this,null,function*(){const t=r.bookmarks[r.activeTab][e],n=prompt("Nuevo tΓtulo:",t.title);if(null===n)return;const o=prompt("Nueva URL:",t.url);null!==o&&(t.title=n,t.url=o,t.logo=`https://www.google.com/s2/favicons?domain=${new URL(o).hostname}&sz=64`,f())})}(n),["prevent"])},"βοΈ",8,Ge),t.createElementVNode("button",{class:"delete-app",onClick:t.withModifiers(e=>function(e){return d(this,null,function*(){confirm(`ΒΏEstΓ‘s seguro de eliminar ${r.bookmarks[r.activeTab][e].title}?`)&&(r.bookmarks[r.activeTab].splice(e,1),f())})}(n),["prevent"])},"ποΈ",8,Xe)]),t.createElementVNode("a",{href:"#",class:"card-link",onClick:t.withModifiers(t=>{return n=e.url,void("self"===c.value?window.location.href=n:window.open(n,"_blank"));var n},["prevent"])},[t.createElementVNode("div",tt,[t.createElementVNode("div",{class:"icon-container",style:t.normalizeStyle(t.unref(m)),ref_for:!0,ref:"iconContainers"},[t.createElementVNode("img",{src:e.logo,alt:e.title+" logo",class:t.normalizeClass({small:s.value}),onError:t=>function(e,t){const n=e.target;n.style.display="none";const o=n.parentNode;o.style.backgroundColor="#066D5A",o.textContent=t.charAt(0).toUpperCase()}(t,e.title)},null,42,nt)],4),t.createTextVNode(" "+t.toDisplayString(e.title),1)])],8,et)],2))),128)),t.unref(u).length<8?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["card",s.value?"small":""])},[t.createElementVNode("a",{href:"#",class:"card-link",onClick:t.withModifiers(p,["prevent"])},n[0]||(n[0]=[t.createElementVNode("div",{class:"column"},[t.createElementVNode("span",{class:"add"},"+"),t.createTextVNode(" Add ")],-1)]))],2)):t.createCommentVNode("",!0)])]))}},it=f(rt,[["__scopeId","data-v-5fb970f5"]]),st=t.defineCustomElement(v),lt=t.defineCustomElement(Le),ct=t.defineCustomElement(He),at=t.defineCustomElement(it);customElements.get("z-clock-widget")||customElements.define("z-clock-widget",st),customElements.get("z-search-widget")||customElements.define("z-search-widget",lt),customElements.get("z-todo-widget")||customElements.define("z-todo-widget",ct),customElements.get("z-marked-widget")||customElements.define("z-search-widget",at),e.ZClockWidget=v,e.ZMarkedWidget=it,e.ZSearchWidget=Le,e.ZTodoWidget=He,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
import { defineCustomElement } from 'vue'
|
|
2
2
|
import ZClockWidget from './widgets/z-clock-widget.vue'
|
|
3
3
|
import ZSearchWidget from './widgets/z-search-widget.vue'
|
|
4
|
+
import ZTodoWidget from './widgets/z-todo-widget.vue'
|
|
5
|
+
import ZMarkedWidget from './widgets/z-marked-widget.vue'
|
|
4
6
|
|
|
5
7
|
// Crear el custom element
|
|
6
8
|
const ZClockElement = defineCustomElement(ZClockWidget)
|
|
7
9
|
const ZSearchElement = defineCustomElement(ZSearchWidget)
|
|
10
|
+
const ZTodoElement = defineCustomElement(ZTodoWidget)
|
|
11
|
+
const ZMarkedElement = defineCustomElement(ZMarkedWidget)
|
|
8
12
|
|
|
9
13
|
// Registrar custom element (evitar doble registro)
|
|
10
14
|
if (!customElements.get('z-clock-widget')) {
|
|
11
15
|
customElements.define('z-clock-widget', ZClockElement)
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
// Registrar custom element (evitar doble registro)
|
|
15
18
|
if (!customElements.get('z-search-widget')) {
|
|
16
19
|
customElements.define('z-search-widget', ZSearchElement)
|
|
17
20
|
}
|
|
18
21
|
|
|
22
|
+
if (!customElements.get('z-todo-widget')) {
|
|
23
|
+
customElements.define('z-todo-widget', ZTodoElement)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (!customElements.get('z-marked-widget')) {
|
|
27
|
+
customElements.define('z-search-widget', ZMarkedElement)
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
// Exportar el componente para uso tradicional Vue
|
|
20
|
-
export { ZClockWidget }
|
|
31
|
+
export { ZClockWidget, ZSearchWidget, ZTodoWidget, ZMarkedWidget }
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="tabs">
|
|
4
|
+
<div v-for="tab in categories" :key="tab" class="container-tab">
|
|
5
|
+
<button
|
|
6
|
+
class="tab"
|
|
7
|
+
:class="{ active: tab === state.activeTab }"
|
|
8
|
+
@click="setActiveTab(tab)"
|
|
9
|
+
>
|
|
10
|
+
{{ tab }}
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="grid">
|
|
16
|
+
<div
|
|
17
|
+
v-for="(item, index) in currentBookmarks"
|
|
18
|
+
:key="index"
|
|
19
|
+
:class="['card', small ? 'small' : '']"
|
|
20
|
+
>
|
|
21
|
+
<div class="option-app">
|
|
22
|
+
<button class="edit-app" @click.prevent="editBookmark(index)">βοΈ</button>
|
|
23
|
+
<button class="delete-app" @click.prevent="deleteBookmark(index)">ποΈ</button>
|
|
24
|
+
</div>
|
|
25
|
+
<a href="#" class="card-link" @click.prevent="openLink(item.url)">
|
|
26
|
+
<div class="column">
|
|
27
|
+
<div
|
|
28
|
+
class="icon-container"
|
|
29
|
+
:style="iconContainerStyle"
|
|
30
|
+
ref="iconContainers"
|
|
31
|
+
>
|
|
32
|
+
<img
|
|
33
|
+
:src="item.logo"
|
|
34
|
+
:alt="item.title + ' logo'"
|
|
35
|
+
:class="{ small: small }"
|
|
36
|
+
@error="onImageError($event, item.title)"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
{{ item.title }}
|
|
40
|
+
</div>
|
|
41
|
+
</a>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div v-if="currentBookmarks.length < 8" :class="['card', small ? 'small' : '']">
|
|
45
|
+
<a href="#" class="card-link" @click.prevent="addBookmarkPrompt">
|
|
46
|
+
<div class="column">
|
|
47
|
+
<span class="add">+</span>
|
|
48
|
+
Add
|
|
49
|
+
</div>
|
|
50
|
+
</a>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<script setup>
|
|
57
|
+
import { reactive, ref, watch, onMounted } from 'vue';
|
|
58
|
+
|
|
59
|
+
// Opciones (podrΓan venir como props)
|
|
60
|
+
const props = defineProps({
|
|
61
|
+
theme: { type: String, default: 'light' },
|
|
62
|
+
small: { type: Boolean, default: false },
|
|
63
|
+
categories: { type: Array, default: () => ['Personal', 'Work', 'Study'] },
|
|
64
|
+
open: { type: String, default: 'self' },
|
|
65
|
+
useStorage: { type: Boolean, default: false }
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const STORAGE_KEY = 'bookmark_manager_state';
|
|
69
|
+
|
|
70
|
+
const defaultBookmarks = {
|
|
71
|
+
Personal: [
|
|
72
|
+
{ title: 'Reddit', url: 'https://reddit.com', logo: 'https://www.google.com/s2/favicons?domain=reddit.com&sz=64' },
|
|
73
|
+
{ title: 'Spotify', url: 'https://spotify.com', logo: 'https://www.google.com/s2/favicons?domain=spotify.com&sz=64' },
|
|
74
|
+
{ title: 'Youtube', url: 'https://youtube.com', logo: 'https://www.google.com/s2/favicons?domain=youtube.com&sz=64' },
|
|
75
|
+
{ title: 'Instagram', url: 'https://instagram.com', logo: 'https://www.google.com/s2/favicons?domain=instagram.com&sz=64' },
|
|
76
|
+
{ title: 'Facebook', url: 'https://facebook.com', logo: 'https://www.google.com/s2/favicons?domain=facebook.com&sz=64' },
|
|
77
|
+
{ title: 'WhatsApp', url: 'https://whatsapp.com', logo: 'https://www.google.com/s2/favicons?domain=whatsapp.com&sz=64' },
|
|
78
|
+
{ title: 'Telegram', url: 'https://web.telegram.org/', logo: 'https://www.google.com/s2/favicons?domain=web.telegram.org&sz=64' },
|
|
79
|
+
{ title: 'Spotify', url: 'https://spotify.com', logo: 'https://www.google.com/s2/favicons?domain=spotify.com&sz=64' }
|
|
80
|
+
],
|
|
81
|
+
Work: [
|
|
82
|
+
{ title: 'GitHub', url: 'https://github.com', logo: 'https://www.google.com/s2/favicons?domain=github.com&sz=64' },
|
|
83
|
+
{ title: 'Notion', url: 'https://notion.so', logo: 'https://www.google.com/s2/favicons?domain=notion.so&sz=64' }
|
|
84
|
+
],
|
|
85
|
+
Study: [
|
|
86
|
+
{ title: 'MDN Web Docs', url: 'https://developer.mozilla.org', logo: 'https://www.google.com/s2/favicons?domain=mozilla.org&sz=64' },
|
|
87
|
+
{ title: 'FreeCodeCamp', url: 'https://freecodecamp.org', logo: 'https://www.google.com/s2/favicons?domain=freecodecamp.org&sz=64' }
|
|
88
|
+
]
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const state = reactive({
|
|
92
|
+
bookmarks: props.useStorage
|
|
93
|
+
? JSON.parse(localStorage.getItem(STORAGE_KEY)) || defaultBookmarks
|
|
94
|
+
: defaultBookmarks,
|
|
95
|
+
activeTab: 'Personal'
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const categories = ref([...props.categories]);
|
|
99
|
+
const small = ref(props.small);
|
|
100
|
+
const theme = ref(props.theme);
|
|
101
|
+
const open = ref(props.open);
|
|
102
|
+
const useStorage = ref(props.useStorage);
|
|
103
|
+
|
|
104
|
+
const currentBookmarks = computed(() => state.bookmarks[state.activeTab] || []);
|
|
105
|
+
|
|
106
|
+
function saveState() {
|
|
107
|
+
if (useStorage.value) {
|
|
108
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(state.bookmarks));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function setActiveTab(tab) {
|
|
113
|
+
state.activeTab = tab;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function openLink(url) {
|
|
117
|
+
if (open.value === 'self') {
|
|
118
|
+
window.location.href = url;
|
|
119
|
+
} else {
|
|
120
|
+
window.open(url, '_blank');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async function deleteBookmark(index) {
|
|
125
|
+
if (confirm(`ΒΏEstΓ‘s seguro de eliminar ${state.bookmarks[state.activeTab][index].title}?`)) {
|
|
126
|
+
state.bookmarks[state.activeTab].splice(index, 1);
|
|
127
|
+
saveState();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async function editBookmark(index) {
|
|
132
|
+
const item = state.bookmarks[state.activeTab][index];
|
|
133
|
+
const newTitle = prompt('Nuevo tΓtulo:', item.title);
|
|
134
|
+
if (newTitle === null) return;
|
|
135
|
+
const newUrl = prompt('Nueva URL:', item.url);
|
|
136
|
+
if (newUrl === null) return;
|
|
137
|
+
item.title = newTitle;
|
|
138
|
+
item.url = newUrl;
|
|
139
|
+
item.logo = `https://www.google.com/s2/favicons?domain=${new URL(newUrl).hostname}&sz=64`;
|
|
140
|
+
saveState();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function addBookmarkPrompt() {
|
|
144
|
+
const title = prompt('Nombre del marcador:');
|
|
145
|
+
if (!title) return;
|
|
146
|
+
const url = prompt('URL del marcador:');
|
|
147
|
+
if (!url) return;
|
|
148
|
+
const logo = `https://www.google.com/s2/favicons?domain=${new URL(url).hostname}&sz=64`;
|
|
149
|
+
if (!state.bookmarks[state.activeTab]) {
|
|
150
|
+
state.bookmarks[state.activeTab] = [];
|
|
151
|
+
}
|
|
152
|
+
state.bookmarks[state.activeTab].push({ title, url, logo });
|
|
153
|
+
saveState();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function onImageError(event, title) {
|
|
157
|
+
const img = event.target;
|
|
158
|
+
img.style.display = 'none';
|
|
159
|
+
const iconContainer = img.parentNode;
|
|
160
|
+
iconContainer.style.backgroundColor = '#066D5A';
|
|
161
|
+
iconContainer.textContent = title.charAt(0).toUpperCase();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Estilos dinΓ‘micos en JS para iconContainer, podrΓan pasarse como clase tambiΓ©n
|
|
165
|
+
const iconContainerStyle = computed(() => ({
|
|
166
|
+
position: 'relative',
|
|
167
|
+
width: small.value ? '50px' : '40px',
|
|
168
|
+
height: small.value ? '50px' : '40px',
|
|
169
|
+
marginBottom: '8px',
|
|
170
|
+
borderRadius: '.4rem',
|
|
171
|
+
display: 'flex',
|
|
172
|
+
alignItems: 'center',
|
|
173
|
+
justifyContent: 'center',
|
|
174
|
+
fontWeight: 'bold',
|
|
175
|
+
fontSize: '1.8rem',
|
|
176
|
+
color: theme.value === 'light' ? '#555' : '#eee',
|
|
177
|
+
userSelect: 'none'
|
|
178
|
+
}));
|
|
179
|
+
|
|
180
|
+
// Guardar en localStorage si cambia bookmarks
|
|
181
|
+
watch(() => state.bookmarks, () => saveState(), { deep: true });
|
|
182
|
+
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<style scoped>
|
|
186
|
+
.tabs {
|
|
187
|
+
width: auto;
|
|
188
|
+
display: flex;
|
|
189
|
+
gap: 10px;
|
|
190
|
+
margin-bottom: 20px;
|
|
191
|
+
flex-wrap: wrap;
|
|
192
|
+
background: rgba(220, 220, 220, 0.4);
|
|
193
|
+
padding: 0.2rem;
|
|
194
|
+
border-radius: 0.6rem;
|
|
195
|
+
align-self: start;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.container-tab {
|
|
199
|
+
position: relative;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.tab {
|
|
203
|
+
padding: 8px 2rem;
|
|
204
|
+
border: none;
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
transition: 0.3s;
|
|
207
|
+
font-weight: 600;
|
|
208
|
+
background-color: transparent;
|
|
209
|
+
color: #444444;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.tab.active {
|
|
213
|
+
background-color: #066D5A;
|
|
214
|
+
color: white;
|
|
215
|
+
border-radius: 0.5rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.grid {
|
|
219
|
+
display: flex;
|
|
220
|
+
flex-wrap: wrap;
|
|
221
|
+
gap: 1.4rem;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.card {
|
|
225
|
+
position: relative;
|
|
226
|
+
flex: 1 1 100px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.card.small {
|
|
230
|
+
flex: 1 1 25%;
|
|
231
|
+
min-width: 140px;
|
|
232
|
+
max-width: 170px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.card-link {
|
|
236
|
+
height: 106px;
|
|
237
|
+
padding: 16px;
|
|
238
|
+
border-radius: 1rem;
|
|
239
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
240
|
+
background-color: rgba(200, 200, 200, 0.3);
|
|
241
|
+
backdrop-filter: blur(0.2rem);
|
|
242
|
+
text-align: center;
|
|
243
|
+
cursor: pointer;
|
|
244
|
+
text-decoration: none;
|
|
245
|
+
color: #202020;
|
|
246
|
+
display: flex;
|
|
247
|
+
justify-content: center;
|
|
248
|
+
flex-direction: column;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.option-app {
|
|
252
|
+
display: none;
|
|
253
|
+
position: absolute;
|
|
254
|
+
top: 10px;
|
|
255
|
+
right: 10px;
|
|
256
|
+
z-index: 2;
|
|
257
|
+
gap: 0.4rem;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.card:hover .option-app {
|
|
261
|
+
display: flex;
|
|
262
|
+
justify-content: center;
|
|
263
|
+
align-items: center;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.delete-app,
|
|
267
|
+
.edit-app {
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
border-radius: 0.2rem;
|
|
270
|
+
width: 23px;
|
|
271
|
+
height: 23px;
|
|
272
|
+
border: none;
|
|
273
|
+
font-size: 0.8rem;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.edit-app {
|
|
277
|
+
font-size: 1rem;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.card-link img {
|
|
281
|
+
width: 100%;
|
|
282
|
+
max-width: 40px;
|
|
283
|
+
border-radius: 0.4rem;
|
|
284
|
+
margin-bottom: 8px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.card-link img.small {
|
|
288
|
+
max-width: 50px;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.column {
|
|
292
|
+
display: flex;
|
|
293
|
+
flex-direction: column;
|
|
294
|
+
align-items: center;
|
|
295
|
+
gap: 5px;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.add {
|
|
299
|
+
width: 50px;
|
|
300
|
+
height: 50px;
|
|
301
|
+
background: gray;
|
|
302
|
+
border-radius: 0.5rem;
|
|
303
|
+
display: flex;
|
|
304
|
+
justify-content: center;
|
|
305
|
+
font-size: 2rem;
|
|
306
|
+
line-height: 50px;
|
|
307
|
+
color: white;
|
|
308
|
+
user-select: none;
|
|
309
|
+
}
|
|
310
|
+
</style>
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="todo-widget">
|
|
3
|
+
<h2 class="title">π Mis Tareas</h2>
|
|
4
|
+
|
|
5
|
+
<form @submit.prevent="addTask" class="todo-form">
|
|
6
|
+
<input v-model="newTask" type="text" placeholder="Escribe una nueva tarea..." />
|
|
7
|
+
<button type="submit">Agregar</button>
|
|
8
|
+
</form>
|
|
9
|
+
|
|
10
|
+
<div class="task-section">
|
|
11
|
+
<h3>Tareas Pendientes</h3>
|
|
12
|
+
<div v-if="pendingTasks.length === 0" class="empty">Sin tareas.</div>
|
|
13
|
+
<ul>
|
|
14
|
+
<li v-for="(task, index) in pendingTasks" :key="index">
|
|
15
|
+
<span>{{ task.text }}</span>
|
|
16
|
+
<div class="actions">
|
|
17
|
+
<button @click="completeTask(index)">βοΈ</button>
|
|
18
|
+
<button @click="deleteTask(index)">ποΈ</button>
|
|
19
|
+
</div>
|
|
20
|
+
</li>
|
|
21
|
+
</ul>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="task-section completed">
|
|
25
|
+
<h3>Completadas</h3>
|
|
26
|
+
<div v-if="completedTasks.length === 0" class="empty">Ninguna aΓΊn.</div>
|
|
27
|
+
<ul>
|
|
28
|
+
<li v-for="(task, index) in completedTasks" :key="'c' + index">
|
|
29
|
+
<span class="done">{{ task.text }}</span>
|
|
30
|
+
<button @click="deleteCompleted(index)">β</button>
|
|
31
|
+
</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
export default {
|
|
39
|
+
name: 'TodoWidget',
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
newTask: '',
|
|
43
|
+
pendingTasks: [],
|
|
44
|
+
completedTasks: []
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
addTask() {
|
|
49
|
+
if (this.newTask.trim()) {
|
|
50
|
+
this.pendingTasks.push({ text: this.newTask.trim() })
|
|
51
|
+
this.newTask = ''
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
completeTask(index) {
|
|
55
|
+
const task = this.pendingTasks.splice(index, 1)[0]
|
|
56
|
+
this.completedTasks.push(task)
|
|
57
|
+
},
|
|
58
|
+
deleteTask(index) {
|
|
59
|
+
this.pendingTasks.splice(index, 1)
|
|
60
|
+
},
|
|
61
|
+
deleteCompleted(index) {
|
|
62
|
+
this.completedTasks.splice(index, 1)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style scoped>
|
|
69
|
+
.todo-widget {
|
|
70
|
+
width: 100%;
|
|
71
|
+
background-color: rgba(20, 20, 20, .4);
|
|
72
|
+
backdrop-filter: blur(.2rem);
|
|
73
|
+
border-radius: 16px;
|
|
74
|
+
padding: 20px;
|
|
75
|
+
color: #fff;
|
|
76
|
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
|
|
77
|
+
max-width: 500px;
|
|
78
|
+
margin: 0 auto;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.title {
|
|
82
|
+
margin-bottom: 16px;
|
|
83
|
+
text-align: center;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.todo-form {
|
|
87
|
+
display: flex;
|
|
88
|
+
gap: 10px;
|
|
89
|
+
margin-bottom: 20px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.todo-form input {
|
|
93
|
+
flex: 1;
|
|
94
|
+
padding: 10px 12px;
|
|
95
|
+
border: none;
|
|
96
|
+
border-radius: 8px;
|
|
97
|
+
background-color: #2a2a2a;
|
|
98
|
+
color: white;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.todo-form button {
|
|
102
|
+
background-color: #007bff;
|
|
103
|
+
color: white;
|
|
104
|
+
border: none;
|
|
105
|
+
border-radius: 8px;
|
|
106
|
+
padding: 10px 16px;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.task-section {
|
|
111
|
+
margin-bottom: 20px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.task-section h3 {
|
|
115
|
+
margin-bottom: 8px;
|
|
116
|
+
font-size: 1rem;
|
|
117
|
+
color: #ccc;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.task-section ul {
|
|
121
|
+
list-style: none;
|
|
122
|
+
padding: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.task-section li {
|
|
126
|
+
background-color: #292929;
|
|
127
|
+
padding: 10px 12px;
|
|
128
|
+
border-radius: 10px;
|
|
129
|
+
margin-bottom: 8px;
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
align-items: center;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.actions button {
|
|
136
|
+
margin-left: 8px;
|
|
137
|
+
background: none;
|
|
138
|
+
border: none;
|
|
139
|
+
color: #bbb;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
font-size: 1rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.actions button:hover {
|
|
145
|
+
color: white;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.empty {
|
|
149
|
+
font-size: 0.9rem;
|
|
150
|
+
color: #666;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.done {
|
|
154
|
+
text-decoration: line-through;
|
|
155
|
+
color: #777;
|
|
156
|
+
}
|
|
157
|
+
</style>
|