Time slots app prototype
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
131 KiB

var yh=Object.create;var Ye=Object.defineProperty;var bh=Object.getOwnPropertyDescriptor;var _h=Object.getOwnPropertyNames;var vh=Object.getPrototypeOf,xh=Object.prototype.hasOwnProperty;var Sh=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),wh=(i,t)=>{for(var e in t)Ye(i,e,{get:t[e],enumerable:!0})},an=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _h(t))!xh.call(i,s)&&s!==e&&Ye(i,s,{get:()=>t[s],enumerable:!(r=bh(t,s))||r.enumerable});return i};var Rt=(i,t,e)=>(e=i!=null?yh(vh(i)):{},an(t||!i||!i.__esModule?Ye(e,"default",{value:i,enumerable:!0}):e,i)),Th=i=>an(Ye({},"__esModule",{value:!0}),i);var Fl=Sh((pd,Ts)=>{"use strict";var se=typeof Reflect=="object"?Reflect:null,Tl=se&&typeof se.apply=="function"?se.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},Vr;se&&typeof se.ownKeys=="function"?Vr=se.ownKeys:Object.getOwnPropertySymbols?Vr=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Vr=function(t){return Object.getOwnPropertyNames(t)};function zu(i){console&&console.warn&&console.warn(i)}var Nl=Number.isNaN||function(t){return t!==t};function g(){g.init.call(this)}Ts.exports=g;Ts.exports.once=Yu;g.EventEmitter=g;g.prototype._events=void 0;g.prototype._eventsCount=0;g.prototype._maxListeners=void 0;var Ll=10;function Dr(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return Ll},set:function(i){if(typeof i!="number"||i<0||Nl(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");Ll=i}});g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};g.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Nl(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Cl(i){return i._maxListeners===void 0?g.defaultMaxListeners:i._maxListeners}g.prototype.getMaxListeners=function(){return Cl(this)};g.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var s=t==="error",n=this._events;if(n!==void 0)s=s&&n.error===void 0;else if(!s)return!1;if(s){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var h=n[t];if(h===void 0)return!1;if(typeof h=="function")Tl(h,this,e);else for(var a=h.length,c=El(h,a),r=0;r<a;++r)Tl(c[r],this,e);return!0};function Ol(i,t,e,r){var s,n,o;if(Dr(e),n=i._events,n===void 0?(n=i._events=Object.create(null),i._eventsCount=0):(n.newListener!==void 0&&(i.emit("newListener",t,e.listener?e.listener:e),n=i._events),o=n[t]),o===void 0)o=n[t]=e,++i._eventsCount;else if(typeof o=="function"?o=n[t]=r?[e,o]:[o,e]:r?o.unshift(e):o.push(e),s=Cl(i),s>0&&o.length>s&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=i,l.type=t,l.count=o.length,zu(l)}return i}g.prototype.addListener=function(t,e){return Ol(this,t,e,!1)};g.prototype.on=g.prototype.addListener;g.prototype.prependListener=function(t,e){return Ol(this,t,e,!0)};function Uu(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Ml(i,t,e){var r={fired:!1,wrapFn:void 0,target:i,type:t,listener:e},s=Uu.bind(r);return s.listener=e,r.wrapFn=s,s}g.prototype.once=function(t,e){return Dr(e),this.on(t,Ml(this,t,e)),this};g.prototype.prependOnceListener=function(t,e){return Dr(e),this.prependListener(t,Ml(this,t,e)),this};g.prototype.removeListener=function(t,e){var r,s,n,o,l;if(Dr(e),s=t
`;for(let n of et(r))n.write("event: "+t+`
`),n.write(`id: imba
`),n.write(s);return this}pause(){return this.paused!=!0&&(this.paused=!0,!0)&&this.broadcast("paused"),this}resume(){if(this.paused!=!1&&(this.paused=!1,!0))return this.broadcast("resumed"),this.flushStalledResponses()}flushStalledResponses(){for(let t=0,e=et(this.stalledResponses),r=e.length;t<r;t++)e[t].end();return this.stalledResponses=[]}close(){var t=this;return this.pause(),new Promise(function(e){return t.closed=!0,t.server.close(e),t.flushStalledResponses()})}};function Ih(i,...t){return li.wrap(i,...t)}var ai=Rt(require("path")),Ah=new class{get rootDir(){return process.env.IMBA_OUTDIR||ai.default.dirname(process.env.pm_exec_path||process.argv[1])}get publicPath(){return ai.default.resolve(this.rootDir,process.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}};function Rh(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Q={"":[-1,{id:1,slot:1,part:1,elementTiming:"elementtiming"}],HTML:[-1,{title:1,lang:1,translate:1,dir:1,accessKey:"accesskey",draggable:1,spellcheck:1,autocapitalize:1,inputMode:"inputmode",style:1,tabIndex:"tabindex",enterKeyHint:"enterkeyhint"}],HTMLAnchor:[1,{target:1,download:1,ping:1,rel:1,relList:"rel",hreflang:1,type:1,referrerPolicy:"referrerpolicy",coords:1,charset:1,name:1,rev:1,shape:1,href:1}],HTMLArea:[1,{alt:1,coords:1,download:1,shape:1,target:1,ping:1,rel:1,relList:"rel",referrerPolicy:"referrerpolicy",href:1}],HTMLMedia:[1,{src:1,crossOrigin:"crossorigin",preload:1,controlsList:"controlslist"}],HTMLAudio:[4,{}],HTMLBase:[1,{href:1,target:1}],HTMLQuote:[1,{cite:1}],HTMLBody:[1,{text:1,link:1,vLink:"vlink",aLink:"alink",bgColor:"bgcolor",background:1}],HTMLBR:[1,{clear:1}],HTMLButton:[1,{formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",name:1,type:1,value:1}],HTMLCanvas:[1,{width:1,height:1}],HTMLTableCaption:[1,{align:1}],HTMLTableCol:[1,{span:1,align:1,ch:"char",chOff:"charoff",vAlign:"valign",width:1}],HTMLData:[1,{value:1}],HTMLDataList:[1,{}],HTMLMod:[1,{cite:1,dateTime:"datetime"}],HTMLDetails:[1,{}],HTMLDialog:[1,{}],HTMLDiv:[1,{align:1}],HTMLDList:[1,{}],HTMLEmbed:[1,{src:1,type:1,width:1,height:1,align:1,name:1}],HTMLFieldSet:[1,{name:1}],HTMLForm:[1,{acceptCharset:"accept-charset",action:1,autocomplete:1,enctype:1,encoding:"enctype",method:1,name:1,target:1}],HTMLHeading:[1,{align:1}],HTMLHead:[1,{}],HTMLHR:[1,{align:1,color:1,size:1,width:1}],HTMLHtml:[1,{version:1}],HTMLIFrame:[1,{src:1,srcdoc:1,name:1,sandbox:1,width:1,height:1,referrerPolicy:"referrerpolicy",csp:1,allow:1,align:1,scrolling:1,frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",loading:1}],HTMLImage:[1,{alt:1,src:1,srcset:1,sizes:1,crossOrigin:"crossorigin",useMap:"usemap",width:1,height:1,referrerPolicy:"referrerpolicy",decoding:1,name:1,lowsrc:1,align:1,hspace:1,vspace:1,longDesc:"longdesc",border:1,loading:1}],HTMLInput:[1,{accept:1,alt:1,autocomplete:1,dirName:"dirname",formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",height:1,max:1,maxLength:"maxlength",min:1,minLength:"minlength",name:1,pattern:1,placeholder:1,src:1,step:1,type:1,defaultValue:"value",value:1,width:1,align:1,useMap:"usemap",required:1}],HTMLLabel:[1,{htmlFor:"for"}],HTMLLegend:[1,{align:1}],HTMLLI:[1,{value:1,type:1}],HTMLLink:[1,{href:1,crossOrigin:"crossorigin",rel:1,relList:"rel",media:1,hreflang:1,type:1,as:1,referrerPolicy:"referrerpolicy",sizes:1,imageSrcset:"imagesrcset",imageSizes:"imagesizes",charset:1,rev:1,target:1,integrity:1}],HTMLMap:[1,{name:1}],HTMLMenu:[1,{}],HTMLMeta:[1,{name:1,httpEquiv:"http-equiv",content:1,scheme:1,property:1,charset:1}],HTMLMeter:[1,{value:1,min:1,max:1,low:1,high:1,optimum:1}],HTMLObject:[1,{data:1,type:1,name:1,useMap:"usemap",width:1,height:1,align:1,archive:1,code:1,hspace:1,standby:1,vspace:1,codeBase:"codebase",codeType:"codetype",border:1}],HTMLOList:[1,{start:1,type:1}],HTMLOptGroup:[1,{label:1}],HTMLOption:[1,{label:1,value:1}],HTMLOutput:[1,{htmlFor:"for",name:1}],HTMLParagraph:[1,{align:1}],HTMLParam:[1,{name:1,value:1,type:1,v
`+n.join(`
`)+`
`+e.slice(o)}return"<!DOCTYPE html>"+e}};ye[w]();var qt=class extends M{},Kt=class extends M{},Yt=class extends M{},Wt=class extends M{},Xt=class extends M{},ar=class extends M{get outerHTML(){return lt&&(lt.scripts||(lt.scripts=[])).push(this),this[ot]&&(this[ot].js?(this.setAttribute("src",this[ot].js.url),this.setAttribute("type","module")):console.warn("could not find browser entrypoint for "+this[ot].path)),super.outerHTML}},ur=class extends M{get outerHTML(){if(this[ot]){let t=this.getAttribute("rel"),e;t=="stylesheet"&&((e=this[ot].css.url)||console.warn("could not find stylesheet for "+this[ot].path)),e&&this.setAttribute("href",e)}return super.outerHTML}},cr=class extends M{set src(t){this[de]!=t&&(this[de]=t)}get src(){return this[de]}get outerHTML(){if(lt&&this.src&&(lt.styles||(lt.styles=[])).push(this),this.src){this.nodeName="link",this.setAttribute("rel","stylesheet"),this.setAttribute("href",String(this.src));let t=super.outerHTML;return this.nodeName="style",t}return super.outerHTML}},P=class{},be=class extends P{},Qt=class extends be{},_e=class extends Qt{},ve=class extends be{},k=class extends P{},eo={};function oo(i,t,e){if(!i)return e[t]=null;if(e[t]!==void 0)return e[t];let r=Object.getOwnPropertyDescriptor(i,t);return r!==void 0||i==Jt?e[t]=r||null:oo(Reflect.getPrototypeOf(i),t,e)}var Jt=class extends d{set$(t,e){var r;let s=eo[r=this.nodeName]||(eo[r]={}),n=oo(this,t,s);!n||!n.set?this.setAttribute(t,e):this[t]=e}},fr=class extends Jt{set src(t){if(this[de]!=t&&(this[de]=t,!0)){if(t&&t.adoptNode)t.adoptNode(this);else if(t&&t.type=="svg"){if(t.attributes)for(let e=t.attributes,r=0,s=Object.keys(e),n=s.length,o,l;r<n;r++)o=s[r],l=e[o],this.setAttribute(o,l);this.innerHTML=t.content}}}};Q[""].klass=d;Q.HTML.klass=M;Q.SVG.klass=Jt;L.html.klass=ye;L.select.klass=qt;L.input.klass=Kt;L.textarea.klass=Yt;L.button.klass=Wt;L.option.klass=Xt;L.script.klass=ar;L.style.klass=cr;L.link.klass=ur;L.svg_svg.klass=fr;ht("");ht("HTML");ht("SVG");function ha(i,t,e,r){let s=at.createElement(i);return e&&(s.className=e),r!==null&&s.text$(r),t&&t[me]&&t[me](s),s}function aa(i,t,e,r,s){let n=at.createElementNS("http://www.w3.org/2000/svg",i);return e&&(n.className=e),t&&t[me]&&t[me](n),r&&(n.textContent=r),n}function ut(i){return at.createComment(i)}function dr(i){return at.createTextNode(i)}function ua(){return at.createDocumentFragment()}function lo(i,t,e,r,s){let n;return typeof i!="string"&&(i.prototype instanceof M?(n=new i,n.nodeName=i.nodeName):i&&i.nodeName&&(i=i.nodeName)),n||(n=at.createElement(so[i]||i)),n[io]=t,n[w](),r!==null&&n[Jh]("__").text$(r),(e||n.flags$ns)&&n.flag$(e||""),n}function ca(i,t,e,r){if(i==null||i==null)return ut("");if(i instanceof T)return i;if(typeof i=="string"||i&&i.prototype instanceof T)return lo(i,t,e,r)}function fa(i,t,e={}){Q[i]=no[i]={idl:!0,name:i,klass:t};let r=t.nodeName=i,s=t.prototype;if(i.indexOf("-")==-1&&(r=t.nodeName=""+i+"-tag",so[i]=r),e.extends&&(s[or]=e.extends),e.cssns){let n=(s._ns_||"")+" "+e.cssns;s._ns_=n.trim()+" ",s[Zh]=e.cssns}if(e.cssid){let n=(s.flags$ns||"")+" "+e.cssid;s[ta]=e.cssid,s.flags$ns=n.trim()+" "}return t}globalThis[ea]={Location:Bt,Document:J};function Ci(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}function da(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}var yr=Symbol.for("#parent"),ho=Symbol.for("#closestNode"),pa=Symbol.for("#isRichElement"),ma=Symbol.for("#afterVisit"),ao=Symbol.for("#__initor__"),uo=Symbol.for("#__inited__"),co=Symbol.for("#appendChild"),fo=Symbol.for("#removeChild"),po=Symbol.for("#replaceChild"),ct=Symbol.for("#insertInto"),pr=Symbol.for("#replaceWith"),mo=Symbol.for("#insertChild"),mr=Symbol.for("#removeFrom"),go=Symbol.for("#placeChild"),xo=Symbol.for("#__init__"),ga=Symbol.for("#registerFunctionalSlot"),ya=Symbol.for("#getFunctionalSlot"),yo=Symbol.for("#getSlot"),Mi=Symbol.for("##parent"),vt=Symbol.for("##up"),bo=Symbol.for("##flags"),ba=Symbol.for("#domFlags"),q=Symbol.for("#end"),_o=Symbol.for("#textContent"),gr=Symbol.for("#textNode"),Oi=Symbol.
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor;
}`,Ii=class{constructor(t=null){this[Ho](t)}[Ho](t=null){var e;this.entries=t&&(e=t.entries)!==void 0?e:{}}register(t,e){let r=this.entries[t];r?r&&(r.css=e,r.node&&(r.node.textContent=e)):(r=this.entries[t]={sourceId:t,css:e},this.entries.resets||this.register("resets",za))}toString(){return Object.values(this.entries).map(function(t){return t.css}).join(`
`)}toValue(t,e,r,s=null){let n;jo[r]&&(t=String(t));let o=typeof t;if(o=="number"){if(e||($a.test(r)?e="px":Ba.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return ja[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(o=="string"){if(r&&jo[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),n=t.match(Ga)){let h=Ri[n[1]][parseInt(n[2])],a="100%";if(typeof s=="number"?a=s+"%":typeof s=="string"&&(a=s),h)return"hsla("+h[0]+","+h[1]+"%,"+h[2]+"%,"+a+")"}}else if(t&&t.toStyleString instanceof Function)return t.toStyleString();return t}parseDimension(t){if(typeof t=="string"){let[e,r,s]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(r),s]}else if(typeof t=="number")return[t]}},Go=new Ii,Ua=Object.keys(Ri);function qa(){return!0}var Ai=class{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,s,n=null){let o=Go.toValue(e,r,s,n);this.style.setProperty(t,o)}};Ha(d.prototype,Ai.prototype);var Ka=Symbol.for("#insertInto"),$o=Symbol.for("#removeFrom");function Ya(i,t={}){let e=C.context;C.context=t;let r=i(t);return C.context==t&&(C.context=e),r}function Bo(i,t){return console.error(`imba.mount not supported on server.
To spawn a dev-server for an imba client run:
> imba serve my-imba-file.imba`),String(i);let e=t||globalThis.document.body,r=i;if(i instanceof Function){let s=new B(e,null),n=function(){let o=C.context;C.context=s;let l=i(s);return C.context==s&&(C.context=o),l};r=n(),I.listen("commit",n)}else r.__F|=64;return r[Ka](e),r}function zo(i){return i&&i[$o]&&i[$o](i.parentNode),i}var Uo=globalThis.imba||(globalThis.imba={});Uo.mount=Bo;Uo.unmount=zo;function re(i,t){let e=Object.getOwnPropertyDescriptors(t);return delete e.constructor,Object.defineProperties(i,e),i}function we(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Te=Symbol.for("##onchange"),Ne=Symbol.for("#afterVisit"),Le=Symbol.for("##oninput"),Lr=Symbol.for("##onclick"),Ce=Symbol.for("##bound"),wt=Symbol.for("##visitContext");function Wa(){return!0}var Xa={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},Vi=function(i){return i instanceof Array||i&&i.has instanceof Function},zi=function(i,t){return i==t?!0:i instanceof Array?i.indexOf(t)>=0:i&&i.has instanceof Function?i.has(t):i&&i.contains instanceof Function?i.contains(t):!1},Ui=function(i,t){if(i instanceof Array)return i.push(t);if(i&&i.add instanceof Function)return i.add(t)},qi=function(i,t){if(i instanceof Array){let e=i.indexOf(t);if(e>=0)return i.splice(e,1)}else if(i&&i.delete instanceof Function)return i.delete(t)};function Qa(i){function t(){return i[0]?i[0][i[1]]:void 0}function e(r){return i[0]?i[0][i[1]]=r:null}return{get:t,set:e}}var Di=class{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this[Ce]&&Xa[this.nodeName]&&(this[Ce]=!0,this[Te]&&this.addEventListener("change",this[Te]=this[Te].bind(this)),this[Le]&&this.addEventListener("input",this[Le]=this[Le].bind(this),{capture:!0}),this[Lr]&&this.addEventListener("click",this[Lr]=this[Lr].bind(this),{capture:!0})),Object.defineProperty(this,t,r instanceof Array?Qa(r):r),r}};re(d.prototype,Di.prototype);Object.defineProperty(d.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(i){return this.setRichValue(i)}});var Hi=class{[Te](t){let e=this.data,r=this.$$value;this.$$value=void 0;let s=this.getRichValue();if(this.multiple){if(r)for(let n=0,o=we(r),l=o.length;n<l;n++){let h=o[n];s.indexOf(h)==-1&&qi(e,h)}for(let n=0,o=we(s),l=o.length;n<l;n++){let h=o[n];(!r||r.indexOf(h)==-1)&&Ui(e,h)}}else this.data=s[0];return O(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=we(this.selectedOptions),s=r.length;e<s;e++){let n=r[e];t.push(n.richValue)}return this.$$value=t}syncValue(){let t=this.data;if(this.multiple){let e=[];for(let r=0,s=we(this.options),n=s.length;r<n;r++){let o=s[r],l=o.richValue,h=zi(t,l);o.selected=h,h&&e.push(l)}this.$$value=e}else for(let e=0,r=we(this.options),s=r.length;e<s;e++){let o=r[e].richValue;if(o==t){this.$$value=[o],this.selectedIndex=e;break}}}[Ne](){if(this.syncValue(),this[wt])return this[wt]=null}};re(qt.prototype,Hi.prototype);var ji=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};re(Xt.prototype,ji.prototype);var Gi=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[Le](t){return this.data=this.value,O()}[Ne](){let t=this.data;if(t==null&&(t=""),this[Ce]&&this.value!=t&&(this.value=t),this[wt])return this[wt]=null}};re(Yt.prototype,Gi.prototype);var $i=class{[Le](t){let e=this.type;if(!(e=="checkbox"||e=="radio")&&!(e=="number"&&Number.isNaN(this.valueAsNumber)))return this.$$value=void 0,this.data=this.richValue,O()}[Te](t){let e=this.data,r=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let s=this.checked;Vi(e)?s?Ui(e,r):qi(e,r):this.data=s?r:!1}return O()}setRichValue(t){this.$$value!==t&&(this.$$value=t,this.value!==t&&(this.value=t))}getRichValue(){if(this.$$value!==void 0)return this.$$value;let t=this.value,e=this.type;if(e=="range"||e=="number"){let r=this.valueAsNumber;Number.isNaN(r)&&(r=Number(t.replace(/\,/,".")+0)),Number.isNaN(r)&&(r=null),t=r}else e=="checkbox"