@syncify/cli 0.2.3-beta → 0.3.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  'use strict';
3
2
 
4
3
  var cjs_js = require('./cjs.js');
@@ -9,4 +8,4 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
8
 
10
9
  var a__default = /*#__PURE__*/_interopDefault(a);
11
10
 
12
- cjs_js.e(a__default.default(process$1.argv.slice(1),{alias:{config:"c",input:"i",output:"o",build:"b",watch:"w",upload:"u",download:"d",theme:"t",help:"h",spawn:"s",filter:"f",delete:"del"},default:{cwd:process.cwd(),config:".",input:"source",cli:!0,dev:!0,prod:!1,import:!1,export:!1,build:!1,watch:!1,upload:!1,download:!1,terse:!1,hot:!1,help:!1,interactive:!1,views:!1,script:!1,style:!1,svg:!1,image:!1,metafields:!1,pages:!1,redirects:!1,clean:!1,silent:!1,force:!1,setup:!1,strap:!1},boolean:["build","watch","download","upload","import","export","hot","terse","help","interactive","dev","prod","metafields","pages","redirects","clean","silent","pull","force","test","vsc","strap","views","script","style","svg","image"],string:["input","output","config","theme","spawn","del","bump","filter","strap"]})).catch(cjs_js.a.throws);
11
+ cjs_js.e(a__default.default(process$1.argv.slice(1),{alias:{config:"c",input:"i",output:"o",build:"b",watch:"w",upload:"u",download:"d",theme:"t",help:"h",spawn:"s",resource:"r",filter:"f",delete:"del"},default:{cwd:process.cwd(),config:".",input:"source",cli:!0,dev:!0,prod:!1,import:!1,export:!1,build:!1,watch:!1,upload:!1,download:!1,terse:!1,hot:!1,help:!1,interactive:!1,views:!1,script:!1,style:!1,svg:!1,image:!1,metafields:!1,pages:!1,redirects:!1,clean:!1,silent:!1,force:!1,setup:!1,strap:!1},boolean:["build","watch","download","upload","import","export","hot","terse","help","interactive","dev","prod","metafields","pages","redirects","clean","silent","pull","force","test","vsc","strap","views","script","style","svg","image"],string:["input","output","config","theme","spawn","del","bump","resource","filter","strap"]})).catch(cjs_js.a.throws);
package/hot.js.liquid CHANGED
@@ -1,3 +1,3 @@
1
1
  <script>
2
- "use strict";(()=>{var fr=Object.create;var ft=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var sr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty;var $=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var or=(r,i,a,f)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of ur(i))!cr.call(r,s)&&s!==a&&ft(r,s,{get:()=>i[s],enumerable:!(f=lr(i,s))||f.enumerable});return r};var hr=(r,i,a)=>(a=r!=null?fr(sr(r)):{},or(i||!r||!r.__esModule?ft(a,"default",{value:r,enumerable:!0}):a,r));var ue=$((en,lt)=>{"use strict";function he(r,i,a,f,s,o){return{tag:r,key:i,attrs:a,children:f,text:s,dom:o,domSize:void 0,state:void 0,events:void 0,instance:void 0}}he.normalize=function(r){return Array.isArray(r)?he("[",void 0,void 0,he.normalizeChildren(r),void 0,void 0):r==null||typeof r=="boolean"?null:typeof r=="object"?r:he("#",void 0,void 0,String(r),void 0,void 0)};he.normalizeChildren=function(r){var i=[];if(r.length){for(var a=r[0]!=null&&r[0].key!=null,f=1;f<r.length;f++)if((r[f]!=null&&r[f].key!=null)!==a)throw new TypeError(a&&(r[f]!=null||typeof r[f]=="boolean")?"In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole.":"In fragments, vnodes must either all have keys or none have keys.");for(var f=0;f<r.length;f++)i[f]=he.normalize(r[f])}return i};lt.exports=he});var Be=$((tn,ut)=>{"use strict";var pr=ue();ut.exports=function(){var r=arguments[this],i=this+1,a;if(r==null?r={}:(typeof r!="object"||r.tag!=null||Array.isArray(r))&&(r={},i=this),arguments.length===i+1)a=arguments[i],Array.isArray(a)||(a=[a]);else for(a=[];i<arguments.length;)a.push(arguments[i++]);return pr("",r.key,r,a)}});var ve=$((rn,st)=>{"use strict";st.exports={}.hasOwnProperty});var Ke=$((nn,ht)=>{"use strict";var mr=ue(),yr=Be(),ye=ve(),gr=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,ot={};function ct(r){for(var i in r)if(ye.call(r,i))return!1;return!0}function dr(r){for(var i,a="div",f=[],s={};i=gr.exec(r);){var o=i[1],u=i[2];if(o===""&&u!=="")a=u;else if(o==="#")s.id=u;else if(o===".")f.push(u);else if(i[3][0]==="["){var p=i[6];p&&(p=p.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),i[4]==="class"?f.push(p):s[i[4]]=p===""?p:p||!0}}return f.length>0&&(s.className=f.join(" ")),ot[r]={tag:a,attrs:s}}function wr(r,i){var a=i.attrs,f=ye.call(a,"class"),s=f?a.class:a.className;if(i.tag=r.tag,i.attrs={},!ct(r.attrs)&&!ct(a)){var o={};for(var u in a)ye.call(a,u)&&(o[u]=a[u]);a=o}for(var u in r.attrs)ye.call(r.attrs,u)&&u!=="className"&&!ye.call(a,u)&&(a[u]=r.attrs[u]);(s!=null||r.attrs.className!=null)&&(a.className=s!=null?r.attrs.className!=null?String(r.attrs.className)+" "+String(s):s:r.attrs.className!=null?r.attrs.className:null),f&&(a.class=null);for(var u in a)if(ye.call(a,u)&&u!=="key"){i.attrs=a;break}return i}function br(r){if(r==null||typeof r!="string"&&typeof r!="function"&&typeof r.view!="function")throw Error("The selector must be either a string or a component.");var i=yr.apply(1,arguments);return typeof r=="string"&&(i.children=mr.normalizeChildren(i.children),r!=="[")?wr(ot[r]||dr(r),i):(i.tag=r,i)}ht.exports=br});var mt=$((an,pt)=>{"use strict";var vr=ue();pt.exports=function(r){return r==null&&(r=""),vr("<",void 0,void 0,r,void 0,void 0)}});var gt=$((fn,yt)=>{"use strict";var xr=ue(),Tr=Be();yt.exports=function(){var r=Tr.apply(0,arguments);return r.tag="[",r.children=xr.normalizeChildren(r.children),r}});var wt=$((ln,dt)=>{"use strict";var Xe=Ke();Xe.trust=mt();Xe.fragment=gt();dt.exports=Xe});var Ge=$((un,bt)=>{"use strict";var J=function(r){if(!(this instanceof J))throw new Error("Promise must be called with 'new'.");if(typeof r!="function")throw new TypeError("executor must be a function.");var i=this,a=[],f=[],s=h(a,!0),o=h(f,!1),u=i._instance={resolvers:a,rejectors:f},p=typeof setImmediate=="function"?setImmediate:setTimeout;function h(T,N){return function A(S){var y;try{if(N&&S!=null&&(typeof S=="object"||typeof S=="function")&&typeof(y=S.then)=="function"){if(S===i)throw new TypeError("Promise can't be resolved with itself.");w(y.bind(S))}else p(function(){!N&&T.length===0&&console.error("Possible unhandled promise rejection:",S);for(var m=0;m<T.length;m++)T[m](S);a.length=0,f.length=0,u.state=N,u.retry=function(){A(S)}})}catch(m){o(m)}}}function w(T){var N=0;function A(y){return function(m){N++>0||y(m)}}var S=A(o);try{T(A(s),S)}catch(y){S(y)}}w(r)};J.prototype.then=function(r,i){var a=this,f=a._instance;function s(h,w,T,N){w.push(function(A){if(typeof h!="function")T(A);else try{o(h(A))}catch(S){u&&u(S)}}),typeof f.retry=="function"&&N===f.state&&f.retry()}var o,u,p=new J(function(h,w){o=h,u=w});return s(r,f.resolvers,o,!0),s(i,f.rejectors,u,!1),p};J.prototype.catch=function(r){return this.then(null,r)};J.prototype.finally=function(r){return this.then(function(i){return J.resolve(r()).then(function(){return i})},function(i){return J.resolve(r()).then(function(){return J.reject(i)})})};J.resolve=function(r){return r instanceof J?r:new J(function(i){i(r)})};J.reject=function(r){return new J(function(i,a){a(r)})};J.all=function(r){return new J(function(i,a){var f=r.length,s=0,o=[];if(r.length===0)i([]);else for(var u=0;u<r.length;u++)(function(p){function h(w){s++,o[p]=w,s===f&&i(o)}r[p]!=null&&(typeof r[p]=="object"||typeof r[p]=="function")&&typeof r[p].then=="function"?r[p].then(h,a):h(r[p])})(u)})};J.race=function(r){return new J(function(i,a){for(var f=0;f<r.length;f++)r[f].then(i,a)})};bt.exports=J});var Je=$((sn,Ce)=>{"use strict";var xe=Ge();typeof window<"u"?(typeof window.Promise>"u"?window.Promise=xe:window.Promise.prototype.finally||(window.Promise.prototype.finally=xe.prototype.finally),Ce.exports=window.Promise):typeof global<"u"?(typeof global.Promise>"u"?global.Promise=xe:global.Promise.prototype.finally||(global.Promise.prototype.finally=xe.prototype.finally),Ce.exports=global.Promise):Ce.exports=xe});var xt=$((cn,vt)=>{"use strict";var We=ue();vt.exports=function(r){var i=r&&r.document,a,f={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function s(t){return t.attrs&&t.attrs.xmlns||f[t.tag]}function o(t,e){if(t.state!==e)throw new Error("'vnode.state' must not be modified.")}function u(t){var e=t.state;try{return this.apply(e,arguments)}finally{o(t,e)}}function p(){try{return i.activeElement}catch{return null}}function h(t,e,n,l,c,g,R){for(var j=n;j<l;j++){var v=e[j];v!=null&&w(t,v,c,R,g)}}function w(t,e,n,l,c){var g=e.tag;if(typeof g=="string")switch(e.state={},e.attrs!=null&&ze(e.attrs,e,n),g){case"#":T(t,e,c);break;case"<":A(t,e,l,c);break;case"[":S(t,e,n,l,c);break;default:y(t,e,n,l,c)}else d(t,e,n,l,c)}function T(t,e,n){e.dom=i.createTextNode(e.children),Y(t,e.dom,n)}var N={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function A(t,e,n,l){var c=e.children.match(/^\s*?<(\w+)/im)||[],g=i.createElement(N[c[1]]||"div");n==="http://www.w3.org/2000/svg"?(g.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e.children+"</svg>",g=g.firstChild):g.innerHTML=e.children,e.dom=g.firstChild,e.domSize=g.childNodes.length,e.instance=[];for(var R=i.createDocumentFragment(),j;j=g.firstChild;)e.instance.push(j),R.appendChild(j);Y(t,R,l)}function S(t,e,n,l,c){var g=i.createDocumentFragment();if(e.children!=null){var R=e.children;h(g,R,0,R.length,n,null,l)}e.dom=g.firstChild,e.domSize=g.childNodes.length,Y(t,g,c)}function y(t,e,n,l,c){var g=e.tag,R=e.attrs,j=R&&R.is;l=s(e)||l;var v=l?j?i.createElementNS(l,g,{is:j}):i.createElementNS(l,g):j?i.createElement(g,{is:j}):i.createElement(g);if(e.dom=v,R!=null&&F(e,R,l),Y(t,v,c),!Ae(e)&&e.children!=null){var H=e.children;h(v,H,0,H.length,n,null,l),e.tag==="select"&&R!=null&&se(e,R)}}function m(t,e){var n;if(typeof t.tag.view=="function"){if(t.state=Object.create(t.tag),n=t.state.view,n.$$reentrantLock$$!=null)return;n.$$reentrantLock$$=!0}else{if(t.state=void 0,n=t.tag,n.$$reentrantLock$$!=null)return;n.$$reentrantLock$$=!0,t.state=t.tag.prototype!=null&&typeof t.tag.prototype.view=="function"?new t.tag(t):t.tag(t)}if(ze(t.state,t,e),t.attrs!=null&&ze(t.attrs,t,e),t.instance=We.normalize(u.call(t.state.view,t)),t.instance===t)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}function d(t,e,n,l,c){m(e,n),e.instance!=null?(w(t,e.instance,n,l,c),e.dom=e.instance.dom,e.domSize=e.dom!=null?e.instance.domSize:0):e.domSize=0}function x(t,e,n,l,c,g){if(!(e===n||e==null&&n==null))if(e==null||e.length===0)h(t,n,0,n.length,l,c,g);else if(n==null||n.length===0)le(t,e,0,e.length);else{var R=e[0]!=null&&e[0].key!=null,j=n[0]!=null&&n[0].key!=null,v=0,H=0;if(!R)for(;H<e.length&&e[H]==null;)H++;if(!j)for(;v<n.length&&n[v]==null;)v++;if(R!==j)le(t,e,H,e.length),h(t,n,v,n.length,l,c,g);else if(j){for(var Z=e.length-1,G=n.length-1,qe,k,K,Q,V,Ie;Z>=H&&G>=v&&(Q=e[Z],V=n[G],Q.key===V.key);)Q!==V&&q(t,Q,V,l,c,g),V.dom!=null&&(c=V.dom),Z--,G--;for(;Z>=H&&G>=v&&(k=e[H],K=n[v],k.key===K.key);)H++,v++,k!==K&&q(t,k,K,l,U(e,H,c),g);for(;Z>=H&&G>=v&&!(v===G||k.key!==V.key||Q.key!==K.key);)Ie=U(e,H,c),te(t,Q,Ie),Q!==K&&q(t,Q,K,l,Ie,g),++v<=--G&&te(t,k,c),k!==V&&q(t,k,V,l,c,g),V.dom!=null&&(c=V.dom),H++,Z--,Q=e[Z],V=n[G],k=e[H],K=n[v];for(;Z>=H&&G>=v&&Q.key===V.key;)Q!==V&&q(t,Q,V,l,c,g),V.dom!=null&&(c=V.dom),Z--,G--,Q=e[Z],V=n[G];if(v>G)le(t,e,H,Z+1);else if(H>Z)h(t,n,v,G+1,l,c,g);else{var ar=c,at=G-v+1,be=new Array(at),_e=0,B=0,Fe=2147483647,$e=0,qe,Ve;for(B=0;B<at;B++)be[B]=-1;for(B=G;B>=v;B--){qe==null&&(qe=z(e,H,Z+1)),V=n[B];var me=qe[V.key];me!=null&&(Fe=me<Fe?me:-1,be[B-v]=me,Q=e[me],e[me]=null,Q!==V&&q(t,Q,V,l,c,g),V.dom!=null&&(c=V.dom),$e++)}if(c=ar,$e!==Z-H+1&&le(t,e,H,Z+1),$e===0)h(t,n,v,G+1,l,c,g);else if(Fe===-1)for(Ve=X(be),_e=Ve.length-1,B=G;B>=v;B--)K=n[B],be[B-v]===-1?w(t,K,l,g,c):Ve[_e]===B-v?_e--:te(t,K,c),K.dom!=null&&(c=n[B].dom);else for(B=G;B>=v;B--)K=n[B],be[B-v]===-1&&w(t,K,l,g,c),K.dom!=null&&(c=n[B].dom)}}else{var He=e.length<n.length?e.length:n.length;for(v=v<H?v:H;v<He;v++)k=e[v],K=n[v],!(k===K||k==null&&K==null)&&(k==null?w(t,K,l,g,U(e,v+1,c)):K==null?C(t,k):q(t,k,K,l,U(e,v+1,c),g));e.length>He&&le(t,e,v,e.length),n.length>He&&h(t,n,v,n.length,l,c,g)}}}function q(t,e,n,l,c,g){var R=e.tag,j=n.tag;if(R===j){if(n.state=e.state,n.events=e.events,ir(n,e))return;if(typeof R=="string")switch(n.attrs!=null&&Ue(n.attrs,n,l),R){case"#":M(e,n);break;case"<":b(t,e,n,g,c);break;case"[":D(t,e,n,l,c,g);break;default:P(e,n,l,g)}else I(t,e,n,l,c,g)}else C(t,e),w(t,n,l,g,c)}function M(t,e){t.children.toString()!==e.children.toString()&&(t.dom.nodeValue=e.children),e.dom=t.dom}function b(t,e,n,l,c){e.children!==n.children?(O(t,e),A(t,n,l,c)):(n.dom=e.dom,n.domSize=e.domSize,n.instance=e.instance)}function D(t,e,n,l,c,g){x(t,e.children,n.children,l,c,g);var R=0,j=n.children;if(n.dom=null,j!=null){for(var v=0;v<j.length;v++){var H=j[v];H!=null&&H.dom!=null&&(n.dom==null&&(n.dom=H.dom),R+=H.domSize||1)}R!==1&&(n.domSize=R)}}function P(t,e,n,l){var c=e.dom=t.dom;l=s(e)||l,e.tag==="textarea"&&e.attrs==null&&(e.attrs={}),pe(e,t.attrs,e.attrs,l),Ae(e)||x(c,t.children,e.children,n,null,l)}function I(t,e,n,l,c,g){if(n.instance=We.normalize(u.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");Ue(n.state,n,l),n.attrs!=null&&Ue(n.attrs,n,l),n.instance!=null?(e.instance==null?w(t,n.instance,l,g,c):q(t,e.instance,n.instance,l,c,g),n.dom=n.instance.dom,n.domSize=n.instance.domSize):e.instance!=null?(C(t,e.instance),n.dom=void 0,n.domSize=0):(n.dom=e.dom,n.domSize=e.domSize)}function z(t,e,n){for(var l=Object.create(null);e<n;e++){var c=t[e];if(c!=null){var g=c.key;g!=null&&(l[g]=e)}}return l}var E=[];function X(t){for(var e=[0],n=0,l=0,c=0,g=E.length=t.length,c=0;c<g;c++)E[c]=t[c];for(var c=0;c<g;++c)if(t[c]!==-1){var R=e[e.length-1];if(t[R]<t[c]){E[c]=R,e.push(c);continue}for(n=0,l=e.length-1;n<l;){var j=(n>>>1)+(l>>>1)+(n&l&1);t[e[j]]<t[c]?n=j+1:l=j}t[c]<t[e[n]]&&(n>0&&(E[c]=e[n-1]),e[n]=c)}for(n=e.length,l=e[n-1];n-- >0;)e[n]=l,l=E[l];return E.length=0,e}function U(t,e,n){for(;e<t.length;e++)if(t[e]!=null&&t[e].dom!=null)return t[e].dom;return n}function te(t,e,n){var l=i.createDocumentFragment();ne(t,l,e),Y(t,l,n)}function ne(t,e,n){for(;n.dom!=null&&n.dom.parentNode===t;){if(typeof n.tag!="string"){if(n=n.instance,n!=null)continue}else if(n.tag==="<")for(var l=0;l<n.instance.length;l++)e.appendChild(n.instance[l]);else if(n.tag!=="[")e.appendChild(n.dom);else if(n.children.length===1){if(n=n.children[0],n!=null)continue}else for(var l=0;l<n.children.length;l++){var c=n.children[l];c!=null&&ne(t,e,c)}break}}function Y(t,e,n){n!=null?t.insertBefore(e,n):t.appendChild(e)}function Ae(t){if(t.attrs==null||t.attrs.contenteditable==null&&t.attrs.contentEditable==null)return!1;var e=t.children;if(e!=null&&e.length===1&&e[0].tag==="<"){var n=e[0].children;t.dom.innerHTML!==n&&(t.dom.innerHTML=n)}else if(e!=null&&e.length!==0)throw new Error("Child node of a contenteditable must be trusted.");return!0}function le(t,e,n,l){for(var c=n;c<l;c++){var g=e[c];g!=null&&C(t,g)}}function C(t,e){var n=0,l=e.state,c,g;if(typeof e.tag!="string"&&typeof e.state.onbeforeremove=="function"){var R=u.call(e.state.onbeforeremove,e);R!=null&&typeof R.then=="function"&&(n=1,c=R)}if(e.attrs&&typeof e.attrs.onbeforeremove=="function"){var R=u.call(e.attrs.onbeforeremove,e);R!=null&&typeof R.then=="function"&&(n|=2,g=R)}if(o(e,l),!n)L(e),_(t,e);else{if(c!=null){var j=function(){n&1&&(n&=2,n||v())};c.then(j,j)}if(g!=null){var j=function(){n&2&&(n&=1,n||v())};g.then(j,j)}}function v(){o(e,l),L(e),_(t,e)}}function O(t,e){for(var n=0;n<e.instance.length;n++)t.removeChild(e.instance[n])}function _(t,e){for(;e.dom!=null&&e.dom.parentNode===t;){if(typeof e.tag!="string"){if(e=e.instance,e!=null)continue}else if(e.tag==="<")O(t,e);else{if(e.tag!=="["&&(t.removeChild(e.dom),!Array.isArray(e.children)))break;if(e.children.length===1){if(e=e.children[0],e!=null)continue}else for(var n=0;n<e.children.length;n++){var l=e.children[n];l!=null&&_(t,l)}}break}}function L(t){if(typeof t.tag!="string"&&typeof t.state.onremove=="function"&&u.call(t.state.onremove,t),t.attrs&&typeof t.attrs.onremove=="function"&&u.call(t.attrs.onremove,t),typeof t.tag!="string")t.instance!=null&&L(t.instance);else{var e=t.children;if(Array.isArray(e))for(var n=0;n<e.length;n++){var l=e[n];l!=null&&L(l)}}}function F(t,e,n){t.tag==="input"&&e.type!=null&&t.dom.setAttribute("type",e.type);var l=e!=null&&t.tag==="input"&&e.type==="file";for(var c in e)ie(t,c,null,e[c],n,l)}function ie(t,e,n,l,c,g){if(!(e==="key"||e==="is"||l==null||oe(e)||n===l&&!fe(t,e)&&typeof l!="object"||e==="type"&&t.tag==="input")){if(e[0]==="o"&&e[1]==="n")return it(t,e,l);if(e.slice(0,6)==="xlink:")t.dom.setAttributeNS("http://www.w3.org/1999/xlink",e.slice(6),l);else if(e==="style")nt(t.dom,n,l);else if(re(t,e,c)){if(e==="value"){if((t.tag==="input"||t.tag==="textarea")&&t.dom.value===""+l&&(g||t.dom===p())||t.tag==="select"&&n!==null&&t.dom.value===""+l||t.tag==="option"&&n!==null&&t.dom.value===""+l)return;if(g&&""+l!=""){console.error("`value` is read-only on file inputs!");return}}t.dom[e]=l}else typeof l=="boolean"?l?t.dom.setAttribute(e,""):t.dom.removeAttribute(e):t.dom.setAttribute(e==="className"?"class":e,l)}}function ae(t,e,n,l){if(!(e==="key"||e==="is"||n==null||oe(e)))if(e[0]==="o"&&e[1]==="n")it(t,e,void 0);else if(e==="style")nt(t.dom,n,null);else if(re(t,e,l)&&e!=="className"&&e!=="title"&&!(e==="value"&&(t.tag==="option"||t.tag==="select"&&t.dom.selectedIndex===-1&&t.dom===p()))&&!(t.tag==="input"&&e==="type"))t.dom[e]=null;else{var c=e.indexOf(":");c!==-1&&(e=e.slice(c+1)),n!==!1&&t.dom.removeAttribute(e==="className"?"class":e)}}function se(t,e){if("value"in e)if(e.value===null)t.dom.selectedIndex!==-1&&(t.dom.value=null);else{var n=""+e.value;(t.dom.value!==n||t.dom.selectedIndex===-1)&&(t.dom.value=n)}"selectedIndex"in e&&ie(t,"selectedIndex",null,e.selectedIndex,void 0)}function pe(t,e,n,l){if(e&&e===n&&console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major"),n!=null){t.tag==="input"&&n.type!=null&&t.dom.setAttribute("type",n.type);var c=t.tag==="input"&&n.type==="file";for(var g in n)ie(t,g,e&&e[g],n[g],l,c)}var R;if(e!=null)for(var g in e)(R=e[g])!=null&&(n==null||n[g]==null)&&ae(t,g,R,l)}function fe(t,e){return e==="value"||e==="checked"||e==="selectedIndex"||e==="selected"&&t.dom===p()||t.tag==="option"&&t.dom.parentNode===i.activeElement}function oe(t){return t==="oninit"||t==="oncreate"||t==="onupdate"||t==="onremove"||t==="onbeforeremove"||t==="onbeforeupdate"}function re(t,e,n){return n===void 0&&(t.tag.indexOf("-")>-1||t.attrs!=null&&t.attrs.is||e!=="href"&&e!=="list"&&e!=="form"&&e!=="width"&&e!=="height")&&e in t.dom}var de=/[A-Z]/g;function Ne(t){return"-"+t.toLowerCase()}function je(t){return t[0]==="-"&&t[1]==="-"?t:t==="cssFloat"?"float":t.replace(de,Ne)}function nt(t,e,n){if(e!==n)if(n==null)t.style.cssText="";else if(typeof n!="object")t.style.cssText=n;else if(e==null||typeof e!="object"){t.style.cssText="";for(var l in n){var c=n[l];c!=null&&t.style.setProperty(je(l),String(c))}}else{for(var l in n){var c=n[l];c!=null&&(c=String(c))!==String(e[l])&&t.style.setProperty(je(l),c)}for(var l in e)e[l]!=null&&n[l]==null&&t.style.removeProperty(je(l))}}function Me(){this._=a}Me.prototype=Object.create(null),Me.prototype.handleEvent=function(t){var e=this["on"+t.type],n;typeof e=="function"?n=e.call(t.currentTarget,t):typeof e.handleEvent=="function"&&e.handleEvent(t),this._&&t.redraw!==!1&&(0,this._)(),n===!1&&(t.preventDefault(),t.stopPropagation())};function it(t,e,n){if(t.events!=null){if(t.events._=a,t.events[e]===n)return;n!=null&&(typeof n=="function"||typeof n=="object")?(t.events[e]==null&&t.dom.addEventListener(e.slice(2),t.events,!1),t.events[e]=n):(t.events[e]!=null&&t.dom.removeEventListener(e.slice(2),t.events,!1),t.events[e]=void 0)}else n!=null&&(typeof n=="function"||typeof n=="object")&&(t.events=new Me,t.dom.addEventListener(e.slice(2),t.events,!1),t.events[e]=n)}function ze(t,e,n){typeof t.oninit=="function"&&u.call(t.oninit,e),typeof t.oncreate=="function"&&n.push(u.bind(t.oncreate,e))}function Ue(t,e,n){typeof t.onupdate=="function"&&n.push(u.bind(t.onupdate,e))}function ir(t,e){do{if(t.attrs!=null&&typeof t.attrs.onbeforeupdate=="function"){var n=u.call(t.attrs.onbeforeupdate,t,e);if(n!==void 0&&!n)break}if(typeof t.tag!="string"&&typeof t.state.onbeforeupdate=="function"){var n=u.call(t.state.onbeforeupdate,t,e);if(n!==void 0&&!n)break}return!1}while(!1);return t.dom=e.dom,t.domSize=e.domSize,t.instance=e.instance,t.attrs=e.attrs,t.children=e.children,t.text=e.text,!0}var we;return function(t,e,n){if(!t)throw new TypeError("DOM element being rendered to does not exist.");if(we!=null&&t.contains(we))throw new TypeError("Node is currently being rendered to and thus is locked.");var l=a,c=we,g=[],R=p(),j=t.namespaceURI;we=t,a=typeof n=="function"?n:void 0;try{t.vnodes==null&&(t.textContent=""),e=We.normalizeChildren(Array.isArray(e)?e:[e]),x(t,t.vnodes,e,g,null,j==="http://www.w3.org/1999/xhtml"?void 0:j),t.vnodes=e,R!=null&&p()!==R&&typeof R.focus=="function"&&R.focus();for(var v=0;v<g.length;v++)g[v]()}finally{a=l,we=c}}}});var Qe=$((on,Tt)=>{"use strict";Tt.exports=xt()(typeof window<"u"?window:null)});var qt=$((hn,Nt)=>{"use strict";var At=ue();Nt.exports=function(r,i,a){var f=[],s=!1,o=-1;function u(){for(o=0;o<f.length;o+=2)try{r(f[o],At(f[o+1]),p)}catch(w){a.error(w)}o=-1}function p(){s||(s=!0,i(function(){s=!1,u()}))}p.sync=u;function h(w,T){if(T!=null&&T.view==null&&typeof T!="function")throw new TypeError("m.mount expects a component, not a vnode.");var N=f.indexOf(w);N>=0&&(f.splice(N,2),N<=o&&(o-=2),r(w,[])),T!=null&&(f.push(w,T),r(w,At(T),p))}return{mount:h,redraw:p}}});var Se=$((pn,Ct)=>{"use strict";var Ar=Qe();Ct.exports=qt()(Ar,typeof requestAnimationFrame<"u"?requestAnimationFrame:null,typeof console<"u"?console:null)});var Ye=$((mn,St)=>{"use strict";St.exports=function(r){if(Object.prototype.toString.call(r)!=="[object Object]")return"";var i=[];for(var a in r)f(a,r[a]);return i.join("&");function f(s,o){if(Array.isArray(o))for(var u=0;u<o.length;u++)f(s+"["+u+"]",o[u]);else if(Object.prototype.toString.call(o)==="[object Object]")for(var u in o)f(s+"["+u+"]",o[u]);else i.push(encodeURIComponent(s)+(o!=null&&o!==""?"="+encodeURIComponent(o):""))}}});var Ze=$((yn,Ot)=>{"use strict";var Nr=ve();Ot.exports=Object.assign||function(r,i){for(var a in i)Nr.call(i,a)&&(r[a]=i[a])}});var Oe=$((gn,Rt)=>{"use strict";var qr=Ye(),Cr=Ze();Rt.exports=function(r,i){if(/:([^\/\.-]+)(\.{3})?:/.test(r))throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.");if(i==null)return r;var a=r.indexOf("?"),f=r.indexOf("#"),s=f<0?r.length:f,o=a<0?s:a,u=r.slice(0,o),p={};Cr(p,i);var h=u.replace(/:([^\/\.-]+)(\.{3})?/g,function(m,d,x){return delete p[d],i[d]==null?m:x?i[d]:encodeURIComponent(String(i[d]))}),w=h.indexOf("?"),T=h.indexOf("#"),N=T<0?h.length:T,A=w<0?N:w,S=h.slice(0,A);a>=0&&(S+=r.slice(a,s)),w>=0&&(S+=(a<0?"?":"&")+h.slice(w,N));var y=qr(p);return y&&(S+=(a<0&&w<0?"?":"&")+y),f>=0&&(S+=r.slice(f)),T>=0&&(S+=(f<0?"":"&")+h.slice(T)),S}});var Lt=$((dn,Et)=>{"use strict";var Sr=Oe(),Pt=ve();Et.exports=function(r,i,a){var f=0;function s(p){return new i(p)}s.prototype=i.prototype,s.__proto__=i;function o(p){return function(h,w){typeof h!="string"?(w=h,h=h.url):w==null&&(w={});var T=new i(function(y,m){p(Sr(h,w.params),w,function(d){if(typeof w.type=="function")if(Array.isArray(d))for(var x=0;x<d.length;x++)d[x]=new w.type(d[x]);else d=new w.type(d);y(d)},m)});if(w.background===!0)return T;var N=0;function A(){--N===0&&typeof a=="function"&&a()}return S(T);function S(y){var m=y.then;return y.constructor=s,y.then=function(){N++;var d=m.apply(y,arguments);return d.then(A,function(x){if(A(),N===0)throw x}),S(d)},y}}}function u(p,h){for(var w in p.headers)if(Pt.call(p.headers,w)&&w.toLowerCase()===h)return!0;return!1}return{request:o(function(p,h,w,T){var N=h.method!=null?h.method.toUpperCase():"GET",A=h.body,S=(h.serialize==null||h.serialize===JSON.serialize)&&!(A instanceof r.FormData||A instanceof r.URLSearchParams),y=h.responseType||(typeof h.extract=="function"?"":"json"),m=new r.XMLHttpRequest,d=!1,x=!1,q=m,M,b=m.abort;m.abort=function(){d=!0,b.call(this)},m.open(N,p,h.async!==!1,typeof h.user=="string"?h.user:void 0,typeof h.password=="string"?h.password:void 0),S&&A!=null&&!u(h,"content-type")&&m.setRequestHeader("Content-Type","application/json; charset=utf-8"),typeof h.deserialize!="function"&&!u(h,"accept")&&m.setRequestHeader("Accept","application/json, text/*"),h.withCredentials&&(m.withCredentials=h.withCredentials),h.timeout&&(m.timeout=h.timeout),m.responseType=y;for(var D in h.headers)Pt.call(h.headers,D)&&m.setRequestHeader(D,h.headers[D]);m.onreadystatechange=function(P){if(!d&&P.target.readyState===4)try{var I=P.target.status>=200&&P.target.status<300||P.target.status===304||/^file:\/\//i.test(p),z=P.target.response,E;if(y==="json"){if(!P.target.responseType&&typeof h.extract!="function")try{z=JSON.parse(P.target.responseText)}catch{z=null}}else(!y||y==="text")&&z==null&&(z=P.target.responseText);if(typeof h.extract=="function"?(z=h.extract(P.target,h),I=!0):typeof h.deserialize=="function"&&(z=h.deserialize(z)),I)w(z);else{var X=function(){try{E=P.target.responseText}catch{E=z}var U=new Error(E);U.code=P.target.status,U.response=z,T(U)};m.status===0?setTimeout(function(){x||X()}):X()}}catch(U){T(U)}},m.ontimeout=function(P){x=!0;var I=new Error("Request timed out");I.code=P.target.status,T(I)},typeof h.config=="function"&&(m=h.config(m,h,p)||m,m!==q&&(M=m.abort,m.abort=function(){d=!0,M.call(this)})),A==null?m.send():typeof h.serialize=="function"?m.send(h.serialize(A)):A instanceof r.FormData||A instanceof r.URLSearchParams?m.send(A):m.send(JSON.stringify(A))}),jsonp:o(function(p,h,w,T){var N=h.callbackName||"_mithril_"+Math.round(Math.random()*1e16)+"_"+f++,A=r.document.createElement("script");r[N]=function(S){delete r[N],A.parentNode.removeChild(A),w(S)},A.onerror=function(){delete r[N],A.parentNode.removeChild(A),T(new Error("JSONP request failed"))},A.src=p+(p.indexOf("?")<0?"?":"&")+encodeURIComponent(h.callbackKey||"callback")+"="+encodeURIComponent(N),r.document.documentElement.appendChild(A)})}}});var jt=$((wn,Dt)=>{"use strict";var Or=Je(),Rr=Se();Dt.exports=Lt()(typeof window<"u"?window:null,Or,Rr.redraw)});var ke=$((bn,zt)=>{"use strict";function Mt(r){try{return decodeURIComponent(r)}catch{return r}}zt.exports=function(r){if(r===""||r==null)return{};r.charAt(0)==="?"&&(r=r.slice(1));for(var i=r.split("&"),a={},f={},s=0;s<i.length;s++){var o=i[s].split("="),u=Mt(o[0]),p=o.length===2?Mt(o[1]):"";p==="true"?p=!0:p==="false"&&(p=!1);var h=u.split(/\]\[?|\[/),w=f;u.indexOf("[")>-1&&h.pop();for(var T=0;T<h.length;T++){var N=h[T],A=h[T+1],S=A==""||!isNaN(parseInt(A,10));if(N===""){var u=h.slice(0,T).join();a[u]==null&&(a[u]=Array.isArray(w)?w.length:0),N=a[u]++}else if(N==="__proto__")break;if(T===h.length-1)w[N]=p;else{var y=Object.getOwnPropertyDescriptor(w,N);y!=null&&(y=y.value),y==null&&(w[N]=y=S?[]:{}),w=y}}}return f}});var Re=$((vn,Ut)=>{"use strict";var Pr=ke();Ut.exports=function(r){var i=r.indexOf("?"),a=r.indexOf("#"),f=a<0?r.length:a,s=i<0?f:i,o=r.slice(0,s).replace(/\/{2,}/g,"/");return o?(o[0]!=="/"&&(o="/"+o),o.length>1&&o[o.length-1]==="/"&&(o=o.slice(0,-1))):o="/",{path:o,params:i<0?{}:Pr(r.slice(i+1,f))}}});var It=$((xn,Ht)=>{"use strict";var Er=Re();Ht.exports=function(r){var i=Er(r),a=Object.keys(i.params),f=[],s=new RegExp("^"+i.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(o,u,p){return u==null?"\\"+o:(f.push({k:u,r:p==="..."}),p==="..."?"(.*)":p==="."?"([^/]+)\\.":"([^/]+)"+(p||""))})+"$");return function(o){for(var u=0;u<a.length;u++)if(i.params[a[u]]!==o.params[a[u]])return!1;if(!f.length)return s.test(o.path);var p=s.exec(o.path);if(p==null)return!1;for(var u=0;u<f.length;u++)o.params[f[u].k]=f[u].r?p[u+1]:decodeURIComponent(p[u+1]);return!0}}});var et=$((Tn,$t)=>{"use strict";var _t=ve(),Ft=new RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");$t.exports=function(r,i){var a={};if(i!=null)for(var f in r)_t.call(r,f)&&!Ft.test(f)&&i.indexOf(f)<0&&(a[f]=r[f]);else for(var f in r)_t.call(r,f)&&!Ft.test(f)&&(a[f]=r[f]);return a}});var Xt=$((An,Kt)=>{"use strict";var Lr=ue(),Dr=Ke(),jr=Je(),Vt=Oe(),Bt=Re(),Mr=It(),zr=Ze(),Ur=et(),tt={};function Hr(r){try{return decodeURIComponent(r)}catch{return r}}Kt.exports=function(r,i){var a=r==null?null:typeof r.setImmediate=="function"?r.setImmediate:r.setTimeout,f=jr.resolve(),s=!1,o=!1,u=0,p,h,w=tt,T,N,A,S,y={onbeforeupdate:function(){return u=u?2:1,!(!u||tt===w)},onremove:function(){r.removeEventListener("popstate",x,!1),r.removeEventListener("hashchange",d,!1)},view:function(){if(!(!u||tt===w)){var b=[Lr(T,N.key,N)];return w&&(b=w.render(b[0])),b}}},m=M.SKIP={};function d(){s=!1;var b=r.location.hash;M.prefix[0]!=="#"&&(b=r.location.search+b,M.prefix[0]!=="?"&&(b=r.location.pathname+b,b[0]!=="/"&&(b="/"+b)));var D=b.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,Hr).slice(M.prefix.length),P=Bt(D);zr(P.params,r.history.state);function I(E){console.error(E),q(h,null,{replace:!0})}z(0);function z(E){for(;E<p.length;E++)if(p[E].check(P)){var X=p[E].component,U=p[E].route,te=X,ne=S=function(Y){if(ne===S){if(Y===m)return z(E+1);T=Y!=null&&(typeof Y.view=="function"||typeof Y=="function")?Y:"div",N=P.params,A=D,S=null,w=X.render?X:null,u===2?i.redraw():(u=2,i.redraw.sync())}};X.view||typeof X=="function"?(X={},ne(te)):X.onmatch?f.then(function(){return X.onmatch(P.params,D,U)}).then(ne,D===h?null:I):ne("div");return}if(D===h)throw new Error("Could not resolve default route "+h+".");q(h,null,{replace:!0})}}function x(){s||(s=!0,a(d))}function q(b,D,P){if(b=Vt(b,D),o){x();var I=P?P.state:null,z=P?P.title:null;P&&P.replace?r.history.replaceState(I,z,M.prefix+b):r.history.pushState(I,z,M.prefix+b)}else r.location.href=M.prefix+b}function M(b,D,P){if(!b)throw new TypeError("DOM element being rendered to does not exist.");if(p=Object.keys(P).map(function(z){if(z[0]!=="/")throw new SyntaxError("Routes must start with a '/'.");if(/:([^\/\.-]+)(\.{3})?:/.test(z))throw new SyntaxError("Route parameter names must be separated with either '/', '.', or '-'.");return{route:z,component:P[z],check:Mr(z)}}),h=D,D!=null){var I=Bt(D);if(!p.some(function(z){return z.check(I)}))throw new ReferenceError("Default route doesn't match any known routes.")}typeof r.history.pushState=="function"?r.addEventListener("popstate",x,!1):M.prefix[0]==="#"&&r.addEventListener("hashchange",d,!1),o=!0,i.mount(b,y),d()}return M.set=function(b,D,P){S!=null&&(P=P||{},P.replace=!0),S=null,q(b,D,P)},M.get=function(){return A},M.prefix="#!",M.Link={view:function(b){var D=Dr(b.attrs.selector||"a",Ur(b.attrs,["options","params","selector","onclick"]),b.children),P,I,z;return(D.attrs.disabled=!!D.attrs.disabled)?(D.attrs.href=null,D.attrs["aria-disabled"]="true"):(P=b.attrs.options,I=b.attrs.onclick,z=Vt(D.attrs.href,b.attrs.params),D.attrs.href=M.prefix+z,D.attrs.onclick=function(E){var X;typeof I=="function"?X=I.call(E.currentTarget,E):I==null||typeof I!="object"||typeof I.handleEvent=="function"&&I.handleEvent(E),X!==!1&&!E.defaultPrevented&&(E.button===0||E.which===0||E.which===1)&&(!E.currentTarget.target||E.currentTarget.target==="_self")&&!E.ctrlKey&&!E.metaKey&&!E.shiftKey&&!E.altKey&&(E.preventDefault(),E.redraw=!1,M.set(z,null,P))}),D}},M.param=function(b){return N&&b!=null?N[b]:N},M}});var Jt=$((Nn,Gt)=>{"use strict";var Ir=Se();Gt.exports=Xt()(typeof window<"u"?window:null,Ir)});var Zt=$((qn,Yt)=>{"use strict";var Pe=wt(),Wt=jt(),Qt=Se(),W=function(){return Pe.apply(this,arguments)};W.m=Pe;W.trust=Pe.trust;W.fragment=Pe.fragment;W.Fragment="[";W.mount=Qt.mount;W.route=Jt();W.render=Qe();W.redraw=Qt.redraw;W.request=Wt.request;W.jsonp=Wt.jsonp;W.parseQueryString=ke();W.buildQueryString=Ye();W.parsePathname=Re();W.buildPathname=Oe();W.vnode=ue();W.PromisePolyfill=Ge();W.censor=et();Yt.exports=W});var ge=hr(Zt());var kt=11;function _r(r,i){var a=i.attributes,f,s,o,u,p;if(!(i.nodeType===kt||r.nodeType===kt)){for(var h=a.length-1;h>=0;h--)f=a[h],s=f.name,o=f.namespaceURI,u=f.value,o?(s=f.localName||s,p=r.getAttributeNS(o,s),p!==u&&(f.prefix==="xmlns"&&(s=f.name),r.setAttributeNS(o,s,u))):(p=r.getAttribute(s),p!==u&&r.setAttribute(s,u));for(var w=r.attributes,T=w.length-1;T>=0;T--)f=w[T],s=f.name,o=f.namespaceURI,o?(s=f.localName||s,i.hasAttributeNS(o,s)||r.removeAttributeNS(o,s)):i.hasAttribute(s)||r.removeAttribute(s)}}var Ee,Fr="http://www.w3.org/1999/xhtml",ee=typeof document>"u"?void 0:document,$r=!!ee&&"content"in ee.createElement("template"),Vr=!!ee&&ee.createRange&&"createContextualFragment"in ee.createRange();function Br(r){var i=ee.createElement("template");return i.innerHTML=r,i.content.childNodes[0]}function Kr(r){Ee||(Ee=ee.createRange(),Ee.selectNode(ee.body));var i=Ee.createContextualFragment(r);return i.childNodes[0]}function Xr(r){var i=ee.createElement("body");return i.innerHTML=r,i.childNodes[0]}function Gr(r){return r=r.trim(),$r?Br(r):Vr?Kr(r):Xr(r)}function Le(r,i){var a=r.nodeName,f=i.nodeName,s,o;return a===f?!0:(s=a.charCodeAt(0),o=f.charCodeAt(0),s<=90&&o>=97?a===f.toUpperCase():o<=90&&s>=97?f===a.toUpperCase():!1)}function Jr(r,i){return!i||i===Fr?ee.createElement(r):ee.createElementNS(i,r)}function Wr(r,i){for(var a=r.firstChild;a;){var f=a.nextSibling;i.appendChild(a),a=f}return i}function rt(r,i,a){r[a]!==i[a]&&(r[a]=i[a],r[a]?r.setAttribute(a,""):r.removeAttribute(a))}var er={OPTION:function(r,i){var a=r.parentNode;if(a){var f=a.nodeName.toUpperCase();f==="OPTGROUP"&&(a=a.parentNode,f=a&&a.nodeName.toUpperCase()),f==="SELECT"&&!a.hasAttribute("multiple")&&(r.hasAttribute("selected")&&!i.selected&&(r.setAttribute("selected","selected"),r.removeAttribute("selected")),a.selectedIndex=-1)}rt(r,i,"selected")},INPUT:function(r,i){rt(r,i,"checked"),rt(r,i,"disabled"),r.value!==i.value&&(r.value=i.value),i.hasAttribute("value")||r.removeAttribute("value")},TEXTAREA:function(r,i){var a=i.value;r.value!==a&&(r.value=a);var f=r.firstChild;if(f){var s=f.nodeValue;if(s==a||!a&&s==r.placeholder)return;f.nodeValue=a}},SELECT:function(r,i){if(!i.hasAttribute("multiple")){for(var a=-1,f=0,s=r.firstChild,o,u;s;)if(u=s.nodeName&&s.nodeName.toUpperCase(),u==="OPTGROUP")o=s,s=o.firstChild;else{if(u==="OPTION"){if(s.hasAttribute("selected")){a=f;break}f++}s=s.nextSibling,!s&&o&&(s=o.nextSibling,o=null)}r.selectedIndex=a}}},Te=1,tr=11,rr=3,nr=8;function ce(){}function Qr(r){if(r)return r.getAttribute&&r.getAttribute("id")||r.id}function Yr(r){return function(a,f,s){if(s||(s={}),typeof f=="string")if(a.nodeName==="#document"||a.nodeName==="HTML"||a.nodeName==="BODY"){var o=f;f=ee.createElement("html"),f.innerHTML=o}else f=Gr(f);else f.nodeType===tr&&(f=f.firstElementChild);var u=s.getNodeKey||Qr,p=s.onBeforeNodeAdded||ce,h=s.onNodeAdded||ce,w=s.onBeforeElUpdated||ce,T=s.onElUpdated||ce,N=s.onBeforeNodeDiscarded||ce,A=s.onNodeDiscarded||ce,S=s.onBeforeElChildrenUpdated||ce,y=s.skipFromChildren||ce,m=s.addChild||function(C,O){return C.appendChild(O)},d=s.childrenOnly===!0,x=Object.create(null),q=[];function M(C){q.push(C)}function b(C,O){if(C.nodeType===Te)for(var _=C.firstChild;_;){var L=void 0;O&&(L=u(_))?M(L):(A(_),_.firstChild&&b(_,O)),_=_.nextSibling}}function D(C,O,_){N(C)!==!1&&(O&&O.removeChild(C),A(C),b(C,_))}function P(C){if(C.nodeType===Te||C.nodeType===tr)for(var O=C.firstChild;O;){var _=u(O);_&&(x[_]=O),P(O),O=O.nextSibling}}P(a);function I(C){h(C);for(var O=C.firstChild;O;){var _=O.nextSibling,L=u(O);if(L){var F=x[L];F&&Le(O,F)?(O.parentNode.replaceChild(F,O),E(F,O)):I(O)}else I(O);O=_}}function z(C,O,_){for(;O;){var L=O.nextSibling;(_=u(O))?M(_):D(O,C,!0),O=L}}function E(C,O,_){var L=u(O);L&&delete x[L],!(!_&&(w(C,O)===!1||(r(C,O),T(C),S(C,O)===!1)))&&(C.nodeName!=="TEXTAREA"?X(C,O):er.TEXTAREA(C,O))}function X(C,O){var _=y(C),L=O.firstChild,F=C.firstChild,ie,ae,se,pe,fe;e:for(;L;){for(pe=L.nextSibling,ie=u(L);!_&&F;){if(se=F.nextSibling,L.isSameNode&&L.isSameNode(F)){L=pe,F=se;continue e}ae=u(F);var oe=F.nodeType,re=void 0;if(oe===L.nodeType&&(oe===Te?(ie?ie!==ae&&((fe=x[ie])?se===fe?re=!1:(C.insertBefore(fe,F),ae?M(ae):D(F,C,!0),F=fe):re=!1):ae&&(re=!1),re=re!==!1&&Le(F,L),re&&E(F,L)):(oe===rr||oe==nr)&&(re=!0,F.nodeValue!==L.nodeValue&&(F.nodeValue=L.nodeValue))),re){L=pe,F=se;continue e}ae?M(ae):D(F,C,!0),F=se}if(ie&&(fe=x[ie])&&Le(fe,L))_||m(C,fe),E(fe,L);else{var de=p(L);de!==!1&&(de&&(L=de),L.actualize&&(L=L.actualize(C.ownerDocument||ee)),m(C,L),I(L))}L=pe,F=se}z(C,F,ae);var Ne=er[C.nodeName];Ne&&Ne(C,O)}var U=a,te=U.nodeType,ne=f.nodeType;if(!d){if(te===Te)ne===Te?Le(a,f)||(A(a),U=Wr(a,Jr(f.nodeName,f.namespaceURI))):U=f;else if(te===rr||te===nr){if(ne===te)return U.nodeValue!==f.nodeValue&&(U.nodeValue=f.nodeValue),U;U=f}}if(U===f)A(a);else{if(f.isSameNode&&f.isSameNode(U))return;if(E(U,f,d),q)for(var Y=0,Ae=q.length;Y<Ae;Y++){var le=x[q[Y]];le&&D(le,le.parentNode,!1)}}return!d&&U!==a&&a.parentNode&&(U.actualize&&(U=U.actualize(a.ownerDocument||ee)),a.parentNode.replaceChild(U,a)),U}}var Zr=Yr(_r),De=Zr;(function(r){window.syncify=window.syncify||{ready:!1};let i=`http://localhost:${r.server}/`,a=new WebSocket(`ws://localhost:${r.socket}/ws`),f=new DOMParser,s={onBeforeElUpdated:function(y,m){return!(y.id==="syncify-hot-label-status"||y.tagName==="SCRIPT"||y.tagName==="STYLE"||y.isEqualNode(m))}};function o(y){return{list:()=>Object.keys(y).length>0?y:null,get:m=>m in y?document.body.querySelectorAll(y[m].join(",")):null,load:()=>{y={};let m=document.body.querySelectorAll(".shopify-section");return m?(m.forEach(d=>{let x=/_{2}[\w-]+$/g.exec(d.id),q=x!==null?x[0].slice(2):d.id;q in y?y[q].push("#"+d.id):y[q]=["#"+d.id]}),y):null}}}let u=function(){let m="Syncify Connected",d=document.createElement("div");d.id="syncify-hot-label-status";let x={position:"fixed",left:"0",bottom:"0",right:"0",margin:"0 auto",display:"flex",color:"#f7f7f7",zIndex:"99999",fontFamily:"system-ui,sans-serif",textAlign:"center",justifyContent:"space-around",alignItems:"center",fontSize:"11px"},q={padding:"5px 20px",backgroundColor:"#232326",border:"0.8px solid transparent",borderRadius:"5px",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",borderBottom:"0"},M={view:()=>(0,ge.default)("div",{style:q},m)};return Object.assign(d.style,x),window.syncify.style={parent:b=>{Object.assign(d.style,x,b),ge.default.redraw()},label:b=>{Object.assign(q,b),ge.default.redraw()}},ge.default.mount(d,M),{get node(){return d},event:b=>(b!==void 0&&(m=b),ge.default.redraw(),m),render:b=>{b.contains(d)||b.append(d)}}}(),p=function(y){let m=null;return{start:()=>{let d=performance.now();y.push(d)},stop:()=>{m!==null&&(clearTimeout(m),m=null),m=setTimeout(()=>{u.event("Waiting for changes..."),m=null},5e3);let d=performance.now()-y.pop();if(d<1e3)return`${d.toFixed(0)}ms`;let x=d/1e3;if(x<60)return`${x.toFixed(0)}s ${+d.toFixed(0).slice(1)}ms`;let q=(x/60).toFixed(0);return`${q}m ${x-60*Number(q)}s ${+d.toFixed(0).slice(1)}ms`}}}([]);function h(y){let m=y.lastIndexOf("/")+1,d=y.indexOf("?",m);return(d>-1?y.substring(m,d):y.substring(m))+"?v="+Date.now()}function w(y,m){return typeof m!="string"?!1:y.slice(y.lastIndexOf("/")+1).startsWith(m)}function T(y,m){return y.querySelectorAll("link[rel=stylesheet]").forEach(d=>{let x=d.getAttribute("href");w(x,m)&&d.setAttribute("href",i+h(x))}),y}function N(y,m){return y.querySelectorAll("script").forEach(d=>{if(!d.hasAttribute("src"))return;let x=d.getAttribute("src");if(!w(x,m))return;let q=document.createElement("script");q.setAttribute("src",i+h(x));for(let M of Array.from(d.attributes))M.nodeName!=="src"&&q.setAttribute(M.nodeName,M.nodeValue);d.replaceWith(q)}),y}function A(y){return N(y),T(y),y}function S(y,m){return new Promise(function(d,x){let q=new XMLHttpRequest;q.responseType=m,q.open("GET",y),q.setRequestHeader("X-Syncify-Reload","true"),q.setRequestHeader("X-Requested-With","XMLHttpRequest"),q.onload=()=>d(q.response),q.onerror=()=>x(q.statusText),q.send()})}a.addEventListener("message",function({data:y}){if(y==="reload")return u.event("Refreshing"),top.location.reload();if(y==="replace")return p.start(),u.event("Reloading"),S(location.href,"text").then(m=>{let d=f.parseFromString(m,"text/html"),x=A(d);console.log(x.body),De(document.body,x.body,s),u.render(document.body),u.event(`Reloaded in ${p.stop()}`)});{p.start();let[m,d]=y.split(",");if(m==="section"){let x=window.syncify.sections.get(d);if(u.event(`Reloading Section: ${d}`),x===null){window.syncify.reload();return}return S(`${location.pathname}?sections=${d}`,"json").then(q=>{x!==null&&(x.forEach(M=>{De(M,q[d],{childrenOnly:!0,onBeforeElUpdated:function(b,D){return!(b.tagName==="SCRIPT"||b.tagName==="STYLE"||b.isEqualNode(D))}})}),u.event(`Reloaded in ${p.stop()}`))})}else m==="script"?(u.event(`Reloading JavaScript: ${d}`),N(document,d),u.event(`Reloaded in ${p.stop()}`)):m==="stylesheet"&&(u.event(`Reloading Stylesheet: ${d}`),T(document,d),u.event(`Reloaded in ${p.stop()}`))}}),window.syncify.sections=o({}),window.syncify.assets=()=>A(document),window.syncify.refresh=()=>top.location.reload(),window.syncify.reload=()=>S(location.href,"text").then(y=>{let m=f.parseFromString(y,"text/html");De(document.body,A(m).body,s),u.render(document.body),window.syncify.sections.load()}),document.addEventListener("DOMContentLoaded",()=>{u.render(document.body),window.syncify.sections.load(),window.syncify.ready=!0})})({server:"{{- server | default: 3000 -}}",socket:"{{- socket | default: 8089 -}}",label:'{{- label | default: "visible" -}}'});})();
2
+ "use strict";(()=>{var fr=Object.create;var ft=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var sr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty;var V=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var or=(r,i,a,f)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of ur(i))!cr.call(r,c)&&c!==a&&ft(r,c,{get:()=>i[c],enumerable:!(f=lr(i,c))||f.enumerable});return r};var hr=(r,i,a)=>(a=r!=null?fr(sr(r)):{},or(i||!r||!r.__esModule?ft(a,"default",{value:r,enumerable:!0}):a,r));var ue=V((en,lt)=>{"use strict";function he(r,i,a,f,c,h){return{tag:r,key:i,attrs:a,children:f,text:c,dom:h,domSize:void 0,state:void 0,events:void 0,instance:void 0}}he.normalize=function(r){return Array.isArray(r)?he("[",void 0,void 0,he.normalizeChildren(r),void 0,void 0):r==null||typeof r=="boolean"?null:typeof r=="object"?r:he("#",void 0,void 0,String(r),void 0,void 0)};he.normalizeChildren=function(r){var i=[];if(r.length){for(var a=r[0]!=null&&r[0].key!=null,f=1;f<r.length;f++)if((r[f]!=null&&r[f].key!=null)!==a)throw new TypeError(a&&(r[f]!=null||typeof r[f]=="boolean")?"In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole.":"In fragments, vnodes must either all have keys or none have keys.");for(var f=0;f<r.length;f++)i[f]=he.normalize(r[f])}return i};lt.exports=he});var Be=V((tn,ut)=>{"use strict";var pr=ue();ut.exports=function(){var r=arguments[this],i=this+1,a;if(r==null?r={}:(typeof r!="object"||r.tag!=null||Array.isArray(r))&&(r={},i=this),arguments.length===i+1)a=arguments[i],Array.isArray(a)||(a=[a]);else for(a=[];i<arguments.length;)a.push(arguments[i++]);return pr("",r.key,r,a)}});var ve=V((rn,st)=>{"use strict";st.exports={}.hasOwnProperty});var Ke=V((nn,ht)=>{"use strict";var mr=ue(),yr=Be(),ye=ve(),gr=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,ot={};function ct(r){for(var i in r)if(ye.call(r,i))return!1;return!0}function dr(r){for(var i,a="div",f=[],c={};i=gr.exec(r);){var h=i[1],s=i[2];if(h===""&&s!=="")a=s;else if(h==="#")c.id=s;else if(h===".")f.push(s);else if(i[3][0]==="["){var p=i[6];p&&(p=p.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),i[4]==="class"?f.push(p):c[i[4]]=p===""?p:p||!0}}return f.length>0&&(c.className=f.join(" ")),ot[r]={tag:a,attrs:c}}function wr(r,i){var a=i.attrs,f=ye.call(a,"class"),c=f?a.class:a.className;if(i.tag=r.tag,i.attrs={},!ct(r.attrs)&&!ct(a)){var h={};for(var s in a)ye.call(a,s)&&(h[s]=a[s]);a=h}for(var s in r.attrs)ye.call(r.attrs,s)&&s!=="className"&&!ye.call(a,s)&&(a[s]=r.attrs[s]);(c!=null||r.attrs.className!=null)&&(a.className=c!=null?r.attrs.className!=null?String(r.attrs.className)+" "+String(c):c:r.attrs.className!=null?r.attrs.className:null),f&&(a.class=null);for(var s in a)if(ye.call(a,s)&&s!=="key"){i.attrs=a;break}return i}function br(r){if(r==null||typeof r!="string"&&typeof r!="function"&&typeof r.view!="function")throw Error("The selector must be either a string or a component.");var i=yr.apply(1,arguments);return typeof r=="string"&&(i.children=mr.normalizeChildren(i.children),r!=="[")?wr(ot[r]||dr(r),i):(i.tag=r,i)}ht.exports=br});var mt=V((an,pt)=>{"use strict";var vr=ue();pt.exports=function(r){return r==null&&(r=""),vr("<",void 0,void 0,r,void 0,void 0)}});var gt=V((fn,yt)=>{"use strict";var xr=ue(),Tr=Be();yt.exports=function(){var r=Tr.apply(0,arguments);return r.tag="[",r.children=xr.normalizeChildren(r.children),r}});var wt=V((ln,dt)=>{"use strict";var We=Ke();We.trust=mt();We.fragment=gt();dt.exports=We});var Xe=V((un,bt)=>{"use strict";var G=function(r){if(!(this instanceof G))throw new Error("Promise must be called with 'new'.");if(typeof r!="function")throw new TypeError("executor must be a function.");var i=this,a=[],f=[],c=u(a,!0),h=u(f,!1),s=i._instance={resolvers:a,rejectors:f},p=typeof setImmediate=="function"?setImmediate:setTimeout;function u(A,C){return function S(P){var L;try{if(C&&P!=null&&(typeof P=="object"||typeof P=="function")&&typeof(L=P.then)=="function"){if(P===i)throw new TypeError("Promise can't be resolved with itself.");g(L.bind(P))}else p(function(){!C&&A.length===0&&console.error("Possible unhandled promise rejection:",P);for(var N=0;N<A.length;N++)A[N](P);a.length=0,f.length=0,s.state=C,s.retry=function(){S(P)}})}catch(N){h(N)}}}function g(A){var C=0;function S(L){return function(N){C++>0||L(N)}}var P=S(h);try{A(S(c),P)}catch(L){P(L)}}g(r)};G.prototype.then=function(r,i){var a=this,f=a._instance;function c(u,g,A,C){g.push(function(S){if(typeof u!="function")A(S);else try{h(u(S))}catch(P){s&&s(P)}}),typeof f.retry=="function"&&C===f.state&&f.retry()}var h,s,p=new G(function(u,g){h=u,s=g});return c(r,f.resolvers,h,!0),c(i,f.rejectors,s,!1),p};G.prototype.catch=function(r){return this.then(null,r)};G.prototype.finally=function(r){return this.then(function(i){return G.resolve(r()).then(function(){return i})},function(i){return G.resolve(r()).then(function(){return G.reject(i)})})};G.resolve=function(r){return r instanceof G?r:new G(function(i){i(r)})};G.reject=function(r){return new G(function(i,a){a(r)})};G.all=function(r){return new G(function(i,a){var f=r.length,c=0,h=[];if(r.length===0)i([]);else for(var s=0;s<r.length;s++)(function(p){function u(g){c++,h[p]=g,c===f&&i(h)}r[p]!=null&&(typeof r[p]=="object"||typeof r[p]=="function")&&typeof r[p].then=="function"?r[p].then(u,a):u(r[p])})(s)})};G.race=function(r){return new G(function(i,a){for(var f=0;f<r.length;f++)r[f].then(i,a)})};bt.exports=G});var Ge=V((sn,qe)=>{"use strict";var xe=Xe();typeof window<"u"?(typeof window.Promise>"u"?window.Promise=xe:window.Promise.prototype.finally||(window.Promise.prototype.finally=xe.prototype.finally),qe.exports=window.Promise):typeof global<"u"?(typeof global.Promise>"u"?global.Promise=xe:global.Promise.prototype.finally||(global.Promise.prototype.finally=xe.prototype.finally),qe.exports=global.Promise):qe.exports=xe});var xt=V((cn,vt)=>{"use strict";var Je=ue();vt.exports=function(r){var i=r&&r.document,a,f={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function c(t){return t.attrs&&t.attrs.xmlns||f[t.tag]}function h(t,e){if(t.state!==e)throw new Error("'vnode.state' must not be modified.")}function s(t){var e=t.state;try{return this.apply(e,arguments)}finally{h(t,e)}}function p(){try{return i.activeElement}catch{return null}}function u(t,e,n,l,o,m,E){for(var U=n;U<l;U++){var T=e[U];T!=null&&g(t,T,o,E,m)}}function g(t,e,n,l,o){var m=e.tag;if(typeof m=="string")switch(e.state={},e.attrs!=null&&je(e.attrs,e,n),m){case"#":A(t,e,o);break;case"<":S(t,e,l,o);break;case"[":P(t,e,n,l,o);break;default:L(t,e,n,l,o)}else z(t,e,n,l,o)}function A(t,e,n){e.dom=i.createTextNode(e.children),Y(t,e.dom,n)}var C={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function S(t,e,n,l){var o=e.children.match(/^\s*?<(\w+)/im)||[],m=i.createElement(C[o[1]]||"div");n==="http://www.w3.org/2000/svg"?(m.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e.children+"</svg>",m=m.firstChild):m.innerHTML=e.children,e.dom=m.firstChild,e.domSize=m.childNodes.length,e.instance=[];for(var E=i.createDocumentFragment(),U;U=m.firstChild;)e.instance.push(U),E.appendChild(U);Y(t,E,l)}function P(t,e,n,l,o){var m=i.createDocumentFragment();if(e.children!=null){var E=e.children;u(m,E,0,E.length,n,null,l)}e.dom=m.firstChild,e.domSize=m.childNodes.length,Y(t,m,o)}function L(t,e,n,l,o){var m=e.tag,E=e.attrs,U=E&&E.is;l=c(e)||l;var T=l?U?i.createElementNS(l,m,{is:U}):i.createElementNS(l,m):U?i.createElement(m,{is:U}):i.createElement(m);if(e.dom=T,E!=null&&$(e,E,l),Y(t,T,o),!Ne(e)&&e.children!=null){var I=e.children;u(T,I,0,I.length,n,null,l),e.tag==="select"&&E!=null&&se(e,E)}}function N(t,e){var n;if(typeof t.tag.view=="function"){if(t.state=Object.create(t.tag),n=t.state.view,n.$$reentrantLock$$!=null)return;n.$$reentrantLock$$=!0}else{if(t.state=void 0,n=t.tag,n.$$reentrantLock$$!=null)return;n.$$reentrantLock$$=!0,t.state=t.tag.prototype!=null&&typeof t.tag.prototype.view=="function"?new t.tag(t):t.tag(t)}if(je(t.state,t,e),t.attrs!=null&&je(t.attrs,t,e),t.instance=Je.normalize(s.call(t.state.view,t)),t.instance===t)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}function z(t,e,n,l,o){N(e,n),e.instance!=null?(g(t,e.instance,n,l,o),e.dom=e.instance.dom,e.domSize=e.dom!=null?e.instance.domSize:0):e.domSize=0}function y(t,e,n,l,o,m){if(!(e===n||e==null&&n==null))if(e==null||e.length===0)u(t,n,0,n.length,l,o,m);else if(n==null||n.length===0)le(t,e,0,e.length);else{var E=e[0]!=null&&e[0].key!=null,U=n[0]!=null&&n[0].key!=null,T=0,I=0;if(!E)for(;I<e.length&&e[I]==null;)I++;if(!U)for(;T<n.length&&n[T]==null;)T++;if(E!==U)le(t,e,I,e.length),u(t,n,T,n.length,l,o,m);else if(U){for(var Z=e.length-1,X=n.length-1,Ce,k,W,Q,B,Ie;Z>=I&&X>=T&&(Q=e[Z],B=n[X],Q.key===B.key);)Q!==B&&x(t,Q,B,l,o,m),B.dom!=null&&(o=B.dom),Z--,X--;for(;Z>=I&&X>=T&&(k=e[I],W=n[T],k.key===W.key);)I++,T++,k!==W&&x(t,k,W,l,H(e,I,o),m);for(;Z>=I&&X>=T&&!(T===X||k.key!==B.key||Q.key!==W.key);)Ie=H(e,I,o),te(t,Q,Ie),Q!==W&&x(t,Q,W,l,Ie,m),++T<=--X&&te(t,k,o),k!==B&&x(t,k,B,l,o,m),B.dom!=null&&(o=B.dom),I++,Z--,Q=e[Z],B=n[X],k=e[I],W=n[T];for(;Z>=I&&X>=T&&Q.key===B.key;)Q!==B&&x(t,Q,B,l,o,m),B.dom!=null&&(o=B.dom),Z--,X--,Q=e[Z],B=n[X];if(T>X)le(t,e,I,Z+1);else if(I>Z)u(t,n,T,X+1,l,o,m);else{var ar=o,at=X-T+1,be=new Array(at),_e=0,K=0,Fe=2147483647,$e=0,Ce,Ve;for(K=0;K<at;K++)be[K]=-1;for(K=X;K>=T;K--){Ce==null&&(Ce=M(e,I,Z+1)),B=n[K];var me=Ce[B.key];me!=null&&(Fe=me<Fe?me:-1,be[K-T]=me,Q=e[me],e[me]=null,Q!==B&&x(t,Q,B,l,o,m),B.dom!=null&&(o=B.dom),$e++)}if(o=ar,$e!==Z-I+1&&le(t,e,I,Z+1),$e===0)u(t,n,T,X+1,l,o,m);else if(Fe===-1)for(Ve=_(be),_e=Ve.length-1,K=X;K>=T;K--)W=n[K],be[K-T]===-1?g(t,W,l,m,o):Ve[_e]===K-T?_e--:te(t,W,o),W.dom!=null&&(o=n[K].dom);else for(K=X;K>=T;K--)W=n[K],be[K-T]===-1&&g(t,W,l,m,o),W.dom!=null&&(o=n[K].dom)}}else{var He=e.length<n.length?e.length:n.length;for(T=T<I?T:I;T<He;T++)k=e[T],W=n[T],!(k===W||k==null&&W==null)&&(k==null?g(t,W,l,m,H(e,T+1,o)):W==null?q(t,k):x(t,k,W,l,H(e,T+1,o),m));e.length>He&&le(t,e,T,e.length),n.length>He&&u(t,n,T,n.length,l,o,m)}}}function x(t,e,n,l,o,m){var E=e.tag,U=n.tag;if(E===U){if(n.state=e.state,n.events=e.events,ir(n,e))return;if(typeof E=="string")switch(n.attrs!=null&&ze(n.attrs,n,l),E){case"#":v(e,n);break;case"<":w(t,e,n,m,o);break;case"[":d(t,e,n,l,o,m);break;default:b(e,n,l,m)}else j(t,e,n,l,o,m)}else q(t,e),g(t,n,l,m,o)}function v(t,e){t.children.toString()!==e.children.toString()&&(t.dom.nodeValue=e.children),e.dom=t.dom}function w(t,e,n,l,o){e.children!==n.children?(R(t,e),S(t,n,l,o)):(n.dom=e.dom,n.domSize=e.domSize,n.instance=e.instance)}function d(t,e,n,l,o,m){y(t,e.children,n.children,l,o,m);var E=0,U=n.children;if(n.dom=null,U!=null){for(var T=0;T<U.length;T++){var I=U[T];I!=null&&I.dom!=null&&(n.dom==null&&(n.dom=I.dom),E+=I.domSize||1)}E!==1&&(n.domSize=E)}}function b(t,e,n,l){var o=e.dom=t.dom;l=c(e)||l,e.tag==="textarea"&&e.attrs==null&&(e.attrs={}),pe(e,t.attrs,e.attrs,l),Ne(e)||y(o,t.children,e.children,n,null,l)}function j(t,e,n,l,o,m){if(n.instance=Je.normalize(s.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");ze(n.state,n,l),n.attrs!=null&&ze(n.attrs,n,l),n.instance!=null?(e.instance==null?g(t,n.instance,l,m,o):x(t,e.instance,n.instance,l,o,m),n.dom=n.instance.dom,n.domSize=n.instance.domSize):e.instance!=null?(q(t,e.instance),n.dom=void 0,n.domSize=0):(n.dom=e.dom,n.domSize=e.domSize)}function M(t,e,n){for(var l=Object.create(null);e<n;e++){var o=t[e];if(o!=null){var m=o.key;m!=null&&(l[m]=e)}}return l}var O=[];function _(t){for(var e=[0],n=0,l=0,o=0,m=O.length=t.length,o=0;o<m;o++)O[o]=t[o];for(var o=0;o<m;++o)if(t[o]!==-1){var E=e[e.length-1];if(t[E]<t[o]){O[o]=E,e.push(o);continue}for(n=0,l=e.length-1;n<l;){var U=(n>>>1)+(l>>>1)+(n&l&1);t[e[U]]<t[o]?n=U+1:l=U}t[o]<t[e[n]]&&(n>0&&(O[o]=e[n-1]),e[n]=o)}for(n=e.length,l=e[n-1];n-- >0;)e[n]=l,l=O[l];return O.length=0,e}function H(t,e,n){for(;e<t.length;e++)if(t[e]!=null&&t[e].dom!=null)return t[e].dom;return n}function te(t,e,n){var l=i.createDocumentFragment();ne(t,l,e),Y(t,l,n)}function ne(t,e,n){for(;n.dom!=null&&n.dom.parentNode===t;){if(typeof n.tag!="string"){if(n=n.instance,n!=null)continue}else if(n.tag==="<")for(var l=0;l<n.instance.length;l++)e.appendChild(n.instance[l]);else if(n.tag!=="[")e.appendChild(n.dom);else if(n.children.length===1){if(n=n.children[0],n!=null)continue}else for(var l=0;l<n.children.length;l++){var o=n.children[l];o!=null&&ne(t,e,o)}break}}function Y(t,e,n){n!=null?t.insertBefore(e,n):t.appendChild(e)}function Ne(t){if(t.attrs==null||t.attrs.contenteditable==null&&t.attrs.contentEditable==null)return!1;var e=t.children;if(e!=null&&e.length===1&&e[0].tag==="<"){var n=e[0].children;t.dom.innerHTML!==n&&(t.dom.innerHTML=n)}else if(e!=null&&e.length!==0)throw new Error("Child node of a contenteditable must be trusted.");return!0}function le(t,e,n,l){for(var o=n;o<l;o++){var m=e[o];m!=null&&q(t,m)}}function q(t,e){var n=0,l=e.state,o,m;if(typeof e.tag!="string"&&typeof e.state.onbeforeremove=="function"){var E=s.call(e.state.onbeforeremove,e);E!=null&&typeof E.then=="function"&&(n=1,o=E)}if(e.attrs&&typeof e.attrs.onbeforeremove=="function"){var E=s.call(e.attrs.onbeforeremove,e);E!=null&&typeof E.then=="function"&&(n|=2,m=E)}if(h(e,l),!n)D(e),F(t,e);else{if(o!=null){var U=function(){n&1&&(n&=2,n||T())};o.then(U,U)}if(m!=null){var U=function(){n&2&&(n&=1,n||T())};m.then(U,U)}}function T(){h(e,l),D(e),F(t,e)}}function R(t,e){for(var n=0;n<e.instance.length;n++)t.removeChild(e.instance[n])}function F(t,e){for(;e.dom!=null&&e.dom.parentNode===t;){if(typeof e.tag!="string"){if(e=e.instance,e!=null)continue}else if(e.tag==="<")R(t,e);else{if(e.tag!=="["&&(t.removeChild(e.dom),!Array.isArray(e.children)))break;if(e.children.length===1){if(e=e.children[0],e!=null)continue}else for(var n=0;n<e.children.length;n++){var l=e.children[n];l!=null&&F(t,l)}}break}}function D(t){if(typeof t.tag!="string"&&typeof t.state.onremove=="function"&&s.call(t.state.onremove,t),t.attrs&&typeof t.attrs.onremove=="function"&&s.call(t.attrs.onremove,t),typeof t.tag!="string")t.instance!=null&&D(t.instance);else{var e=t.children;if(Array.isArray(e))for(var n=0;n<e.length;n++){var l=e[n];l!=null&&D(l)}}}function $(t,e,n){t.tag==="input"&&e.type!=null&&t.dom.setAttribute("type",e.type);var l=e!=null&&t.tag==="input"&&e.type==="file";for(var o in e)ie(t,o,null,e[o],n,l)}function ie(t,e,n,l,o,m){if(!(e==="key"||e==="is"||l==null||oe(e)||n===l&&!fe(t,e)&&typeof l!="object"||e==="type"&&t.tag==="input")){if(e[0]==="o"&&e[1]==="n")return it(t,e,l);if(e.slice(0,6)==="xlink:")t.dom.setAttributeNS("http://www.w3.org/1999/xlink",e.slice(6),l);else if(e==="style")nt(t.dom,n,l);else if(re(t,e,o)){if(e==="value"){if((t.tag==="input"||t.tag==="textarea")&&t.dom.value===""+l&&(m||t.dom===p())||t.tag==="select"&&n!==null&&t.dom.value===""+l||t.tag==="option"&&n!==null&&t.dom.value===""+l)return;if(m&&""+l!=""){console.error("`value` is read-only on file inputs!");return}}t.dom[e]=l}else typeof l=="boolean"?l?t.dom.setAttribute(e,""):t.dom.removeAttribute(e):t.dom.setAttribute(e==="className"?"class":e,l)}}function ae(t,e,n,l){if(!(e==="key"||e==="is"||n==null||oe(e)))if(e[0]==="o"&&e[1]==="n")it(t,e,void 0);else if(e==="style")nt(t.dom,n,null);else if(re(t,e,l)&&e!=="className"&&e!=="title"&&!(e==="value"&&(t.tag==="option"||t.tag==="select"&&t.dom.selectedIndex===-1&&t.dom===p()))&&!(t.tag==="input"&&e==="type"))t.dom[e]=null;else{var o=e.indexOf(":");o!==-1&&(e=e.slice(o+1)),n!==!1&&t.dom.removeAttribute(e==="className"?"class":e)}}function se(t,e){if("value"in e)if(e.value===null)t.dom.selectedIndex!==-1&&(t.dom.value=null);else{var n=""+e.value;(t.dom.value!==n||t.dom.selectedIndex===-1)&&(t.dom.value=n)}"selectedIndex"in e&&ie(t,"selectedIndex",null,e.selectedIndex,void 0)}function pe(t,e,n,l){if(e&&e===n&&console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major"),n!=null){t.tag==="input"&&n.type!=null&&t.dom.setAttribute("type",n.type);var o=t.tag==="input"&&n.type==="file";for(var m in n)ie(t,m,e&&e[m],n[m],l,o)}var E;if(e!=null)for(var m in e)(E=e[m])!=null&&(n==null||n[m]==null)&&ae(t,m,E,l)}function fe(t,e){return e==="value"||e==="checked"||e==="selectedIndex"||e==="selected"&&t.dom===p()||t.tag==="option"&&t.dom.parentNode===i.activeElement}function oe(t){return t==="oninit"||t==="oncreate"||t==="onupdate"||t==="onremove"||t==="onbeforeremove"||t==="onbeforeupdate"}function re(t,e,n){return n===void 0&&(t.tag.indexOf("-")>-1||t.attrs!=null&&t.attrs.is||e!=="href"&&e!=="list"&&e!=="form"&&e!=="width"&&e!=="height")&&e in t.dom}var de=/[A-Z]/g;function Se(t){return"-"+t.toLowerCase()}function Me(t){return t[0]==="-"&&t[1]==="-"?t:t==="cssFloat"?"float":t.replace(de,Se)}function nt(t,e,n){if(e!==n)if(n==null)t.style.cssText="";else if(typeof n!="object")t.style.cssText=n;else if(e==null||typeof e!="object"){t.style.cssText="";for(var l in n){var o=n[l];o!=null&&t.style.setProperty(Me(l),String(o))}}else{for(var l in n){var o=n[l];o!=null&&(o=String(o))!==String(e[l])&&t.style.setProperty(Me(l),o)}for(var l in e)e[l]!=null&&n[l]==null&&t.style.removeProperty(Me(l))}}function Ue(){this._=a}Ue.prototype=Object.create(null),Ue.prototype.handleEvent=function(t){var e=this["on"+t.type],n;typeof e=="function"?n=e.call(t.currentTarget,t):typeof e.handleEvent=="function"&&e.handleEvent(t),this._&&t.redraw!==!1&&(0,this._)(),n===!1&&(t.preventDefault(),t.stopPropagation())};function it(t,e,n){if(t.events!=null){if(t.events._=a,t.events[e]===n)return;n!=null&&(typeof n=="function"||typeof n=="object")?(t.events[e]==null&&t.dom.addEventListener(e.slice(2),t.events,!1),t.events[e]=n):(t.events[e]!=null&&t.dom.removeEventListener(e.slice(2),t.events,!1),t.events[e]=void 0)}else n!=null&&(typeof n=="function"||typeof n=="object")&&(t.events=new Ue,t.dom.addEventListener(e.slice(2),t.events,!1),t.events[e]=n)}function je(t,e,n){typeof t.oninit=="function"&&s.call(t.oninit,e),typeof t.oncreate=="function"&&n.push(s.bind(t.oncreate,e))}function ze(t,e,n){typeof t.onupdate=="function"&&n.push(s.bind(t.onupdate,e))}function ir(t,e){do{if(t.attrs!=null&&typeof t.attrs.onbeforeupdate=="function"){var n=s.call(t.attrs.onbeforeupdate,t,e);if(n!==void 0&&!n)break}if(typeof t.tag!="string"&&typeof t.state.onbeforeupdate=="function"){var n=s.call(t.state.onbeforeupdate,t,e);if(n!==void 0&&!n)break}return!1}while(!1);return t.dom=e.dom,t.domSize=e.domSize,t.instance=e.instance,t.attrs=e.attrs,t.children=e.children,t.text=e.text,!0}var we;return function(t,e,n){if(!t)throw new TypeError("DOM element being rendered to does not exist.");if(we!=null&&t.contains(we))throw new TypeError("Node is currently being rendered to and thus is locked.");var l=a,o=we,m=[],E=p(),U=t.namespaceURI;we=t,a=typeof n=="function"?n:void 0;try{t.vnodes==null&&(t.textContent=""),e=Je.normalizeChildren(Array.isArray(e)?e:[e]),y(t,t.vnodes,e,m,null,U==="http://www.w3.org/1999/xhtml"?void 0:U),t.vnodes=e,E!=null&&p()!==E&&typeof E.focus=="function"&&E.focus();for(var T=0;T<m.length;T++)m[T]()}finally{a=l,we=o}}}});var Qe=V((on,Tt)=>{"use strict";Tt.exports=xt()(typeof window<"u"?window:null)});var St=V((hn,Nt)=>{"use strict";var At=ue();Nt.exports=function(r,i,a){var f=[],c=!1,h=-1;function s(){for(h=0;h<f.length;h+=2)try{r(f[h],At(f[h+1]),p)}catch(g){a.error(g)}h=-1}function p(){c||(c=!0,i(function(){c=!1,s()}))}p.sync=s;function u(g,A){if(A!=null&&A.view==null&&typeof A!="function")throw new TypeError("m.mount expects a component, not a vnode.");var C=f.indexOf(g);C>=0&&(f.splice(C,2),C<=h&&(h-=2),r(g,[])),A!=null&&(f.push(g,A),r(g,At(A),p))}return{mount:u,redraw:p}}});var Oe=V((pn,Ct)=>{"use strict";var Ar=Qe();Ct.exports=St()(Ar,typeof requestAnimationFrame<"u"?requestAnimationFrame:null,typeof console<"u"?console:null)});var Ye=V((mn,qt)=>{"use strict";qt.exports=function(r){if(Object.prototype.toString.call(r)!=="[object Object]")return"";var i=[];for(var a in r)f(a,r[a]);return i.join("&");function f(c,h){if(Array.isArray(h))for(var s=0;s<h.length;s++)f(c+"["+s+"]",h[s]);else if(Object.prototype.toString.call(h)==="[object Object]")for(var s in h)f(c+"["+s+"]",h[s]);else i.push(encodeURIComponent(c)+(h!=null&&h!==""?"="+encodeURIComponent(h):""))}}});var Ze=V((yn,Ot)=>{"use strict";var Nr=ve();Ot.exports=Object.assign||function(r,i){for(var a in i)Nr.call(i,a)&&(r[a]=i[a])}});var Re=V((gn,Rt)=>{"use strict";var Sr=Ye(),Cr=Ze();Rt.exports=function(r,i){if(/:([^\/\.-]+)(\.{3})?:/.test(r))throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.");if(i==null)return r;var a=r.indexOf("?"),f=r.indexOf("#"),c=f<0?r.length:f,h=a<0?c:a,s=r.slice(0,h),p={};Cr(p,i);var u=s.replace(/:([^\/\.-]+)(\.{3})?/g,function(N,z,y){return delete p[z],i[z]==null?N:y?i[z]:encodeURIComponent(String(i[z]))}),g=u.indexOf("?"),A=u.indexOf("#"),C=A<0?u.length:A,S=g<0?C:g,P=u.slice(0,S);a>=0&&(P+=r.slice(a,c)),g>=0&&(P+=(a<0?"?":"&")+u.slice(g,C));var L=Sr(p);return L&&(P+=(a<0&&g<0?"?":"&")+L),f>=0&&(P+=r.slice(f)),A>=0&&(P+=(f<0?"":"&")+u.slice(A)),P}});var Lt=V((dn,Pt)=>{"use strict";var qr=Re(),Et=ve();Pt.exports=function(r,i,a){var f=0;function c(p){return new i(p)}c.prototype=i.prototype,c.__proto__=i;function h(p){return function(u,g){typeof u!="string"?(g=u,u=u.url):g==null&&(g={});var A=new i(function(L,N){p(qr(u,g.params),g,function(z){if(typeof g.type=="function")if(Array.isArray(z))for(var y=0;y<z.length;y++)z[y]=new g.type(z[y]);else z=new g.type(z);L(z)},N)});if(g.background===!0)return A;var C=0;function S(){--C===0&&typeof a=="function"&&a()}return P(A);function P(L){var N=L.then;return L.constructor=c,L.then=function(){C++;var z=N.apply(L,arguments);return z.then(S,function(y){if(S(),C===0)throw y}),P(z)},L}}}function s(p,u){for(var g in p.headers)if(Et.call(p.headers,g)&&g.toLowerCase()===u)return!0;return!1}return{request:h(function(p,u,g,A){var C=u.method!=null?u.method.toUpperCase():"GET",S=u.body,P=(u.serialize==null||u.serialize===JSON.serialize)&&!(S instanceof r.FormData||S instanceof r.URLSearchParams),L=u.responseType||(typeof u.extract=="function"?"":"json"),N=new r.XMLHttpRequest,z=!1,y=!1,x=N,v,w=N.abort;N.abort=function(){z=!0,w.call(this)},N.open(C,p,u.async!==!1,typeof u.user=="string"?u.user:void 0,typeof u.password=="string"?u.password:void 0),P&&S!=null&&!s(u,"content-type")&&N.setRequestHeader("Content-Type","application/json; charset=utf-8"),typeof u.deserialize!="function"&&!s(u,"accept")&&N.setRequestHeader("Accept","application/json, text/*"),u.withCredentials&&(N.withCredentials=u.withCredentials),u.timeout&&(N.timeout=u.timeout),N.responseType=L;for(var d in u.headers)Et.call(u.headers,d)&&N.setRequestHeader(d,u.headers[d]);N.onreadystatechange=function(b){if(!z&&b.target.readyState===4)try{var j=b.target.status>=200&&b.target.status<300||b.target.status===304||/^file:\/\//i.test(p),M=b.target.response,O;if(L==="json"){if(!b.target.responseType&&typeof u.extract!="function")try{M=JSON.parse(b.target.responseText)}catch{M=null}}else(!L||L==="text")&&M==null&&(M=b.target.responseText);if(typeof u.extract=="function"?(M=u.extract(b.target,u),j=!0):typeof u.deserialize=="function"&&(M=u.deserialize(M)),j)g(M);else{var _=function(){try{O=b.target.responseText}catch{O=M}var H=new Error(O);H.code=b.target.status,H.response=M,A(H)};N.status===0?setTimeout(function(){y||_()}):_()}}catch(H){A(H)}},N.ontimeout=function(b){y=!0;var j=new Error("Request timed out");j.code=b.target.status,A(j)},typeof u.config=="function"&&(N=u.config(N,u,p)||N,N!==x&&(v=N.abort,N.abort=function(){z=!0,v.call(this)})),S==null?N.send():typeof u.serialize=="function"?N.send(u.serialize(S)):S instanceof r.FormData||S instanceof r.URLSearchParams?N.send(S):N.send(JSON.stringify(S))}),jsonp:h(function(p,u,g,A){var C=u.callbackName||"_mithril_"+Math.round(Math.random()*1e16)+"_"+f++,S=r.document.createElement("script");r[C]=function(P){delete r[C],S.parentNode.removeChild(S),g(P)},S.onerror=function(){delete r[C],S.parentNode.removeChild(S),A(new Error("JSONP request failed"))},S.src=p+(p.indexOf("?")<0?"?":"&")+encodeURIComponent(u.callbackKey||"callback")+"="+encodeURIComponent(C),r.document.documentElement.appendChild(S)})}}});var Mt=V((wn,Dt)=>{"use strict";var Or=Ge(),Rr=Oe();Dt.exports=Lt()(typeof window<"u"?window:null,Or,Rr.redraw)});var ke=V((bn,jt)=>{"use strict";function Ut(r){try{return decodeURIComponent(r)}catch{return r}}jt.exports=function(r){if(r===""||r==null)return{};r.charAt(0)==="?"&&(r=r.slice(1));for(var i=r.split("&"),a={},f={},c=0;c<i.length;c++){var h=i[c].split("="),s=Ut(h[0]),p=h.length===2?Ut(h[1]):"";p==="true"?p=!0:p==="false"&&(p=!1);var u=s.split(/\]\[?|\[/),g=f;s.indexOf("[")>-1&&u.pop();for(var A=0;A<u.length;A++){var C=u[A],S=u[A+1],P=S==""||!isNaN(parseInt(S,10));if(C===""){var s=u.slice(0,A).join();a[s]==null&&(a[s]=Array.isArray(g)?g.length:0),C=a[s]++}else if(C==="__proto__")break;if(A===u.length-1)g[C]=p;else{var L=Object.getOwnPropertyDescriptor(g,C);L!=null&&(L=L.value),L==null&&(g[C]=L=P?[]:{}),g=L}}}return f}});var Ee=V((vn,zt)=>{"use strict";var Er=ke();zt.exports=function(r){var i=r.indexOf("?"),a=r.indexOf("#"),f=a<0?r.length:a,c=i<0?f:i,h=r.slice(0,c).replace(/\/{2,}/g,"/");return h?(h[0]!=="/"&&(h="/"+h),h.length>1&&h[h.length-1]==="/"&&(h=h.slice(0,-1))):h="/",{path:h,params:i<0?{}:Er(r.slice(i+1,f))}}});var It=V((xn,Ht)=>{"use strict";var Pr=Ee();Ht.exports=function(r){var i=Pr(r),a=Object.keys(i.params),f=[],c=new RegExp("^"+i.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(h,s,p){return s==null?"\\"+h:(f.push({k:s,r:p==="..."}),p==="..."?"(.*)":p==="."?"([^/]+)\\.":"([^/]+)"+(p||""))})+"$");return function(h){for(var s=0;s<a.length;s++)if(i.params[a[s]]!==h.params[a[s]])return!1;if(!f.length)return c.test(h.path);var p=c.exec(h.path);if(p==null)return!1;for(var s=0;s<f.length;s++)h.params[f[s].k]=f[s].r?p[s+1]:decodeURIComponent(p[s+1]);return!0}}});var et=V((Tn,$t)=>{"use strict";var _t=ve(),Ft=new RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");$t.exports=function(r,i){var a={};if(i!=null)for(var f in r)_t.call(r,f)&&!Ft.test(f)&&i.indexOf(f)<0&&(a[f]=r[f]);else for(var f in r)_t.call(r,f)&&!Ft.test(f)&&(a[f]=r[f]);return a}});var Wt=V((An,Kt)=>{"use strict";var Lr=ue(),Dr=Ke(),Mr=Ge(),Vt=Re(),Bt=Ee(),Ur=It(),jr=Ze(),zr=et(),tt={};function Hr(r){try{return decodeURIComponent(r)}catch{return r}}Kt.exports=function(r,i){var a=r==null?null:typeof r.setImmediate=="function"?r.setImmediate:r.setTimeout,f=Mr.resolve(),c=!1,h=!1,s=0,p,u,g=tt,A,C,S,P,L={onbeforeupdate:function(){return s=s?2:1,!(!s||tt===g)},onremove:function(){r.removeEventListener("popstate",y,!1),r.removeEventListener("hashchange",z,!1)},view:function(){if(!(!s||tt===g)){var w=[Lr(A,C.key,C)];return g&&(w=g.render(w[0])),w}}},N=v.SKIP={};function z(){c=!1;var w=r.location.hash;v.prefix[0]!=="#"&&(w=r.location.search+w,v.prefix[0]!=="?"&&(w=r.location.pathname+w,w[0]!=="/"&&(w="/"+w)));var d=w.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,Hr).slice(v.prefix.length),b=Bt(d);jr(b.params,r.history.state);function j(O){console.error(O),x(u,null,{replace:!0})}M(0);function M(O){for(;O<p.length;O++)if(p[O].check(b)){var _=p[O].component,H=p[O].route,te=_,ne=P=function(Y){if(ne===P){if(Y===N)return M(O+1);A=Y!=null&&(typeof Y.view=="function"||typeof Y=="function")?Y:"div",C=b.params,S=d,P=null,g=_.render?_:null,s===2?i.redraw():(s=2,i.redraw.sync())}};_.view||typeof _=="function"?(_={},ne(te)):_.onmatch?f.then(function(){return _.onmatch(b.params,d,H)}).then(ne,d===u?null:j):ne("div");return}if(d===u)throw new Error("Could not resolve default route "+u+".");x(u,null,{replace:!0})}}function y(){c||(c=!0,a(z))}function x(w,d,b){if(w=Vt(w,d),h){y();var j=b?b.state:null,M=b?b.title:null;b&&b.replace?r.history.replaceState(j,M,v.prefix+w):r.history.pushState(j,M,v.prefix+w)}else r.location.href=v.prefix+w}function v(w,d,b){if(!w)throw new TypeError("DOM element being rendered to does not exist.");if(p=Object.keys(b).map(function(M){if(M[0]!=="/")throw new SyntaxError("Routes must start with a '/'.");if(/:([^\/\.-]+)(\.{3})?:/.test(M))throw new SyntaxError("Route parameter names must be separated with either '/', '.', or '-'.");return{route:M,component:b[M],check:Ur(M)}}),u=d,d!=null){var j=Bt(d);if(!p.some(function(M){return M.check(j)}))throw new ReferenceError("Default route doesn't match any known routes.")}typeof r.history.pushState=="function"?r.addEventListener("popstate",y,!1):v.prefix[0]==="#"&&r.addEventListener("hashchange",z,!1),h=!0,i.mount(w,L),z()}return v.set=function(w,d,b){P!=null&&(b=b||{},b.replace=!0),P=null,x(w,d,b)},v.get=function(){return S},v.prefix="#!",v.Link={view:function(w){var d=Dr(w.attrs.selector||"a",zr(w.attrs,["options","params","selector","onclick"]),w.children),b,j,M;return(d.attrs.disabled=!!d.attrs.disabled)?(d.attrs.href=null,d.attrs["aria-disabled"]="true"):(b=w.attrs.options,j=w.attrs.onclick,M=Vt(d.attrs.href,w.attrs.params),d.attrs.href=v.prefix+M,d.attrs.onclick=function(O){var _;typeof j=="function"?_=j.call(O.currentTarget,O):j==null||typeof j!="object"||typeof j.handleEvent=="function"&&j.handleEvent(O),_!==!1&&!O.defaultPrevented&&(O.button===0||O.which===0||O.which===1)&&(!O.currentTarget.target||O.currentTarget.target==="_self")&&!O.ctrlKey&&!O.metaKey&&!O.shiftKey&&!O.altKey&&(O.preventDefault(),O.redraw=!1,v.set(M,null,b))}),d}},v.param=function(w){return C&&w!=null?C[w]:C},v}});var Gt=V((Nn,Xt)=>{"use strict";var Ir=Oe();Xt.exports=Wt()(typeof window<"u"?window:null,Ir)});var Zt=V((Sn,Yt)=>{"use strict";var Pe=wt(),Jt=Mt(),Qt=Oe(),J=function(){return Pe.apply(this,arguments)};J.m=Pe;J.trust=Pe.trust;J.fragment=Pe.fragment;J.Fragment="[";J.mount=Qt.mount;J.route=Gt();J.render=Qe();J.redraw=Qt.redraw;J.request=Jt.request;J.jsonp=Jt.jsonp;J.parseQueryString=ke();J.buildQueryString=Ye();J.parsePathname=Ee();J.buildPathname=Re();J.vnode=ue();J.PromisePolyfill=Xe();J.censor=et();Yt.exports=J});var ge=hr(Zt());var kt=11;function _r(r,i){var a=i.attributes,f,c,h,s,p;if(!(i.nodeType===kt||r.nodeType===kt)){for(var u=a.length-1;u>=0;u--)f=a[u],c=f.name,h=f.namespaceURI,s=f.value,h?(c=f.localName||c,p=r.getAttributeNS(h,c),p!==s&&(f.prefix==="xmlns"&&(c=f.name),r.setAttributeNS(h,c,s))):(p=r.getAttribute(c),p!==s&&r.setAttribute(c,s));for(var g=r.attributes,A=g.length-1;A>=0;A--)f=g[A],c=f.name,h=f.namespaceURI,h?(c=f.localName||c,i.hasAttributeNS(h,c)||r.removeAttributeNS(h,c)):i.hasAttribute(c)||r.removeAttribute(c)}}var Le,Fr="http://www.w3.org/1999/xhtml",ee=typeof document>"u"?void 0:document,$r=!!ee&&"content"in ee.createElement("template"),Vr=!!ee&&ee.createRange&&"createContextualFragment"in ee.createRange();function Br(r){var i=ee.createElement("template");return i.innerHTML=r,i.content.childNodes[0]}function Kr(r){Le||(Le=ee.createRange(),Le.selectNode(ee.body));var i=Le.createContextualFragment(r);return i.childNodes[0]}function Wr(r){var i=ee.createElement("body");return i.innerHTML=r,i.childNodes[0]}function Xr(r){return r=r.trim(),$r?Br(r):Vr?Kr(r):Wr(r)}function De(r,i){var a=r.nodeName,f=i.nodeName,c,h;return a===f?!0:(c=a.charCodeAt(0),h=f.charCodeAt(0),c<=90&&h>=97?a===f.toUpperCase():h<=90&&c>=97?f===a.toUpperCase():!1)}function Gr(r,i){return!i||i===Fr?ee.createElement(r):ee.createElementNS(i,r)}function Jr(r,i){for(var a=r.firstChild;a;){var f=a.nextSibling;i.appendChild(a),a=f}return i}function rt(r,i,a){r[a]!==i[a]&&(r[a]=i[a],r[a]?r.setAttribute(a,""):r.removeAttribute(a))}var er={OPTION:function(r,i){var a=r.parentNode;if(a){var f=a.nodeName.toUpperCase();f==="OPTGROUP"&&(a=a.parentNode,f=a&&a.nodeName.toUpperCase()),f==="SELECT"&&!a.hasAttribute("multiple")&&(r.hasAttribute("selected")&&!i.selected&&(r.setAttribute("selected","selected"),r.removeAttribute("selected")),a.selectedIndex=-1)}rt(r,i,"selected")},INPUT:function(r,i){rt(r,i,"checked"),rt(r,i,"disabled"),r.value!==i.value&&(r.value=i.value),i.hasAttribute("value")||r.removeAttribute("value")},TEXTAREA:function(r,i){var a=i.value;r.value!==a&&(r.value=a);var f=r.firstChild;if(f){var c=f.nodeValue;if(c==a||!a&&c==r.placeholder)return;f.nodeValue=a}},SELECT:function(r,i){if(!i.hasAttribute("multiple")){for(var a=-1,f=0,c=r.firstChild,h,s;c;)if(s=c.nodeName&&c.nodeName.toUpperCase(),s==="OPTGROUP")h=c,c=h.firstChild;else{if(s==="OPTION"){if(c.hasAttribute("selected")){a=f;break}f++}c=c.nextSibling,!c&&h&&(c=h.nextSibling,h=null)}r.selectedIndex=a}}},Te=1,tr=11,rr=3,nr=8;function ce(){}function Qr(r){if(r)return r.getAttribute&&r.getAttribute("id")||r.id}function Yr(r){return function(a,f,c){if(c||(c={}),typeof f=="string")if(a.nodeName==="#document"||a.nodeName==="HTML"||a.nodeName==="BODY"){var h=f;f=ee.createElement("html"),f.innerHTML=h}else f=Xr(f);else f.nodeType===tr&&(f=f.firstElementChild);var s=c.getNodeKey||Qr,p=c.onBeforeNodeAdded||ce,u=c.onNodeAdded||ce,g=c.onBeforeElUpdated||ce,A=c.onElUpdated||ce,C=c.onBeforeNodeDiscarded||ce,S=c.onNodeDiscarded||ce,P=c.onBeforeElChildrenUpdated||ce,L=c.skipFromChildren||ce,N=c.addChild||function(q,R){return q.appendChild(R)},z=c.childrenOnly===!0,y=Object.create(null),x=[];function v(q){x.push(q)}function w(q,R){if(q.nodeType===Te)for(var F=q.firstChild;F;){var D=void 0;R&&(D=s(F))?v(D):(S(F),F.firstChild&&w(F,R)),F=F.nextSibling}}function d(q,R,F){C(q)!==!1&&(R&&R.removeChild(q),S(q),w(q,F))}function b(q){if(q.nodeType===Te||q.nodeType===tr)for(var R=q.firstChild;R;){var F=s(R);F&&(y[F]=R),b(R),R=R.nextSibling}}b(a);function j(q){u(q);for(var R=q.firstChild;R;){var F=R.nextSibling,D=s(R);if(D){var $=y[D];$&&De(R,$)?(R.parentNode.replaceChild($,R),O($,R)):j(R)}else j(R);R=F}}function M(q,R,F){for(;R;){var D=R.nextSibling;(F=s(R))?v(F):d(R,q,!0),R=D}}function O(q,R,F){var D=s(R);D&&delete y[D],!(!F&&(g(q,R)===!1||(r(q,R),A(q),P(q,R)===!1)))&&(q.nodeName!=="TEXTAREA"?_(q,R):er.TEXTAREA(q,R))}function _(q,R){var F=L(q),D=R.firstChild,$=q.firstChild,ie,ae,se,pe,fe;e:for(;D;){for(pe=D.nextSibling,ie=s(D);!F&&$;){if(se=$.nextSibling,D.isSameNode&&D.isSameNode($)){D=pe,$=se;continue e}ae=s($);var oe=$.nodeType,re=void 0;if(oe===D.nodeType&&(oe===Te?(ie?ie!==ae&&((fe=y[ie])?se===fe?re=!1:(q.insertBefore(fe,$),ae?v(ae):d($,q,!0),$=fe):re=!1):ae&&(re=!1),re=re!==!1&&De($,D),re&&O($,D)):(oe===rr||oe==nr)&&(re=!0,$.nodeValue!==D.nodeValue&&($.nodeValue=D.nodeValue))),re){D=pe,$=se;continue e}ae?v(ae):d($,q,!0),$=se}if(ie&&(fe=y[ie])&&De(fe,D))F||N(q,fe),O(fe,D);else{var de=p(D);de!==!1&&(de&&(D=de),D.actualize&&(D=D.actualize(q.ownerDocument||ee)),N(q,D),j(D))}D=pe,$=se}M(q,$,ae);var Se=er[q.nodeName];Se&&Se(q,R)}var H=a,te=H.nodeType,ne=f.nodeType;if(!z){if(te===Te)ne===Te?De(a,f)||(S(a),H=Jr(a,Gr(f.nodeName,f.namespaceURI))):H=f;else if(te===rr||te===nr){if(ne===te)return H.nodeValue!==f.nodeValue&&(H.nodeValue=f.nodeValue),H;H=f}}if(H===f)S(a);else{if(f.isSameNode&&f.isSameNode(H))return;if(O(H,f,z),x)for(var Y=0,Ne=x.length;Y<Ne;Y++){var le=y[x[Y]];le&&d(le,le.parentNode,!1)}}return!z&&H!==a&&a.parentNode&&(H.actualize&&(H=H.actualize(a.ownerDocument||ee)),a.parentNode.replaceChild(H,a)),H}}var Zr=Yr(_r),Ae=Zr;(function(i){if(!document)return;console.log(i),window.syncify=window.syncify||{ready:!1,connected:!0,errors:[]};let a=document.createElement("div");a.id="syncify-hot-label-status";function f(){let y=new WebSocket(`ws://localhost:${i.socket}/ws`);z(y)}f();let c=`http://localhost:${i.server}/`,h=new DOMParser,s={onBeforeElUpdated:function(y,x){return!(y.id==="syncify-hot-label-status"||y.tagName==="SCRIPT"||y.tagName==="STYLE"||y.isEqualNode(x))}},p=function(y){return{list:()=>Object.keys(y).length>0?y:null,get:x=>x in y?document.body.querySelectorAll(y[x].join(",")):null,load:(x=document.body)=>{y={};let v=x.querySelectorAll(".shopify-section");return v?(v.forEach(({id:w})=>{let d=/[0-9]+_{2}[\w-]+$/.exec(w),b;if(d!==null)b=d[0].slice(d[0].indexOf("__")+2);else if(w.startsWith("shopify-section-"))b=w.slice(16);else return window.syncify.errors.push({title:"Unknown Section",description:`Syncify encountered an issue mapping the section id: ${w}`,group:"section"}),null;let j=`#${w}`;b in y?y[b].indexOf(j)<0&&y[b].push(j):y[b]=[j]}),y):null}}}({}),u=function(){let x="Syncify Connected",v={position:"fixed",left:"0",bottom:"0",right:"0",margin:"0 auto",display:"flex",color:"#f7f7f7",zIndex:"99999",fontFamily:"system-ui,sans-serif",textAlign:"center",justifyContent:"space-around",alignItems:"center",fontSize:"11px"},w={padding:"5px 20px",backgroundColor:"#232326",border:"0.8px solid transparent",borderRadius:"5px",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",borderBottom:"0"},d={view:()=>(0,ge.default)("div",{style:w},x)};return Object.assign(a.style,v),window.syncify.style={parent:b=>{Object.assign(a.style,v,b),ge.default.redraw()},label:b=>{Object.assign(w,b),ge.default.redraw()}},ge.default.mount(a,d),{get node(){return a},event:b=>(b!==void 0&&(x=b),ge.default.redraw(),x),render:b=>{b.append(a)}}}(),g=function(y){let x=null;return{start:()=>{let v=performance.now();y.push(v)},stop:()=>{x!==null&&(clearTimeout(x),x=null),x=setTimeout(()=>{u.event("Waiting for changes..."),x=null},5e3);let v=performance.now()-y.pop();if(v<1e3)return`${v.toFixed(0)}ms`;let w=v/1e3;if(w<60)return`${w.toFixed(0)}s ${+v.toFixed(0).slice(1)}ms`;let d=(w/60).toFixed(0);return`${d}m ${w-60*Number(d)}s ${+v.toFixed(0).slice(1)}ms`}}}([]);function A(y){let x=y.lastIndexOf("/")+1,v=y.indexOf("?",x);return(v>-1?y.substring(x,v):y.substring(x))+"?v="+Date.now()}function C(y,x){return typeof x!="string"?!1:y.slice(y.lastIndexOf("/")+1).startsWith(x)}function S(y,x){return y.querySelectorAll("link[rel=stylesheet]").forEach(v=>{let w=v.getAttribute("href");C(w,x)&&v.setAttribute("href",c+A(w))}),y}function P(y,x){return y.querySelectorAll("script").forEach(v=>{if(!v.hasAttribute("src"))return;let w=v.getAttribute("src");if(!C(w,x))return;let d=document.createElement("script");d.setAttribute("src",c+A(w));for(let b of Array.from(v.attributes))b.nodeName!=="src"&&d.setAttribute(b.nodeName,b.nodeValue);v.replaceWith(d)}),y}function L(y){return P(y),S(y),y}function N(y,x){return new Promise(function(v,w){let d=new XMLHttpRequest;d.responseType=x,d.open("GET",y),d.setRequestHeader("X-Syncify-Request","true"),d.onload=()=>v(d.response),d.onerror=()=>w(d.statusText),d.send()})}function z(y){let x=NaN;y.addEventListener("close",()=>{y=null,setTimeout(f,5e3)}),y.addEventListener("message",function({data:v}){if(v==="connected"){if(!window.syncify.connected)return g.start(),u.event("Reconnecting"),N(location.href,"document").then(w=>{let d=L(w);i.strategy==="hydrate"?Ae(document.body,d.body,s):document.body.replaceWith(d.body),p.load(document.body),u.render(document.body),u.event(`Reconnected in ${g.stop()}`),window.syncify.connected=!0})}else if(v==="disconnect")window.syncify.connected=!1,u.event("Syncify Disconnected");else{if(v==="reload")return u.event("Refreshing"),top.location.reload();if(v==="replace")return g.start(),u.event("Reloading"),isNaN(x)||clearTimeout(x),N(location.href,"document").then(w=>{let d=L(w);i.strategy==="hydrate"?Ae(document.body,d.body,s):document.body.replaceWith(d.body),p.load(document.body),u.render(document.body),u.event(`Reloaded in ${g.stop()}`),x=NaN});{g.start();let[w,d]=v.split(",");if(w==="section"){let b=p.get(d);if(b===null){window.syncify.reload();return}b.length>1?u.event(`Reloading ${b.length} Sections: ${d}`):u.event(`Reloading Section: ${d}`);let j=`${location.pathname}?sections=${d}`;return N(j,"json").then(M=>{if(b!==null){if(i.strategy==="hydrate"){let O={childrenOnly:!0,onBeforeElUpdated:function(_,H){return!(_.tagName==="SCRIPT"||_.tagName==="STYLE"||_.isEqualNode(H))}};b.forEach(_=>Ae(_,M[d],O))}else b.forEach(O=>{let{firstElementChild:_}=h.parseFromString(M[j],"text/html").body;O.replaceWith(_)});u.event(`Reloaded in ${g.stop()}`)}}).catch(M=>{window.syncify.errors.push({title:"XHR Error fetching section",description:`Section with id: ${d} failed to return a response from Shopify`,group:"sections"}),console.error("SYNCIFY: ",M)})}else w==="script"?(u.event(`Reloading JavaScript: ${d}`),P(document,d),u.event(`Reloaded in ${g.stop()}`)):w==="stylesheet"&&(u.event(`Reloading Stylesheet: ${d}`),S(document,d),u.event(`Reloaded in ${g.stop()}`))}}})}window.syncify.sections=p,window.syncify.assets=()=>L(document),window.syncify.refresh=()=>top.location.reload(),window.syncify.reload=()=>N(location.href,"text").then(y=>{let x=h.parseFromString(y,"text/html");i.strategy==="hydrate"?Ae(document.body,L(x).body,s):document.body.replaceWith(x.body),p.load(document.body),u.render(document.body)}),document.addEventListener("DOMContentLoaded",()=>{p.load(document.body),u.render(document.body),window.syncify.ready=!0})})({server:"{{- server | default: 3000 -}}",socket:"{{- socket | default: 8089 -}}",label:'{{- label | default: "visible" -}}',history:!!"{{- history | default: false -}}",method:'{{- method | default: "hot" -}}',scroll:'{{- scroll | default: "preserved" -}}',strategy:'{{- strategy | default: "hydrate" -}}'});})();
3
3
  </script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@syncify/cli",
3
3
  "description": "The next generation build tool for Shopify theme development.",
4
- "version": "0.2.3-beta",
4
+ "version": "0.3.0-beta",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/panoply/syncify",
7
7
  "bugs": "https://github.com/panoply/syncify/issues",
@@ -44,7 +44,7 @@
44
44
  "main": "./dist/index.js",
45
45
  "bin": {
46
46
  "syncify": "dist/cli.js",
47
- "sync": "dist/cli.js"
47
+ "sy": "dist/cli.js"
48
48
  },
49
49
  "prettier": "@sissel/prettier-config",
50
50
  "eslintConfig": {
@@ -61,29 +61,30 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
+ "@liquify/highlight": "^0.1.0",
64
65
  "anymatch": "^3.1.3",
65
- "axios": "^1.4.0",
66
+ "axios": "^1.5.0",
66
67
  "chokidar": "^3.5.3",
67
68
  "clean-css": "^5.3.2",
68
69
  "cross-spawn": "^7.0.3",
69
70
  "dotenv": "^16.3.1",
70
- "fast-glob": "^3.2.12",
71
+ "fast-glob": "^3.3.1",
71
72
  "finalhandler": "^1.2.0",
72
73
  "fs-extra": "^11.1.1",
73
74
  "gray-matter": "^4.0.3",
74
75
  "html-minifier-terser": "7.2.0",
75
- "html-to-image": "^1.11.11",
76
76
  "load-tsconfig": "^0.2.5",
77
77
  "markdown-it": "^13.0.1",
78
- "mime-types": "^2.1.35",
79
78
  "minimist": "^1.2.8",
80
79
  "morphdom": "^2.7.0",
81
80
  "node-notifier": "^10.0.1",
81
+ "open-editor": "^4.1.1",
82
82
  "p-map": "^6.0.0",
83
+ "pathe": "^1.1.1",
83
84
  "prompts": "^2.4.2",
84
85
  "serve-static": "^1.15.0",
86
+ "tree-kill": "^1.2.2",
85
87
  "turndown": "^7.1.2",
86
- "turndown-plugin-gfm": "^1.0.2",
87
88
  "ws": "^8.13.0"
88
89
  },
89
90
  "devDependencies": {
@@ -93,42 +94,43 @@
93
94
  "@types/fs-extra": "^11.0.1",
94
95
  "@types/mime-types": "^2.1.1",
95
96
  "@types/minimist": "^1.2.2",
97
+ "@types/prompts": "^2.4.4",
96
98
  "@types/serve-static": "^1.15.2",
97
99
  "@types/svg-sprite": "^0.0.34",
98
100
  "@types/ws": "^8.5.5",
99
101
  "ansis": "^1.5.5",
100
102
  "ava": "^5.3.1",
101
103
  "clean-stack": "^5.2.0",
102
- "esbuild": "^0.18.10",
103
- "eslint": "^8.43.0",
104
+ "esbuild": "^0.19.2",
105
+ "eslint": "^8.48.0",
104
106
  "log-update": "^5.0.1",
105
107
  "mergerino": "^0.4.0",
106
108
  "mithril": "^2.2.2",
107
- "p-queue": "^7.3.4",
108
- "postcss": "^8.4.24",
109
- "prettier": "^2.8.8",
110
- "rambdax": "^9.1.1",
111
- "sass": "^1.63.6",
112
- "sharp": "^0.32.1",
113
- "strip-json-comments": "^5.0.0",
109
+ "p-queue": "^7.4.1",
110
+ "postcss": "^8.4.29",
111
+ "prettier": "^3.0.3",
112
+ "rambdax": "^10.0.0",
113
+ "sass": "^1.66.1",
114
+ "sharp": "^0.32.5",
115
+ "strip-json-comments": "^5.0.1",
114
116
  "svg-sprite": "^2.0.2",
115
117
  "svgo": "^3.0.2",
116
- "tailwindcss": "^3.3.2",
117
- "tiny-spinner": "^2.0.0",
118
+ "tailwindcss": "^3.3.3",
119
+ "tiny-spinner": "^2.0.3",
118
120
  "tsconfig-type": "^1.27.0",
119
- "tsup": "^7.1.0",
120
- "type-fest": "^3.12.0",
121
- "typescript": "^5.1.3",
121
+ "tsup": "^7.2.0",
122
+ "type-fest": "^4.3.1",
123
+ "typescript": "^5.2.2",
122
124
  "wrap-ansi": "^8.1.0"
123
125
  },
124
126
  "peerDependencies": {
125
- "esbuild": "^0.18.10",
126
- "postcss": "^8.4.24",
127
- "sass": "^1.63.6",
128
- "sharp": "^0.32.1",
127
+ "esbuild": "^0.19.2",
128
+ "postcss": "^8.4.29",
129
+ "sass": "^1.66.1",
130
+ "sharp": "^0.32.5",
129
131
  "svg-sprite": "^2.0.2",
130
132
  "svgo": "^3.0.2",
131
- "tailwindcss": "^3.3.2"
133
+ "tailwindcss": "^3.3.3"
132
134
  },
133
135
  "peerDependenciesMeta": {
134
136
  "esbuild": {