Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | function noop() { } function run(fn) { return fn(); } function blank_object() { return /* @__PURE__ */ Object.create(null); } function run_all(fns) { fns.forEach(run); } function safe_not_equal(a, b) { return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function"; } function subscribe(store, ...callbacks) { if (store == null) { for (const callback of callbacks) { callback(void 0); } return noop; } const unsub = store.subscribe(...callbacks); return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; } let current_component; function set_current_component(component) { current_component = component; } function get_current_component() { if (!current_component) throw new Error("Function called outside component initialization"); return current_component; } function setContext(key, context) { get_current_component().$$.context.set(key, context); return context; } function getContext(key) { return get_current_component().$$.context.get(key); } function ensure_array_like(array_like_or_iterator) { return array_like_or_iterator?.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator); } const ATTR_REGEX = /[&"]/g; const CONTENT_REGEX = /[&<]/g; function escape(value, is_attr = false) { const str = String(value); const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX; pattern.lastIndex = 0; let escaped = ""; let last = 0; while (pattern.test(str)) { const i = pattern.lastIndex - 1; const ch = str[i]; escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<"); last = i + 1; } return escaped + str.substring(last); } function each(items, fn) { items = ensure_array_like(items); let str = ""; for (let i = 0; i < items.length; i += 1) { str += fn(items[i], i); } return str; } const missing_component = { $$render: () => "" }; function validate_component(component, name) { if (!component || !component.$$render) { if (name === "svelte:component") name += " this={...}"; throw new Error( `<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.` ); } return component; } let on_destroy; function create_ssr_component(fn) { function $$render(result, props, bindings, slots, context) { const parent_component = current_component; const $$ = { on_destroy, context: new Map(context || (parent_component ? parent_component.$$.context : [])), // these will be immediately discarded on_mount: [], before_update: [], after_update: [], callbacks: blank_object() }; set_current_component({ $$ }); const html = fn(result, props, bindings, slots); set_current_component(parent_component); return html; } return { render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => { on_destroy = []; const result = { title: "", head: "", css: /* @__PURE__ */ new Set() }; const html = $$render(result, props, {}, $$slots, context); run_all(on_destroy); return { html, css: { code: Array.from(result.css).map((css) => css.code).join("\n"), map: null // TODO }, head: result.title + result.head }; }, $$render }; } function add_attribute(name, value, boolean) { if (value == null || boolean && !value) return ""; const assignment = boolean && value === true ? "" : `="${escape(value, true)}"`; return ` ${name}${assignment}`; } export { subscribe as a, each as b, create_ssr_component as c, add_attribute as d, escape as e, safe_not_equal as f, getContext as g, missing_component as m, noop as n, setContext as s, validate_component as v }; |