{"version":3,"file":"Toast.LIymbRzT.mjs","sources":["../../../../../../node_modules/svelte/src/runtime/internal/animations.js","../../../../../../node_modules/svelte/src/runtime/animate/index.js","../../../../../../src/lib/icons/CheckCircle.svelte","../../../../../../src/lib/icons/InformationCircle.svelte","../../../../../../src/lib/app/components/Toast.svelte"],"sourcesContent":["import { identity as linear, noop } from './utils.js';\nimport { now } from './environment.js';\nimport { loop } from './loop.js';\nimport { create_rule, delete_rule } from './style_manager.js';\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {import('./private.js').PositionRect} from\n * @param {import('./private.js').AnimationFn} fn\n */\nexport function create_animation(node, from, fn, params) {\n\tif (!from) return noop;\n\tconst to = node.getBoundingClientRect();\n\tif (\n\t\tfrom.left === to.left &&\n\t\tfrom.right === to.right &&\n\t\tfrom.top === to.top &&\n\t\tfrom.bottom === to.bottom\n\t)\n\t\treturn noop;\n\tconst {\n\t\tdelay = 0,\n\t\tduration = 300,\n\t\teasing = linear,\n\t\t// @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n\t\tstart: start_time = now() + delay,\n\t\t// @ts-ignore todo:\n\t\tend = start_time + duration,\n\t\ttick = noop,\n\t\tcss\n\t} = fn(node, { from, to }, params);\n\tlet running = true;\n\tlet started = false;\n\tlet name;\n\t/** @returns {void} */\n\tfunction start() {\n\t\tif (css) {\n\t\t\tname = create_rule(node, 0, 1, duration, delay, easing, css);\n\t\t}\n\t\tif (!delay) {\n\t\t\tstarted = true;\n\t\t}\n\t}\n\t/** @returns {void} */\n\tfunction stop() {\n\t\tif (css) delete_rule(node, name);\n\t\trunning = false;\n\t}\n\tloop((now) => {\n\t\tif (!started && now >= start_time) {\n\t\t\tstarted = true;\n\t\t}\n\t\tif (started && now >= end) {\n\t\t\ttick(1, 0);\n\t\t\tstop();\n\t\t}\n\t\tif (!running) {\n\t\t\treturn false;\n\t\t}\n\t\tif (started) {\n\t\t\tconst p = now - start_time;\n\t\t\tconst t = 0 + 1 * easing(p / duration);\n\t\t\ttick(t, 1 - t);\n\t\t}\n\t\treturn true;\n\t});\n\tstart();\n\ttick(0, 1);\n\treturn stop;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @returns {void}\n */\nexport function fix_position(node) {\n\tconst style = getComputedStyle(node);\n\tif (style.position !== 'absolute' && style.position !== 'fixed') {\n\t\tconst { width, height } = style;\n\t\tconst a = node.getBoundingClientRect();\n\t\tnode.style.position = 'absolute';\n\t\tnode.style.width = width;\n\t\tnode.style.height = height;\n\t\tadd_transform(node, a);\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {import('./private.js').PositionRect} a\n * @returns {void}\n */\nexport function add_transform(node, a) {\n\tconst b = node.getBoundingClientRect();\n\tif (a.left !== b.left || a.top !== b.top) {\n\t\tconst style = getComputedStyle(node);\n\t\tconst transform = style.transform === 'none' ? '' : style.transform;\n\t\tnode.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n\t}\n}\n","import { cubicOut } from '../easing/index.js';\nimport { is_function } from '../internal/index.js';\n\n/**\n * The flip function calculates the start and end position of an element and animates between them, translating the x and y values.\n * `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).\n *\n * https://svelte.dev/docs/svelte-animate#flip\n * @param {Element} node\n * @param {{ from: DOMRect; to: DOMRect }} fromTo\n * @param {import('./public.js').FlipParams} params\n * @returns {import('./public.js').AnimationConfig}\n */\nexport function flip(node, { from, to }, params = {}) {\n\tconst style = getComputedStyle(node);\n\tconst transform = style.transform === 'none' ? '' : style.transform;\n\tconst [ox, oy] = style.transformOrigin.split(' ').map(parseFloat);\n\tconst dx = from.left + (from.width * ox) / to.width - (to.left + ox);\n\tconst dy = from.top + (from.height * oy) / to.height - (to.top + oy);\n\tconst { delay = 0, duration = (d) => Math.sqrt(d) * 120, easing = cubicOut } = params;\n\treturn {\n\t\tdelay,\n\t\tduration: is_function(duration) ? duration(Math.sqrt(dx * dx + dy * dy)) : duration,\n\t\teasing,\n\t\tcss: (t, u) => {\n\t\t\tconst x = u * dx;\n\t\t\tconst y = u * dy;\n\t\t\tconst sx = t + (u * from.width) / to.width;\n\t\t\tconst sy = t + (u * from.height) / to.height;\n\t\t\treturn `transform: ${transform} translate(${x}px, ${y}px) scale(${sx}, ${sy});`;\n\t\t}\n\t};\n}\n","<script lang=\"ts\">\n\texport let active: boolean = false\n</script>\n\n<svg\n\txmlns=\"http://www.w3.org/2000/svg\"\n\tfill=\"none\"\n\tviewBox=\"0 0 24 24\"\n\tstroke-width=\"1.5\"\n\tstroke=\"currentColor\"\n\tclass:text-gray-500={active}\n\tclass:text-gray-400={!active}\n\tclass={' h-6 w-6 flex-shrink-0  group-hover:text-gray-500 dark:text-white ' + $$props.class}\n>\n\t<path\n\t\tstroke-linecap=\"round\"\n\t\tstroke-linejoin=\"round\"\n\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t/>\n</svg>\n","<svg\n\txmlns=\"http://www.w3.org/2000/svg\"\n\tfill=\"none\"\n\tviewBox=\"0 0 24 24\"\n\tstroke-width=\"1.5\"\n\tstroke=\"currentColor\"\n\tclass={'h-6 w-6  dark:fill-white dark:text-white ' + $$props.class}\n>\n\t<path\n\t\tstroke-linecap=\"round\"\n\t\tstroke-linejoin=\"round\"\n\t\td=\"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z\"\n\t/>\n</svg>\n","<script lang=\"ts\">\n\timport { flip } from 'svelte/animate'\n\timport { fly } from 'svelte/transition'\n\timport { notifications } from '$lib/store.js'\n\timport {\n\t\tExclamationTriangle,\n\t\tExclamationCircle,\n\t\tInformationCircle,\n\t\tCheckCircle\n\t} from '$lib/icons'\n\n\tconst icons = {\n\t\tCheckCircle,\n\t\tInformationCircle,\n\t\tExclamationCircle,\n\t\tExclamationTriangle\n\t}\n\n\tconst themes = {\n\t\tinfo: {\n\t\t\tbg: 'bg-blue-50 dark:bg-blue-50\t',\n\t\t\ttitleColor: 'text-blue-800 dark:text-blue-800',\n\t\t\ttextColor: 'text-blue-500 dark:text-blue-500 focus:ring-blue-500'\n\t\t},\n\t\tdanger: {\n\t\t\tbg: 'bg-red-50 dark:bg-red-50\t',\n\t\t\ttitleColor: 'text-red-800 dark:text-red-800',\n\t\t\ttextColor: 'text-red-400 dark:text-red-400 focus:ring-red-500'\n\t\t},\n\t\tsuccess: {\n\t\t\tbg: 'bg-green-50 dark:bg-green-50',\n\t\t\ttitleColor: 'text-green-800 dark:text-green-800',\n\t\t\ttextColor: 'text-green-400 dark:text-green-400 focus:ring-green-500'\n\t\t},\n\t\twarning: {\n\t\t\tbg: 'bg-amber-50 dark:bg-amber-50',\n\t\t\ttitleColor: 'text-amber-800 dark:amber-green-800',\n\t\t\ttextColor: 'text-amber-500 dark:text-amber-500 focus:ring-amber-500'\n\t\t}\n\t}\n</script>\n\n<div\n\taria-live=\"assertive\"\n\tclass=\"pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n>\n\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t{#each $notifications as notification (notification.id)}\n\t\t\t{@const type = themes[notification.type]}\n\n\t\t\t<div\n\t\t\t\tanimate:flip\n\t\t\t\ttransition:fly|global={{ y: 30 }}\n\t\t\t\tclass={`pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 dark:ring-white dark:ring-opacity-30 ${type.bg}`}\n\t\t\t>\n\t\t\t\t<div class=\"p-4\">\n\t\t\t\t\t<div class=\"flex items-start\">\n\t\t\t\t\t\t<div class=\"flex-shrink-0\">\n\t\t\t\t\t\t\t{#if notification.icon}\n\t\t\t\t\t\t\t\t<svelte:component\n\t\t\t\t\t\t\t\t\tthis={icons[notification.icon]}\n\t\t\t\t\t\t\t\t\tclass={type.textColor}\n\t\t\t\t\t\t\t\t\tactive={notification.active}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t<p class={`text-sm font-medium ${type.textColor}`}>\n\t\t\t\t\t\t\t\t{#if notification.message}{notification.message}{:else}Successfully saved!{/if}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p class=\"mt-1 hidden text-sm text-gray-500\">\n\t\t\t\t\t\t\t\tAnyone with a link can now view this file.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"ml-4 flex flex-shrink-0\">\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ton:click={() => notifications.close(notification.id)}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass={`inline-flex rounded bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 ${type.bg} ${type.textColor}`}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t<svg class=\"h-5 w-5\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\td=\"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t{/each}\n\t</div>\n</div>\n"],"names":["create_animation","node","from","fn","params","noop","to","delay","duration","easing","linear","start_time","now","end","tick","css","running","started","name","start","create_rule","stop","delete_rule","loop","p","t","fix_position","style","width","height","a","add_transform","b","transform","flip","ox","oy","dx","dy","d","cubicOut","is_function","u","x","y","sx","sy","ctx","insert_hydration","target","svg","anchor","append_hydration","path","active","$$props","child_ctx","dirty","switch_instance_changes","t_value","set_data","if_block0","create_if_block_1","create_if_block","attr","p0","p0_class_value","button","button_class_value","div5","div5_class_value","div4","div3","div0","div1","p1","div2","span","current","div5_transition","create_bidirectional_transition","fly","get_key","i","CheckCircle","InformationCircle","ExclamationCircle","ExclamationTriangle","notification","notifications"],"mappings":"k7BAUO,SAASA,GAAiBC,EAAMC,EAAMC,EAAIC,EAAQ,CACxD,GAAI,CAACF,EAAM,OAAOG,EAClB,MAAMC,EAAKL,EAAK,wBAChB,GACCC,EAAK,OAASI,EAAG,MACjBJ,EAAK,QAAUI,EAAG,OAClBJ,EAAK,MAAQI,EAAG,KAChBJ,EAAK,SAAWI,EAAG,OAEnB,OAAOD,EACR,KAAM,CACL,MAAAE,EAAQ,EACR,SAAAC,EAAW,IACX,OAAAC,EAASC,GAET,MAAOC,EAAaC,GAAG,EAAKL,EAE5B,IAAAM,EAAMF,EAAaH,EACnB,KAAAM,EAAOT,EACP,IAAAU,CACF,EAAKZ,EAAGF,EAAM,CAAE,KAAAC,EAAM,GAAAI,CAAE,EAAIF,CAAM,EACjC,IAAIY,EAAU,GACVC,EAAU,GACVC,EAEJ,SAASC,GAAQ,CACZJ,IACHG,EAAOE,GAAYnB,EAAM,EAAG,EAAGO,EAAUD,EAAOE,EAAQM,CAAG,GAEvDR,IACJU,EAAU,GAEX,CAED,SAASI,GAAO,CACXN,GAAKO,GAAYrB,EAAMiB,CAAI,EAC/BF,EAAU,EACV,CACD,OAAAO,GAAMX,GAAQ,CAQb,GAPI,CAACK,GAAWL,GAAOD,IACtBM,EAAU,IAEPA,GAAWL,GAAOC,IACrBC,EAAK,EAAG,CAAC,EACTO,KA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