forked from riot/riot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
riot.min.js
2 lines (2 loc) · 24 KB
/
riot.min.js
1
2
/* Riot v3.7.3, @license MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.riot={})}(this,function(e){"use strict";function t(e,t){for(var n=e?e.length:0,r=0;r<n;r++)t(e[r],r);return e}function n(e,t){return-1!==e.indexOf(t)}function r(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function i(e,t){return e.slice(0,t.length)===t}function o(e,t,n,r){return Object.defineProperty(e,t,a({value:n,enumerable:!1,writable:!1,configurable:!0},r)),e}function a(e){for(var t,n=1,r=arguments,i=r.length;n<i;n++)if(t=r[n])for(var o in t)g(e,o)&&(e[o]=t[o]);return e}function s(e){return Ge.test(e)}function u(e){return typeof e===Ve}function l(e){return e&&typeof e===$e}function c(e){return typeof e===He}function f(e){return typeof e===Pe}function p(e){return d(e)||""===e}function d(e){return c(e)||null===e}function h(e){return Array.isArray(e)||e instanceof Array}function g(e,t){var n=Xe(e,t);return c(e[t])||n&&n.writable}function m(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function v(e,t){return(t||document).querySelector(e)}function y(){return document.createDocumentFragment()}function _(){return document.createTextNode("")}function x(e){return!!e.ownerSVGElement}function b(e){return"svg"===e?document.createElementNS(Be,e):document.createElement(e)}function w(e,t){if(c(e.innerHTML)){var n=(new DOMParser).parseFromString(t,"application/xml"),r=e.ownerDocument.importNode(n.documentElement,!0);e.appendChild(r)}else e.innerHTML=t}function N(e,t){e.style.display=t?"":"none",e.hidden=!t}function O(e,t){e.removeAttribute(t)}function C(e){return Object.keys(e).reduce(function(t,n){return t+" "+n+": "+e[n]+";"},"")}function E(e,t){return e.getAttribute(t)}function j(e,t,n){var r=ze.exec(t);r&&r[1]?e.setAttributeNS(Ue,r[1],n):e.setAttribute(t,n)}function T(e,t,n){e.insertBefore(t,n.parentNode&&n)}function A(e,t){if(e)for(var n;n=We.exec(e);)t(n[1].toLowerCase(),n[2]||n[3]||n[4])}function L(e,t,n){if(e){var r,i=t(e,n);if(!1===i)return;for(e=e.firstChild;e;)r=e.nextSibling,L(e,t,i),e=r}}function k(e,t,n){var r=this.__.parent,i=this.__.item;if(!i)for(;r&&!i;)i=r.__.item,r=r.__.parent;if(g(n,"currentTarget")&&(n.currentTarget=e),g(n,"target")&&(n.target=n.srcElement),g(n,"which")&&(n.which=n.charCode||n.keyCode),n.item=i,t.call(this,n),ct.autoUpdate&&!n.preventUpdate){var o=ce(this);o.isMounted&&o.update()}}function M(e,t,r,i){var o,a=k.bind(i,r,t);r[e]=null,o=e.replace(qe,""),n(i.__.listeners,r)||i.__.listeners.push(r),r[Re]||(r[Re]={}),r[Re][e]&&r.removeEventListener(o,r[Re][e]),r[Re][e]=a,r.addEventListener(o,a,!1)}function S(e,n,r){var i,o=e.tag||e.dom._tag,a=(o?o.__:{}).head,s="VIRTUAL"===e.dom.tagName;o&&e.tagName===r?o.update():(o&&(s&&(i=_(),a.parentNode.insertBefore(i,a)),o.unmount(!0)),f(r)&&(e.impl=Ne[r],e.impl&&(e.tag=o=le(e.impl,{root:e.dom,parent:n,tagName:r},e.dom.innerHTML,n),t(e.attrs,function(e){return j(o.root,e.name,e.value)}),e.tagName=r,o.mount(),s&&me(o,i||o.root),n.__.onUnmount=function(){var e=o.opts.dataIs;he(o.parent.tags,e,o),he(o.__.parent.tags,e,o),o.unmount()})))}function I(e){return e?(e=e.replace(Ee,""),Ze[e]&&(e=Ze[e]),e):null}function R(e){if(!this.root||!E(this.root,"virtualized")){var t,r=e.dom,i=I(e.attr),o=n([Me,Se],i),s=e.root&&"VIRTUAL"===e.root.tagName,c=this.__.isAnonymous,f=r&&(e.parent||r.parentNode),d="style"===i,h="class"===i;if(e._riot_id)e.__.wasCreated?e.update():(e.mount(),s&&me(e,e.root));else{if(e.update)return e.update();var g=o&&!c?a(Object.create(this),this.parent):this,m=!p(t=ut(e.expr,g)),v=l(t);if(v&&(h?t=ut(JSON.stringify(t),this):d&&(t=C(t))),!e.attr||e.wasParsedOnce&&m&&!1!==t||O(r,E(r,e.attr)?e.attr:i),e.bool&&(t=!!t&&i),e.isRtag)return S(e,this,t);if((!e.wasParsedOnce||e.value!==t)&&(e.value=t,e.wasParsedOnce=!0,!v||h||d||o)){if(m||(t=""),!i)return t+="",void(f&&(e.parent=f,"TEXTAREA"===f.tagName?(f.value=t,Qe||(r.nodeValue=t)):r.nodeValue=t));u(t)?M(i,t,r,this):o?N(r,i===Se?!t:t):(e.bool&&(r[i]=t),"value"===i&&r.value!==t?r.value=t:m&&!1!==t&&j(r,i,t),d&&r.hidden&&N(r,!1))}}}}function P(e){t(e,R.bind(this))}function $(e,t,n,r){var i=r?Object.create(r):{};return i[e.key]=t,e.pos&&(i[e.pos]=n),i}function H(e,t){for(var n=t.length,r=e.length;n>r;)n--,V.apply(t[n],[t,n])}function V(e,t){e.splice(t,1),this.unmount(),he(this.parent,this,this.__.tagName,!0)}function U(e){var n=this;t(Object.keys(this.tags),function(t){ue.apply(n.tags[t],[t,e])})}function B(e,t,n){n?ye.apply(this,[e,t]):T(e,this.root,t.root)}function z(e,t,n){n?ve.apply(this,[e,t]):T(e,this.root,t.root)}function F(e,t){t?ve.call(this,e):e.appendChild(this.root)}function D(e,t,n,r){return e?r?ut(e,n):t[e]:t}function K(e,r,i){var o,s=typeof E(e,ke)!==Pe||O(e,ke),u=E(e,Ie),l=!!u&&ut.hasExpr(u),c=pe(e),p=Ne[c],d=e.parentNode,g=_(),m=se(e),v=E(e,Ae),x=[],b=e.innerHTML,w=!Ne[c],N="VIRTUAL"===e.tagName,C=[];return O(e,Le),O(e,Ie),i=ut.loopKeys(i),i.isLoop=!0,v&&O(e,Ae),d.insertBefore(g,e),d.removeChild(e),i.update=function(){i.value=ut(i.val,r);var d=i.value,_=y(),O=!h(d)&&!f(d),E=g.parentNode,j=[];E&&(O?d=(o=d||!1)?Object.keys(d).map(function(e){return $(i,d[e],e)}):[]:o=!1,v&&(d=d.filter(function(e,t){return i.key&&!O?!!ut(v,$(i,e,t,r)):!!ut(v,a(Object.create(r),e))})),t(d,function(t,a){var f=!o&&i.key?$(i,t,a):t,h=D(u,t,f,l),g=s&&typeof t===$e&&!o,v=C.indexOf(h),y=-1===v,O=!y&&g?v:a,T=x[O],A=a>=C.length,L=g&&y||!g&&!T;L?((T=ae(p,{parent:r,isLoop:!0,isAnonymous:w,tagName:c,root:e.cloneNode(w),item:f,index:a},b)).mount(),A?F.apply(T,[_||E,N]):z.apply(T,[E,x[a],N]),A||C.splice(a,0,f),x.splice(a,0,T),m&&de(r.tags,c,T,!0)):O!==a&&g&&((u||n(d,C[O]))&&(B.apply(T,[E,x[a],N]),x.splice(a,0,x.splice(O,1)[0]),C.splice(a,0,C.splice(O,1)[0])),i.pos&&(T[i.pos]=a),!m&&T.tags&&U.call(T,a)),T.__.item=f,T.__.index=a,T.__.parent=r,j[a]=h,L||T.update(f)}),H(d,x),C=j.slice(),E.insertBefore(_,g))},i.unmount=function(){t(x,function(e){e.unmount()})},i}function q(e,t,n){var r=this;L(e,function(t,i){var o,a,s,u=t.nodeType,l=i.parent;if(!n&&t===e)return{parent:l};if(3===u&&"STYLE"!==t.parentNode.tagName&&ut.hasExpr(t.nodeValue)&&l.children.push({dom:t,expr:t.nodeValue}),1!==u)return i;var c="VIRTUAL"===t.tagName;if(o=E(t,Le))return c&&j(t,"loopVirtual",!0),l.children.push(K(t,r,o)),!1;if(o=E(t,Ae))return l.children.push(Object.create(ft).init(t,r,o)),!1;if((a=E(t,Te))&&ut.hasExpr(a))return l.children.push({isRtag:!0,expr:a,dom:t,attrs:[].slice.call(t.attributes)}),!1;if(s=se(t),c&&(E(t,"virtualized")&&t.parentElement.removeChild(t),s||E(t,"virtualized")||E(t,"loopVirtual")||(s={tmpl:t.outerHTML})),s&&(t!==e||n)){if(!c||E(t,Te))return l.children.push(le(s,{root:t,parent:r},t.innerHTML,r)),!1;j(t,"virtualized",!0);var f=ae({tmpl:t.outerHTML},{root:t,parent:r},t.innerHTML);l.children.push(f)}return W.apply(r,[t,t.attributes,function(e,t){t&&l.children.push(t)}]),{parent:l}},{parent:{children:t}})}function W(e,r,i){var o=this;t(r,function(t){if(!t)return!1;var r,a=t.name,u=s(a);n(je,a)&&e.tagName.toLowerCase()!==Oe?r=Object.create(pt).init(e,o,a,t.value):ut.hasExpr(t.value)&&(r={dom:e,expr:t.value,attr:a,bool:u}),i(t,r)})}function Z(e,t,n){var r="o"===n[0],i=r?"select>":"table>";if(e.innerHTML="<"+i+t.trim()+"</"+i,i=e.firstChild,r)i.selectedIndex=-1;else{var o=vt[n];o&&1===i.childElementCount&&(i=v(o,i))}return i}function G(e,t){if(!dt.test(e))return e;var n={};return t=t&&t.replace(gt,function(e,t,r){return n[t]=n[t]||r,""}).trim(),e.replace(mt,function(e,t,r){return n[t]||r||""}).replace(ht,function(e,n){return t||n||""})}function Q(e,t,n){var r=e&&e.match(/^\s*<([-\w]+)/),i=r&&r[1].toLowerCase(),o=b(n?xt:_t);return e=G(e,t),yt.test(i)?o=Z(o,e,i):w(o,e),o}function J(e,t){var n=this,r=n.name,i=n.tmpl,o=n.css,a=n.attrs,s=n.onCreate;return Ne[r]||(X(r,i,o,a,s),Ne[r].class=this.constructor),ge(e,r,t,this),o&&ot.inject(),this}function X(e,t,n,r,i){return u(r)&&(i=r,/^[\w-]+\s?=/.test(n)?(r=n,n=""):r=""),n&&(u(n)?i=n:ot.add(n)),e=e.toLowerCase(),Ne[e]={name:e,tmpl:t,attrs:r,fn:i},e}function Y(e,t,n,r,i){return n&&ot.add(n,e),Ne[e]={name:e,tmpl:t,attrs:r,fn:i},e}function ee(e,n,r){function i(e){if(e.tagName){var o,a=E(e,Te);n&&a!==n&&(a=n,j(e,Te,n)),(o=ge(e,a||e.tagName.toLowerCase(),r))&&s.push(o)}else e.length&&t(e,i)}var o,a,s=[];if(ot.inject(),l(n)&&(r=n,n=0),o=f(e)?(e="*"===e?a=_e():e+_e(e.split(/, */)))?m(e):[]:e,"*"===n){if(n=a||_e(),o.tagName)o=m(n,o);else{var u=[];t(o,function(e){return u.push(m(n,e))}),o=u}n=0}return i(o),s}function te(e,t,n){if(l(e))te("__"+Nt+++"__",e,!0);else{var r=n?wt:bt;if(!t){if(c(r[e]))throw new Error("Unregistered mixin: "+e);return r[e]}r[e]=u(t)?a(t.prototype,r[e]||{})&&t:a(r[e]||{},t)}}function ne(){return t(we,function(e){return e.update()})}function re(e){Ne[e]=null}function ie(e,n,i,o,a){if(!e||!i){var s=!i&&e?this:n||this;t(a,function(e){e.expr&&P.call(s,[e.expr]),o[r(e.name).replace(Ee,"")]=e.expr?e.expr.value:e.value})}}function oe(e){var t=this.__.isAnonymous;o(this,"isMounted",e),t||(e?this.trigger("mount"):(this.trigger("unmount"),this.off("*"),this.__.wasCreated=!1))}function ae(e,r,s){void 0===e&&(e={}),void 0===r&&(r={});var l,c=r.context||{},p=a({},r.opts),d=r.parent,h=r.isLoop,g=!!r.isAnonymous,m=ct.skipAnonymousTags&&g,v=r.item,y=r.index,_=[],b=[],N=[],C=r.root,E=r.tagName||pe(C),T="virtual"===E,L=!T&&!e.tmpl;return m||lt(c),e.name&&C._tag&&C._tag.unmount(!0),o(c,"isMounted",!1),o(c,"__",{isAnonymous:g,instAttrs:_,innerHTML:s,tagName:E,index:y,isLoop:h,isInline:L,listeners:[],virts:[],wasCreated:!1,tail:null,head:null,parent:null,item:null}),o(c,"_riot_id",Je()),o(c,"root",C),a(c,{opts:p},v),o(c,"parent",d||null),o(c,"tags",{}),o(c,"refs",{}),L||h&&g?l=C:(T||(C.innerHTML=""),l=Q(e.tmpl,s,x(C))),o(c,"update",function(e){var t={},n=c.isMounted&&!m;return g&&d&&a(c,d),a(c,e),ie.apply(c,[h,d,g,t,_]),n&&c.isMounted&&u(c.shouldUpdate)&&!c.shouldUpdate(e,t)?c:(a(p,t),n&&c.trigger("update",e),P.call(c,N),n&&c.trigger("updated"),c)}),o(c,"mixin",function(){return t(arguments,function(e){var r,i,o=[],a=["init","__proto__"];e=f(e)?te(e):e,r=u(e)?new e:e;var s=Object.getPrototypeOf(r);do{o=o.concat(Object.getOwnPropertyNames(i||r))}while(i=Object.getPrototypeOf(i||r));t(o,function(e){if(!n(a,e)){var t=Xe(r,e)||Xe(s,e),i=t&&(t.get||t.set);!c.hasOwnProperty(e)&&i?Object.defineProperty(c,e,t):c[e]=u(r[e])?r[e].bind(c):r[e]}}),r.init&&r.init.bind(c)(p)}),c}),o(c,"mount",function(){C._tag=c,W.apply(d,[C,C.attributes,function(e,t){!g&&pt.isPrototypeOf(t)&&(t.tag=c),e.expr=t,_.push(e)}]),A(e.attrs,function(e,t){b.push({name:e,value:t})}),W.apply(c,[C,b,function(e,t){t?N.push(t):j(C,e.name,e.value)}]),ie.apply(c,[h,d,g,p,_]);var t=te(Ce);if(t&&!m)for(var n in t)t.hasOwnProperty(n)&&c.mixin(t[n]);if(e.fn&&e.fn.call(c,p),m||c.trigger("before-mount"),q.apply(c,[l,N,g]),c.update(v),!g&&!L)for(;l.firstChild;)C.appendChild(l.firstChild);if(o(c,"root",C),!m&&c.parent){var r=ce(c.parent);r.one(r.isMounted?"updated":"mount",function(){oe.call(c,!0)})}else oe.call(c,!0);return c.__.wasCreated=!0,c}),o(c,"unmount",function(n){var r,o=c.root,a=o.parentNode,s=we.indexOf(c);return m||c.trigger("before-unmount"),A(e.attrs,function(e){i(e,Ee)&&(e=e.slice(Ee.length)),O(C,e)}),c.__.listeners.forEach(function(e){Object.keys(e[Re]).forEach(function(t){e.removeEventListener(t,e[Re][t])})}),-1!==s&&we.splice(s,1),(a||T)&&(d?(r=ce(d),T?Object.keys(c.tags).forEach(function(e){he(r.tags,e,c.tags[e])}):(he(r.tags,E,c),d!==r&&he(d.tags,E,c))):w(o,""),a&&!n&&a.removeChild(o)),c.__.virts&&t(c.__.virts,function(e){e.parentNode&&e.parentNode.removeChild(e)}),fe(N),t(_,function(e){return e.expr&&e.expr.unmount&&e.expr.unmount()}),c.__.onUnmount&&c.__.onUnmount(),c.isMounted||oe.call(c,!0),oe.call(c,!1),delete c.root._tag,c}),c}function se(e){return e.tagName&&Ne[E(e,Te)||E(e,Te)||e.tagName.toLowerCase()]}function ue(e,t){var n,r=this.parent;r&&(h(n=r.tags[e])?n.splice(t,0,n.splice(n.indexOf(this),1)[0]):de(r.tags,e,this))}function le(e,t,n,r){var i=ae(e,t,n),a=t.tagName||pe(t.root,!0),s=ce(r);return o(i,"parent",s),i.__.parent=r,de(s.tags,a,i),s!==r&&de(r.tags,a,i),i}function ce(e){for(var t=e;t.__.isAnonymous&&t.parent;)t=t.parent;return t}function fe(e){t(e,function(e){e.unmount?e.unmount(!0):e.tagName?e.tag.unmount(!0):e.unmount&&e.unmount()})}function pe(e,t){var n=se(e),r=!t&&E(e,Te);return r&&!ut.hasExpr(r)?r:n?n.name:e.tagName.toLowerCase()}function de(e,t,n,r,i){var o=e[t],a=h(o),s=!c(i);if(!o||o!==n)if(!o&&r)e[t]=[n];else if(o)if(a){var u=o.indexOf(n);if(u===i)return;-1!==u&&o.splice(u,1),s?o.splice(i,0,n):o.push(n)}else e[t]=[o,n];else e[t]=n}function he(e,t,n,r){if(h(e[t])){var i=e[t].indexOf(n);-1!==i&&e[t].splice(i,1),e[t].length?1!==e[t].length||r||(e[t]=e[t][0]):delete e[t]}else delete e[t]}function ge(e,t,r,i){var o,s=Ne[t],u=Ne[t].class,l=i||(u?Object.create(u.prototype):{}),c=e._innerHTML=e._innerHTML||e.innerHTML,f=a({root:e,opts:r,context:l},{parent:r?r.parent:null});return s&&e&&(o=ae(s,f,c)),o&&o.mount&&(o.mount(!0),n(we,o)||we.push(o)),o}function me(e,t){var n=y();ve.call(e,n),t.parentNode.replaceChild(n,t)}function ve(e,t){var n,r,i=this,o=_(),a=_(),s=y();for(this.root.insertBefore(o,this.root.firstChild),this.root.appendChild(a),this.__.head=r=o,this.__.tail=a;r;)n=r.nextSibling,s.appendChild(r),i.__.virts.push(r),r=n;t?e.insertBefore(s,t.__.head):e.appendChild(s)}function ye(e,t){for(var n,r=this,i=this.__.head,o=y();i;)if(n=i.nextSibling,o.appendChild(i),(i=n)===r.__.tail){o.appendChild(i),e.insertBefore(o,t.__.head);break}}function _e(e){if(!e){var t=Object.keys(Ne);return t+_e(t)}return e.filter(function(e){return!/[^-\w]/.test(e)}).reduce(function(e,t){var n=t.trim().toLowerCase();return e+",["+Te+'="'+n+'"]'},"")}var xe,be,we=[],Ne={},Oe="yield",Ce="__global_mixin",Ee="riot-",je=["ref","data-ref"],Te="data-is",Ae="if",Le="each",ke="no-reorder",Me="show",Se="hide",Ie="key",Re="__riot-events__",Pe="string",$e="object",He="undefined",Ve="function",Ue="http://www.w3.org/1999/xlink",Be="http://www.w3.org/2000/svg",ze=/^xlink:(\w+)/,Fe=typeof window===He?void 0:window,De=/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?|opt(?:ion|group))$/,Ke=/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?)$/,qe=/^on/,We=/([-\w]+) ?= ?(?:"([^"]*)|'([^']*)|({[^}]*}))/g,Ze={viewbox:"viewBox",preserveaspectratio:"preserveAspectRatio"},Ge=/^(?:disabled|checked|readonly|required|allowfullscreen|auto(?:focus|play)|compact|controls|default|formnovalidate|hidden|ismap|itemscope|loop|multiple|muted|no(?:resize|shade|validate|wrap)?|open|reversed|seamless|selected|sortable|truespeed|typemustmatch)$/,Qe=0|(Fe&&Fe.document||{}).documentMode,Je=function(){var e=0;return function(){return++e}}(),Xe=function(e,t){return Object.getOwnPropertyDescriptor(e,t)},Ye=Object.freeze({each:t,contains:n,toCamel:r,startsWith:i,defineProperty:o,uid:Je,getPropDescriptor:Xe,extend:a}),et=Object.freeze({isBoolAttr:s,isFunction:u,isObject:l,isUndefined:c,isString:f,isBlank:p,isNil:d,isArray:h,isWritable:g}),tt=Object.freeze({$$:m,$:v,createFrag:y,createDOMPlaceholder:_,isSvg:x,mkEl:b,setInnerHTML:w,toggleVisibility:N,remAttr:O,styleObjectToString:C,getAttr:E,setAttr:j,safeInsert:T,walkAttrs:A,walkNodes:L}),nt={},rt=[],it=!1;Fe&&(xe=function(){var e=b("style"),t=v("style[type=riot]");return j(e,"type","text/css"),t?(t.id&&(e.id=t.id),t.parentNode.replaceChild(e,t)):document.getElementsByTagName("head")[0].appendChild(e),e}(),be=xe.styleSheet);var ot={styleNode:xe,add:function(e,t){t?nt[t]=e:rt.push(e),it=!0},inject:function(){if(Fe&&it){it=!1;var e=Object.keys(nt).map(function(e){return nt[e]}).concat(rt).join("\n");be?be.cssText=e:xe.innerHTML=e}}},at=function(){function e(e,t){for(;--t>=0&&/\s/.test(e[t]););return t}var t="[{(,;:?=|&!^~>%*/",n=["case","default","do","else","in","instanceof","prefix","return","typeof","void","yield"],r=n.reduce(function(e,t){return e+t.slice(-1)},""),i=/^\/(?=[^*>/])[^[/\\]*(?:(?:\\.|\[(?:\\.|[^\]\\]*)*\])[^[\\/]*)*?\/[gimuy]*/,o=/[$\w]/;return function(a,s){var u=/.*/g,l=u.lastIndex=s++,c=u.exec(a)[0].match(i);if(c){var f=l+c[0].length,p=a[l=e(a,l)];if(l<0||~t.indexOf(p))return f;if("."===p)"."===a[l-1]&&(s=f);else if("+"===p||"-"===p)(a[--l]!==p||(l=e(a,l))<0||!o.test(a[l]))&&(s=f);else if(~r.indexOf(p)){for(var d=l+1;--l>=0&&o.test(a[l]););~n.indexOf(a.slice(l+1,d))&&(s=f)}}return s}}(),st=function(e){function t(e){return e}function n(e,t){return t||(t=_),new RegExp(e.source.replace(/{/g,t[2]).replace(/}/g,t[3]),e.global?u:"")}function r(e){if(e===m)return v;var t=e.split(" ");if(2!==t.length||p.test(e))throw new Error('Unsupported brackets "'+e+'"');return t=t.concat(e.replace(d,"\\").split(" ")),t[4]=n(t[1].length>1?/{[\S\s]*?}/:v[4],t),t[5]=n(e.length>3?/\\({|})/g:v[5],t),t[6]=n(v[6],t),t[7]=RegExp("\\\\("+t[3]+")|([[({])|("+t[3]+")|"+h,u),t[8]=e,t}function i(e){return e instanceof RegExp?a(e):_[e]}function o(e){(e||(e=m))!==_[8]&&(_=r(e),a=e===m?t:n,_[9]=a(v[9])),y=e}var a,s,u="g",l=/\/\*[^*]*\*+(?:[^*\/][^*]*\*+)*\//g,c=/"[^"\\]*(?:\\[\S\s][^"\\]*)*"|'[^'\\]*(?:\\[\S\s][^'\\]*)*'|`[^`\\]*(?:\\[\S\s][^`\\]*)*`/g,f=c.source+"|"+/(?:\breturn\s+|(?:[$\w\)\]]|\+\+|--)\s*(\/)(?![*\/]))/.source+"|"+/\/(?=[^*\/])[^[\/\\]*(?:(?:\[(?:\\.|[^\]\\]*)*\]|\\.)[^[\/\\]*)*?([^<]\/)[gim]*/.source,p=RegExp("[\\x00-\\x1F<>a-zA-Z0-9'\",;\\\\]"),d=/(?=[[\]()*+?.^$|])/g,h=c.source+"|"+/(\/)(?![*\/])/.source,g={"(":RegExp("([()])|"+h,u),"[":RegExp("([[\\]])|"+h,u),"{":RegExp("([{}])|"+h,u)},m="{ }",v=["{","}","{","}",/{[^}]*}/,/\\([{}])/g,/\\({)|{/g,RegExp("\\\\(})|([[({])|(})|"+h,u),m,/^\s*{\^?\s*([$\w]+)(?:\s*,\s*(\S+))?\s+in\s+(\S.*)\s*}/,/(^|[^\\]){=[\S\s]*?}/],y=void 0,_=[];return i.split=function(e,t,n){function r(e){h&&(e=h+e,h=""),t||a?f.push(e&&e.replace(n[5],"$1")):f.push(e)}function i(n,r,i){return i&&(r=at(e,n)),t&&r>n+2&&(l="⁗"+d.length+"~",d.push(e.slice(n,r)),h+=e.slice(s,n)+l,s=r),r}n||(n=_);var o,a,s,u,l,c,f=[],p=n[6],d=[],h="";for(a=s=p.lastIndex=0;o=p.exec(e);){if(c=p.lastIndex,u=o.index,a){if(o[2]){var m=o[2],v=g[m],y=1;for(v.lastIndex=c;o=v.exec(e);)if(o[1]){if(o[1]===m)++y;else if(!--y)break}else v.lastIndex=i(o.index,v.lastIndex,o[2]);p.lastIndex=y?e.length:v.lastIndex;continue}if(!o[3]){p.lastIndex=i(u,c,o[4]);continue}}o[1]||(r(e.slice(s,u)),s=p.lastIndex,(p=n[6+(a^=1)]).lastIndex=s)}return e&&s<e.length&&r(e.slice(s)),f.qblocks=d,f},i.hasExpr=function(e){return _[4].test(e)},i.loopKeys=function(e){var t=e.match(_[9]);return t?{key:t[1],pos:t[2],val:_[0]+t[3].trim()+_[1]}:{val:e.trim()}},i.array=function(e){return e?r(e):_},Object.defineProperty(i,"settings",{set:function(e){var t;t=(e=e||{}).brackets,Object.defineProperty(e,"brackets",{set:o,get:function(){return y},enumerable:!0}),s=e,o(t)},get:function(){return s}}),i.settings="undefined"!=typeof riot&&riot.settings||{},i.set=o,i.skipRegex=at,i.R_STRINGS=c,i.R_MLCOMMS=l,i.S_QBLOCKS=f,i.S_QBLOCK2=h,i}(),ut=function(){function e(e,r){return e?(a[e]||(a[e]=n(e))).call(r,t.bind({data:r,tmpl:e})):e}function t(t,n){t.riotData={tagName:n&&n.__&&n.__.tagName,_riot_id:n&&n._riot_id},e.errorHandler?e.errorHandler(t):"undefined"!=typeof console&&"function"==typeof console.error&&(console.error(t.message),console.log("<%s> %s",t.riotData.tagName||"Unknown tag",this.tmpl),console.log(this.data))}function n(e){var t=r(e);return"try{return "!==t.slice(0,11)&&(t="return "+t),new Function("E",t+";")}function r(e){var t,n=st.split(e.replace(s,'"'),1),r=n.qblocks;if(n.length>2||n[0]){var o,a,l=[];for(o=a=0;o<n.length;++o)(t=n[o])&&(t=1&o?i(t,1,r):'"'+t.replace(/\\/g,"\\\\").replace(/\r\n?|\n/g,"\\n").replace(/"/g,'\\"')+'"')&&(l[a++]=t);t=a<2?l[0]:"["+l.join(",")+'].join("")'}else t=i(n[1],0,r);return r.length&&(t=t.replace(u,function(e,t){return r[t].replace(/\r/g,"\\r").replace(/\n/g,"\\n")})),t}function i(e,t,n){if(e=e.replace(/\s+/g," ").trim().replace(/\ ?([[\({},?\.:])\ ?/g,"$1")){for(var r,i=[],a=0;e&&(r=e.match(l))&&!r.index;){var s,u,f=/,|([[{(])|$/g;for(e=RegExp.rightContext,s=r[2]?n[r[2]].slice(1,-1).trim().replace(/\s+/g," "):r[1];u=(r=f.exec(e))[1];)!function(t,n){var r,i=1,o=c[t];for(o.lastIndex=n.lastIndex;r=o.exec(e);)if(r[0]===t)++i;else if(!--i)break;n.lastIndex=i?e.length:o.lastIndex}(u,f);u=e.slice(0,r.index),e=RegExp.rightContext,i[a++]=o(u,1,s)}e=a?a>1?"["+i.join(",")+'].join(" ").trim()':i[0]:o(e,t)}return e}function o(e,t,n){var r;return e=e.replace(p,function(e,t,n,i,o){return n&&(i=r?0:i+e.length,"this"!==n&&"global"!==n&&"window"!==n?(e=t+'("'+n+f+n,i&&(r="."===(o=o[i])||"("===o||"["===o)):i&&(r=!d.test(o.slice(i)))),e}),r&&(e="try{return "+e+"}catch(e){E(e,this)}"),n?e=(r?"function(){"+e+"}.call(this)":"("+e+")")+'?"'+n+'":""':t&&(e="function(v){"+(r?e.replace("return ","v="):"v=("+e+")")+';return v||v===0?v:""}.call(this)'),e}var a={};e.hasExpr=st.hasExpr,e.loopKeys=st.loopKeys,e.clearCache=function(){a={}},e.errorHandler=null;var s=/\u2057/g,u=/\u2057(\d+)~/g,l=/^(?:(-?[_A-Za-z\xA0-\xFF][-\w\xA0-\xFF]*)|\u2057(\d+)~):/,c={"(":/[()]/g,"[":/[[\]]/g,"{":/[{}]/g},f='"in this?this:'+("object"!=typeof window?"global":"window")+").",p=/[,{][\$\w]+(?=:)|(^ *|[^$\w\.{])(?!(?:typeof|true|false|null|undefined|in|instanceof|is(?:Finite|NaN)|void|NaN|new|Date|RegExp|Math)(?![$\w]))([$_A-Za-z][$\w]*)/g,d=/^(?=(\.[$\w]+))\1(?:[^.[(]|$)/;return e.version=st.version="v3.0.8",e}(),lt=function(e){e=e||{};var t={},n=Array.prototype.slice;return Object.defineProperties(e,{on:{value:function(n,r){return"function"==typeof r&&(t[n]=t[n]||[]).push(r),e},enumerable:!1,writable:!1,configurable:!1},off:{value:function(n,r){if("*"!=n||r)if(r)for(var i,o=t[n],a=0;i=o&&o[a];++a)i==r&&o.splice(a--,1);else delete t[n];else t={};return e},enumerable:!1,writable:!1,configurable:!1},one:{value:function(t,n){function r(){e.off(t,r),n.apply(e,arguments)}return e.on(t,r)},enumerable:!1,writable:!1,configurable:!1},trigger:{value:function(r){var i,o,a,s=arguments,u=arguments.length-1,l=new Array(u);for(a=0;a<u;a++)l[a]=s[a+1];for(i=n.call(t[r]||[],0),a=0;o=i[a];++a)o.apply(e,l);return t["*"]&&"*"!=r&&e.trigger.apply(e,["*",r].concat(l)),e},enumerable:!1,writable:!1,configurable:!1}}),e},ct=a(Object.create(st.settings),{skipAnonymousTags:!0,autoUpdate:!0}),ft={init:function(e,t,n){O(e,Ae),this.tag=t,this.expr=n,this.stub=_(),this.pristine=e;var r=e.parentNode;return r.insertBefore(this.stub,e),r.removeChild(e),this},update:function(){this.value=ut(this.expr,this.tag),this.value&&!this.current?(this.current=this.pristine.cloneNode(!0),this.stub.parentNode.insertBefore(this.current,this.stub),this.expressions=[],q.apply(this.tag,[this.current,this.expressions,!0])):!this.value&&this.current&&(fe(this.expressions),this.current._tag?this.current._tag.unmount():this.current.parentNode&&this.current.parentNode.removeChild(this.current),this.current=null,this.expressions=[]),this.value&&P.call(this.tag,this.expressions)},unmount:function(){fe(this.expressions||[])}},pt={init:function(e,t,n,r){return this.dom=e,this.attr=n,this.rawValue=r,this.parent=t,this.hasExp=ut.hasExpr(r),this},update:function(){var e=this.value,t=this.parent&&ce(this.parent),n=this.dom.__ref||this.tag||this.dom;this.value=this.hasExp?ut(this.rawValue,this.parent):this.rawValue,!p(e)&&t&&he(t.refs,e,n),!p(this.value)&&f(this.value)?(t&&de(t.refs,this.value,n,null,this.parent.__.index),this.value!==e&&j(this.dom,this.attr,this.value)):O(this.dom,this.attr),this.dom.__ref||(this.dom.__ref=n)},unmount:function(){var e=this.tag||this.dom,t=this.parent&&ce(this.parent);!p(this.value)&&t&&he(t.refs,this.value,e)}},dt=/<yield\b/i,ht=/<yield\s*(?:\/>|>([\S\s]*?)<\/yield\s*>|>)/gi,gt=/<yield\s+to=['"]([^'">]*)['"]\s*>([\S\s]*?)<\/yield\s*>/gi,mt=/<yield\s+from=['"]?([-\w]+)['"]?\s*(?:\/>|>([\S\s]*?)<\/yield\s*>)/gi,vt={tr:"tbody",th:"tr",td:"tr",col:"colgroup"},yt=Qe&&Qe<10?De:Ke,_t="div",xt="svg",bt={},wt=bt[Ce]={},Nt=0,Ot=Object.freeze({Tag:J,tag:X,tag2:Y,mount:ee,mixin:te,update:ne,unregister:re,version:"v3.7.3"}),Ct=Object.freeze({getTag:se,moveChildTag:ue,initChildTag:le,getImmediateCustomParentTag:ce,unmountAll:fe,getTagName:pe,arrayishAdd:de,arrayishRemove:he,mountTo:ge,makeReplaceVirtual:me,makeVirtual:ve,moveVirtual:ye,selectTags:_e}),Et=ct,jt={tmpl:ut,brackets:st,styleManager:ot,vdom:we,styleNode:ot.styleNode,dom:tt,check:et,misc:Ye,tags:Ct},Tt=J,At=X,Lt=Y,kt=ee,Mt=te,St=ne,It=re,Rt=lt,Pt=a({},Ot,{observable:lt,settings:Et,util:jt});e.settings=Et,e.util=jt,e.Tag=Tt,e.tag=At,e.tag2=Lt,e.mount=kt,e.mixin=Mt,e.update=St,e.unregister=It,e.version="v3.7.3",e.observable=Rt,e.default=Pt,Object.defineProperty(e,"__esModule",{value:!0})});