import { a as subscribe, h as set_store_value, c as compute_rest_props } from './lifecycle-px-3doLe.js'; import { c as create_ssr_component, b as add_attribute, v as validate_component, e as escape } from './ssr-ipqebOFl.js'; import { F as Form_field, C as Control, b as Form_label, I as Input, c as Form_description, d as Form_field_errors, R as Root, T as Trigger, a as Tooltip_content, S as Switch, e as Textarea } from './textarea-bqlfV9dO.js'; import './stores-Cv0rQqhp.js'; import { g as superForm } from './index-CUXxL1oq.js'; import './index-Ddp2AB5f.js'; import { b as zodClient } from './zod-D1iX83g6.js'; import { s as schema } from './7-BgL-yaFE.js'; import { k as toast } from './Toaster.svelte_svelte_type_style_lang-Bhmi0dH5.js'; import { c as config } from './config-BHx687w1.js'; import { B as Button, I as Icon$1 } from './button-JMjD_Bg6.js'; import './index3-JA_ucGjW.js'; import './index2-D4yenS_5.js'; import './scheduler-1Ju9dhbL.js'; import 'clsx'; import './exports-DuWZopOC.js'; import './stringify-D5iWhcfN.js'; import 'zod'; import './shared-server-i79vVjEm.js'; import 'tailwind-merge'; import 'tailwind-variants'; import './ssr2-BVSPLo1E.js'; const Circle_help = create_ssr_component(($$result, $$props, $$bindings, slots) => { const iconNode = [ ["circle", { "cx": "12", "cy": "12", "r": "10" }], [ "path", { "d": "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" } ], ["path", { "d": "M12 17h.01" }] ]; return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "circle-help" }, $$props, { iconNode }), {}, { default: () => { return `${slots.default ? slots.default({}) : ``}`; } })}`; }); const CircleQuestion = Circle_help; const Form_button = create_ssr_component(($$result, $$props, $$bindings, slots) => { let $$restProps = compute_rest_props($$props, []); return `${validate_component(Button, "Button.Root").$$render($$result, Object.assign({}, { type: "submit" }, $$restProps), {}, { default: () => { return `${slots.default ? slots.default({}) : ``}`; } })}`; }); const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => { let $formData, $$unsubscribe_formData; let $tainted, $$unsubscribe_tainted; let { data } = $$props; const form = superForm(data.form, { validators: zodClient(schema), resetForm: false, onResult: (e) => { if (e.result.type == "success") { toast.success("Website configuration successfully updated!"); } else { if (e.result.type === "error") { console.log(e.result.error); toast.error("Error when updating website. Message from server: " + e.result.error.message); } } } }); const { form: formData, enhance, tainted, isTainted } = form; $$unsubscribe_formData = subscribe(formData, (value) => $formData = value); $$unsubscribe_tainted = subscribe(tainted, (value) => $tainted = value); set_store_value(formData, $formData.id = data.blog_info.id, $formData); let disable_freebies = !$formData.use_freebie; !$formData.auto_publish; if ($$props.data === void 0 && $$bindings.data && data !== void 0) $$bindings.data(data); let $$settled; let $$rendered; let previous_head = $$result.head; do { $$settled = true; $$result.head = previous_head; disable_freebies = !$formData.use_freebie; !$formData.auto_publish; $$rendered = `
`; } while (!$$settled); $$unsubscribe_formData(); $$unsubscribe_tainted(); return $$rendered; }); export { Page as default }; //# sourceMappingURL=_page.svelte-BjcGCX-7.js.map