@syncify/cli 0.2.4-beta → 1.0.0-alpha.1
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/LICENSE +10 -6
- package/dist/index.d.cts +1815 -0
- package/dist/index.d.ts +1815 -0
- package/package.json +101 -101
- package/pnpm-lock.yaml +16526 -4200
- package/readme.md +77 -2017
- package/scripts/hot.js.liquid +25 -0
- package/dist/api.js +0 -16
- package/dist/cjs.js +0 -221
- package/dist/cli.js +0 -12
- package/dist/index.js +0 -18
- package/hot.js.liquid +0 -3
- package/schema/syncify.config.json +0 -676
- package/schema/syncify.env.json +0 -58
- package/schema/syncify.package.json +0 -11
- package/types/api.d.ts +0 -319
- package/types/cli.d.ts +0 -541
- package/types/config/index.d.ts +0 -530
- package/types/config/terser.d.ts +0 -267
- package/types/config/views.d.ts +0 -234
- package/types/index.d.ts +0 -55
- package/types/internal/cache.d.ts +0 -97
- package/types/internal/commands.d.ts +0 -396
- package/types/internal/errors.d.ts +0 -101
- package/types/internal/file.d.ts +0 -285
- package/types/internal/filters.d.ts +0 -81
- package/types/internal/hot.d.ts +0 -161
- package/types/internal/index.d.ts +0 -513
- package/types/internal/markdown.d.ts +0 -104
- package/types/internal/plugin.d.ts +0 -127
- package/types/internal/processors.d.ts +0 -54
- package/types/internal/reports.d.ts +0 -123
- package/types/internal/requests.d.ts +0 -288
- package/types/internal/shared.d.ts +0 -124
- package/types/modules/html-minifier-terser.d.ts +0 -211
- package/types/transforms/image.d.ts +0 -15
- package/types/transforms/json.d.ts +0 -42
- package/types/transforms/script.d.ts +0 -308
- package/types/transforms/style.d.ts +0 -219
- package/types/transforms/svg.d.ts +0 -189
package/dist/cli.js
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
var cjs_js = require('./cjs.js');
|
5
|
-
var process$1 = require('process');
|
6
|
-
var a = require('minimist');
|
7
|
-
|
8
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
9
|
-
|
10
|
-
var a__default = /*#__PURE__*/_interopDefault(a);
|
11
|
-
|
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);
|
package/dist/index.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var cjs_js = require('./cjs.js');
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
Object.defineProperty(exports, 'defineConfig', {
|
8
|
-
enumerable: true,
|
9
|
-
get: function () { return cjs_js.b; }
|
10
|
-
});
|
11
|
-
Object.defineProperty(exports, 'env', {
|
12
|
-
enumerable: true,
|
13
|
-
get: function () { return cjs_js.d; }
|
14
|
-
});
|
15
|
-
Object.defineProperty(exports, 'run', {
|
16
|
-
enumerable: true,
|
17
|
-
get: function () { return cjs_js.e; }
|
18
|
-
});
|
package/hot.js.liquid
DELETED
@@ -1,3 +0,0 @@
|
|
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,h){return{tag:r,key:i,attrs:a,children:f,text:s,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=$((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 h=i[1],u=i[2];if(h===""&&u!=="")a=u;else if(h==="#")s.id=u;else if(h===".")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 h={};for(var u in a)ye.call(a,u)&&(h[u]=a[u]);a=h}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 W=function(r){if(!(this instanceof W))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=o(a,!0),h=o(f,!1),u=i._instance={resolvers:a,rejectors:f},p=typeof setImmediate=="function"?setImmediate:setTimeout;function o(A,C){return function N(R){var D;try{if(C&&R!=null&&(typeof R=="object"||typeof R=="function")&&typeof(D=R.then)=="function"){if(R===i)throw new TypeError("Promise can't be resolved with itself.");d(D.bind(R))}else p(function(){!C&&A.length===0&&console.error("Possible unhandled promise rejection:",R);for(var q=0;q<A.length;q++)A[q](R);a.length=0,f.length=0,u.state=C,u.retry=function(){N(R)}})}catch(q){h(q)}}}function d(A){var C=0;function N(D){return function(q){C++>0||D(q)}}var R=N(h);try{A(N(s),R)}catch(D){R(D)}}d(r)};W.prototype.then=function(r,i){var a=this,f=a._instance;function s(o,d,A,C){d.push(function(N){if(typeof o!="function")A(N);else try{h(o(N))}catch(R){u&&u(R)}}),typeof f.retry=="function"&&C===f.state&&f.retry()}var h,u,p=new W(function(o,d){h=o,u=d});return s(r,f.resolvers,h,!0),s(i,f.rejectors,u,!1),p};W.prototype.catch=function(r){return this.then(null,r)};W.prototype.finally=function(r){return this.then(function(i){return W.resolve(r()).then(function(){return i})},function(i){return W.resolve(r()).then(function(){return W.reject(i)})})};W.resolve=function(r){return r instanceof W?r:new W(function(i){i(r)})};W.reject=function(r){return new W(function(i,a){a(r)})};W.all=function(r){return new W(function(i,a){var f=r.length,s=0,h=[];if(r.length===0)i([]);else for(var u=0;u<r.length;u++)(function(p){function o(d){s++,h[p]=d,s===f&&i(h)}r[p]!=null&&(typeof r[p]=="object"||typeof r[p]=="function")&&typeof r[p].then=="function"?r[p].then(o,a):o(r[p])})(u)})};W.race=function(r){return new W(function(i,a){for(var f=0;f<r.length;f++)r[f].then(i,a)})};bt.exports=W});var We=$((sn,qe)=>{"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),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=$((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 s(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 u(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 o(t,e,n,l,c,y,L){for(var j=n;j<l;j++){var x=e[j];x!=null&&d(t,x,c,L,y)}}function d(t,e,n,l,c){var y=e.tag;if(typeof y=="string")switch(e.state={},e.attrs!=null&&ze(e.attrs,e,n),y){case"#":A(t,e,c);break;case"<":N(t,e,l,c);break;case"[":R(t,e,n,l,c);break;default:D(t,e,n,l,c)}else m(t,e,n,l,c)}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 N(t,e,n,l){var c=e.children.match(/^\s*?<(\w+)/im)||[],y=i.createElement(C[c[1]]||"div");n==="http://www.w3.org/2000/svg"?(y.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e.children+"</svg>",y=y.firstChild):y.innerHTML=e.children,e.dom=y.firstChild,e.domSize=y.childNodes.length,e.instance=[];for(var L=i.createDocumentFragment(),j;j=y.firstChild;)e.instance.push(j),L.appendChild(j);Y(t,L,l)}function R(t,e,n,l,c){var y=i.createDocumentFragment();if(e.children!=null){var L=e.children;o(y,L,0,L.length,n,null,l)}e.dom=y.firstChild,e.domSize=y.childNodes.length,Y(t,y,c)}function D(t,e,n,l,c){var y=e.tag,L=e.attrs,j=L&&L.is;l=s(e)||l;var x=l?j?i.createElementNS(l,y,{is:j}):i.createElementNS(l,y):j?i.createElement(y,{is:j}):i.createElement(y);if(e.dom=x,L!=null&&F(e,L,l),Y(t,x,c),!Ne(e)&&e.children!=null){var I=e.children;o(x,I,0,I.length,n,null,l),e.tag==="select"&&L!=null&&se(e,L)}}function q(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=Je.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 m(t,e,n,l,c){q(e,n),e.instance!=null?(d(t,e.instance,n,l,c),e.dom=e.instance.dom,e.domSize=e.dom!=null?e.instance.domSize:0):e.domSize=0}function w(t,e,n,l,c,y){if(!(e===n||e==null&&n==null))if(e==null||e.length===0)o(t,n,0,n.length,l,c,y);else if(n==null||n.length===0)le(t,e,0,e.length);else{var L=e[0]!=null&&e[0].key!=null,j=n[0]!=null&&n[0].key!=null,x=0,I=0;if(!L)for(;I<e.length&&e[I]==null;)I++;if(!j)for(;x<n.length&&n[x]==null;)x++;if(L!==j)le(t,e,I,e.length),o(t,n,x,n.length,l,c,y);else if(j){for(var Z=e.length-1,G=n.length-1,Ce,k,K,Q,V,Ie;Z>=I&&G>=x&&(Q=e[Z],V=n[G],Q.key===V.key);)Q!==V&&T(t,Q,V,l,c,y),V.dom!=null&&(c=V.dom),Z--,G--;for(;Z>=I&&G>=x&&(k=e[I],K=n[x],k.key===K.key);)I++,x++,k!==K&&T(t,k,K,l,H(e,I,c),y);for(;Z>=I&&G>=x&&!(x===G||k.key!==V.key||Q.key!==K.key);)Ie=H(e,I,c),te(t,Q,Ie),Q!==K&&T(t,Q,K,l,Ie,y),++x<=--G&&te(t,k,c),k!==V&&T(t,k,V,l,c,y),V.dom!=null&&(c=V.dom),I++,Z--,Q=e[Z],V=n[G],k=e[I],K=n[x];for(;Z>=I&&G>=x&&Q.key===V.key;)Q!==V&&T(t,Q,V,l,c,y),V.dom!=null&&(c=V.dom),Z--,G--,Q=e[Z],V=n[G];if(x>G)le(t,e,I,Z+1);else if(I>Z)o(t,n,x,G+1,l,c,y);else{var ar=c,at=G-x+1,be=new Array(at),_e=0,B=0,Fe=2147483647,$e=0,Ce,Ve;for(B=0;B<at;B++)be[B]=-1;for(B=G;B>=x;B--){Ce==null&&(Ce=z(e,I,Z+1)),V=n[B];var me=Ce[V.key];me!=null&&(Fe=me<Fe?me:-1,be[B-x]=me,Q=e[me],e[me]=null,Q!==V&&T(t,Q,V,l,c,y),V.dom!=null&&(c=V.dom),$e++)}if(c=ar,$e!==Z-I+1&&le(t,e,I,Z+1),$e===0)o(t,n,x,G+1,l,c,y);else if(Fe===-1)for(Ve=X(be),_e=Ve.length-1,B=G;B>=x;B--)K=n[B],be[B-x]===-1?d(t,K,l,y,c):Ve[_e]===B-x?_e--:te(t,K,c),K.dom!=null&&(c=n[B].dom);else for(B=G;B>=x;B--)K=n[B],be[B-x]===-1&&d(t,K,l,y,c),K.dom!=null&&(c=n[B].dom)}}else{var He=e.length<n.length?e.length:n.length;for(x=x<I?x:I;x<He;x++)k=e[x],K=n[x],!(k===K||k==null&&K==null)&&(k==null?d(t,K,l,y,H(e,x+1,c)):K==null?E(t,k):T(t,k,K,l,H(e,x+1,c),y));e.length>He&&le(t,e,x,e.length),n.length>He&&o(t,n,x,n.length,l,c,y)}}}function T(t,e,n,l,c,y){var L=e.tag,j=n.tag;if(L===j){if(n.state=e.state,n.events=e.events,ir(n,e))return;if(typeof L=="string")switch(n.attrs!=null&&Ue(n.attrs,n,l),L){case"#":v(e,n);break;case"<":g(t,e,n,y,c);break;case"[":b(t,e,n,l,c,y);break;default:S(e,n,l,y)}else U(t,e,n,l,c,y)}else E(t,e),d(t,n,l,y,c)}function v(t,e){t.children.toString()!==e.children.toString()&&(t.dom.nodeValue=e.children),e.dom=t.dom}function g(t,e,n,l,c){e.children!==n.children?(P(t,e),N(t,n,l,c)):(n.dom=e.dom,n.domSize=e.domSize,n.instance=e.instance)}function b(t,e,n,l,c,y){w(t,e.children,n.children,l,c,y);var L=0,j=n.children;if(n.dom=null,j!=null){for(var x=0;x<j.length;x++){var I=j[x];I!=null&&I.dom!=null&&(n.dom==null&&(n.dom=I.dom),L+=I.domSize||1)}L!==1&&(n.domSize=L)}}function S(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),Ne(e)||w(c,t.children,e.children,n,null,l)}function U(t,e,n,l,c,y){if(n.instance=Je.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?d(t,n.instance,l,y,c):T(t,e.instance,n.instance,l,c,y),n.dom=n.instance.dom,n.domSize=n.instance.domSize):e.instance!=null?(E(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 y=c.key;y!=null&&(l[y]=e)}}return l}var O=[];function X(t){for(var e=[0],n=0,l=0,c=0,y=O.length=t.length,c=0;c<y;c++)O[c]=t[c];for(var c=0;c<y;++c)if(t[c]!==-1){var L=e[e.length-1];if(t[L]<t[c]){O[c]=L,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&&(O[c]=e[n-1]),e[n]=c)}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 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 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 c=n;c<l;c++){var y=e[c];y!=null&&E(t,y)}}function E(t,e){var n=0,l=e.state,c,y;if(typeof e.tag!="string"&&typeof e.state.onbeforeremove=="function"){var L=u.call(e.state.onbeforeremove,e);L!=null&&typeof L.then=="function"&&(n=1,c=L)}if(e.attrs&&typeof e.attrs.onbeforeremove=="function"){var L=u.call(e.attrs.onbeforeremove,e);L!=null&&typeof L.then=="function"&&(n|=2,y=L)}if(h(e,l),!n)M(e),_(t,e);else{if(c!=null){var j=function(){n&1&&(n&=2,n||x())};c.then(j,j)}if(y!=null){var j=function(){n&2&&(n&=1,n||x())};y.then(j,j)}}function x(){h(e,l),M(e),_(t,e)}}function P(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==="<")P(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 M(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&&M(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&&M(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,y){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&&(y||t.dom===p())||t.tag==="select"&&n!==null&&t.dom.value===""+l||t.tag==="option"&&n!==null&&t.dom.value===""+l)return;if(y&&""+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 y in n)ie(t,y,e&&e[y],n[y],l,c)}var L;if(e!=null)for(var y in e)(L=e[y])!=null&&(n==null||n[y]==null)&&ae(t,y,L,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 c=n[l];c!=null&&t.style.setProperty(Me(l),String(c))}}else{for(var l in n){var c=n[l];c!=null&&(c=String(c))!==String(e[l])&&t.style.setProperty(Me(l),c)}for(var l in e)e[l]!=null&&n[l]==null&&t.style.removeProperty(Me(l))}}function je(){this._=a}je.prototype=Object.create(null),je.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 je,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,y=[],L=p(),j=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]),w(t,t.vnodes,e,y,null,j==="http://www.w3.org/1999/xhtml"?void 0:j),t.vnodes=e,L!=null&&p()!==L&&typeof L.focus=="function"&&L.focus();for(var x=0;x<y.length;x++)y[x]()}finally{a=l,we=c}}}});var Qe=$((on,Tt)=>{"use strict";Tt.exports=xt()(typeof window<"u"?window:null)});var St=$((hn,Nt)=>{"use strict";var At=ue();Nt.exports=function(r,i,a){var f=[],s=!1,h=-1;function u(){for(h=0;h<f.length;h+=2)try{r(f[h],At(f[h+1]),p)}catch(d){a.error(d)}h=-1}function p(){s||(s=!0,i(function(){s=!1,u()}))}p.sync=u;function o(d,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(d);C>=0&&(f.splice(C,2),C<=h&&(h-=2),r(d,[])),A!=null&&(f.push(d,A),r(d,At(A),p))}return{mount:o,redraw:p}}});var Oe=$((pn,Ct)=>{"use strict";var Ar=Qe();Ct.exports=St()(Ar,typeof requestAnimationFrame<"u"?requestAnimationFrame:null,typeof console<"u"?console:null)});var Ye=$((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(s,h){if(Array.isArray(h))for(var u=0;u<h.length;u++)f(s+"["+u+"]",h[u]);else if(Object.prototype.toString.call(h)==="[object Object]")for(var u in h)f(s+"["+u+"]",h[u]);else i.push(encodeURIComponent(s)+(h!=null&&h!==""?"="+encodeURIComponent(h):""))}}});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 Re=$((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("#"),s=f<0?r.length:f,h=a<0?s:a,u=r.slice(0,h),p={};Cr(p,i);var o=u.replace(/:([^\/\.-]+)(\.{3})?/g,function(q,m,w){return delete p[m],i[m]==null?q:w?i[m]:encodeURIComponent(String(i[m]))}),d=o.indexOf("?"),A=o.indexOf("#"),C=A<0?o.length:A,N=d<0?C:d,R=o.slice(0,N);a>=0&&(R+=r.slice(a,s)),d>=0&&(R+=(a<0?"?":"&")+o.slice(d,C));var D=Sr(p);return D&&(R+=(a<0&&d<0?"?":"&")+D),f>=0&&(R+=r.slice(f)),A>=0&&(R+=(f<0?"":"&")+o.slice(A)),R}});var Lt=$((dn,Pt)=>{"use strict";var qr=Re(),Et=ve();Pt.exports=function(r,i,a){var f=0;function s(p){return new i(p)}s.prototype=i.prototype,s.__proto__=i;function h(p){return function(o,d){typeof o!="string"?(d=o,o=o.url):d==null&&(d={});var A=new i(function(D,q){p(qr(o,d.params),d,function(m){if(typeof d.type=="function")if(Array.isArray(m))for(var w=0;w<m.length;w++)m[w]=new d.type(m[w]);else m=new d.type(m);D(m)},q)});if(d.background===!0)return A;var C=0;function N(){--C===0&&typeof a=="function"&&a()}return R(A);function R(D){var q=D.then;return D.constructor=s,D.then=function(){C++;var m=q.apply(D,arguments);return m.then(N,function(w){if(N(),C===0)throw w}),R(m)},D}}}function u(p,o){for(var d in p.headers)if(Et.call(p.headers,d)&&d.toLowerCase()===o)return!0;return!1}return{request:h(function(p,o,d,A){var C=o.method!=null?o.method.toUpperCase():"GET",N=o.body,R=(o.serialize==null||o.serialize===JSON.serialize)&&!(N instanceof r.FormData||N instanceof r.URLSearchParams),D=o.responseType||(typeof o.extract=="function"?"":"json"),q=new r.XMLHttpRequest,m=!1,w=!1,T=q,v,g=q.abort;q.abort=function(){m=!0,g.call(this)},q.open(C,p,o.async!==!1,typeof o.user=="string"?o.user:void 0,typeof o.password=="string"?o.password:void 0),R&&N!=null&&!u(o,"content-type")&&q.setRequestHeader("Content-Type","application/json; charset=utf-8"),typeof o.deserialize!="function"&&!u(o,"accept")&&q.setRequestHeader("Accept","application/json, text/*"),o.withCredentials&&(q.withCredentials=o.withCredentials),o.timeout&&(q.timeout=o.timeout),q.responseType=D;for(var b in o.headers)Et.call(o.headers,b)&&q.setRequestHeader(b,o.headers[b]);q.onreadystatechange=function(S){if(!m&&S.target.readyState===4)try{var U=S.target.status>=200&&S.target.status<300||S.target.status===304||/^file:\/\//i.test(p),z=S.target.response,O;if(D==="json"){if(!S.target.responseType&&typeof o.extract!="function")try{z=JSON.parse(S.target.responseText)}catch{z=null}}else(!D||D==="text")&&z==null&&(z=S.target.responseText);if(typeof o.extract=="function"?(z=o.extract(S.target,o),U=!0):typeof o.deserialize=="function"&&(z=o.deserialize(z)),U)d(z);else{var X=function(){try{O=S.target.responseText}catch{O=z}var H=new Error(O);H.code=S.target.status,H.response=z,A(H)};q.status===0?setTimeout(function(){w||X()}):X()}}catch(H){A(H)}},q.ontimeout=function(S){w=!0;var U=new Error("Request timed out");U.code=S.target.status,A(U)},typeof o.config=="function"&&(q=o.config(q,o,p)||q,q!==T&&(v=q.abort,q.abort=function(){m=!0,v.call(this)})),N==null?q.send():typeof o.serialize=="function"?q.send(o.serialize(N)):N instanceof r.FormData||N instanceof r.URLSearchParams?q.send(N):q.send(JSON.stringify(N))}),jsonp:h(function(p,o,d,A){var C=o.callbackName||"_mithril_"+Math.round(Math.random()*1e16)+"_"+f++,N=r.document.createElement("script");r[C]=function(R){delete r[C],N.parentNode.removeChild(N),d(R)},N.onerror=function(){delete r[C],N.parentNode.removeChild(N),A(new Error("JSONP request failed"))},N.src=p+(p.indexOf("?")<0?"?":"&")+encodeURIComponent(o.callbackKey||"callback")+"="+encodeURIComponent(C),r.document.documentElement.appendChild(N)})}}});var Mt=$((wn,Dt)=>{"use strict";var Or=We(),Rr=Oe();Dt.exports=Lt()(typeof window<"u"?window:null,Or,Rr.redraw)});var ke=$((bn,zt)=>{"use strict";function jt(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 h=i[s].split("="),u=jt(h[0]),p=h.length===2?jt(h[1]):"";p==="true"?p=!0:p==="false"&&(p=!1);var o=u.split(/\]\[?|\[/),d=f;u.indexOf("[")>-1&&o.pop();for(var A=0;A<o.length;A++){var C=o[A],N=o[A+1],R=N==""||!isNaN(parseInt(N,10));if(C===""){var u=o.slice(0,A).join();a[u]==null&&(a[u]=Array.isArray(d)?d.length:0),C=a[u]++}else if(C==="__proto__")break;if(A===o.length-1)d[C]=p;else{var D=Object.getOwnPropertyDescriptor(d,C);D!=null&&(D=D.value),D==null&&(d[C]=D=R?[]:{}),d=D}}}return f}});var Ee=$((vn,Ut)=>{"use strict";var Er=ke();Ut.exports=function(r){var i=r.indexOf("?"),a=r.indexOf("#"),f=a<0?r.length:a,s=i<0?f:i,h=r.slice(0,s).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=$((xn,Ht)=>{"use strict";var Pr=Ee();Ht.exports=function(r){var i=Pr(r),a=Object.keys(i.params),f=[],s=new RegExp("^"+i.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(h,u,p){return u==null?"\\"+h:(f.push({k:u,r:p==="..."}),p==="..."?"(.*)":p==="."?"([^/]+)\\.":"([^/]+)"+(p||""))})+"$");return function(h){for(var u=0;u<a.length;u++)if(i.params[a[u]]!==h.params[a[u]])return!1;if(!f.length)return s.test(h.path);var p=s.exec(h.path);if(p==null)return!1;for(var u=0;u<f.length;u++)h.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(),Mr=We(),Vt=Re(),Bt=Ee(),jr=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=Mr.resolve(),s=!1,h=!1,u=0,p,o,d=tt,A,C,N,R,D={onbeforeupdate:function(){return u=u?2:1,!(!u||tt===d)},onremove:function(){r.removeEventListener("popstate",w,!1),r.removeEventListener("hashchange",m,!1)},view:function(){if(!(!u||tt===d)){var g=[Lr(A,C.key,C)];return d&&(g=d.render(g[0])),g}}},q=v.SKIP={};function m(){s=!1;var g=r.location.hash;v.prefix[0]!=="#"&&(g=r.location.search+g,v.prefix[0]!=="?"&&(g=r.location.pathname+g,g[0]!=="/"&&(g="/"+g)));var b=g.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,Hr).slice(v.prefix.length),S=Bt(b);zr(S.params,r.history.state);function U(O){console.error(O),T(o,null,{replace:!0})}z(0);function z(O){for(;O<p.length;O++)if(p[O].check(S)){var X=p[O].component,H=p[O].route,te=X,ne=R=function(Y){if(ne===R){if(Y===q)return z(O+1);A=Y!=null&&(typeof Y.view=="function"||typeof Y=="function")?Y:"div",C=S.params,N=b,R=null,d=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(S.params,b,H)}).then(ne,b===o?null:U):ne("div");return}if(b===o)throw new Error("Could not resolve default route "+o+".");T(o,null,{replace:!0})}}function w(){s||(s=!0,a(m))}function T(g,b,S){if(g=Vt(g,b),h){w();var U=S?S.state:null,z=S?S.title:null;S&&S.replace?r.history.replaceState(U,z,v.prefix+g):r.history.pushState(U,z,v.prefix+g)}else r.location.href=v.prefix+g}function v(g,b,S){if(!g)throw new TypeError("DOM element being rendered to does not exist.");if(p=Object.keys(S).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:S[z],check:jr(z)}}),o=b,b!=null){var U=Bt(b);if(!p.some(function(z){return z.check(U)}))throw new ReferenceError("Default route doesn't match any known routes.")}typeof r.history.pushState=="function"?r.addEventListener("popstate",w,!1):v.prefix[0]==="#"&&r.addEventListener("hashchange",m,!1),h=!0,i.mount(g,D),m()}return v.set=function(g,b,S){R!=null&&(S=S||{},S.replace=!0),R=null,T(g,b,S)},v.get=function(){return N},v.prefix="#!",v.Link={view:function(g){var b=Dr(g.attrs.selector||"a",Ur(g.attrs,["options","params","selector","onclick"]),g.children),S,U,z;return(b.attrs.disabled=!!b.attrs.disabled)?(b.attrs.href=null,b.attrs["aria-disabled"]="true"):(S=g.attrs.options,U=g.attrs.onclick,z=Vt(b.attrs.href,g.attrs.params),b.attrs.href=v.prefix+z,b.attrs.onclick=function(O){var X;typeof U=="function"?X=U.call(O.currentTarget,O):U==null||typeof U!="object"||typeof U.handleEvent=="function"&&U.handleEvent(O),X!==!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(z,null,S))}),b}},v.param=function(g){return C&&g!=null?C[g]:C},v}});var Wt=$((Nn,Gt)=>{"use strict";var Ir=Oe();Gt.exports=Xt()(typeof window<"u"?window:null,Ir)});var Zt=$((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=Wt();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=Ge();J.censor=et();Yt.exports=J});var ge=hr(Zt());var kt=11;function _r(r,i){var a=i.attributes,f,s,h,u,p;if(!(i.nodeType===kt||r.nodeType===kt)){for(var o=a.length-1;o>=0;o--)f=a[o],s=f.name,h=f.namespaceURI,u=f.value,h?(s=f.localName||s,p=r.getAttributeNS(h,s),p!==u&&(f.prefix==="xmlns"&&(s=f.name),r.setAttributeNS(h,s,u))):(p=r.getAttribute(s),p!==u&&r.setAttribute(s,u));for(var d=r.attributes,A=d.length-1;A>=0;A--)f=d[A],s=f.name,h=f.namespaceURI,h?(s=f.localName||s,i.hasAttributeNS(h,s)||r.removeAttributeNS(h,s)):i.hasAttribute(s)||r.removeAttribute(s)}}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 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 De(r,i){var a=r.nodeName,f=i.nodeName,s,h;return a===f?!0:(s=a.charCodeAt(0),h=f.charCodeAt(0),s<=90&&h>=97?a===f.toUpperCase():h<=90&&s>=97?f===a.toUpperCase():!1)}function Wr(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 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,h,u;s;)if(u=s.nodeName&&s.nodeName.toUpperCase(),u==="OPTGROUP")h=s,s=h.firstChild;else{if(u==="OPTION"){if(s.hasAttribute("selected")){a=f;break}f++}s=s.nextSibling,!s&&h&&(s=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,s){if(s||(s={}),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=Gr(f);else f.nodeType===tr&&(f=f.firstElementChild);var u=s.getNodeKey||Qr,p=s.onBeforeNodeAdded||ce,o=s.onNodeAdded||ce,d=s.onBeforeElUpdated||ce,A=s.onElUpdated||ce,C=s.onBeforeNodeDiscarded||ce,N=s.onNodeDiscarded||ce,R=s.onBeforeElChildrenUpdated||ce,D=s.skipFromChildren||ce,q=s.addChild||function(E,P){return E.appendChild(P)},m=s.childrenOnly===!0,w=Object.create(null),T=[];function v(E){T.push(E)}function g(E,P){if(E.nodeType===Te)for(var _=E.firstChild;_;){var M=void 0;P&&(M=u(_))?v(M):(N(_),_.firstChild&&g(_,P)),_=_.nextSibling}}function b(E,P,_){C(E)!==!1&&(P&&P.removeChild(E),N(E),g(E,_))}function S(E){if(E.nodeType===Te||E.nodeType===tr)for(var P=E.firstChild;P;){var _=u(P);_&&(w[_]=P),S(P),P=P.nextSibling}}S(a);function U(E){o(E);for(var P=E.firstChild;P;){var _=P.nextSibling,M=u(P);if(M){var F=w[M];F&&De(P,F)?(P.parentNode.replaceChild(F,P),O(F,P)):U(P)}else U(P);P=_}}function z(E,P,_){for(;P;){var M=P.nextSibling;(_=u(P))?v(_):b(P,E,!0),P=M}}function O(E,P,_){var M=u(P);M&&delete w[M],!(!_&&(d(E,P)===!1||(r(E,P),A(E),R(E,P)===!1)))&&(E.nodeName!=="TEXTAREA"?X(E,P):er.TEXTAREA(E,P))}function X(E,P){var _=D(E),M=P.firstChild,F=E.firstChild,ie,ae,se,pe,fe;e:for(;M;){for(pe=M.nextSibling,ie=u(M);!_&&F;){if(se=F.nextSibling,M.isSameNode&&M.isSameNode(F)){M=pe,F=se;continue e}ae=u(F);var oe=F.nodeType,re=void 0;if(oe===M.nodeType&&(oe===Te?(ie?ie!==ae&&((fe=w[ie])?se===fe?re=!1:(E.insertBefore(fe,F),ae?v(ae):b(F,E,!0),F=fe):re=!1):ae&&(re=!1),re=re!==!1&&De(F,M),re&&O(F,M)):(oe===rr||oe==nr)&&(re=!0,F.nodeValue!==M.nodeValue&&(F.nodeValue=M.nodeValue))),re){M=pe,F=se;continue e}ae?v(ae):b(F,E,!0),F=se}if(ie&&(fe=w[ie])&&De(fe,M))_||q(E,fe),O(fe,M);else{var de=p(M);de!==!1&&(de&&(M=de),M.actualize&&(M=M.actualize(E.ownerDocument||ee)),q(E,M),U(M))}M=pe,F=se}z(E,F,ae);var Se=er[E.nodeName];Se&&Se(E,P)}var H=a,te=H.nodeType,ne=f.nodeType;if(!m){if(te===Te)ne===Te?De(a,f)||(N(a),H=Jr(a,Wr(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)N(a);else{if(f.isSameNode&&f.isSameNode(H))return;if(O(H,f,m),T)for(var Y=0,Ne=T.length;Y<Ne;Y++){var le=w[T[Y]];le&&b(le,le.parentNode,!1)}}return!m&&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(r){if(!document)return;window.syncify=window.syncify||{ready:!1,connected:!0,errors:[]};let i=document.createElement("div");i.id="syncify-hot-label-status";function a(){let m=new WebSocket(`ws://localhost:${r.socket}/ws`);q(m)}a();let f=`http://localhost:${r.server}/`,s=new DOMParser,h={onBeforeElUpdated:function(m,w){return!(m.id==="syncify-hot-label-status"||m.tagName==="SCRIPT"||m.tagName==="STYLE"||m.isEqualNode(w))}},u=function(m){return{list:()=>Object.keys(m).length>0?m:null,get:w=>w in m?document.body.querySelectorAll(m[w].join(",")):null,load:(w=document.body)=>{m={};let T=w.querySelectorAll(".shopify-section");return T?(T.forEach(({id:v})=>{let g=/[0-9]+_{2}[\w-]+$/.exec(v),b;if(g!==null)b=g[0].slice(g[0].indexOf("__")+2);else if(v.startsWith("shopify-section-"))b=v.slice(16);else return window.syncify.errors.push({title:"Unknown Section",description:`Syncify encountered an issue mapping the section id: ${v}`,group:"section"}),null;let S=`#${v}`;b in m?m[b].indexOf(S)<0&&m[b].push(S):m[b]=[S]}),m):null}}}({}),p=function(){let w="Syncify Connected",T={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"},v={padding:"5px 20px",backgroundColor:"#232326",border:"0.8px solid transparent",borderRadius:"5px",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",borderBottom:"0"},g={view:()=>(0,ge.default)("div",{style:v},w)};return Object.assign(i.style,T),window.syncify.style={parent:b=>{Object.assign(i.style,T,b),ge.default.redraw()},label:b=>{Object.assign(v,b),ge.default.redraw()}},ge.default.mount(i,g),{get node(){return i},event:b=>(b!==void 0&&(w=b),ge.default.redraw(),w),render:b=>{b.contains(i)||b.append(i)}}}(),o=function(m){let w=null;return{start:()=>{let T=performance.now();m.push(T)},stop:()=>{w!==null&&(clearTimeout(w),w=null),w=setTimeout(()=>{p.event("Waiting for changes..."),w=null},5e3);let T=performance.now()-m.pop();if(T<1e3)return`${T.toFixed(0)}ms`;let v=T/1e3;if(v<60)return`${v.toFixed(0)}s ${+T.toFixed(0).slice(1)}ms`;let g=(v/60).toFixed(0);return`${g}m ${v-60*Number(g)}s ${+T.toFixed(0).slice(1)}ms`}}}([]);function d(m){let w=m.lastIndexOf("/")+1,T=m.indexOf("?",w);return(T>-1?m.substring(w,T):m.substring(w))+"?v="+Date.now()}function A(m,w){return typeof w!="string"?!1:m.slice(m.lastIndexOf("/")+1).startsWith(w)}function C(m,w){return m.querySelectorAll("link[rel=stylesheet]").forEach(T=>{let v=T.getAttribute("href");A(v,w)&&T.setAttribute("href",f+d(v))}),m}function N(m,w){return m.querySelectorAll("script").forEach(T=>{if(!T.hasAttribute("src"))return;let v=T.getAttribute("src");if(!A(v,w))return;let g=document.createElement("script");g.setAttribute("src",f+d(v));for(let b of Array.from(T.attributes))b.nodeName!=="src"&&g.setAttribute(b.nodeName,b.nodeValue);T.replaceWith(g)}),m}function R(m){return N(m),C(m),m}function D(m,w){return new Promise(function(T,v){let g=new XMLHttpRequest;g.responseType=w,g.open("GET",m),g.setRequestHeader("X-Syncify-Request","true"),g.onload=()=>T(g.response),g.onerror=()=>v(g.statusText),g.send()})}function q(m){let w=NaN;m.addEventListener("close",()=>{m=null,setTimeout(a,5e3)}),m.addEventListener("message",function({data:T}){if(T==="connected"){if(!window.syncify.connected)return o.start(),p.event("Reconnecting"),D(location.href,"document").then(v=>{Ae(document.body,R(v).body,h),u.load(document.body),p.render(document.body),p.event(`Reconnected in ${o.stop()}`),window.syncify.connected=!0})}else if(T==="disconnect")window.syncify.connected=!1,p.event("Syncify Disconnected");else{if(T==="reload")return p.event("Refreshing"),top.location.reload();if(T==="replace")o.start(),p.event("Reloading"),isNaN(w)||clearTimeout(w),w=window.setTimeout(()=>{D(location.href,"document").then(v=>{let g=R(v);Ae(document.body,g.body,h),u.load(document.body),p.render(document.body),p.event(`Reloaded in ${o.stop()}`),w=NaN})},50);else{o.start();let[v,g]=T.split(",");if(v==="section"){let b=u.get(g);if(b===null){window.syncify.reload();return}b.length>1?p.event(`Reloading ${b.length} Sections: ${g}`):p.event(`Reloading Section: ${g}`);let S=`${location.pathname}?sections=${g}`;return D(S,"json").then(U=>{if(b===null)return;let z={childrenOnly:!0,onBeforeElUpdated:function(O,X){return!(O.tagName==="SCRIPT"||O.tagName==="STYLE"||O.isEqualNode(X))}};b.forEach(O=>Ae(O,U[g],z)),p.event(`Reloaded in ${o.stop()}`)}).catch(U=>{window.syncify.errors.push({title:"XHR Error fetching section",description:`Section with id: ${g} failed to return a response from Shopify`,group:"sections"}),console.error("SYNCIFY: ",U)})}else v==="script"?(p.event(`Reloading JavaScript: ${g}`),N(document,g),p.event(`Reloaded in ${o.stop()}`)):v==="stylesheet"&&(p.event(`Reloading Stylesheet: ${g}`),C(document,g),p.event(`Reloaded in ${o.stop()}`))}}})}window.syncify.sections=u,window.syncify.assets=()=>R(document),window.syncify.refresh=()=>top.location.reload(),window.syncify.reload=()=>D(location.href,"text").then(m=>{let w=s.parseFromString(m,"text/html");Ae(document.body,R(w).body,h),u.load(document.body),p.render(document.body)}),document.addEventListener("DOMContentLoaded",()=>{u.load(document.body),p.render(document.body),window.syncify.ready=!0})})({server:"{{- server | default: 3000 -}}",socket:"{{- socket | default: 8089 -}}",label:'{{- label | default: "visible" -}}'});})();
|
3
|
-
</script>
|