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.

11 lines
22 KiB

3 years ago
(()=>{var t,e={432:t=>{!function(e,n){const s="*",r=Object.defineProperties,o=Object.entries,i=(t,e)=>(n,s)=>(t.has(n)?t.get(n).add(s):t.set(n,(new Set).add(s)),e),a=(t,e)=>(n,r)=>(n!==s||r?((t,e,n,s)=>{if(s){const e=t.get(n);e&&(e.delete(s),0===e.size&&t.delete(n))}else t.delete(n)})(t,0,n,r):t.clear(),e),u=(t,e)=>(t,n)=>e.on(t,(function s(...r){e.off(t,s),n.apply(e,r)})),c=(t,e)=>(n,...r)=>{const o=t.get(n);return o&&o.forEach((t=>t.apply(e,r))),t.get(s)&&n!==s&&e.trigger(s,n,...r),e};t.exports=function(t){const e=new Map;return r(t=t||{},o({on:i,off:a,one:u,trigger:c}).reduce(((n,[s,r])=>(n[s]={value:r(e,t),enumerable:!1,writable:!1,configurable:!1},n)),{})),t}}("undefined"!=typeof window&&window)},641:(t,e,n)=>{"use strict";function s(t){return t.replace(/-(\w)/g,((t,e)=>e.toUpperCase()))}function r(t,e){t.firstChild&&(e.appendChild(t.firstChild),r(t,e))}function o(t){i(t.childNodes)}function i(t){Array.from(t).forEach(a)}const a=t=>t&&t.parentNode&&t.parentNode.removeChild(t),u=(t,e)=>e&&e.parentNode&&e.parentNode.insertBefore(t,e),c=new Map,l=Symbol("riot-component"),p=new Set,d="is",h="mount",m="update",f="unmount",b="shouldUpdate",g="onBeforeMount",v="onMounted",O="onBeforeUpdate",E="onUpdated",y="onBeforeUnmount",N="onUnmounted",T="props",x="state",_="slots",j="root",M=Symbol("pure"),A=Symbol("is_updating"),S=Symbol("parent"),w=Symbol("attributes"),C=Symbol("template");var U=Object.freeze({__proto__:null,COMPONENTS_IMPLEMENTATION_MAP:c,DOM_COMPONENT_INSTANCE_PROPERTY:l,PLUGINS_SET:p,IS_DIRECTIVE:d,VALUE_ATTRIBUTE:"value",MOUNT_METHOD_KEY:h,UPDATE_METHOD_KEY:m,UNMOUNT_METHOD_KEY:f,SHOULD_UPDATE_KEY:b,ON_BEFORE_MOUNT_KEY:g,ON_MOUNTED_KEY:v,ON_BEFORE_UPDATE_KEY:O,ON_UPDATED_KEY:E,ON_BEFORE_UNMOUNT_KEY:y,ON_UNMOUNTED_KEY:N,PROPS_KEY:T,STATE_KEY:x,SLOTS_KEY:_,ROOT_KEY:j,IS_PURE_SYMBOL:M,IS_COMPONENT_UPDATING:A,PARENT_KEY_SYMBOL:S,ATTRIBUTES_KEY_SYMBOL:w,TEMPLATE_KEY_SYMBOL:C});var I={EACH:0,IF:1,SIMPLE:2,TAG:3,SLOT:4};var P={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};const D=Symbol("head"),k=Symbol("tail");function L(t){const e=t.dom.cloneNode(!0),{head:n,tail:s}=function(){const t=document.createTextNode(""),e=document.createTextNode("");return t[D]=!0,e[k]=!0,{head:t,tail:e}}();return{avoidDOMInjection:!0,fragment:e,head:n,tail:s,children:[n,...Array.from(e.childNodes),s]}}function R(t,e,n,s){return void 0===s&&(s={}),Object.defineProperty(t,e,Object.assign({value:n,enumerable:!1,writable:!1,configurable:!0},s)),t}function Y(t,e,n){return Object.entries(e).forEach((e=>{let[s,r]=e;R(t,s,r,n)})),t}function B(t,e){return Object.entries(e).forEach((e=>{let[n,s]=e;t[n]||(t[n]=s)})),t}function K(t,e){return typeof t===e}function V(t){const e=t.ownerSVGElement;return!!e||null===e}function $(t){return"template"===t.tagName.toLowerCase()}function F(t){return K(t,"function")}function z(t){return!H(t)&&t.constructor===Object}function H(t){return null==t}const G=Symbol("unmount"),q={nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:s,childrenMap:r}=this,o=t===G?null:this.evaluate(t),i=o?Array.from(o):[],{newChildrenMap:c,batches:l,futureNodes:p}=function(t,e,n,s){const{condition:r,template:o,childrenMap:i,itemName:a,getKey:u,indexName:c,root:l,isTemplateTag:p}=s,d=new Map,h=[],m=[];return t.forEach(((t,s)=>{const f=function(t,e){let{itemName:n,indexName:s,index:r,item:o}=e;R(t,n,o),s&&R(t,s,r);return t}(Object.create(e),{itemName:a,indexName:c,index:s,item:t}),b=u?u(f):s,g=i.get(b),v=[];if(function(t,e){return!!t&&!t(e)}(r,f))return;const O=!g,E=g?g.template:o.clone(),y=E.el||l.cloneNode(),N=p&&O?L(E):E.meta;O?h.push((()=>E.mount(y,f,n,N))):h.push((()=>E.update(f,n))),p?v.push(...N.children):v.push(y),i.delete(b),m.push(...v),d.set(b,{nodes:v,template:E,context:f,index:s})})),{newChildrenMap:d,batches:h,futureNodes:m}}(i,t,e,this);return((t,e,n,s)=>{const r=e.length;let o=t.length,i=r,c=0,l=0,p=null;for(;c<o||l<i;)if(o===c){const t=i<r?l?n(e[l-1],-0).nextSibling:n(e[i-l],0):s;for(;l<i;)u(n(e[l++],1),t)}else if(i===l)for(;c<o;)p&&p.has(t[c])||a(n(t[c],-1)),c++;else if(t[c]===e[l])c++,l++;else if(t[o-1
/* Riot v6.1.2, @license MIT */
var r;return t[(r=n,r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=zt(s),t}),{})}(e.exports?e.exports.components:{});return t(Nt,P,I,(t=>t===e.name?Bt(e):n[t]||c.get(t)))}function zt(t){const{css:e,template:n,exports:s,name:r}=t,o=n?Ft(n,t):Yt;return t=>{let{slots:i,attributes:a,props:u}=t;if(s&&s[M])return function(t,e){let{slots:n,attributes:s,props:r,css:o,template:i}=e;i&&W("Pure components can not have html"),o&&W("Pure components do not have css");const a=B(t({slots:n,attributes:s,props:r}),Lt);return $t((t=>function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];if(t===h){const[t]=n;R(t,M,!0),Vt(t,a)}return a[t](...n),a}))}(s,{slots:i,attributes:a,props:u,css:e,template:n});const c=xt(s)||{},l=Ht({css:e,template:o,componentAPI:c,name:r})({slots:i,attributes:a,props:u});return{mount:(t,e,n)=>l.mount(t,n,e),update:(t,e)=>l.update(e,t),unmount:t=>l.unmount(t)}}}function Ht(t){let{css:e,template:n,componentAPI:s,name:r}=t;return e&&r&&It.add(r,e),Pt(qt)(Y(B(s,Object.assign({},Rt,{[T]:{},[x]:{}})),Object.assign({[_]:null,[j]:null},kt,{name:r,css:e,template:n})))}function Gt(t,e){return Object.assign({},t,xt(e))}function qt(t,e){let{slots:n,attributes:s,props:r}=e;return o=function(t){return[...p].reduce(((t,e)=>e(t)||t),t)}(Y(z(t)?Object.create(t):t,{mount(e,o,i){return void 0===o&&(o={}),R(e,M,!1),this[S]=i,this[w]=function(t,e){void 0===e&&(e=[]);const n=e.map((e=>lt(t,e))),s={};return Object.assign(s,Object.assign({expressions:n},$t((t=>e=>(n.forEach((n=>n[t](e))),s)))))}(e,s).mount(i),R(this,T,Object.freeze(Object.assign({},Kt(e,r),J(this[w].expressions)))),this.state=Gt(this.state,o),this[C]=this.template.createDOM(e).clone(),Vt(e,this),t.name&&function(t,e){Dt(t)!==e&&At(t,d,e)}(e,t.name),R(this,j,e),R(this,_,n),this.onBeforeMount(this.props,this.state),this[C].mount(e,this,i),this.onMounted(this.props,this.state),this},update(t,e){void 0===t&&(t={}),e&&(this[S]=e,this[w].update(e));const n=J(this[w].expressions);if(!1!==this.shouldUpdate(n,this.props))return R(this,T,Object.freeze(Object.assign({},this.props,n))),this.state=Gt(this.state,t),this.onBeforeUpdate(this.props,this.state),this[A]||(this[A]=!0,this[C].update(this,this[S])),this.onUpdated(this.props,this.state),this[A]=!1,this},unmount(t){return this.onBeforeUnmount(this.props,this.state),this[w].unmount(),this[C].unmount(this,this[S],null===t?null:!t),this.onUnmounted(this.props,this.state),this}})),Object.keys(t).filter((e=>F(t[e]))).forEach((t=>{o[t]=o[t].bind(o)})),o;var o}const{DOM_COMPONENT_INSTANCE_PROPERTY:Xt,COMPONENTS_IMPLEMENTATION_MAP:Wt,PLUGINS_SET:Zt}=U;function Jt(t,e){let{css:n,template:s,exports:r}=e;return Wt.has(t)&&W(`The component "${t}" was already registered`),Wt.set(t,zt({name:t,css:n,template:s,exports:r})),Wt}function Qt(t,e,n){return jt(t).map((t=>function(t,e,n){const s=n||Dt(t);return c.has(s)||W(`The component named "${s}" was never registered`),c.get(s)({props:e}).mount(t)}(t,e,n)))}var te,ee=new Uint8Array(16);function ne(){if(!te&&!(te="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(ee)}const se=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const re=function(t){return"string"==typeof t&&se.test(t)};for(var oe=[],ie=0;ie<256;++ie)oe.push((ie+256).toString(16).substr(1));const ae=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(oe[t[e+0]]+oe[t[e+1]]+oe[t[e+2]]+oe[t[e+3]]+"-"+oe[t[e+4]]+oe[t[e+5]]+"-"+oe[t[e+6]]+oe[t[e+7]]+"-"+oe[t[e+8]]+oe[t[e+9]]+"-"+oe[t[e+10]]+oe[t[e+11]]+oe[t[e+12]]+oe[t[e+13]]+oe[t[e+14]]+oe[t[e+15]]).toLowerCase();if(!re(n))throw TypeError("Stringified UUID is invalid");return n};const ue=function(t,e,n){var s=(t=t||{}).random||(t.rng||ne)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){n=
/**
* NotificationService
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.node001.net/tiny-components/notification
*
*/const le=n.n(ce)()({SUCCESS:"success",DANGER:"danger",INFO:"info",success:function(t){this._add(t,this.SUCCESS)},danger:function(t){this._add(t,this.DANGER)},info:function(t){this._add(t,this.INFO)},_add:function(t,e){this.trigger("append",{message:t,type:e})}}),pe={css:null,exports:{state:{items:[],timeout:5e3,prefixId:"tiny-notification-",wrapperClass:""},onMounted(t,e){t.timeout&&(e.timeout=t.timeout),t.wrapperClass&&(e.wrapperClass=t.wrapperClass),le.on("append",(t=>{t.id=this.state.prefixId+"toast-"+ue(),t.timeout=setTimeout((()=>{this.removeItem(t)}),this.state.timeout),t.classes=["toast","toast--"+t.type],this.state.items.push(t),this.update(),setTimeout((()=>{for(let e=0;e<this.state.items.length;e++)this.state.items[e].id===t.id&&(this.state.items[e].classes.push("toast--animation"),this.update())}),10)}))},removeItem(t){this.$("#"+t.id).addEventListener("transitionend",(()=>{const e=[];for(let n=0;n<this.state.items.length;n++)this.state.items[n].id===t.id?clearTimeout(this.state.items[n].timeout):e.push(this.state.items[n]);this.state.items=e,this.update()})),requestAnimationFrame((()=>{for(let e=0;e<this.state.items.length;e++)this.state.items[e].id===t.id&&(this.state.items[e].classes.pop("toast--animation"),this.update())}))},handleClick(t,e){this.removeItem(e)}},template:(t,e,n,s)=>t('<div expr0="expr0"></div>',[{type:n.IF,evaluate:t=>t.state.items.length>0,redundantAttribute:"expr0",selector:"[expr0]",template:t('<div expr1="expr1"></div>',[{expressions:[{type:e.ATTRIBUTE,name:"class",evaluate:t=>["toast-wrapper ",t.state.wrapperClass].join("")}]},{type:n.EACH,getKey:null,condition:null,template:t('<div expr2="expr2" class="toast__body"> </div>',[{expressions:[{type:e.ATTRIBUTE,name:"id",evaluate:t=>t.item.id},{type:e.ATTRIBUTE,name:"class",evaluate:t=>t.item.classes.join(" ")},{type:e.EVENT,name:"onclick",evaluate:t=>e=>{t.handleClick(e,t.item)}}]},{redundantAttribute:"expr2",selector:"[expr2]",expressions:[{type:e.TEXT,childNodeIndex:0,evaluate:t=>[t.item.message].join("")}]}]),redundantAttribute:"expr1",selector:"[expr1]",itemName:"item",indexName:null,evaluate:t=>t.state.items}])}]),name:"tiny-notification"},de={css:null,exports:{handleClickDanger(t){le.danger("Error!")},handleClickSuccess(t){le.success("Success!")}},template:(t,e,n,s)=>t('<div class="m-top-4 m-bottom-4"><button expr3="expr3" class="button button--danger m-right-md-3">\n Show Error!\n </button><button expr4="expr4" class="button button--success m-left-md-3">\n Show Success!\n </button></div>',[{redundantAttribute:"expr3",selector:"[expr3]",expressions:[{type:e.EVENT,name:"onclick",evaluate:t=>e=>{t.handleClickDanger(e)}}]},{redundantAttribute:"expr4",selector:"[expr4]",expressions:[{type:e.EVENT,name:"onclick",evaluate:t=>e=>{t.handleClickSuccess(e)}}]}]),name:"example-action-button"};Jt("tiny-notification",pe),Jt("example-action-button",de),Qt("tiny-notification"),Qt("example-action-button")},37:()=>{}},n={};function s(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,s),o.exports}s.m=e,t=[],s.O=(e,n,r,o)=>{if(!n){var i=1/0;for(l=0;l<t.length;l++){for(var[n,r,o]=t[l],a=!0,u=0;u<n.length;u++)(!1&o||i>=o)&&Object.keys(s.O).every((t=>s.O[t](n[u])))?n.splice(u--,1):(a=!1,o<i&&(i=o));if(a){t.splice(l--,1);var c=r();void 0!==c&&(e=c)}}return e}o=o||0;for(var l=t.length;l>0&&t[l-1][2]>o;l--)t[l]=t[l-1];t[l]=[n,r,o]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={268:0,908:0};s.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,[i,a,u]=n,c=0;if(i.some((e=>0!==t[e]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(u)var l=u(s)}for(e&&e(n);c<i.length;c++)o=i[c],s.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return s.O(l)},n=self.webpackChunk_tiny_components_notification=self.webpackChunk_tiny_components_notification||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),s.O(void 0,[908],(()=>s(