Current section
Files
Jump to
Current section
Files
priv/static/live_svelte.min.js
var LiveSvelte=(()=>{var a=Object.defineProperty,y=Object.defineProperties,C=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyDescriptors,j=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var f=(t,e,n)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,c=(t,e)=>{for(var n in e||(e={}))h.call(e,n)&&f(t,n,e[n]);if(u)for(var n of u(e))k.call(e,n)&&f(t,n,e[n]);return t},m=(t,e)=>y(t,_(e));var J=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of j(e))!h.call(t,s)&&s!==n&&a(t,s,{get:()=>e[s],enumerable:!(o=C(e,s))||o.enumerable});return t};var z=t=>x(a({},"__esModule",{value:!0}),t);var N={};J(N,{getHooks:()=>A,getRender:()=>v});function d(t){if(!Array.isArray(t.default)||!Array.isArray(t.filenames))return t;let e={};for(let[n,o]of t.default.entries()){let s=o.default,r=t.filenames[n].replace("../svelte/","").replace(".svelte","");e[r]=s}return e}function v(t){return t=d(t),function(n,o,s){let r=t[n],b=Object.fromEntries(Object.entries(s).map(([E,w])=>[E,()=>w]));return r.render(o,{$$slots:b})}}function i(t,e){let n=t.el.getAttribute(e);return n?JSON.parse(n):{}}function p(t){var e;(e=t.parentNode)==null||e.removeChild(t)}function g(t,e,n){t.insertBefore(e,n||null)}function $(){}function H(t){let e={};for(let n in i(t,"data-slots")){let o=()=>({getElement(){let s=i(t,"data-slots")[n],r=document.createElement("div");return r.innerHTML=atob(s).trim(),r},update(){p(this.savedElement),this.savedElement=this.getElement(),g(this.savedTarget,this.savedElement,this.savedAnchor)},c:$,m(s,r){this.savedTarget=s,this.savedAnchor=r,this.savedElement=this.getElement(),g(this.savedTarget,this.savedElement,this.savedAnchor)},d(s){s&&p(this.savedElement)},l:$});e[n]=[o]}return e}function S(t){let e=i(t,"data-live-json");if(!Array.isArray(e))return e;let n={};for(let o of e){let s=window[o];s&&(n[o]=s)}return n}function l(t){return m(c(c({},i(t,"data-props")),S(t)),{live:t,$$slots:H(t),$$scope:{}})}function L(t){return t.$$.ctx.find(e=>e==null?void 0:e.default)}function A(t){return t=d(t),{SvelteHook:{mounted(){let n=this.el.getAttribute("data-name");if(!n)throw new Error("Component name must be provided");let o=t[n];if(!o)throw new Error(`Unable to find ${n} component.`);for(let s of Object.keys(i(this,"data-live-json")))window.addEventListener(`${s}_initialized`,r=>this._instance.$set(l(this)),!1),window.addEventListener(`${s}_patched`,r=>this._instance.$set(l(this)),!1);this._instance=new o({target:this.el,props:l(this),hydrate:this.el.hasAttribute("data-ssr")})},updated(){this._instance.$set(l(this));let n=L(this._instance);for(let o in n)n[o][0]().update()},destroyed(){}}}}return z(N);})();