Update dependencies and switch to @sveltejs/adapter-node for SvelteKit project
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
var _layout_ts = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null
|
||||
});
|
||||
|
||||
const index = 0;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_layout.svelte-Ectc0goa.js')).default;
|
||||
const universal_id = "src/routes/+layout.ts";
|
||||
const imports = ["_app/immutable/nodes/0.BWGINVoR.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/BrBXfa46.js","_app/immutable/chunks/m2dceAnU.js"];
|
||||
const stylesheets = ["_app/immutable/assets/0.C7J2EIJ7.css"];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, stylesheets, _layout_ts as universal, universal_id };
|
||||
//# sourceMappingURL=0-BIaOo9PC.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"0-BIaOo9PC.js","sources":["../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["import * as universal from '../entries/pages/_layout.ts.js';\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport { universal };\nexport const universal_id = \"src/routes/+layout.ts\";\nexport const imports = [\"_app/immutable/nodes/0.BWGINVoR.js\",\"_app/immutable/chunks/Bzak7iHL.js\",\"_app/immutable/chunks/BrBXfa46.js\",\"_app/immutable/chunks/m2dceAnU.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.C7J2EIJ7.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE;AAElG,MAAC,YAAY,GAAG;AAChB,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAC5J,MAAC,WAAW,GAAG,CAAC,sCAAsC;AACtD,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -0,0 +1,9 @@
|
||||
const index = 1;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./error.svelte-RymJGne7.js')).default;
|
||||
const imports = ["_app/immutable/nodes/1.BwpnmtAp.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/BrBXfa46.js","_app/immutable/chunks/m2dceAnU.js","_app/immutable/chunks/Db3dOJqt.js","_app/immutable/chunks/DKU_2deH.js","_app/immutable/chunks/D6EhJnz8.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, stylesheets };
|
||||
//# sourceMappingURL=1-BGPacjVk.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"1-BGPacjVk.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.BwpnmtAp.js\",\"_app/immutable/chunks/Bzak7iHL.js\",\"_app/immutable/chunks/BrBXfa46.js\",\"_app/immutable/chunks/m2dceAnU.js\",\"_app/immutable/chunks/Db3dOJqt.js\",\"_app/immutable/chunks/DKU_2deH.js\",\"_app/immutable/chunks/D6EhJnz8.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE;AACpG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AACxQ,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -0,0 +1,9 @@
|
||||
const index = 2;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-C3pCwICc.js')).default;
|
||||
const imports = ["_app/immutable/nodes/2.W3CLiCpj.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/BrBXfa46.js","_app/immutable/chunks/m2dceAnU.js","_app/immutable/chunks/D4Z6sX8n.js","_app/immutable/chunks/BtiMKAzw.js","_app/immutable/chunks/DcegSV8N.js","_app/immutable/chunks/DKU_2deH.js","_app/immutable/chunks/CvosxF64.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, stylesheets };
|
||||
//# sourceMappingURL=2-AuNPQJ-v.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"2-AuNPQJ-v.js","sources":["../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/2.W3CLiCpj.js\",\"_app/immutable/chunks/Bzak7iHL.js\",\"_app/immutable/chunks/BrBXfa46.js\",\"_app/immutable/chunks/m2dceAnU.js\",\"_app/immutable/chunks/D4Z6sX8n.js\",\"_app/immutable/chunks/BtiMKAzw.js\",\"_app/immutable/chunks/DcegSV8N.js\",\"_app/immutable/chunks/DKU_2deH.js\",\"_app/immutable/chunks/CvosxF64.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAkC,CAAC,EAAE;AAChG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAChV,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { r as redirect } from './index-B2LGyy1l.js';
|
||||
|
||||
const load = ({ locals }) => {
|
||||
locals.pb.authStore.clear();
|
||||
throw redirect(303, "/login");
|
||||
};
|
||||
|
||||
var _page_server_ts = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 3;
|
||||
const server_id = "src/routes/logout/+page.server.ts";
|
||||
const imports = [];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=3-DEGBOxIZ.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"3-DEGBOxIZ.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/logout/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["import { redirect } from \"@sveltejs/kit\";\nconst load = ({ locals }) => {\n locals.pb.authStore.clear();\n throw redirect(303, \"/login\");\n};\nexport {\n load\n};\n","import * as server from '../entries/pages/logout/_page.server.ts.js';\n\nexport const index = 3;\nexport { server };\nexport const server_id = \"src/routes/logout/+page.server.ts\";\nexport const imports = [];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;AACA,MAAM,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK;AAC7B,EAAE,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE;AAC7B,EAAE,MAAM,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;AAC/B,CAAC;;;;;;;ACFW,MAAC,KAAK,GAAG;AAET,MAAC,SAAS,GAAG;AACb,MAAC,OAAO,GAAG;AACX,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -0,0 +1,123 @@
|
||||
import { f as fail } from './index-B2LGyy1l.js';
|
||||
|
||||
const COLLECTION = "Stackq_Items";
|
||||
function parseNum(val) {
|
||||
if (val === "" || val === null || val === void 0) return void 0;
|
||||
const n = Number(val);
|
||||
return Number.isFinite(n) ? n : void 0;
|
||||
}
|
||||
function parseBool(val) {
|
||||
return val === "on" || val === "true" || val === true;
|
||||
}
|
||||
const load = async ({ locals }) => {
|
||||
const list = await locals.pb.collection(COLLECTION).getFullList({
|
||||
sort: "-created",
|
||||
expand: "Parent"
|
||||
}).catch((err) => {
|
||||
console.error(COLLECTION, err);
|
||||
return [];
|
||||
});
|
||||
const itemsForParent = list.map((i) => ({ id: i.id, Item: i.Item, SKU: i.SKU }));
|
||||
return { items: list, itemsForParent };
|
||||
};
|
||||
const actions = {
|
||||
create: async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
const Item = form.get("Item")?.trim() ?? "";
|
||||
const SKU = form.get("SKU")?.trim() ?? "";
|
||||
const Description = form.get("Description")?.trim() ?? "";
|
||||
const UOM = form.get("UOM")?.trim() ?? "";
|
||||
const Cost = parseNum(form.get("Cost"));
|
||||
const Vendor = form.get("Vendor")?.trim() ?? "";
|
||||
const Catagory = form.get("Catagory")?.trim() ?? "";
|
||||
const Sub_Catagory = form.get("Sub_Catagory")?.trim() ?? "";
|
||||
const Has_Parent = parseBool(form.get("Has_Parent"));
|
||||
const Parent = form.get("Parent")?.trim() ?? "";
|
||||
const Stock = parseBool(form.get("Stock"));
|
||||
if (!Item) return fail(400, { error: "Item name is required", form: "create" });
|
||||
try {
|
||||
await locals.pb.collection(COLLECTION).create({
|
||||
Item,
|
||||
SKU,
|
||||
Description,
|
||||
UOM: UOM || void 0,
|
||||
Cost: Cost ?? 0,
|
||||
Vendor,
|
||||
Catagory: Catagory || void 0,
|
||||
Sub_Catagory: Sub_Catagory || void 0,
|
||||
Has_Parent: !!Has_Parent,
|
||||
Parent: Parent || null,
|
||||
Stock: !!Stock
|
||||
});
|
||||
} catch (e) {
|
||||
const message = e && typeof e === "object" && "message" in e ? String(e.message) : "Create failed";
|
||||
return fail(500, { error: message, form: "create" });
|
||||
}
|
||||
return { success: true };
|
||||
},
|
||||
update: async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
const id = form.get("id")?.trim();
|
||||
if (!id) return fail(400, { error: "Missing id", form: "update" });
|
||||
const Item = form.get("Item")?.trim() ?? "";
|
||||
const SKU = form.get("SKU")?.trim() ?? "";
|
||||
const Description = form.get("Description")?.trim() ?? "";
|
||||
const UOM = form.get("UOM")?.trim() ?? "";
|
||||
const Cost = parseNum(form.get("Cost"));
|
||||
const Vendor = form.get("Vendor")?.trim() ?? "";
|
||||
const Catagory = form.get("Catagory")?.trim() ?? "";
|
||||
const Sub_Catagory = form.get("Sub_Catagory")?.trim() ?? "";
|
||||
const Has_Parent = parseBool(form.get("Has_Parent"));
|
||||
const Parent = form.get("Parent")?.trim() ?? "";
|
||||
const Stock = parseBool(form.get("Stock"));
|
||||
if (!Item) return fail(400, { error: "Item name is required", form: "update" });
|
||||
try {
|
||||
await locals.pb.collection(COLLECTION).update(id, {
|
||||
Item,
|
||||
SKU,
|
||||
Description,
|
||||
UOM: UOM || void 0,
|
||||
Cost: Cost ?? 0,
|
||||
Vendor,
|
||||
Catagory: Catagory || void 0,
|
||||
Sub_Catagory: Sub_Catagory || void 0,
|
||||
Has_Parent: !!Has_Parent,
|
||||
Parent: Parent || null,
|
||||
Stock: !!Stock
|
||||
});
|
||||
} catch (e) {
|
||||
const message = e && typeof e === "object" && "message" in e ? String(e.message) : "Update failed";
|
||||
return fail(500, { error: message, form: "update" });
|
||||
}
|
||||
return { success: true };
|
||||
},
|
||||
delete: async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
const id = form.get("id")?.trim();
|
||||
if (!id) return fail(400, { error: "Missing id", form: "delete" });
|
||||
try {
|
||||
await locals.pb.collection(COLLECTION).delete(id);
|
||||
} catch (e) {
|
||||
const message = e && typeof e === "object" && "message" in e ? String(e.message) : "Delete failed";
|
||||
return fail(500, { error: message, form: "delete" });
|
||||
}
|
||||
return { success: true };
|
||||
}
|
||||
};
|
||||
|
||||
var _page_server_ts = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
actions: actions,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 4;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-BSzWqLxF.js')).default;
|
||||
const server_id = "src/routes/items/+page.server.ts";
|
||||
const imports = ["_app/immutable/nodes/4.DSwQNsv9.js","_app/immutable/chunks/D0oS5fvi.js","_app/immutable/chunks/CS4xyx6M.js","_app/immutable/chunks/m2dceAnU.js","_app/immutable/chunks/DcegSV8N.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/BMcrRaS1.js","_app/immutable/chunks/BtiMKAzw.js","_app/immutable/chunks/DKU_2deH.js","_app/immutable/chunks/CvosxF64.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=4-TkpNwhRF.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,48 @@
|
||||
import { f as fail, r as redirect } from './index-B2LGyy1l.js';
|
||||
|
||||
function safeRedirectTo(searchParams) {
|
||||
const to = searchParams.get("redirectTo");
|
||||
if (!to || typeof to !== "string") return "/";
|
||||
if (!to.startsWith("/") || to.startsWith("//")) return "/";
|
||||
return to;
|
||||
}
|
||||
const load = ({ url, locals }) => {
|
||||
if (locals.user) {
|
||||
throw redirect(303, safeRedirectTo(url.searchParams));
|
||||
}
|
||||
};
|
||||
const actions = {
|
||||
login: async ({ request, locals, url }) => {
|
||||
const data = await request.formData();
|
||||
const email = data.get("email")?.trim() ?? "";
|
||||
const password = data.get("password") ?? "";
|
||||
if (!email || !password) {
|
||||
return fail(400, { error: "Email and password are required.", email });
|
||||
}
|
||||
try {
|
||||
await locals.pb.collection("users").authWithPassword(email, password);
|
||||
} catch (err) {
|
||||
const message = err && typeof err === "object" && "message" in err ? String(err.message) : "Invalid email or password.";
|
||||
return fail(401, { error: message, email });
|
||||
}
|
||||
const redirectTo = safeRedirectTo(url.searchParams);
|
||||
throw redirect(303, redirectTo);
|
||||
}
|
||||
};
|
||||
|
||||
var _page_server_ts = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
actions: actions,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 5;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-3rk2vnq3.js')).default;
|
||||
const server_id = "src/routes/login/+page.server.ts";
|
||||
const imports = ["_app/immutable/nodes/5.Y48nEW8J.js","_app/immutable/chunks/CS4xyx6M.js","_app/immutable/chunks/m2dceAnU.js","_app/immutable/chunks/DcegSV8N.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/BMcrRaS1.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=5-B5o-1cPT.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"5-B5o-1cPT.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/login/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/5.js"],"sourcesContent":["import { fail, redirect } from \"@sveltejs/kit\";\nfunction safeRedirectTo(searchParams) {\n const to = searchParams.get(\"redirectTo\");\n if (!to || typeof to !== \"string\") return \"/\";\n if (!to.startsWith(\"/\") || to.startsWith(\"//\")) return \"/\";\n return to;\n}\nconst load = ({ url, locals }) => {\n if (locals.user) {\n throw redirect(303, safeRedirectTo(url.searchParams));\n }\n};\nconst actions = {\n login: async ({ request, locals, url }) => {\n const data = await request.formData();\n const email = data.get(\"email\")?.trim() ?? \"\";\n const password = data.get(\"password\") ?? \"\";\n if (!email || !password) {\n return fail(400, { error: \"Email and password are required.\", email });\n }\n try {\n await locals.pb.collection(\"users\").authWithPassword(email, password);\n } catch (err) {\n const message = err && typeof err === \"object\" && \"message\" in err ? String(err.message) : \"Invalid email or password.\";\n return fail(401, { error: message, email });\n }\n const redirectTo = safeRedirectTo(url.searchParams);\n throw redirect(303, redirectTo);\n }\n};\nexport {\n actions,\n load\n};\n","import * as server from '../entries/pages/login/_page.server.ts.js';\n\nexport const index = 5;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/login/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/login/+page.server.ts\";\nexport const imports = [\"_app/immutable/nodes/5.Y48nEW8J.js\",\"_app/immutable/chunks/CS4xyx6M.js\",\"_app/immutable/chunks/m2dceAnU.js\",\"_app/immutable/chunks/DcegSV8N.js\",\"_app/immutable/chunks/Bzak7iHL.js\",\"_app/immutable/chunks/BMcrRaS1.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;AACA,SAAS,cAAc,CAAC,YAAY,EAAE;AACtC,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC;AAC3C,EAAE,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,OAAO,GAAG;AAC/C,EAAE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG;AAC5D,EAAE,OAAO,EAAE;AACX;AACA,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK;AAClC,EAAE,IAAI,MAAM,CAAC,IAAI,EAAE;AACnB,IAAI,MAAM,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AACzD,EAAE;AACF,CAAC;AACD,MAAM,OAAO,GAAG;AAChB,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK;AAC7C,IAAI,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE;AACzC,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE;AACjD,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE;AAC/C,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE;AAC7B,MAAM,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,kCAAkC,EAAE,KAAK,EAAE,CAAC;AAC5E,IAAI;AACJ,IAAI,IAAI;AACR,MAAM,MAAM,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC3E,IAAI,CAAC,CAAC,OAAO,GAAG,EAAE;AAClB,MAAM,MAAM,OAAO,GAAG,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,SAAS,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,4BAA4B;AAC7H,MAAM,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjD,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC;AACvD,IAAI,MAAM,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;AACnC,EAAE;AACF,CAAC;;;;;;;;AC3BW,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAwC,CAAC,EAAE;AAEtG,MAAC,SAAS,GAAG;AACb,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AACpO,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { c as slot } from './index-Cd32JeF5.js';
|
||||
import 'clsx';
|
||||
|
||||
function _layout($$renderer, $$props) {
|
||||
$$renderer.push(`<!--[-->`);
|
||||
slot($$renderer, $$props, "default", {});
|
||||
$$renderer.push(`<!--]-->`);
|
||||
}
|
||||
|
||||
export { _layout as default };
|
||||
//# sourceMappingURL=_layout.svelte-Ectc0goa.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_layout.svelte-Ectc0goa.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.svelte.js"],"sourcesContent":["import { s as slot } from \"../../chunks/index.js\";\nfunction _layout($$renderer, $$props) {\n $$renderer.push(`<!--[-->`);\n slot($$renderer, $$props, \"default\", {});\n $$renderer.push(`<!--]-->`);\n}\nexport {\n _layout as default\n};\n"],"names":[],"mappings":";;;AACA,SAAS,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE;AACtC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC7B,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC;AAC1C,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC7B;;;;"}
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'clsx';
|
||||
|
||||
function _page($$renderer, $$props) {
|
||||
let { data } = $$props;
|
||||
$$renderer.push(`<main class="flex min-h-screen flex-col items-center justify-center p-4">`);
|
||||
{
|
||||
$$renderer.push("<!--[!-->");
|
||||
$$renderer.push(`<div class="w-full max-w-sm space-y-4 rounded-xl border bg-card p-6 shadow-sm"><div class="space-y-1"><h1 class="text-lg font-semibold">Login</h1> <p class="text-muted-foreground text-sm">Enter your email and password to sign in.</p></div> <p class="text-muted-foreground text-sm">Loading form…</p></div>`);
|
||||
}
|
||||
$$renderer.push(`<!--]--></main>`);
|
||||
}
|
||||
|
||||
export { _page as default };
|
||||
//# sourceMappingURL=_page.svelte-3rk2vnq3.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_page.svelte-3rk2vnq3.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/login/_page.svelte.js"],"sourcesContent":["import \"clsx\";\nfunction _page($$renderer, $$props) {\n let { data } = $$props;\n $$renderer.push(`<main class=\"flex min-h-screen flex-col items-center justify-center p-4\">`);\n {\n $$renderer.push(\"<!--[!-->\");\n $$renderer.push(`<div class=\"w-full max-w-sm space-y-4 rounded-xl border bg-card p-6 shadow-sm\"><div class=\"space-y-1\"><h1 class=\"text-lg font-semibold\">Login</h1> <p class=\"text-muted-foreground text-sm\">Enter your email and password to sign in.</p></div> <p class=\"text-muted-foreground text-sm\">Loading form…</p></div>`);\n }\n $$renderer.push(`<!--]--></main>`);\n}\nexport {\n _page as default\n};\n"],"names":[],"mappings":";;AACA,SAAS,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE;AACpC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;AACxB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,yEAAyE,CAAC,CAAC;AAC9F,EAAE;AACF,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;AAChC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,gTAAgT,CAAC,CAAC;AACvU,EAAE;AACF,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,CAAC;AACpC;;;;"}
|
||||
@@ -0,0 +1,671 @@
|
||||
import { a9 as head, d as escape_html, a6 as attributes, a7 as clsx, a8 as bind_props, aa as ensure_array_like, ab as element } from './index-Cd32JeF5.js';
|
||||
import { c as cn, t as tv } from './index-DWasNFG9.js';
|
||||
import 'clsx';
|
||||
import 'tailwind-merge';
|
||||
|
||||
function Table($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<div data-slot="table-container" class="relative w-full overflow-x-auto"><table${attributes({
|
||||
"data-slot": "table",
|
||||
class: clsx(cn("w-full caption-bottom text-sm", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></table></div>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_body($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<tbody${attributes({
|
||||
"data-slot": "table-body",
|
||||
class: clsx(cn("[&_tr:last-child]:border-0", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></tbody>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_cell($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<td${attributes({
|
||||
"data-slot": "table-cell",
|
||||
class: clsx(cn("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></td>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_head($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<th${attributes({
|
||||
"data-slot": "table-head",
|
||||
class: clsx(cn("text-foreground h-10 bg-clip-padding px-2 text-start align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pe-0", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></th>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_header($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<thead${attributes({
|
||||
"data-slot": "table-header",
|
||||
class: clsx(cn("[&_tr]:border-b", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></thead>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_row($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<tr${attributes({
|
||||
"data-slot": "table-row",
|
||||
class: clsx(cn("hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></tr>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
const badgeVariants = tv({
|
||||
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",
|
||||
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",
|
||||
destructive: "bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70 border-transparent text-white",
|
||||
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
||||
}
|
||||
},
|
||||
defaultVariants: { variant: "default" }
|
||||
});
|
||||
function Badge($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
href,
|
||||
class: className,
|
||||
variant = "default",
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
element(
|
||||
$$renderer2,
|
||||
href ? "a" : "span",
|
||||
() => {
|
||||
$$renderer2.push(`${attributes({
|
||||
"data-slot": "badge",
|
||||
href,
|
||||
class: clsx(cn(badgeVariants({ variant }), className)),
|
||||
...restProps
|
||||
})}`);
|
||||
},
|
||||
() => {
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!---->`);
|
||||
}
|
||||
);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Card($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<div${attributes({
|
||||
"data-slot": "card",
|
||||
class: clsx(cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></div>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Card_content($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<div${attributes({
|
||||
"data-slot": "card-content",
|
||||
class: clsx(cn("px-6", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></div>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Card_header($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<div${attributes({
|
||||
"data-slot": "card-header",
|
||||
class: clsx(cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></div>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Card_title($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<div${attributes({
|
||||
"data-slot": "card-title",
|
||||
class: clsx(cn("leading-none font-semibold", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></div>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function _page($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let { data } = $$props;
|
||||
function asList(val) {
|
||||
if (val == null) return [];
|
||||
return Array.isArray(val) ? val : [val];
|
||||
}
|
||||
function formatDate(iso) {
|
||||
if (!iso) return "—";
|
||||
try {
|
||||
return new Date(iso).toLocaleDateString(void 0, { dateStyle: "short", timeStyle: "short" });
|
||||
} catch {
|
||||
return iso;
|
||||
}
|
||||
}
|
||||
const items = data?.items ?? [];
|
||||
head("rk8na7", $$renderer2, ($$renderer3) => {
|
||||
$$renderer3.title(($$renderer4) => {
|
||||
$$renderer4.push(`<title>Items – Stackq</title>`);
|
||||
});
|
||||
});
|
||||
{
|
||||
$$renderer2.push("<!--[!-->");
|
||||
$$renderer2.push(`<main class="container mx-auto flex flex-col gap-6 py-8"><div class="flex items-center justify-between"><h1 class="text-2xl font-semibold">Stackq Items</h1> <span class="text-muted-foreground text-sm">${escape_html(items.length)} items</span></div> `);
|
||||
Card($$renderer2, {
|
||||
children: ($$renderer3) => {
|
||||
Card_header($$renderer3, {
|
||||
children: ($$renderer4) => {
|
||||
Card_title($$renderer4, {
|
||||
children: ($$renderer5) => {
|
||||
$$renderer5.push(`<!---->Stackq_Items`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer4.push(`<!----> <p class="text-muted-foreground text-sm">PocketBase collection. Enable JS for create/edit/delete.</p>`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer3.push(`<!----> `);
|
||||
Card_content($$renderer3, {
|
||||
class: "p-0",
|
||||
children: ($$renderer4) => {
|
||||
$$renderer4.push("<!---->");
|
||||
Table?.($$renderer4, {
|
||||
children: ($$renderer5) => {
|
||||
$$renderer5.push("<!---->");
|
||||
Table_header?.($$renderer5, {
|
||||
children: ($$renderer6) => {
|
||||
$$renderer6.push("<!---->");
|
||||
Table_row?.($$renderer6, {
|
||||
children: ($$renderer7) => {
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Item`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->SKU`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
class: "max-w-[200px]",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Description`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->UOM`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
class: "text-right",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Cost`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Vendor`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Catagory`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Sub_Catagory`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Has Parent`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Parent`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Stock`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
class: "text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->created`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
class: "text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->updated`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer6.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer5.push(`<!----> `);
|
||||
$$renderer5.push("<!---->");
|
||||
Table_body?.($$renderer5, {
|
||||
children: ($$renderer6) => {
|
||||
if (items.length === 0) {
|
||||
$$renderer6.push("<!--[-->");
|
||||
$$renderer6.push("<!---->");
|
||||
Table_row?.($$renderer6, {
|
||||
children: ($$renderer7) => {
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
colspan: "13",
|
||||
class: "h-24 text-center text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->No items.`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer6.push(`<!---->`);
|
||||
} else {
|
||||
$$renderer6.push("<!--[!-->");
|
||||
$$renderer6.push(`<!--[-->`);
|
||||
const each_array = ensure_array_like(items);
|
||||
for (let $$index_2 = 0, $$length = each_array.length; $$index_2 < $$length; $$index_2++) {
|
||||
let item = each_array[$$index_2];
|
||||
$$renderer6.push("<!---->");
|
||||
Table_row?.($$renderer6, {
|
||||
children: ($$renderer7) => {
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "font-medium",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.Item ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "font-mono text-xs",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.SKU ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "max-w-[200px] truncate",
|
||||
title: item.Description ?? "",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.Description ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
Badge($$renderer8, {
|
||||
variant: "outline",
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->${escape_html(item.UOM ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-right tabular-nums",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.Cost != null ? Number(item.Cost).toLocaleString() : "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.Vendor ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!--[-->`);
|
||||
const each_array_1 = ensure_array_like(asList(item.Catagory));
|
||||
for (let $$index = 0, $$length2 = each_array_1.length; $$index < $$length2; $$index++) {
|
||||
let cat = each_array_1[$$index];
|
||||
Badge($$renderer8, {
|
||||
variant: "secondary",
|
||||
class: "mr-1 text-xs",
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->${escape_html(cat)}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
}
|
||||
$$renderer8.push(`<!--]--> `);
|
||||
if (asList(item.Catagory).length === 0) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground">—</span>`);
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!--[-->`);
|
||||
const each_array_2 = ensure_array_like(asList(item.Sub_Catagory));
|
||||
for (let $$index_1 = 0, $$length2 = each_array_2.length; $$index_1 < $$length2; $$index_1++) {
|
||||
let sub = each_array_2[$$index_1];
|
||||
Badge($$renderer8, {
|
||||
variant: "outline",
|
||||
class: "mr-1 text-xs",
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->${escape_html(sub)}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
}
|
||||
$$renderer8.push(`<!--]--> `);
|
||||
if (asList(item.Sub_Catagory).length === 0) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground">—</span>`);
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
if (item.Has_Parent) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
Badge($$renderer8, {
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->Yes`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground">No</span>`);
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
if (item.expand?.Parent) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
$$renderer8.push(`${escape_html(item.expand.Parent.Item ?? item.expand.Parent.SKU ?? item.Parent)}`);
|
||||
} else if (item.Parent) {
|
||||
$$renderer8.push("<!--[1-->");
|
||||
$$renderer8.push(`<span class="font-mono text-xs">${escape_html(item.Parent)}</span>`);
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
$$renderer8.push(`—`);
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
if (item.Stock) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
Badge($$renderer8, {
|
||||
variant: "default",
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->Stock`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground">—</span>`);
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-muted-foreground text-xs",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(formatDate(item.created))}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-muted-foreground text-xs",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(formatDate(item.updated))}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer6.push(`<!---->`);
|
||||
}
|
||||
$$renderer6.push(`<!--]-->`);
|
||||
}
|
||||
$$renderer6.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer5.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer4.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer3.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer2.push(`<!----></main>`);
|
||||
}
|
||||
$$renderer2.push(`<!--]-->`);
|
||||
});
|
||||
}
|
||||
|
||||
export { _page as default };
|
||||
//# sourceMappingURL=_page.svelte-BSzWqLxF.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,92 @@
|
||||
import 'clsx';
|
||||
import { a6 as attributes, a7 as clsx, a8 as bind_props } from './index-Cd32JeF5.js';
|
||||
import { c as cn, t as tv } from './index-DWasNFG9.js';
|
||||
import 'tailwind-merge';
|
||||
|
||||
const buttonVariants = tv({
|
||||
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",
|
||||
destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",
|
||||
outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
|
||||
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",
|
||||
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
||||
link: "text-primary underline-offset-4 hover:underline"
|
||||
},
|
||||
size: {
|
||||
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
||||
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
||||
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
||||
icon: "size-9",
|
||||
"icon-sm": "size-8",
|
||||
"icon-lg": "size-10"
|
||||
}
|
||||
},
|
||||
defaultVariants: { variant: "default", size: "default" }
|
||||
});
|
||||
function Button($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
class: className,
|
||||
variant = "default",
|
||||
size = "default",
|
||||
ref = null,
|
||||
href = void 0,
|
||||
type = "button",
|
||||
disabled,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
if (href) {
|
||||
$$renderer2.push("<!--[-->");
|
||||
$$renderer2.push(`<a${attributes({
|
||||
"data-slot": "button",
|
||||
class: clsx(cn(buttonVariants({ variant, size }), className)),
|
||||
href: disabled ? void 0 : href,
|
||||
"aria-disabled": disabled,
|
||||
role: disabled ? "link" : void 0,
|
||||
tabindex: disabled ? -1 : void 0,
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></a>`);
|
||||
} else {
|
||||
$$renderer2.push("<!--[!-->");
|
||||
$$renderer2.push(`<button${attributes({
|
||||
"data-slot": "button",
|
||||
class: clsx(cn(buttonVariants({ variant, size }), className)),
|
||||
type,
|
||||
disabled,
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></button>`);
|
||||
}
|
||||
$$renderer2.push(`<!--]-->`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function _page($$renderer) {
|
||||
$$renderer.push(`<main class="flex min-h-screen flex-col items-center justify-center gap-4 p-8"><h1 class="text-2xl font-semibold">Stackq</h1> <p class="text-muted-foreground">Svelte 5 + shadcn-svelte + PocketBase</p> <div class="flex gap-2"><a href="/items">`);
|
||||
Button($$renderer, {
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->Items table`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a> <a href="/logout">`);
|
||||
Button($$renderer, {
|
||||
variant: "outline",
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->Log out`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a></div></main>`);
|
||||
}
|
||||
|
||||
export { _page as default };
|
||||
//# sourceMappingURL=_page.svelte-C3pCwICc.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,46 @@
|
||||
import { d as escape_html, f as getContext, n as noop } from './index-Cd32JeF5.js';
|
||||
import 'clsx';
|
||||
import { l as writable } from './exports-DzT6WcEV.js';
|
||||
|
||||
function create_updated_store() {
|
||||
const { set, subscribe } = writable(false);
|
||||
{
|
||||
return {
|
||||
subscribe,
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
check: async () => false
|
||||
};
|
||||
}
|
||||
}
|
||||
const is_legacy = noop.toString().includes("$$") || /function \w+\(\) \{\}/.test(noop.toString());
|
||||
if (is_legacy) {
|
||||
({
|
||||
url: new URL("https://example.com")
|
||||
});
|
||||
}
|
||||
const stores = {
|
||||
updated: /* @__PURE__ */ create_updated_store()
|
||||
};
|
||||
({
|
||||
check: stores.updated.check
|
||||
});
|
||||
function context() {
|
||||
return getContext("__request__");
|
||||
}
|
||||
const page$1 = {
|
||||
get error() {
|
||||
return context().page.error;
|
||||
},
|
||||
get status() {
|
||||
return context().page.status;
|
||||
}
|
||||
};
|
||||
const page = page$1;
|
||||
function Error$1($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
$$renderer2.push(`<h1>${escape_html(page.status)}</h1> <p>${escape_html(page.error?.message)}</p>`);
|
||||
});
|
||||
}
|
||||
|
||||
export { Error$1 as default };
|
||||
//# sourceMappingURL=error.svelte-RymJGne7.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error.svelte-RymJGne7.js","sources":["../../../.svelte-kit/adapter-node/entries/fallbacks/error.svelte.js"],"sourcesContent":["import { n as noop, g as getContext, e as escape_html } from \"../../chunks/index.js\";\nimport \"clsx\";\nimport { w as writable } from \"../../chunks/exports.js\";\nimport \"@sveltejs/kit/internal/server\";\nimport \"../../chunks/root.js\";\nimport \"@sveltejs/kit/internal\";\nimport \"../../chunks/utils.js\";\nfunction create_updated_store() {\n const { set, subscribe } = writable(false);\n {\n return {\n subscribe,\n // eslint-disable-next-line @typescript-eslint/require-await\n check: async () => false\n };\n }\n}\nconst is_legacy = noop.toString().includes(\"$$\") || /function \\w+\\(\\) \\{\\}/.test(noop.toString());\nif (is_legacy) {\n ({\n data: {},\n form: null,\n error: null,\n params: {},\n route: { id: null },\n state: {},\n status: -1,\n url: new URL(\"https://example.com\")\n });\n}\nconst stores = {\n updated: /* @__PURE__ */ create_updated_store()\n};\n({\n check: stores.updated.check\n});\nfunction context() {\n return getContext(\"__request__\");\n}\nconst page$1 = {\n get error() {\n return context().page.error;\n },\n get status() {\n return context().page.status;\n }\n};\nconst page = page$1;\nfunction Error$1($$renderer, $$props) {\n $$renderer.component(($$renderer2) => {\n $$renderer2.push(`<h1>${escape_html(page.status)}</h1> <p>${escape_html(page.error?.message)}</p>`);\n });\n}\nexport {\n Error$1 as default\n};\n"],"names":[],"mappings":";;;;AAOA,SAAS,oBAAoB,GAAG;AAChC,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC;AAC5C,EAAE;AACF,IAAI,OAAO;AACX,MAAM,SAAS;AACf;AACA,MAAM,KAAK,EAAE,YAAY;AACzB,KAAK;AACL,EAAE;AACF;AACA,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;AACjG,IAAI,SAAS,EAAE;AACf,EAAE,CAAC;AACH,IAOI,GAAG,EAAE,IAAI,GAAG,CAAC,qBAAqB;AACtC,GAAG;AACH;AACA,MAAM,MAAM,GAAG;AACf,EAAE,OAAO,kBAAkB,oBAAoB;AAC/C,CAAC;AACD,CAAC;AACD,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC;AACD,SAAS,OAAO,GAAG;AACnB,EAAE,OAAO,UAAU,CAAC,aAAa,CAAC;AAClC;AACA,MAAM,MAAM,GAAG;AACf,EAAE,IAAI,KAAK,GAAG;AACd,IAAI,OAAO,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK;AAC/B,EAAE,CAAC;AACH,EAAE,IAAI,MAAM,GAAG;AACf,IAAI,OAAO,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM;AAChC,EAAE;AACF,CAAC;AACD,MAAM,IAAI,GAAG,MAAM;AACnB,SAAS,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE;AACtC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,KAAK;AACxC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACvG,EAAE,CAAC,CAAC;AACJ;;;;"}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,35 @@
|
||||
import { r as redirect } from './index-B2LGyy1l.js';
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const POCKETBASE_URL = "https://pocketbase.ccllc.pro";
|
||||
const LOGIN_PATH = "/login";
|
||||
const LOGOUT_PATH = "/logout";
|
||||
function isPublicRoute(pathname) {
|
||||
return pathname === LOGIN_PATH || pathname.startsWith(LOGIN_PATH + "/") || pathname === LOGOUT_PATH;
|
||||
}
|
||||
const handle = async ({ event, resolve }) => {
|
||||
event.locals.pb = new PocketBase(POCKETBASE_URL);
|
||||
event.locals.pb.authStore.loadFromCookie(event.request.headers.get("cookie") || "");
|
||||
try {
|
||||
if (event.locals.pb.authStore.isValid) {
|
||||
await event.locals.pb.collection("users").authRefresh();
|
||||
}
|
||||
} catch {
|
||||
event.locals.pb.authStore.clear();
|
||||
}
|
||||
event.locals.user = event.locals.pb.authStore.record ?? null;
|
||||
if (!event.locals.user && !isPublicRoute(event.url.pathname)) {
|
||||
const redirectTo = event.url.pathname + event.url.search;
|
||||
const loginUrl = redirectTo && redirectTo !== "/" ? `${LOGIN_PATH}?redirectTo=${encodeURIComponent(redirectTo)}` : LOGIN_PATH;
|
||||
throw redirect(303, loginUrl);
|
||||
}
|
||||
const response = await resolve(event);
|
||||
response.headers.append(
|
||||
"set-cookie",
|
||||
event.locals.pb.authStore.exportToCookie({ httpOnly: false, sameSite: "Lax" })
|
||||
);
|
||||
return response;
|
||||
};
|
||||
|
||||
export { handle };
|
||||
//# sourceMappingURL=hooks.server-CyaTv4Vv.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hooks.server-CyaTv4Vv.js","sources":["../../../.svelte-kit/adapter-node/entries/hooks.server.js"],"sourcesContent":["import { redirect } from \"@sveltejs/kit\";\nimport PocketBase from \"pocketbase\";\nconst POCKETBASE_URL = \"https://pocketbase.ccllc.pro\";\nconst LOGIN_PATH = \"/login\";\nconst LOGOUT_PATH = \"/logout\";\nfunction isPublicRoute(pathname) {\n return pathname === LOGIN_PATH || pathname.startsWith(LOGIN_PATH + \"/\") || pathname === LOGOUT_PATH;\n}\nconst handle = async ({ event, resolve }) => {\n event.locals.pb = new PocketBase(POCKETBASE_URL);\n event.locals.pb.authStore.loadFromCookie(event.request.headers.get(\"cookie\") || \"\");\n try {\n if (event.locals.pb.authStore.isValid) {\n await event.locals.pb.collection(\"users\").authRefresh();\n }\n } catch {\n event.locals.pb.authStore.clear();\n }\n event.locals.user = event.locals.pb.authStore.record ?? null;\n if (!event.locals.user && !isPublicRoute(event.url.pathname)) {\n const redirectTo = event.url.pathname + event.url.search;\n const loginUrl = redirectTo && redirectTo !== \"/\" ? `${LOGIN_PATH}?redirectTo=${encodeURIComponent(redirectTo)}` : LOGIN_PATH;\n throw redirect(303, loginUrl);\n }\n const response = await resolve(event);\n response.headers.append(\n \"set-cookie\",\n event.locals.pb.authStore.exportToCookie({ httpOnly: false, sameSite: \"Lax\" })\n );\n return response;\n};\nexport {\n handle\n};\n"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG,8BAA8B;AACrD,MAAM,UAAU,GAAG,QAAQ;AAC3B,MAAM,WAAW,GAAG,SAAS;AAC7B,SAAS,aAAa,CAAC,QAAQ,EAAE;AACjC,EAAE,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,UAAU,GAAG,GAAG,CAAC,IAAI,QAAQ,KAAK,WAAW;AACrG;AACK,MAAC,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK;AAC7C,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,UAAU,CAAC,cAAc,CAAC;AAClD,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AACrF,EAAE,IAAI;AACN,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE;AAC3C,MAAM,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE;AAC7D,IAAI;AACJ,EAAE,CAAC,CAAC,MAAM;AACV,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE;AACrC,EAAE;AACF,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI;AAC9D,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AAChE,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM;AAC5D,IAAI,MAAM,QAAQ,GAAG,UAAU,IAAI,UAAU,KAAK,GAAG,GAAG,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU;AACjI,IAAI,MAAM,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;AACjC,EAAE;AACF,EAAE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC;AACvC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM;AACzB,IAAI,YAAY;AAChB,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;AACjF,GAAG;AACH,EAAE,OAAO,QAAQ;AACjB;;;;"}
|
||||
@@ -0,0 +1,247 @@
|
||||
/** @import { StandardSchemaV1 } from '@standard-schema/spec' */
|
||||
|
||||
class HttpError {
|
||||
/**
|
||||
* @param {number} status
|
||||
* @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body
|
||||
*/
|
||||
constructor(status, body) {
|
||||
this.status = status;
|
||||
if (typeof body === 'string') {
|
||||
this.body = { message: body };
|
||||
} else if (body) {
|
||||
this.body = body;
|
||||
} else {
|
||||
this.body = { message: `Error: ${status}` };
|
||||
}
|
||||
}
|
||||
|
||||
toString() {
|
||||
return JSON.stringify(this.body);
|
||||
}
|
||||
}
|
||||
|
||||
class Redirect {
|
||||
/**
|
||||
* @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status
|
||||
* @param {string} location
|
||||
*/
|
||||
constructor(status, location) {
|
||||
this.status = status;
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An error that was thrown from within the SvelteKit runtime that is not fatal and doesn't result in a 500, such as a 404.
|
||||
* `SvelteKitError` goes through `handleError`.
|
||||
* @extends Error
|
||||
*/
|
||||
class SvelteKitError extends Error {
|
||||
/**
|
||||
* @param {number} status
|
||||
* @param {string} text
|
||||
* @param {string} message
|
||||
*/
|
||||
constructor(status, text, message) {
|
||||
super(message);
|
||||
this.status = status;
|
||||
this.text = text;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @template [T=undefined]
|
||||
*/
|
||||
class ActionFailure {
|
||||
/**
|
||||
* @param {number} status
|
||||
* @param {T} data
|
||||
*/
|
||||
constructor(status, data) {
|
||||
this.status = status;
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
const text_encoder = new TextEncoder();
|
||||
new TextDecoder();
|
||||
|
||||
/** @import { StandardSchemaV1 } from '@standard-schema/spec' */
|
||||
|
||||
|
||||
// TODO 3.0: remove these types as they are not used anymore (we can't remove them yet because that would be a breaking change)
|
||||
/**
|
||||
* @template {number} TNumber
|
||||
* @template {any[]} [TArray=[]]
|
||||
* @typedef {TNumber extends TArray['length'] ? TArray[number] : LessThan<TNumber, [...TArray, TArray['length']]>} LessThan
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {number} TStart
|
||||
* @template {number} TEnd
|
||||
* @typedef {Exclude<TEnd | LessThan<TEnd>, LessThan<TStart>>} NumericRange
|
||||
*/
|
||||
|
||||
// Keep the status codes as `number` because restricting to certain numbers makes it unnecessarily hard to use compared to the benefits
|
||||
// (we have runtime errors already to check for invalid codes). Also see https://github.com/sveltejs/kit/issues/11780
|
||||
|
||||
// we have to repeat the JSDoc because the display for function overloads is broken
|
||||
// see https://github.com/microsoft/TypeScript/issues/55056
|
||||
|
||||
/**
|
||||
* Throws an error with a HTTP status code and an optional message.
|
||||
* When called during request handling, this will cause SvelteKit to
|
||||
* return an error response without invoking `handleError`.
|
||||
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
|
||||
* @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
|
||||
* @param {App.Error} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
|
||||
* @overload
|
||||
* @param {number} status
|
||||
* @param {App.Error} body
|
||||
* @return {never}
|
||||
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
|
||||
* @throws {Error} If the provided status is invalid (not between 400 and 599).
|
||||
*/
|
||||
/**
|
||||
* Throws an error with a HTTP status code and an optional message.
|
||||
* When called during request handling, this will cause SvelteKit to
|
||||
* return an error response without invoking `handleError`.
|
||||
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
|
||||
* @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
|
||||
* @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
|
||||
* @overload
|
||||
* @param {number} status
|
||||
* @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body]
|
||||
* @return {never}
|
||||
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
|
||||
* @throws {Error} If the provided status is invalid (not between 400 and 599).
|
||||
*/
|
||||
/**
|
||||
* Throws an error with a HTTP status code and an optional message.
|
||||
* When called during request handling, this will cause SvelteKit to
|
||||
* return an error response without invoking `handleError`.
|
||||
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
|
||||
* @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
|
||||
* @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
|
||||
* @return {never}
|
||||
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
|
||||
* @throws {Error} If the provided status is invalid (not between 400 and 599).
|
||||
*/
|
||||
function error(status, body) {
|
||||
if ((isNaN(status) || status < 400 || status > 599)) {
|
||||
throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`);
|
||||
}
|
||||
|
||||
throw new HttpError(status, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect a request. When called during request handling, SvelteKit will return a redirect response.
|
||||
* Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it.
|
||||
*
|
||||
* Most common status codes:
|
||||
* * `303 See Other`: redirect as a GET request (often used after a form POST request)
|
||||
* * `307 Temporary Redirect`: redirect will keep the request method
|
||||
* * `308 Permanent Redirect`: redirect will keep the request method, SEO will be transferred to the new page
|
||||
*
|
||||
* [See all redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages)
|
||||
*
|
||||
* @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | ({} & number)} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308.
|
||||
* @param {string | URL} location The location to redirect to.
|
||||
* @throws {Redirect} This error instructs SvelteKit to redirect to the specified location.
|
||||
* @throws {Error} If the provided status is invalid.
|
||||
* @return {never}
|
||||
*/
|
||||
function redirect(status, location) {
|
||||
if ((isNaN(status) || status < 300 || status > 308)) {
|
||||
throw new Error('Invalid status code');
|
||||
}
|
||||
|
||||
throw new Redirect(
|
||||
// @ts-ignore
|
||||
status,
|
||||
location.toString()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a JSON `Response` object from the supplied data.
|
||||
* @param {any} data The value that will be serialized as JSON.
|
||||
* @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically.
|
||||
*/
|
||||
function json(data, init) {
|
||||
// TODO deprecate this in favour of `Response.json` when it's
|
||||
// more widely supported
|
||||
const body = JSON.stringify(data);
|
||||
|
||||
// we can't just do `text(JSON.stringify(data), init)` because
|
||||
// it will set a default `content-type` header. duplicated code
|
||||
// means less duplicated work
|
||||
const headers = new Headers(init?.headers);
|
||||
if (!headers.has('content-length')) {
|
||||
headers.set('content-length', text_encoder.encode(body).byteLength.toString());
|
||||
}
|
||||
|
||||
if (!headers.has('content-type')) {
|
||||
headers.set('content-type', 'application/json');
|
||||
}
|
||||
|
||||
return new Response(body, {
|
||||
...init,
|
||||
headers
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a `Response` object from the supplied body.
|
||||
* @param {string} body The value that will be used as-is.
|
||||
* @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically.
|
||||
*/
|
||||
function text(body, init) {
|
||||
const headers = new Headers(init?.headers);
|
||||
if (!headers.has('content-length')) {
|
||||
const encoded = text_encoder.encode(body);
|
||||
headers.set('content-length', encoded.byteLength.toString());
|
||||
return new Response(encoded, {
|
||||
...init,
|
||||
headers
|
||||
});
|
||||
}
|
||||
|
||||
return new Response(body, {
|
||||
...init,
|
||||
headers
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an `ActionFailure` object. Call when form submission fails.
|
||||
* @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
|
||||
* @overload
|
||||
* @param {number} status
|
||||
* @returns {import('./public.js').ActionFailure<undefined>}
|
||||
*/
|
||||
/**
|
||||
* Create an `ActionFailure` object. Call when form submission fails.
|
||||
* @template [T=undefined]
|
||||
* @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
|
||||
* @param {T} data Data associated with the failure (e.g. validation errors)
|
||||
* @overload
|
||||
* @param {number} status
|
||||
* @param {T} data
|
||||
* @returns {import('./public.js').ActionFailure<T>}
|
||||
*/
|
||||
/**
|
||||
* Create an `ActionFailure` object. Call when form submission fails.
|
||||
* @param {number} status
|
||||
* @param {any} [data]
|
||||
* @returns {import('./public.js').ActionFailure<any>}
|
||||
*/
|
||||
function fail(status, data) {
|
||||
// @ts-expect-error unique symbol missing
|
||||
return new ActionFailure(status, data);
|
||||
}
|
||||
|
||||
export { ActionFailure as A, HttpError as H, Redirect as R, SvelteKitError as S, error as e, fail as f, json as j, redirect as r, text as t };
|
||||
//# sourceMappingURL=index-B2LGyy1l.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,408 @@
|
||||
import { clsx } from 'clsx';
|
||||
import { twMerge, extendTailwindMerge } from 'tailwind-merge';
|
||||
|
||||
function cn(...inputs) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
// src/utils.js
|
||||
var SPACE_REGEX = /\s+/g;
|
||||
var removeExtraSpaces = (str) => {
|
||||
if (typeof str !== "string" || !str) return str;
|
||||
return str.replace(SPACE_REGEX, " ").trim();
|
||||
};
|
||||
var cx = (...classnames) => {
|
||||
const classList = [];
|
||||
const buildClassString = (input) => {
|
||||
if (!input && input !== 0 && input !== 0n) return;
|
||||
if (Array.isArray(input)) {
|
||||
for (let i = 0, len = input.length; i < len; i++) buildClassString(input[i]);
|
||||
return;
|
||||
}
|
||||
const type = typeof input;
|
||||
if (type === "string" || type === "number" || type === "bigint") {
|
||||
if (type === "number" && input !== input) return;
|
||||
classList.push(String(input));
|
||||
} else if (type === "object") {
|
||||
const keys = Object.keys(input);
|
||||
for (let i = 0, len = keys.length; i < len; i++) {
|
||||
const key = keys[i];
|
||||
if (input[key]) classList.push(key);
|
||||
}
|
||||
}
|
||||
};
|
||||
for (let i = 0, len = classnames.length; i < len; i++) {
|
||||
const c = classnames[i];
|
||||
if (c !== null && c !== void 0) buildClassString(c);
|
||||
}
|
||||
return classList.length > 0 ? removeExtraSpaces(classList.join(" ")) : void 0;
|
||||
};
|
||||
var falsyToString = (value) => value === false ? "false" : value === true ? "true" : value === 0 ? "0" : value;
|
||||
var isEmptyObject = (obj) => {
|
||||
if (!obj || typeof obj !== "object") return true;
|
||||
for (const _ in obj) return false;
|
||||
return true;
|
||||
};
|
||||
var isEqual = (obj1, obj2) => {
|
||||
if (obj1 === obj2) return true;
|
||||
if (!obj1 || !obj2) return false;
|
||||
const keys1 = Object.keys(obj1);
|
||||
const keys2 = Object.keys(obj2);
|
||||
if (keys1.length !== keys2.length) return false;
|
||||
for (let i = 0; i < keys1.length; i++) {
|
||||
const key = keys1[i];
|
||||
if (!keys2.includes(key)) return false;
|
||||
if (obj1[key] !== obj2[key]) return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var joinObjects = (obj1, obj2) => {
|
||||
for (const key in obj2) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj2, key)) {
|
||||
const val2 = obj2[key];
|
||||
if (key in obj1) {
|
||||
obj1[key] = cx(obj1[key], val2);
|
||||
} else {
|
||||
obj1[key] = val2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj1;
|
||||
};
|
||||
var flat = (arr, target) => {
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
const el = arr[i];
|
||||
if (Array.isArray(el)) flat(el, target);
|
||||
else if (el) target.push(el);
|
||||
}
|
||||
};
|
||||
var flatMergeArrays = (...arrays) => {
|
||||
const result = [];
|
||||
flat(arrays, result);
|
||||
const filtered = [];
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
if (result[i]) filtered.push(result[i]);
|
||||
}
|
||||
return filtered;
|
||||
};
|
||||
var mergeObjects = (obj1, obj2) => {
|
||||
const result = {};
|
||||
for (const key in obj1) {
|
||||
const val1 = obj1[key];
|
||||
if (key in obj2) {
|
||||
const val2 = obj2[key];
|
||||
if (Array.isArray(val1) || Array.isArray(val2)) {
|
||||
result[key] = flatMergeArrays(val2, val1);
|
||||
} else if (typeof val1 === "object" && typeof val2 === "object" && val1 && val2) {
|
||||
result[key] = mergeObjects(val1, val2);
|
||||
} else {
|
||||
result[key] = val2 + " " + val1;
|
||||
}
|
||||
} else {
|
||||
result[key] = val1;
|
||||
}
|
||||
}
|
||||
for (const key in obj2) {
|
||||
if (!(key in obj1)) {
|
||||
result[key] = obj2[key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
// src/config.js
|
||||
var defaultConfig = {
|
||||
twMerge: true,
|
||||
twMergeConfig: {}
|
||||
};
|
||||
|
||||
// src/state.js
|
||||
function createState() {
|
||||
let cachedTwMerge = null;
|
||||
let cachedTwMergeConfig = {};
|
||||
let didTwMergeConfigChange = false;
|
||||
return {
|
||||
get cachedTwMerge() {
|
||||
return cachedTwMerge;
|
||||
},
|
||||
set cachedTwMerge(value) {
|
||||
cachedTwMerge = value;
|
||||
},
|
||||
get cachedTwMergeConfig() {
|
||||
return cachedTwMergeConfig;
|
||||
},
|
||||
set cachedTwMergeConfig(value) {
|
||||
cachedTwMergeConfig = value;
|
||||
},
|
||||
get didTwMergeConfigChange() {
|
||||
return didTwMergeConfigChange;
|
||||
},
|
||||
set didTwMergeConfigChange(value) {
|
||||
didTwMergeConfigChange = value;
|
||||
},
|
||||
reset() {
|
||||
cachedTwMerge = null;
|
||||
cachedTwMergeConfig = {};
|
||||
didTwMergeConfigChange = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
var state = createState();
|
||||
|
||||
// src/core.js
|
||||
var getTailwindVariants = (cn) => {
|
||||
const tv = (options, configProp) => {
|
||||
const {
|
||||
extend = null,
|
||||
slots: slotProps = {},
|
||||
variants: variantsProps = {},
|
||||
compoundVariants: compoundVariantsProps = [],
|
||||
compoundSlots = [],
|
||||
defaultVariants: defaultVariantsProps = {}
|
||||
} = options;
|
||||
const config = { ...defaultConfig, ...configProp };
|
||||
const base = extend?.base ? cx(extend.base, options?.base) : options?.base;
|
||||
const variants = extend?.variants && !isEmptyObject(extend.variants) ? mergeObjects(variantsProps, extend.variants) : variantsProps;
|
||||
const defaultVariants = extend?.defaultVariants && !isEmptyObject(extend.defaultVariants) ? { ...extend.defaultVariants, ...defaultVariantsProps } : defaultVariantsProps;
|
||||
if (!isEmptyObject(config.twMergeConfig) && !isEqual(config.twMergeConfig, state.cachedTwMergeConfig)) {
|
||||
state.didTwMergeConfigChange = true;
|
||||
state.cachedTwMergeConfig = config.twMergeConfig;
|
||||
}
|
||||
const isExtendedSlotsEmpty = isEmptyObject(extend?.slots);
|
||||
const componentSlots = !isEmptyObject(slotProps) ? {
|
||||
// add "base" to the slots object
|
||||
base: cx(options?.base, isExtendedSlotsEmpty && extend?.base),
|
||||
...slotProps
|
||||
} : {};
|
||||
const slots = isExtendedSlotsEmpty ? componentSlots : joinObjects(
|
||||
{ ...extend?.slots },
|
||||
isEmptyObject(componentSlots) ? { base: options?.base } : componentSlots
|
||||
);
|
||||
const compoundVariants = isEmptyObject(extend?.compoundVariants) ? compoundVariantsProps : flatMergeArrays(extend?.compoundVariants, compoundVariantsProps);
|
||||
const component = (props) => {
|
||||
if (isEmptyObject(variants) && isEmptyObject(slotProps) && isExtendedSlotsEmpty) {
|
||||
return cn(base, props?.class, props?.className)(config);
|
||||
}
|
||||
if (compoundVariants && !Array.isArray(compoundVariants)) {
|
||||
throw new TypeError(
|
||||
`The "compoundVariants" prop must be an array. Received: ${typeof compoundVariants}`
|
||||
);
|
||||
}
|
||||
if (compoundSlots && !Array.isArray(compoundSlots)) {
|
||||
throw new TypeError(
|
||||
`The "compoundSlots" prop must be an array. Received: ${typeof compoundSlots}`
|
||||
);
|
||||
}
|
||||
const getVariantValue = (variant, vrs = variants, _slotKey = null, slotProps2 = null) => {
|
||||
const variantObj = vrs[variant];
|
||||
if (!variantObj || isEmptyObject(variantObj)) {
|
||||
return null;
|
||||
}
|
||||
const variantProp = slotProps2?.[variant] ?? props?.[variant];
|
||||
if (variantProp === null) return null;
|
||||
const variantKey = falsyToString(variantProp);
|
||||
if (typeof variantKey === "object") {
|
||||
return null;
|
||||
}
|
||||
const defaultVariantProp = defaultVariants?.[variant];
|
||||
const key = variantKey != null ? variantKey : falsyToString(defaultVariantProp);
|
||||
const value = variantObj[key || "false"];
|
||||
return value;
|
||||
};
|
||||
const getVariantClassNames = () => {
|
||||
if (!variants) return null;
|
||||
const keys = Object.keys(variants);
|
||||
const result = [];
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const value = getVariantValue(keys[i], variants);
|
||||
if (value) result.push(value);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const getVariantClassNamesBySlotKey = (slotKey, slotProps2) => {
|
||||
if (!variants || typeof variants !== "object") return null;
|
||||
const result = [];
|
||||
for (const variant in variants) {
|
||||
const variantValue = getVariantValue(variant, variants, slotKey, slotProps2);
|
||||
const value = slotKey === "base" && typeof variantValue === "string" ? variantValue : variantValue && variantValue[slotKey];
|
||||
if (value) result.push(value);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const propsWithoutUndefined = {};
|
||||
for (const prop in props) {
|
||||
const value = props[prop];
|
||||
if (value !== void 0) propsWithoutUndefined[prop] = value;
|
||||
}
|
||||
const getCompleteProps = (key, slotProps2) => {
|
||||
const initialProp = typeof props?.[key] === "object" ? {
|
||||
[key]: props[key]?.initial
|
||||
} : {};
|
||||
return {
|
||||
...defaultVariants,
|
||||
...propsWithoutUndefined,
|
||||
...initialProp,
|
||||
...slotProps2
|
||||
};
|
||||
};
|
||||
const getCompoundVariantsValue = (cv = [], slotProps2) => {
|
||||
const result = [];
|
||||
const cvLength = cv.length;
|
||||
for (let i = 0; i < cvLength; i++) {
|
||||
const { class: tvClass, className: tvClassName, ...compoundVariantOptions } = cv[i];
|
||||
let isValid = true;
|
||||
const completeProps = getCompleteProps(null, slotProps2);
|
||||
for (const key in compoundVariantOptions) {
|
||||
const value = compoundVariantOptions[key];
|
||||
const completePropsValue = completeProps[key];
|
||||
if (Array.isArray(value)) {
|
||||
if (!value.includes(completePropsValue)) {
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ((value == null || value === false) && (completePropsValue == null || completePropsValue === false))
|
||||
continue;
|
||||
if (completePropsValue !== value) {
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isValid) {
|
||||
if (tvClass) result.push(tvClass);
|
||||
if (tvClassName) result.push(tvClassName);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const getCompoundVariantClassNamesBySlot = (slotProps2) => {
|
||||
const compoundClassNames = getCompoundVariantsValue(compoundVariants, slotProps2);
|
||||
if (!Array.isArray(compoundClassNames)) return compoundClassNames;
|
||||
const result = {};
|
||||
const cnFn = cn;
|
||||
for (let i = 0; i < compoundClassNames.length; i++) {
|
||||
const className = compoundClassNames[i];
|
||||
if (typeof className === "string") {
|
||||
result.base = cnFn(result.base, className)(config);
|
||||
} else if (typeof className === "object") {
|
||||
for (const slot in className) {
|
||||
result[slot] = cnFn(result[slot], className[slot])(config);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const getCompoundSlotClassNameBySlot = (slotProps2) => {
|
||||
if (compoundSlots.length < 1) return null;
|
||||
const result = {};
|
||||
const completeProps = getCompleteProps(null, slotProps2);
|
||||
for (let i = 0; i < compoundSlots.length; i++) {
|
||||
const {
|
||||
slots: slots2 = [],
|
||||
class: slotClass,
|
||||
className: slotClassName,
|
||||
...slotVariants
|
||||
} = compoundSlots[i];
|
||||
if (!isEmptyObject(slotVariants)) {
|
||||
let isValid = true;
|
||||
for (const key in slotVariants) {
|
||||
const completePropsValue = completeProps[key];
|
||||
const slotVariantValue = slotVariants[key];
|
||||
if (completePropsValue === void 0 || (Array.isArray(slotVariantValue) ? !slotVariantValue.includes(completePropsValue) : slotVariantValue !== completePropsValue)) {
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isValid) continue;
|
||||
}
|
||||
for (let j = 0; j < slots2.length; j++) {
|
||||
const slotName = slots2[j];
|
||||
if (!result[slotName]) result[slotName] = [];
|
||||
result[slotName].push([slotClass, slotClassName]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
if (!isEmptyObject(slotProps) || !isExtendedSlotsEmpty) {
|
||||
const slotsFns = {};
|
||||
if (typeof slots === "object" && !isEmptyObject(slots)) {
|
||||
const cnFn = cn;
|
||||
for (const slotKey in slots) {
|
||||
slotsFns[slotKey] = (slotProps2) => {
|
||||
const compoundVariantClasses = getCompoundVariantClassNamesBySlot(slotProps2);
|
||||
const compoundSlotClasses = getCompoundSlotClassNameBySlot(slotProps2);
|
||||
return cnFn(
|
||||
slots[slotKey],
|
||||
getVariantClassNamesBySlotKey(slotKey, slotProps2),
|
||||
compoundVariantClasses ? compoundVariantClasses[slotKey] : void 0,
|
||||
compoundSlotClasses ? compoundSlotClasses[slotKey] : void 0,
|
||||
slotProps2?.class,
|
||||
slotProps2?.className
|
||||
)(config);
|
||||
};
|
||||
}
|
||||
}
|
||||
return slotsFns;
|
||||
}
|
||||
return cn(
|
||||
base,
|
||||
getVariantClassNames(),
|
||||
getCompoundVariantsValue(compoundVariants),
|
||||
props?.class,
|
||||
props?.className
|
||||
)(config);
|
||||
};
|
||||
const getVariantKeys = () => {
|
||||
if (!variants || typeof variants !== "object") return;
|
||||
return Object.keys(variants);
|
||||
};
|
||||
component.variantKeys = getVariantKeys();
|
||||
component.extend = extend;
|
||||
component.base = base;
|
||||
component.slots = slots;
|
||||
component.variants = variants;
|
||||
component.defaultVariants = defaultVariants;
|
||||
component.compoundSlots = compoundSlots;
|
||||
component.compoundVariants = compoundVariants;
|
||||
return component;
|
||||
};
|
||||
const createTV = (configProp) => {
|
||||
return (options, config) => tv(options, config ? mergeObjects(configProp, config) : configProp);
|
||||
};
|
||||
return {
|
||||
tv,
|
||||
createTV
|
||||
};
|
||||
};
|
||||
|
||||
var createTwMerge = (cachedTwMergeConfig) => {
|
||||
return isEmptyObject(cachedTwMergeConfig) ? twMerge : extendTailwindMerge({
|
||||
...cachedTwMergeConfig,
|
||||
extend: {
|
||||
theme: cachedTwMergeConfig.theme,
|
||||
classGroups: cachedTwMergeConfig.classGroups,
|
||||
conflictingClassGroupModifiers: cachedTwMergeConfig.conflictingClassGroupModifiers,
|
||||
conflictingClassGroups: cachedTwMergeConfig.conflictingClassGroups,
|
||||
...cachedTwMergeConfig.extend
|
||||
}
|
||||
});
|
||||
};
|
||||
var executeMerge = (classnames, config) => {
|
||||
const base = cx(classnames);
|
||||
if (!base || !(config?.twMerge ?? true)) return base;
|
||||
if (!state.cachedTwMerge || state.didTwMergeConfigChange) {
|
||||
state.didTwMergeConfigChange = false;
|
||||
state.cachedTwMerge = createTwMerge(state.cachedTwMergeConfig);
|
||||
}
|
||||
return state.cachedTwMerge(base) || void 0;
|
||||
};
|
||||
var cnMerge = (...classnames) => {
|
||||
return (config) => executeMerge(classnames, config);
|
||||
};
|
||||
|
||||
// src/index.js
|
||||
var { tv } = getTailwindVariants(cnMerge);
|
||||
|
||||
export { cn as c, tv as t };
|
||||
//# sourceMappingURL=index-DWasNFG9.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,70 @@
|
||||
const manifest = (() => {
|
||||
function __memo(fn) {
|
||||
let value;
|
||||
return () => value ??= (value = fn());
|
||||
}
|
||||
|
||||
return {
|
||||
appDir: "_app",
|
||||
appPath: "_app",
|
||||
assets: new Set([]),
|
||||
mimeTypes: {},
|
||||
_: {
|
||||
client: {start:"_app/immutable/entry/start.C_SQrpA0.js",app:"_app/immutable/entry/app.DE4HKxpj.js",imports:["_app/immutable/entry/start.C_SQrpA0.js","_app/immutable/chunks/D6EhJnz8.js","_app/immutable/chunks/Db3dOJqt.js","_app/immutable/chunks/m2dceAnU.js","_app/immutable/chunks/DKU_2deH.js","_app/immutable/entry/app.DE4HKxpj.js","_app/immutable/chunks/CS4xyx6M.js","_app/immutable/chunks/m2dceAnU.js","_app/immutable/chunks/DcegSV8N.js","_app/immutable/chunks/Db3dOJqt.js","_app/immutable/chunks/DKU_2deH.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/CvosxF64.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
||||
nodes: [
|
||||
__memo(() => import('./chunks/0-BIaOo9PC.js')),
|
||||
__memo(() => import('./chunks/1-BGPacjVk.js')),
|
||||
__memo(() => import('./chunks/2-AuNPQJ-v.js')),
|
||||
__memo(() => import('./chunks/3-DEGBOxIZ.js')),
|
||||
__memo(() => import('./chunks/4-TkpNwhRF.js')),
|
||||
__memo(() => import('./chunks/5-B5o-1cPT.js'))
|
||||
],
|
||||
remotes: {
|
||||
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
id: "/",
|
||||
pattern: /^\/$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 2 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/items",
|
||||
pattern: /^\/items\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 4 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/login",
|
||||
pattern: /^\/login\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 5 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/logout",
|
||||
pattern: /^\/logout\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 3 },
|
||||
endpoint: null
|
||||
}
|
||||
],
|
||||
prerendered_routes: new Set([]),
|
||||
matchers: async () => {
|
||||
|
||||
return { };
|
||||
},
|
||||
server_assets: {}
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
const prerendered = new Set([]);
|
||||
|
||||
const base = "";
|
||||
|
||||
export { base, manifest, prerendered };
|
||||
//# sourceMappingURL=manifest.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([]),\n\tmimeTypes: {},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.C_SQrpA0.js\",app:\"_app/immutable/entry/app.DE4HKxpj.js\",imports:[\"_app/immutable/entry/start.C_SQrpA0.js\",\"_app/immutable/chunks/D6EhJnz8.js\",\"_app/immutable/chunks/Db3dOJqt.js\",\"_app/immutable/chunks/m2dceAnU.js\",\"_app/immutable/chunks/DKU_2deH.js\",\"_app/immutable/entry/app.DE4HKxpj.js\",\"_app/immutable/chunks/CS4xyx6M.js\",\"_app/immutable/chunks/m2dceAnU.js\",\"_app/immutable/chunks/DcegSV8N.js\",\"_app/immutable/chunks/Db3dOJqt.js\",\"_app/immutable/chunks/DKU_2deH.js\",\"_app/immutable/chunks/Bzak7iHL.js\",\"_app/immutable/chunks/CvosxF64.js\"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},\n\t\tnodes: [\n\t\t\t__memo(() => import('./nodes/0.js')),\n\t\t\t__memo(() => import('./nodes/1.js')),\n\t\t\t__memo(() => import('./nodes/2.js')),\n\t\t\t__memo(() => import('./nodes/3.js')),\n\t\t\t__memo(() => import('./nodes/4.js')),\n\t\t\t__memo(() => import('./nodes/5.js'))\n\t\t],\n\t\tremotes: {\n\t\t\t\n\t\t},\n\t\troutes: [\n\t\t\t{\n\t\t\t\tid: \"/\",\n\t\t\t\tpattern: /^\\/$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 2 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/items\",\n\t\t\t\tpattern: /^\\/items\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 4 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/login\",\n\t\t\t\tpattern: /^\\/login\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 5 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/logout\",\n\t\t\t\tpattern: /^\\/logout\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 3 },\n\t\t\t\tendpoint: null\n\t\t\t}\n\t\t],\n\t\tprerendered_routes: new Set([]),\n\t\tmatchers: async () => {\n\t\t\t\n\t\t\treturn { };\n\t\t},\n\t\tserver_assets: {}\n\t}\n}\n})();\n\nexport const prerendered = new Set([]);\n\nexport const base = \"\";"],"names":[],"mappings":"AAAY,MAAC,QAAQ,GAAG,CAAC,MAAM;AAC/B,SAAS,MAAM,CAAC,EAAE,EAAE;AACpB,CAAC,IAAI,KAAK;AACV,CAAC,OAAO,MAAM,KAAK,MAAM,KAAK,GAAG,EAAE,EAAE,CAAC;AACtC;;AAEA,OAAO;AACP,CAAC,MAAM,EAAE,MAAM;AACf,CAAC,OAAO,EAAE,MAAM;AAChB,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;AACpB,CAAC,SAAS,EAAE,EAAE;AACd,CAAC,CAAC,EAAE;AACJ,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,wCAAwC,CAAC,GAAG,CAAC,sCAAsC,CAAC,OAAO,CAAC,CAAC,wCAAwC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,sCAAsC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC;AACjoB,EAAE,KAAK,EAAE;AACT,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC;AACtC,GAAG;AACH,EAAE,OAAO,EAAE;AACX;AACA,GAAG;AACH,EAAE,MAAM,EAAE;AACV,GAAG;AACH,IAAI,EAAE,EAAE,GAAG;AACX,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd,IAAI;AACJ,GAAG;AACH,IAAI,EAAE,EAAE,QAAQ;AAChB,IAAI,OAAO,EAAE,cAAc;AAC3B,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd,IAAI;AACJ,GAAG;AACH,IAAI,EAAE,EAAE,QAAQ;AAChB,IAAI,OAAO,EAAE,cAAc;AAC3B,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd,IAAI;AACJ,GAAG;AACH,IAAI,EAAE,EAAE,SAAS;AACjB,IAAI,OAAO,EAAE,eAAe;AAC5B,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd;AACA,GAAG;AACH,EAAE,kBAAkB,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;AACjC,EAAE,QAAQ,EAAE,YAAY;AACxB;AACA,GAAG,OAAO,IAAI;AACd,EAAE,CAAC;AACH,EAAE,aAAa,EAAE;AACjB;AACA;AACA,CAAC;;AAEW,MAAC,WAAW,GAAG,IAAI,GAAG,CAAC,EAAE;;AAEzB,MAAC,IAAI,GAAG;;;;"}
|
||||
Reference in New Issue
Block a user