Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@evs-chris/raui

Package Overview
Dependencies
Maintainers
0
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evs-chris/raui - npm Package Compare versions

Comparing version 0.15.8 to 0.16.0

21

es/ace-editor.js

@@ -45,2 +45,9 @@ export default function makeAceEditor(opts) {

}
editor.commands.addCommand({
name: 'save',
bindKey: { win: 'Ctrl-S', mac: 'Command-S', sender: 'editor|cli' },
exec: function() {
ctx.raise('save');
}
});

@@ -55,11 +62,20 @@ handle.update = function(options) {

if (typeof options.highlightActive === 'boolean') { editor.setHighlightActiveLine(options.highlightActive); }
if (typeof options.highlightSelected === 'boolean') { editor.setHighlightSelectedWord(options.highlightSelected); }
if (options.font) { editor.setOptions({ fontFamily: options.font }); }
if (options.fontSize) { editor.setOptions({ fontSize: options.fontSize }); }
if ('printMargin' in options) { editor.setOption('showPrintMargin', options.printMargin); }
if (typeof options.lineNumbers === 'boolean') { editor.setOption('showLineNumbers', options.lineNumbers); }
if (typeof options.relativeLineNumbers === 'boolean') { editor.setOption('relativeLineNumbers', options.relativeLineNumbers); }
if ('keymode' in options) { editor.setKeyboardHandler(options.keymode); }
if ('keymode' in options && options.keymode) { editor.setKeyboardHandler(("ace/keyboard/" + (options.keymode))); }
else { editor.setKeyboardHandler(null) }
if (options.bind !== binding) {
if (observer) { observer.cancel(); }
var old = observer;
if (old) { observer.cancel(); }
if (options.bind) {
binding = options.bind;
observer = ctx.observe(binding, observed, { init: false });
if (old) { setTimeout(function() { observed(ctx.get(options.bind)); }); }
}

@@ -106,1 +122,2 @@ }

}

2

es/ace-editor.min.js

@@ -1,1 +0,1 @@

export default function makeAceEditor(opts){if(opts===void 0)opts={};var Ace=opts.ace;if(!Ace){Ace=window.ace}if(!Ace){throw new Error("Ace must be passed in or available globally.")}function aceEditor(node,options){if(options===void 0)options={};var handle={};var ctx=Ractive.getContext(node);var editor=handle.editor=Ace.edit(node);editor.$blockScrolling=Infinity;var session=editor.getSession();if(!node.classList.contains("ace-editor")){node.classList.add("ace-editor")}var binding;var observer;var lock=false;session.setUseSoftTabs(false);session.setTabSize(2);editor.on("change",function(){if(lock){return}lock=true;if(binding){ctx.set(binding,editor.getValue())}if(ctx.hasListener("change")){ctx.raise("change")}lock=false});function observed(value){if(lock){return}lock=true;var pos=editor.getCursorPosition();editor.setValue(value||"",-1);editor.clearSelection();editor.moveCursorTo(pos.row,pos.column,false);lock=false}handle.update=function(options){if(!options){return}if(options.syntax){editor.getSession().setMode("ace/mode/"+options.syntax)}if(options.theme){editor.setTheme("ace/theme/"+options.theme)}session.setTabSize(options.tabSize||2);if(typeof options.margin==="boolean"){editor.setShowPrintMargin(options.margin)}if(typeof options.wrap==="boolean"){session.setUseWrapMode(options.wrap)}if(typeof options.highlightActive==="boolean"){editor.setHighlightActiveLine(options.highlightActive)}if("keymode"in options){editor.setKeyboardHandler(options.keymode)}else{editor.setKeyboardHandler(null)}if(options.bind!==binding){if(observer){observer.cancel()}if(options.bind){binding=options.bind;observer=ctx.observe(binding,observed,{init:false})}}};handle.resize=function(){editor&&editor.resize()};handle.focus=function(){editor.focus()};var listener=ctx.get("@.root").on("*.resize",handle.resize);window.addEventListener("resize",handle.resize);handle.teardown=function(){editor.off("change");editor.destroy();listener.cancel();window.removeEventListener("resize",handle.resize);node.classList.remove("ace-editor")};handle.update(options);if(options.bind){setTimeout(function(){observed(ctx.get(options.bind))})}return handle}function plugin(ref){var instance=ref.instance;instance.decorators[opts.name||"ace-editor"]=aceEditor}plugin.plugin=plugin;plugin.aceEditor=aceEditor;return plugin}
export default function makeAceEditor(opts){if(opts===void 0)opts={};var Ace=opts.ace;if(!Ace){Ace=window.ace}if(!Ace){throw new Error("Ace must be passed in or available globally.")}function aceEditor(node,options){if(options===void 0)options={};var handle={};var ctx=Ractive.getContext(node);var editor=handle.editor=Ace.edit(node);editor.$blockScrolling=Infinity;var session=editor.getSession();if(!node.classList.contains("ace-editor")){node.classList.add("ace-editor")}var binding;var observer;var lock=false;session.setUseSoftTabs(false);session.setTabSize(2);editor.on("change",function(){if(lock){return}lock=true;if(binding){ctx.set(binding,editor.getValue())}if(ctx.hasListener("change")){ctx.raise("change")}lock=false});function observed(value){if(lock){return}lock=true;var pos=editor.getCursorPosition();editor.setValue(value||"",-1);editor.clearSelection();editor.moveCursorTo(pos.row,pos.column,false);lock=false}editor.commands.addCommand({name:"save",bindKey:{win:"Ctrl-S",mac:"Command-S",sender:"editor|cli"},exec:function(){ctx.raise("save")}});handle.update=function(options){if(!options){return}if(options.syntax){editor.getSession().setMode("ace/mode/"+options.syntax)}if(options.theme){editor.setTheme("ace/theme/"+options.theme)}session.setTabSize(options.tabSize||2);if(typeof options.margin==="boolean"){editor.setShowPrintMargin(options.margin)}if(typeof options.wrap==="boolean"){session.setUseWrapMode(options.wrap)}if(typeof options.highlightActive==="boolean"){editor.setHighlightActiveLine(options.highlightActive)}if(typeof options.highlightSelected==="boolean"){editor.setHighlightSelectedWord(options.highlightSelected)}if(options.font){editor.setOptions({fontFamily:options.font})}if(options.fontSize){editor.setOptions({fontSize:options.fontSize})}if("printMargin"in options){editor.setOption("showPrintMargin",options.printMargin)}if(typeof options.lineNumbers==="boolean"){editor.setOption("showLineNumbers",options.lineNumbers)}if(typeof options.relativeLineNumbers==="boolean"){editor.setOption("relativeLineNumbers",options.relativeLineNumbers)}if("keymode"in options&&options.keymode){editor.setKeyboardHandler("ace/keyboard/"+options.keymode)}else{editor.setKeyboardHandler(null)}if(options.bind!==binding){var old=observer;if(old){observer.cancel()}if(options.bind){binding=options.bind;observer=ctx.observe(binding,observed,{init:false});if(old){setTimeout(function(){observed(ctx.get(options.bind))})}}}};handle.resize=function(){editor&&editor.resize()};handle.focus=function(){editor.focus()};var listener=ctx.get("@.root").on("*.resize",handle.resize);window.addEventListener("resize",handle.resize);handle.teardown=function(){editor.off("change");editor.destroy();listener.cancel();window.removeEventListener("resize",handle.resize);node.classList.remove("ace-editor")};handle.update(options);if(options.bind){setTimeout(function(){observed(ctx.get(options.bind))})}return handle}function plugin(ref){var instance=ref.instance;instance.decorators[opts.name||"ace-editor"]=aceEditor}plugin.plugin=plugin;plugin.aceEditor=aceEditor;return plugin}

@@ -259,2 +259,12 @@ import Ractive from 'ractive';

justPopped = true;
var pop = h.get('rac.pop');
if (v && pop) {
setTimeout(function () {
var root = pop.find('div');
if (root && !root._completeevent) {
root.addEventListener('mousedown', keepFocus);
root._completeevent = 'added';
}
}, 300);
}
}) ];

@@ -270,2 +280,9 @@

function keepFocus(ev) {
var input = h.find('input');
if (input) { input.focus(); }
ev.preventDefault();
return false;
}
function teardown() {

@@ -272,0 +289,0 @@ h.unlink('rac.items');

@@ -1,1 +0,1 @@

import Ractive from"ractive";import{Popover}from"./Popover";import{autofocus}from"./form";var template={v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rautocomplete field-wrapper",g:1},{n:["pop"],t:70,f:{r:["@context","$1"],s:'[(_0).set("rac.pop",_1)]'}}],f:[{t:7,e:"input",m:[{t:8,r:"extra-attributes"},{n:["dblclick"],t:70,f:{r:["rac.pop","@node"],s:"[_0.show(_1)]"}},{n:["focus"],t:70,f:{r:["rac"],s:"[_0.stash()]"}},{n:["blur"],t:70,f:{r:["rac","@node"],s:"[_0.checkBlur(_1)]"}},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-drop",g:1},{n:["click"],t:70,f:{r:["rac.pop","@context"],s:'[_0.show((_1).find("input"))]'}}]}," ",{t:7,e:"rac-pop",m:[{t:13,n:"style",f:"padding: 0;",g:1},{t:13,n:"class",f:"rac-pop",g:1},{n:["init"],t:70,f:{r:["@context","$1"],s:'[(_0).raise("pop",{},_1)]'}},{n:"popped",t:13,f:[{t:2,r:"rac.popped"}]},{n:"where",f:"below",t:13,g:1},{n:"align",f:"end",t:13,g:1},{n:"gap",f:[{t:2,x:{r:[],s:"2"},s:1}],t:13},{n:"offsets",t:13,f:[{t:2,r:"rac.offsets"}]},{n:"fit",t:13,f:[{t:2,r:"rac.fit"}]}],f:[{t:4,f:[{t:7,e:"input",m:[{n:"class-rac-modal",t:13},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13},{n:["blur"],t:70,f:{r:["rac"],s:"[_0.checkBlur()]"}},{n:"autocompletefocus",t:71}]}],n:50,r:"inModal"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-list",g:1},{n:"tabindex",f:"-1",t:13,g:1}],f:[{t:55,f:[{f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Loading..."]}],t:4},{t:62,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item",g:1},{n:"tabindex",f:"-1",t:13,g:1},{t:4,f:[{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]}],n:50,r:"rac.valueBound"},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{t:4,f:[{n:["click"],t:70,f:{r:["@context",".","rac"],s:'[(_0).set("rac.value",_1),_2._drawDisplay()]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],n:50,r:"rac.popped"}],f:[{t:2,x:{r:["rac","."],s:"_0._display(_1)"}}]}],n:52,r:"items"}," "],n:"items"},{t:63,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Load failed."]}]}],r:"rac.list"}]}]}]}],e:{2:function(){return 2},'[(_0).set("rac.pop",_1)]':function(_0,_1){return[_0.set("rac.pop",_1)]},"[_0.show(_1)]":function(_0,_1){return[_0.show(_1)]},"[_0.stash()]":function(_0){return[_0.stash()]},"[_0.checkBlur(_1)]":function(_0,_1){return[_0.checkBlur(_1)]},"[_0.input(_1)]":function(_0,_1){return[_0.input(_1)]},"[_0.key(_1)]":function(_0,_1){return[_0.key(_1)]},'[_0.show((_1).find("input"))]':function(_0,_1){return[_0.show(_1.find("input"))]},'[(_0).raise("pop",{},_1)]':function(_0,_1){return[_0.raise("pop",{},_1)]},"[_0.checkBlur()]":function(_0){return[_0.checkBlur()]},"_0===_1":function(_0,_1){return _0===_1},'[(_0).set("rac.value",_1),_2._drawDisplay()]':function(_0,_1,_2){return[_0.set("rac.value",_1),_2._drawDisplay()]},'[(_0).set("rac.selected",_1)]':function(_0,_1){return[_0.set("rac.selected",_1)]},"_0._display(_1)":function(_0,_1){return _0._display(_1)}}};function safeGet(obj,path){return path.reduce(function(a,c){return a?a[c]:a},obj)}var formNodes=["INPUT","SELECT","TEXTAREA","BUTTON","BODY"];export var Autocomplete=Ractive.macro(function(h){var tm;var root;h.aliasLocal("rac");h.set("rac.list",[]);h.set("rac.popped",false);h.set("rac.stash",function(){h.set("rac.tempDisplay",h.get("rac.display"));h.set("rac.tempValue",h.get("rac.value"))});h.set("rac.key",function(e){var k=e.which;if(k===27){h.set("rac.popped",false);h.set("rac.display",h.get("rac.tempDisplay"));h.set("rac.value",h.get("rac.tempValue"))}else if(k===38||k===40){e.preventDefault();h.get("rac.pop").show(h.find("input"));var i=h.get("rac.selected");var list=h.get("rac.list");if(k===38){if(i<=0||i==null){h.set("rac.selected",Array.isArray(list)?list.length-1:0)}else{h.set("rac.selected",i-1)}}else{if(Array.isArray(list)){h.set("rac.selected",i<list.length-1?i+1:0)}else{h.set("rac.selected",0)}}}else if(k===10||k===13){var list$1=h.get("rac.list");if(Array.isArray(list$1)){h.set("rac.value",list$1[h.get("rac.selected")]);display()}}else if(k===9){if(h.get("rac.popped")){var list$2=h.get("rac.list");if(Array.isArray(list$2)){var v=list$2[h.get("rac.selected")];if(v==null){v=getval(v,true)}h.set("rac.value",v)}if(!h.get("rac.limit")){setTimeout(function(){return display()},140)}}else if(h.get("rac.value")==null||!~h.get("rac.selected")||h.get("rac.display")!=h.get("rac.tempDisplay")){h.set("rac.value",getval(null,true))}h.set("rac.popped",false);h.get("rac.updateDisplay")()}});h.set("rac.input",function(e){if(tm){clearTimeout(tm)}tm=setTimeout(function(){tm=null;list(e.target.value);var el=h.find("input");if(el&&document.activeElement===el){h.get("rac.pop").show(el)}},500);if(!h.attributes.lazy){h.set("rac.display",e.target.value)}});h.setTemplate(template);function list(filter){if(filter==null){filter=h.get("rac.value")==null?"":h.get("rac.display")}if(filter===h.get("rac.tempDisplay")){filter=""}var items=h.get("rac._items");if(typeof items==="function"){var res=items(filter);if(typeof res==="object"&&typeof res.then==="function"){res.then(function(v){return h.set("rac.list",v)})}else{h.set("rac.list",res)}}else if(Array.isArray(items)){var member=h.get("rac._display");var re;try{re=new RegExp(filter||"","i")}catch(e){re=new RegExp((filter||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}h.set("rac.list",items.filter(function(i){return re.test(member(i))}))}else{h.set("rac.list",[])}}function getval(v,nofetch){var def=h.get("rac.default");v=v==null&&!nofetch?h.get("rac.value"):v;if(v==null&&def){if(typeof def==="function"){v=def(h.get("rac.display"))}else{v=def}}return v}function refresh(value,old,path){var v=h.get("rac.displayprop");if(h.get("rac.__display")!==v||h.get("rac._display")===undefined){var def=function(){return h.attributes["display-value"]?h.get("rac.display"):"(none)"};if(typeof v==="string"){var path$1=Ractive.splitKeypath(v);v=function(v){if(v==null){v=getval()}return v==null?def():safeGet(v,path$1)}}else if(Array.isArray(v)){var path$2=v;v=function(v){if(v==null){v=getval()}return v==null?def():safeGet(v,path$2)}}else if(!v){v=function(v){if(v==null){v=getval()}return v==null?def():""+v}}h.set("rac._display",v);h.set("rac.__display",h.get("rac.displayprop"));h.set("rac.display",v(h.get("rac.value")))}v=h.get("rac.member");if(h.get("rac.__member")!==v||h.get("rac._member")===undefined){if(typeof v==="string"){var path$3=Ractive.splitKeypath(v);v=function(v){return safeGet(getval(v),path$3)}}else if(Array.isArray(v)){var path$4=v;v=function(v){return safeGet(getval(v),path$4)}}else if(!v){v=function(v){return getval(v)}}h.set("rac._member",v);h.set("rac.__member",h.get("rac.member"))}v=h.get("rac.items");if(h.get("rac.__items")!==v||h.get("rac._items")===undefined){if(Array.isArray(v)){h.set("rac._items",v)}else if(typeof v==="function"){h.set("rac._items",v)}else if(typeof v==="object"&&typeof v.then==="function"){v.then(function(v){h.set("rac._items",v);list()})}else{h.set("rac._items",[])}h.set("rac.__items",h.get("rac.items"))}if(root&&path==="rac.display"&&h.get("rac.limit")&&!root.contains(document.activeElement)){display()}list()}function display(){var member=h.get("rac._display");if(typeof member==="function"){var disp=member(h.get("rac.value"));h.set("rac.display",disp);h.set("rac.tempDisplay",disp)}}h.set("rac._drawDisplay",display);function value(){if(h.get("rac._value")&&!h.get("rac.value")){return}var member=h.get("rac._member");if(typeof member==="function"){var v=member(h.get("rac.value"));h.set("rac._value",v)}h.ractive.getContext(h.find("input")).raise("selected",{},h.get("rac._value"),h.get("rac.display"))}h.set("rac.updateDisplay",function(ev){setTimeout(function(){if(root&&h.get("rac.limit")&&!root.contains(document.activeElement)){display()}},140)});function update(attrs){if(attrs.items){h.link(attrs.items,"rac.items")}if(attrs.value){h.link(attrs.value,"rac._value")}h.set("rac.valueBound",!!attrs.value);if(attrs.selected){h.link(attrs.selected,"rac.selected")}if(attrs["display-value"]){h.link(attrs["display-value"],"rac.display")}if("display"in attrs){h.set("rac.displayprop",attrs.display)}if("member"in attrs){h.set("rac.member",attrs.member)}if("offsets"in attrs){h.set("rac.offsets",attrs.offsets);h.set("rac.fit","fit"in attrs?attrs.fit:true)}else{h.set("rac.fit","fit"in attrs?attrs.fit:false)}h.set("rac.limit",attrs["limit-set"]);h.set("rac.default",attrs.default);if(h.get("rac.limit")&&h.get("input")){var el=h.get("input");if(el!==document.activeElement){display()}}refresh()}update(h.attributes);var tmScroll;function scrollView(){if(tmScroll){clearTimeout(tm)}tmScroll=setTimeout(function(){tmScroll=null;var el=h.find(".rac-hover");if(el){el.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}},14)}var justPopped=false;var opts={init:false,defer:true};var watches=[h.observe("rac.displayprop",refresh,opts),h.observe("rac.memberprop",refresh,opts),h.observe("rac.items",refresh,opts),h.observe("rac.list",function(v){if(Array.isArray(v)){h.set("rac.selected",v.indexOf(h.get("rac.value")))}else{h.set("rac.selected",-1)}},opts),h.observe("rac.value",function(v){display();value();h.set("rac.popped",false);h.set("rac.tempValue",v)}),h.observe("rac._value",function(v){var member=h.get("rac._member");var which=h.get("rac.list").find(function(i){return member(i)===v});if(which!==h.get("rac.value")){h.set("rac.value",which)}if(!which&&v!=null&&h.get("rac.valueBound")){h.set("rac.display",v);refresh()}}),h.observe("rac.selected",scrollView),h.observe("rac.popped",function(v){if(v){setTimeout(function(){return justPopped=false},300)}justPopped=true})];h.set("rac.checkBlur",function checkBlur(node){if(justPopped){return false}var active=document.activeElement;if(!~formNodes.indexOf(active.nodeName)&&!active.getAttribute("tabindex")){return}var inputs=h.findAll("input").concat(h.get("rac.pop").popFindAll("input"));if(document.activeElement&&!~inputs.indexOf(document.activeElement)){h.get("rac.key")({which:9})}});function teardown(){h.unlink("rac.items");h.unlink("rac._value");h.unlink("rac.selected");h.unlink("rac.display");watches.forEach(function(w){return w.cancel()})}return{teardown:teardown,update:update,render:function render(){root=h.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","fit","offsets","display-value","default"],css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.autocomplete"),data("raui.autocomplete.primary"));var drop=Object.assign({},data("raui.autocomplete.drop"),data("raui.autocomplete.primary.drop"));var boxy=data("raui.form.boxy");return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-drop {\n width: 2em;\n height: 100%;\n position: absolute;\n top: 0;\n right: 2px;\n cursor: pointer;\n }\n .rac-drop:after {\n font-family: "+(drop.font||"sans-serif")+";\n content: "+(drop.string||"'▾'")+";\n position: absolute;\n top: calc(50% - 0.5em);\n height: 1em;\n line-height: 1em;\n width: 100%;\n text-align: center;\n font-weight: "+(drop.weight||"normal")+";\n color: "+(drop.color||primary.bc||"#ccc")+";\n }\n \n .rac-pop {\n min-width: 100%;\n }\n \n .rac-pop > .rpop {\n padding: 0;\n }\n \n .rac-list {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 2.125em;\n max-width: 100%;\n overflow: auto;\n }\n \n .rac-item {\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n padding: 0.25em;\n cursor: pointer;\n }\n \n .rac-selected {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }\n \n .rac-hover {\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bc||"#ccc")+";\n }\n \n .rac-selected.rac-hover {\n background-color: "+(primary.bc||"#ccc")+";\n color: "+(primary.fga||"#07e")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\n display: block;\n border-width: "+(boxy?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }"}.call(this,data)].join(" ")},cssId:"rautocomplete",noCssTransform:true});export function FieldType(opts){if(opts===void 0)opts={};return function(attrs,content,handle){return[{t:7,e:opts.name||"autocomplete",m:attrs,f:content}]}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.partials[opts.name||"autocomplete"]=Autocomplete;instance.components["rac-pop"]=Popover;instance.decorators["autocompletefocus"]=autofocus}}export default plugin;
import Ractive from"ractive";import{Popover}from"./Popover";import{autofocus}from"./form";var template={v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rautocomplete field-wrapper",g:1},{n:["pop"],t:70,f:{r:["@context","$1"],s:'[(_0).set("rac.pop",_1)]'}}],f:[{t:7,e:"input",m:[{t:8,r:"extra-attributes"},{n:["dblclick"],t:70,f:{r:["rac.pop","@node"],s:"[_0.show(_1)]"}},{n:["focus"],t:70,f:{r:["rac"],s:"[_0.stash()]"}},{n:["blur"],t:70,f:{r:["rac","@node"],s:"[_0.checkBlur(_1)]"}},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-drop",g:1},{n:["click"],t:70,f:{r:["rac.pop","@context"],s:'[_0.show((_1).find("input"))]'}}]}," ",{t:7,e:"rac-pop",m:[{t:13,n:"style",f:"padding: 0;",g:1},{t:13,n:"class",f:"rac-pop",g:1},{n:["init"],t:70,f:{r:["@context","$1"],s:'[(_0).raise("pop",{},_1)]'}},{n:"popped",t:13,f:[{t:2,r:"rac.popped"}]},{n:"where",f:"below",t:13,g:1},{n:"align",f:"end",t:13,g:1},{n:"gap",f:[{t:2,x:{r:[],s:"2"},s:1}],t:13},{n:"offsets",t:13,f:[{t:2,r:"rac.offsets"}]},{n:"fit",t:13,f:[{t:2,r:"rac.fit"}]}],f:[{t:4,f:[{t:7,e:"input",m:[{n:"class-rac-modal",t:13},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13},{n:["blur"],t:70,f:{r:["rac"],s:"[_0.checkBlur()]"}},{n:"autocompletefocus",t:71}]}],n:50,r:"inModal"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-list",g:1},{n:"tabindex",f:"-1",t:13,g:1}],f:[{t:55,f:[{f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Loading..."]}],t:4},{t:62,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item",g:1},{n:"tabindex",f:"-1",t:13,g:1},{t:4,f:[{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]}],n:50,r:"rac.valueBound"},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{t:4,f:[{n:["click"],t:70,f:{r:["@context",".","rac"],s:'[(_0).set("rac.value",_1),_2._drawDisplay()]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],n:50,r:"rac.popped"}],f:[{t:2,x:{r:["rac","."],s:"_0._display(_1)"}}]}],n:52,r:"items"}," "],n:"items"},{t:63,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Load failed."]}]}],r:"rac.list"}]}]}]}],e:{2:function(){return 2},'[(_0).set("rac.pop",_1)]':function(_0,_1){return[_0.set("rac.pop",_1)]},"[_0.show(_1)]":function(_0,_1){return[_0.show(_1)]},"[_0.stash()]":function(_0){return[_0.stash()]},"[_0.checkBlur(_1)]":function(_0,_1){return[_0.checkBlur(_1)]},"[_0.input(_1)]":function(_0,_1){return[_0.input(_1)]},"[_0.key(_1)]":function(_0,_1){return[_0.key(_1)]},'[_0.show((_1).find("input"))]':function(_0,_1){return[_0.show(_1.find("input"))]},'[(_0).raise("pop",{},_1)]':function(_0,_1){return[_0.raise("pop",{},_1)]},"[_0.checkBlur()]":function(_0){return[_0.checkBlur()]},"_0===_1":function(_0,_1){return _0===_1},'[(_0).set("rac.value",_1),_2._drawDisplay()]':function(_0,_1,_2){return[_0.set("rac.value",_1),_2._drawDisplay()]},'[(_0).set("rac.selected",_1)]':function(_0,_1){return[_0.set("rac.selected",_1)]},"_0._display(_1)":function(_0,_1){return _0._display(_1)}}};function safeGet(obj,path){return path.reduce(function(a,c){return a?a[c]:a},obj)}var formNodes=["INPUT","SELECT","TEXTAREA","BUTTON","BODY"];export var Autocomplete=Ractive.macro(function(h){var tm;var root;h.aliasLocal("rac");h.set("rac.list",[]);h.set("rac.popped",false);h.set("rac.stash",function(){h.set("rac.tempDisplay",h.get("rac.display"));h.set("rac.tempValue",h.get("rac.value"))});h.set("rac.key",function(e){var k=e.which;if(k===27){h.set("rac.popped",false);h.set("rac.display",h.get("rac.tempDisplay"));h.set("rac.value",h.get("rac.tempValue"))}else if(k===38||k===40){e.preventDefault();h.get("rac.pop").show(h.find("input"));var i=h.get("rac.selected");var list=h.get("rac.list");if(k===38){if(i<=0||i==null){h.set("rac.selected",Array.isArray(list)?list.length-1:0)}else{h.set("rac.selected",i-1)}}else{if(Array.isArray(list)){h.set("rac.selected",i<list.length-1?i+1:0)}else{h.set("rac.selected",0)}}}else if(k===10||k===13){var list$1=h.get("rac.list");if(Array.isArray(list$1)){h.set("rac.value",list$1[h.get("rac.selected")]);display()}}else if(k===9){if(h.get("rac.popped")){var list$2=h.get("rac.list");if(Array.isArray(list$2)){var v=list$2[h.get("rac.selected")];if(v==null){v=getval(v,true)}h.set("rac.value",v)}if(!h.get("rac.limit")){setTimeout(function(){return display()},140)}}else if(h.get("rac.value")==null||!~h.get("rac.selected")||h.get("rac.display")!=h.get("rac.tempDisplay")){h.set("rac.value",getval(null,true))}h.set("rac.popped",false);h.get("rac.updateDisplay")()}});h.set("rac.input",function(e){if(tm){clearTimeout(tm)}tm=setTimeout(function(){tm=null;list(e.target.value);var el=h.find("input");if(el&&document.activeElement===el){h.get("rac.pop").show(el)}},500);if(!h.attributes.lazy){h.set("rac.display",e.target.value)}});h.setTemplate(template);function list(filter){if(filter==null){filter=h.get("rac.value")==null?"":h.get("rac.display")}if(filter===h.get("rac.tempDisplay")){filter=""}var items=h.get("rac._items");if(typeof items==="function"){var res=items(filter);if(typeof res==="object"&&typeof res.then==="function"){res.then(function(v){return h.set("rac.list",v)})}else{h.set("rac.list",res)}}else if(Array.isArray(items)){var member=h.get("rac._display");var re;try{re=new RegExp(filter||"","i")}catch(e){re=new RegExp((filter||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}h.set("rac.list",items.filter(function(i){return re.test(member(i))}))}else{h.set("rac.list",[])}}function getval(v,nofetch){var def=h.get("rac.default");v=v==null&&!nofetch?h.get("rac.value"):v;if(v==null&&def){if(typeof def==="function"){v=def(h.get("rac.display"))}else{v=def}}return v}function refresh(value,old,path){var v=h.get("rac.displayprop");if(h.get("rac.__display")!==v||h.get("rac._display")===undefined){var def=function(){return h.attributes["display-value"]?h.get("rac.display"):"(none)"};if(typeof v==="string"){var path$1=Ractive.splitKeypath(v);v=function(v){if(v==null){v=getval()}return v==null?def():safeGet(v,path$1)}}else if(Array.isArray(v)){var path$2=v;v=function(v){if(v==null){v=getval()}return v==null?def():safeGet(v,path$2)}}else if(!v){v=function(v){if(v==null){v=getval()}return v==null?def():""+v}}h.set("rac._display",v);h.set("rac.__display",h.get("rac.displayprop"));h.set("rac.display",v(h.get("rac.value")))}v=h.get("rac.member");if(h.get("rac.__member")!==v||h.get("rac._member")===undefined){if(typeof v==="string"){var path$3=Ractive.splitKeypath(v);v=function(v){return safeGet(getval(v),path$3)}}else if(Array.isArray(v)){var path$4=v;v=function(v){return safeGet(getval(v),path$4)}}else if(!v){v=function(v){return getval(v)}}h.set("rac._member",v);h.set("rac.__member",h.get("rac.member"))}v=h.get("rac.items");if(h.get("rac.__items")!==v||h.get("rac._items")===undefined){if(Array.isArray(v)){h.set("rac._items",v)}else if(typeof v==="function"){h.set("rac._items",v)}else if(typeof v==="object"&&typeof v.then==="function"){v.then(function(v){h.set("rac._items",v);list()})}else{h.set("rac._items",[])}h.set("rac.__items",h.get("rac.items"))}if(root&&path==="rac.display"&&h.get("rac.limit")&&!root.contains(document.activeElement)){display()}list()}function display(){var member=h.get("rac._display");if(typeof member==="function"){var disp=member(h.get("rac.value"));h.set("rac.display",disp);h.set("rac.tempDisplay",disp)}}h.set("rac._drawDisplay",display);function value(){if(h.get("rac._value")&&!h.get("rac.value")){return}var member=h.get("rac._member");if(typeof member==="function"){var v=member(h.get("rac.value"));h.set("rac._value",v)}h.ractive.getContext(h.find("input")).raise("selected",{},h.get("rac._value"),h.get("rac.display"))}h.set("rac.updateDisplay",function(ev){setTimeout(function(){if(root&&h.get("rac.limit")&&!root.contains(document.activeElement)){display()}},140)});function update(attrs){if(attrs.items){h.link(attrs.items,"rac.items")}if(attrs.value){h.link(attrs.value,"rac._value")}h.set("rac.valueBound",!!attrs.value);if(attrs.selected){h.link(attrs.selected,"rac.selected")}if(attrs["display-value"]){h.link(attrs["display-value"],"rac.display")}if("display"in attrs){h.set("rac.displayprop",attrs.display)}if("member"in attrs){h.set("rac.member",attrs.member)}if("offsets"in attrs){h.set("rac.offsets",attrs.offsets);h.set("rac.fit","fit"in attrs?attrs.fit:true)}else{h.set("rac.fit","fit"in attrs?attrs.fit:false)}h.set("rac.limit",attrs["limit-set"]);h.set("rac.default",attrs.default);if(h.get("rac.limit")&&h.get("input")){var el=h.get("input");if(el!==document.activeElement){display()}}refresh()}update(h.attributes);var tmScroll;function scrollView(){if(tmScroll){clearTimeout(tm)}tmScroll=setTimeout(function(){tmScroll=null;var el=h.find(".rac-hover");if(el){el.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}},14)}var justPopped=false;var opts={init:false,defer:true};var watches=[h.observe("rac.displayprop",refresh,opts),h.observe("rac.memberprop",refresh,opts),h.observe("rac.items",refresh,opts),h.observe("rac.list",function(v){if(Array.isArray(v)){h.set("rac.selected",v.indexOf(h.get("rac.value")))}else{h.set("rac.selected",-1)}},opts),h.observe("rac.value",function(v){display();value();h.set("rac.popped",false);h.set("rac.tempValue",v)}),h.observe("rac._value",function(v){var member=h.get("rac._member");var which=h.get("rac.list").find(function(i){return member(i)===v});if(which!==h.get("rac.value")){h.set("rac.value",which)}if(!which&&v!=null&&h.get("rac.valueBound")){h.set("rac.display",v);refresh()}}),h.observe("rac.selected",scrollView),h.observe("rac.popped",function(v){if(v){setTimeout(function(){return justPopped=false},300)}justPopped=true;var pop=h.get("rac.pop");if(v&&pop){setTimeout(function(){var root=pop.find("div");if(root&&!root._completeevent){root.addEventListener("mousedown",keepFocus);root._completeevent="added"}},300)}})];h.set("rac.checkBlur",function checkBlur(node){if(justPopped){return false}var active=document.activeElement;if(!~formNodes.indexOf(active.nodeName)&&!active.getAttribute("tabindex")){return}var inputs=h.findAll("input").concat(h.get("rac.pop").popFindAll("input"));if(document.activeElement&&!~inputs.indexOf(document.activeElement)){h.get("rac.key")({which:9})}});function keepFocus(ev){var input=h.find("input");if(input){input.focus()}ev.preventDefault();return false}function teardown(){h.unlink("rac.items");h.unlink("rac._value");h.unlink("rac.selected");h.unlink("rac.display");watches.forEach(function(w){return w.cancel()})}return{teardown:teardown,update:update,render:function render(){root=h.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","fit","offsets","display-value","default"],css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.autocomplete"),data("raui.autocomplete.primary"));var drop=Object.assign({},data("raui.autocomplete.drop"),data("raui.autocomplete.primary.drop"));var boxy=data("raui.form.boxy");return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-drop {\n width: 2em;\n height: 100%;\n position: absolute;\n top: 0;\n right: 2px;\n cursor: pointer;\n }\n .rac-drop:after {\n font-family: "+(drop.font||"sans-serif")+";\n content: "+(drop.string||"'▾'")+";\n position: absolute;\n top: calc(50% - 0.5em);\n height: 1em;\n line-height: 1em;\n width: 100%;\n text-align: center;\n font-weight: "+(drop.weight||"normal")+";\n color: "+(drop.color||primary.bc||"#ccc")+";\n }\n \n .rac-pop {\n min-width: 100%;\n }\n \n .rac-pop > .rpop {\n padding: 0;\n }\n \n .rac-list {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 2.125em;\n max-width: 100%;\n overflow: auto;\n }\n \n .rac-item {\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n padding: 0.25em;\n cursor: pointer;\n }\n \n .rac-selected {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }\n \n .rac-hover {\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bc||"#ccc")+";\n }\n \n .rac-selected.rac-hover {\n background-color: "+(primary.bc||"#ccc")+";\n color: "+(primary.fga||"#07e")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\n display: block;\n border-width: "+(boxy?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }"}.call(this,data)].join(" ")},cssId:"rautocomplete",noCssTransform:true});export function FieldType(opts){if(opts===void 0)opts={};return function(attrs,content,handle){return[{t:7,e:opts.name||"autocomplete",m:attrs,f:content}]}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.partials[opts.name||"autocomplete"]=Autocomplete;instance.components["rac-pop"]=Popover;instance.decorators["autocompletefocus"]=autofocus}}export default plugin;

@@ -71,3 +71,3 @@ import globalRegister from './globalRegister';

template: {v:4,t:[{t:7,e:"div",m:[{n:"class",f:["rg-graph rg-graph-",{t:2,r:".type"}],t:13},{t:4,f:[{n:"class-rg-graph-h",t:13,f:[{t:2,r:"graph.horiz"}]},{n:"class-rg-graph-v",t:13,f:[{t:2,x:{r:["graph.horiz"],s:"!_0"}}]}],n:50,x:{r:[".type"],s:"_0===\"bar\""}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-circular",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-middle",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-content",g:1}],f:[{t:16,z:[{n:"selected",x:{r:"~/selected"}},{n:"hovered",x:{r:"~/hovered"}}]}]}]}],n:50,x:{r:[".type","@this.partials.content"],s:"(_0===\"donut\"||_0===\"tire\"||_0===\"hoop\")&&_1"}}," ",{t:7,e:"svg",m:[{n:"width",f:"100%",t:13,g:1},{n:"height",f:"100%",t:13,g:1},{n:"viewBox",f:"-55 -55 110 110",t:13,g:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:[{t:2,r:".d"}],t:13},{n:"class",f:["rg-chonk rg-chonk-",{t:2,r:"@index"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:"[[\"select\",_0,_1,_2]]"}},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:"[[\"hover\",_0,_1,_2]]"}}],f:[{t:4,f:[{t:7,e:"title",f:[{t:2,r:".label"}," ",{t:4,f:["(",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:"\"\\n\"+_0"}}],n:50,r:".sublabel"}]}],n:50,r:".label"}]}],n:52,r:"chonks"}]}]}],n:50,x:{r:[".type"],s:"_0===\"pie\"||_0===\"donut\"||_0===\"tire\"||_0===\"hoop\""}},{t:4,f:[{t:7,e:"svg",m:[{n:"viewBox",f:["0 0 ",{t:2,x:{r:["graph.horiz","~/span","graph.span"],s:"_0?_1:_2"}}," ",{t:2,x:{r:["graph.horiz","graph.span","~/span"],s:"_0?_1:_2"}}],t:13},{t:4,f:[{n:"style-min-height",f:[{t:2,r:"graph.span"},"px"],t:13}],n:50,r:"graph.horiz"},{t:4,f:[{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".y"},",",{t:2,r:".x"}," ",{t:2,r:".y"},",",{t:2,r:".x2"},", ",{t:2,r:".y2"},",",{t:2,r:".x2"}," ",{t:2,r:".y2"},",",{t:2,r:".x"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:"[[\"select\",_0,_1,_2]]"}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:"[[\"hover\",_0,_1,_2]]"}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:"\"\\n\"+_0"}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,i:"idx",r:".points"}],n:52,i:"grp",r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:"graph.bottom"},",0 ",{t:2,r:"graph.bottom"},",",{t:2,r:"graph.span"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:50,r:"graph.horiz"},{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".x"},",",{t:2,r:".y"}," ",{t:2,r:".x"},",",{t:2,r:".y2"},", ",{t:2,r:".x2"},",",{t:2,r:".y2"}," ",{t:2,r:".x2"},",",{t:2,r:".y"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:"[[\"select\",_0,_1,_2]]"}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:"[[\"hover\",_0,_1,_2]]"}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:"\"\\n\"+_0"}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:51,l:1}]}," "],n:50,x:{r:[".type"],s:"_0===\"bar\""},l:1},{t:4,f:[" ",{t:7,e:"svg",m:[{n:"viewBox",f:[{t:2,x:{r:["~/dot"],s:"-_0"}}," ",{t:2,x:{r:["~/span","graph.maxY","~/dot"],s:"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))"}}," ",{t:2,x:{r:["graph.span","~/dot"],s:"_0+(2*_1)"}}," ",{t:2,x:{r:["~/span","graph.maxY","graph.minY","~/dot"],s:"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))"}}],t:13},{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}," ",{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,x:{r:["graph.minX","~/dot"],s:"_0+_1"}},",",{t:2,r:"graph.bottom"}," ",{t:4,f:[{t:4,f:[{t:4,f:["S ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:50,r:"~/project"},{t:4,f:["C ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".ex"},",",{t:2,r:".ey"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1}],n:50,x:{r:["."],s:"\"sx\" in _0"}},{t:4,f:["L ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1},{t:2,x:{r:[],s:"\" \""}}],n:52,r:".points"}," L ",{t:2,r:"~/graph.maxX"},",",{t:2,r:"~/graph.bottom"}," Z"],t:13},{n:"fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:"opacity",f:"0.6",t:13}],n:50,x:{r:["~/graph.groups.length"],s:"_0>1"}},{t:4,f:[{n:"opacity",f:"0.8",t:13}],n:51,l:1},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:52,r:"graph.groups"}," ",{t:4,f:[{t:4,f:[{t:7,e:"circle",m:[{n:"r",f:[{t:2,r:"~/dot"}],t:13},{n:"cx",f:[{t:2,r:".x"}],t:13},{n:"cy",f:[{t:2,r:".y2"}],t:13},{n:"fill",f:[{t:4,f:[{t:2,r:".color"}],n:50,x:{r:["~/graph.groups.length"],s:"_0===1"}},{t:4,f:[{t:2,r:"^^/color"}],n:51,l:1}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:"[[\"select\",_0,_1,_2]]"}},{n:"stroke-width",f:"1",t:13,g:1},{n:"stroke",f:"#000",t:13,g:1},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:"[[\"hover\",_0,_1,_2]]"}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:"\"\\n\"+_0"}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}]}],n:50,x:{r:[".type"],s:"_0===\"line\""},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend",g:1}],f:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"chonks"}],n:50,x:{r:[".type"],s:"_0!==\"bar\"&&_0!==\"line\""}},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups.0.points"}," "],n:50,x:{r:[".type","graph.groups.length"],s:"_0===\"line\"&&_1===1"},l:1},{t:4,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups"}],n:51,l:1}]}],n:50,r:"~/legend"}]}],e:{"!_0":function (_0){return(!_0);},"_0===\"bar\"":function (_0){return(_0==="bar");},"(_0===\"donut\"||_0===\"tire\"||_0===\"hoop\")&&_1":function (_0,_1){return((_0==="donut"||_0==="tire"||_0==="hoop")&&_1);},"[_0.click((_1),_2,_3,_4)]":function (_0,_1,_2,_3,_4){return([_0.click((_1),_2,_3,_4)]);},"[[\"select\",_0,_1,_2]]":function (_0,_1,_2){return([["select",_0,_1,_2]]);},"[[\"hover\",_0,_1,_2]]":function (_0,_1,_2){return([["hover",_0,_1,_2]]);},"\"\\n\"+_0":function (_0){return("\n"+_0);},"_0===\"pie\"||_0===\"donut\"||_0===\"tire\"||_0===\"hoop\"":function (_0){return(_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop");},"_0?_1:_2":function (_0,_1,_2){return(_0?_1:_2);},"-_0":function (_0){return(-_0);},"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))":function (_0,_1,_2){return(Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2)));},"_0+(2*_1)":function (_0,_1){return(_0+(2*_1));},"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))":function (_0,_1,_2,_3){return(Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3)));},"_0+_1":function (_0,_1){return(_0+_1);},"\"sx\" in _0":function (_0){return("sx" in _0);},"\" \"":function (){return(" ");},"_0>1":function (_0){return(_0>1);},"_0===1":function (_0){return(_0===1);},"_0===\"line\"":function (_0){return(_0==="line");},"_0!==\"bar\"&&_0!==\"line\"":function (_0){return(_0!=="bar"&&_0!=="line");},"_0===\"line\"&&_1===1":function (_0,_1){return(_0==="line"&&_1===1);}}},
css: " .rg-graph { position: relative; display: flex; flex-direction: row; width: 100%; height: 100%; box-sizing: border-box; } .rg-graph-circular { position: relative; width: 100%; height: 0; padding-bottom: 100%; } .rg-graph-circular svg { position: absolute; left: 0; top: 0; } .rg-graph svg { box-sizing: border-box; margin-left: auto; margin-right: auto; } .rg-graph-pie .rg-chonk, .rg-graph-donut .rg-chonk, .rg-graph-tire .rg-chonk { transition: transform 0.3s ease, opacity 0.3s ease; } .rg-chonk { opacity: 0.8; user-select: none; } .rg-chonk.clicky { cursor: pointer; } .rg-graph-pie .rg-chonk:hover, .rg-graph-donut .rg-chonk:hover, .rg-graph-tire .rg-chonk:hover { transform: scale(1.1); opacity: 1; } .rg-graph-pie .rg-chonk:active, .rg-graph-donut .rg-chonk:active, .rg-graph-tire .rg-chonk:active { transform: none; } .rg-graph-hoop .rg-chonk:hover { opacity: 1; } .rg-graph-middle { position: absolute; display: flex; align-items: center; justify-content: space-around; text-align: center; } .rg-graph-middle .rg-content { display: inline-block; } .rg-graph-donut .rg-graph-middle { top: 36%; left: 36%; width: 28%; height: 28%; } .rg-graph-tire .rg-graph-middle { left: 28%; top: 28%; height: 43%; width: 43%; } .rg-graph-hoop .rg-graph-middle { left: 14%; top: 14%; width: 72%; height: 72%; } /* bar */ .rg-graph-bar.rg-graph-h { overflow-y: auto; } .rg-graph-bar.rg-graph-h svg { width: 100%; } .rg-graph-bar.rg-graph-v, .rg-graph-line { overflow-x: auto; } .rg-graph-bar.rg-graph-v svg, .rg-graph-line svg { height: 100%; } .rg-legend { display: flex; flex-direction: column; padding-left: 0.5em; justify-content: center; } .rg-legend-entry { padding: 0.25em 0 0.25em 0; line-height: 0.9em; } .rg-legend-color { display: inline-block; width: 1em; height: 1em; }",
css: " .rg-graph { position: relative; display: flex; flex-direction: row; width: 100%; height: 100%; box-sizing: border-box; } .rg-graph-circular { position: relative; width: 100%; height: 0; padding-bottom: 100%; } .rg-graph-circular svg { position: absolute; left: 0; top: 0; } .rg-graph svg { box-sizing: border-box; margin: auto; } .rg-graph-pie .rg-chonk, .rg-graph-donut .rg-chonk, .rg-graph-tire .rg-chonk { transition: transform 0.3s ease, opacity 0.3s ease; } .rg-chonk { opacity: 0.8; user-select: none; } .rg-chonk.clicky { cursor: pointer; } .rg-graph-pie .rg-chonk:hover, .rg-graph-donut .rg-chonk:hover, .rg-graph-tire .rg-chonk:hover { transform: scale(1.1); opacity: 1; } .rg-graph-pie .rg-chonk:active, .rg-graph-donut .rg-chonk:active, .rg-graph-tire .rg-chonk:active { transform: none; } .rg-graph-hoop .rg-chonk:hover { opacity: 1; } .rg-graph-middle { position: absolute; display: flex; align-items: center; justify-content: space-around; text-align: center; } .rg-graph-middle .rg-content { display: inline-block; } .rg-graph-donut .rg-graph-middle { top: 36%; left: 36%; width: 28%; height: 28%; } .rg-graph-tire .rg-graph-middle { left: 28%; top: 28%; height: 43%; width: 43%; } .rg-graph-hoop .rg-graph-middle { left: 14%; top: 14%; width: 72%; height: 72%; } /* bar */ .rg-graph-bar.rg-graph-h { overflow-y: auto; } .rg-graph-bar.rg-graph-h svg { width: 100%; } .rg-graph-bar.rg-graph-v, .rg-graph-line { overflow-x: auto; } .rg-graph-bar.rg-graph-v svg, .rg-graph-line svg { height: 100%; } .rg-legend { display: flex; flex-direction: column; padding-left: 0.5em; justify-content: center; } .rg-legend-entry { padding: 0.25em 0 0.25em 0; line-height: 0.9em; } .rg-legend-color { display: inline-block; width: 1em; height: 1em; }",
cssId: 'rchart',

@@ -74,0 +74,0 @@ noCssTransform: true,

@@ -1,1 +0,1 @@

import globalRegister from"./globalRegister";import Ractive from"ractive";function chonk(r1,r2,startPct,pct){var t1=(startPct>1?startPct/100:startPct)*360*(Math.PI/180);var cos1=Math.cos(t1);var sin1=Math.sin(t1);if(pct>1){pct/=100}if(pct>=1){pct=.99995}var t2=pct*360*(Math.PI/180);var cos2=Math.cos(t2);var sin2=Math.sin(t2);var pt1=[0*cos1-r1*sin1,0*sin1+r1*cos1];var pt2=[0*cos1-r2*sin1,0*sin1+r2*cos1];var pt3=[pt1[0]*cos2-pt1[1]*sin2,pt1[0]*sin2+pt1[1]*cos2];var pt4=[pt2[0]*cos2-pt2[1]*sin2,pt2[0]*sin2+pt2[1]*cos2];var bits=pct<.5?["0 0 1","0 0 0"]:["0 1 1","0 1 0"];return"M "+pt1[0]+","+pt1[1]+" "+pt2[0]+","+pt2[1]+" A "+Math.abs(r2)+","+Math.abs(r2)+" "+bits[0]+" "+pt4[0]+","+pt4[1]+" L "+pt3[0]+","+pt3[1]+" A "+Math.abs(r1)+","+Math.abs(r1)+" "+bits[1]+" "+pt1[0]+","+pt1[1]+" Z"}function bezierControl(start,cur,prev,next,smooth){var p=prev||cur;var n=next||cur;var len,a;{var lenX=n.x-p.x;var lenY=n.y2-p.y2;len=Math.sqrt(Math.pow(lenX,2)+Math.pow(lenY,2));a=Math.atan2(lenY,lenX)}if(!start){a+=Math.PI}len*=smooth;return[cur.x+Math.cos(a)*len,cur.y2+Math.sin(a)*len]}export var Chart=function(Ractive){function Chart(opts){Ractive.call(this,opts)}if(Ractive)Chart.__proto__=Ractive;Chart.prototype=Object.create(Ractive&&Ractive.prototype);Chart.prototype.constructor=Chart;return Chart}(Ractive);Ractive.extendWith(Chart,{template:{v:4,t:[{t:7,e:"div",m:[{n:"class",f:["rg-graph rg-graph-",{t:2,r:".type"}],t:13},{t:4,f:[{n:"class-rg-graph-h",t:13,f:[{t:2,r:"graph.horiz"}]},{n:"class-rg-graph-v",t:13,f:[{t:2,x:{r:["graph.horiz"],s:"!_0"}}]}],n:50,x:{r:[".type"],s:'_0==="bar"'}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-circular",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-middle",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-content",g:1}],f:[{t:16,z:[{n:"selected",x:{r:"~/selected"}},{n:"hovered",x:{r:"~/hovered"}}]}]}]}],n:50,x:{r:[".type","@this.partials.content"],s:'(_0==="donut"||_0==="tire"||_0==="hoop")&&_1'}}," ",{t:7,e:"svg",m:[{n:"width",f:"100%",t:13,g:1},{n:"height",f:"100%",t:13,g:1},{n:"viewBox",f:"-55 -55 110 110",t:13,g:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:[{t:2,r:".d"}],t:13},{n:"class",f:["rg-chonk rg-chonk-",{t:2,r:"@index"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:4,f:[{t:7,e:"title",f:[{t:2,r:".label"}," ",{t:4,f:["(",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}]}],n:50,r:".label"}]}],n:52,r:"chonks"}]}]}],n:50,x:{r:[".type"],s:'_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"'}},{t:4,f:[{t:7,e:"svg",m:[{n:"viewBox",f:["0 0 ",{t:2,x:{r:["graph.horiz","~/span","graph.span"],s:"_0?_1:_2"}}," ",{t:2,x:{r:["graph.horiz","graph.span","~/span"],s:"_0?_1:_2"}}],t:13},{t:4,f:[{n:"style-min-height",f:[{t:2,r:"graph.span"},"px"],t:13}],n:50,r:"graph.horiz"},{t:4,f:[{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".y"},",",{t:2,r:".x"}," ",{t:2,r:".y"},",",{t:2,r:".x2"},", ",{t:2,r:".y2"},",",{t:2,r:".x2"}," ",{t:2,r:".y2"},",",{t:2,r:".x"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,i:"idx",r:".points"}],n:52,i:"grp",r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:"graph.bottom"},",0 ",{t:2,r:"graph.bottom"},",",{t:2,r:"graph.span"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:50,r:"graph.horiz"},{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".x"},",",{t:2,r:".y"}," ",{t:2,r:".x"},",",{t:2,r:".y2"},", ",{t:2,r:".x2"},",",{t:2,r:".y2"}," ",{t:2,r:".x2"},",",{t:2,r:".y"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:51,l:1}]}," "],n:50,x:{r:[".type"],s:'_0==="bar"'},l:1},{t:4,f:[" ",{t:7,e:"svg",m:[{n:"viewBox",f:[{t:2,x:{r:["~/dot"],s:"-_0"}}," ",{t:2,x:{r:["~/span","graph.maxY","~/dot"],s:"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))"}}," ",{t:2,x:{r:["graph.span","~/dot"],s:"_0+(2*_1)"}}," ",{t:2,x:{r:["~/span","graph.maxY","graph.minY","~/dot"],s:"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))"}}],t:13},{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}," ",{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,x:{r:["graph.minX","~/dot"],s:"_0+_1"}},",",{t:2,r:"graph.bottom"}," ",{t:4,f:[{t:4,f:[{t:4,f:["S ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:50,r:"~/project"},{t:4,f:["C ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".ex"},",",{t:2,r:".ey"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1}],n:50,x:{r:["."],s:'"sx" in _0'}},{t:4,f:["L ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1},{t:2,x:{r:[],s:'" "'}}],n:52,r:".points"}," L ",{t:2,r:"~/graph.maxX"},",",{t:2,r:"~/graph.bottom"}," Z"],t:13},{n:"fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:"opacity",f:"0.6",t:13}],n:50,x:{r:["~/graph.groups.length"],s:"_0>1"}},{t:4,f:[{n:"opacity",f:"0.8",t:13}],n:51,l:1},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:52,r:"graph.groups"}," ",{t:4,f:[{t:4,f:[{t:7,e:"circle",m:[{n:"r",f:[{t:2,r:"~/dot"}],t:13},{n:"cx",f:[{t:2,r:".x"}],t:13},{n:"cy",f:[{t:2,r:".y2"}],t:13},{n:"fill",f:[{t:4,f:[{t:2,r:".color"}],n:50,x:{r:["~/graph.groups.length"],s:"_0===1"}},{t:4,f:[{t:2,r:"^^/color"}],n:51,l:1}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:"stroke-width",f:"1",t:13,g:1},{n:"stroke",f:"#000",t:13,g:1},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}]}],n:50,x:{r:[".type"],s:'_0==="line"'},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend",g:1}],f:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"chonks"}],n:50,x:{r:[".type"],s:'_0!=="bar"&&_0!=="line"'}},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups.0.points"}," "],n:50,x:{r:[".type","graph.groups.length"],s:'_0==="line"&&_1===1'},l:1},{t:4,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups"}],n:51,l:1}]}],n:50,r:"~/legend"}]}],e:{"!_0":function(_0){return!_0},'_0==="bar"':function(_0){return _0==="bar"},'(_0==="donut"||_0==="tire"||_0==="hoop")&&_1':function(_0,_1){return(_0==="donut"||_0==="tire"||_0==="hoop")&&_1},"[_0.click((_1),_2,_3,_4)]":function(_0,_1,_2,_3,_4){return[_0.click(_1,_2,_3,_4)]},'[["select",_0,_1,_2]]':function(_0,_1,_2){return[["select",_0,_1,_2]]},'[["hover",_0,_1,_2]]':function(_0,_1,_2){return[["hover",_0,_1,_2]]},'"\\n"+_0':function(_0){return"\n"+_0},'_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"':function(_0){return _0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"},"_0?_1:_2":function(_0,_1,_2){return _0?_1:_2},"-_0":function(_0){return-_0},"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))":function(_0,_1,_2){return Math.min(_2*-2,_0+2*_2-_1-2*_2)},"_0+(2*_1)":function(_0,_1){return _0+2*_1},"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))":function(_0,_1,_2,_3){return Math.max(_0+4*_3,_1+-1*Math.min(_2,0)+4*_3)},"_0+_1":function(_0,_1){return _0+_1},'"sx" in _0':function(_0){return"sx"in _0},'" "':function(){return" "},"_0>1":function(_0){return _0>1},"_0===1":function(_0){return _0===1},'_0==="line"':function(_0){return _0==="line"},'_0!=="bar"&&_0!=="line"':function(_0){return _0!=="bar"&&_0!=="line"},'_0==="line"&&_1===1':function(_0,_1){return _0==="line"&&_1===1}}},css:" .rg-graph { position: relative; display: flex; flex-direction: row; width: 100%; height: 100%; box-sizing: border-box; } .rg-graph-circular { position: relative; width: 100%; height: 0; padding-bottom: 100%; } .rg-graph-circular svg { position: absolute; left: 0; top: 0; } .rg-graph svg { box-sizing: border-box; margin-left: auto; margin-right: auto; } .rg-graph-pie .rg-chonk, .rg-graph-donut .rg-chonk, .rg-graph-tire .rg-chonk { transition: transform 0.3s ease, opacity 0.3s ease; } .rg-chonk { opacity: 0.8; user-select: none; } .rg-chonk.clicky { cursor: pointer; } .rg-graph-pie .rg-chonk:hover, .rg-graph-donut .rg-chonk:hover, .rg-graph-tire .rg-chonk:hover { transform: scale(1.1); opacity: 1; } .rg-graph-pie .rg-chonk:active, .rg-graph-donut .rg-chonk:active, .rg-graph-tire .rg-chonk:active { transform: none; } .rg-graph-hoop .rg-chonk:hover { opacity: 1; } .rg-graph-middle { position: absolute; display: flex; align-items: center; justify-content: space-around; text-align: center; } .rg-graph-middle .rg-content { display: inline-block; } .rg-graph-donut .rg-graph-middle { top: 36%; left: 36%; width: 28%; height: 28%; } .rg-graph-tire .rg-graph-middle { left: 28%; top: 28%; height: 43%; width: 43%; } .rg-graph-hoop .rg-graph-middle { left: 14%; top: 14%; width: 72%; height: 72%; } /* bar */ .rg-graph-bar.rg-graph-h { overflow-y: auto; } .rg-graph-bar.rg-graph-h svg { width: 100%; } .rg-graph-bar.rg-graph-v, .rg-graph-line { overflow-x: auto; } .rg-graph-bar.rg-graph-v svg, .rg-graph-line svg { height: 100%; } .rg-legend { display: flex; flex-direction: column; padding-left: 0.5em; justify-content: center; } .rg-legend-entry { padding: 0.25em 0 0.25em 0; line-height: 0.9em; } .rg-legend-color { display: inline-block; width: 1em; height: 1em; }",cssId:"rchart",noCssTransform:true,attributes:["data","type","horizontal","colors","point","space","flip","dot","smooth","project","span","sub","legend","hole","clustergap","nolabelvalue"],computed:{chonks:function chonks(){var data=this.get("data");if(!Array.isArray(data)){data=[]}else if(Array.isArray(data[0])){data=data[0]}var total=data.reduce(function(a,c){return a+Math.abs(c.value)},0);var type=this.get("type");var colors=this.get("colors");var inner=this.get("hole")||(type==="pie"?0:type==="donut"?15:type==="tire"?25:40);var agg=0;return data.map(function(d,i){var percent=Math.abs(d.value)/total;var datum=Object.assign({idx:i,percent:percent,d:chonk(inner,50,agg,percent),point:d},d);if(!datum.color){datum.color=colors[i%colors.length]}agg+=percent;return datum})},graph:function graph(){var this$1=this;var data=this.get("data");if(!Array.isArray(data)){data=[[]]}if(!Array.isArray(data[0])){data=[data]}var type=this.get("type");var ref=data.reduce(function(a,c){return c.reduce(function(aa,cc){if(cc.value<a[0]){a[0]=cc.value}if(cc.value>a[1]){a[1]=cc.value}return a},0)},[0,0]);var min=ref[0];var max=ref[1];var dot=this.get("dot")||1;var range=max-min;var bottom=min<0?min*-1:-min;var colors=this.get("colors");var point=this.get("point");var space=type==="line"?0:this.get("space");var horiz=this.get("horizontal");var flip=horiz?this.get("flip"):!this.get("flip");var bar=this.get("span");var smooth=type==="line"&&this.get("smooth");var project=this.get("project");var points;if(type==="line"){points=data.map(function(ps){return ps.map(function(d,i){var p=Object.assign({x:i*point+i*space+space,y:bottom/range*bar,y2:(d.value+bottom)/range*bar,idx:i,point:d},d);p.x2=p.x+point;p.comp=p.y2;p.x+=dot;p.x2+=dot;if(smooth&&project&&i>0&&i+1<ps.length){var prev=(ps[i-1].value+bottom)/range*bar;var next=(ps[i+1].value+bottom)/range*bar;var off=(prev+next+p.comp)/6;if(prev>p.comp){p.comp=p.comp-off}else{p.comp=p.comp+off}}if(flip){p.y=bar-p.y;p.y2=bar-p.y2}if(!p.color){p.color=colors[i%colors.length]}return p})});if(smooth){points.forEach(function(points,i){points.forEach(function(p,i){var assign,assign$1;if(i===0){return}assign=bezierControl(true,points[i-1],points[i-2],p,smooth),p.sx=assign[0],p.sy=assign[1];assign$1=bezierControl(false,p,points[i-1],points[i+1],smooth),p.ex=assign$1[0],p.ey=assign$1[1]})})}}else{var single=false;var orig=data;if(data.length===1&&Array.isArray(data[0])){single=true;data=data[0].map(function(d){return data[0]})}var off=point/data.length;var sub=this.get("sub")||"cluster";var gap=this.get("clustergap")||0;points=data.map(function(ds,i){var ps=ds.map(function(_,ii){return data[ii]&&data[ii][i]||{value:0}});var res=ps.map(function(d,ii){var p=Object.assign({x:i*point+i*space+space,y:bottom/range*bar,y2:(d.value+bottom)/range*bar,idx:i,point:d},d,{label:single?orig[0][i].label:d.label});p.x2=p.x+point;p.comp=p.y2;if(!single&&sub==="cluster"){p.x+=off*ii;p.x2=p.x+off-gap}if(flip){p.y=bar-p.y;p.y2=bar-p.y2}if(!p.color){p.color=colors[(single?i:ii)%colors.length]}return p});if(sub==="stack"){res.sort(function(l,r){return l.value>r.value?-1:l.value<r.value?1:0})}return res})}var groups=points.map(function(points,i){var g={points:points,color:colors[i%colors.length]};var base=type==="bar"&&this$1.get("sub")==="stack"?data[i]:points;if(base&&base[i]&&base[i].label){g.label=base[i].label}return g});if(type==="line"){groups.sort(function(l,r){var avgl=l.points.reduce(function(a,c){return a+c.value},0)/l.points.length;var avgr=r.points.reduce(function(a,c){return a+c.value},0)/r.points.length;return avgl<avgr?1:avgl>avgr?-1:0});groups.forEach(function(g,i){return g.color=colors[i%colors.length]})}var len=data.reduce(function(a,c){return c.length>a?c.length:a},0);return{bottom:flip?bar-bottom/range*bar:bottom/range*bar,min:min,max:max,horiz:type==="line"?false:horiz,flip:flip,span:(type==="line"?len-1:len)*point+(len+2)*space+(type==="line"?dot*2:0),minX:points.reduce(function(a,ps){return ps.reduce(function(aa,c){return c.x<aa?c.x:aa},a)},0),maxX:points.reduce(function(a,ps){return ps.reduce(function(aa,c){return c.x>aa?c.x:aa},a)},0),minY:points.reduce(function(a,ps){return ps.reduce(function(aa,c){return c.comp<aa?c.comp:aa},a)},0),maxY:points.reduce(function(a,ps){return ps.reduce(function(aa,c){return c.comp>aa?c.comp:aa},a)},0),groups:groups}}},data:function data(){return{colors:["#1f5b93","#F8D306","#03aa0f","#d21a1a","#2DD3C7","#633294","#FB4700"],point:30,space:5,dot:3,span:200,color:"#1f5b93"}},on:{construct:function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var svg=tpl.find(function(e){return e.e==="svg"});if(svg){this._svgA=svg.m}},config:function config(){if(this._svgA){this.set("svgA",this._svgA)}}}});export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"chart"]=Chart}}globalRegister("RauiChart","components",Chart);export default plugin;
import globalRegister from"./globalRegister";import Ractive from"ractive";function chonk(r1,r2,startPct,pct){var t1=(startPct>1?startPct/100:startPct)*360*(Math.PI/180);var cos1=Math.cos(t1);var sin1=Math.sin(t1);if(pct>1){pct/=100}if(pct>=1){pct=.99995}var t2=pct*360*(Math.PI/180);var cos2=Math.cos(t2);var sin2=Math.sin(t2);var pt1=[0*cos1-r1*sin1,0*sin1+r1*cos1];var pt2=[0*cos1-r2*sin1,0*sin1+r2*cos1];var pt3=[pt1[0]*cos2-pt1[1]*sin2,pt1[0]*sin2+pt1[1]*cos2];var pt4=[pt2[0]*cos2-pt2[1]*sin2,pt2[0]*sin2+pt2[1]*cos2];var bits=pct<.5?["0 0 1","0 0 0"]:["0 1 1","0 1 0"];return"M "+pt1[0]+","+pt1[1]+" "+pt2[0]+","+pt2[1]+" A "+Math.abs(r2)+","+Math.abs(r2)+" "+bits[0]+" "+pt4[0]+","+pt4[1]+" L "+pt3[0]+","+pt3[1]+" A "+Math.abs(r1)+","+Math.abs(r1)+" "+bits[1]+" "+pt1[0]+","+pt1[1]+" Z"}function bezierControl(start,cur,prev,next,smooth){var p=prev||cur;var n=next||cur;var len,a;{var lenX=n.x-p.x;var lenY=n.y2-p.y2;len=Math.sqrt(Math.pow(lenX,2)+Math.pow(lenY,2));a=Math.atan2(lenY,lenX)}if(!start){a+=Math.PI}len*=smooth;return[cur.x+Math.cos(a)*len,cur.y2+Math.sin(a)*len]}export var Chart=function(Ractive){function Chart(opts){Ractive.call(this,opts)}if(Ractive)Chart.__proto__=Ractive;Chart.prototype=Object.create(Ractive&&Ractive.prototype);Chart.prototype.constructor=Chart;return Chart}(Ractive);Ractive.extendWith(Chart,{template:{v:4,t:[{t:7,e:"div",m:[{n:"class",f:["rg-graph rg-graph-",{t:2,r:".type"}],t:13},{t:4,f:[{n:"class-rg-graph-h",t:13,f:[{t:2,r:"graph.horiz"}]},{n:"class-rg-graph-v",t:13,f:[{t:2,x:{r:["graph.horiz"],s:"!_0"}}]}],n:50,x:{r:[".type"],s:'_0==="bar"'}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-circular",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-middle",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-content",g:1}],f:[{t:16,z:[{n:"selected",x:{r:"~/selected"}},{n:"hovered",x:{r:"~/hovered"}}]}]}]}],n:50,x:{r:[".type","@this.partials.content"],s:'(_0==="donut"||_0==="tire"||_0==="hoop")&&_1'}}," ",{t:7,e:"svg",m:[{n:"width",f:"100%",t:13,g:1},{n:"height",f:"100%",t:13,g:1},{n:"viewBox",f:"-55 -55 110 110",t:13,g:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:[{t:2,r:".d"}],t:13},{n:"class",f:["rg-chonk rg-chonk-",{t:2,r:"@index"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:4,f:[{t:7,e:"title",f:[{t:2,r:".label"}," ",{t:4,f:["(",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}]}],n:50,r:".label"}]}],n:52,r:"chonks"}]}]}],n:50,x:{r:[".type"],s:'_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"'}},{t:4,f:[{t:7,e:"svg",m:[{n:"viewBox",f:["0 0 ",{t:2,x:{r:["graph.horiz","~/span","graph.span"],s:"_0?_1:_2"}}," ",{t:2,x:{r:["graph.horiz","graph.span","~/span"],s:"_0?_1:_2"}}],t:13},{t:4,f:[{n:"style-min-height",f:[{t:2,r:"graph.span"},"px"],t:13}],n:50,r:"graph.horiz"},{t:4,f:[{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".y"},",",{t:2,r:".x"}," ",{t:2,r:".y"},",",{t:2,r:".x2"},", ",{t:2,r:".y2"},",",{t:2,r:".x2"}," ",{t:2,r:".y2"},",",{t:2,r:".x"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,i:"idx",r:".points"}],n:52,i:"grp",r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:"graph.bottom"},",0 ",{t:2,r:"graph.bottom"},",",{t:2,r:"graph.span"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:50,r:"graph.horiz"},{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".x"},",",{t:2,r:".y"}," ",{t:2,r:".x"},",",{t:2,r:".y2"},", ",{t:2,r:".x2"},",",{t:2,r:".y2"}," ",{t:2,r:".x2"},",",{t:2,r:".y"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:51,l:1}]}," "],n:50,x:{r:[".type"],s:'_0==="bar"'},l:1},{t:4,f:[" ",{t:7,e:"svg",m:[{n:"viewBox",f:[{t:2,x:{r:["~/dot"],s:"-_0"}}," ",{t:2,x:{r:["~/span","graph.maxY","~/dot"],s:"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))"}}," ",{t:2,x:{r:["graph.span","~/dot"],s:"_0+(2*_1)"}}," ",{t:2,x:{r:["~/span","graph.maxY","graph.minY","~/dot"],s:"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))"}}],t:13},{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}," ",{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,x:{r:["graph.minX","~/dot"],s:"_0+_1"}},",",{t:2,r:"graph.bottom"}," ",{t:4,f:[{t:4,f:[{t:4,f:["S ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:50,r:"~/project"},{t:4,f:["C ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".ex"},",",{t:2,r:".ey"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1}],n:50,x:{r:["."],s:'"sx" in _0'}},{t:4,f:["L ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1},{t:2,x:{r:[],s:'" "'}}],n:52,r:".points"}," L ",{t:2,r:"~/graph.maxX"},",",{t:2,r:"~/graph.bottom"}," Z"],t:13},{n:"fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:"opacity",f:"0.6",t:13}],n:50,x:{r:["~/graph.groups.length"],s:"_0>1"}},{t:4,f:[{n:"opacity",f:"0.8",t:13}],n:51,l:1},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:52,r:"graph.groups"}," ",{t:4,f:[{t:4,f:[{t:7,e:"circle",m:[{n:"r",f:[{t:2,r:"~/dot"}],t:13},{n:"cx",f:[{t:2,r:".x"}],t:13},{n:"cy",f:[{t:2,r:".y2"}],t:13},{n:"fill",f:[{t:4,f:[{t:2,r:".color"}],n:50,x:{r:["~/graph.groups.length"],s:"_0===1"}},{t:4,f:[{t:2,r:"^^/color"}],n:51,l:1}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:"stroke-width",f:"1",t:13,g:1},{n:"stroke",f:"#000",t:13,g:1},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}]}],n:50,x:{r:[".type"],s:'_0==="line"'},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend",g:1}],f:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"chonks"}],n:50,x:{r:[".type"],s:'_0!=="bar"&&_0!=="line"'}},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups.0.points"}," "],n:50,x:{r:[".type","graph.groups.length"],s:'_0==="line"&&_1===1'},l:1},{t:4,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups"}],n:51,l:1}]}],n:50,r:"~/legend"}]}],e:{"!_0":function(_0){return!_0},'_0==="bar"':function(_0){return _0==="bar"},'(_0==="donut"||_0==="tire"||_0==="hoop")&&_1':function(_0,_1){return(_0==="donut"||_0==="tire"||_0==="hoop")&&_1},"[_0.click((_1),_2,_3,_4)]":function(_0,_1,_2,_3,_4){return[_0.click(_1,_2,_3,_4)]},'[["select",_0,_1,_2]]':function(_0,_1,_2){return[["select",_0,_1,_2]]},'[["hover",_0,_1,_2]]':function(_0,_1,_2){return[["hover",_0,_1,_2]]},'"\\n"+_0':function(_0){return"\n"+_0},'_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"':function(_0){return _0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"},"_0?_1:_2":function(_0,_1,_2){return _0?_1:_2},"-_0":function(_0){return-_0},"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))":function(_0,_1,_2){return Math.min(_2*-2,_0+2*_2-_1-2*_2)},"_0+(2*_1)":function(_0,_1){return _0+2*_1},"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))":function(_0,_1,_2,_3){return Math.max(_0+4*_3,_1+-1*Math.min(_2,0)+4*_3)},"_0+_1":function(_0,_1){return _0+_1},'"sx" in _0':function(_0){return"sx"in _0},'" "':function(){return" "},"_0>1":function(_0){return _0>1},"_0===1":function(_0){return _0===1},'_0==="line"':function(_0){return _0==="line"},'_0!=="bar"&&_0!=="line"':function(_0){return _0!=="bar"&&_0!=="line"},'_0==="line"&&_1===1':function(_0,_1){return _0==="line"&&_1===1}}},css:" .rg-graph { position: relative; display: flex; flex-direction: row; width: 100%; height: 100%; box-sizing: border-box; } .rg-graph-circular { position: relative; width: 100%; height: 0; padding-bottom: 100%; } .rg-graph-circular svg { position: absolute; left: 0; top: 0; } .rg-graph svg { box-sizing: border-box; margin: auto; } .rg-graph-pie .rg-chonk, .rg-graph-donut .rg-chonk, .rg-graph-tire .rg-chonk { transition: transform 0.3s ease, opacity 0.3s ease; } .rg-chonk { opacity: 0.8; user-select: none; } .rg-chonk.clicky { cursor: pointer; } .rg-graph-pie .rg-chonk:hover, .rg-graph-donut .rg-chonk:hover, .rg-graph-tire .rg-chonk:hover { transform: scale(1.1); opacity: 1; } .rg-graph-pie .rg-chonk:active, .rg-graph-donut .rg-chonk:active, .rg-graph-tire .rg-chonk:active { transform: none; } .rg-graph-hoop .rg-chonk:hover { opacity: 1; } .rg-graph-middle { position: absolute; display: flex; align-items: center; justify-content: space-around; text-align: center; } .rg-graph-middle .rg-content { display: inline-block; } .rg-graph-donut .rg-graph-middle { top: 36%; left: 36%; width: 28%; height: 28%; } .rg-graph-tire .rg-graph-middle { left: 28%; top: 28%; height: 43%; width: 43%; } .rg-graph-hoop .rg-graph-middle { left: 14%; top: 14%; width: 72%; height: 72%; } /* bar */ .rg-graph-bar.rg-graph-h { overflow-y: auto; } .rg-graph-bar.rg-graph-h svg { width: 100%; } .rg-graph-bar.rg-graph-v, .rg-graph-line { overflow-x: auto; } .rg-graph-bar.rg-graph-v svg, .rg-graph-line svg { height: 100%; } .rg-legend { display: flex; flex-direction: column; padding-left: 0.5em; justify-content: center; } .rg-legend-entry { padding: 0.25em 0 0.25em 0; line-height: 0.9em; } .rg-legend-color { display: inline-block; width: 1em; height: 1em; }",cssId:"rchart",noCssTransform:true,attributes:["data","type","horizontal","colors","point","space","flip","dot","smooth","project","span","sub","legend","hole","clustergap","nolabelvalue"],computed:{chonks:function chonks(){var data=this.get("data");if(!Array.isArray(data)){data=[]}else if(Array.isArray(data[0])){data=data[0]}var total=data.reduce(function(a,c){return a+Math.abs(c.value)},0);var type=this.get("type");var colors=this.get("colors");var inner=this.get("hole")||(type==="pie"?0:type==="donut"?15:type==="tire"?25:40);var agg=0;return data.map(function(d,i){var percent=Math.abs(d.value)/total;var datum=Object.assign({idx:i,percent:percent,d:chonk(inner,50,agg,percent),point:d},d);if(!datum.color){datum.color=colors[i%colors.length]}agg+=percent;return datum})},graph:function graph(){var this$1=this;var data=this.get("data");if(!Array.isArray(data)){data=[[]]}if(!Array.isArray(data[0])){data=[data]}var type=this.get("type");var ref=data.reduce(function(a,c){return c.reduce(function(aa,cc){if(cc.value<a[0]){a[0]=cc.value}if(cc.value>a[1]){a[1]=cc.value}return a},0)},[0,0]);var min=ref[0];var max=ref[1];var dot=this.get("dot")||1;var range=max-min;var bottom=min<0?min*-1:-min;var colors=this.get("colors");var point=this.get("point");var space=type==="line"?0:this.get("space");var horiz=this.get("horizontal");var flip=horiz?this.get("flip"):!this.get("flip");var bar=this.get("span");var smooth=type==="line"&&this.get("smooth");var project=this.get("project");var points;if(type==="line"){points=data.map(function(ps){return ps.map(function(d,i){var p=Object.assign({x:i*point+i*space+space,y:bottom/range*bar,y2:(d.value+bottom)/range*bar,idx:i,point:d},d);p.x2=p.x+point;p.comp=p.y2;p.x+=dot;p.x2+=dot;if(smooth&&project&&i>0&&i+1<ps.length){var prev=(ps[i-1].value+bottom)/range*bar;var next=(ps[i+1].value+bottom)/range*bar;var off=(prev+next+p.comp)/6;if(prev>p.comp){p.comp=p.comp-off}else{p.comp=p.comp+off}}if(flip){p.y=bar-p.y;p.y2=bar-p.y2}if(!p.color){p.color=colors[i%colors.length]}return p})});if(smooth){points.forEach(function(points,i){points.forEach(function(p,i){var assign,assign$1;if(i===0){return}assign=bezierControl(true,points[i-1],points[i-2],p,smooth),p.sx=assign[0],p.sy=assign[1];assign$1=bezierControl(false,p,points[i-1],points[i+1],smooth),p.ex=assign$1[0],p.ey=assign$1[1]})})}}else{var single=false;var orig=data;if(data.length===1&&Array.isArray(data[0])){single=true;data=data[0].map(function(d){return data[0]})}var off=point/data.length;var sub=this.get("sub")||"cluster";var gap=this.get("clustergap")||0;points=data.map(function(ds,i){var ps=ds.map(function(_,ii){return data[ii]&&data[ii][i]||{value:0}});var res=ps.map(function(d,ii){var p=Object.assign({x:i*point+i*space+space,y:bottom/range*bar,y2:(d.value+bottom)/range*bar,idx:i,point:d},d,{label:single?orig[0][i].label:d.label});p.x2=p.x+point;p.comp=p.y2;if(!single&&sub==="cluster"){p.x+=off*ii;p.x2=p.x+off-gap}if(flip){p.y=bar-p.y;p.y2=bar-p.y2}if(!p.color){p.color=colors[(single?i:ii)%colors.length]}return p});if(sub==="stack"){res.sort(function(l,r){return l.value>r.value?-1:l.value<r.value?1:0})}return res})}var groups=points.map(function(points,i){var g={points:points,color:colors[i%colors.length]};var base=type==="bar"&&this$1.get("sub")==="stack"?data[i]:points;if(base&&base[i]&&base[i].label){g.label=base[i].label}return g});if(type==="line"){groups.sort(function(l,r){var avgl=l.points.reduce(function(a,c){return a+c.value},0)/l.points.length;var avgr=r.points.reduce(function(a,c){return a+c.value},0)/r.points.length;return avgl<avgr?1:avgl>avgr?-1:0});groups.forEach(function(g,i){return g.color=colors[i%colors.length]})}var len=data.reduce(function(a,c){return c.length>a?c.length:a},0);return{bottom:flip?bar-bottom/range*bar:bottom/range*bar,min:min,max:max,horiz:type==="line"?false:horiz,flip:flip,span:(type==="line"?len-1:len)*point+(len+2)*space+(type==="line"?dot*2:0),minX:points.reduce(function(a,ps){return ps.reduce(function(aa,c){return c.x<aa?c.x:aa},a)},0),maxX:points.reduce(function(a,ps){return ps.reduce(function(aa,c){return c.x>aa?c.x:aa},a)},0),minY:points.reduce(function(a,ps){return ps.reduce(function(aa,c){return c.comp<aa?c.comp:aa},a)},0),maxY:points.reduce(function(a,ps){return ps.reduce(function(aa,c){return c.comp>aa?c.comp:aa},a)},0),groups:groups}}},data:function data(){return{colors:["#1f5b93","#F8D306","#03aa0f","#d21a1a","#2DD3C7","#633294","#FB4700"],point:30,space:5,dot:3,span:200,color:"#1f5b93"}},on:{construct:function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var svg=tpl.find(function(e){return e.e==="svg"});if(svg){this._svgA=svg.m}},config:function config(){if(this._svgA){this.set("svgA",this._svgA)}}}});export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"chart"]=Chart}}globalRegister("RauiChart","components",Chart);export default plugin;

@@ -360,2 +360,3 @@ // TODO: support for non-numeric formats?

g.value = +v;
if (g.type === 'M') { g.value--; }
}

@@ -362,0 +363,0 @@ }

@@ -1,1 +0,1 @@

var nonDigits=/[^\d]+/;var nonDisplay=/[^\d_]+/;var blankChar="_";var map={y:0,M:1,d:2,H:3,m:4,s:5,S:6};export function padl(str,total,char){if(char===void 0)char="0";var v=str==null?"":""+str;for(var i=v.length;i<total;i++){v=char+v}return v}export function padr(str,total,char){if(char===void 0)char="0";var v=str==null?"":""+str;for(var i=v.length;i<total;i++){v+=char}return v}export var defaults={mask:"yyyy-MM-dd",time:[0,0,0,0],date:function date(){var now=new Date;var tm=defaults.time;return new Date(now.getFullYear(),now.getMonth(),now.getDate(),tm[0],tm[1],tm[2],tm[3])},parseDate:function parseDate(dt){return new Date(dt)}};function timeArray(value){if(value==="start"){value=[0,0,0,0]}else if(value==="end"){value=[23,59,59,999]}else if(value==="mid"){value=[12,0,0,0]}else if(value==="now"){value=function(){var dt=new Date;return[dt.getHours(),dt.getMinutes(),dt.getSeconds(),dt.getMilliseconds()]}}else if(typeof value==="string"){var dt=new Date("2000-05-13T"+value+"Z");if(+dt){value=[dt.getUTCHours(),dt.getUTCMinutes(),dt.getUTCSeconds(),dt.getUTCMilliseconds()]}}if(!Array.isArray(value)&&typeof value!=="function"&&!Array.isArray(value())){value=[0,0,0,0]}return value}export default function plugin(options){if(options===void 0)options={};var defaultMask=options.mask||defaults.mask;var defaultTime=timeArray(options.time||defaults.time);var defaultDate=options.date||defaults.date;if(typeof defaultDate!=="function"){var dt=defaultDate;defaultDate=function(){return dt}}return function(ref){var instance=ref.instance;instance.decorators[options.name||"date"]=function(node,optsin,other){if(optsin===void 0)optsin={};var opts=Object.assign({},options,typeof optsin==="string"?{value:optsin}:optsin,typeof other==="string"?{mask:other}:other);if(!opts.parseDate){opts.parseDate=options.parseDate||defaults.parseDate}var defdt=opts.date||defaultDate;var deftm=timeArray(opts.time||defaultTime);if(typeof defdt!=="function"){var dt=defdt;defdt=function(){return dt}}var ctx=this.getContext(node);var mask=opts.mask||defaultMask;var handles={observers:[],listeners:[]};var lastBackspace=false;if(node.tagName!=="INPUT"){console.warn("Attempted to add a date decorator a "+node.tagName);return noop}if(!mask){return noop}var groups=[];var match,last=0;while(match=dateRE.exec(mask)){var group={mask:match[0],type:match[0][0],length:match[0].length,start:match.index,end:match.index+match[0].length,chunk:groups.length,prefix:mask.substring(last,match.index),groups:groups,value:null,display:padr("",match[0].length,blankChar)};last=group.end;groups.push(group)}groups.suffix=mask.substring(groups[groups.length-1].end);groups.last=null;if(groups.slice(1).find(function(g){return!g.prefix})){console.warn("Attempted to add a date decorator missing interstitial between fields '"+mask+"'");return noop}if(opts.min>opts.max){delete opts.min}if(typeof opts.value==="string"){handles.observers.push(ctx.observe(opts.value,function(v){if(!v&&opts.null===false){v=defdt()}groups.value=v;receiveValue(groups,v,opts.parseDate);groups.last=v;updateDisplay(groups,node);if(opts.min&&v<opts.min||opts.max&&v>opts.max){groups.last=null;setTimeout(sendValue)}},{defer:true}))}if(typeof opts.display==="string"){handles.observers.push(ctx.observe(opts.display,function(v){node.value=v||"";readInput(groups,node,mask);updateValues(groups);applyValues(groups,sendValue,true,defdt,deftm);updateDisplay(groups,node)},{defer:true}))}if(!opts.display&&!opts.value){if(opts.date||opts.null===false){groups.value=getDateValue(opts.date||defdt(),opts.parseDate)}updateDisplay(groups,node)}function sendValue(focused){if(groups.value===null&&groups.last===null||+groups.value===+groups.last){return 1}if(focused&&opts.lazy!==false){return}if(opts.null===false&&groups.value===null){return receiveValue(groups,groups.last,opts.parseDate)&&1||1}if(opts.min&&groups.value<opts.min){receiveValue(groups,opts.min,opts.parseDate);updateDisplay(groups,node)}else if(opts.max&&groups.value>opts.max){receiveValue(groups,opts.max,opts.parseDate);updateDisplay(groups,node)}groups.last=groups.value;if(typeof opts.value==="string"){handles.observers.forEach(function(h){return h.silence()});ctx.set(opts.value,groups.value);handles.observers.forEach(function(h){return h.resume()})}if(typeof opts.display==="string"){handles.observers.forEach(function(h){return h.silence()});ctx.set(opts.display,node.value);handles.observers.forEach(function(h){return h.resume()})}}var selectGroup=function(group,pos){if(pos===undefined){pos=node.selectionStart}if(group&&group.target){group=undefined}if(!group){if(pos===node.value.length&&node.selectionEnd===node.value.length){group=groups[0]}else{group=groupForPos(groups,pos)}}if(lastBackspace){lastBackspace=false;if(pos<group.start){group=groups[groups.indexOf(group)-1]}}document.activeElement===node&&node.setSelectionRange(group.start,group.end)};handles.listeners.push(ctx.listen("input",function(){var pos=node.selectionStart;var start=node.value;readInput(groups,node,mask);var active=groupForPos(groups,pos);var accepted=updateValues(groups,active,pos);applyValues(groups,sendValue,true,defdt,deftm);updateDisplay(groups,node);if(active&&(start.length>=mask.length&&pos===active.end||accepted)&&active!==groups[groups.length-1]){var next=groups[groups.indexOf(active)+1];selectGroup(next,pos)}else{node.setSelectionRange(pos,pos)}}));handles.listeners.push(ctx.listen("blur",function(){lastBackspace=false;if(sendValue(false)){receiveValue(groups,groups.value,opts.parseDate)}if(groups.value===null){groups.forEach(function(g){return g.value=null})}groups.forEach(function(g){return g.display=displayForGroup(g)});updateDisplay(groups,node)}));handles.listeners.push(ctx.listen("click",selectGroup));handles.listeners.push(ctx.listen("focus",selectGroup));handles.listeners.push(ctx.listen("keydown",function(ev){lastBackspace=false;switch(ev.key){case"Enter":case"Tab":{var g=groupForPos(groups,node.selectionStart);var idx=groups.indexOf(g);if(updateValues(groups,g,node.selectionStart,true)){updateDisplay(groups,node);applyValues(groups,sendValue,ev.shiftKey&&idx>0||!ev.shiftKey&&idx+1<groups.length,defdt,deftm)}if(ev.shiftKey&&idx>0){selectGroup(groups[idx-1]);ev.preventDefault();ev.stopPropagation()}else if(!ev.shiftKey&&idx+1<groups.length){selectGroup(groups[idx+1]);ev.preventDefault();ev.stopPropagation()}break}case"Backspace":lastBackspace=true;break;case"ArrowUp":case"ArrowDown":{var ref=[node.selectionStart,node.selectionEnd];var s=ref[0];var e=ref[1];var g$1=groupForPos(groups,s);if(g$1.value===null){g$1.value=1}bumpValue(g$1,ev.key==="ArrowDown");g$1.input=g$1.display=displayForGroup(g$1);applyValues(groups,sendValue,true,defdt,deftm);updateDisplay(groups,node);ev.preventDefault();ev.stopPropagation();node.setSelectionRange(s,e);break}}}));return{teardown:function teardown(){handles.observers.forEach(function(o){return o.cancel()});handles.listeners.forEach(function(o){return o.cancel()})}}}}}function readInput(groups,node,mask){var val=node.value;var pos=node.selectionStart;var active=groupForPos(groups,pos);var gidx=0;var group=groups[gidx];var next=groups[gidx+1];groups.forEach(function(g){return g.input=""});for(var i=0;i<val.length;i++){if(next&&val[i]===next.prefix[0]&&(active!==group||group.input.length>=group.length||val.length-i<mask.length-group.end+(group.length-group.input.length))){if(next.prefix.length>1){i+=next.prefix.length-1}if(val[i+1]===next.prefix[0]){i+=next.prefix.length}group=groups[++gidx];next=groups[gidx+1]}else{group.input+=val[i]}}}function updateValues(groups,target,pos,leave){if(pos===void 0)pos=0;if(leave===void 0)leave=false;var accepted=false;for(var i=0;i<groups.length;i++){var g=groups[i];var v=(g.input||"").replace(nonDigits,"");var hasSep=groups[i+1]&&groups[i+1].prefix&&nonDisplay.test(g.input);if(v.length>g.length&&g===target){var drop=v.length-target.length;v=v.substr(0,pos-target.start)+v.substr(pos-target.start+drop)}else{v=v.substr(0,g.length)}g.input=v;if(g.type==="y"&&v.length===0&&(hasSep||leave)){g.value=(new Date).getFullYear();g.input=g.display=padl(g.value,g.length);accepted=true}else if(g.type==="m"&&v.length===0&&(hasSep||leave)){g.value=0;g.input=g.display=padl(g.value,g.length);accepted=true}else if(g.type==="d"&&v.length!==g.length&&leave){g.value=+v;g.display=displayForGroup(g)}else if(v===""){g.value=null;g.display=displayForGroup(g)}else if(g!==target){g.value=+v;if(g.type==="M"){g.value--}g.display=displayForGroup(g)}else{if(g.type==="M"&&+v>1||g.type==="d"&&+v>3||g.type==="H"&&+v>2||(g.type==="m"||g.type==="s")&&+v>6){g.value=+v;if(g.type==="M"){g.value--}g.display=padl(v,g.length);accepted=true}else if(g.type==="y"&&v.length===2&&(hasSep||leave)){var n=(new Date).getFullYear();var cen=Math.floor(n/100)*100;var val=Math.abs(n-(cen+ +v))<20?cen+ +v:cen-100+ +v;g.value=val;g.input=g.display=padl(val,g.length);accepted=true}else{g.display=padr(v,g.length,blankChar);g.value=+v}}}return accepted}function receiveValue(groups,v,parseDate){v=groups.value=v&&getDateValue(v,parseDate);var parts=v?[v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds()]:[null,null,null,null,null,null,null];groups.forEach(function(g){g.value=parts[map[g.type]];g.input=g.display=displayForGroup(g)})}function applyValues(groups,send,focused,defaultDate,defaultTime){var v=groups.value||defaultDate();var parts=[v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds()];if(!groups.find(function(p){return p.type==="m"||p.type==="s"||p.type==="h"||p.type==="S"})){if(typeof defaultTime==="function"){defaultTime=defaultTime()}for(var i=0;i<4;i++){parts[i+3]=defaultTime[i]}}groups.forEach(function(g){var vv=g.value;if(vv!==null&&g.type==="M"){if(vv<0){vv=0}else if(vv>11){vv=11}}else if(vv!==null&&(g.type==="m"||g.type==="s")){if(vv<0){vv=0}else if(vv>59){vv=59}}else if(vv!==null&&g.type==="H"){if(vv<0){vv=0}else if(vv>23){vv=23}}else if(vv!==null&&g.type==="h"){if(vv<1){vv=1}else if(vv>12){vv=12}}if(vv!==g.value){g.value=vv;g.display=displayForGroup(g)}parts[map[g.type]]=g.value});if(parts[0]!==null&&parts[1]!==null&&parts[2]!==null){var d=groups.find(function(g){return g.type==="d"});if(d){if(parts[2]<1){d.value=parts[2]=1;d.display=displayForGroup(d)}else{var last=lastDay(new Date(parts[0],parts[1],1));if(parts[2]>last){d.value=parts[2]=last;d.display=d.input=displayForGroup(d)}}}}if(groups.find(function(g){return g.value===null})||parts[0]===0||parts[1]>11||parts[1]<0||parts[2]===0){groups.value=null}else{parts.unshift(null);groups.value=new(Date.bind.apply(Date,parts))}send(focused)}function updateDisplay(groups,node){node.value=groups.reduce(function(a,c){return a+c.prefix+c.display},"")+groups.suffix}function groupForPos(groups,pos){return groups.find(function(g){return pos>=g.start&&pos<=g.end})}function displayForGroup(group){if(group.value===null){return padl("",group.length,blankChar)}switch(group.type){case"y":if(!group.value){return padl("",group.length,blankChar)}return group.length<=2?(""+group.value).substr(2,2):""+padl(group.value,group.length);case"M":if(!~group.value){return padl("",group.length,blankChar)}if(group.length===1){return""+(group.value+1)}else if(group.length===2){return(group.value<9?"0":"")+(group.value+1)}else if(group.length===3){return months[group.value].substr(0,3)}else{return months[group.value]}case"d":if(!group.value){return padl("",group.length,blankChar)}if(group.length===1){return""+group.value}else if(group.length===2){return(group.value<=9?"0":"")+group.value}else if(group.length===3){return days[group.groups.value.getDay()].substr(0,3)}else{return days[group.groups.value.getDay()]}case"H":case"h":case"m":case"s":if(group.length===1){return""+group.value}else{return padl(group.value,group.length)}case"S":if(group.length===1){return""+group.value}else{return padl(group.value,3)}}}var dateRE=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g;var months=["January","February","March","April","May","June","July","August","September","October","November","December"];var days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var noop={teardown:function teardown(){}};function bumpValue(group,down){switch(group.type){case"y":group.value=group.value+(down?-1:1);break;case"M":group.value=down?group.value<1?11:group.value-1:group.value>10?0:group.value+1;break;case"d":{var groups=group.groups;var last=lastDay(new Date((groups.find(function(g){return g.type==="y"})||{value:1}).value,(groups.find(function(g){return g.type==="M"})||{value:1}).value),1);if(down){group.value=group.value<2?last:group.value-1}else{group.value=group.value+1>last?1:group.value+1}break}case"H":group.value=down?group.value<1?23:group.value-1:group.value>22?0:group.value+1;break;case"h":group.value=down?group.value<1?12:group.value-1:group.value>11?1:group.value+1;break;case"m":case"s":group.value=down?group.value<1?59:group.value-1:group.value>58?0:group.value+1;break;case"S":group.value=down?group.value<1?999:group.value-1:group.value>998?0:group.value+1;break}}function lastDay(date){return new Date(new Date(date.getFullYear(),date.getMonth()+1,1)-864e5).getDate()}var origin=new Date("0000-01-01T00:00:00");function getDateValue(thing,parseDate){var v=thing;if(typeof v==="function"){v=thing()}if(typeof v==="string"){if(typeof parseDate==="function"){try{v=parseDate(v)}catch(e){return defaultDate()}}else{try{v=new Date(v)}catch(e){return defaultDate()}}}if(v instanceof Date){return v}else{return origin}}
var nonDigits=/[^\d]+/;var nonDisplay=/[^\d_]+/;var blankChar="_";var map={y:0,M:1,d:2,H:3,m:4,s:5,S:6};export function padl(str,total,char){if(char===void 0)char="0";var v=str==null?"":""+str;for(var i=v.length;i<total;i++){v=char+v}return v}export function padr(str,total,char){if(char===void 0)char="0";var v=str==null?"":""+str;for(var i=v.length;i<total;i++){v+=char}return v}export var defaults={mask:"yyyy-MM-dd",time:[0,0,0,0],date:function date(){var now=new Date;var tm=defaults.time;return new Date(now.getFullYear(),now.getMonth(),now.getDate(),tm[0],tm[1],tm[2],tm[3])},parseDate:function parseDate(dt){return new Date(dt)}};function timeArray(value){if(value==="start"){value=[0,0,0,0]}else if(value==="end"){value=[23,59,59,999]}else if(value==="mid"){value=[12,0,0,0]}else if(value==="now"){value=function(){var dt=new Date;return[dt.getHours(),dt.getMinutes(),dt.getSeconds(),dt.getMilliseconds()]}}else if(typeof value==="string"){var dt=new Date("2000-05-13T"+value+"Z");if(+dt){value=[dt.getUTCHours(),dt.getUTCMinutes(),dt.getUTCSeconds(),dt.getUTCMilliseconds()]}}if(!Array.isArray(value)&&typeof value!=="function"&&!Array.isArray(value())){value=[0,0,0,0]}return value}export default function plugin(options){if(options===void 0)options={};var defaultMask=options.mask||defaults.mask;var defaultTime=timeArray(options.time||defaults.time);var defaultDate=options.date||defaults.date;if(typeof defaultDate!=="function"){var dt=defaultDate;defaultDate=function(){return dt}}return function(ref){var instance=ref.instance;instance.decorators[options.name||"date"]=function(node,optsin,other){if(optsin===void 0)optsin={};var opts=Object.assign({},options,typeof optsin==="string"?{value:optsin}:optsin,typeof other==="string"?{mask:other}:other);if(!opts.parseDate){opts.parseDate=options.parseDate||defaults.parseDate}var defdt=opts.date||defaultDate;var deftm=timeArray(opts.time||defaultTime);if(typeof defdt!=="function"){var dt=defdt;defdt=function(){return dt}}var ctx=this.getContext(node);var mask=opts.mask||defaultMask;var handles={observers:[],listeners:[]};var lastBackspace=false;if(node.tagName!=="INPUT"){console.warn("Attempted to add a date decorator a "+node.tagName);return noop}if(!mask){return noop}var groups=[];var match,last=0;while(match=dateRE.exec(mask)){var group={mask:match[0],type:match[0][0],length:match[0].length,start:match.index,end:match.index+match[0].length,chunk:groups.length,prefix:mask.substring(last,match.index),groups:groups,value:null,display:padr("",match[0].length,blankChar)};last=group.end;groups.push(group)}groups.suffix=mask.substring(groups[groups.length-1].end);groups.last=null;if(groups.slice(1).find(function(g){return!g.prefix})){console.warn("Attempted to add a date decorator missing interstitial between fields '"+mask+"'");return noop}if(opts.min>opts.max){delete opts.min}if(typeof opts.value==="string"){handles.observers.push(ctx.observe(opts.value,function(v){if(!v&&opts.null===false){v=defdt()}groups.value=v;receiveValue(groups,v,opts.parseDate);groups.last=v;updateDisplay(groups,node);if(opts.min&&v<opts.min||opts.max&&v>opts.max){groups.last=null;setTimeout(sendValue)}},{defer:true}))}if(typeof opts.display==="string"){handles.observers.push(ctx.observe(opts.display,function(v){node.value=v||"";readInput(groups,node,mask);updateValues(groups);applyValues(groups,sendValue,true,defdt,deftm);updateDisplay(groups,node)},{defer:true}))}if(!opts.display&&!opts.value){if(opts.date||opts.null===false){groups.value=getDateValue(opts.date||defdt(),opts.parseDate)}updateDisplay(groups,node)}function sendValue(focused){if(groups.value===null&&groups.last===null||+groups.value===+groups.last){return 1}if(focused&&opts.lazy!==false){return}if(opts.null===false&&groups.value===null){return receiveValue(groups,groups.last,opts.parseDate)&&1||1}if(opts.min&&groups.value<opts.min){receiveValue(groups,opts.min,opts.parseDate);updateDisplay(groups,node)}else if(opts.max&&groups.value>opts.max){receiveValue(groups,opts.max,opts.parseDate);updateDisplay(groups,node)}groups.last=groups.value;if(typeof opts.value==="string"){handles.observers.forEach(function(h){return h.silence()});ctx.set(opts.value,groups.value);handles.observers.forEach(function(h){return h.resume()})}if(typeof opts.display==="string"){handles.observers.forEach(function(h){return h.silence()});ctx.set(opts.display,node.value);handles.observers.forEach(function(h){return h.resume()})}}var selectGroup=function(group,pos){if(pos===undefined){pos=node.selectionStart}if(group&&group.target){group=undefined}if(!group){if(pos===node.value.length&&node.selectionEnd===node.value.length){group=groups[0]}else{group=groupForPos(groups,pos)}}if(lastBackspace){lastBackspace=false;if(pos<group.start){group=groups[groups.indexOf(group)-1]}}document.activeElement===node&&node.setSelectionRange(group.start,group.end)};handles.listeners.push(ctx.listen("input",function(){var pos=node.selectionStart;var start=node.value;readInput(groups,node,mask);var active=groupForPos(groups,pos);var accepted=updateValues(groups,active,pos);applyValues(groups,sendValue,true,defdt,deftm);updateDisplay(groups,node);if(active&&(start.length>=mask.length&&pos===active.end||accepted)&&active!==groups[groups.length-1]){var next=groups[groups.indexOf(active)+1];selectGroup(next,pos)}else{node.setSelectionRange(pos,pos)}}));handles.listeners.push(ctx.listen("blur",function(){lastBackspace=false;if(sendValue(false)){receiveValue(groups,groups.value,opts.parseDate)}if(groups.value===null){groups.forEach(function(g){return g.value=null})}groups.forEach(function(g){return g.display=displayForGroup(g)});updateDisplay(groups,node)}));handles.listeners.push(ctx.listen("click",selectGroup));handles.listeners.push(ctx.listen("focus",selectGroup));handles.listeners.push(ctx.listen("keydown",function(ev){lastBackspace=false;switch(ev.key){case"Enter":case"Tab":{var g=groupForPos(groups,node.selectionStart);var idx=groups.indexOf(g);if(updateValues(groups,g,node.selectionStart,true)){updateDisplay(groups,node);applyValues(groups,sendValue,ev.shiftKey&&idx>0||!ev.shiftKey&&idx+1<groups.length,defdt,deftm)}if(ev.shiftKey&&idx>0){selectGroup(groups[idx-1]);ev.preventDefault();ev.stopPropagation()}else if(!ev.shiftKey&&idx+1<groups.length){selectGroup(groups[idx+1]);ev.preventDefault();ev.stopPropagation()}break}case"Backspace":lastBackspace=true;break;case"ArrowUp":case"ArrowDown":{var ref=[node.selectionStart,node.selectionEnd];var s=ref[0];var e=ref[1];var g$1=groupForPos(groups,s);if(g$1.value===null){g$1.value=1}bumpValue(g$1,ev.key==="ArrowDown");g$1.input=g$1.display=displayForGroup(g$1);applyValues(groups,sendValue,true,defdt,deftm);updateDisplay(groups,node);ev.preventDefault();ev.stopPropagation();node.setSelectionRange(s,e);break}}}));return{teardown:function teardown(){handles.observers.forEach(function(o){return o.cancel()});handles.listeners.forEach(function(o){return o.cancel()})}}}}}function readInput(groups,node,mask){var val=node.value;var pos=node.selectionStart;var active=groupForPos(groups,pos);var gidx=0;var group=groups[gidx];var next=groups[gidx+1];groups.forEach(function(g){return g.input=""});for(var i=0;i<val.length;i++){if(next&&val[i]===next.prefix[0]&&(active!==group||group.input.length>=group.length||val.length-i<mask.length-group.end+(group.length-group.input.length))){if(next.prefix.length>1){i+=next.prefix.length-1}if(val[i+1]===next.prefix[0]){i+=next.prefix.length}group=groups[++gidx];next=groups[gidx+1]}else{group.input+=val[i]}}}function updateValues(groups,target,pos,leave){if(pos===void 0)pos=0;if(leave===void 0)leave=false;var accepted=false;for(var i=0;i<groups.length;i++){var g=groups[i];var v=(g.input||"").replace(nonDigits,"");var hasSep=groups[i+1]&&groups[i+1].prefix&&nonDisplay.test(g.input);if(v.length>g.length&&g===target){var drop=v.length-target.length;v=v.substr(0,pos-target.start)+v.substr(pos-target.start+drop)}else{v=v.substr(0,g.length)}g.input=v;if(g.type==="y"&&v.length===0&&(hasSep||leave)){g.value=(new Date).getFullYear();g.input=g.display=padl(g.value,g.length);accepted=true}else if(g.type==="m"&&v.length===0&&(hasSep||leave)){g.value=0;g.input=g.display=padl(g.value,g.length);accepted=true}else if(g.type==="d"&&v.length!==g.length&&leave){g.value=+v;g.display=displayForGroup(g)}else if(v===""){g.value=null;g.display=displayForGroup(g)}else if(g!==target){g.value=+v;if(g.type==="M"){g.value--}g.display=displayForGroup(g)}else{if(g.type==="M"&&+v>1||g.type==="d"&&+v>3||g.type==="H"&&+v>2||(g.type==="m"||g.type==="s")&&+v>6){g.value=+v;if(g.type==="M"){g.value--}g.display=padl(v,g.length);accepted=true}else if(g.type==="y"&&v.length===2&&(hasSep||leave)){var n=(new Date).getFullYear();var cen=Math.floor(n/100)*100;var val=Math.abs(n-(cen+ +v))<20?cen+ +v:cen-100+ +v;g.value=val;g.input=g.display=padl(val,g.length);accepted=true}else{g.display=padr(v,g.length,blankChar);g.value=+v;if(g.type==="M"){g.value--}}}}return accepted}function receiveValue(groups,v,parseDate){v=groups.value=v&&getDateValue(v,parseDate);var parts=v?[v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds()]:[null,null,null,null,null,null,null];groups.forEach(function(g){g.value=parts[map[g.type]];g.input=g.display=displayForGroup(g)})}function applyValues(groups,send,focused,defaultDate,defaultTime){var v=groups.value||defaultDate();var parts=[v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds()];if(!groups.find(function(p){return p.type==="m"||p.type==="s"||p.type==="h"||p.type==="S"})){if(typeof defaultTime==="function"){defaultTime=defaultTime()}for(var i=0;i<4;i++){parts[i+3]=defaultTime[i]}}groups.forEach(function(g){var vv=g.value;if(vv!==null&&g.type==="M"){if(vv<0){vv=0}else if(vv>11){vv=11}}else if(vv!==null&&(g.type==="m"||g.type==="s")){if(vv<0){vv=0}else if(vv>59){vv=59}}else if(vv!==null&&g.type==="H"){if(vv<0){vv=0}else if(vv>23){vv=23}}else if(vv!==null&&g.type==="h"){if(vv<1){vv=1}else if(vv>12){vv=12}}if(vv!==g.value){g.value=vv;g.display=displayForGroup(g)}parts[map[g.type]]=g.value});if(parts[0]!==null&&parts[1]!==null&&parts[2]!==null){var d=groups.find(function(g){return g.type==="d"});if(d){if(parts[2]<1){d.value=parts[2]=1;d.display=displayForGroup(d)}else{var last=lastDay(new Date(parts[0],parts[1],1));if(parts[2]>last){d.value=parts[2]=last;d.display=d.input=displayForGroup(d)}}}}if(groups.find(function(g){return g.value===null})||parts[0]===0||parts[1]>11||parts[1]<0||parts[2]===0){groups.value=null}else{parts.unshift(null);groups.value=new(Date.bind.apply(Date,parts))}send(focused)}function updateDisplay(groups,node){node.value=groups.reduce(function(a,c){return a+c.prefix+c.display},"")+groups.suffix}function groupForPos(groups,pos){return groups.find(function(g){return pos>=g.start&&pos<=g.end})}function displayForGroup(group){if(group.value===null){return padl("",group.length,blankChar)}switch(group.type){case"y":if(!group.value){return padl("",group.length,blankChar)}return group.length<=2?(""+group.value).substr(2,2):""+padl(group.value,group.length);case"M":if(!~group.value){return padl("",group.length,blankChar)}if(group.length===1){return""+(group.value+1)}else if(group.length===2){return(group.value<9?"0":"")+(group.value+1)}else if(group.length===3){return months[group.value].substr(0,3)}else{return months[group.value]}case"d":if(!group.value){return padl("",group.length,blankChar)}if(group.length===1){return""+group.value}else if(group.length===2){return(group.value<=9?"0":"")+group.value}else if(group.length===3){return days[group.groups.value.getDay()].substr(0,3)}else{return days[group.groups.value.getDay()]}case"H":case"h":case"m":case"s":if(group.length===1){return""+group.value}else{return padl(group.value,group.length)}case"S":if(group.length===1){return""+group.value}else{return padl(group.value,3)}}}var dateRE=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g;var months=["January","February","March","April","May","June","July","August","September","October","November","December"];var days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var noop={teardown:function teardown(){}};function bumpValue(group,down){switch(group.type){case"y":group.value=group.value+(down?-1:1);break;case"M":group.value=down?group.value<1?11:group.value-1:group.value>10?0:group.value+1;break;case"d":{var groups=group.groups;var last=lastDay(new Date((groups.find(function(g){return g.type==="y"})||{value:1}).value,(groups.find(function(g){return g.type==="M"})||{value:1}).value),1);if(down){group.value=group.value<2?last:group.value-1}else{group.value=group.value+1>last?1:group.value+1}break}case"H":group.value=down?group.value<1?23:group.value-1:group.value>22?0:group.value+1;break;case"h":group.value=down?group.value<1?12:group.value-1:group.value>11?1:group.value+1;break;case"m":case"s":group.value=down?group.value<1?59:group.value-1:group.value>58?0:group.value+1;break;case"S":group.value=down?group.value<1?999:group.value-1:group.value>998?0:group.value+1;break}}function lastDay(date){return new Date(new Date(date.getFullYear(),date.getMonth()+1,1)-864e5).getDate()}var origin=new Date("0000-01-01T00:00:00");function getDateValue(thing,parseDate){var v=thing;if(typeof v==="function"){v=thing()}if(typeof v==="string"){if(typeof parseDate==="function"){try{v=parseDate(v)}catch(e){return defaultDate()}}else{try{v=new Date(v)}catch(e){return defaultDate()}}}if(v instanceof Date){return v}else{return origin}}

@@ -10,3 +10,3 @@ import globalRegister from './globalRegister';

return ("\n label.field, .field-manual {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid " + (primary.bc || '#ccc') + ";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: " + (primary.radius || '0.2em') + ";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n color: " + (primary.fg || '#222') + ";\n }\n\n label.field.focus {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n\n label.field.textarea.focus {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input,\n label.field select,\n label.field textarea,\n .field-manual .field-body\n {\n display: block;\n border-width: " + (boxy ? '0.0625em' : '0 0 0.0625em 0') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n box-sizing: border-box;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n color: " + (primary.fg || '#222') + ";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";") : '') + "\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input" + (boxy ? '' : ':disabled') + ",\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding: 0 0.75em;\n }\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: " + (disabled.bg || '#f4f4f4') + ";\n color: " + (disabled.fg || '#444') + ";\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n " + (!boxy ? ("label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n 0.0625em -0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em -0.0625em " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";\n }") : '') + "\n\n /**** CHECK BOXES ****/\n\n label.field.check, label.field.radio {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -0.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\n background-color: " + (primary.bc || '#ccc') + ";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: " + (primary.fg || '#222') + ";\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: '';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"" + ((primary.bg || '#fff').replace(/#/g, '%23')) + "\" d=\"m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z\" /></svg>') " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><circle fill=\"" + ((primary.bg || '#fff').replace(/#/g, '%23')) + "\" cx=\"8\" cy=\"8\" r=\"5\" /></svg>') " + (primary.fga || '#07e') + ";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: " + (disabled.fg || '#444') + ";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: " + (disabled.bc || '#ccc') + ";\n background-color: " + (disabled.bg || '#f4f4f4') + ";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: " + (disabled.bc || '#ccc') + ";\n }\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 1.125em;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field textarea {\n border: none;" + (boxy ? "\n padding: 0;" : '') + "\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0 0.0625em 0 0 " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: " + (primary.fg || '#222') + ";\n text-align: " + (boxy ? 'center' : 'left') + ";\n padding: 0.5em " + (boxy ? '0.5em' : '0') + ";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0.0625em;") : ("\n border-bottom-color: " + (primary.bc || '#ccc') + ";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")) + "\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: " + (boxy ? '1.7' : '1.958') + "em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: " + (boxy ? '0.15em' : '0') + ";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n " + (boxy ? ("height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid " + (primary.bg || '#fff') + ";\n margin-left: 0;") :
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n ");
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n .just-the.field-tip,\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1em;\n font-family: monospace;\n text-align: center;\n margin-top: -0.2em;\n cursor: help;\n }\n .just-the.field-tip.field-tip-error {\n background-color: " + (primary.error || '#ca3c3c') + ";\n }\n .just-the.field-tip.field-tip-warn {\n background-color: " + (primary.warn || '#f79e0b') + ";\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n ");
// TODO: other themes

@@ -267,3 +267,3 @@ }

],
f: '?'
f: '?',
}); }

@@ -286,2 +286,26 @@ var inline = attrs.find(function (a) { return a.n === 'inline'; });

var tip = Ractive.macro(function (handle) {
handle.aliasLocal('__rtip');
var body = [{
t: 7, e: 'span', m: (handle.template.m || []).concat([
{ t: 13, n: 'class', f: ["just-the field-tip", { t: 4, f: [' field-tip-error'], x: { r: ['__rtip.attrs.type'], s: '_0==="error"' } }, { t: 4, f: [' field-tip-warn'], x: { r: ['__rtip.attrs.type'], s: '_0==="warn"' } }] },
{ t: 13, n: 'title', f: Array.isArray(handle.template.f) || typeof handle.template.f === 'string' ? handle.template.f : [handle.template.f] },
{ t: 70, n: ['click'], f: { r: [], s: '[false]' } }
]),
f: [{ t: 4, f: [{ t: 3, r: '__rtip.attrs.sign' }], n: 50, r: '__rtip.attrs.sign' }, { t: 4, f: ['!'], n: 50, x: { r: ['__rtip.attrs.type'], s: '_0==="error"||_0==="warn"' }, l: 1 }, { t: 4, f: ['?'], n: 51, l: 1 }],
}];
handle.set('__rtip.attrs', handle.attributes);
handle.setTemplate(body);
return {
update: function update() {
handle.set('__rtip.attrs', handle.attributes);
}
};
}, {
attributes: ['sign', 'type'],
});
export function autofocus(node, opts) {

@@ -319,2 +343,3 @@ if (typeof node.focus === 'function' && !node.disabled) {

instance.partials[opts.name || 'field'] = macro;
instance.partials[opts.tipName || 'tip'] = tip;
instance.decorators[opts.name || 'field'] = field;

@@ -327,2 +352,3 @@ instance.decorators[opts.autofocusName || 'autofocus'] = autofocus;

globalRegister('field', 'partials', macro);
globalRegister('tip', 'partials', tip);
globalRegister('autofocus', 'decorators', autofocus);

@@ -329,0 +355,0 @@

@@ -1,1 +0,1 @@

import globalRegister from"./globalRegister";import Ractive from"ractive";export function style(data){var primary=Object.assign({},data("raui.primary"),data("raui.form.primary"));var active=Object.assign({},data("raui.primary.active"),data("raui.form.primary.active"));var disabled=Object.assign({},data("raui.primary.disabled"),data("raui.form.primary.disabled"));var boxy=data("raui.form.boxy");return"\n label.field, .field-manual {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(primary.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(primary.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n color: "+(primary.fg||"#222")+";\n }\n\n label.field.focus {\n color: "+(active.fg||primary.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(active.fg||primary.fga||"#07e")+";\n "+(!boxy?"box-shadow: 0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n 0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+";":"")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea,\n .field-manual .field-body\n {\n display: block;\n border-width: "+(boxy?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n color: "+(primary.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(boxy?"":":disabled")+",\n label.field select"+(boxy?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(boxy?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(disabled.bg||"#f4f4f4")+";\n color: "+(disabled.fg||"#444")+";\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(!boxy?"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(primary.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(primary.bc||"#ccc")+",\n -0.0625em 0.0625em "+(primary.bc||"#ccc")+",\n 0.0625em -0.0625em "+(primary.bc||"#ccc")+",\n -0.0625em -0.0625em "+(primary.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n 0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+";\n }":"")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check, label.field.radio {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -0.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\n background-color: "+(primary.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(primary.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(primary.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(primary.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(disabled.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(disabled.bc||"#ccc")+";\n background-color: "+(disabled.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(disabled.bc||"#ccc")+";\n }\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 1.125em;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(primary.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(boxy?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(active.fg||primary.fga||"#07e")+";\n "+(!boxy?"box-shadow: 0 0.0625em 0 0 "+(active.fg||primary.fga||"#07e")+";":"")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(active.fg||primary.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(primary.fg||"#222")+";\n text-align: "+(boxy?"center":"left")+";\n padding: 0.5em "+(boxy?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(primary.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(boxy?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(boxy?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(boxy?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(primary.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(boxy?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(primary.radius||"0.2em")+" "+(primary.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(primary.radius||"0.2em")+" 0 0 "+(primary.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(boxy?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(primary.fga||"#07e")+";\n color: "+(primary.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "}function noop(){}function focused(ev){if(!~this.className.indexOf("focus")){this.className+=" focus"}}function blurred(ev){this.className=this.className.replace(/\bfocus\b/g,"").trim()}export function field(node){var ctx=this.getContext(node);var isField,isCheck,isRadio,isArea,isSelect,isFile,isButton,isPlain,isInput;var change,attrs,desc,last;function invalidate(){var val=setup().split(/\s+/).filter(function(c){return!!c});isField=!!~val.indexOf("field");if(!isField){val.push("field");isField=true}isCheck=node.querySelector("input[type=checkbox]");if(isCheck&&!~val.indexOf("check")){val.push("check")}isRadio=node.querySelector("input[type=radio]");if(isRadio&&!~val.indexOf("radio")){val.push("radio")}var checkable=isCheck||isRadio;if(checkable&&checkable.checked&&!~val.indexOf("checked")){val.push("checked")}if(checkable&&checkable.disabled&&!~val.indexOf("disabled")){val.push("disabled")}if(!checkable&&change){change.cancel();change=0;if(attrs){attrs.disconnect();attrs=0}delete checkable._form_callback;if(last){delete last.checked;desc=last=undefined}}else if(checkable){checkable._form_callback=function(ev,init){if(init===void 0)init=true;if(init&&checkable.type==="radio"&&checkable.name){var list=[];list.push.apply(list,document.querySelectorAll("input[type=radio][name="+checkable.name+"]"));list=list.filter(function(i){return i!==checkable});list.forEach(function(l){return l._form_callback&&l._form_callback(ev,false)})}var checked=checkable.checked;if(checked&&!~node.className.indexOf("checked")){node.className+=" checked"}else if(!checked&&~node.className.indexOf("checked")){node.className=node.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim()}};if(MutationObserver){attrs=new MutationObserver(function(){var val;val=checkable.disabled;if(val&&!~node.className.indexOf("disabled")){node.className+=" disabled"}else if(!val&&~node.className.indexOf("disabled")){node.className=node.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim()}});attrs.observe(checkable,{attributes:true})}change=this.getContext(checkable).listen("change",checkable._form_callback);desc=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(checkable),"checked");if(desc&&desc.configurable){last=checkable;Object.defineProperty(checkable,"checked",{get:desc.get,set:function set(v){desc.set.call(last,v);checkable._form_callback()},enumerable:true,configurable:true})}}isArea=!!node.querySelector("textarea");if(isArea&&!~val.indexOf("textarea")){val.push("textarea")}isSelect=!!node.querySelector("select");if(isSelect&&!~val.indexOf("select")){val.push("select")}isFile=!!node.querySelector("input[type=file]");if(isFile&&!~val.indexOf("file")){val.push("file")}isButton=node.querySelector("button");isButton=!!isButton&&isButton.parentNode===node;if(isButton&&!~val.indexOf("button")){val.push("button")}isPlain=!!node.querySelector("div");if(isPlain&&!~val.indexOf("plain")){val.push("plain")}isInput=!isCheck&&!isRadio&&!isFile&&!!node.querySelector("input");if(isInput&&!~val.indexOf("input")){val.push("input")}node.className=val.join(" ")}function setup(){var cls=node.className;if(!isField){cls=cls.replace(/\bfield\b/g,"").trim()}if(!isCheck){cls=cls.replace(/\bcheck(ed)?\b/g,"").trim()}if(!isRadio){cls=cls.replace(/\bradio\b/g,"").trim()}if(!isArea){cls=cls.replace(/\btextarea\b/g,"").trim()}if(!isSelect){cls=cls.replace(/\bselect\b/g,"").trim()}if(!isFile){cls=cls.replace(/\bfile\b/g,"").trim()}if(!isButton){cls=cls.replace(/\bbutton\b/g,"").trim()}if(!isPlain){cls=cls.replace(/\bplain\b/g,"").trim()}if(!isInput){cls=cls.replace(/\binput\b/g,"").trim()}cls=cls.replace(/ +/g," ");return cls}var focus=ctx.listen("focusin",focused);var blur=ctx.listen("focusout",blurred);invalidate.call(this);var res={update:noop,invalidate:invalidate.bind(this),teardown:function teardown(){ctx.ractive.fire("fieldUnregistered",ctx,node,res);var cls=setup();cls=cls.replace(/\bfocus\b/g,"").trim();focus.cancel();blur.cancel();change&&change.cancel();if(attrs){attrs.disconnect()}if(last){delete last.checked;desc=last=undefined}node.className=cls},setDisabled:function setDisabled(v){var children=node.querySelectorAll("input,button,select,textarea");children.forEach(function(c){return c.disabled=v});this.invalidate()}};ctx.ractive.fire("fieldRegistered",ctx,node,res);return res}field.style=style;function findDeep(els,el){if(!els){return false}for(var i=0;i<els.length;i++){if(els[i].e===el){return true}if(els[i].f&&findDeep(els[i].f,el)){return true}}return false}export var macro=Ractive.macro(function(handle){var body=[];var label=[];var attrs=(handle.template.m||[]).slice();var content=handle.template.f||[];var value=attrs.find(function(a){return a.n==="value"});var type=attrs.find(function(a){return a.n==="type"});var tip=attrs.find(function(a){return a.n==="tip"});var disabled=attrs.find(function(a){return a.n==="disabled"});var maxlength=attrs.find(function(a){return a.n==="maxlength"});if(tip){attrs.splice(attrs.indexOf(tip),1)}if(type&&typeof macro.types[type.f]==="function"){body.push.apply(body,macro.types[type.f](attrs,content,handle))}else if(value){var el={t:7,e:"input",m:[value]};if(disabled){el.m.push(disabled)}if(maxlength){el.m.push(maxlength)}if(findDeep(content,"option")){el.e="select";el.f=content}if(type){el.m.push(type);if(type.f==="checkbox"||type.f==="radio"){var target=attrs.find(function(a){return a.n==="target"});if(target){el.m.push(Object.assign({},target,{n:"name"}))}else{el.m.splice(el.m.indexOf(value),1,Object.assign({},value,{n:"checked"}))}}}el.m=el.m.concat(attrs.filter(function(a){return a.t===73||a.t===73||a.n==="placeholder"}));body.push(el);var btns=content.filter(function(e){return e.e==="button"||findDeep(e.f,"button")});if(btns.length){body.push.apply(body,btns);body=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:body}]}}else{content.forEach(function(e){if(e.e==="label"){if(e.f&&e.f.length){label.push.apply(label,e.f)}}else{body.push(e)}});var els=content.filter(function(e){return e.e});if(els.find(function(e){return e.e==="button"})&&els.length>1){body=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:body}]}}var labelattr=attrs.find(function(a){return a.n==="label"});if(labelattr&&labelattr.f&&labelattr.f.length){label.push.apply(label,Array.isArray(labelattr.f)?labelattr.f:[labelattr.f])}if(tip){body.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(!label.length?" field-solo-tip":""),g:1},{t:13,n:"title",f:tip.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"})}var inline=attrs.find(function(a){return a.n==="inline"});if(label&&!inline){body.unshift.apply(body,label)}else if(!inline){body.unshift(" ")}var outer={t:7,e:"label",m:[{t:71,n:"field"}].concat(attrs.filter(function(a){return a.t!==13&&a.t!==73||a.n!=="value"&&a.n!=="type"&&a.n!=="inline"&&a.n!=="label"&&a.n!=="placeholder"&&a.n!=="target"&&a.n!=="disabled"})),f:body};if(inline){outer.m.push({t:13,n:"class",f:"inline"})}handle.setTemplate([outer])});macro.types={};export function autofocus(node,opts){if(typeof node.focus==="function"&&!node.disabled){if(opts&&opts.immediate){node.focus()}else{setTimeout(function(){return!node.disabled&&node.focus()},(opts||{}).timeout||250)}}return{teardown:noop}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;if(!Ractive.isInstance(instance)){if(opts.includeStyle){if(instance===Ractive){Ractive.addCSS("form-decorator",style)}else{var css=instance.css;instance.css=function(data){var res=typeof css!=="function"?css||"":css(data);return res+style(data)}}}}instance.partials[opts.name||"field"]=macro;instance.decorators[opts.name||"field"]=field;instance.decorators[opts.autofocusName||"autofocus"]=autofocus}}globalRegister("field","decorators",field);globalRegister("field","partials",macro);globalRegister("autofocus","decorators",autofocus);export default plugin;
import globalRegister from"./globalRegister";import Ractive from"ractive";export function style(data){var primary=Object.assign({},data("raui.primary"),data("raui.form.primary"));var active=Object.assign({},data("raui.primary.active"),data("raui.form.primary.active"));var disabled=Object.assign({},data("raui.primary.disabled"),data("raui.form.primary.disabled"));var boxy=data("raui.form.boxy");return"\n label.field, .field-manual {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(primary.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(primary.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n color: "+(primary.fg||"#222")+";\n }\n\n label.field.focus {\n color: "+(active.fg||primary.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(active.fg||primary.fga||"#07e")+";\n "+(!boxy?"box-shadow: 0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n 0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+";":"")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea,\n .field-manual .field-body\n {\n display: block;\n border-width: "+(boxy?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(boxy?primary.bg||"#fff":"transparent")+";\n color: "+(primary.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(boxy?"":":disabled")+",\n label.field select"+(boxy?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(boxy?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(disabled.bg||"#f4f4f4")+";\n color: "+(disabled.fg||"#444")+";\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(!boxy?"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(primary.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(primary.bc||"#ccc")+",\n -0.0625em 0.0625em "+(primary.bc||"#ccc")+",\n 0.0625em -0.0625em "+(primary.bc||"#ccc")+",\n -0.0625em -0.0625em "+(primary.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em 0.0625em "+(active.fg||primary.fga||"#07e")+",\n 0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+",\n -0.0625em -0.0625em "+(active.fg||primary.fga||"#07e")+";\n }":"")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check, label.field.radio {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -0.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\n background-color: "+(primary.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(primary.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(primary.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(primary.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(disabled.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(disabled.bc||"#ccc")+";\n background-color: "+(disabled.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(disabled.bc||"#ccc")+";\n }\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 1.125em;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(primary.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(boxy?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(active.fg||primary.fga||"#07e")+";\n "+(!boxy?"box-shadow: 0 0.0625em 0 0 "+(active.fg||primary.fga||"#07e")+";":"")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(active.fg||primary.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(primary.fg||"#222")+";\n text-align: "+(boxy?"center":"left")+";\n padding: 0.5em "+(boxy?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(boxy?"\n border-radius: "+(primary.radius||"0.2em")+";\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(primary.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(boxy?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(boxy?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(boxy?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(primary.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(boxy?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(primary.radius||"0.2em")+" "+(primary.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(primary.radius||"0.2em")+" 0 0 "+(primary.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(boxy?"15":"1")+"em;\n }\n\n .just-the.field-tip,\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(primary.fga||"#07e")+";\n color: "+(primary.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1em;\n font-family: monospace;\n text-align: center;\n margin-top: -0.2em;\n cursor: help;\n }\n .just-the.field-tip.field-tip-error {\n background-color: "+(primary.error||"#ca3c3c")+";\n }\n .just-the.field-tip.field-tip-warn {\n background-color: "+(primary.warn||"#f79e0b")+";\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "}function noop(){}function focused(ev){if(!~this.className.indexOf("focus")){this.className+=" focus"}}function blurred(ev){this.className=this.className.replace(/\bfocus\b/g,"").trim()}export function field(node){var ctx=this.getContext(node);var isField,isCheck,isRadio,isArea,isSelect,isFile,isButton,isPlain,isInput;var change,attrs,desc,last;function invalidate(){var val=setup().split(/\s+/).filter(function(c){return!!c});isField=!!~val.indexOf("field");if(!isField){val.push("field");isField=true}isCheck=node.querySelector("input[type=checkbox]");if(isCheck&&!~val.indexOf("check")){val.push("check")}isRadio=node.querySelector("input[type=radio]");if(isRadio&&!~val.indexOf("radio")){val.push("radio")}var checkable=isCheck||isRadio;if(checkable&&checkable.checked&&!~val.indexOf("checked")){val.push("checked")}if(checkable&&checkable.disabled&&!~val.indexOf("disabled")){val.push("disabled")}if(!checkable&&change){change.cancel();change=0;if(attrs){attrs.disconnect();attrs=0}delete checkable._form_callback;if(last){delete last.checked;desc=last=undefined}}else if(checkable){checkable._form_callback=function(ev,init){if(init===void 0)init=true;if(init&&checkable.type==="radio"&&checkable.name){var list=[];list.push.apply(list,document.querySelectorAll("input[type=radio][name="+checkable.name+"]"));list=list.filter(function(i){return i!==checkable});list.forEach(function(l){return l._form_callback&&l._form_callback(ev,false)})}var checked=checkable.checked;if(checked&&!~node.className.indexOf("checked")){node.className+=" checked"}else if(!checked&&~node.className.indexOf("checked")){node.className=node.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim()}};if(MutationObserver){attrs=new MutationObserver(function(){var val;val=checkable.disabled;if(val&&!~node.className.indexOf("disabled")){node.className+=" disabled"}else if(!val&&~node.className.indexOf("disabled")){node.className=node.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim()}});attrs.observe(checkable,{attributes:true})}change=this.getContext(checkable).listen("change",checkable._form_callback);desc=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(checkable),"checked");if(desc&&desc.configurable){last=checkable;Object.defineProperty(checkable,"checked",{get:desc.get,set:function set(v){desc.set.call(last,v);checkable._form_callback()},enumerable:true,configurable:true})}}isArea=!!node.querySelector("textarea");if(isArea&&!~val.indexOf("textarea")){val.push("textarea")}isSelect=!!node.querySelector("select");if(isSelect&&!~val.indexOf("select")){val.push("select")}isFile=!!node.querySelector("input[type=file]");if(isFile&&!~val.indexOf("file")){val.push("file")}isButton=node.querySelector("button");isButton=!!isButton&&isButton.parentNode===node;if(isButton&&!~val.indexOf("button")){val.push("button")}isPlain=!!node.querySelector("div");if(isPlain&&!~val.indexOf("plain")){val.push("plain")}isInput=!isCheck&&!isRadio&&!isFile&&!!node.querySelector("input");if(isInput&&!~val.indexOf("input")){val.push("input")}node.className=val.join(" ")}function setup(){var cls=node.className;if(!isField){cls=cls.replace(/\bfield\b/g,"").trim()}if(!isCheck){cls=cls.replace(/\bcheck(ed)?\b/g,"").trim()}if(!isRadio){cls=cls.replace(/\bradio\b/g,"").trim()}if(!isArea){cls=cls.replace(/\btextarea\b/g,"").trim()}if(!isSelect){cls=cls.replace(/\bselect\b/g,"").trim()}if(!isFile){cls=cls.replace(/\bfile\b/g,"").trim()}if(!isButton){cls=cls.replace(/\bbutton\b/g,"").trim()}if(!isPlain){cls=cls.replace(/\bplain\b/g,"").trim()}if(!isInput){cls=cls.replace(/\binput\b/g,"").trim()}cls=cls.replace(/ +/g," ");return cls}var focus=ctx.listen("focusin",focused);var blur=ctx.listen("focusout",blurred);invalidate.call(this);var res={update:noop,invalidate:invalidate.bind(this),teardown:function teardown(){ctx.ractive.fire("fieldUnregistered",ctx,node,res);var cls=setup();cls=cls.replace(/\bfocus\b/g,"").trim();focus.cancel();blur.cancel();change&&change.cancel();if(attrs){attrs.disconnect()}if(last){delete last.checked;desc=last=undefined}node.className=cls},setDisabled:function setDisabled(v){var children=node.querySelectorAll("input,button,select,textarea");children.forEach(function(c){return c.disabled=v});this.invalidate()}};ctx.ractive.fire("fieldRegistered",ctx,node,res);return res}field.style=style;function findDeep(els,el){if(!els){return false}for(var i=0;i<els.length;i++){if(els[i].e===el){return true}if(els[i].f&&findDeep(els[i].f,el)){return true}}return false}export var macro=Ractive.macro(function(handle){var body=[];var label=[];var attrs=(handle.template.m||[]).slice();var content=handle.template.f||[];var value=attrs.find(function(a){return a.n==="value"});var type=attrs.find(function(a){return a.n==="type"});var tip=attrs.find(function(a){return a.n==="tip"});var disabled=attrs.find(function(a){return a.n==="disabled"});var maxlength=attrs.find(function(a){return a.n==="maxlength"});if(tip){attrs.splice(attrs.indexOf(tip),1)}if(type&&typeof macro.types[type.f]==="function"){body.push.apply(body,macro.types[type.f](attrs,content,handle))}else if(value){var el={t:7,e:"input",m:[value]};if(disabled){el.m.push(disabled)}if(maxlength){el.m.push(maxlength)}if(findDeep(content,"option")){el.e="select";el.f=content}if(type){el.m.push(type);if(type.f==="checkbox"||type.f==="radio"){var target=attrs.find(function(a){return a.n==="target"});if(target){el.m.push(Object.assign({},target,{n:"name"}))}else{el.m.splice(el.m.indexOf(value),1,Object.assign({},value,{n:"checked"}))}}}el.m=el.m.concat(attrs.filter(function(a){return a.t===73||a.t===73||a.n==="placeholder"}));body.push(el);var btns=content.filter(function(e){return e.e==="button"||findDeep(e.f,"button")});if(btns.length){body.push.apply(body,btns);body=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:body}]}}else{content.forEach(function(e){if(e.e==="label"){if(e.f&&e.f.length){label.push.apply(label,e.f)}}else{body.push(e)}});var els=content.filter(function(e){return e.e});if(els.find(function(e){return e.e==="button"})&&els.length>1){body=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:body}]}}var labelattr=attrs.find(function(a){return a.n==="label"});if(labelattr&&labelattr.f&&labelattr.f.length){label.push.apply(label,Array.isArray(labelattr.f)?labelattr.f:[labelattr.f])}if(tip){body.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(!label.length?" field-solo-tip":""),g:1},{t:13,n:"title",f:tip.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"})}var inline=attrs.find(function(a){return a.n==="inline"});if(label&&!inline){body.unshift.apply(body,label)}else if(!inline){body.unshift(" ")}var outer={t:7,e:"label",m:[{t:71,n:"field"}].concat(attrs.filter(function(a){return a.t!==13&&a.t!==73||a.n!=="value"&&a.n!=="type"&&a.n!=="inline"&&a.n!=="label"&&a.n!=="placeholder"&&a.n!=="target"&&a.n!=="disabled"})),f:body};if(inline){outer.m.push({t:13,n:"class",f:"inline"})}handle.setTemplate([outer])});macro.types={};var tip=Ractive.macro(function(handle){handle.aliasLocal("__rtip");var body=[{t:7,e:"span",m:(handle.template.m||[]).concat([{t:13,n:"class",f:["just-the field-tip",{t:4,f:[" field-tip-error"],x:{r:["__rtip.attrs.type"],s:'_0==="error"'}},{t:4,f:[" field-tip-warn"],x:{r:["__rtip.attrs.type"],s:'_0==="warn"'}}]},{t:13,n:"title",f:Array.isArray(handle.template.f)||typeof handle.template.f==="string"?handle.template.f:[handle.template.f]},{t:70,n:["click"],f:{r:[],s:"[false]"}}]),f:[{t:4,f:[{t:3,r:"__rtip.attrs.sign"}],n:50,r:"__rtip.attrs.sign"},{t:4,f:["!"],n:50,x:{r:["__rtip.attrs.type"],s:'_0==="error"||_0==="warn"'},l:1},{t:4,f:["?"],n:51,l:1}]}];handle.set("__rtip.attrs",handle.attributes);handle.setTemplate(body);return{update:function update(){handle.set("__rtip.attrs",handle.attributes)}}},{attributes:["sign","type"]});export function autofocus(node,opts){if(typeof node.focus==="function"&&!node.disabled){if(opts&&opts.immediate){node.focus()}else{setTimeout(function(){return!node.disabled&&node.focus()},(opts||{}).timeout||250)}}return{teardown:noop}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;if(!Ractive.isInstance(instance)){if(opts.includeStyle){if(instance===Ractive){Ractive.addCSS("form-decorator",style)}else{var css=instance.css;instance.css=function(data){var res=typeof css!=="function"?css||"":css(data);return res+style(data)}}}}instance.partials[opts.name||"field"]=macro;instance.partials[opts.tipName||"tip"]=tip;instance.decorators[opts.name||"field"]=field;instance.decorators[opts.autofocusName||"autofocus"]=autofocus}}globalRegister("field","decorators",field);globalRegister("field","partials",macro);globalRegister("tip","partials",tip);globalRegister("autofocus","decorators",autofocus);export default plugin;

@@ -82,2 +82,11 @@ import Ractive from 'ractive';

Split.prototype.size = function size (idx, size$1) {
if (this.get(("splits." + idx))) {
var sets = {};
sets[("splits." + idx + ".lastSet")] = sets[("splits." + idx + ".curSize")] = sets[("splits." + idx + ".size")] = size$1;
this.set(sets);
this._adjustSizes();
}
};
return Split;

@@ -84,0 +93,0 @@ }(Ractive));

@@ -1,1 +0,1 @@

import Ractive from"ractive";import globalRegister from"./globalRegister";export var Split=function(Ractive){function Split(opts){Ractive.call(this,opts)}if(Ractive)Split.__proto__=Ractive;Split.prototype=Object.create(Ractive&&Ractive.prototype);Split.prototype.constructor=Split;Split.prototype._adjustSizes=function _adjustSizes(){var this$1=this;this._sizing=true;var splits=this.get("splits");var count=0;var used=0;splits.forEach(function(s){var size=s.sizePath?+this$1.get(s.sizePath):s.size;if(s.curSize===undefined){if(s.min){s.curSize=0;s.lastSize=Math.floor(100/splits.length)}else{s.curSize=size;used+=size;count++}}else if(s.min&&s.curSize){s.lastSize=s.curSize;s.curSize=0}else if(!s.min&&!s.curSize&&s.lastSize){used+=s.lastSize;s.curSize=s.lastSize;s.lastSize=false}else if(size&&!s.min&&s.lastSet&&s.lastSet!==size){s.curSize=size;s.lastSize=false;used+=size}else if(s.curSize){used+=s.curSize;count++}else if(!s.curSize&&!s.min){s.curSize=.1;count++}});var offset=(100-used)/(count||1);var sets={};splits.forEach(function(s,i){setTimeout(function(){var sizing=this$1._sizing;this$1._sizing=true;this$1.set(s.sizePath?s.sizePath:"splits."+i+".size",s.curSize);this$1._sizing=sizing});sets["splits."+i+".curSize"]=s.lastSize===false||s.min?s.curSize:s.curSize+offset;sets["splits."+i+".lastSet"]=sets["splits."+i+".curSize"];if(!s.lastSize){s.lastSize=null}});this.set(sets);setTimeout(function(){return this$1.fire("resize")},320);this._sizing=false};Split.prototype.maximize=function maximize(idx){if(this.get("splits."+idx+".min")){this.toggle("splits."+idx+".min")}else{this.toggle("splits."+(idx+1)+".min")}this._adjustSizes()};Split.prototype.minimize=function minimize(idx){if(this.get("splits."+(idx+1)+".min")){this.toggle("splits."+(idx+1)+".min")}else{this.toggle("splits."+idx+".min")}this._adjustSizes()};return Split}(Ractive);Ractive.extendWith(Split,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit",g:1},{n:"class-rsplit-vertical",t:13,f:[{t:2,r:"vertical"}]},{n:"class-rsplit-horizontal",t:13,f:[{t:2,x:{r:["vertical"],s:"!_0"}}]},{n:"class-rsplit-draggable",t:13,f:[{t:2,r:"draggable"}]},{t:16,r:"extra-attributes"},{n:"class-rsplit-flex",t:13,f:[{t:2,r:"flex"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-split",g:1},{t:4,f:[{n:"style-transition",f:"width 0.3s ease-in-out, height 0.3s ease-in-out",t:13}],n:51,r:"~/dragging"},{t:4,f:[{n:"style-width",f:["calc(",{t:2,r:".curSize"},"% - ",{t:2,x:{r:["@style.split.handle.width","@last"],s:"_1*(_0||14)/(_1+1)"}},"px)"],t:13}],n:50,r:"~/vertical"},{t:4,f:[{n:"style-height",f:["calc(",{t:2,r:".curSize"},"% - ",{t:2,x:{r:["@style.split.handle.width","@last"],s:"_1*(_0||14)/(_1+1)"}},"px)"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:".attrs"}],n:50,r:".attrs"}],f:[{t:16,r:".content"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-block",g:1}]}],n:50,x:{r:["~/draggable","~/dragging"],s:"_0&&_1"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep",g:1},{t:4,f:[{n:"sizeHandle",t:71,f:{r:["~/vertical","@index"],s:"[_0,_1]"}}],n:50,x:{r:[".",".draggable","~/draggable"],s:'"draggable" in _0?_1:_2'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-max",g:1},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0.maximize(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-max-btn",g:1}]}]}],n:50,x:{r:[".",".maximizable","~/maximizable",".min","@index","../"],s:'"maximizable" in _0?_1:_2&&(_3||!_5[_4+1].min)'}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-min",g:1},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0.minimize(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-min-btn",g:1}]}]}],n:50,x:{r:[".",".minimizable","~/minimizable",".min"],s:'"minimizable" in _0?_1:_2&&!_3'}}]}],n:50,x:{r:["@index","@last"],s:"_0!==_1"}}],n:52,r:"splits"}]}],e:{"!_0":function(_0){return!_0},"_1*(_0||14)/(_1+1)":function(_0,_1){return _1*(_0||14)/(_1+1)},"_0&&_1":function(_0,_1){return _0&&_1},"[_0,_1]":function(_0,_1){return[_0,_1]},'"draggable" in _0?_1:_2':function(_0,_1,_2){return"draggable"in _0?_1:_2},"[_0.maximize(_1)]":function(_0,_1){return[_0.maximize(_1)]},'"maximizable" in _0?_1:_2&&(_3||!_5[_4+1].min)':function(_0,_1,_2,_3,_4,_5){return"maximizable"in _0?_1:_2&&(_3||!_5[_4+1].min)},"[_0.minimize(_1)]":function(_0,_1){return[_0.minimize(_1)]},'"minimizable" in _0?_1:_2&&!_3':function(_0,_1,_2,_3){return"minimizable"in _0?_1:_2&&!_3},"_0!==_1":function(_0,_1){return _0!==_1}}},css:function(data){return[" .rsplit { position: absolute; width: 100%; height: 100%; flex-grow: 1; display: flex; } .rsplit.rsplit-vertical { flex-direction: row; } .rsplit.rsplit-horizontal { flex-direction: column; } .rsplit > .rsplit-split { display: inline-block; overflow: auto; position: relative; } .rsplit.rsplit-flex > .rsplit-split { display: flex; } .rsplit.rsplit-vertical > .rsplit-split { height: 100%; } .rsplit.rsplit-horizontal > .rsplit-split { width: 100%; } .rsplit-block { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 999; } .rsplit.rsplit-draggable.rsplit-vertical > .rsplit-sep { cursor: ew-resize; } .rsplit.rsplit-draggable.rsplit-horizontal > .rsplit-sep { cursor: ns-resize; } .rsplit > .rsplit-sep { display: flex; justify-content: center; overflow: hidden; touch-action: none; flex-shrink: 0; } .rsplit.rsplit-vertical > .rsplit-sep { flex-direction: column; } .rsplit > .rsplit-sep .rsplit-sep-max, .rsplit > .rsplit-sep .rsplit-sep-min { text-align: center; display: inline-block; position: relative; cursor: pointer; } .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-max, .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-min { width: 3em; height: 100%; margin: 0 1em; } .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-max, .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-min { width: 100%; height: 1em; padding: 1em 0; margin: 0.5em 0; } .rsplit > .rsplit-sep .rsplit-sep-max-btn, .rsplit > .rsplit-sep .rsplit-sep-min-btn { display: inline-block; border-style: solid; position: relative; width: 0; height: 0; box-sizing: border-box; }",function(data){var handle=Object.assign({bg:"rgba(0, 0, 0, 0.1)",fg:"rgba(0, 0, 0, 0.4)",width:14},data("raui.split.handle"));return"\n .rsplit > .rsplit-sep {\n background-color: "+handle.bg+";\n color: "+handle.fg+";\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep {\n width: "+handle.width+"px;\n height: 100%;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep {\n height: "+handle.width+"px;\n width: 100%;\n }\n \n .rsplit > .rsplit-sep {\n font-size: "+handle.width+"px;\n }\n \n .rsplit > .rsplit-sep .rsplit-sep-max-btn,\n .rsplit > .rsplit-sep .rsplit-sep-min-btn {\n border-width: "+handle.width/2+"px;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-max-btn {\n top: "+handle.width/4+"px;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-min-btn {\n bottom: "+handle.width/4+"px;\n border-top-color: transparent;\n border-right-color: transparent;\n border-left-color: transparent;\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-max-btn {\n left: "+handle.width/4+"px;\n border-top-color: transparent;\n border-right-color: transparent;\n border-bottom-color: transparent;\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-min-btn {\n right: "+handle.width/4+"px;\n border-top-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n "}.call(this,data)].join(" ")},cssId:"split",noCssTransform:true,attributes:["vertical","draggable","maximizable","minimizable","flex"],data:function data(){return{draggable:true,maximizable:true,minimizable:true}},decorators:{sizeHandle:sizeHandle},on:{construct:function construct(){var this$1=this;var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var id=0;function map(attr,partial){if(attr&&attr.f&&attr.f.length===1&&attr.f[0].t===2){var n="_a"+id++;attrs.push({t:13,n:n,f:attr.f});return partial?{t:[{t:2,r:"~/"+n}]}:{t:2,r:"~/"+n}}return attr&&attr.f}var splits=tpl.filter(function(e){return e.e});this._mappedSizes=[];this._splits=splits.map(function(e,i){var attrs=(e.m||[]).slice();var el={e:e.e,f:e.f,t:e.t,m:attrs.filter(function(a){return a.n!=="size"&&a.n!=="minimize"})};var res={content:el.e==="pane"?el.f:[el]};if(el.e==="pane"){if(el.m){res.attrs=el.m.slice()}}var size=attrs.find(function(a){return a.n==="size"});if(size){if(size.f&&typeof size.f==="string"){res.size=+size.f}else{res.sizePath=map(size).r;this$1._mappedSizes.push(res.sizePath)}}if(attrs.find(function(a){return a.n==="minimize"})){res.min=true}return res});var remain=100-this._splits.reduce(function(a,c){return a+(c.min?0:c.size||0)},0);var unsized=this._splits.reduce(function(a,c){return a+("size"in c?0:1)},0);this._splits.forEach(function(s){if(!("size"in s)){s.size=remain/unsized}if(s.min){s.lastSize=s.size;s.curSize=0}else{s.curSize=s.size}})},config:function config(){if(this._splits){this.set("splits",this._splits)}},init:function init(){var this$1=this;this.observe(this._mappedSizes.concat("splits.*.size").join(" "),function(){if(this$1._sizing||this$1._tm){return}this$1._tm=setTimeout(function(){this$1._adjustSizes();this$1._tm=null})})}}});function sizeHandle(node,vertical,startIdx){var ctx=this.getContext(node);var startSplit=ctx.get("../"+startIdx);var endSplit=ctx.get("../"+(startIdx+1));var root=node.parentNode;var pos,initStart,initEnd,available;var vert=vertical;var posKey=vert?"screenX":"screenY";var tm;function start(ev){if(ev.target!==node&&ev.target.parentNode!==node){return}ctx.ractive._sizing=true;ctx.set("~/dragging",true);available=vert?root.clientWidth:root.clientHeight;document.addEventListener("touchmove",move,true);document.addEventListener("mousemove",move,true);document.addEventListener("mouseup",end,true);document.addEventListener("touchend",end,true);initStart=startSplit.curSize;initEnd=endSplit.curSize;if(posKey in ev){pos=ev[posKey]}else{pos=ev.touches[0][posKey]}ev.preventDefault()}function move(ev){var obj;var cur=posKey in ev?ev[posKey]:ev.touches[0][posKey];var dist=cur-pos;var moved,s,e;moved=Math.abs(dist)/available*100;if(dist<0){s=initStart-moved;e=initEnd+moved}else{s=initStart+moved;e=initEnd-moved}if(s<startSplit.min||0){e-=startSplit.min-s;s+=startSplit.min-s}if(e<endSplit.min||0){s-=endSplit.min-e;e+=endSplit.min-e}if(s<0){s=0;e=initStart+initEnd}if(e<0){s=initStart+initEnd;e=0}ctx.set((obj={},obj[startSplit.sizePath?"~/"+startSplit.sizePath:"../"+startIdx+".size"]=s,obj[endSplit.sizePath?"~/"+endSplit.sizePath:"../"+(startIdx+1)+".size"]=e,obj["../"+startIdx+".curSize"]=s,obj["../"+startIdx+".lastSet"]=s,obj["../"+startIdx+".min"]=false,obj["../"+(startIdx+1)+".curSize"]=e,obj["../"+(startIdx+1)+".lastSet"]=e,obj["../"+(startIdx+1)+".min"]=false,obj));if(!tm){setTimeout(function(){ctx.ractive.fire("resize");tm=null},300)}}function end(){ctx.ractive._sizing=false;ctx.set("~/dragging",false);document.removeEventListener("touchmove",move,true);document.removeEventListener("mousemove",move,true);document.removeEventListener("mouseup",end,true);document.removeEventListener("touchend",end,true);if(tm){clearTimeout(tm)}ctx.ractive.fire("resize")}ctx.listen("mousedown",start);ctx.listen("touchstart",start);return{teardown:function teardown(){ctx.unlisten("mousedown",start);ctx.unlisten("touchstart",start);end()},update:function update(vertical){vert=vertical;posKey=vertical?"screenX":"screenY"}}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"split"]=Split}}globalRegister("RauiSplit","components",Split);export default plugin;
import Ractive from"ractive";import globalRegister from"./globalRegister";export var Split=function(Ractive){function Split(opts){Ractive.call(this,opts)}if(Ractive)Split.__proto__=Ractive;Split.prototype=Object.create(Ractive&&Ractive.prototype);Split.prototype.constructor=Split;Split.prototype._adjustSizes=function _adjustSizes(){var this$1=this;this._sizing=true;var splits=this.get("splits");var count=0;var used=0;splits.forEach(function(s){var size=s.sizePath?+this$1.get(s.sizePath):s.size;if(s.curSize===undefined){if(s.min){s.curSize=0;s.lastSize=Math.floor(100/splits.length)}else{s.curSize=size;used+=size;count++}}else if(s.min&&s.curSize){s.lastSize=s.curSize;s.curSize=0}else if(!s.min&&!s.curSize&&s.lastSize){used+=s.lastSize;s.curSize=s.lastSize;s.lastSize=false}else if(size&&!s.min&&s.lastSet&&s.lastSet!==size){s.curSize=size;s.lastSize=false;used+=size}else if(s.curSize){used+=s.curSize;count++}else if(!s.curSize&&!s.min){s.curSize=.1;count++}});var offset=(100-used)/(count||1);var sets={};splits.forEach(function(s,i){setTimeout(function(){var sizing=this$1._sizing;this$1._sizing=true;this$1.set(s.sizePath?s.sizePath:"splits."+i+".size",s.curSize);this$1._sizing=sizing});sets["splits."+i+".curSize"]=s.lastSize===false||s.min?s.curSize:s.curSize+offset;sets["splits."+i+".lastSet"]=sets["splits."+i+".curSize"];if(!s.lastSize){s.lastSize=null}});this.set(sets);setTimeout(function(){return this$1.fire("resize")},320);this._sizing=false};Split.prototype.maximize=function maximize(idx){if(this.get("splits."+idx+".min")){this.toggle("splits."+idx+".min")}else{this.toggle("splits."+(idx+1)+".min")}this._adjustSizes()};Split.prototype.minimize=function minimize(idx){if(this.get("splits."+(idx+1)+".min")){this.toggle("splits."+(idx+1)+".min")}else{this.toggle("splits."+idx+".min")}this._adjustSizes()};Split.prototype.size=function size(idx,size$1){if(this.get("splits."+idx)){var sets={};sets["splits."+idx+".lastSet"]=sets["splits."+idx+".curSize"]=sets["splits."+idx+".size"]=size$1;this.set(sets);this._adjustSizes()}};return Split}(Ractive);Ractive.extendWith(Split,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit",g:1},{n:"class-rsplit-vertical",t:13,f:[{t:2,r:"vertical"}]},{n:"class-rsplit-horizontal",t:13,f:[{t:2,x:{r:["vertical"],s:"!_0"}}]},{n:"class-rsplit-draggable",t:13,f:[{t:2,r:"draggable"}]},{t:16,r:"extra-attributes"},{n:"class-rsplit-flex",t:13,f:[{t:2,r:"flex"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-split",g:1},{t:4,f:[{n:"style-transition",f:"width 0.3s ease-in-out, height 0.3s ease-in-out",t:13}],n:51,r:"~/dragging"},{t:4,f:[{n:"style-width",f:["calc(",{t:2,r:".curSize"},"% - ",{t:2,x:{r:["@style.split.handle.width","@last"],s:"_1*(_0||14)/(_1+1)"}},"px)"],t:13}],n:50,r:"~/vertical"},{t:4,f:[{n:"style-height",f:["calc(",{t:2,r:".curSize"},"% - ",{t:2,x:{r:["@style.split.handle.width","@last"],s:"_1*(_0||14)/(_1+1)"}},"px)"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:".attrs"}],n:50,r:".attrs"}],f:[{t:16,r:".content"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-block",g:1}]}],n:50,x:{r:["~/draggable","~/dragging"],s:"_0&&_1"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep",g:1},{t:4,f:[{n:"sizeHandle",t:71,f:{r:["~/vertical","@index"],s:"[_0,_1]"}}],n:50,x:{r:[".",".draggable","~/draggable"],s:'"draggable" in _0?_1:_2'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-max",g:1},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0.maximize(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-max-btn",g:1}]}]}],n:50,x:{r:[".",".maximizable","~/maximizable",".min","@index","../"],s:'"maximizable" in _0?_1:_2&&(_3||!_5[_4+1].min)'}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-min",g:1},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0.minimize(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-min-btn",g:1}]}]}],n:50,x:{r:[".",".minimizable","~/minimizable",".min"],s:'"minimizable" in _0?_1:_2&&!_3'}}]}],n:50,x:{r:["@index","@last"],s:"_0!==_1"}}],n:52,r:"splits"}]}],e:{"!_0":function(_0){return!_0},"_1*(_0||14)/(_1+1)":function(_0,_1){return _1*(_0||14)/(_1+1)},"_0&&_1":function(_0,_1){return _0&&_1},"[_0,_1]":function(_0,_1){return[_0,_1]},'"draggable" in _0?_1:_2':function(_0,_1,_2){return"draggable"in _0?_1:_2},"[_0.maximize(_1)]":function(_0,_1){return[_0.maximize(_1)]},'"maximizable" in _0?_1:_2&&(_3||!_5[_4+1].min)':function(_0,_1,_2,_3,_4,_5){return"maximizable"in _0?_1:_2&&(_3||!_5[_4+1].min)},"[_0.minimize(_1)]":function(_0,_1){return[_0.minimize(_1)]},'"minimizable" in _0?_1:_2&&!_3':function(_0,_1,_2,_3){return"minimizable"in _0?_1:_2&&!_3},"_0!==_1":function(_0,_1){return _0!==_1}}},css:function(data){return[" .rsplit { position: absolute; width: 100%; height: 100%; flex-grow: 1; display: flex; } .rsplit.rsplit-vertical { flex-direction: row; } .rsplit.rsplit-horizontal { flex-direction: column; } .rsplit > .rsplit-split { display: inline-block; overflow: auto; position: relative; } .rsplit.rsplit-flex > .rsplit-split { display: flex; } .rsplit.rsplit-vertical > .rsplit-split { height: 100%; } .rsplit.rsplit-horizontal > .rsplit-split { width: 100%; } .rsplit-block { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 999; } .rsplit.rsplit-draggable.rsplit-vertical > .rsplit-sep { cursor: ew-resize; } .rsplit.rsplit-draggable.rsplit-horizontal > .rsplit-sep { cursor: ns-resize; } .rsplit > .rsplit-sep { display: flex; justify-content: center; overflow: hidden; touch-action: none; flex-shrink: 0; } .rsplit.rsplit-vertical > .rsplit-sep { flex-direction: column; } .rsplit > .rsplit-sep .rsplit-sep-max, .rsplit > .rsplit-sep .rsplit-sep-min { text-align: center; display: inline-block; position: relative; cursor: pointer; } .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-max, .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-min { width: 3em; height: 100%; margin: 0 1em; } .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-max, .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-min { width: 100%; height: 1em; padding: 1em 0; margin: 0.5em 0; } .rsplit > .rsplit-sep .rsplit-sep-max-btn, .rsplit > .rsplit-sep .rsplit-sep-min-btn { display: inline-block; border-style: solid; position: relative; width: 0; height: 0; box-sizing: border-box; }",function(data){var handle=Object.assign({bg:"rgba(0, 0, 0, 0.1)",fg:"rgba(0, 0, 0, 0.4)",width:14},data("raui.split.handle"));return"\n .rsplit > .rsplit-sep {\n background-color: "+handle.bg+";\n color: "+handle.fg+";\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep {\n width: "+handle.width+"px;\n height: 100%;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep {\n height: "+handle.width+"px;\n width: 100%;\n }\n \n .rsplit > .rsplit-sep {\n font-size: "+handle.width+"px;\n }\n \n .rsplit > .rsplit-sep .rsplit-sep-max-btn,\n .rsplit > .rsplit-sep .rsplit-sep-min-btn {\n border-width: "+handle.width/2+"px;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-max-btn {\n top: "+handle.width/4+"px;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-min-btn {\n bottom: "+handle.width/4+"px;\n border-top-color: transparent;\n border-right-color: transparent;\n border-left-color: transparent;\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-max-btn {\n left: "+handle.width/4+"px;\n border-top-color: transparent;\n border-right-color: transparent;\n border-bottom-color: transparent;\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-min-btn {\n right: "+handle.width/4+"px;\n border-top-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n "}.call(this,data)].join(" ")},cssId:"split",noCssTransform:true,attributes:["vertical","draggable","maximizable","minimizable","flex"],data:function data(){return{draggable:true,maximizable:true,minimizable:true}},decorators:{sizeHandle:sizeHandle},on:{construct:function construct(){var this$1=this;var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var id=0;function map(attr,partial){if(attr&&attr.f&&attr.f.length===1&&attr.f[0].t===2){var n="_a"+id++;attrs.push({t:13,n:n,f:attr.f});return partial?{t:[{t:2,r:"~/"+n}]}:{t:2,r:"~/"+n}}return attr&&attr.f}var splits=tpl.filter(function(e){return e.e});this._mappedSizes=[];this._splits=splits.map(function(e,i){var attrs=(e.m||[]).slice();var el={e:e.e,f:e.f,t:e.t,m:attrs.filter(function(a){return a.n!=="size"&&a.n!=="minimize"})};var res={content:el.e==="pane"?el.f:[el]};if(el.e==="pane"){if(el.m){res.attrs=el.m.slice()}}var size=attrs.find(function(a){return a.n==="size"});if(size){if(size.f&&typeof size.f==="string"){res.size=+size.f}else{res.sizePath=map(size).r;this$1._mappedSizes.push(res.sizePath)}}if(attrs.find(function(a){return a.n==="minimize"})){res.min=true}return res});var remain=100-this._splits.reduce(function(a,c){return a+(c.min?0:c.size||0)},0);var unsized=this._splits.reduce(function(a,c){return a+("size"in c?0:1)},0);this._splits.forEach(function(s){if(!("size"in s)){s.size=remain/unsized}if(s.min){s.lastSize=s.size;s.curSize=0}else{s.curSize=s.size}})},config:function config(){if(this._splits){this.set("splits",this._splits)}},init:function init(){var this$1=this;this.observe(this._mappedSizes.concat("splits.*.size").join(" "),function(){if(this$1._sizing||this$1._tm){return}this$1._tm=setTimeout(function(){this$1._adjustSizes();this$1._tm=null})})}}});function sizeHandle(node,vertical,startIdx){var ctx=this.getContext(node);var startSplit=ctx.get("../"+startIdx);var endSplit=ctx.get("../"+(startIdx+1));var root=node.parentNode;var pos,initStart,initEnd,available;var vert=vertical;var posKey=vert?"screenX":"screenY";var tm;function start(ev){if(ev.target!==node&&ev.target.parentNode!==node){return}ctx.ractive._sizing=true;ctx.set("~/dragging",true);available=vert?root.clientWidth:root.clientHeight;document.addEventListener("touchmove",move,true);document.addEventListener("mousemove",move,true);document.addEventListener("mouseup",end,true);document.addEventListener("touchend",end,true);initStart=startSplit.curSize;initEnd=endSplit.curSize;if(posKey in ev){pos=ev[posKey]}else{pos=ev.touches[0][posKey]}ev.preventDefault()}function move(ev){var obj;var cur=posKey in ev?ev[posKey]:ev.touches[0][posKey];var dist=cur-pos;var moved,s,e;moved=Math.abs(dist)/available*100;if(dist<0){s=initStart-moved;e=initEnd+moved}else{s=initStart+moved;e=initEnd-moved}if(s<startSplit.min||0){e-=startSplit.min-s;s+=startSplit.min-s}if(e<endSplit.min||0){s-=endSplit.min-e;e+=endSplit.min-e}if(s<0){s=0;e=initStart+initEnd}if(e<0){s=initStart+initEnd;e=0}ctx.set((obj={},obj[startSplit.sizePath?"~/"+startSplit.sizePath:"../"+startIdx+".size"]=s,obj[endSplit.sizePath?"~/"+endSplit.sizePath:"../"+(startIdx+1)+".size"]=e,obj["../"+startIdx+".curSize"]=s,obj["../"+startIdx+".lastSet"]=s,obj["../"+startIdx+".min"]=false,obj["../"+(startIdx+1)+".curSize"]=e,obj["../"+(startIdx+1)+".lastSet"]=e,obj["../"+(startIdx+1)+".min"]=false,obj));if(!tm){setTimeout(function(){ctx.ractive.fire("resize");tm=null},300)}}function end(){ctx.ractive._sizing=false;ctx.set("~/dragging",false);document.removeEventListener("touchmove",move,true);document.removeEventListener("mousemove",move,true);document.removeEventListener("mouseup",end,true);document.removeEventListener("touchend",end,true);if(tm){clearTimeout(tm)}ctx.ractive.fire("resize")}ctx.listen("mousedown",start);ctx.listen("touchstart",start);return{teardown:function teardown(){ctx.unlisten("mousedown",start);ctx.unlisten("touchstart",start);end()},update:function update(vertical){vert=vertical;posKey=vertical?"screenX":"screenY"}}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"split"]=Split}}globalRegister("RauiSplit","components",Split);export default plugin;

@@ -1,1 +0,1 @@

import Ractive from"ractive";import{grid,style as gridStyle}from"./grid";import click from"./event-click";import expand from"./transition-expand";import scrolled from"./scrolled";import{sized}from"./watch-size";import globalRegister from"./globalRegister";var sortRE=/^([-+])?([^\s]+)$/;function isString(v){return typeof v==="string"}function isNumber(v){return typeof v==="number"}function isObject(v){return typeof v==="object"}function isRegex(v){return typeof v==="object"&&Object.prototype.toString.call(v)==="RegExp"}export var Table=function(Ractive){function Table(opts){Ractive.call(this,opts)}if(Ractive)Table.__proto__=Ractive;Table.prototype=Object.create(Ractive&&Ractive.prototype);Table.prototype.constructor=Table;var prototypeAccessors={selections:{configurable:true},selected:{configurable:true},rows:{configurable:true},visibleRows:{configurable:true},allRows:{configurable:true}};Table.prototype._allSelected=function _allSelected(){var sel=this.get("selections");var visible=this.get("paginate")==="virtual"?this.get("rows"):this.get("visibleRows");for(var i=0;i<visible.length;i++){if(!~sel.indexOf(visible[i])){return false}}return visible.length&&true};Table.prototype._setSort=function _setSort(index,ev){var ref=[this.get("sort-handler"),this.get("@style.raui.table.sort-handler")];var localh=ref[0];var classh=ref[1];var fn=localh||classh;if(fn){fn(this,this.get("columns."+index),index,ev)}else{var sort=this.get("sort")||"";var col=this.get("columns."+index);var id=col.id;if(sort===id||sort.substr(1)===id){if(sort[0]==="-"){this.set("sort",id)}else{this.set("sort","-"+id)}}else{this.set("sort",id)}}};Table.prototype.nodeSet=function nodeSet(node,prop,value){node[prop]=value};Table.prototype._expand=function _expand(idx){var this$1=this;var which=this.get("visibleRows")[idx];var current=this.get("expanded");var expanded=this.find(".rtable-row-expand");if(expanded){this.transition("expand",expanded,{outro:true}).then(function(){if(current===which){this$1.set("expanded",null)}else{this$1.set("expanded",which);this$1.transition("expand",this$1.find(".rtable-row-expand"),{intro:true})}})}else{if(which===current){this.set("expanded",null)}else{this.set("expanded",which);this.transition("expand",this.find(".rtable-row-expand"),{intro:true})}}};Table.prototype._hover=function _hover(idx){this.set("hovered",this.get("~/visibleRows")[idx]);return false};Table.prototype._unhover=function _unhover(idx){if(this.find(".rtable-top .rtable-row-wrap:hover")){return}else{this.set("hovered",undefined)}return false};Table.prototype._select=function _select(src,ev){var sels=this.get("selections");if(!sels){sels=[];this.set("selections",sels)}var i=sels.indexOf(src);if(~i){this.splice("selections",i,1)}else{this.push("selections",src)}if(i>=sels.length||sels.length===1){this.set("selected",sels[sels.length-1])}this.fire("selection",{},{item:sels[sels.length-1],items:sels});setTimeout(function(){return ev.target.checked=!~i});return false};Table.prototype._open=function _open(row,idx,vidx){var this$1=this;if(this._opentm){return}this.fire("selected",{},row,idx,vidx);this._opentm=setTimeout(function(){this$1._opentm=null},500)};Table.prototype.select=function select(){var selected=this.get("selected");if(selected){this.fire("selected",{},selected,this.get("rows").indexOf(selected),this.get("visibleRows").indexOf(selected))}};Table.prototype.deselect=function deselect(){this.set({selections:[],selected:undefined})};prototypeAccessors.selections.get=function(){return this.get("selections")||[]};prototypeAccessors.selections.set=function(v){var rows=this.get("rows");var sels=Array.isArray(v)?v.filter(function(i){return~rows.indexOf(i)}):[];this.set("selections",sels)};prototypeAccessors.selected.get=function(){return this.get("selected")};prototypeAccessors.selected.set=function(v){this.set({selected:v,selections:[v]})};prototypeAccessors.rows.get=function(){return this.get("rows")};prototypeAccessors.visibleRows.get=function(){return this.get("visibleRows")};prototypeAccessors.allRows.get=function(){return this.get("items")};Table.prototype.selectionOffset=function selectionOffset(offset){var selected=this.get("selected");var visible=this.get("visibleRows");if(!selected||!~visible.indexOf(selected)){var next=offset>0?visible[0]:visible[visible.length-1];this.set({selected:next,selections:[next]})}else{var idx=visible.indexOf(selected);if(offset>0?idx+offset>=visible.length:idx+offset<0){var move=offset<1?-1:1;if(move<0&&this.get("page")+move>=0||move>0&&this.get("page")+move<this.get("pagination.total")){this.add("page",move)}visible=this.get("visibleRows");var next$1=offset>0?visible[0]:visible[visible.length-1];this.set({selected:next$1,selections:[next$1]})}else{this.set({selected:visible[idx+offset],selections:[visible[idx+offset]]})}}this.fire("selection",{},{item:this.get("selected"),items:this.get("selections")})};Table.prototype.selectionDown=function selectionDown(){this.selectionOffset(1)};Table.prototype.selectionUp=function selectionUp(){this.selectionOffset(-1)};Table.prototype._selectGroup=function _selectGroup(idx){var grp=idx;if(this.get("page")){grp+=this.get("page")*this.get("pagination.per")}var rows=this.get("rows");var groups=this.get("groups");var sels=this.get("selections");var x=rows[grp++];var xs=["selections"];var ss=[];var i;if(!~(i=sels.indexOf(x))){xs.push(x)}else{ss.push(i)}while(grp<rows.length&&!(grp in groups)){x=rows[grp++];if(!~(i=sels.indexOf(x))){xs.push(x)}else{ss.push(i)}}if(xs.length===1){i=ss.length;while(i--){this.splice("selections",ss[i],1)}}else{this.push.apply(this,xs)}return false};Table.prototype._groupSelected=function _groupSelected(idx){var grp=idx;if(this.get("page")){grp+=this.get("page")*this.get("pagination.per")}var rows=this.get("rows");var groups=this.get("groups");var sels=this.get("selections");if(!~sels.indexOf(rows[grp++])){return false}while(grp<rows.length&&!(grp in groups)){if(!~sels.indexOf(rows[grp++])){return false}}return true};Table.prototype._rows=function _rows(){var src=(this.get("items")||[]).slice();var filter=this.get("filter");var sort=this.get("sort");var ref=[this.get("data-handler"),this.get("@style.raui.table.data-handler")];var localh=ref[0];var classh=ref[1];var handler=localh||classh||defaultFilter;if(!filter&&!sort){this.set("isFiltered",false);return this.set("rows",src)}var res=handler(this,src,filter,sort,this.get("parameters",{virtual:true}));this.set("isFiltered",res.length!==src.length);this.set("rows",res);var sels=this.get("selections");this.set("selections",sels.filter(function(s){return~src.indexOf(s)}));if(!~src.indexOf(this.get("selection"))){this.set("selected",undefined)}};Table.prototype.replaceColumns=function replaceColumns(columns){var ref=makeRows(columns);var headerCols=ref[0];var rowCols=ref[1];this.set("columns",columns);this.resetPartial("grid-row-cols",rowCols);this.resetPartial("grid-head-cols",headerCols)};Object.defineProperties(Table.prototype,prototypeAccessors);return Table}(Ractive);function scrollother(node,find){var this$1=this;var scroll=function(ev){if(scrollother.lock&&scrollother.lock!==node){return}if(scrollother.tm){clearTimeout(scrollother.tm)}scrollother.lock=node;this$1.find(find).scrollLeft=ev.target.scrollLeft;scrollother.tm=setTimeout(function(){scrollother.tm=null;scrollother.lock=false},100)};node.addEventListener("scroll",scroll,{passive:true});return{teardown:function teardown(){node.removeEventListener("scroll",scroll)}}}Table.settings={valign:"center",border:false,"fixed-header":true,"allow-select":true,"allow-select-all":true,"auto-titles":false,paginate:"virtual"};Ractive.extendWith(Table,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable",g:1},{n:"class-rtable-virtual",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="virtual"'}}]},{n:"class-rtable-auto",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="auto"'}}]},{n:"class-rtable-fixed",t:13,f:[{t:2,r:"~/fixed"}]},{n:"class-rtable-border",t:13,f:[{t:2,r:"~/border"}]},{n:"class-rtable-fixed-header",t:13,f:[{t:2,r:"~/fixedHeader"}]},{n:"class-rtable-scrolled-down",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{n:"class-rtable-scrolled-up",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("bottom")'}}]},{n:"class-rtable-with-select",t:13,f:[{t:2,r:"~/allowSelect"}]},{n:"class-rtable-valign-top",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="top"'}}]},{n:"class-rtable-valign-center",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="center"'}}]},{n:"class-rtable-valign-bottom",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="bottom"'}}]},{n:"class-rtable-nowrap",t:13,f:[{t:2,r:"~/noWrap"}]},{n:"class-rtable-wrap",t:13,f:[{t:2,x:{r:["~/noWrap"],s:"!_0"}}]},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-fixed",g:1},{n:"grid",t:71,f:{r:["~/scrollOffset"],s:"[{offset:_0}]"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,r:"meta.top"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1},{t:4,f:[{n:"scrollother",t:71,f:{r:[],s:'[".rtable-top"]'}}],n:50,r:"~/noWrap"}],f:[{t:8,r:"grid-head"}]}],n:51,r:"~/noHeader"}]}],n:50,x:{r:["~/noHeader","meta.top","~/fixedHeader"],s:"(!_0||_1)&&_2"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-top",g:1},{t:4,f:[{n:["scrolled"],t:70,f:"scroll"},{n:"sized",t:71,f:{r:[],s:'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]'}}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scroll"]'}}],n:50,x:{r:["~/noHeader","~/fixedHeader","~/meta.bottom","~/paginate"],s:'(!_0&&_1)||_2||_3==="virtual"'}},{t:4,f:[{n:"scrollother",t:71,f:{r:[],s:'[".rtable-header-wrapper"]'}}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,x:{r:["~/fixedHeader","meta.top"],s:"!_0&&_1"}}," ",{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]'}},{t:4,f:[{n:"style-margin-top",f:[{t:2,r:"~/virtual.above"},"px"],t:13},{n:"style-margin-bottom",f:[{t:2,r:"~/virtual.below"},"px"],t:13}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&!_1"}}," ",{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,z:[{n:"source",x:{r:"~/items"}},{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/visibleRows"}],n:50,r:"~/shuffle"},{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,r:"~/visibleRows"}],n:51,l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-row row t1",g:1}],f:[{t:16,r:"empty",z:[{n:"message",x:{r:"~/empty"}}]}]}],n:50,x:{r:["~/rows.length"],s:"!_0"}}]}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-bottom",g:1},{t:4,f:[{t:16,r:"meta.bottomAttrs"}],n:50,r:"meta.bottomAttrs"}],f:[{t:4,f:[{t:16,r:"meta.bottom",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}],n:50,r:"~/meta.bottom"}," ",{t:4,f:[{t:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],n:50,x:{r:["~/paginate","~/meta.bottom"],s:'_0!=="virtual"||_1'}}]}],e:{'_0==="virtual"':function(_0){return _0==="virtual"},'_0==="auto"':function(_0){return _0==="auto"},'!~(_0||"").indexOf("top")':function(_0){return!~(_0||"").indexOf("top")},'!~(_0||"").indexOf("bottom")':function(_0){return!~(_0||"").indexOf("bottom")},'_0==="top"':function(_0){return _0==="top"},'_0==="center"':function(_0){return _0==="center"},'_0==="bottom"':function(_0){return _0==="bottom"},"!_0":function(_0){return!_0},"[{offset:_0}]":function(_0){return[{offset:_0}]},'[".rtable-top"]':function(){return[".rtable-top"]},"(!_0||_1)&&_2":function(_0,_1,_2){return(!_0||_1)&&_2},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},'(!_0&&_1)||_2||_3==="virtual"':function(_0,_1,_2,_3){return!_0&&_1||_2||_3==="virtual"},'[".rtable-header-wrapper"]':function(){return[".rtable-header-wrapper"]},"_0&&_1":function(_0,_1){return _0&&_1},"!_0&&_1":function(_0,_1){return!_0&&_1},'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]':function(){return[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]},"!_0&&!_1":function(_0,_1){return!_0&&!_1},true:function(){return true},'_0!=="virtual"':function(_0){return _0!=="virtual"},'_0!=="virtual"||_1':function(_0,_1){return _0!=="virtual"||_1},"(_0+_1)%2===1":function(_0,_1){return(_0+_1)%2===1},"[_0._setSort(_1,_2)]":function(_0,_1,_2){return[_0._setSort(_1,_2)]},"[_0._select(_1,_2),false]":function(_0,_1,_2){return[_0._select(_1,_2),false]},"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]":function(_0,_1,_2,_3){return[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]},"[_0._expand(_1)]":function(_0,_1){return[_0._expand(_1)]},"[_0.stopPropagation()]":function(_0){return[_0.stopPropagation()]},"_0.indexOf(_1)":function(_0,_1){return _0.indexOf(_1)},"_0===_1":function(_0,_1){return _0===_1},"_0>0":function(_0){return _0>0},"!_0&&_1>0":function(_0,_1){return!_0&&_1>0},'_0==="boolean"':function(_0){return _0==="boolean"},"_0._allSelected()":function(_0){return _0._allSelected()},'_0||"No data."':function(_0){return _0||"No data."},"_0*_1+1":function(_0,_1){return _0*_1+1},"_2+1===_0?_1:(_2+1)*_3":function(_0,_1,_2,_3){return _2+1===_0?_1:(_2+1)*_3},"_0===1":function(_0){return _0===1},"_0._allSelected()&&_1<_2":function(_0,_1,_2){return _0._allSelected()&&_1<_2},'[_0.set("page",_1-1)]':function(_0,_1){return[_0.set("page",_1-1)]},'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]':function(_0,_1,_2,_3,_4){return[/^\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1)||_2.nodeSet(_3,"value",_4+1)]},"_0==_1+1":function(_0,_1){return _0==_1+1},'[_0.set("page",_2[_1-1])]':function(_0,_1,_2){return[_0.set("page",_2[_1-1])]},'_0==="..."':function(_0){return _0==="..."},'[_0.set("page",_1+1)]':function(_0,_1){return[_0.set("page",_1+1)]},"_0<_1-1":function(_0,_1){return _0<_1-1}},p:{"csp-dummy":[{t:7,e:"div",m:[{n:"class-rtable-odd",t:13,f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{n:"class-top",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="top"'}}]},{n:"class-bottom",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="bottom"'}}]},{n:"class-center",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="center"'}}]},{n:["click"],t:70,f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}},{n:["click"],t:70,f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}},{n:["click"],t:70,f:{r:["@this","~/rows","~/visibleRows","."],s:"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]"}},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},{n:["click"],t:70,f:{r:["@event"],s:"[_0.stopPropagation()]"}}]}," ",{t:4,f:["..."],n:50,x:{r:["~/selections","."],s:"_0.indexOf(_1)"}}," ",{t:4,f:["..."],n:50,x:{r:[".","~/expanded"],s:"_0===_1"}}," ",{t:4,f:["..."],n:50,x:{r:["~/virtual.offset"],s:"_0>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/columns.0.type"],s:'_0==="boolean"'}}," ",{t:4,f:["..."],n:50,x:{r:["@this"],s:"_0._allSelected()"}}],empty:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:2,x:{r:["message"],s:'_0||"No data."'}}]}]}],pagination:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pagination",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-info",g:1}],f:[{t:4,f:[{t:2,x:{r:["~/page","~/pagination.per"],s:"_0*_1+1"}}," - ",{t:2,x:{r:["~/pagination.total","~/rows.length","~/page","~/pagination.per"],s:"_2+1===_0?_1:(_2+1)*_3"}}," of ",{t:2,r:"~/rows.length"},{t:4,f:[" (",{t:2,r:"~/items.length"}," total)"],n:50,r:"~/isFiltered"}],n:50,x:{r:["pagination","rows.length"],s:"_0&&_1"}}," ",{t:4,f:["​"],n:50,x:{r:["_paginate"],s:"_0===1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-select-all-all",g:1}],f:[{t:4,f:[{t:7,e:"strong",f:[{t:2,r:"selections.length"}]}," of ",{t:7,e:"strong",f:[{t:2,r:"rows.length"}]}," selected",{t:4,f:[" - ",{t:7,e:"a",m:[{n:"href",f:"#",t:13,g:1},{n:["click"],t:70,f:"selectAllAll"}],f:["Select All"]}],n:50,x:{r:["@this","selections.length","rows.length"],s:"_0._allSelected()&&_1<_2"}}],n:50,x:{r:["selections.length"],s:"_0>0"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pages",g:1}],f:[{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1-1)]'}}],f:["Previous"]}],n:50,x:{r:["~/page"],s:"_0>0"}}," ",{t:4,f:[{t:4,f:[{t:7,e:"input",m:[{n:["change"],t:70,f:{r:["~/pagination.total","@node.value","@this","@node","~/page"],s:'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]'}},{n:"value",f:[{t:2,r:"."}],t:13},{t:73,v:"t",f:"false"}]}],n:50,x:{r:[".","~/page"],s:"_0==_1+1"}},{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","@index","../"],s:'[_0.set("page",_2[_1-1])]'}}],f:["..."]}," "],n:50,x:{r:["."],s:'_0==="..."'},l:1},{t:4,f:[" ",{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","."],s:'[_0.set("page",_1-1)]'}}],f:[{t:2,r:"."}]}],n:51,l:1}],n:52,r:"~/pagination.array"}," ",{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1+1)]'}}],f:["Next"]}],n:50,x:{r:["~/page","~/pagination.total"],s:"_0<_1-1"}}]}]}]}},css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.table.primary"));var active=Object.assign({},primary,data("raui.primary.active"),data("raui.table.primary.active"));var table=Object.assign({selected:{},header:{},footer:{}},data("raui.table"));return"\n .rtable {\n display: flex;\n flex-direction: column;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n }\n \n .rtable.rtable-border {\n border: 1px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header {\n min-height: 2em;\n }\n \n .rtable-group > div > div,\n .rtable-header > div > div,\n .rtable-row > div > div {\n padding: "+(table.padding||"0.5em")+";\n overflow: inherit;\n text-overflow: inherit;\n line-height: 1em;\n }\n .rtable-row > .rtable-no-pad > div {\n padding: 0;\n }\n \n .rtable-auto .row > *,\n .rtable-fixed .row > *\n {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n \n .rtable-header > div > div, .rtable-column {\n overflow: hidden;\n }\n \n .rtable-number-column {\n text-align: right;\n }\n .rtable-date-column {\n text-align: right;\n }\n \n .rtable-sortable {\n cursor: pointer;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .grid .row.rtable-row, .grid .rtable-header > .row {\n width: auto;\n min-width: min-content;\n flex-grow: 1;\n }\n \n .rtable-nowrap .grid .rtable-row, .rtable-nowrap .grid .rtable-header > .row {\n flex-wrap: nowrap;\n }\n .rtable-nowrap .rtable-row-wrap, .rtable-inner-row-wrap {\n flex-grow: 1;\n } \n \n .rtable-row-wrap {\n display: flex;\n flex-grow: 1;\n align-items: center;\n z-index: 2;\n align-items: stretch;\n color: "+(primary.fg||"#222")+";\n background-color: "+(table.even||primary.bga||"#f4f4f4")+";\n }\n .rtable-row-wrap:focus-within {\n z-index: 3;\n }\n .rtable-row-wrap.rtable-odd {\n background-color: "+(table.odd||primary.bg||"#fff")+";\n }\n .rtable-row-wrap:hover .rtable-inner-row-wrap, .rtable-row-wrap:hover .rtable-select-row {\n background-color: "+(table.over||active.bg||"#e6f0fa")+";\n }\n .rtable-row-wrap:hover .rtable-inner-row-wrap,\n .rtable-wrap .rtable-row-wrap:hover .rtable-select-row {\n position: relative;\n }\n .rtable-row-wrap:hover .rtable-select-row {\n overflow: visible;\n }\n \n .rtable-row-wrap:hover {\n border-bottom: "+(table.dividerSize||"4px")+" solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-row-wrap.rtable-selected {\n background-color: "+(table.selected.bg||"#cee5fd")+";\n color: "+(table.selected.fg||primary.fg||"#222")+";\n }\n .rtable-row-wrap.rtable-selected.rtable-odd {\n background-color: "+(table.selected.odd||"#c5dffb")+";\n }\n \n .rtable-nowrap .rtable-row-wrap {\n display: inline-flex;\n min-width: 100%;\n box-sizing: border-box;\n }\n \n .rtable-nowrap > .rtable-top > .grid {\n line-height: 1em;\n }\n \n .rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 0 0 1px;\n margin: 0 0 0 -1px;\n }\n .rtable-wrap.rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-width: 0 0 1px 1px;\n margin: 0 0 -1px -1px;\n }\n \n .rtable-border .rtable-header .rtable-column {\n border-width: 0 0 0 0;\n margin: 0 0 0 0;\n }\n .rtable-wrap.rtable-border .rtable-header .rtable-column {\n border-width: 0 0 1px 0;\n margin: 0 0 -1px 0;\n }\n \n .rtable-border .rtable-row .rtable-column:nth-child(1),\n .rtable-border .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 0;\n }\n .rtable-border.rtable-with-select .rtable-row .rtable-column:nth-child(1),\n .rtable-border.rtable-with-select .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 1px;\n }\n \n .rtable-border .rtable-row-wrap {\n border-bottom-width: 1px;\n }\n \n .rtable-border .rtable-row-expand, .rtable-border .rtable-row-extra {\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin-left: -1px;\n width: 100%;\n }\n .rtable-border.rtable-with-select .rtable-row-expand, .rtable-border.rtable-with-select .rtable-row-extra {\n border-left-width: 1px;\n }\n \n .rtable-row-expand, .rtable-row-extra {\n box-sizing: border-box;\n padding: "+(table.padding||"0.5em")+";\n }\n \n .rtable-row-hover {\n pointer-events: none;\n position: relative;\n z-index: 1;\n }\n .rtable-row-hover-content {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n }\n .rtable-row-hover-content > * {\n pointer-events: visible;\n }\n \n .rtable-group {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header.rtable-row-wrap:hover {\n font-weight: bold;\n background-color: "+(table.header.bg||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n background-color: "+(table.header.bg||"#dedede")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header-extra.rtable-noheader {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header-extra {\n background-color: "+(table.header.bg||"#dedede")+";\n padding: "+(table.padding||"0.5em")+";\n line-height: 1em;\n z-index: 4;\n box-sizing: border-box;\n min-width: 100%;\n }\n .rtable-nowrap .rtable-header-extra {\n position: sticky;\n left: 0;\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n position: relative;\n z-index: 3;\n }\n .rtable-fixed-header.rtable-scrolled-down .rtable-header-fixed {\n box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15), 0 0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper::-webkit-scrollbar {\n height: 0;\n }\n .rtable-fixed-header .rtable-header-fixed::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n \n .rtable-nowrap .rtable-fixed-column, .rtable-nowrap .rtable-row-extra, .rtable-nowrap .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n position: -webkit-sticky;\n position: sticky;\n left: 0;\n }\n .rtable-border..rtable-nowrap .rtable-fixed-column, .rtable-border.rtable-nowrap .rtable-row-extra, .rtable-border.rtable-nowrap .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: 1px;\n }\n .rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtable-nowrap.rtable-with-select .rtable-row-extra, .rtable-nowrap.rtable-with-select .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: "+(table.selectWidth||"2em")+";\n }\n .rtabe-border.rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-extra, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: "+(table.selectWidth||"2em")+";\n }\n \n .rtable-nowrap .rtable-inner-row-wrap {\n background-color: inherit;\n }\n \n .rtable-nowrap .row,\n .rtable-nowrap .rtable-fixed-column,\n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n background-color: inherit;\n z-index: 1;\n }\n \n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n position: sticky;\n position: -webkit-sticky;\n left: 0;\n z-index: 1;\n }\n .rtable-nowrap .rtable-select-header {\n z-index: 2;\n }\n \n .rtable-nowrap.rtable-border .rtable-fixed-column {\n border-right-width: 1px;\n }\n \n .rtable-scrolled-up .rtable-bottom {\n box-shadow: 0 -1px 2px 0 rgba(60, 64, 67, 0.3), 0 -1px 3px 1px rgba(60, 64, 67, 0.15), 0 -0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-bottom {\n padding: "+(table.padding||"0.5em")+";\n background-color: "+(table.footer.bg||table.header.bg||"#dedede")+";\n border-top: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-pagination {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n justify-content: space-between;\n user-select: none;\n }\n \n .rtable-pages span {\n margin: 0.3em;\n cursor: pointer;\n }\n .rtable-pages span:first-of-type {\n margin-left: 0;\n }\n .rtable-pages input {\n text-align: center;\n width: 2.5em;\n font-size: 1em;\n background-color: transparent;\n border: none;\n padding: 0;\n font-weight: bold;\n text-decoration: underline;\n }\n \n /* checkboxes */\n .rtable-select {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n position: absolute;\n display: block;\n margin: 0;\n width: 3em;\n height: 3em;\n box-shadow: none;\n outline: none;\n opacity: 0;\n top: -0.75em;\n left: -0.75em;\n border-radius: 2em;\n transition: transform 0.2s, opacity 0.2s;\n background-color: "+(primary.bc||"#ccc")+";\n cursor: pointer;\n }\n \n .rtable-select-header > div, .rtable-select-row > div, .rtable-header > div.rtable-select-header > div {\n padding: 0;\n overflow: visible;\n width: 1.5em;\n height: 1.5em;\n position: relative;\n line-height: 1.8em;\n cursor: pointer;\n display: flex;\n justify-content: space-around;\n align-items: center;\n flex-grow: 0;\n display: block;\n }\n \n .rtable-select:checked {\n background-color: "+(primary.fga||"#07e")+';\n }\n \n .rtable-select-header:hover .rtable-select, .rtable-select-row:hover .rtable-select {\n opacity: 0.04;\n }\n \n .rtable-select:focus {\n opacity: 0.12;\n transform: scale(1);\n }\n \n .rtable-select-header:hover .rtable-select:focus, .rtable-select-row:hover .rtable.select:focus {\n opacity: 0.16;\n }\n \n .rtable-select:active {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n \n .rtable-select-row > div:before, .rtable-select-header > div:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n border: solid 0.125em; /* Safari */\n border-color: '+(primary.fg||"#222")+";\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n position: absolute;\n top: 0.3em;\n left: 0.15em;\n transition: border-color 0.2s, background-color 0.2s;\n }\n \n .rtable-select-row > div:after, .rtable-select-header > div:after {\n content: '';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 0.3em;\n left: 0.15em;\n border-radius: 0.125em;\n }\n \n .rtable-selected .rtable-select-row > div:before, .rtable-all-selected > div:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n \n .rtable-selected .rtable-select-row > div:after, .rtable-all-selected > div:after {\n border-color: "+(primary.bg||"#fff")+';\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(primary.fga||"#07e")+";\n opacity: 1;\n }\n \n .rtable-row-wrap > .rtable-select-header,\n .rtable-row-wrap > .rtable-select-row {\n text-align: center;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: "+(table.selectWidth||"2em")+";\n }\n \n .rtable-row-wrap > .rtable-select-row {\n border-style: solid;\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n }\n \n .rtable-inner-row-wrap {\n border-style: solid;\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n }\n \n .rtable-column button, .rtable-column .btn {\n padding: 0 0.5em;\n margin: 0.2em 0.5em;\n min-height: 0;\n }\n \n .rtable-column.rtable-editing, .rtable-column.rtable-editing > .rtable-edit {\n padding: 0;\n }\n .rtable-column.rtable-editing input {\n width: 100%;\n box-sizing: border-box;\n height: 100%;\n margin: 0;\n border: none;\n background-color: transparent;\n padding: 0.25em 0.5em;\n }\n \n .rtable-valign-top .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-top > div {\n display: flex;\n height: 100%;\n align-items: flex-start;\n box-sizing: border-box;\n }\n .rtable-valign-bottom .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-bottom > div {\n display: flex;\n height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n }\n .rtable-valign-center .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-center > div {\n display: flex;\n height: 100%;\n align-items: center;\n box-sizing: border-box;\n }\n "+(data("table.includeGrid")?gridStyle(data):"")}.call(this,data)].join(" ")},cssId:"rtable",noCssTransform:true,attributes:["auto-titles","paginate","items","filter","data-handler","sort-handler","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap","parameters"],components:{table:false,Table:false},syncComputedChildren:true,decorators:{grid:grid,sized:sized,scrollother:scrollother},events:{},use:[click({name:"clickd",count:1}),click({name:"dblclickd",count:2}),expand(),scrolled()],on:{construct:construct,config:function config(){this.set(this._init.sets);Object.assign(this.partials,this._init.partials)},render:function render(){if(this._autoObserver){this._autoObserver.fire()}},selectAll:function selectAll(){var sel,item;if(this._allSelected()){item=null;sel=[];this.set({selections:sel,selected:item})}else{sel=(this.get("paginate")==="virtual"?this.get("rows"):this.get("visibleRows")).slice();item=sel[0];this.set({selections:sel,selected:item})}this.fire("selection",{},{item:item,items:sel});return false},selectAllAll:function selectAllAll(){var item=null;var sel=this.get("rows").slice();this.set({selections:sel,selected:item});this.fire("selection",{},{item:item,items:sel});return false}},observe:{_rows:function _rows(){var this$1=this;if(this._rowbounce){clearTimeout(this._rowbounce)}setTimeout(function(){return this$1._rows()},this.get("@style.raui.table.debounce")||160)},paginate:{handler:function handler(v){var this$1=this;if(v==="auto"||v==="virtual"||v instanceof Ractive){if(this._autoObserver){this._autoObserver.cancel()}if(this._scrollListener){this._scrollListener.cancel()}var root=v==="auto"||v==="virtual"?this.root:v;var sized=false;var fn=function(){if(!this$1.rendered){return}var top=this$1.find(".rtable-top");if(!top){return}if(!this$1.get("items.length")){if(!this$1._autoLenObserver){this$1._autoLenObserver=this$1.observeOnce("items",function(){this$1._autoLenObserver=0;setTimeout(fn)})}return}var size=top.clientHeight+","+top.clientWidth;if(fn.last===size&&sized){return}{var ctx=this$1.getContext(top);if(ctx.decorators&&ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}}var header=this$1.find(".rtable-header")||{};var rows=Array.apply(null,this$1.findAll(".rtable-live")).map(function(r){return r.offsetHeight});if(rows.length<5){var auto=Math.floor(top.clientHeight/(header.offsetHeight||1));if(auto<5){auto=5}this$1.set("_paginate",auto);rows=Array.apply(null,this$1.findAll(".rtable-live")).map(function(r){return r.offsetHeight})}if(rows.length>0){sized=true}else{rows=[25]}var avg=Math.ceil(rows.reduce(function(a,c){return a+c},0)/rows.length);this$1._avgSize=avg;var fit=Math.floor((top.clientHeight-(header.offsetHeight||1))/avg);if(v==="virtual"){fit=fit+10;if(fit<30){fit=30}}this$1.set("_paginate",fit);fn.last=size};var tm;var fnd=function(){if(tm){clearTimeout(tm)}tm=setTimeout(function(){fn();tm=null;if(sized&&this$1._scrollListener){this$1._scrollListener.fn()}},50)};this._autoObserver=this.observe("~/tableHeight",fnd);this._autoObserver.fire=fnd;if(v==="virtual"){var lock=false;var node;var fn$1=function(){if(!this$1.rendered){node=null;return}if(!node){node=this$1.find(".rtable-top")}if(!sized){return fnd()}var top=node.scrollTop;var virtual=this$1.get("virtual")||{};var offset=virtual.offset;var visible=this$1.get("_paginate");var page=visible-10;var count=this$1.get("rows.length");if(visible>count){visible=count}var avg=this$1._avgSize;var pageSize=page*avg;var wnd=Math.floor(top/avg);var first=wnd-5;if(first<0){first=0}var hardFirst=first;if(first+visible>count){first=count-visible}if(offset===first&&!isNaN(virtual.top)){return lock=false}if(!isNumber(offset)||isNaN(offset)||isNaN(virtual.top)||top<virtual.top+pageSize||top>virtual.bottom-pageSize||offset>0&&top<avg*page){var amtAbove=hardFirst;var amtBelow=count-hardFirst-visible;if(amtAbove<0){amtBelow+=amtAbove*-1;amtAbove=0}else if(amtAbove>count-visible){amtAbove=count-visible}if(amtBelow<0){amtBelow=0}var above=amtAbove*avg;var below=amtBelow*avg;var vis,next;if(first<offset+visible&&first>offset-visible){if(first>offset){vis=this$1.findAll(".rtable-live")[first-offset]}else{vis=this$1.findAll(".rtable-live")[offset-first]}}if(vis&&first>0&&vis.offsetTop>node.scrollTop-pageSize-5&&vis.offsetTop<node.scrollTop+pageSize){next=vis.offsetTop}this$1.set({"virtual.above":above,"virtual.below":below,"virtual.offset":first});if(typeof next==="number"){if(next!==vis.offsetTop){this$1.set("virtual.above",above+(next-vis.offsetTop))}}this$1.set({"virtual.top":this$1.get("virtual.above"),"virtual.bottom":node.scrollHeight-below})}lock=false};var scroll=this._scrollListener=this.on("scroll",function(ref){var node=ref.node;if(!lock){lock=true;requestAnimationFrame(fn$1)}});scroll.fn=fn$1;scroll.observer=this.observe("rows.length",function(){this$1.set("virtual.offset",null);fn$1()},{init:false,strict:true,defer:true});var cancel=scroll.cancel;scroll.cancel=function(){cancel();scroll.observer.cancel()}}fnd()}else{if(this._autoObserver){this._autoObserver.cancel()}if(this._scrollListener){this._scrollListener.cancel()}}if(isNumber(v)){this.set("_paginate",v)}},defer:true},"scrollOffset tableHeight":{handler:function handler(){var this$1=this;if(this.rendered){requestAnimationFrame(function(){var top=this$1.find(".rtable-top");var ctx=top&&this$1.getContext(top);if(ctx&&ctx.decorators&&ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}})}},init:false},scroll:function scroll(v,o){if(~(v||"").indexOf("top")&&!~(o||"").indexOf("top")){this.fire("scrolltop",{})}if(~(v||"").indexOf("bottom")&&!~(o||"").indexOf("bottom")){this.fire("scrollbottom",{})}}},data:function data(){return Object.assign({page:0,selections:[],showGroups:true,allowGroupSelect:true,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:false,rows:[]},Table.settings)},computed:{allowSelect:function allowSelect(){return this.get("allow-select")},allowSelectAll:function allowSelectAll(){return this.get("allow-select-all")},fixedHeader:function fixedHeader(){return this.get("fixed-header")},autoTitles:function autoTitles(){return this.get("auto-titles")},noHeader:function noHeader(){return this.get("no-header")},noWrap:function noWrap(){return this.get("no-wrap")},_rows:function _rows(){var src=(this.get("items")||[]).slice();var filter=this.get("filter");var sort=this.get("sort");var params=this.get("parameters");var ref=[this.get("data-handler"),this.get("@style.raui.table.data-handler")];var localh=ref[0];var classh=ref[1];var ref$1=[this.get("data-pre-handler"),this.get("@style.raui.table.data-pre-handler")];var localp=ref$1[0];var classp=ref$1[1];if(localp||classp){(localp||classp)(this,src,filter,sort,params)}return{}},visibleRows:function visibleRows(){var this$1=this;var rows=this.get("rows");var paginate=this.get("paginate");var per=paginate;var intPer=this.get("_paginate");var offset=this.get("page")||0;var virtual=this.get("virtual");if(!per){return rows}if(typeof per!=="number"&&isNaN(+per)){if(per==="auto"||per==="virtual"||per instanceof Ractive){per=intPer||1}else{per=30}}if(per<this.get("minPerPage")){per=this.get("minPerPage")}if(paginate==="virtual"){offset=virtual&&virtual.offset||0;return rows.slice(offset,offset+per)}else{if(offset*per>rows.length){setTimeout(function(){return this$1.set("page",0)},0)}return rows.slice(per*offset,per*offset+per)}},pagination:function pagination(){var items=this.get("items")||empty;var rows=this.get("rows");var paginate=this.get("paginate");var per=paginate;var offset=this.get("page")||0;if(typeof per!=="number"&&isNaN(per)){per=this.get("_paginate")}if(per<this.get("minPerPage")){per=this.get("minPerPage")}if(!per){return}var total=Math.ceil(rows.length/per);var info={max:Math.ceil(items.length/per),total:total,per:per};if(paginate==="virtual"){info.height=this._avg*rows.length}if(info.total>14){var arr=info.array=[];if(offset>5){arr.push(1,2,3,"...")}else{arr.push(1,2,3,4,5,6,7,8)}if(offset>5&&offset+6<total){arr.push(offset-1,offset,offset+1,offset+2,offset+3,"...",total-2,total-1,total)}else if(offset+6<total){arr.push("...",total-2,total-1,total)}else{arr.push(total-7,total-6,total-5,total-4,total-3,total-2,total-1,total)}}else{info.array=Array.apply(null,{length:info.total}).map(function(v,i){return i+1})}return info},groups:function groups(){var rows=this.get("rows");var last,cur;var res={};for(var i=0;i<rows.length;i++){cur=rows[i][this._init.by];if(cur!=last){res[i]=1}last=cur}return res}}});var notNumbers=/^[^\d]*/;export function numberify(v){if(isNumber(v)){return v}if(!v){return+Infinity}v=(""+v).replace(notNumbers,"");if(!v){return+Infinity}return parseFloat(v)}function columnGetter(table,col,sort){if(typeof col.get==="function"){return col.get}var path=(sort?col.sort:0)||col.path||col.filter||col.id;if(typeof path==="string"){var arr=Ractive.splitKeypath(path);return function(row){var v=row;for(var i=0;i<arr.length;i++){v=v&&v[arr[i]]}return v}}}function defaultFilter(table,rows,filter,sort){var all=[].concat(table.viewmodel.value.columns,table.viewmodel.value.fields);var map=all.reduce(function(a,c){return((a[c.id]=columnGetter(table,c))||true)&&a},{});var cols=Object.values(map);var list=rows||[];var src=list;if((filter instanceof RegExp||isString(filter))&&filter){var nocase=filter===""+filter.toLowerCase()||filter===""+filter.toUpperCase();try{var re=isString(filter)?new RegExp(filter,nocase?"i":""):filter;list=list.filter(function(l){var i=cols.length;while(i--){var v=l&&cols[i](l);if(v&&re.test(v)){return true}}})}catch(e){}}if(isString(sort)||isObject(sort)&&!Array.isArray(sort)){sort=[sort]}if(Array.isArray(sort)){sort=sort.map(function(f){if(isString(f)){var id$1=f[0]==="-"||f[0]==="+"?f.substr(1):f;var col=all.find(function(c){return c.id===id$1});if(!col){return}var res={get:columnGetter(table,col,true),dir:f[0]==="-"?-1:1};if(col&&col.type==="number"){var get=res.get;res.get=function(v){return numberify(get.call(table,v))}}return res}else if(f&&typeof f==="object"){var col$1=all.find(function(c){return c.id===id});if(!col$1){return}var res$1={dir:isNumber(f.dir)?f.dir:f.dir==="desc"?-1:1,get:columnGetter(table,col$1,true)};if(f.type==="number"||col$1&&col$1.type==="number"){var get$1=res$1.get;res$1.get=function(v){return numberify(get$1.call(table,v))}}return res$1}}).filter(function(s){return s&&s.get});list.sort(function(a,b){var aa,bb,p;for(var i=0;i<sort.length;i++){aa=sort[i].get.call(table,a);bb=sort[i].get.call(table,b);p=sort[i].dir*(aa<bb?-1:aa>bb?1:0);if(p!==0){return p}}return p})}return list}function makeRows(columns){var z=[{n:"gridValue",x:{r:"~/gridValue"}},{n:"gridName",x:{r:"~/gridName"}},{n:"gridSize",x:{r:"~/tableWidth"}},{n:"gridMax",x:{r:"~/gridMax"}},{n:"table",x:{r:"@this"}}];var sortKey="[_0._setSort(_1,_2)]";var headerCols=columns.filter(function(c){return c.hidden!==true}).map(function(c,cidx){if(c.index==null){c.index=cidx}c.attrsHP=c.attrs.filter(function(a){return a.n!=="title"});var div={t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/columns."+cidx+".label",c:{r:"."},z:z}]}],m:[{t:13,n:"title",f:c.title||c.label},{t:16,r:"~/columns."+cidx+".attrsHP",z:z}]};if(c.type){div.m.push({t:13,n:"class-rtable-"+c.type+"-column"})}if(c.filter||c.sort){div.m.push({t:13,n:"class-rtable-sortable"},{t:4,n:53,r:"~/columns."+cidx,f:[{t:70,n:["click"],f:{r:["@this",".index","@event"],s:sortKey}}]})}div.m.push({t:13,n:"class-rtable-column"});if(c.fixed){var path=c.fixed.path||"~/columns."+cidx+".fixed";div.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:path}]});div.m.push({t:4,n:50,x:{r:["~/noWrap",path],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:path}]}]})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res});var rowCols=columns.filter(function(c){return c.hidden!==true}).map(function(c,cidx){var content=[{t:7,e:"div",f:[{t:16,r:"~/columns."+cidx+".content",c:{r:"."},z:z}]}];if(c.attrs.length){c.attrsP=c.attrs;c.attrs=[{t:16,r:"~/columns."+cidx+".attrsP",c:{r:"."},z:z}]}else{c.attrs=[]}var attrs=c.attrs;if(c.fixed){var path=c.fixed.path||"~/columns."+cidx+".fixed";attrs.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:path}]});attrs.push({t:4,n:50,x:{r:["~/noWrap",path],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:path}]}]})}if(c.editable&&(c.filter||c.editP)){var noclicky={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}};var editor=[{t:4,n:50,x:{r:["~/columns."+cidx+".editP"],s:"Array.isArray(_0)"},f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-edit"},noclicky],f:[{t:16,r:"~/columns."+cidx+".editP"}]}]},{t:4,n:50,l:1,x:{r:["~/columns."+cidx+".type"],s:"_0==='boolean'"},f:[{t:7,e:"input",m:[{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,r:c.filter}]},noclicky]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:c.filter}]},noclicky]}]}];if(typeof c.editable==="object"){attrs.push({t:13,n:"class-rtable-editing",f:c.editable});content=[Object.assign({},c.editable,{t:4,n:50,f:editor}),{t:4,n:51,l:1,f:content}]}else{attrs.push({t:13,n:"class-rtable-editing"});content=editor}}if(c.valign){attrs.push({t:13,n:"class-rtable-valign-col-top",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='top'"}}]},{t:13,n:"class-rtable-valign-col-bottom",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='bottom'"}}]},{t:13,n:"class-rtable-valign-col-center",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='center'"}}]})}var div={t:7,e:"div",f:content,m:attrs};if(c.type){attrs.unshift({t:13,n:"class-rtable-"+c.type+"-column"})}attrs.push({t:13,n:"class-rtable-column"});var title=c.attrsP&&c.attrsP.find(function(a){return a.n==="title"});if(!title){attrs.unshift({t:4,n:50,r:"~/autoTitles",f:[{t:13,n:"title",f:c.content.find(function(e){return e.e})?c.label:c.content}]})}else if(!title.f){attrs.unshift({t:13,n:"title",f:c.content.find(function(e){return e.e})?c.label:c.content});c.attrsP.splice(attrs.indexOf(title),1)}if(c.noPad===0){attrs.push({t:13,n:"class-rtable-no-pad"})}else if(c.noPad){attrs.push({t:13,n:"class-rtable-no-pad",f:c.noPad})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res});return[headerCols,rowCols,z]}var colAttrs=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"];var cell=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/;var empty=[];function construct(){var cmp=this.component;if(!cmp){return}var expandEl,hoverEl,groupEl,wrapperEl,rowEl,topEl,bottomEl,mappings;var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var id=0;function map(attr,partial,plain){if(attr&&attr.f&&attr.f.length===1&&attr.f[0].t===2){var n="_a"+id++;attrs.push({t:13,n:n,f:attr.f});if(plain){return n}return partial?{t:[{t:2,r:"~/"+n}]}:{t:2,r:"~/"+n}}return attr&&attr.f}function grabColumns(tpl){var columns=[];var fields=[];tpl.forEach(function(e){if(e.e==="column"||e.e==="col"){var col={};var attrs=e.m||empty;var attr;col.index=columns.length;columns.push(col);col.content=(e.f||[]).filter(function(e){return e.e!=="edit"&&e.e!=="header"});col.editP=(e.f||[]).find(function(e){return e.e==="edit"});if(col.editP){col.editP=col.editP.f}attr=attrs.find(function(a){return a.n==="id"});if(attr&&isString(attr.f)){col.id=attr.f}col.label=(e.f||[]).find(function(e){return e.e==="header"});if(col.label){col.label=col.label.f;col.title=attrs.find(function(a){return a.n==="label"});if(!col.title){col.title=attrs.find(function(a){return a.n==="header"})}if(col.title&&col.title.f){col.title=map(col.title)}}else{col.label=attrs.find(function(a){return a.n==="label"});if(!col.label){col.label=attrs.find(function(a){return a.n==="header"})}if(col.label&&col.label.f){col.label=map(col.label)}}if(!col.label){col.label=""}if(!col.id){col.id=col.label}if(!Array.isArray(col.label)){col.label=[col.label]}col.type=attrs.find(function(a){return a.n==="type"});if(col.type&&col.type.f){col.type=col.type.f}if(!col.type){col.type="string"}col.filter=attrs.find(function(a){return a.n==="filter"});if(col.filter&&col.filter.f){col.filter=map(col.filter);if(col.filter.r){col.filter=col.filter.r}}col.sort=attrs.find(function(a){return a.n==="sort"});if(col.sort&&col.sort.f){col.sort=map(col.sort);if(col.sort.r){col.sort=col.sort.r}}col.dir=attrs.find(function(a){return a.n==="dir"});if(col.dir&&col.dir.f){col.dir=map(col.dir);if(col.dir.r){col.dir=col.dir.r}}col.hidden=attrs.find(function(a){return a.n==="hidden"});if(col.hidden&&col.hidden.f===0){col.hidden=true}else if(col.hidden&&isObject(col.hidden.f)){col.hidden=map(col.hidden)}else{col.hidden=false}if(isString(col.hidden)){col.hidden=false}col.noPad=attrs.find(function(a){return a.n==="no-pad"});if(col.noPad&&col.noPad.f===0){col.noPad=0}else if(col.noPad&&isObject(col.noPad.f)){col.noPad=map(col.noPad)}else{delete col.noPad}col.editable=attrs.find(function(a){return a.n==="editable"});if(col.editable&&col.editable.f===0){col.editable=true}else if(col.editable&&isObject(col.editable.f)){col.editable=map(col.editable)}else{col.editable=false}col.valign=attrs.find(function(a){return a.n==="valign"});if(col.valign&&isObject(col.valign.f)){col.valign=map(col.valign)}else if(col.valign&&typeof col.valign.f==="string"){col.valign=col.valign.f}col.fixed=attrs.find(function(a){return a.n==="fixed"});if(col.fixed&&isObject(col.fixed.f)){col.fixed={path:map(col.fixed,false,true)}}else if(col.fixed&&typeof col.fixed.f==="string"){col.fixed=col.fixed.f}attr=attrs.find(function(a){return a.n==="get"});if(attr&&attr.f){var name=map(attr,false,true);field.get=function(val){var fn=this.get(name);return typeof fn==="function"?fn.call(this,val):undefined}}col.attrs=attrs.filter(function(a){return!~colAttrs.indexOf(a.n)});col.attrs.forEach(function(a,i){if(cell.test(a.n)){col.attrs[i]={t:13,n:"class-"+a.n}}})}else if(e.e==="field"){var field$1={};var attrs$1=e.m||empty;var a;a=attrs$1.find(function(a){return a.n==="path"});if(isString(a)){field$1.path=a}else if(a&&a.f){field$1.path=map(a)}a=attrs$1.find(function(a){return a.n==="value"});if(a&&a.f){field$1.value=map(a)}a=attrs$1.find(function(a){return a.n==="type"});if(isString(a)){field$1.type=a}else if(a&&a.f){field$1.type=map(a)}a=attrs$1.find(function(a){return a.n==="id"});if(isString(a.f)){field$1.id=a.f}a=attrs$1.find(function(a){return a.n==="dir"});if(isString(a)){field$1.dir=a}else if(a&&isString(a.f)){field$1.dir=a.f}a=attrs$1.find(function(a){return a.n==="label"});if(isString(a)){field$1.label=a}else if(a&&a.f){field$1.label=map(a)}a=attrs$1.find(function(a){return a.n==="get"});if(a&&a.f){var name$1=map(a,false,true);field$1.get=function(val){var fn=this.get(name$1);return typeof fn==="function"?fn.call(this,val):undefined}}if(!field$1.id){field$1.id=field$1.label}if(!field$1.path){field$1.path=field$1.id}fields.push(field$1)}});return{fields:fields,columns:columns}}expandEl=tpl.find(function(e){return e.e==="expand"});hoverEl=tpl.find(function(e){return e.e==="hover"});groupEl=tpl.find(function(e){return e.e==="group"});wrapperEl=tpl.find(function(e){return e.e==="wrapper"});rowEl=tpl.find(function(e){return e.e==="row"});topEl=tpl.find(function(e){return e.e==="top"});bottomEl=tpl.find(function(e){return e.e==="bottom"});this._init={sets:grabColumns(tpl),partials:{}};var columns=this._init.sets.columns;this._init.sets["meta.expand"]=expandEl&&expandEl.f&&expandEl.f.length&&expandEl.f;this._init.sets["meta.hover"]=hoverEl&&hoverEl.f&&hoverEl.f.length&&hoverEl.f;this._init.sets["meta.extra"]=rowEl&&rowEl.f&&rowEl.f.length&&rowEl.f;this._init.sets["meta.top"]=topEl&&topEl.f&&topEl.f.length&&topEl.f;this._init.sets["meta.topAttrs"]=topEl&&topEl.m;this._init.sets["meta.bottom"]=bottomEl&&bottomEl.f&&bottomEl.f.length&&bottomEl.f;this._init.sets["meta.bottomAttrs"]=bottomEl&&bottomEl.m;var ref=makeRows(columns);var headerCols=ref[0];var rowCols=ref[1];var z=ref[2];var header=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-header"},{t:4,f:[{n:"style-opacity",f:"0",t:13}],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}},{t:4,n:50,r:"~/fixedHeader",f:[{t:13,n:"style-padding-right",f:[{t:2,r:"~/scrollOffset"},"px"]}]}],f:[{t:7,e:"div",f:[{t:8,r:"grid-head-cols"}],m:[{t:13,n:"class-row"}]}]}];header[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-header"},{t:13,n:"class-rtable-column"},{t:13,n:"title",f:[{t:2,r:"selections.length"}," items selected"]},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]}],f:[{t:7,e:"div",f:[{t:4,n:50,r:"~/allowSelectAll",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:"selectAll"}]}]}],m:[{t:70,n:["clickd"],f:"selectAll"}]}]}]});var row=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-rtable-odd",f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-live"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-inner-row-wrap"}],f:[{t:7,e:"div",f:[{t:8,r:"grid-row-cols"}],m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-row"},{t:70,n:expandEl&&expandEl.f?["dblclickd"]:["click","dblclick"],f:{r:["@this","~/rows","~/visibleRows","."],s:"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]"}}]}]}]}];if(rowEl&&rowEl.m&&rowEl.m.length){this._init.sets.rowAttrs=rowEl.m.slice();row[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."},z:z})}if(wrapperEl&&wrapperEl.m&&wrapperEl.m.length){this._init.sets.wrapperAttrs=wrapperEl.m.slice();row[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."},z:z})}if(rowEl&&rowEl.f&&rowEl.f.length){row[0].f[0].f.push({t:7,e:"div",m:[{t:13,n:"class-rtable-row-extra"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."},z:z}]})}if(expandEl&&expandEl.f&&expandEl.f.length){var listener={t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}};var ev=expandEl.m&&expandEl.m.find(function(a){return a.n==="skip"});if(ev&&ev.f&&ev.f[0]&&ev.f[0].t===2){ev=Object.assign({},ev.f[0],{t:4,n:51,f:[listener]})}else{ev=listener}row[0].f[0].f.push({t:4,n:50,x:{r:[".","~/expanded"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/meta.expand",c:{r:"."},z:z}]}],m:[{t:13,n:"class-rtable-row-expand"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]});row[0].f[0].f[0].m.push(ev);row[0].f[0].f[1].f[0].m.push({t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}})}if(hoverEl&&hoverEl.f&&hoverEl.f.length){row[0].f[0].f.unshift({t:4,n:50,x:{r:[".","~/hovered"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-hover-content"}].concat(hoverEl.m||[]),f:[{t:16,r:"~/meta.hover",c:{r:"."},z:z}]}],m:[{t:13,n:"class-rtable-row-hover"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]});row[0].m.push({t:70,n:["mouseenter"],f:{r:["@this","@index"],s:"[_0._hover(_1)]"}},{t:70,n:["mouseleave"],f:{r:["@this","@index"],s:"[_0._unhover(_1)]"}})}row[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}]}]}]}]});var by;if(groupEl&&groupEl.m&&(by=groupEl.m.find(function(a){return a.n==="by"}))&&(isString(by.f)||by.length===1&&by[0].t===2)){var group={t:4,n:50,f:[{t:7,e:"div",m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-group"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:70,n:expandEl&&expandEl.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}].concat(groupEl.m.filter(function(a){return a.n!=="by"&&a.n!=="select"}))}],x:{s:"_0&&_1[(_1&&(_2*_3+_4))||_4]",r:["~/showGroups","~/groups","~/page","~/pagination.per","@index"]}};row.unshift(group);this._init.by=by.f;var parts=grabColumns(groupEl.f).columns.filter(function(c){return c.hidden!==true}).map(function(c){var div={t:7,e:"div",f:[{t:7,e:"div",f:c.content}],m:c.attrs};if(c.type){div.m.unshift({t:13,n:"class-rtable-"+c.type+"-column"})}div.m.push({t:13,n:"class-rtable-column"});if(!div.m.find(function(a){return a.n==="title"})){div.m.unshift({t:13,n:"title",f:c.content})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res});parts.unshift({t:4,n:50,r:"~/allowGroupSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}}]}]}]}]});var attr;if(attr=groupEl.m.find(function(a){return a.n==="select"})){(mappings||(mappings=[])).push(Object.assign({},attr,{n:"allowGroupSelect"}))}if(attr=groupEl.m.find(function(a){return a.n==="show"})){(mappings||(mappings=[])).push(Object.assign({},attr,{n:"showGroups"}))}group.f[0].f=parts}this._init.partials["grid-row"]=row;this._init.partials["grid-row-cols"]=rowCols;this._init.partials["grid-head"]=header;this._init.partials["grid-head-cols"]=headerCols;if(mappings&&this.component){this.component.mappings=mappings}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;if("includeGrid"in opts){Ractive.styleSet("table.includeGrid",opts.includeGrid)}instance.components[opts.name||"data-table"]=Table}}globalRegister("RauiTable","components",Table);export default plugin;
import Ractive from"ractive";import{grid,style as gridStyle}from"./grid";import click from"./event-click";import expand from"./transition-expand";import scrolled from"./scrolled";import{sized}from"./watch-size";import globalRegister from"./globalRegister";var sortRE=/^([-+])?([^\s]+)$/;function isString(v){return typeof v==="string"}function isNumber(v){return typeof v==="number"}function isObject(v){return typeof v==="object"}function isRegex(v){return typeof v==="object"&&Object.prototype.toString.call(v)==="RegExp"}export var Table=function(Ractive){function Table(opts){Ractive.call(this,opts)}if(Ractive)Table.__proto__=Ractive;Table.prototype=Object.create(Ractive&&Ractive.prototype);Table.prototype.constructor=Table;var prototypeAccessors={selections:{configurable:true},selected:{configurable:true},rows:{configurable:true},visibleRows:{configurable:true},allRows:{configurable:true}};Table.prototype._allSelected=function _allSelected(){var sel=this.get("selections");var visible=this.get("paginate")==="virtual"?this.get("rows"):this.get("visibleRows");for(var i=0;i<visible.length;i++){if(!~sel.indexOf(visible[i])){return false}}return visible.length&&true};Table.prototype._setSort=function _setSort(index,ev){var ref=[this.get("sort-handler"),this.get("@style.raui.table.sort-handler")];var localh=ref[0];var classh=ref[1];var fn=localh||classh;if(fn){fn(this,this.get("columns."+index),index,ev)}else{var sort=this.get("sort")||"";var col=this.get("columns."+index);var id=col.id;if(sort===id||sort.substr(1)===id){if(sort[0]==="-"){this.set("sort",id)}else{this.set("sort","-"+id)}}else{this.set("sort",id)}}};Table.prototype.nodeSet=function nodeSet(node,prop,value){node[prop]=value};Table.prototype._expand=function _expand(idx){var this$1=this;var which=this.get("visibleRows")[idx];var current=this.get("expanded");var expanded=this.find(".rtable-row-expand");if(expanded){this.transition("expand",expanded,{outro:true}).then(function(){if(current===which){this$1.set("expanded",null)}else{this$1.set("expanded",which);this$1.transition("expand",this$1.find(".rtable-row-expand"),{intro:true})}})}else{if(which===current){this.set("expanded",null)}else{this.set("expanded",which);this.transition("expand",this.find(".rtable-row-expand"),{intro:true})}}};Table.prototype._hover=function _hover(idx){this.set("hovered",this.get("~/visibleRows")[idx]);return false};Table.prototype._unhover=function _unhover(idx){if(this.find(".rtable-top .rtable-row-wrap:hover")){return}else{this.set("hovered",undefined)}return false};Table.prototype._select=function _select(src,ev){var sels=this.get("selections");if(!sels){sels=[];this.set("selections",sels)}var i=sels.indexOf(src);if(~i){this.splice("selections",i,1)}else{this.push("selections",src)}if(i>=sels.length||sels.length===1){this.set("selected",sels[sels.length-1])}this.fire("selection",{},{item:sels[sels.length-1],items:sels});setTimeout(function(){return ev.target.checked=!~i});return false};Table.prototype._open=function _open(row,idx,vidx){var this$1=this;if(this._opentm){return}this.fire("selected",{},row,idx,vidx);this._opentm=setTimeout(function(){this$1._opentm=null},500)};Table.prototype.select=function select(){var selected=this.get("selected");if(selected){this.fire("selected",{},selected,this.get("rows").indexOf(selected),this.get("visibleRows").indexOf(selected))}};Table.prototype.deselect=function deselect(){this.set({selections:[],selected:undefined})};prototypeAccessors.selections.get=function(){return this.get("selections")||[]};prototypeAccessors.selections.set=function(v){var rows=this.get("rows");var sels=Array.isArray(v)?v.filter(function(i){return~rows.indexOf(i)}):[];this.set("selections",sels)};prototypeAccessors.selected.get=function(){return this.get("selected")};prototypeAccessors.selected.set=function(v){this.set({selected:v,selections:[v]})};prototypeAccessors.rows.get=function(){return this.get("rows")};prototypeAccessors.visibleRows.get=function(){return this.get("visibleRows")};prototypeAccessors.allRows.get=function(){return this.get("items")};Table.prototype.selectionOffset=function selectionOffset(offset){var selected=this.get("selected");var visible=this.get("visibleRows");if(!selected||!~visible.indexOf(selected)){var next=offset>0?visible[0]:visible[visible.length-1];this.set({selected:next,selections:[next]})}else{var idx=visible.indexOf(selected);if(offset>0?idx+offset>=visible.length:idx+offset<0){var move=offset<1?-1:1;if(move<0&&this.get("page")+move>=0||move>0&&this.get("page")+move<this.get("pagination.total")){this.add("page",move)}visible=this.get("visibleRows");var next$1=offset>0?visible[0]:visible[visible.length-1];this.set({selected:next$1,selections:[next$1]})}else{this.set({selected:visible[idx+offset],selections:[visible[idx+offset]]})}}this.fire("selection",{},{item:this.get("selected"),items:this.get("selections")})};Table.prototype.selectionDown=function selectionDown(){this.selectionOffset(1)};Table.prototype.selectionUp=function selectionUp(){this.selectionOffset(-1)};Table.prototype._selectGroup=function _selectGroup(idx){var grp=idx;if(this.get("page")){grp+=this.get("page")*this.get("pagination.per")}var rows=this.get("rows");var groups=this.get("groups");var sels=this.get("selections");var x=rows[grp++];var xs=["selections"];var ss=[];var i;if(!~(i=sels.indexOf(x))){xs.push(x)}else{ss.push(i)}while(grp<rows.length&&!(grp in groups)){x=rows[grp++];if(!~(i=sels.indexOf(x))){xs.push(x)}else{ss.push(i)}}if(xs.length===1){i=ss.length;while(i--){this.splice("selections",ss[i],1)}}else{this.push.apply(this,xs)}return false};Table.prototype._groupSelected=function _groupSelected(idx){var grp=idx;if(this.get("page")){grp+=this.get("page")*this.get("pagination.per")}var rows=this.get("rows");var groups=this.get("groups");var sels=this.get("selections");if(!~sels.indexOf(rows[grp++])){return false}while(grp<rows.length&&!(grp in groups)){if(!~sels.indexOf(rows[grp++])){return false}}return true};Table.prototype._rows=function _rows(){var src=(this.get("items")||[]).slice();var filter=this.get("filter");var sort=this.get("sort");var ref=[this.get("data-handler"),this.get("@style.raui.table.data-handler")];var localh=ref[0];var classh=ref[1];var handler=localh||classh||defaultFilter;if(!filter&&!sort){this.set("isFiltered",false);return this.set("rows",src)}var res=handler(this,src,filter,sort,this.get("parameters",{virtual:true}));this.set("isFiltered",res.length!==src.length);this.set("rows",res);var sels=this.get("selections");this.set("selections",sels.filter(function(s){return~src.indexOf(s)}));if(!~src.indexOf(this.get("selection"))){this.set("selected",undefined)}};Table.prototype.replaceColumns=function replaceColumns(columns){var ref=makeRows(columns);var headerCols=ref[0];var rowCols=ref[1];this.set("columns",columns);this.resetPartial("grid-row-cols",rowCols);this.resetPartial("grid-head-cols",headerCols)};Object.defineProperties(Table.prototype,prototypeAccessors);return Table}(Ractive);function scrollother(node,find){var this$1=this;var scroll=function(ev){if(scrollother.lock&&scrollother.lock!==node){return}if(scrollother.tm){clearTimeout(scrollother.tm)}scrollother.lock=node;this$1.find(find).scrollLeft=ev.target.scrollLeft;scrollother.tm=setTimeout(function(){scrollother.tm=null;scrollother.lock=false},100)};node.addEventListener("scroll",scroll,{passive:true});return{teardown:function teardown(){node.removeEventListener("scroll",scroll)}}}Table.settings={valign:"center",border:false,"fixed-header":true,"allow-select":true,"allow-select-all":true,"auto-titles":false,paginate:"virtual"};Ractive.extendWith(Table,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable",g:1},{n:"class-rtable-virtual",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="virtual"'}}]},{n:"class-rtable-auto",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="auto"'}}]},{n:"class-rtable-fixed",t:13,f:[{t:2,r:"~/fixed"}]},{n:"class-rtable-border",t:13,f:[{t:2,r:"~/border"}]},{n:"class-rtable-fixed-header",t:13,f:[{t:2,r:"~/fixedHeader"}]},{n:"class-rtable-scrolled-down",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{n:"class-rtable-scrolled-up",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("bottom")'}}]},{n:"class-rtable-with-select",t:13,f:[{t:2,r:"~/allowSelect"}]},{n:"class-rtable-valign-top",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="top"'}}]},{n:"class-rtable-valign-center",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="center"'}}]},{n:"class-rtable-valign-bottom",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="bottom"'}}]},{n:"class-rtable-nowrap",t:13,f:[{t:2,r:"~/noWrap"}]},{n:"class-rtable-wrap",t:13,f:[{t:2,x:{r:["~/noWrap"],s:"!_0"}}]},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-fixed",g:1},{n:"grid",t:71,f:{r:["~/scrollOffset"],s:"[{offset:_0}]"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,r:"meta.top"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1},{t:4,f:[{n:"scrollother",t:71,f:{r:[],s:'[".rtable-top"]'}}],n:50,r:"~/noWrap"}],f:[{t:8,r:"grid-head"}]}],n:51,r:"~/noHeader"}]}],n:50,x:{r:["~/noHeader","meta.top","~/fixedHeader"],s:"(!_0||_1)&&_2"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-top",g:1},{t:4,f:[{n:["scrolled"],t:70,f:"scroll"},{n:"sized",t:71,f:{r:[],s:'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]'}}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scroll"]'}}],n:50,x:{r:["~/noHeader","~/fixedHeader","~/meta.bottom","~/paginate"],s:'(!_0&&_1)||_2||_3==="virtual"'}},{t:4,f:[{n:"scrollother",t:71,f:{r:[],s:'[".rtable-header-wrapper"]'}}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,x:{r:["~/fixedHeader","meta.top"],s:"!_0&&_1"}}," ",{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]'}},{t:4,f:[{n:"style-margin-top",f:[{t:2,r:"~/virtual.above"},"px"],t:13},{n:"style-margin-bottom",f:[{t:2,r:"~/virtual.below"},"px"],t:13}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&!_1"}}," ",{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,z:[{n:"source",x:{r:"~/items"}},{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/visibleRows"}],n:50,r:"~/shuffle"},{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,r:"~/visibleRows"}],n:51,l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-row row t1",g:1}],f:[{t:16,r:"empty",z:[{n:"message",x:{r:"~/empty"}}]}]}],n:50,x:{r:["~/rows.length"],s:"!_0"}}]}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-bottom",g:1},{t:4,f:[{t:16,r:"meta.bottomAttrs"}],n:50,r:"meta.bottomAttrs"}],f:[{t:4,f:[{t:16,r:"meta.bottom",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}],n:50,r:"~/meta.bottom"}," ",{t:4,f:[{t:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],n:50,x:{r:["~/paginate","~/meta.bottom"],s:'_0!=="virtual"||_1'}}]}],e:{'_0==="virtual"':function(_0){return _0==="virtual"},'_0==="auto"':function(_0){return _0==="auto"},'!~(_0||"").indexOf("top")':function(_0){return!~(_0||"").indexOf("top")},'!~(_0||"").indexOf("bottom")':function(_0){return!~(_0||"").indexOf("bottom")},'_0==="top"':function(_0){return _0==="top"},'_0==="center"':function(_0){return _0==="center"},'_0==="bottom"':function(_0){return _0==="bottom"},"!_0":function(_0){return!_0},"[{offset:_0}]":function(_0){return[{offset:_0}]},'[".rtable-top"]':function(){return[".rtable-top"]},"(!_0||_1)&&_2":function(_0,_1,_2){return(!_0||_1)&&_2},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},'(!_0&&_1)||_2||_3==="virtual"':function(_0,_1,_2,_3){return!_0&&_1||_2||_3==="virtual"},'[".rtable-header-wrapper"]':function(){return[".rtable-header-wrapper"]},"_0&&_1":function(_0,_1){return _0&&_1},"!_0&&_1":function(_0,_1){return!_0&&_1},'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]':function(){return[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]},"!_0&&!_1":function(_0,_1){return!_0&&!_1},true:function(){return true},'_0!=="virtual"':function(_0){return _0!=="virtual"},'_0!=="virtual"||_1':function(_0,_1){return _0!=="virtual"||_1},"(_0+_1)%2===1":function(_0,_1){return(_0+_1)%2===1},"[_0._setSort(_1,_2)]":function(_0,_1,_2){return[_0._setSort(_1,_2)]},"[_0._select(_1,_2),false]":function(_0,_1,_2){return[_0._select(_1,_2),false]},"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]":function(_0,_1,_2,_3){return[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]},"[_0._expand(_1)]":function(_0,_1){return[_0._expand(_1)]},"[_0.stopPropagation()]":function(_0){return[_0.stopPropagation()]},"_0.indexOf(_1)":function(_0,_1){return _0.indexOf(_1)},"_0===_1":function(_0,_1){return _0===_1},"_0>0":function(_0){return _0>0},"!_0&&_1>0":function(_0,_1){return!_0&&_1>0},'_0==="boolean"':function(_0){return _0==="boolean"},"_0._allSelected()":function(_0){return _0._allSelected()},'_0||"No data."':function(_0){return _0||"No data."},"_0*_1+1":function(_0,_1){return _0*_1+1},"_2+1===_0?_1:(_2+1)*_3":function(_0,_1,_2,_3){return _2+1===_0?_1:(_2+1)*_3},"_0===1":function(_0){return _0===1},"_0._allSelected()&&_1<_2":function(_0,_1,_2){return _0._allSelected()&&_1<_2},'[_0.set("page",_1-1)]':function(_0,_1){return[_0.set("page",_1-1)]},'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]':function(_0,_1,_2,_3,_4){return[/^\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1)||_2.nodeSet(_3,"value",_4+1)]},"_0==_1+1":function(_0,_1){return _0==_1+1},'[_0.set("page",_2[_1-1])]':function(_0,_1,_2){return[_0.set("page",_2[_1-1])]},'_0==="..."':function(_0){return _0==="..."},'[_0.set("page",_1+1)]':function(_0,_1){return[_0.set("page",_1+1)]},"_0<_1-1":function(_0,_1){return _0<_1-1}},p:{"csp-dummy":[{t:7,e:"div",m:[{n:"class-rtable-odd",t:13,f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{n:"class-top",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="top"'}}]},{n:"class-bottom",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="bottom"'}}]},{n:"class-center",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="center"'}}]},{n:["click"],t:70,f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}},{n:["click"],t:70,f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}},{n:["click"],t:70,f:{r:["@this","~/rows","~/visibleRows","."],s:"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]"}},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},{n:["click"],t:70,f:{r:["@event"],s:"[_0.stopPropagation()]"}}]}," ",{t:4,f:["..."],n:50,x:{r:["~/selections","."],s:"_0.indexOf(_1)"}}," ",{t:4,f:["..."],n:50,x:{r:[".","~/expanded"],s:"_0===_1"}}," ",{t:4,f:["..."],n:50,x:{r:["~/virtual.offset"],s:"_0>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/columns.0.type"],s:'_0==="boolean"'}}," ",{t:4,f:["..."],n:50,x:{r:["@this"],s:"_0._allSelected()"}}],empty:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:2,x:{r:["message"],s:'_0||"No data."'}}]}]}],pagination:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pagination",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-info",g:1}],f:[{t:4,f:[{t:2,x:{r:["~/page","~/pagination.per"],s:"_0*_1+1"}}," - ",{t:2,x:{r:["~/pagination.total","~/rows.length","~/page","~/pagination.per"],s:"_2+1===_0?_1:(_2+1)*_3"}}," of ",{t:2,r:"~/rows.length"},{t:4,f:[" (",{t:2,r:"~/items.length"}," total)"],n:50,r:"~/isFiltered"}],n:50,x:{r:["pagination","rows.length"],s:"_0&&_1"}}," ",{t:4,f:["​"],n:50,x:{r:["_paginate"],s:"_0===1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-select-all-all",g:1}],f:[{t:4,f:[{t:7,e:"strong",f:[{t:2,r:"selections.length"}]}," of ",{t:7,e:"strong",f:[{t:2,r:"rows.length"}]}," selected",{t:4,f:[" - ",{t:7,e:"a",m:[{n:"href",f:"#",t:13,g:1},{n:["click"],t:70,f:"selectAllAll"}],f:["Select All"]}],n:50,x:{r:["@this","selections.length","rows.length"],s:"_0._allSelected()&&_1<_2"}}],n:50,x:{r:["selections.length"],s:"_0>0"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pages",g:1}],f:[{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1-1)]'}}],f:["Previous"]}],n:50,x:{r:["~/page"],s:"_0>0"}}," ",{t:4,f:[{t:4,f:[{t:7,e:"input",m:[{n:["change"],t:70,f:{r:["~/pagination.total","@node.value","@this","@node","~/page"],s:'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]'}},{n:"value",f:[{t:2,r:"."}],t:13},{t:73,v:"t",f:"false"}]}],n:50,x:{r:[".","~/page"],s:"_0==_1+1"}},{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","@index","../"],s:'[_0.set("page",_2[_1-1])]'}}],f:["..."]}," "],n:50,x:{r:["."],s:'_0==="..."'},l:1},{t:4,f:[" ",{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","."],s:'[_0.set("page",_1-1)]'}}],f:[{t:2,r:"."}]}],n:51,l:1}],n:52,r:"~/pagination.array"}," ",{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1+1)]'}}],f:["Next"]}],n:50,x:{r:["~/page","~/pagination.total"],s:"_0<_1-1"}}]}]}]}},css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.table.primary"));var active=Object.assign({},primary,data("raui.primary.active"),data("raui.table.primary.active"));var table=Object.assign({selected:{},header:{},footer:{}},data("raui.table"));return"\n .rtable {\n display: flex;\n flex-direction: column;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n }\n \n .rtable.rtable-border {\n border: 1px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header {\n min-height: 2em;\n }\n \n .rtable-group > div > div,\n .rtable-header > div > div,\n .rtable-row > div > div {\n padding: "+(table.padding||"0.5em")+";\n overflow: inherit;\n text-overflow: inherit;\n line-height: 1em;\n }\n .rtable-row > .rtable-no-pad > div {\n padding: 0;\n }\n \n .rtable-auto .row > *,\n .rtable-fixed .row > *\n {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n \n .rtable-header > div > div, .rtable-column {\n overflow: hidden;\n }\n \n .rtable-number-column {\n text-align: right;\n }\n .rtable-date-column {\n text-align: right;\n }\n \n .rtable-sortable {\n cursor: pointer;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .grid .row.rtable-row, .grid .rtable-header > .row {\n width: auto;\n min-width: min-content;\n flex-grow: 1;\n }\n \n .rtable-nowrap .grid .rtable-row, .rtable-nowrap .grid .rtable-header > .row {\n flex-wrap: nowrap;\n }\n .rtable-nowrap .rtable-row-wrap, .rtable-inner-row-wrap {\n flex-grow: 1;\n } \n \n .rtable-row-wrap {\n display: flex;\n flex-grow: 1;\n align-items: center;\n z-index: 2;\n align-items: stretch;\n color: "+(primary.fg||"#222")+";\n background-color: "+(table.even||primary.bga||"#f4f4f4")+";\n }\n .rtable-row-wrap:focus-within {\n z-index: 3;\n }\n .rtable-row-wrap.rtable-odd {\n background-color: "+(table.odd||primary.bg||"#fff")+";\n }\n .rtable-row-wrap:hover .rtable-inner-row-wrap, .rtable-row-wrap:hover .rtable-select-row {\n background-color: "+(table.over||active.bg||"#e6f0fa")+";\n }\n .rtable-row-wrap:hover .rtable-inner-row-wrap,\n .rtable-wrap .rtable-row-wrap:hover .rtable-select-row {\n position: relative;\n }\n .rtable-row-wrap:hover .rtable-select-row {\n overflow: visible;\n }\n \n .rtable-row-wrap:hover {\n border-bottom: "+(table.dividerSize||"4px")+" solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-row-wrap.rtable-selected {\n background-color: "+(table.selected.bg||"#cee5fd")+";\n color: "+(table.selected.fg||primary.fg||"#222")+";\n }\n .rtable-row-wrap.rtable-selected.rtable-odd {\n background-color: "+(table.selected.odd||"#c5dffb")+";\n }\n \n .rtable-nowrap .rtable-row-wrap {\n display: inline-flex;\n min-width: 100%;\n box-sizing: border-box;\n }\n \n .rtable-nowrap > .rtable-top > .grid {\n line-height: 1em;\n }\n \n .rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 0 0 1px;\n margin: 0 0 0 -1px;\n }\n .rtable-wrap.rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-width: 0 0 1px 1px;\n margin: 0 0 -1px -1px;\n }\n \n .rtable-border .rtable-header .rtable-column {\n border-width: 0 0 0 0;\n margin: 0 0 0 0;\n }\n .rtable-wrap.rtable-border .rtable-header .rtable-column {\n border-width: 0 0 1px 0;\n margin: 0 0 -1px 0;\n }\n \n .rtable-border .rtable-row .rtable-column:nth-child(1),\n .rtable-border .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 0;\n }\n .rtable-border.rtable-with-select .rtable-row .rtable-column:nth-child(1),\n .rtable-border.rtable-with-select .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 1px;\n }\n \n .rtable-border .rtable-row-wrap {\n border-bottom-width: 1px;\n }\n \n .rtable-border .rtable-row-expand, .rtable-border .rtable-row-extra {\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin-left: -1px;\n width: 100%;\n }\n .rtable-border.rtable-with-select .rtable-row-expand, .rtable-border.rtable-with-select .rtable-row-extra {\n border-left-width: 1px;\n }\n \n .rtable-row-expand, .rtable-row-extra {\n box-sizing: border-box;\n padding: "+(table.padding||"0.5em")+";\n }\n \n .rtable-row-hover {\n pointer-events: none;\n position: relative;\n z-index: 1;\n }\n .rtable-row-hover-content {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n }\n .rtable-row-hover-content > * {\n pointer-events: visible;\n }\n \n .rtable-group {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header.rtable-row-wrap:hover {\n font-weight: bold;\n background-color: "+(table.header.bg||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n background-color: "+(table.header.bg||"#dedede")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header-extra.rtable-noheader {\n border-bottom: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-header-extra {\n background-color: "+(table.header.bg||"#dedede")+";\n padding: "+(table.padding||"0.5em")+";\n line-height: 1em;\n z-index: 4;\n box-sizing: border-box;\n min-width: 100%;\n }\n .rtable-nowrap .rtable-header-extra {\n position: sticky;\n left: 0;\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n position: relative;\n z-index: 3;\n }\n .rtable-fixed-header.rtable-scrolled-down .rtable-header-fixed {\n box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15), 0 0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper::-webkit-scrollbar {\n height: 0;\n }\n .rtable-fixed-header .rtable-header-fixed::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n \n .rtable-nowrap .rtable-fixed-column, .rtable-nowrap .rtable-row-extra, .rtable-nowrap .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n position: -webkit-sticky;\n position: sticky;\n left: 0;\n }\n .rtable-border..rtable-nowrap .rtable-fixed-column, .rtable-border.rtable-nowrap .rtable-row-extra, .rtable-border.rtable-nowrap .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: 1px;\n }\n .rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtable-nowrap.rtable-with-select .rtable-row-extra, .rtable-nowrap.rtable-with-select .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: "+(table.selectWidth||"2em")+";\n }\n .rtabe-border.rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-extra, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: "+(table.selectWidth||"2em")+";\n }\n \n .rtable-nowrap .rtable-inner-row-wrap {\n background-color: inherit;\n }\n \n .rtable-nowrap .row,\n .rtable-nowrap .rtable-fixed-column,\n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n background-color: inherit;\n z-index: 1;\n }\n \n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n position: sticky;\n position: -webkit-sticky;\n left: 0;\n z-index: 1;\n }\n .rtable-nowrap .rtable-select-header {\n z-index: 2;\n }\n \n .rtable-nowrap.rtable-border .rtable-fixed-column {\n border-right-width: 1px;\n }\n \n .rtable-scrolled-up .rtable-bottom {\n box-shadow: 0 -1px 2px 0 rgba(60, 64, 67, 0.3), 0 -1px 3px 1px rgba(60, 64, 67, 0.15), 0 -0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-bottom {\n padding: "+(table.padding||"0.5em")+";\n background-color: "+(table.footer.bg||table.header.bg||"#dedede")+";\n border-top: 2px solid "+(table.divider||primary.bc||"#ccc")+";\n }\n \n .rtable-pagination {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n justify-content: space-between;\n user-select: none;\n }\n \n .rtable-pages span {\n margin: 0.3em;\n cursor: pointer;\n }\n .rtable-pages span:first-of-type {\n margin-left: 0;\n }\n .rtable-pages input {\n text-align: center;\n width: 2.5em;\n font-size: 1em;\n background-color: transparent;\n border: none;\n padding: 0;\n font-weight: bold;\n text-decoration: underline;\n }\n \n /* checkboxes */\n .rtable-select {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n position: absolute;\n display: block;\n margin: 0;\n width: 3em;\n height: 3em;\n box-shadow: none;\n outline: none;\n opacity: 0;\n top: -0.75em;\n left: -0.75em;\n border-radius: 2em;\n transition: transform 0.2s, opacity 0.2s;\n background-color: "+(primary.bc||"#ccc")+";\n cursor: pointer;\n }\n \n .rtable-select-header > div, .rtable-select-row > div, .rtable-header > div.rtable-select-header > div {\n padding: 0;\n overflow: visible;\n width: 1.5em;\n height: 1.5em;\n position: relative;\n line-height: 1.8em;\n cursor: pointer;\n display: flex;\n justify-content: space-around;\n align-items: center;\n flex-grow: 0;\n display: block;\n }\n \n .rtable-select:checked {\n background-color: "+(primary.fga||"#07e")+';\n }\n \n .rtable-select-header:hover .rtable-select, .rtable-select-row:hover .rtable-select {\n opacity: 0.04;\n }\n \n .rtable-select:focus {\n opacity: 0.12;\n transform: scale(1);\n }\n \n .rtable-select-header:hover .rtable-select:focus, .rtable-select-row:hover .rtable.select:focus {\n opacity: 0.16;\n }\n \n .rtable-select:active {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n \n .rtable-select-row > div:before, .rtable-select-header > div:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n border: solid 0.125em; /* Safari */\n border-color: '+(primary.fg||"#222")+";\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n position: absolute;\n top: 0.3em;\n left: 0.15em;\n transition: border-color 0.2s, background-color 0.2s;\n }\n \n .rtable-select-row > div:after, .rtable-select-header > div:after {\n content: '';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 0.3em;\n left: 0.15em;\n border-radius: 0.125em;\n }\n \n .rtable-selected .rtable-select-row > div:before, .rtable-all-selected > div:before {\n border-color: "+(primary.fga||"#07e")+";\n }\n \n .rtable-selected .rtable-select-row > div:after, .rtable-all-selected > div:after {\n border-color: "+(primary.bg||"#fff")+';\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(primary.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(primary.fga||"#07e")+";\n opacity: 1;\n }\n \n .rtable-row-wrap > .rtable-select-header,\n .rtable-row-wrap > .rtable-select-row {\n text-align: center;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: "+(table.selectWidth||"2em")+";\n }\n \n .rtable-row-wrap > .rtable-select-row {\n border-style: solid;\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n }\n \n .rtable-inner-row-wrap {\n border-style: solid;\n border-color: "+(table.divider||primary.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n }\n \n .rtable-column button, .rtable-column .btn {\n padding: 0 0.5em;\n margin: 0.2em 0.5em;\n min-height: 0;\n }\n \n .rtable-column.rtable-editing, .rtable-column.rtable-editing > .rtable-edit {\n padding: 0;\n }\n .rtable-column.rtable-editing input {\n width: 100%;\n box-sizing: border-box;\n height: 100%;\n margin: 0;\n border: none;\n background-color: transparent;\n padding: 0.25em 0.5em;\n }\n \n .rtable-valign-top .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-top > div {\n display: flex;\n height: 100%;\n align-items: flex-start;\n box-sizing: border-box;\n }\n .rtable-valign-bottom .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-bottom > div {\n display: flex;\n height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n }\n .rtable-valign-center .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-center > div {\n display: flex;\n height: 100%;\n align-items: center;\n box-sizing: border-box;\n }\n "+(data("table.includeGrid")?gridStyle(data):"")}.call(this,data)].join(" ")},cssId:"rtable",noCssTransform:true,attributes:["auto-titles","paginate","items","filter","data-handler","sort-handler","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap","parameters"],components:{table:false,Table:false},syncComputedChildren:true,decorators:{grid:grid,sized:sized,scrollother:scrollother},events:{},use:[click({name:"clickd",count:1}),click({name:"dblclickd",count:2}),expand(),scrolled()],on:{construct:construct,config:function config(){this.set(this._init.sets);Object.assign(this.partials,this._init.partials)},render:function render(){if(this._autoObserver){this._autoObserver.fire()}},selectAll:function selectAll(){var sel,item;if(this._allSelected()){item=null;sel=[];this.set({selections:sel,selected:item})}else{sel=(this.get("paginate")==="virtual"?this.get("rows"):this.get("visibleRows")).slice();item=sel[0];this.set({selections:sel,selected:item})}this.fire("selection",{},{item:item,items:sel});return false},selectAllAll:function selectAllAll(){var item=null;var sel=this.get("rows").slice();this.set({selections:sel,selected:item});this.fire("selection",{},{item:item,items:sel});return false}},observe:{_rows:function _rows(){var this$1=this;if(this._rowbounce){clearTimeout(this._rowbounce)}setTimeout(function(){return this$1._rows()},this.get("@style.raui.table.debounce")||160)},paginate:{handler:function handler(v){var this$1=this;if(v==="auto"||v==="virtual"||v instanceof Ractive){if(this._autoObserver){this._autoObserver.cancel()}if(this._scrollListener){this._scrollListener.cancel()}var root=v==="auto"||v==="virtual"?this.root:v;var sized=false;var fn=function(){if(!this$1.rendered){return}var top=this$1.find(".rtable-top");if(!top){return}if(!this$1.get("items.length")){if(!this$1._autoLenObserver){this$1._autoLenObserver=this$1.observeOnce("items",function(){this$1._autoLenObserver=0;setTimeout(fn)})}return}var size=top.clientHeight+","+top.clientWidth;if(fn.last===size&&sized){return}{var ctx=this$1.getContext(top);if(ctx.decorators&&ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}}var header=this$1.find(".rtable-header")||{};var rows=Array.apply(null,this$1.findAll(".rtable-live")).map(function(r){return r.offsetHeight});if(rows.length<5){var auto=Math.floor(top.clientHeight/(header.offsetHeight||1));if(auto<5){auto=5}this$1.set("_paginate",auto);rows=Array.apply(null,this$1.findAll(".rtable-live")).map(function(r){return r.offsetHeight})}if(rows.length>0){sized=true}else{rows=[25]}var avg=Math.ceil(rows.reduce(function(a,c){return a+c},0)/rows.length);this$1._avgSize=avg;var fit=Math.floor((top.clientHeight-(header.offsetHeight||1))/avg);if(v==="virtual"){fit=fit+10;if(fit<30){fit=30}}this$1.set("_paginate",fit);fn.last=size};var tm;var fnd=function(){if(tm){clearTimeout(tm)}tm=setTimeout(function(){fn();tm=null;if(sized&&this$1._scrollListener){this$1._scrollListener.fn()}},50)};this._autoObserver=this.observe("~/tableHeight",fnd);this._autoObserver.fire=fnd;if(v==="virtual"){var lock=false;var node;var fn$1=function(){if(!this$1.rendered){node=null;return}if(!node){node=this$1.find(".rtable-top")}if(!sized){return fnd()}var top=node.scrollTop;var virtual=this$1.get("virtual")||{};var offset=virtual.offset;var visible=this$1.get("_paginate");var page=visible-10;var count=this$1.get("rows.length");if(visible>count){visible=count}var avg=this$1._avgSize;var pageSize=page*avg;var wnd=Math.floor(top/avg);var first=wnd-5;if(first<0){first=0}var hardFirst=first;if(first+visible>count){first=count-visible}if(offset===first&&!isNaN(virtual.top)){return lock=false}if(!isNumber(offset)||isNaN(offset)||isNaN(virtual.top)||top<virtual.top+pageSize||top>virtual.bottom-pageSize||offset>0&&top<avg*page){var amtAbove=hardFirst;var amtBelow=count-hardFirst-visible;if(amtAbove<0){amtBelow+=amtAbove*-1;amtAbove=0}else if(amtAbove>count-visible){amtAbove=count-visible}if(amtBelow<0){amtBelow=0}var above=amtAbove*avg;var below=amtBelow*avg;var vis,next;if(first<offset+visible&&first>offset-visible){if(first>offset){vis=this$1.findAll(".rtable-live")[first-offset]}else{vis=this$1.findAll(".rtable-live")[offset-first]}}if(vis&&first>0&&vis.offsetTop>node.scrollTop-pageSize-5&&vis.offsetTop<node.scrollTop+pageSize){next=vis.offsetTop}this$1.set({"virtual.above":above,"virtual.below":below,"virtual.offset":first});if(typeof next==="number"){if(next!==vis.offsetTop){this$1.set("virtual.above",above+(next-vis.offsetTop))}}this$1.set({"virtual.top":this$1.get("virtual.above"),"virtual.bottom":node.scrollHeight-below})}lock=false};var scroll=this._scrollListener=this.on("scroll",function(ref){var node=ref.node;if(!lock){lock=true;requestAnimationFrame(fn$1)}});scroll.fn=fn$1;scroll.observer=this.observe("rows.length",function(){this$1.set("virtual.offset",null);fn$1()},{init:false,strict:true,defer:true});var cancel=scroll.cancel;scroll.cancel=function(){cancel();scroll.observer.cancel()}}fnd()}else{if(this._autoObserver){this._autoObserver.cancel()}if(this._scrollListener){this._scrollListener.cancel()}}if(isNumber(v)){this.set("_paginate",v)}},defer:true},"scrollOffset tableHeight":{handler:function handler(){var this$1=this;requestAnimationFrame(function(){if(this$1.rendered){var top=this$1.find(".rtable-top");var ctx=top&&this$1.getContext(top);if(ctx&&ctx.decorators&&ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}}})},init:false},scroll:function scroll(v,o){if(~(v||"").indexOf("top")&&!~(o||"").indexOf("top")){this.fire("scrolltop",{})}if(~(v||"").indexOf("bottom")&&!~(o||"").indexOf("bottom")){this.fire("scrollbottom",{})}}},data:function data(){return Object.assign({page:0,selections:[],showGroups:true,allowGroupSelect:true,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:false,rows:[]},Table.settings)},computed:{allowSelect:function allowSelect(){return this.get("allow-select")},allowSelectAll:function allowSelectAll(){return this.get("allow-select-all")},fixedHeader:function fixedHeader(){return this.get("fixed-header")},autoTitles:function autoTitles(){return this.get("auto-titles")},noHeader:function noHeader(){return this.get("no-header")},noWrap:function noWrap(){return this.get("no-wrap")},_rows:function _rows(){var src=(this.get("items")||[]).slice();var filter=this.get("filter");var sort=this.get("sort");var params=this.get("parameters");var ref=[this.get("data-handler"),this.get("@style.raui.table.data-handler")];var localh=ref[0];var classh=ref[1];var ref$1=[this.get("data-pre-handler"),this.get("@style.raui.table.data-pre-handler")];var localp=ref$1[0];var classp=ref$1[1];if(localp||classp){(localp||classp)(this,src,filter,sort,params)}return{}},visibleRows:function visibleRows(){var this$1=this;var rows=this.get("rows");var paginate=this.get("paginate");var per=paginate;var intPer=this.get("_paginate");var offset=this.get("page")||0;var virtual=this.get("virtual");if(!per){return rows}if(typeof per!=="number"&&isNaN(+per)){if(per==="auto"||per==="virtual"||per instanceof Ractive){per=intPer||1}else{per=30}}if(per<this.get("minPerPage")){per=this.get("minPerPage")}if(paginate==="virtual"){offset=virtual&&virtual.offset||0;return rows.slice(offset,offset+per)}else{if(offset*per>rows.length){setTimeout(function(){return this$1.set("page",0)},0)}return rows.slice(per*offset,per*offset+per)}},pagination:function pagination(){var items=this.get("items")||empty;var rows=this.get("rows");var paginate=this.get("paginate");var per=paginate;var offset=this.get("page")||0;if(typeof per!=="number"&&isNaN(per)){per=this.get("_paginate")}if(per<this.get("minPerPage")){per=this.get("minPerPage")}if(!per){return}var total=Math.ceil(rows.length/per);var info={max:Math.ceil(items.length/per),total:total,per:per};if(paginate==="virtual"){info.height=this._avg*rows.length}if(info.total>14){var arr=info.array=[];if(offset>5){arr.push(1,2,3,"...")}else{arr.push(1,2,3,4,5,6,7,8)}if(offset>5&&offset+6<total){arr.push(offset-1,offset,offset+1,offset+2,offset+3,"...",total-2,total-1,total)}else if(offset+6<total){arr.push("...",total-2,total-1,total)}else{arr.push(total-7,total-6,total-5,total-4,total-3,total-2,total-1,total)}}else{info.array=Array.apply(null,{length:info.total}).map(function(v,i){return i+1})}return info},groups:function groups(){var rows=this.get("rows");var last,cur;var res={};for(var i=0;i<rows.length;i++){cur=rows[i][this._init.by];if(cur!=last){res[i]=1}last=cur}return res}}});var notNumbers=/^[^\d]*/;export function numberify(v){if(isNumber(v)){return v}if(!v){return+Infinity}v=(""+v).replace(notNumbers,"");if(!v){return+Infinity}return parseFloat(v)}function columnGetter(table,col,sort){if(typeof col.get==="function"){return col.get}var path=(sort?col.sort:0)||col.path||col.filter||col.id;if(typeof path==="string"){var arr=Ractive.splitKeypath(path);return function(row){var v=row;for(var i=0;i<arr.length;i++){v=v&&v[arr[i]]}return v}}}function defaultFilter(table,rows,filter,sort){var all=[].concat(table.viewmodel.value.columns,table.viewmodel.value.fields);var map=all.reduce(function(a,c){return((a[c.id]=columnGetter(table,c))||true)&&a},{});var cols=Object.values(map);var list=rows||[];var src=list;if((filter instanceof RegExp||isString(filter))&&filter){var nocase=filter===""+filter.toLowerCase()||filter===""+filter.toUpperCase();try{var re=isString(filter)?new RegExp(filter,nocase?"i":""):filter;list=list.filter(function(l){var i=cols.length;while(i--){var v=l&&cols[i](l);if(v&&re.test(v)){return true}}})}catch(e){}}if(isString(sort)||isObject(sort)&&!Array.isArray(sort)){sort=[sort]}if(Array.isArray(sort)){sort=sort.map(function(f){if(isString(f)){var id$1=f[0]==="-"||f[0]==="+"?f.substr(1):f;var col=all.find(function(c){return c.id===id$1});if(!col){return}var res={get:columnGetter(table,col,true),dir:f[0]==="-"?-1:1};if(col&&col.type==="number"){var get=res.get;res.get=function(v){return numberify(get.call(table,v))}}return res}else if(f&&typeof f==="object"){var col$1=all.find(function(c){return c.id===id});if(!col$1){return}var res$1={dir:isNumber(f.dir)?f.dir:f.dir==="desc"?-1:1,get:columnGetter(table,col$1,true)};if(f.type==="number"||col$1&&col$1.type==="number"){var get$1=res$1.get;res$1.get=function(v){return numberify(get$1.call(table,v))}}return res$1}}).filter(function(s){return s&&s.get});list.sort(function(a,b){var aa,bb,p;for(var i=0;i<sort.length;i++){aa=sort[i].get.call(table,a);bb=sort[i].get.call(table,b);p=sort[i].dir*(aa<bb?-1:aa>bb?1:0);if(p!==0){return p}}return p})}return list}function makeRows(columns){var z=[{n:"gridValue",x:{r:"~/gridValue"}},{n:"gridName",x:{r:"~/gridName"}},{n:"gridSize",x:{r:"~/tableWidth"}},{n:"gridMax",x:{r:"~/gridMax"}},{n:"table",x:{r:"@this"}}];var sortKey="[_0._setSort(_1,_2)]";var headerCols=columns.filter(function(c){return c.hidden!==true}).map(function(c,cidx){if(c.index==null){c.index=cidx}c.attrsHP=c.attrs.filter(function(a){return a.n!=="title"});var div={t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/columns."+cidx+".label",c:{r:"."},z:z}]}],m:[{t:13,n:"title",f:c.title||c.label},{t:16,r:"~/columns."+cidx+".attrsHP",z:z}]};if(c.type){div.m.push({t:13,n:"class-rtable-"+c.type+"-column"})}if(c.filter||c.sort){div.m.push({t:13,n:"class-rtable-sortable"},{t:4,n:53,r:"~/columns."+cidx,f:[{t:70,n:["click"],f:{r:["@this",".index","@event"],s:sortKey}}]})}div.m.push({t:13,n:"class-rtable-column"});if(c.fixed){var path=c.fixed.path||"~/columns."+cidx+".fixed";div.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:path}]});div.m.push({t:4,n:50,x:{r:["~/noWrap",path],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:path}]}]})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res});var rowCols=columns.filter(function(c){return c.hidden!==true}).map(function(c,cidx){var content=[{t:7,e:"div",f:[{t:16,r:"~/columns."+cidx+".content",c:{r:"."},z:z}]}];if(c.attrs.length){c.attrsP=c.attrs;c.attrs=[{t:16,r:"~/columns."+cidx+".attrsP",c:{r:"."},z:z}]}else{c.attrs=[]}var attrs=c.attrs;if(c.fixed){var path=c.fixed.path||"~/columns."+cidx+".fixed";attrs.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:path}]});attrs.push({t:4,n:50,x:{r:["~/noWrap",path],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:path}]}]})}if(c.editable&&(c.filter||c.editP)){var noclicky={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}};var editor=[{t:4,n:50,x:{r:["~/columns."+cidx+".editP"],s:"Array.isArray(_0)"},f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-edit"},noclicky],f:[{t:16,r:"~/columns."+cidx+".editP"}]}]},{t:4,n:50,l:1,x:{r:["~/columns."+cidx+".type"],s:"_0==='boolean'"},f:[{t:7,e:"input",m:[{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,r:c.filter}]},noclicky]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:c.filter}]},noclicky]}]}];if(typeof c.editable==="object"){attrs.push({t:13,n:"class-rtable-editing",f:c.editable});content=[Object.assign({},c.editable,{t:4,n:50,f:editor}),{t:4,n:51,l:1,f:content}]}else{attrs.push({t:13,n:"class-rtable-editing"});content=editor}}if(c.valign){attrs.push({t:13,n:"class-rtable-valign-col-top",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='top'"}}]},{t:13,n:"class-rtable-valign-col-bottom",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='bottom'"}}]},{t:13,n:"class-rtable-valign-col-center",f:[{t:2,x:{r:["~/columns."+cidx+".valign"],s:"_0==='center'"}}]})}var div={t:7,e:"div",f:content,m:attrs};if(c.type){attrs.unshift({t:13,n:"class-rtable-"+c.type+"-column"})}attrs.push({t:13,n:"class-rtable-column"});var title=c.attrsP&&c.attrsP.find(function(a){return a.n==="title"});if(!title){attrs.unshift({t:4,n:50,r:"~/autoTitles",f:[{t:13,n:"title",f:c.content.find(function(e){return e.e})?c.label:c.content}]})}else if(!title.f){attrs.unshift({t:13,n:"title",f:c.content.find(function(e){return e.e})?c.label:c.content});c.attrsP.splice(attrs.indexOf(title),1)}if(c.noPad===0){attrs.push({t:13,n:"class-rtable-no-pad"})}else if(c.noPad){attrs.push({t:13,n:"class-rtable-no-pad",f:c.noPad})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res});return[headerCols,rowCols,z]}var colAttrs=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"];var cell=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/;var empty=[];function construct(){var cmp=this.component;if(!cmp){return}var expandEl,hoverEl,groupEl,wrapperEl,rowEl,topEl,bottomEl,mappings;var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var id=0;function map(attr,partial,plain){if(attr&&attr.f&&attr.f.length===1&&attr.f[0].t===2){var n="_a"+id++;attrs.push({t:13,n:n,f:attr.f});if(plain){return n}return partial?{t:[{t:2,r:"~/"+n}]}:{t:2,r:"~/"+n}}return attr&&attr.f}function grabColumns(tpl){var columns=[];var fields=[];tpl.forEach(function(e){if(e.e==="column"||e.e==="col"){var col={};var attrs=e.m||empty;var attr;col.index=columns.length;columns.push(col);col.content=(e.f||[]).filter(function(e){return e.e!=="edit"&&e.e!=="header"});col.editP=(e.f||[]).find(function(e){return e.e==="edit"});if(col.editP){col.editP=col.editP.f}attr=attrs.find(function(a){return a.n==="id"});if(attr&&isString(attr.f)){col.id=attr.f}col.label=(e.f||[]).find(function(e){return e.e==="header"});if(col.label){col.label=col.label.f;col.title=attrs.find(function(a){return a.n==="label"});if(!col.title){col.title=attrs.find(function(a){return a.n==="header"})}if(col.title&&col.title.f){col.title=map(col.title)}}else{col.label=attrs.find(function(a){return a.n==="label"});if(!col.label){col.label=attrs.find(function(a){return a.n==="header"})}if(col.label&&col.label.f){col.label=map(col.label)}}if(!col.label){col.label=""}if(!col.id){col.id=col.label}if(!Array.isArray(col.label)){col.label=[col.label]}col.type=attrs.find(function(a){return a.n==="type"});if(col.type&&col.type.f){col.type=col.type.f}if(!col.type){col.type="string"}col.filter=attrs.find(function(a){return a.n==="filter"});if(col.filter&&col.filter.f){col.filter=map(col.filter);if(col.filter.r){col.filter=col.filter.r}}col.sort=attrs.find(function(a){return a.n==="sort"});if(col.sort&&col.sort.f){col.sort=map(col.sort);if(col.sort.r){col.sort=col.sort.r}}col.dir=attrs.find(function(a){return a.n==="dir"});if(col.dir&&col.dir.f){col.dir=map(col.dir);if(col.dir.r){col.dir=col.dir.r}}col.hidden=attrs.find(function(a){return a.n==="hidden"});if(col.hidden&&col.hidden.f===0){col.hidden=true}else if(col.hidden&&isObject(col.hidden.f)){col.hidden=map(col.hidden)}else{col.hidden=false}if(isString(col.hidden)){col.hidden=false}col.noPad=attrs.find(function(a){return a.n==="no-pad"});if(col.noPad&&col.noPad.f===0){col.noPad=0}else if(col.noPad&&isObject(col.noPad.f)){col.noPad=map(col.noPad)}else{delete col.noPad}col.editable=attrs.find(function(a){return a.n==="editable"});if(col.editable&&col.editable.f===0){col.editable=true}else if(col.editable&&isObject(col.editable.f)){col.editable=map(col.editable)}else{col.editable=false}col.valign=attrs.find(function(a){return a.n==="valign"});if(col.valign&&isObject(col.valign.f)){col.valign=map(col.valign)}else if(col.valign&&typeof col.valign.f==="string"){col.valign=col.valign.f}col.fixed=attrs.find(function(a){return a.n==="fixed"});if(col.fixed&&isObject(col.fixed.f)){col.fixed={path:map(col.fixed,false,true)}}else if(col.fixed&&typeof col.fixed.f==="string"){col.fixed=col.fixed.f}attr=attrs.find(function(a){return a.n==="get"});if(attr&&attr.f){var name=map(attr,false,true);field.get=function(val){var fn=this.get(name);return typeof fn==="function"?fn.call(this,val):undefined}}col.attrs=attrs.filter(function(a){return!~colAttrs.indexOf(a.n)});col.attrs.forEach(function(a,i){if(cell.test(a.n)){col.attrs[i]={t:13,n:"class-"+a.n}}})}else if(e.e==="field"){var field$1={};var attrs$1=e.m||empty;var a;a=attrs$1.find(function(a){return a.n==="path"});if(isString(a)){field$1.path=a}else if(a&&a.f){field$1.path=map(a)}a=attrs$1.find(function(a){return a.n==="value"});if(a&&a.f){field$1.value=map(a)}a=attrs$1.find(function(a){return a.n==="type"});if(isString(a)){field$1.type=a}else if(a&&a.f){field$1.type=map(a)}a=attrs$1.find(function(a){return a.n==="id"});if(isString(a.f)){field$1.id=a.f}a=attrs$1.find(function(a){return a.n==="dir"});if(isString(a)){field$1.dir=a}else if(a&&isString(a.f)){field$1.dir=a.f}a=attrs$1.find(function(a){return a.n==="label"});if(isString(a)){field$1.label=a}else if(a&&a.f){field$1.label=map(a)}a=attrs$1.find(function(a){return a.n==="get"});if(a&&a.f){var name$1=map(a,false,true);field$1.get=function(val){var fn=this.get(name$1);return typeof fn==="function"?fn.call(this,val):undefined}}if(!field$1.id){field$1.id=field$1.label}if(!field$1.path){field$1.path=field$1.id}fields.push(field$1)}});return{fields:fields,columns:columns}}expandEl=tpl.find(function(e){return e.e==="expand"});hoverEl=tpl.find(function(e){return e.e==="hover"});groupEl=tpl.find(function(e){return e.e==="group"});wrapperEl=tpl.find(function(e){return e.e==="wrapper"});rowEl=tpl.find(function(e){return e.e==="row"});topEl=tpl.find(function(e){return e.e==="top"});bottomEl=tpl.find(function(e){return e.e==="bottom"});this._init={sets:grabColumns(tpl),partials:{}};var columns=this._init.sets.columns;this._init.sets["meta.expand"]=expandEl&&expandEl.f&&expandEl.f.length&&expandEl.f;this._init.sets["meta.hover"]=hoverEl&&hoverEl.f&&hoverEl.f.length&&hoverEl.f;this._init.sets["meta.extra"]=rowEl&&rowEl.f&&rowEl.f.length&&rowEl.f;this._init.sets["meta.top"]=topEl&&topEl.f&&topEl.f.length&&topEl.f;this._init.sets["meta.topAttrs"]=topEl&&topEl.m;this._init.sets["meta.bottom"]=bottomEl&&bottomEl.f&&bottomEl.f.length&&bottomEl.f;this._init.sets["meta.bottomAttrs"]=bottomEl&&bottomEl.m;var ref=makeRows(columns);var headerCols=ref[0];var rowCols=ref[1];var z=ref[2];var header=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-header"},{t:4,f:[{n:"style-opacity",f:"0",t:13}],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}},{t:4,n:50,r:"~/fixedHeader",f:[{t:13,n:"style-padding-right",f:[{t:2,r:"~/scrollOffset"},"px"]}]}],f:[{t:7,e:"div",f:[{t:8,r:"grid-head-cols"}],m:[{t:13,n:"class-row"}]}]}];header[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-header"},{t:13,n:"class-rtable-column"},{t:13,n:"title",f:[{t:2,r:"selections.length"}," items selected"]},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]}],f:[{t:7,e:"div",f:[{t:4,n:50,r:"~/allowSelectAll",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:"selectAll"}]}]}],m:[{t:70,n:["clickd"],f:"selectAll"}]}]}]});var row=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-rtable-odd",f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-live"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-inner-row-wrap"}],f:[{t:7,e:"div",f:[{t:8,r:"grid-row-cols"}],m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-row"},{t:70,n:expandEl&&expandEl.f?["dblclickd"]:["click","dblclick"],f:{r:["@this","~/rows","~/visibleRows","."],s:"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]"}}]}]}]}];if(rowEl&&rowEl.m&&rowEl.m.length){this._init.sets.rowAttrs=rowEl.m.slice();row[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."},z:z})}if(wrapperEl&&wrapperEl.m&&wrapperEl.m.length){this._init.sets.wrapperAttrs=wrapperEl.m.slice();row[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."},z:z})}if(rowEl&&rowEl.f&&rowEl.f.length){row[0].f[0].f.push({t:7,e:"div",m:[{t:13,n:"class-rtable-row-extra"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."},z:z}]})}if(expandEl&&expandEl.f&&expandEl.f.length){var listener={t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}};var ev=expandEl.m&&expandEl.m.find(function(a){return a.n==="skip"});if(ev&&ev.f&&ev.f[0]&&ev.f[0].t===2){ev=Object.assign({},ev.f[0],{t:4,n:51,f:[listener]})}else{ev=listener}row[0].f[0].f.push({t:4,n:50,x:{r:[".","~/expanded"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/meta.expand",c:{r:"."},z:z}]}],m:[{t:13,n:"class-rtable-row-expand"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]});row[0].f[0].f[0].m.push(ev);row[0].f[0].f[1].f[0].m.push({t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}})}if(hoverEl&&hoverEl.f&&hoverEl.f.length){row[0].f[0].f.unshift({t:4,n:50,x:{r:[".","~/hovered"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-hover-content"}].concat(hoverEl.m||[]),f:[{t:16,r:"~/meta.hover",c:{r:"."},z:z}]}],m:[{t:13,n:"class-rtable-row-hover"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]});row[0].m.push({t:70,n:["mouseenter"],f:{r:["@this","@index"],s:"[_0._hover(_1)]"}},{t:70,n:["mouseleave"],f:{r:["@this","@index"],s:"[_0._unhover(_1)]"}})}row[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}]}]}]}]});var by;if(groupEl&&groupEl.m&&(by=groupEl.m.find(function(a){return a.n==="by"}))&&(isString(by.f)||by.length===1&&by[0].t===2)){var group={t:4,n:50,f:[{t:7,e:"div",m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-group"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:70,n:expandEl&&expandEl.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}].concat(groupEl.m.filter(function(a){return a.n!=="by"&&a.n!=="select"}))}],x:{s:"_0&&_1[(_1&&(_2*_3+_4))||_4]",r:["~/showGroups","~/groups","~/page","~/pagination.per","@index"]}};row.unshift(group);this._init.by=by.f;var parts=grabColumns(groupEl.f).columns.filter(function(c){return c.hidden!==true}).map(function(c){var div={t:7,e:"div",f:[{t:7,e:"div",f:c.content}],m:c.attrs};if(c.type){div.m.unshift({t:13,n:"class-rtable-"+c.type+"-column"})}div.m.push({t:13,n:"class-rtable-column"});if(!div.m.find(function(a){return a.n==="title"})){div.m.unshift({t:13,n:"title",f:c.content})}var res=div;if(c.hidden&&c.hidden.r){res={t:4,n:51,r:c.hidden.r,f:[div]}}return res});parts.unshift({t:4,n:50,r:"~/allowGroupSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}}]}]}]}]});var attr;if(attr=groupEl.m.find(function(a){return a.n==="select"})){(mappings||(mappings=[])).push(Object.assign({},attr,{n:"allowGroupSelect"}))}if(attr=groupEl.m.find(function(a){return a.n==="show"})){(mappings||(mappings=[])).push(Object.assign({},attr,{n:"showGroups"}))}group.f[0].f=parts}this._init.partials["grid-row"]=row;this._init.partials["grid-row-cols"]=rowCols;this._init.partials["grid-head"]=header;this._init.partials["grid-head-cols"]=headerCols;if(mappings&&this.component){this.component.mappings=mappings}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var Ractive=ref.Ractive;var instance=ref.instance;if("includeGrid"in opts){Ractive.styleSet("table.includeGrid",opts.includeGrid)}instance.components[opts.name||"data-table"]=Table}}globalRegister("RauiTable","components",Table);export default plugin;

@@ -151,3 +151,3 @@ import Ractive from 'ractive';

return "\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n " + (!boxy ? ("box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";") :
("border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }" + (boxy ? ("\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }") : '') + "\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n \n .rtabs-tab-window-wrapper:before,\n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n height: 100%;\n width: " + (primary.indicator.size || '1em') + ";\n opacity: 0;\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n left: 0;\n }\n .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n right: 0;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after,\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 0.5;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n " + (!boxy ? (".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: " + (primary.bga || '#f4f4f4') + ";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: " + (primary.fga || '#07e') + ";\n }") : ("\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.bg || '#fff') + ";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.fga || '#07e') + ";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")) + "\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }" + (boxy ? "\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }" : '') + "\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;" + (boxy ? ("\n border-style: solid;\n border-width: 0 0 " + bottom + " 0;\n border-color: " + (primary.bc || '#ccc') + ";\n line-height: 1.5em;") : '') + "\n }\n \n .rtabs-tab {\n display: inline-block;\n padding: 0.5em 1em;\n height: 1.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;" + (!boxy ? "\n opacity: 0.9;" : ("\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0 1px " + bottom + " 0;\n margin-bottom: -" + bottom + ";\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected" + (boxy ? ",\n .alt > div > .rtabs-tab-window .rtabs-selected" : '') + " {\n opacity: 1;" + (boxy ? ("\n font-weight: bold;\n border-bottom-color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.selected.bg || primary.bg || '#fff') + ";\n color: " + (primary.selected.fg || primary.fg || '#222') + ";") : '') + "\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: " + (primary.indicator.color || primary.fga || '#07e') + ";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n }\n \n .rtabs {\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: flex;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-content-window:before,\n .rtabs-content-window:after {\n content: '';\n display: block;\n position: absolute;\n z-index: 999;\n height: " + (primary.indicator.size || '1em') + ";\n width: 100%;\n opacity: 0;\n pointer-events: none;\n }\n .rtabs-content-window:before {\n top: 0;\n background: linear-gradient(to bottom, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n }\n .rtabs-content-window:after {\n bottom: 0;\n background: linear-gradient(to top, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n }\n .rtabs-content-window.rtab-scroll-top:before,\n .rtabs-content-window.rtab-scroll-bottom:after {\n opacity: 0.5;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n " + themes.map(function (t) {
("border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }" + (boxy ? ("\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }") : '') + "\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n \n .rtabs-tab-window-wrapper:before,\n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n height: 100%;\n width: " + (primary.indicator.size || '1em') + ";\n opacity: 0;\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n left: 0;\n }\n .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n right: 0;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after,\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 0.5;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n " + (!boxy ? (".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: " + (primary.bga || '#f4f4f4') + ";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: " + (primary.fga || '#07e') + ";\n }") : ("\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.bg || '#fff') + ";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.fga || '#07e') + ";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")) + "\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }" + (boxy ? "\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }" : '') + "\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;" + (boxy ? ("\n border-style: solid;\n border-width: 0 0 " + bottom + " 0;\n border-color: " + (primary.bc || '#ccc') + ";\n line-height: 1.5em;") : '') + "\n }\n \n .rtabs-tab {\n display: inline-flex;\n align-items: center;\n padding: 0.5em 1em;\n height: 1.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;" + (!boxy ? "\n opacity: 0.9;" : ("\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0 1px " + bottom + " 0;\n margin-bottom: -" + bottom + ";\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected" + (boxy ? ",\n .alt > div > .rtabs-tab-window .rtabs-selected" : '') + " {\n opacity: 1;" + (boxy ? ("\n font-weight: bold;\n border-bottom-color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.selected.bg || primary.bg || '#fff') + ";\n color: " + (primary.selected.fg || primary.fg || '#222') + ";") : '') + "\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: " + (primary.indicator.color || primary.fga || '#07e') + ";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n }\n \n .rtabs {\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: flex;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-content-window:before,\n .rtabs-content-window:after {\n content: '';\n display: block;\n position: absolute;\n z-index: 999;\n height: " + (primary.indicator.size || '1em') + ";\n width: 100%;\n opacity: 0;\n pointer-events: none;\n }\n .rtabs-content-window:before {\n top: 0;\n background: linear-gradient(to bottom, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n }\n .rtabs-content-window:after {\n bottom: 0;\n background: linear-gradient(to top, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n }\n .rtabs-content-window.rtab-scroll-top:before,\n .rtabs-content-window.rtab-scroll-bottom:after {\n opacity: 0.5;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n " + themes.map(function (t) {
var theme = Object.assign({}, data('raui.primary'), data('raui.tabs.primary'), data(("raui." + t)), data(("raui.tabs." + t)));

@@ -154,0 +154,0 @@ theme.selected = Object.assign({}, data('raui.tabs.selected'), data('raui.tabs.primary.selected'), data(("raui.tabs." + t + ".selected")));

@@ -1,1 +0,1 @@

import Ractive from"ractive";import{scrolled}from"./scrolled";import{sized}from"./watch-size";import globalRegister from"./globalRegister";export var Tabs=function(Ractive){function Tabs(opts){Ractive.call(this,opts)}if(Ractive)Tabs.__proto__=Ractive;Tabs.prototype=Object.create(Ractive&&Ractive.prototype);Tabs.prototype.constructor=Tabs;var prototypeAccessors={selection:{configurable:true},visibleSelection:{configurable:true}};Tabs.prototype.addTab=function addTab(tab,idx){if(!tab.template){tab.template=[]}if(typeof idx==="number"){this.splice("tabs",idx,0,tab)}else{this.push("tabs",tab)}var res=new Handle(this,tab);if(tab.select){this.select(res.index)}return res};Tabs.prototype.getTab=function getTab(id){var tabs=this.get("tabs");var tab=tabs.find(function(t){return t.id===id});if(tab){return new Handle(this,tab)}else if(id in tabs&&typeof tabs[id]==="object"){return new Handle(this,tabs[id])}};Tabs.prototype.updateIndicator=function updateIndicator(){if(!this.rendered||!this._tabs){return}var ctx=this.getContext(this.find(".rtabs-tab-window"));if(ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}if(this.get("@style.raui.tabs.boxy")){return}var node=this._tabs[this.get("selected")];if(!node||!node.offsetParent){return}if(node){var start=this.get("selectedLeft");if(start===undefined){this.set({selectedLeft:node.offsetLeft,selectedRight:node.offsetParent.clientWidth-(node.offsetLeft+node.offsetWidth)})}else{var max=node.offsetParent.clientWidth;var left=node.offsetLeft,width=node.clientWidth,right=max-left-width;this.set({direction:left<start?"left":"right",selectedLeft:left,selectedRight:right})}}else{this.set({selectedLeft:0,selectedRight:this.find(".tabs").offsetWidth})}};Tabs.prototype.checkSelection=function checkSelection(ctx,idx){if(this.get("selected")!==idx){select.call(this,ctx,idx)}};Tabs.prototype.select=function select(idx){if(idx<0||idx>=(this.get("tabs.length")||0)||this._hidden(idx)){return false}this.fire("select",{},idx);return true};Tabs.prototype._hidden=function _hidden(idx){var hidden=this.get("tabs."+idx+".hidden");if(typeof hidden==="string"){hidden=this.get(hidden)}return hidden};Tabs.prototype.stopHorizontalScroll=function stopHorizontalScroll(node){if(node.scrollLeft){node.scrollLeft=0}};Tabs.prototype._scrollsRight=function _scrollsRight(scroll){if(/hscroll.*(hmiddle|left)/.test(scroll)&&!/right/.test(scroll)){return true}};Tabs.prototype._scrollsUp=function _scrollsUp(scroll){if(/vscroll.*(vmiddle|bottom)/.test(scroll)&&!/top/.test(scroll)){return true}};Tabs.prototype._scrollsLeft=function _scrollsLeft(scroll){if(/hscroll.*(hmiddle|right)/.test(scroll)&&!/left/.test(scroll)){return true}};Tabs.prototype._scrollsDown=function _scrollsDown(scroll){if(/vscroll.*(vmiddle|top)/.test(scroll)&&!/bottom/.test(scroll)){return true}};prototypeAccessors.selection.get=function(){return this.get("selected")};prototypeAccessors.visibleSelection.get=function(){var idx=0;var tabs=this.get("tabs");var active=this.get("selected");for(var i=0;i<tabs.length;i++){var tab=tabs[i];if(active===i){return idx}var hidden=tab.hidden;if(typeof hidden==="string"){hidden=this.get(hidden)}if(!hidden){idx++}}return idx};Object.defineProperties(Tabs.prototype,prototypeAccessors);return Tabs}(Ractive);var tabAttrs=["closable","disabled","title","right","button","no-pad","hidden","id","load"];Ractive.extendWith(Tabs,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs",g:1},{t:16,r:"extra-attributes"},{n:"class-rtabs-flat",t:13,f:[{t:2,r:"~/flat"}]},{n:"class-rtabs-margin",t:13,f:[{t:2,r:"~/margin"}]},{n:"class-rtabs-fill",t:13,f:[{t:2,r:"~/fill"}]},{n:"sized",t:71,f:{r:[],s:'[{clientWidth:"~/clientWidth"}]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window-wrapper",g:1},{n:"class-rtabs-scroll-right",t:13,f:[{t:2,x:{r:["@this","~/scrollStatus"],s:"_0._scrollsRight(_1)"}}]},{n:"class-rtabs-scroll-left",t:13,f:[{t:2,x:{r:["@this","~/scrollStatus"],s:"_0._scrollsLeft(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window",g:1},{t:4,f:[{n:"class-rtabs-going-left",t:13}],n:50,x:{r:[".direction"],s:'_0==="left"'}},{t:4,f:[{n:"class-rtabs-going-right",t:13}],n:51,l:1},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scrollStatus"]'}}],n:51,r:"@style.raui.tabs.noscrollindicators"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tabs",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-left",g:1},{n:"class-rtabs-center",t:13,f:[{t:2,r:"~/center"}]}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"!_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-right",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-indicator",g:1},{n:"style-left",f:[{t:2,r:".selectedLeft"},"px"],t:13},{t:4,f:[{n:"style-right",f:[{t:2,r:".selectedRight"},"px"],t:13}],n:50,x:{r:[".selectedRight"],s:"_0!==undefined"}}]}],n:51,r:"@style.raui.tabs.boxy"}]}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-window",g:1},{t:4,f:[{n:"class-rtabs-trans-fade",t:13}],n:50,x:{r:[".transition"],s:'_0==="fade"'}},{t:4,f:[{n:"class-rtabs-trans-slide",t:13}],n:50,x:{r:[".transition"],s:'_0==="slide"'},l:1},{n:["scroll"],t:70,f:{r:["@this","@node"],s:"[_0.stopHorizontalScroll(_1)]"}},{n:"class-rtab-scroll-right",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-left",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-top",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-bottom",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-contents",g:1},{n:"style-opacity",f:[{t:2,r:"~/opacity"}],t:13},{n:"style-left",f:[{t:2,x:{r:[".selectedContent"],s:"_0*-100"}},"%"],t:13},{n:"class-rtabs-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:4,f:[{t:8,r:"tab-content"}],n:52,r:".tabs"}]}]}]}]}],e:{'[{clientWidth:"~/clientWidth"}]':function(){return[{clientWidth:"~/clientWidth"}]},"_0._scrollsRight(_1)":function(_0,_1){return _0._scrollsRight(_1)},"_0._scrollsLeft(_1)":function(_0,_1){return _0._scrollsLeft(_1)},'_0==="left"':function(_0){return _0==="left"},'["~/scrollStatus"]':function(){return["~/scrollStatus"]},"!_0&&!_1._hidden(_2)":function(_0,_1,_2){return!_0&&!_1._hidden(_2)},"_0&&!_1._hidden(_2)":function(_0,_1,_2){return _0&&!_1._hidden(_2)},"_0!==undefined":function(_0){return _0!==undefined},'_0==="fade"':function(_0){return _0==="fade"},'_0==="slide"':function(_0){return _0==="slide"},"[_0.stopHorizontalScroll(_1)]":function(_0,_1){return[_0.stopHorizontalScroll(_1)]},"_0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)":function(_0,_1,_2){return _0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)},"_0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)":function(_0,_1,_2){return _0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)},"_0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)":function(_0,_1,_2){return _0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)},"_0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)":function(_0,_1,_2){return _0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)},"_0*-100":function(_0){return _0*-100},"_0===_1":function(_0,_1){return _0===_1},'_0==="dynamic"':function(_0){return _0==="dynamic"},"_0!==_1":function(_0,_1){return _0!==_1},"_0===false":function(_0){return _0===false},"[_0.checkSelection((_1),_2)]":function(_0,_1,_2){return[_0.checkSelection(_1,_2)]},'[".scrollStatus"]':function(){return[".scrollStatus"]},'["content",_0]':function(_0){return["content",_0]},'(_3==="always"&&_0===_1)||(_3&&_2)||!_3':function(_0,_1,_2,_3){return _3==="always"&&_0===_1||_3&&_2||!_3},"!_0":function(_0){return!_0},"_0===_1&&!_2":function(_0,_1,_2){return _0===_1&&!_2},'typeof _1==="string"?_0.get(_1):_1':function(_0,_1){return typeof _1==="string"?_0.get(_1):_1},'[["select",_0]]':function(_0){return[["select",_0]]},"[_0.button()]":function(_0){return[_0.button()]},'typeof _0==="function"':function(_0){return typeof _0==="function"},'["tab",_0]':function(_0){return["tab",_0]},'typeof _0==="string"':function(_0){return typeof _0==="string"},'[["close",_0]]':function(_0){return[["close",_0]]},"_0&&!_1":function(_0,_1){return _0&&!_1}},p:{"tab-content":[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-content",g:1},{n:"class-rtabs-selected-content",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0===_1"}}]},{n:"class-rtabs-dyna",t:13,f:[{t:2,x:{r:["~/height"],s:'_0==="dynamic"'}}]},{n:"class-rtabs-not-selected",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0!==_1"}}]},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"},{t:4,f:[{n:"class-rtabs-no-pad",t:13}],n:50,x:{r:[".pad"],s:"_0===false"}},{t:4,f:[{n:"class-rtabs-no-pad",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".padRef"}]}}]}],n:50,r:".padRef",l:1},{n:["focusin"],t:70,f:{r:["@this","@context","@index"],s:"[_0.checkSelection((_1),_2)]"}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'[".scrollStatus"]'}}],n:51,r:"@style.raui.tabs.noscrollindicators"},{n:"registered",t:71,f:{r:["@index"],s:'["content",_0]'}}],f:[{t:4,f:[{t:16,r:".template"}],n:50,x:{r:["~/selectedContent","@index",".load","~/defer"],s:'(_3==="always"&&_0===_1)||(_3&&_2)||!_3'}}]}],n:50,x:{r:[".button"],s:"!_0"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-placeholder",g:1}]}],n:51,l:1}],tab:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab",g:1},{n:"class-rtabs-selected",t:13,f:[{t:2,x:{r:["~/selected","@index",".button"],s:"_0===_1&&!_2"}}]},{t:4,f:[{n:"class-rtabs-disabled",t:13}],n:50,x:{r:["@this",".disabled"],s:'typeof _1==="string"?_0.get(_1):_1'}},{t:4,f:[{n:["click"],t:70,f:{r:["@index"],s:'[["select",_0]]'}}],n:50,x:{r:[".button"],s:"!_0"},l:1},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.button()]"}}],n:50,x:{r:[".button"],s:'typeof _0==="function"'},l:1},{n:"registered",t:71,f:{r:["@index"],s:'["tab",_0]'}},{t:4,f:[{t:16,r:".extraTab"}],n:50,r:".extraTab"},{n:"data-tab-index",f:[{t:2,r:"@index"}],t:13}],f:[{t:4,f:[{t:2,r:"title"}],n:50,x:{r:[".title"],s:'typeof _0==="string"'}},{t:4,f:[{t:16,r:".title"}],n:50,r:".title",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-close",g:1},{n:["click"],t:70,f:{r:["@index"],s:'[["close",_0]]'}}],f:["×"]}],n:50,x:{r:[".closable",".button"],s:"_0&&!_1"}}]}]}},cssId:"rtab",noCssTransform:true,css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.tabs.primary"));primary.selected=Object.assign({},data("raui.tabs.selected"),data("raui.tabs.primary.selected"));primary.indicator=Object.assign({},data("raui.tabs.indicator"),data("raui.tabs.primary.indicator"));var themes=(data("raui.themes")||[]).slice();(data("raui.tabs.themes")||[]).forEach(function(t){if(!~themes.indexOf(t)){themes.push(t)}});var boxy=data("raui.tabs.boxy")||data("raui.tabs.primary.boxy");var bottom=(data("raui.tabs.bottom")||1)*.0625+"em";return"\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n "+(!boxy?"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";":"border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bga||"#f4f4f4")+";\n ")+"\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }"+(boxy?"\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }":"")+"\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n \n .rtabs-tab-window-wrapper:before,\n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n height: 100%;\n width: "+(primary.indicator.size||"1em")+";\n opacity: 0;\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(primary.indicator.highlight||primary.indicator.color||primary.fga||"#07e")+", transparent);\n left: 0;\n }\n .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(primary.indicator.highlight||primary.indicator.color||primary.fga||"#07e")+", transparent);\n right: 0;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after,\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 0.5;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n "+(!boxy?".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: "+(primary.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: "+(primary.fga||"#07e")+";\n }":"\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(primary.bg||"#fff")+";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(primary.fga||"#07e")+";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")+"\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }"+(boxy?"\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }":"")+"\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;"+(boxy?"\n border-style: solid;\n border-width: 0 0 "+bottom+" 0;\n border-color: "+(primary.bc||"#ccc")+";\n line-height: 1.5em;":"")+"\n }\n \n .rtabs-tab {\n display: inline-block;\n padding: 0.5em 1em;\n height: 1.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;"+(!boxy?"\n opacity: 0.9;":"\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 1px "+bottom+" 0;\n margin-bottom: -"+bottom+";\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bga||"#f4f4f4")+";\n ")+"\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected"+(boxy?",\n .alt > div > .rtabs-tab-window .rtabs-selected":"")+" {\n opacity: 1;"+(boxy?"\n font-weight: bold;\n border-bottom-color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.selected.bg||primary.bg||"#fff")+";\n color: "+(primary.selected.fg||primary.fg||"#222")+";":"")+"\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: "+(primary.indicator.color||primary.fga||"#07e")+";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(primary.bg||"#fff")+";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n }\n \n .rtabs {\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: flex;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-content-window:before,\n .rtabs-content-window:after {\n content: '';\n display: block;\n position: absolute;\n z-index: 999;\n height: "+(primary.indicator.size||"1em")+";\n width: 100%;\n opacity: 0;\n pointer-events: none;\n }\n .rtabs-content-window:before {\n top: 0;\n background: linear-gradient(to bottom, "+(primary.indicator.highlight||primary.indicator.color||primary.fga||"#07e")+", transparent);\n }\n .rtabs-content-window:after {\n bottom: 0;\n background: linear-gradient(to top, "+(primary.indicator.highlight||primary.indicator.color||primary.fga||"#07e")+", transparent);\n }\n .rtabs-content-window.rtab-scroll-top:before,\n .rtabs-content-window.rtab-scroll-bottom:after {\n opacity: 0.5;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n "+themes.map(function(t){var theme=Object.assign({},data("raui.primary"),data("raui.tabs.primary"),data("raui."+t),data("raui.tabs."+t));theme.selected=Object.assign({},data("raui.tabs.selected"),data("raui.tabs.primary.selected"),data("raui.tabs."+t+".selected"));theme.indicator=Object.assign({},data("raui.tabs.indicator"),data("raui.tabs.primary.indicator"),data("raui.tabs."+t+".indicator"));var boxy="boxy"in theme?theme.boxy:data("raui.tabs.boxy");return".rtabs."+t+" > div > .rtabs-tab-window {\n "+(!boxy?"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bg||"#fff")+";":"border-color: "+(theme.bc||"#ccc")+";\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bga||"#f4f4f4")+";\n ")+"\n }\n .rtabs."+t+" > .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(theme.indicator.highlight||theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+" > .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(theme.indicator.highlight||theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+" > .rtabs-content-wrapper > .rtabs-content-window:before {\n background: linear-gradient(to bottom, "+(theme.indicator.highlight||theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+" > .rtabs-content-wrapper > .rtabs-content-window:after {\n background: linear-gradient(to top, "+(theme.indicator.highlight||theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+".alt > div > .rtabs-tab-window {\n color: "+(theme.bg||"#fff")+";\n background-color: "+(theme.fga||"#07e")+";\n }"+(boxy?"\n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(theme.bg||"#fff")+";\n background-color: "+(theme.fga||"#07e")+";\n }":"")+"\n \n "+(!boxy?".rtabs-flat."+t+" > div > .rtabs-tab-window:after {\n background-color: "+(theme.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt."+t+" > div > .rtabs-tab-window:after {\n background-color: "+(theme.fga||"#07e")+";\n }":"\n .rtabs-flat."+t+" > div > .rtabs-tab-window {\n background-color: "+(theme.bg||"#fff")+";\n }\n .alt.rtabs-flat."+t+" > div > .rtabs-tab-window {\n background-color: "+(theme.fga||"#07e")+";\n }")+"\n \n "+(boxy?".rtabs."+t+" > div > .rtabs-tab-window .rtabs-tabs {\n border-color: "+(theme.bc||"#ccc")+";\n }":"")+"\n \n .rtabs."+t+" > div > .rtabs-tab-window > .rtabs-tab {\n cursor: pointer;"+(!boxy?"":"\n border-color: "+(theme.bc||"#ccc")+";\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bga||"#f4f4f4")+";\n ")+"\n }\n \n .rtabs."+t+" > div > .rtabs-tab-window .rtabs-selected"+(boxy?",\n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-selected":"")+" {"+(boxy?"\n border-bottom-color: "+(them.bg||"#fff")+";\n background-color: "+(theme.selected.bg||theme.bg||"#fff")+";"+(theme.indicator?"\n background-image: linear-gradient(to bottom, "+(theme.indicator.color||theme.fga||"#07e")+", "+(theme.bg||"#fff")+" 3px);":"")+"\n color: "+(theme.selected.fg||theme.fg||"#222")+";":"")+"\n }\n \n .rtabs."+t+" > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(theme.indicator.color||theme.fga||"#07e")+";\n }\n \n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(theme.bg||"#fff")+";\n }\n \n .rtabs."+t+" {\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bg||"#fff")+";\n }\n "}).join("\n")}.call(this,data)].join(" ")},attributes:["transition","flat","pad","center","height","fill","defer","selected"],data:function data(){return{tabs:[],rightTabs:[],selected:-1,selectedContent:-1,opacity:1,scrollStatus:""}},on:{construct:construct,config:function config(){var this$1=this;if(this._ctabs){this.set("tabs",(this.get("tabs")||[]).concat(this._ctabs),{shuffle:true})}this._ctabs=0;var tabs=this.get("tabs");var xs=this.indicatorObservers=[];tabs.forEach(function(t){if(typeof t.hidden==="string"){xs.push(this$1.observe(t.hidden,function(){return setTimeout(function(){return this$1.updateIndicator()})},{init:false,defer:true}))}});xs.push(this.observe("tabs.*.hidden",function(){return setTimeout(function(){return this$1.updateIndicator()})},{init:false,defer:true}));this.once("render",function(){var sel=this$1.get("selected");if(sel===-1){this$1.select(0)}else{this$1.set("selectedContent",sel)}})},select:select,close:close,teardown:function teardown(){this.indicatorObservers.forEach(function(o){return o.cancel()})}},observe:{selected:{handler:function handler(v){var this$1=this;var hidden=this._hidden(v);var tabs=this.get("tabs");if(hidden){setTimeout(function(){var trans=this$1.get("transition");this$1.set("transition","");var tabs=this$1.get("tabs");for(var i=0;i<tabs.length;i++){var t=tabs[i];var h=t.hidden;if(typeof h==="string"){h=this$1.get(h)}if(!h){this$1.select(i);break}}this$1.set("transition",trans)})}},init:false},clientWidth:function clientWidth(){this.updateIndicator()}},decorators:{registered:function registered(node,where,idx){var me=this;var ctx=this.getContext(node);if(!this._tabs){this._tabs=[]}if(!this._contents){this._contents=[]}this["_"+where+"s"][idx]=node;if(where==="tab"){this.updateIndicator()}else if(ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}return{teardown:function teardown(){},invalidate:function invalidate(){if(where==="tab"){me.updateIndicator()}else if(ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}},update:function update(idx){me["_"+where+"s"][idx]=node;if(where==="tab"){setTimeout(function(){return me.updateIndicator()})}else if(ctx.decorators.scrolled){setTimeout(function(){return ctx.decorators.scrolled.refresh()})}}}},scrolled:scrolled,sized:sized}});function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var tabs=tpl.filter(function(n){return n.e==="tab"}).map(function(t){var tab={template:{t:t.f.filter(function(n){return n.e!=="title"})}};var extra=[];var extraTab=[];t.m&&t.m.forEach(function(a){if(a.t===13&&~tabAttrs.indexOf(a.n)){if(a.n==="disabled"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd="_cnd"+attrs.length;tab.disabled=cnd;attrs.push({t:13,n:cnd,f:a.f})}else if(a.n==="no-pad"){if(!a.f){tab.pad=false}else if(a.f.length===1&&a.f[0].t===2){var cnd$1="_cnd"+attrs.length;tab.padRef=cnd$1;attrs.push({t:13,n:cnd$1,f:a.f})}}else if(a.n==="hidden"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd$2="_cnd"+attrs.length;tab.hidden=cnd$2;attrs.push({t:13,n:cnd$2,f:a.f})}else{tab[a.n]=a.f===0?true:typeof a.f==="string"?a.f:{t:a.f}}}else if(a.t===70){extraTab.push(a)}else{extra.push(a)}});var tmp;tmp=t.f.find(function(n){return n.e==="title"});if(tmp){tab.title=tmp.f;if(tmp.m){extraTab.push.apply(extraTab,tmp.m)}}if(extra.length){tab.extra={t:extra}}if(extraTab.length){tab.extraTab={t:extraTab}}return tab});this._ctabs=tabs}function select(ctx,idx){var this$1=this;var obj;if(idx<-1||idx>=this.get("tabs.length")){return}var current=this.get("selected");var prs=[];var trans=this.get("transition");if(this._fadetm){this.set("opacity",1);clearTimeout(this._fadetm);this._fadetm=0}if(this._contents){var el=this._contents[idx];if(el){var ctx$1=this.getContext(el);if(ctx$1.decorators.scrolled){ctx$1.decorators.scrolled.refresh()}}}if(current!==idx){if(this.rendered){var cur=this.getContext(this.find(".rtabs-selected"));var window=this.find(".rtabs-content-window");if(~current){this.set("scroll."+cur.get("@index"),window.scrollTop)}if(cur.hasListener("leave")){cur.raise("leave")}if(trans==="fade"){this.set({opacity:0,selected:idx});this.updateIndicator();var ctx$2=this.getContext(this.find(".rtabs-selected"));this._fadetm=setTimeout(function(){var obj;this$1._fadetm=0;this$1.set((obj={selectedContent:idx},obj["tabs."+idx+".load"]=true,obj.opacity=1,obj));if(ctx$2.hasListener("enter")){ctx$2.raise("enter")}if(window&&~current){window.scrollTop=this$1.get("scroll."+idx)||0}},150)}else if(trans==="slide"){this.set("selected",idx);this.set("tabs."+idx+".load",true);this.set("selectedContent",idx);this.updateIndicator();var ctx$3=this.getContext(this.find(".rtabs-selected"));if(ctx$3.hasListener("enter")){ctx$3.raise("enter")}if(window&&~current){window.scrollTop=this.get("scroll."+idx)||0}}else{this.set((obj={selected:idx},obj["tabs."+idx+".load"]=true,obj.selectedContent=idx,obj));this.updateIndicator();var ctx$4=this.getContext(this.find(".rtabs-selected"));if(ctx$4.hasListener("enter")){ctx$4.raise("enter")}if(window){window.scrollTop=this.get("scroll."+idx)||0}}if(~current&&window&&window.scrollLeft){window.scrollLeft=0}}else{this.set({selected:idx,selectedContent:idx})}}}function close(ctx,idx){var tab=this.getContext(this._tabs[idx]);var ok=true;if(typeof tab.onclose==="function"){ok=tab.onclose.call(undefined)!==false}if(ok&&tab.element.events.find(function(e){return e.events.find(function(e){return e.name==="close"})})){ok=tab.raise("close")!==false}if(ok){this.splice("tabs",idx,1)}return false}export var Handle=function Handle(tabs,item){this.tabs=tabs;this.item=item};var prototypeAccessors$1={keypath:{configurable:true},id:{configurable:true},index:{configurable:true},title:{configurable:true},template:{configurable:true},hidden:{configurable:true},right:{configurable:true},pad:{configurable:true},disabled:{configurable:true},button:{configurable:true},closable:{configurable:true},load:{configurable:true}};prototypeAccessors$1.keypath.get=function(){if(this.removed){return}return"tabs."+this.index};prototypeAccessors$1.id.get=function(){return this.get("id")};prototypeAccessors$1.id.set=function(v){this.set("id",v)};prototypeAccessors$1.index.get=function(){return this.tabs.get("tabs").indexOf(this.item)};prototypeAccessors$1.title.get=function(){return this.get("title")};prototypeAccessors$1.title.set=function(v){this.set("title",v)};prototypeAccessors$1.template.get=function(){return this.get("template")};prototypeAccessors$1.template.set=function(v){return this.set("template",v)};prototypeAccessors$1.hidden.get=function(){return this.get("hidden")};prototypeAccessors$1.hidden.set=function(v){return this.set("hidden",v)};prototypeAccessors$1.right.get=function(){return this.get("right")};prototypeAccessors$1.right.set=function(v){return this.set("right",v)};prototypeAccessors$1.pad.get=function(){return this.get("pad")};prototypeAccessors$1.pad.set=function(v){return this.set("pad",v)};prototypeAccessors$1.disabled.get=function(){return this.get("disabled")};prototypeAccessors$1.disabled.set=function(v){return this.set("disabled",v)};prototypeAccessors$1.button.get=function(){return this.get("button")};prototypeAccessors$1.button.set=function(v){return this.set("button",v)};prototypeAccessors$1.closable.get=function(){return this.get("closable")};prototypeAccessors$1.closable.set=function(v){return this.set("closable",v)};prototypeAccessors$1.load.get=function(){return this.get("load")};prototypeAccessors$1.load.set=function(v){return this.set("load",v)};Handle.prototype.select=function select(){if(this.removed){return}this.tabs.select(this.index)};Handle.prototype.remove=function remove(){if(this.removed){return false}this.tabs.splice("tabs",this.index,1);this.removed=true;return true};Handle.prototype.get=function get(keypath){if(this.removed){return false}if(!keypath){return this.tabs.get(this.keypath)}var key=keypath.replace(/^[\.\/]*/,"");return this.tabs.get(this.keypath+"."+key)};Handle.prototype.set=function set(keypath,value){if(this.removed){return false}var key=keypath.replace(/^[\.\/]*/,"");return this.tabs.set(this.keypath+"."+key,value)};Object.defineProperties(Handle.prototype,prototypeAccessors$1);export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"tabs"]=Tabs}}globalRegister("RauiTabs","components",Tabs);export default plugin;
import Ractive from"ractive";import{scrolled}from"./scrolled";import{sized}from"./watch-size";import globalRegister from"./globalRegister";export var Tabs=function(Ractive){function Tabs(opts){Ractive.call(this,opts)}if(Ractive)Tabs.__proto__=Ractive;Tabs.prototype=Object.create(Ractive&&Ractive.prototype);Tabs.prototype.constructor=Tabs;var prototypeAccessors={selection:{configurable:true},visibleSelection:{configurable:true}};Tabs.prototype.addTab=function addTab(tab,idx){if(!tab.template){tab.template=[]}if(typeof idx==="number"){this.splice("tabs",idx,0,tab)}else{this.push("tabs",tab)}var res=new Handle(this,tab);if(tab.select){this.select(res.index)}return res};Tabs.prototype.getTab=function getTab(id){var tabs=this.get("tabs");var tab=tabs.find(function(t){return t.id===id});if(tab){return new Handle(this,tab)}else if(id in tabs&&typeof tabs[id]==="object"){return new Handle(this,tabs[id])}};Tabs.prototype.updateIndicator=function updateIndicator(){if(!this.rendered||!this._tabs){return}var ctx=this.getContext(this.find(".rtabs-tab-window"));if(ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}if(this.get("@style.raui.tabs.boxy")){return}var node=this._tabs[this.get("selected")];if(!node||!node.offsetParent){return}if(node){var start=this.get("selectedLeft");if(start===undefined){this.set({selectedLeft:node.offsetLeft,selectedRight:node.offsetParent.clientWidth-(node.offsetLeft+node.offsetWidth)})}else{var max=node.offsetParent.clientWidth;var left=node.offsetLeft,width=node.clientWidth,right=max-left-width;this.set({direction:left<start?"left":"right",selectedLeft:left,selectedRight:right})}}else{this.set({selectedLeft:0,selectedRight:this.find(".tabs").offsetWidth})}};Tabs.prototype.checkSelection=function checkSelection(ctx,idx){if(this.get("selected")!==idx){select.call(this,ctx,idx)}};Tabs.prototype.select=function select(idx){if(idx<0||idx>=(this.get("tabs.length")||0)||this._hidden(idx)){return false}this.fire("select",{},idx);return true};Tabs.prototype._hidden=function _hidden(idx){var hidden=this.get("tabs."+idx+".hidden");if(typeof hidden==="string"){hidden=this.get(hidden)}return hidden};Tabs.prototype.stopHorizontalScroll=function stopHorizontalScroll(node){if(node.scrollLeft){node.scrollLeft=0}};Tabs.prototype._scrollsRight=function _scrollsRight(scroll){if(/hscroll.*(hmiddle|left)/.test(scroll)&&!/right/.test(scroll)){return true}};Tabs.prototype._scrollsUp=function _scrollsUp(scroll){if(/vscroll.*(vmiddle|bottom)/.test(scroll)&&!/top/.test(scroll)){return true}};Tabs.prototype._scrollsLeft=function _scrollsLeft(scroll){if(/hscroll.*(hmiddle|right)/.test(scroll)&&!/left/.test(scroll)){return true}};Tabs.prototype._scrollsDown=function _scrollsDown(scroll){if(/vscroll.*(vmiddle|top)/.test(scroll)&&!/bottom/.test(scroll)){return true}};prototypeAccessors.selection.get=function(){return this.get("selected")};prototypeAccessors.visibleSelection.get=function(){var idx=0;var tabs=this.get("tabs");var active=this.get("selected");for(var i=0;i<tabs.length;i++){var tab=tabs[i];if(active===i){return idx}var hidden=tab.hidden;if(typeof hidden==="string"){hidden=this.get(hidden)}if(!hidden){idx++}}return idx};Object.defineProperties(Tabs.prototype,prototypeAccessors);return Tabs}(Ractive);var tabAttrs=["closable","disabled","title","right","button","no-pad","hidden","id","load"];Ractive.extendWith(Tabs,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs",g:1},{t:16,r:"extra-attributes"},{n:"class-rtabs-flat",t:13,f:[{t:2,r:"~/flat"}]},{n:"class-rtabs-margin",t:13,f:[{t:2,r:"~/margin"}]},{n:"class-rtabs-fill",t:13,f:[{t:2,r:"~/fill"}]},{n:"sized",t:71,f:{r:[],s:'[{clientWidth:"~/clientWidth"}]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window-wrapper",g:1},{n:"class-rtabs-scroll-right",t:13,f:[{t:2,x:{r:["@this","~/scrollStatus"],s:"_0._scrollsRight(_1)"}}]},{n:"class-rtabs-scroll-left",t:13,f:[{t:2,x:{r:["@this","~/scrollStatus"],s:"_0._scrollsLeft(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window",g:1},{t:4,f:[{n:"class-rtabs-going-left",t:13}],n:50,x:{r:[".direction"],s:'_0==="left"'}},{t:4,f:[{n:"class-rtabs-going-right",t:13}],n:51,l:1},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scrollStatus"]'}}],n:51,r:"@style.raui.tabs.noscrollindicators"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tabs",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-left",g:1},{n:"class-rtabs-center",t:13,f:[{t:2,r:"~/center"}]}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"!_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-right",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-indicator",g:1},{n:"style-left",f:[{t:2,r:".selectedLeft"},"px"],t:13},{t:4,f:[{n:"style-right",f:[{t:2,r:".selectedRight"},"px"],t:13}],n:50,x:{r:[".selectedRight"],s:"_0!==undefined"}}]}],n:51,r:"@style.raui.tabs.boxy"}]}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-window",g:1},{t:4,f:[{n:"class-rtabs-trans-fade",t:13}],n:50,x:{r:[".transition"],s:'_0==="fade"'}},{t:4,f:[{n:"class-rtabs-trans-slide",t:13}],n:50,x:{r:[".transition"],s:'_0==="slide"'},l:1},{n:["scroll"],t:70,f:{r:["@this","@node"],s:"[_0.stopHorizontalScroll(_1)]"}},{n:"class-rtab-scroll-right",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-left",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-top",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-bottom",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-contents",g:1},{n:"style-opacity",f:[{t:2,r:"~/opacity"}],t:13},{n:"style-left",f:[{t:2,x:{r:[".selectedContent"],s:"_0*-100"}},"%"],t:13},{n:"class-rtabs-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:4,f:[{t:8,r:"tab-content"}],n:52,r:".tabs"}]}]}]}]}],e:{'[{clientWidth:"~/clientWidth"}]':function(){return[{clientWidth:"~/clientWidth"}]},"_0._scrollsRight(_1)":function(_0,_1){return _0._scrollsRight(_1)},"_0._scrollsLeft(_1)":function(_0,_1){return _0._scrollsLeft(_1)},'_0==="left"':function(_0){return _0==="left"},'["~/scrollStatus"]':function(){return["~/scrollStatus"]},"!_0&&!_1._hidden(_2)":function(_0,_1,_2){return!_0&&!_1._hidden(_2)},"_0&&!_1._hidden(_2)":function(_0,_1,_2){return _0&&!_1._hidden(_2)},"_0!==undefined":function(_0){return _0!==undefined},'_0==="fade"':function(_0){return _0==="fade"},'_0==="slide"':function(_0){return _0==="slide"},"[_0.stopHorizontalScroll(_1)]":function(_0,_1){return[_0.stopHorizontalScroll(_1)]},"_0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)":function(_0,_1,_2){return _0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)},"_0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)":function(_0,_1,_2){return _0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)},"_0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)":function(_0,_1,_2){return _0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)},"_0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)":function(_0,_1,_2){return _0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)},"_0*-100":function(_0){return _0*-100},"_0===_1":function(_0,_1){return _0===_1},'_0==="dynamic"':function(_0){return _0==="dynamic"},"_0!==_1":function(_0,_1){return _0!==_1},"_0===false":function(_0){return _0===false},"[_0.checkSelection((_1),_2)]":function(_0,_1,_2){return[_0.checkSelection(_1,_2)]},'[".scrollStatus"]':function(){return[".scrollStatus"]},'["content",_0]':function(_0){return["content",_0]},'(_3==="always"&&_0===_1)||(_3&&_2)||!_3':function(_0,_1,_2,_3){return _3==="always"&&_0===_1||_3&&_2||!_3},"!_0":function(_0){return!_0},"_0===_1&&!_2":function(_0,_1,_2){return _0===_1&&!_2},'typeof _1==="string"?_0.get(_1):_1':function(_0,_1){return typeof _1==="string"?_0.get(_1):_1},'[["select",_0]]':function(_0){return[["select",_0]]},"[_0.button()]":function(_0){return[_0.button()]},'typeof _0==="function"':function(_0){return typeof _0==="function"},'["tab",_0]':function(_0){return["tab",_0]},'typeof _0==="string"':function(_0){return typeof _0==="string"},'[["close",_0]]':function(_0){return[["close",_0]]},"_0&&!_1":function(_0,_1){return _0&&!_1}},p:{"tab-content":[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-content",g:1},{n:"class-rtabs-selected-content",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0===_1"}}]},{n:"class-rtabs-dyna",t:13,f:[{t:2,x:{r:["~/height"],s:'_0==="dynamic"'}}]},{n:"class-rtabs-not-selected",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0!==_1"}}]},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"},{t:4,f:[{n:"class-rtabs-no-pad",t:13}],n:50,x:{r:[".pad"],s:"_0===false"}},{t:4,f:[{n:"class-rtabs-no-pad",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".padRef"}]}}]}],n:50,r:".padRef",l:1},{n:["focusin"],t:70,f:{r:["@this","@context","@index"],s:"[_0.checkSelection((_1),_2)]"}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'[".scrollStatus"]'}}],n:51,r:"@style.raui.tabs.noscrollindicators"},{n:"registered",t:71,f:{r:["@index"],s:'["content",_0]'}}],f:[{t:4,f:[{t:16,r:".template"}],n:50,x:{r:["~/selectedContent","@index",".load","~/defer"],s:'(_3==="always"&&_0===_1)||(_3&&_2)||!_3'}}]}],n:50,x:{r:[".button"],s:"!_0"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-placeholder",g:1}]}],n:51,l:1}],tab:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab",g:1},{n:"class-rtabs-selected",t:13,f:[{t:2,x:{r:["~/selected","@index",".button"],s:"_0===_1&&!_2"}}]},{t:4,f:[{n:"class-rtabs-disabled",t:13}],n:50,x:{r:["@this",".disabled"],s:'typeof _1==="string"?_0.get(_1):_1'}},{t:4,f:[{n:["click"],t:70,f:{r:["@index"],s:'[["select",_0]]'}}],n:50,x:{r:[".button"],s:"!_0"},l:1},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.button()]"}}],n:50,x:{r:[".button"],s:'typeof _0==="function"'},l:1},{n:"registered",t:71,f:{r:["@index"],s:'["tab",_0]'}},{t:4,f:[{t:16,r:".extraTab"}],n:50,r:".extraTab"},{n:"data-tab-index",f:[{t:2,r:"@index"}],t:13}],f:[{t:4,f:[{t:2,r:"title"}],n:50,x:{r:[".title"],s:'typeof _0==="string"'}},{t:4,f:[{t:16,r:".title"}],n:50,r:".title",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-close",g:1},{n:["click"],t:70,f:{r:["@index"],s:'[["close",_0]]'}}],f:["×"]}],n:50,x:{r:[".closable",".button"],s:"_0&&!_1"}}]}]}},cssId:"rtab",noCssTransform:true,css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.tabs.primary"));primary.selected=Object.assign({},data("raui.tabs.selected"),data("raui.tabs.primary.selected"));primary.indicator=Object.assign({},data("raui.tabs.indicator"),data("raui.tabs.primary.indicator"));var themes=(data("raui.themes")||[]).slice();(data("raui.tabs.themes")||[]).forEach(function(t){if(!~themes.indexOf(t)){themes.push(t)}});var boxy=data("raui.tabs.boxy")||data("raui.tabs.primary.boxy");var bottom=(data("raui.tabs.bottom")||1)*.0625+"em";return"\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n "+(!boxy?"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";":"border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bga||"#f4f4f4")+";\n ")+"\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }"+(boxy?"\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fga||"#07e")+";\n }":"")+"\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n \n .rtabs-tab-window-wrapper:before,\n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n height: 100%;\n width: "+(primary.indicator.size||"1em")+";\n opacity: 0;\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(primary.indicator.highlight||primary.indicator.color||primary.fga||"#07e")+", transparent);\n left: 0;\n }\n .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(primary.indicator.highlight||primary.indicator.color||primary.fga||"#07e")+", transparent);\n right: 0;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after,\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 0.5;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n "+(!boxy?".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: "+(primary.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: "+(primary.fga||"#07e")+";\n }":"\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(primary.bg||"#fff")+";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(primary.fga||"#07e")+";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")+"\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }"+(boxy?"\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }":"")+"\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;"+(boxy?"\n border-style: solid;\n border-width: 0 0 "+bottom+" 0;\n border-color: "+(primary.bc||"#ccc")+";\n line-height: 1.5em;":"")+"\n }\n \n .rtabs-tab {\n display: inline-flex;\n align-items: center;\n padding: 0.5em 1em;\n height: 1.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;"+(!boxy?"\n opacity: 0.9;":"\n border-color: "+(primary.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 1px "+bottom+" 0;\n margin-bottom: -"+bottom+";\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bga||"#f4f4f4")+";\n ")+"\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected"+(boxy?",\n .alt > div > .rtabs-tab-window .rtabs-selected":"")+" {\n opacity: 1;"+(boxy?"\n font-weight: bold;\n border-bottom-color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.selected.bg||primary.bg||"#fff")+";\n color: "+(primary.selected.fg||primary.fg||"#222")+";":"")+"\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: "+(primary.indicator.color||primary.fga||"#07e")+";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(primary.bg||"#fff")+";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n }\n \n .rtabs {\n color: "+(primary.fg||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: flex;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-content-window:before,\n .rtabs-content-window:after {\n content: '';\n display: block;\n position: absolute;\n z-index: 999;\n height: "+(primary.indicator.size||"1em")+";\n width: 100%;\n opacity: 0;\n pointer-events: none;\n }\n .rtabs-content-window:before {\n top: 0;\n background: linear-gradient(to bottom, "+(primary.indicator.highlight||primary.indicator.color||primary.fga||"#07e")+", transparent);\n }\n .rtabs-content-window:after {\n bottom: 0;\n background: linear-gradient(to top, "+(primary.indicator.highlight||primary.indicator.color||primary.fga||"#07e")+", transparent);\n }\n .rtabs-content-window.rtab-scroll-top:before,\n .rtabs-content-window.rtab-scroll-bottom:after {\n opacity: 0.5;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n "+themes.map(function(t){var theme=Object.assign({},data("raui.primary"),data("raui.tabs.primary"),data("raui."+t),data("raui.tabs."+t));theme.selected=Object.assign({},data("raui.tabs.selected"),data("raui.tabs.primary.selected"),data("raui.tabs."+t+".selected"));theme.indicator=Object.assign({},data("raui.tabs.indicator"),data("raui.tabs.primary.indicator"),data("raui.tabs."+t+".indicator"));var boxy="boxy"in theme?theme.boxy:data("raui.tabs.boxy");return".rtabs."+t+" > div > .rtabs-tab-window {\n "+(!boxy?"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bg||"#fff")+";":"border-color: "+(theme.bc||"#ccc")+";\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bga||"#f4f4f4")+";\n ")+"\n }\n .rtabs."+t+" > .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(theme.indicator.highlight||theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+" > .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(theme.indicator.highlight||theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+" > .rtabs-content-wrapper > .rtabs-content-window:before {\n background: linear-gradient(to bottom, "+(theme.indicator.highlight||theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+" > .rtabs-content-wrapper > .rtabs-content-window:after {\n background: linear-gradient(to top, "+(theme.indicator.highlight||theme.indicator.color||theme.fga||"#07e")+", transparent);\n }\n .rtabs."+t+".alt > div > .rtabs-tab-window {\n color: "+(theme.bg||"#fff")+";\n background-color: "+(theme.fga||"#07e")+";\n }"+(boxy?"\n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(theme.bg||"#fff")+";\n background-color: "+(theme.fga||"#07e")+";\n }":"")+"\n \n "+(!boxy?".rtabs-flat."+t+" > div > .rtabs-tab-window:after {\n background-color: "+(theme.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt."+t+" > div > .rtabs-tab-window:after {\n background-color: "+(theme.fga||"#07e")+";\n }":"\n .rtabs-flat."+t+" > div > .rtabs-tab-window {\n background-color: "+(theme.bg||"#fff")+";\n }\n .alt.rtabs-flat."+t+" > div > .rtabs-tab-window {\n background-color: "+(theme.fga||"#07e")+";\n }")+"\n \n "+(boxy?".rtabs."+t+" > div > .rtabs-tab-window .rtabs-tabs {\n border-color: "+(theme.bc||"#ccc")+";\n }":"")+"\n \n .rtabs."+t+" > div > .rtabs-tab-window > .rtabs-tab {\n cursor: pointer;"+(!boxy?"":"\n border-color: "+(theme.bc||"#ccc")+";\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bga||"#f4f4f4")+";\n ")+"\n }\n \n .rtabs."+t+" > div > .rtabs-tab-window .rtabs-selected"+(boxy?",\n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-selected":"")+" {"+(boxy?"\n border-bottom-color: "+(them.bg||"#fff")+";\n background-color: "+(theme.selected.bg||theme.bg||"#fff")+";"+(theme.indicator?"\n background-image: linear-gradient(to bottom, "+(theme.indicator.color||theme.fga||"#07e")+", "+(theme.bg||"#fff")+" 3px);":"")+"\n color: "+(theme.selected.fg||theme.fg||"#222")+";":"")+"\n }\n \n .rtabs."+t+" > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(theme.indicator.color||theme.fga||"#07e")+";\n }\n \n .rtabs."+t+".alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(theme.bg||"#fff")+";\n }\n \n .rtabs."+t+" {\n color: "+(theme.fg||"#222")+";\n background-color: "+(theme.bg||"#fff")+";\n }\n "}).join("\n")}.call(this,data)].join(" ")},attributes:["transition","flat","pad","center","height","fill","defer","selected"],data:function data(){return{tabs:[],rightTabs:[],selected:-1,selectedContent:-1,opacity:1,scrollStatus:""}},on:{construct:construct,config:function config(){var this$1=this;if(this._ctabs){this.set("tabs",(this.get("tabs")||[]).concat(this._ctabs),{shuffle:true})}this._ctabs=0;var tabs=this.get("tabs");var xs=this.indicatorObservers=[];tabs.forEach(function(t){if(typeof t.hidden==="string"){xs.push(this$1.observe(t.hidden,function(){return setTimeout(function(){return this$1.updateIndicator()})},{init:false,defer:true}))}});xs.push(this.observe("tabs.*.hidden",function(){return setTimeout(function(){return this$1.updateIndicator()})},{init:false,defer:true}));this.once("render",function(){var sel=this$1.get("selected");if(sel===-1){this$1.select(0)}else{this$1.set("selectedContent",sel)}})},select:select,close:close,teardown:function teardown(){this.indicatorObservers.forEach(function(o){return o.cancel()})}},observe:{selected:{handler:function handler(v){var this$1=this;var hidden=this._hidden(v);var tabs=this.get("tabs");if(hidden){setTimeout(function(){var trans=this$1.get("transition");this$1.set("transition","");var tabs=this$1.get("tabs");for(var i=0;i<tabs.length;i++){var t=tabs[i];var h=t.hidden;if(typeof h==="string"){h=this$1.get(h)}if(!h){this$1.select(i);break}}this$1.set("transition",trans)})}},init:false},clientWidth:function clientWidth(){this.updateIndicator()}},decorators:{registered:function registered(node,where,idx){var me=this;var ctx=this.getContext(node);if(!this._tabs){this._tabs=[]}if(!this._contents){this._contents=[]}this["_"+where+"s"][idx]=node;if(where==="tab"){this.updateIndicator()}else if(ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}return{teardown:function teardown(){},invalidate:function invalidate(){if(where==="tab"){me.updateIndicator()}else if(ctx.decorators.scrolled){ctx.decorators.scrolled.refresh()}},update:function update(idx){me["_"+where+"s"][idx]=node;if(where==="tab"){setTimeout(function(){return me.updateIndicator()})}else if(ctx.decorators.scrolled){setTimeout(function(){return ctx.decorators.scrolled.refresh()})}}}},scrolled:scrolled,sized:sized}});function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};var tabs=tpl.filter(function(n){return n.e==="tab"}).map(function(t){var tab={template:{t:t.f.filter(function(n){return n.e!=="title"})}};var extra=[];var extraTab=[];t.m&&t.m.forEach(function(a){if(a.t===13&&~tabAttrs.indexOf(a.n)){if(a.n==="disabled"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd="_cnd"+attrs.length;tab.disabled=cnd;attrs.push({t:13,n:cnd,f:a.f})}else if(a.n==="no-pad"){if(!a.f){tab.pad=false}else if(a.f.length===1&&a.f[0].t===2){var cnd$1="_cnd"+attrs.length;tab.padRef=cnd$1;attrs.push({t:13,n:cnd$1,f:a.f})}}else if(a.n==="hidden"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd$2="_cnd"+attrs.length;tab.hidden=cnd$2;attrs.push({t:13,n:cnd$2,f:a.f})}else{tab[a.n]=a.f===0?true:typeof a.f==="string"?a.f:{t:a.f}}}else if(a.t===70){extraTab.push(a)}else{extra.push(a)}});var tmp;tmp=t.f.find(function(n){return n.e==="title"});if(tmp){tab.title=tmp.f;if(tmp.m){extraTab.push.apply(extraTab,tmp.m)}}if(extra.length){tab.extra={t:extra}}if(extraTab.length){tab.extraTab={t:extraTab}}return tab});this._ctabs=tabs}function select(ctx,idx){var this$1=this;var obj;if(idx<-1||idx>=this.get("tabs.length")){return}var current=this.get("selected");var prs=[];var trans=this.get("transition");if(this._fadetm){this.set("opacity",1);clearTimeout(this._fadetm);this._fadetm=0}if(this._contents){var el=this._contents[idx];if(el){var ctx$1=this.getContext(el);if(ctx$1.decorators.scrolled){ctx$1.decorators.scrolled.refresh()}}}if(current!==idx){if(this.rendered){var cur=this.getContext(this.find(".rtabs-selected"));var window=this.find(".rtabs-content-window");if(~current){this.set("scroll."+cur.get("@index"),window.scrollTop)}if(cur.hasListener("leave")){cur.raise("leave")}if(trans==="fade"){this.set({opacity:0,selected:idx});this.updateIndicator();var ctx$2=this.getContext(this.find(".rtabs-selected"));this._fadetm=setTimeout(function(){var obj;this$1._fadetm=0;this$1.set((obj={selectedContent:idx},obj["tabs."+idx+".load"]=true,obj.opacity=1,obj));if(ctx$2.hasListener("enter")){ctx$2.raise("enter")}if(window&&~current){window.scrollTop=this$1.get("scroll."+idx)||0}},150)}else if(trans==="slide"){this.set("selected",idx);this.set("tabs."+idx+".load",true);this.set("selectedContent",idx);this.updateIndicator();var ctx$3=this.getContext(this.find(".rtabs-selected"));if(ctx$3.hasListener("enter")){ctx$3.raise("enter")}if(window&&~current){window.scrollTop=this.get("scroll."+idx)||0}}else{this.set((obj={selected:idx},obj["tabs."+idx+".load"]=true,obj.selectedContent=idx,obj));this.updateIndicator();var ctx$4=this.getContext(this.find(".rtabs-selected"));if(ctx$4.hasListener("enter")){ctx$4.raise("enter")}if(window){window.scrollTop=this.get("scroll."+idx)||0}}if(~current&&window&&window.scrollLeft){window.scrollLeft=0}}else{this.set({selected:idx,selectedContent:idx})}}}function close(ctx,idx){var tab=this.getContext(this._tabs[idx]);var ok=true;if(typeof tab.onclose==="function"){ok=tab.onclose.call(undefined)!==false}if(ok&&tab.element.events.find(function(e){return e.events.find(function(e){return e.name==="close"})})){ok=tab.raise("close")!==false}if(ok){this.splice("tabs",idx,1)}return false}export var Handle=function Handle(tabs,item){this.tabs=tabs;this.item=item};var prototypeAccessors$1={keypath:{configurable:true},id:{configurable:true},index:{configurable:true},title:{configurable:true},template:{configurable:true},hidden:{configurable:true},right:{configurable:true},pad:{configurable:true},disabled:{configurable:true},button:{configurable:true},closable:{configurable:true},load:{configurable:true}};prototypeAccessors$1.keypath.get=function(){if(this.removed){return}return"tabs."+this.index};prototypeAccessors$1.id.get=function(){return this.get("id")};prototypeAccessors$1.id.set=function(v){this.set("id",v)};prototypeAccessors$1.index.get=function(){return this.tabs.get("tabs").indexOf(this.item)};prototypeAccessors$1.title.get=function(){return this.get("title")};prototypeAccessors$1.title.set=function(v){this.set("title",v)};prototypeAccessors$1.template.get=function(){return this.get("template")};prototypeAccessors$1.template.set=function(v){return this.set("template",v)};prototypeAccessors$1.hidden.get=function(){return this.get("hidden")};prototypeAccessors$1.hidden.set=function(v){return this.set("hidden",v)};prototypeAccessors$1.right.get=function(){return this.get("right")};prototypeAccessors$1.right.set=function(v){return this.set("right",v)};prototypeAccessors$1.pad.get=function(){return this.get("pad")};prototypeAccessors$1.pad.set=function(v){return this.set("pad",v)};prototypeAccessors$1.disabled.get=function(){return this.get("disabled")};prototypeAccessors$1.disabled.set=function(v){return this.set("disabled",v)};prototypeAccessors$1.button.get=function(){return this.get("button")};prototypeAccessors$1.button.set=function(v){return this.set("button",v)};prototypeAccessors$1.closable.get=function(){return this.get("closable")};prototypeAccessors$1.closable.set=function(v){return this.set("closable",v)};prototypeAccessors$1.load.get=function(){return this.get("load")};prototypeAccessors$1.load.set=function(v){return this.set("load",v)};Handle.prototype.select=function select(){if(this.removed){return}this.tabs.select(this.index)};Handle.prototype.remove=function remove(){if(this.removed){return false}this.tabs.splice("tabs",this.index,1);this.removed=true;return true};Handle.prototype.get=function get(keypath){if(this.removed){return false}if(!keypath){return this.tabs.get(this.keypath)}var key=keypath.replace(/^[\.\/]*/,"");return this.tabs.get(this.keypath+"."+key)};Handle.prototype.set=function set(keypath,value){if(this.removed){return false}var key=keypath.replace(/^[\.\/]*/,"");return this.tabs.set(this.keypath+"."+key,value)};Object.defineProperties(Handle.prototype,prototypeAccessors$1);export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"tabs"]=Tabs}}globalRegister("RauiTabs","components",Tabs);export default plugin;

@@ -1,1 +0,1 @@

import Ractive from"ractive";import expand from"./transition-expand";import toast from"./Toast";import globalRegister from"./globalRegister";import{sizeInEm,sizeInPx}from"./watch-size";var escape=Ractive.escapeKey;var windowTrans;export var Base=function(Ractive){function Base(opts){Ractive.call(this,opts)}if(Ractive)Base.__proto__=Ractive;Base.prototype=Object.create(Ractive&&Ractive.prototype);Base.prototype.constructor=Base;return Base}(Ractive);Ractive.extendWith(Base,{css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.window.primary"));primary.action=Object.assign({},data("raui.window.action"),data("raui.window.primary.action"));primary.host=Object.assign({},data("raui.window.host"),data("raui.window.primary.host"));primary.title=Object.assign({inactive:{}},data("raui.window.title"),data("raui.window.primary.title"));primary.topmost=Object.assign({},data("raui.primary"),data("raui.window.primary"),data("raui.window.primary.topmost"));return"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: "+(primary.host.bg||primary.bg||"#fff")+";\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n width: 100%;\n height: 100%;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(primary.handleSize||7)+"px;\n }\n \n .rwindow-slide-left {\n height: 100%;\n left: 0;\n }\n .rwindow-slide-right {\n height: 100%;\n right: 0;\n }\n .rwindow-slide-top {\n width: 100%;\n top: 0;\n }\n .rwindow-slide-bottom {\n width: 100%;\n bottom: 0;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 "+(primary.topmost.shadow||"rgba(0, 0, 0, 0.14)")+", 0 1px 18px 0 "+(primary.topmost.shadow||"rgba(0, 0, 0, 0.12)")+", 0 3px 5px -1px "+(primary.topmost.shadow||"rgba(0, 0, 0, 0.3)")+";\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n .rwindow-modal.rwindow-move {\n z-index: 50;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(primary.bg||"#fff")+";\n color: "+(primary.fg||"#222")+";\n box-shadow: 0 2px 2px 0 "+(primary.shadow||"rgba(0, 0, 0, 0.14)")+", 0 1px 5px 0 "+(primary.shadow||"rgba(0, 0, 0, 0.12)")+", 0 3px 1px -2px "+(primary.shadow||"rgba(0, 0, 0, 0.2)")+";\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(primary.minWidth||"6em")+";\n min-height: "+(primary.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(primary.title.inactive.bg||primary.fg||"#222")+";\n color: "+(primary.title.inactive.fg||primary.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n min-height: 2em;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(primary.title.bg||primary.fga||"#07e")+";\n color: "+(primary.title.fg||primary.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(primary.action.bc||primary.bc||"#ccc")+";\n background-color: "+(primary.action.bg||primary.bg||"#fff")+";\n color: "+(primary.action.fg||primary.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n cursor: default;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+(typeof data("raui.window.extra")==="function"?data("raui.window.extra").call(this,data):"")+"\n "}.call(this,data)].join(" ")},cssId:"rwindow",noCssTransform:true,delegate:false,decorators:{tracked:function tracked(node,id){this[id]=node;return{teardown:function teardown(){if(this[id]===node){this[id]=null}}}}},transitions:{window:function window(t,params){if(windowTrans){return t.complete()}windowTrans=t;var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0});setTimeout(function(){t.animateStyle({transform:"none",opacity:1},p).then(function(){t.setStyle("opacity",1);windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})})}else{t.setStyle({transform:"none",opacity:1});t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},p).then(function(){windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})}},slide:function slide(t,params){var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";var done=function(){t.complete();if(parent.style){setTimeout(function(){return parent.style.overflow=overflow})}};if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){if(p.from==="top"){t.setStyle({transform:"translateY(-100%)"});t.animateStyle({transform:"translateY(0)"},p).then(done)}else if(p.from==="bottom"){t.setStyle({transform:"translateY(100%)"});t.animateStyle({transform:"translateY(0)"},p).then(done)}else if(p.from==="left"){t.setStyle({transform:"translateX(-100%)"});t.animateStyle({transform:"translateX(0)"},p).then(done)}else if(p.from==="right"){t.setStyle({transform:"translateX(100%)"});t.animateStyle({transform:"translateX(0)"},p).then(done)}}else{if(p.from==="top"){t.setStyle({transform:"translateY(0)"});t.animateStyle({transform:"translateY(-100%)"},p).then(done)}else if(p.from==="bottom"){t.setStyle({transform:"translateY(0)"});t.animateStyle({transform:"translateY(100%)"},p).then(done)}else if(p.from==="left"){t.setStyle({transform:"translateX(0)"});t.animateStyle({transform:"translateX(-100%)"},p).then(done)}else if(p.from==="right"){t.setStyle({transform:"translateX(0)"});t.animateStyle({transform:"translateX(100%)"},p).then(done)}}}}});var id=0;export var Host=function(Base){function Host(opts){Base.call(this,opts);this.defaults={}}if(Base)Host.__proto__=Base;Host.prototype=Object.create(Base&&Base.prototype);Host.prototype.constructor=Host;var prototypeAccessors={current:{configurable:true},currentId:{configurable:true},placement:{configurable:true},topmost:{configurable:true},windows:{configurable:true}};prototypeAccessors.current.get=function(){var top=this.get("topLevel");return this.getWindow(this.get("windows."+escape(top)+".id"))};prototypeAccessors.currentId.get=function(){var top=this.get("topLevel");return this.get("windows."+escape(top)+".id")};prototypeAccessors.placement.get=function(){return this.get("placement")};prototypeAccessors.placement.set=function(v){return this.set("placement",v)};prototypeAccessors.topmost.get=function(){var windows=this.get("windows");for(var k in windows){if(windows[k].topmost){return this.getWindow(windows[k].id)}}};prototypeAccessors.windows.get=function(){return Object.keys(this.get("windows"))};Host.prototype.addWindow=function addWindow(window,opts){var this$1=this;var options=Object.assign({},this.defaults,window.constructor.prototype.options,window.options,window.get("options"),opts);if(!(window instanceof Window)){throw new Error("Windows must be instances of Window")}if(!window.id){window.set("@.id",options.id||"window"+id++)}if(!this.get("windows."+escape(window.id))){this.set("windows."+escape(window.id),Object.assign({show:options.show!==false,autosize:true,id:window.id,blockers:[],close:true,minimize:true,maximize:true,minWidth:"5em",minHeight:"5em"},options,{id:window.id}))}window.host=this;var promise=this.attachChild(window,{target:"window"});var parent;if(options.block){parent=options.block.id||options.block;if(typeof parent==="string"&&parent in this.get("windows")){this.push("windows."+escape(parent)+".blockers",window.id);window.set("control.blocking",parent)}else{parent=false}}window.minSize(options.minWidth||"5em",options.minHeight||"5em");if(options.slide){}else if(options.size==="fill"&&(parent||options.block)){var wnd;if(options.block===true){wnd=this.find(".rwhost-pane")}else if(wnd=this.getWindow(parent)){wnd=wnd.find(".rwindow")}if(wnd){window.size(wnd.clientWidth-(options.fillPad||20),wnd.clientHeight-(options.fillPad||20));if(options.block&&!(options.top||options.left)){options.top=options.left=Math.floor((options.fillPad||20)/2)}}}else if(options.width&&options.height){window.size(options.width,options.height)}else{window.size("auto")}if(options.slide){}else if(options.top&&options.left){window.move(options.top,options.left)}else{this.place(window)}this.raise(window,{show:options.show!==false,parent:options.stickToParent});window.on("close",function(){var blocking=window.get("control.blocking");if(blocking){var blockers=this$1.windowGet(blocking,"blockers")||[];this$1.splice("windows."+escape(blocking)+".blockers",blockers.indexOf(window.id),1)}this$1.detachChild(window).then(function(){return window.teardown()});this$1.set("windows."+escape(window.id)+".block",false);this$1.set("windows."+escape(window.id)+".index",-1);this$1.raise();this$1.set("windows."+escape(window.id),undefined);delete this$1.get("windows")[window.id]});this.update("windows."+escape(window.id)+".id",{force:true});this.fire("add",{},{window:window,options:options});return promise.then(function(){return window})};Host.prototype.getWindow=function getWindow(id){return this.children.byName.window&&this.children.byName.window.filter(function(w){return w.instance.id===id}).map(function(w){return w.instance})[0]};Host.prototype.windowGet=function windowGet(id,path){return this.get("windows."+escape(id)+"."+path)};Host.prototype.windowSet=function windowSet(id,path,val){return this.set("windows."+escape(id)+"."+path,val)};Host.prototype.raise=function raise(window,opts){var this$1=this;if(opts===void 0)opts={};var wnd=window instanceof Window?window:this.children.byName.window.filter(function(a){return a.instance.id===window}).map(function(a){return a.instance})[0];var object=this.get("windows",{virtual:false});var host=this;var wnds=Object.keys(object).map(function(k){return object[k]});var top=(wnds.length+1)*2;var last=this.get("topLevel");var wasBlocked=this.get("blocked");var id=wnd?wnd.get("control.id"):wnds.reduce(function(a,c){return!a?c:c.index>a.index?c:a},null);if(!wnd&&id){wnd=this.children.byName.window.find(function(a){return a.instance.id===id})}function blocks(ctrl){if(ctrl.blockers){ctrl.blockers.forEach(function(b,i){var w=wnds.find(function(w){return w.id===b});if(!w){return}w.index=ctrl.index+i+1;blocks(w)})}}function liftBlocked(control,pos){if(!control){return}control.index=pos--;if(control.blocking){liftBlocked(wnds.find(function(w){return w.id===control.blocking}),pos)}blocks(control)}if(wnd){var ctrl=wnd.get("control");ctrl.index=opts.show===false?-1:top;blocks(ctrl);if(ctrl.blocking){liftBlocked(wnds.find(function(w){return w.id===ctrl.blocking}),top-1)}if(opts.show!==false&&!ctrl.show){wnd.show()}}wnds.filter(function(w){return w.show!==false&&w.block===true}).forEach(function(w){this$1.set("windows."+escape(w.id)+".index",(w.index||0)+top);blocks(w)});var ordered=wnds.sort(function(l,r){return!l.show?-1:!r.show?1:l.index<r.index?-1:1});var visible=ordered.filter(function(w){return w.show});top=ordered.indexOf(visible[visible.length-1]);var sets={};var modalIdx=null;ordered.forEach(function(w,i){var key=escape(w.id);if(w.block===true&&modalIdx===null){modalIdx=i}sets["windows."+key+".index"]=w.index=modalIdx!==null?i+2:i;sets["windows."+key+".topmost"]=i===top;sets["windows."+key+".stack"]=ordered.length-i});if(modalIdx!==null){sets.blocked=modalIdx+1}else{sets.blocked=0}if(~top&&ordered.length){sets.topLevel=ordered[top].id}else{sets.topLevel=null}this.set(sets);top=sets.topLevel;if(top&&top!==last&&this.get("currentMax")&&this.rendered){var leaving=this.get("windows."+escape(last));wnd=this.getWindow(top);var transition=this.get("transition");if(transition!==false&&!wnd.get("control.slide")&&(!leaving||!leaving.dialog&&!leaving.slide&&(!leaving.blocking||leaving.blocking&&leaving.blocking!==top))){wnd.transition(transition||"window",wnd.find("div"),{intro:true})}}this.fire("raise",{},{top:this.topmost});if(last!==this.get("topLevel")){var wnd$1=this.current;wnd$1&&wnd$1.fire("raise",{},{last:this.getWindow(last)})}};Host.prototype.place=function place(wnd){var this$1=this;if(!wnd.get("control.show")){return Promise.resolve()}return new Promise(function(ok){requestAnimationFrame(function(){var local=wnd.get("control");if(local.width===undefined&&!local.dialog){wnd.size("auto")}var left=0;var top=0;if(!(this$1.fragment&&this$1.fragment.rendered)){return}var host=this$1.find(".rwhost");var maxw=host.clientWidth;var maxh=host.clientHeight;var lw=local.width;var lh=local.height;if(local.dialog&&(!local.size||local.size==="auto"||!local.width||!local.height)){lw=sizeInEm(wnd.pane.clientWidth);lh=sizeInEm(wnd.pane.clientHeight)}var blocking=local.blocking;if(blocking){var key="windows."+escape(blocking);var blocked=this$1.get(key);var max=local.max||!local.dialog&&(this$1.get("max")||this$1.get("userMax"));var bmax=blocked.max||this$1.get("userMax")||this$1.get("max");var bw=bmax?this$1.host.clientWidth:sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-sizeInPx(lw)/2;top=(max?maxh:bh/2)+(max?0:bt)-sizeInPx(lh)/2}else{var place=this$1.get("placement");var pos;if(typeof place==="function"){try{pos=place(this$1,host,local)}catch(e){pos=placeGrid(this$1,host,local)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local);break;default:pos=placeGrid(this$1,host,local);break}}else{pos=placeGrid(this$1,host,local)}top=pos.top;left=pos.left}if(isNaN(left)||left<0){left=10}if(isNaN(top)||top<0){top=10}wnd.set({"control.top":top,"control.left":left});ok()})})};Host.prototype.placeAll=function placeAll(){var this$1=this;if(!(this.fragment&&this.fragment.rendered)){return}var winids=Object.keys(this.get("windows")||{}).filter(function(k){return this$1.get("windows."+Ractive.escapeKey(k)+".show")});var host=this.find(".rwhost");return new Promise(function(ok){requestAnimationFrame(function(){var maxw=host.clientWidth;var maxh=host.clientHeight;var winid;while(winid=winids[0]){var wnd=this$1.getWindow(winid);var local=wnd.get("control");if(local.width===undefined&&!local.dialog){wnd.size("auto")}var left=0;var top=0;var lw=local.width;var lh=local.height;if(local.dialog&&(!local.size||local.size==="auto"||!local.width||!local.height)){lw=sizeInEm(wnd.pane.clientWidth);lh=sizeInEm(wnd.pane.clientHeight)}var blocking=local.blocking;if(blocking){var key="windows."+escape(blocking);var blocked=this$1.get(key);var max=local.max||!local.dialog&&(this$1.get("max")||this$1.get("userMax"));var bmax=blocked.max||this$1.get("userMax")||this$1.get("max");var bw=bmax?this$1.host.clientWidth:sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-sizeInPx(lw)/2;top=(max?maxh:bh/2)+(max?0:bt)-sizeInPx(lh)/2}else{var place=this$1.get("placement");var pos=void 0;if(typeof place==="function"){try{pos=place(this$1,host,local,winids)}catch(e){pos=placeGrid(this$1,host,local,winids)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local,winids);break;default:pos=placeGrid(this$1,host,local,winids);break}}else{pos=placeGrid(this$1,host,local,winids)}top=pos.top;left=pos.left}if(isNaN(left)||left<0){left=10}if(isNaN(top)||top<0){top=10}wnd.set({"control.top":top,"control.left":left});winids.shift()}ok()})})};Object.defineProperties(Host.prototype,prototypeAccessors);return Host}(Base);function placeGrid(host,target,node){var maxw=target.clientWidth;var maxh=target.clientHeight;var top=0,left=0;var grid1=host._grid1===undefined?host._grid1=0:host._grid1>7?host._grid1=0:++host._grid1;var width=Math.floor(maxw/3);var height=Math.floor(maxh/3);var localWidth=sizeInPx(node.width);var localHeight=sizeInPx(node.height+"em");switch(grid1){case 5:case 7:case 8:top=maxh-localHeight-10;break;case 2:case 4:case 6:top=height+Math.floor((height-localHeight)/2);break;case 0:case 1:case 3:top=10;break}switch(grid1){case 3:case 6:case 8:left=maxw-localWidth-10;break;case 1:case 4:case 7:left=width+Math.floor((width-localWidth)/2);break;case 0:case 2:case 5:left=10;break}if(left+localWidth>maxw){left=maxw-localWidth-10}if(top+localHeight>maxh){top=maxh-localHeight-10}return{top:top,left:left}}function placeSmart(host,target,node,ignore){var maxw=target.clientWidth-10;var maxh=target.clientHeight-10;var i,j;var cell=16;var mh=Math.floor(maxh/cell),mw=Math.floor(maxw/cell);var grid=new Array(mh*mw);var dest=new Array(mh*mw);for(i=0;i<grid.length;i++){grid[i]=0}var win,t,l,w,h,wins=0;var windows=host.get("windows");for(var k in windows){if(ignore&&~ignore.indexOf(k)){continue}wins++;win=windows[k];t=Math.floor(win.top/cell);l=Math.floor(win.left/cell);h=Math.ceil(sizeInPx(win.height)/cell);w=Math.ceil(sizeInPx(win.width)/cell);for(i=t;i<t+h&&i<mh;i++){for(j=l;j<l+w&&j<mw;j++){grid[i*mw+j]++}}}var c,ii,jj;w=Math.ceil(sizeInPx(node.width)/cell);h=Math.ceil(sizeInPx(node.height)/cell);for(i=0;i<mh;i++){for(j=0;j<mw;j++){if(i+h>mh||j+w>mw){c=wins*w*h}else{c=0;for(ii=0;ii<h;ii++){for(jj=0;jj<w;jj++){c+=grid[(i+ii)*mw+j+jj]}}}if(c===0){return{top:i*cell+5,left:j*cell+5}}dest[i*mw+j]=c}}c=wins*w*h;ii=0;for(i=0;i<dest.length;i++){if(dest[i]<c){c=dest[i];ii=i}}return{top:Math.floor(ii/mw)*cell+5,left:ii%mw*cell+5}}Base.extendWith(Host,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"moving",f:[{t:2,r:"~/moving"}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},"{t:_0}":function(_0){return{t:_0}},"_0&&_1":function(_0,_1){return _0&&_1},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(_0,_1){return[_0.getWindow(_1).hide()]},"!_0&&_1":function(_0,_1){return!_0&&_1},"[_0.getWindow(_1).maximize()]":function(_0,_1){return[_0.getWindow(_1).maximize()]},"!_0&&_1&&_2":function(_0,_1,_2){return!_0&&_1&&_2},"[_0.getWindow(_1).close()]":function(_0,_1){return[_0.getWindow(_1).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(_0){return[_0.hide()]},"[_0.maximize()]":function(_0){return[_0.maximize()]},"[_0.close()]":function(_0){return[_0.close()]},"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6":function(_0,_1,_2,_3,_4,_5,_6){return!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6},'["content"]':function(){return["content"]},"!_0":function(_0){return!_0},"[_0.call(_1)]":function(_0,_1){return[_0.call(_1)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(_0){return _0!==false},"_0||_1":function(_0,_1){return _0||_1},"(_0||_1||_2)&&!_3&&!_4":function(_0,_1,_2,_3,_4){return(_0||_1||_2)&&!_3&&!_4},"[{from:_0}]":function(_0){return[{from:_0}]},"[_0._startResize(_1)]":function(_0,_1){return[_0._startResize(_1)]},"[_0._sizeHandle(_1)]":function(_0,_1){return[_0._sizeHandle(_1)]},"[_0._startMove(_1)]":function(_0,_1){return[_0._startMove(_1)]},"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5":function(_0,_1,_2,_3,_4,_5){return!(_4===false||(_0||_1)&&!_3||_2)&&(!_3||_4===true)&&!_5},"[_0.raise()]":function(_0){return[_0.raise()]},'["pane"]':function(){return["pane"]},"_0&&!_1":function(_0,_1){return _0&&!_1}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,x:{r:["window.dialog","window.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{t:4,f:[" ",{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[toast(),expand()],cssId:"window-host",noIntro:true,attributes:["placement","windows","transition"],observe:{"@style.raui.window.maxFrom":function _style_raui_window_maxFrom(){initMediaListener(this)},topLevel:function topLevel(v){if(v){this.link("windows."+escape(v),"current")}else{this.unlink("current")}},currentMax:{handler:function handler(v){(this.children.byName.window||[]).forEach(function(w){return w.instance.fire("resize")})},defer:true}},computed:{currentMax:function currentMax(){var top=this.get("topLevel");var max=this.get("windows."+escape(top)+".max");var user=this.get("userMax");return user||this.get("max")||max}},on:{config:function config(){var this$1=this;var content=this.partials.content;if(content&&Array.isArray(content)){content=this.partials.content=content.slice();var i=content.length;while(i--){var e=content[i];if(e.e==="max-top"){content.splice(i,1);this.set({_maxP:{t:e.f},hideTitleMax:true});if(e.m){this.set({_maxAttrsP:{t:e.m}})}}}}if(typeof window!=="undefined"){var tm;this._resizeListener=function(){if(tm){return}tm=setTimeout(function(){tm=null;this$1.fire("resize")},300)};window.addEventListener("resize",this._resizeListener)}},teardown:function teardown(){if(this._resizeListener){window.removeEventListener("resize",this._resizeListener)}}}});function initMediaListener(r){if(r._media){r._media.fn()}else{r._media={};r._media.fn=function(){if(!r.host){return}var max=sizeInPx(r.get("@style.raui.window.maxFrom"));var trans=r.transitionsEnabled;r.transitionsEnabled=false;r.set("max",r.host.clientWidth<=max);r.set("dimensions",{clientWidth:r.host.clientWidth,clientHeight:r.host.clientHeight});r.transitionsEnabled=trans};r._media.handle=r.root.on("*.resize",r._media.fn);setTimeout(r._media.fn)}}function findEvent(instance){var i=instance;while(i){if(i.event&&i.event){return i.event.event}i=i.parent}}function getEventCoords(event){var node=event.target;if(!node){return{x:0,y:0}}var rect=node.getBoundingClientRect();return{x:Math.round(rect.left+(rect.right-rect.left)/2),y:Math.round(rect.top+(rect.bottom-rect.top)/2)}}Ractive.transitions.modal=function(t,parms){var params=t.processParams(parms,{duration:400,easing:"easeOut",x:0,y:-50,event:true});var event=null;var current={x:t.node.offsetLeft,y:t.node.offsetTop};var styles;var overflow=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(!event&&!t.node._modalSrc){if(t.isIntro){styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0}}}else{var click=t.node._modalSrc||(event?getEventCoords(event):{x:current.x+params.x,y:current.y+params.y});var target={x:click.x-Math.round(t.node.clientWidth/2)-current.x,y:click.y-Math.round(t.node.clientHeight/2)-current.y};if(t.node.parentNode.style){t.node.parentNode.style.overflow="hidden"}if(t.isIntro){t.node._modalSrc=click;styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0}}}t.animateStyle(styles,params).then(function(){if(t.node.parentNode.style){t.node.parentNode.style.overflow=overflow}t.complete()})};var moveEvents=["mousemove","mouseup","touchmove","touchend"];var handleSize=7;export var Window=function(Base){function Window(opts){Base.call(this,opts)}if(Base)Window.__proto__=Base;Window.prototype=Object.create(Base&&Base.prototype);Window.prototype.constructor=Window;var prototypeAccessors$1={resizable:{configurable:true},title:{configurable:true},visible:{configurable:true},pad:{configurable:true},buttons:{configurable:true},blocked:{configurable:true},result:{configurable:true}};prototypeAccessors$1.resizable.get=function(){return this.get("control.resizable")};prototypeAccessors$1.resizable.set=function(v){return this.set("control.resizable",v)};prototypeAccessors$1.title.get=function(){return this.get("control.title")};prototypeAccessors$1.title.set=function(v){return this.set("control.title",v)};prototypeAccessors$1.visible.get=function(){return this.get("control.show")};prototypeAccessors$1.visible.set=function(v){if(v){this.show()}else{if(this.get("control.show")){try{this.fire("hide")}catch(e){}}this.set("control.show",v,{keep:true})}this.host.raise(this,{show:v})};prototypeAccessors$1.pad.get=function(){return this.get("pad")};prototypeAccessors$1.pad.set=function(v){this.set("pad",v)};prototypeAccessors$1.buttons.get=function(){return this.get("buttons")};prototypeAccessors$1.buttons.set=function(v){return this.set("buttons",v)};prototypeAccessors$1.blocked.get=function(){return this.get("control.blocked")};prototypeAccessors$1.blocked.set=function(v){return this.set("control.blocked",v)};prototypeAccessors$1.result.get=function(){var this$1=this;if(!this._result){this._result={};this._result.promise=new Promise(function(ok){this$1._result.ok=ok})}return this._result.promise};Window.prototype.setResult=function setResult(v){this.result;this._result.value=v};Window.prototype.close=function close(force,result){if(force!==true){if(!this.parent){return false}if(this.get("control.blockers.length")){return false}if(typeof this.beforeClose==="function"&&this.beforeClose()===false){return false}if(this.fire("beforeClose")===false){return false}}this.fire("close");if(this._result){this._result.ok(this._result.value||result)}return true};Window.prototype.maximize=function maximize(){this.toggle("root.userMax")};Window.prototype.hide=function hide(){this.visible=false};Window.prototype.raise=function raise(show){this.host.raise(this,{show:show})};Window.prototype.show=function show(){var shown=this.get("control.show");this.set("control.show",true);if(this.get("control.top")===undefined){this.host.place(this)}if(!shown){try{this.fire("show")}catch(e){}}};Window.prototype.size=function size(w,h){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(!this$1.visible){if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":sizeInEm(w),"control.height":sizeInEm(h),"control.naturalWidth":sizeInEm(w),"control.naturalHeight":sizeInEm(h),"control.autosize":false})}return ok()}var el=this$1.wrapper;if(!el){return ok()}if(w==="auto"){this$1.set("control.autosize",true);var nw=Math.ceil(sizeInEm(el.clientWidth+16));var nh=Math.ceil(sizeInEm(el.clientHeight+8));this$1.set({"control.width":nw,"control.height":nh,"control.naturalWidth":nw,"control.naturalHeight":nh,"control.autosize":false})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":sizeInEm(w),"control.height":sizeInEm(h),"control.naturalWidth":sizeInEm(w),"control.naturalHeight":sizeInEm(h),"control.autosize":false})}else if(typeof w==="string"&&typeof h==="string"){var ow=el.style.width;var oh=el.style.height;el.style.width=w;el.style.height=h;var nw$1=el.clientWidth;var nh$1=el.clientHeight;el.style.width=ow;el.style.height=oh;this$1.set({"control.width":sizeInEm(nw$1),"control.height":sizeInEm(nh$1),"control.naturalWidth":sizeInEm(nw$1),"control.naturalHeight":sizeInEm(nh$1),"control.autosize":false})}var hel=this$1.host.host;if(hel){var maxw=sizeInEm(hel.clientWidth-16);var maxh=sizeInEm(hel.clientHeight-16);if(this$1.get("control.width")>maxw){this$1.set("control.width",maxw)}if(this$1.get("control.height")>maxh){this$1.set("control.height",maxh)}}var minw=this$1.get("control.minWidth")||5;var minh=this$1.get("control.minHeight")||5;if(this$1.get("control.width")<minw){this$1.set("control.width",minw)}if(this$1.get("control.height")<minh){this$1.set("control.height",minh)}this$1.fire("resize");ok()})})};Window.prototype.minSize=function minSize(w,h){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(!this$1.visible){if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.minWidth":sizeInEm(w),"control.minHeight":sizeInEm(h)})}return ok()}var el=this$1.wrapper;if(!el){return ok()}if(w==="auto"){var auto=this$1.get("control.autosize");this$1.set("control.autosize",true);var nw=sizeInEm(el.clientWidth+16);var nh=sizeInEm(el.clientHeight);this$1.set({"control.minWidth":nw,"control.minHeight":nh,"control.autosize":auto})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.minWidth":sizeInEm(w),"control.minHeight":sizeInEm(h)})}else if(typeof w==="string"&&typeof h==="string"){var ow=el.style.width;var oh=el.style.height;el.style.width=w;el.style.height=h;var nw$1=el.clientWidth;var nh$1=el.clientHeight;el.style.width=ow;el.style.height=oh;this$1.set({"control.minWidth":sizeInEm(nw$1),"control.minHeight":sizeInEm(nh$1)})}ok()})})};Window.prototype.move=function move(top,left){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(top==="center"){top=this$1.host.modalPane.clientHeight/2-this$1.wrapper.clientHeight/2}else if(typeof top==="string"){top=sizeInEm(top)}if(left==="center"){left=this$1.host.modalPane.clientWidth/2-this$1.wrapper.clientWidth/2}if(typeof left==="string"){left=sizeInEm(left)}var set={};if(typeof top==="number"){set["control.top"]=top}if(typeof left==="number"){set["control.left"]=left}this$1.set(set);ok()})})};Window.prototype._startMove=function _startMove(event){var this$1=this;if(event.type==="mousedown"&&event.button!==0){return}if(!this.get("control.topmost")){this.raise()}if(~event.type.indexOf("mouse")){if(!this.top||!event.ctrlKey&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}else{if(event.targetTouches&&event.targetTouches.length===1&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}this.set("moving",true);var wnd=this.pane;var cursor=wnd.style.cursor;wnd.style.cursor="move";wnd.style.userSelect="none";var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=wnd.clientWidth;var oh=wnd.clientHeight;var _move=function(ev){var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var nx=ox+(x-sx);var ny=oy+(y-sy);if(nx<(ow<30?0:30-ow)){nx=ow<30?0:30-ow}if(ny<(oh<30?0:30-oh)){ny=oh<30?0:30-oh}if(nx<0){nx=0}if(ny<0){ny=0}this$1.set({"control.top":ny,"control.left":nx});if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_move,{passive:false})});wnd.style.cursor=cursor;wnd.style.userSelect="";this$1.set("moving",false)}else{ev.preventDefault()}};moveEvents.forEach(function(e){return document.addEventListener(e,_move,{passive:false})});if(event.type.indexOf("mouse")===0){return false}};Window.prototype._startResize=function _startResize(event){var this$1=this;if(event.target!==this.wrapper){return}if(event.type==="mousedown"&&event.button!==0){return}if(this.get("control.autosize")){this.size("auto")}if(!this.get("control.topmost")){this.raise()}this.set("control.resizing",true);this.set("moving",true);var el=this.wrapper;var ix=event.offsetX||event.targetTouches&&event.targetTouches[0].pageX-el.getBoundingClientRect().left;var iy=event.offsetY||event.targetTouches&&event.targetTouches[0].pageY-el.getBoundingClientRect().top;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size*2,bottom=el.clientHeight-size*2;var min=2*size;var l=ix<=min||ix>=right;var t=iy<=min||iy>=bottom;var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=sizeInPx(this.get("control.width"));var oh=sizeInPx(this.get("control.height"));var nh=sizeInPx(this.get("control.minHeight"));var nw=sizeInPx(this.get("control.minWidth"));var tm;var _resize=function(ev){ev.preventDefault();var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var dx=l?x-sx:0;var dy=t?y-sy:0;var set={};if(iy<=size){set["control.top"]=oy+dy;set["control.height"]=oh-dy}else{set["control.height"]=oh+dy}if(ix<=size){set["control.left"]=ox+dx;set["control.width"]=ow-dx}else{set["control.width"]=ow+dx}if(set["control.width"]<nw){delete set["control.width"];delete set["control.left"]}if(set["control.height"]<nh){delete set["control.height"];delete set["control.top"]}if(set["control.left"]<0){set["control.left"]=0}if(set["control.top"]<0){set["control.top"]=0}if(set["control.width"]){set["control.width"]=sizeInEm(set["control.width"])}if(set["control.height"]){set["control.height"]=sizeInEm(set["control.height"])}this$1.set(set);if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_resize,{passive:false})});this$1.set("control.resizing",false);this$1.set("moving",false);if(ow!==this$1.get("control.width")||oh!==this$1.get("control.height")){if(tm){clearTimeout(tm)}tm=null;this$1.fire("resize")}}else{if(!tm){tm=setTimeout(function(){this$1.fire("resize");tm=null},200)}}};moveEvents.forEach(function(e){return document.addEventListener(e,_resize,{passive:false})});return false};Window.prototype._sizeHandle=function _sizeHandle(event){if(event.target!==this.wrapper){return}var el=this.wrapper;if(event.type==="mouseout"){return el.style.cursor="auto"}var x=event.offsetX,y=event.offsetY;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size,bottom=el.clientHeight-size;var style=el.style;if(x<=size+size&&y<=size+size||x>=right-size&&y>=bottom-size){style.cursor="nwse-resize"}else if(x>=right-size&&y<=size+size||x<=size+size&&y>=bottom-size){style.cursor="nesw-resize"}else if((x<=size||x>=right)&&(y<bottom||y>size)){style.cursor="ew-resize"}else if((y<=size||y>=bottom)&&(x<right||x>size)){style.cursor="ns-resize"}else{style.cursor="auto"}};Object.defineProperties(Window.prototype,prototypeAccessors$1);return Window}(Base);var buttonAttrs=["left","right","center","condition"];Base.extendWith(Window,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{t:4,f:[" ",{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}]}.t,title:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}]}.t,contents:{v:4,t:""}.t,status:{v:4,t:""}.t},data:function data(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function leftButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="left"})},centerButtons:function centerButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="center"})},rightButtons:function rightButtons(){return(this.get("buttons")||[]).filter(function(b){return!b.where||b.where==="right"})}},decorators:{button:function button(node){var ctx=this.getContext(node);ctx.add("visibleButtons");return{update:function update(){},teardown:function teardown(){ctx.subtract("visibleButtons")}}}},on:{config:function config(){var parent=Window.prototype.template;var child=this.template;if(typeof parent!=="string"&&!Array.isArray(parent)&&parent.t){parent=parent.t}if(typeof child!=="string"&&!Array.isArray(child)&&child.t){child=child.t}if(parent!==child){if(!this.partials.hasOwnProperty("contents")){this.partials.contents=child}this.template=parent}},construct:function construct(){var wnd=this.constructor;if(!wnd._constructed){wnd._constructed=1;var tpl=wnd.prototype.template.t.slice();var btns=tpl.find(function(e){return e.e==="buttons"});wnd.prototype.template.t=tpl.filter(function(e){return e.e!=="buttons"});function mapButton(b){var attrs=b.m||[];var res={partial:{t:[{t:b.t,e:b.e,f:b.f,m:attrs.filter(function(a){return!~buttonAttrs.indexOf(a.n)})}]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};res.partial.t[0].m.push({t:71,n:"button"});return res}if(btns){wnd._btns=btns.f.filter(function(e){return e.e==="button"||e.e==="not-button"||e.t===4&&(e.n===50||e.n===51)&&e.f.find(function(e){return e.e==="button"||e.e==="not-button"})}).map(function(n){if(n.t===4){return n.f.filter(function(e){return e.e==="button"||e.e==="not-button"}).map(function(bb){var attrs=bb.m||[];var b=bb.e==="button"?mapButton(bb):{partial:{t:bb.f||[]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};var f={t:n.t,n:n.n,f:[b.partial.t[0]]};if(n.r){f.r=n.r}if(n.rx){f.rx=n.rx}if(n.x){f.x=n.x}b.partial={t:[f]};return b})}else if(n.e==="not-button"){var attrs=n.m||[];return[{partial:{t:n.f||[]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"}]}else{var b=mapButton(n);return[b]}}).reduce(function(a,c){return a.concat(c)},[])}}},init:function init(){var wnd=this.constructor;if(wnd._btns&&!this.get("buttons.length")){this.set("buttons",wnd._btns)}}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function handler(v,o,k){if(!this.get("control.id")){return}var max=this.get("control.max")||this.get("root.userMax")||this.get("root.max");var actual=this.get("control.actual")||{};if(max){if(!actual.max){var root=this.wrapper;if(this.wrapper){this.set("control.actual",{width:sizeInEm(this.wrapper.clientWidth),height:sizeInEm(this.wrapper.clientHeight),max:max})}}else if(~k.indexOf("client")&&typeof v==="number"){if(~k.indexOf("Width")){this.set("control.actual.width",sizeInEm(v))}else if(~k.indexOf("Height")){this.set("control.actual.height",sizeInEm(v))}}}else{if(typeof v==="number"){if(~k.indexOf("width")){this.set("control.actual.width",v)}else if(~k.indexOf("height")){this.set("control.actual.height",v)}}if(actual.max){this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:max})}this.set("control.actual.max",false)}},init:false,defer:true}}});export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"host"]=Host}}globalRegister("RauiWindowHost","components",Host);globalRegister("RauiWindow","components",Window);Host.prototype.Window=Window;export default plugin;
import Ractive from"ractive";import expand from"./transition-expand";import toast from"./Toast";import globalRegister from"./globalRegister";import{sizeInEm,sizeInPx}from"./watch-size";var escape=Ractive.escapeKey;var windowTrans;export var Base=function(Ractive){function Base(opts){Ractive.call(this,opts)}if(Ractive)Base.__proto__=Ractive;Base.prototype=Object.create(Ractive&&Ractive.prototype);Base.prototype.constructor=Base;return Base}(Ractive);Ractive.extendWith(Base,{css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.window.primary"));primary.action=Object.assign({},data("raui.window.action"),data("raui.window.primary.action"));primary.host=Object.assign({},data("raui.window.host"),data("raui.window.primary.host"));primary.title=Object.assign({inactive:{}},data("raui.window.title"),data("raui.window.primary.title"));primary.topmost=Object.assign({},data("raui.primary"),data("raui.window.primary"),data("raui.window.primary.topmost"));return"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: "+(primary.host.bg||primary.bg||"#fff")+";\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n width: 100%;\n height: 100%;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(primary.handleSize||7)+"px;\n }\n \n .rwindow-slide-left {\n height: 100%;\n left: 0;\n }\n .rwindow-slide-right {\n height: 100%;\n right: 0;\n }\n .rwindow-slide-top {\n width: 100%;\n top: 0;\n }\n .rwindow-slide-bottom {\n width: 100%;\n bottom: 0;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 "+(primary.topmost.shadow||"rgba(0, 0, 0, 0.14)")+", 0 1px 18px 0 "+(primary.topmost.shadow||"rgba(0, 0, 0, 0.12)")+", 0 3px 5px -1px "+(primary.topmost.shadow||"rgba(0, 0, 0, 0.3)")+";\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n .rwindow-modal.rwindow-move {\n z-index: 50;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(primary.bg||"#fff")+";\n color: "+(primary.fg||"#222")+";\n box-shadow: 0 2px 2px 0 "+(primary.shadow||"rgba(0, 0, 0, 0.14)")+", 0 1px 5px 0 "+(primary.shadow||"rgba(0, 0, 0, 0.12)")+", 0 3px 1px -2px "+(primary.shadow||"rgba(0, 0, 0, 0.2)")+";\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(primary.minWidth||"6em")+";\n min-height: "+(primary.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(primary.title.inactive.bg||primary.fg||"#222")+";\n color: "+(primary.title.inactive.fg||primary.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n min-height: 2em;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(primary.title.bg||primary.fga||"#07e")+";\n color: "+(primary.title.fg||primary.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(primary.action.bc||primary.bc||"#ccc")+";\n background-color: "+(primary.action.bg||primary.bg||"#fff")+";\n color: "+(primary.action.fg||primary.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n cursor: default;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+(typeof data("raui.window.extra")==="function"?data("raui.window.extra").call(this,data):"")+"\n "}.call(this,data)].join(" ")},cssId:"rwindow",noCssTransform:true,delegate:false,decorators:{tracked:function tracked(node,id){this[id]=node;return{teardown:function teardown(){if(this[id]===node){this[id]=null}}}}},transitions:{window:function window(t,params){if(windowTrans){return t.complete()}windowTrans=t;var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0});setTimeout(function(){t.animateStyle({transform:"none",opacity:1},p).then(function(){t.setStyle("opacity",1);windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})})}else{t.setStyle({transform:"none",opacity:1});t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},p).then(function(){windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})}},slide:function slide(t,params){var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";var done=function(){t.complete();if(parent.style){setTimeout(function(){return parent.style.overflow=overflow})}};if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){if(p.from==="top"){t.setStyle({transform:"translateY(-100%)"});t.animateStyle({transform:"translateY(0)"},p).then(done)}else if(p.from==="bottom"){t.setStyle({transform:"translateY(100%)"});t.animateStyle({transform:"translateY(0)"},p).then(done)}else if(p.from==="left"){t.setStyle({transform:"translateX(-100%)"});t.animateStyle({transform:"translateX(0)"},p).then(done)}else if(p.from==="right"){t.setStyle({transform:"translateX(100%)"});t.animateStyle({transform:"translateX(0)"},p).then(done)}}else{if(p.from==="top"){t.setStyle({transform:"translateY(0)"});t.animateStyle({transform:"translateY(-100%)"},p).then(done)}else if(p.from==="bottom"){t.setStyle({transform:"translateY(0)"});t.animateStyle({transform:"translateY(100%)"},p).then(done)}else if(p.from==="left"){t.setStyle({transform:"translateX(0)"});t.animateStyle({transform:"translateX(-100%)"},p).then(done)}else if(p.from==="right"){t.setStyle({transform:"translateX(0)"});t.animateStyle({transform:"translateX(100%)"},p).then(done)}}}}});var id=0;export var Host=function(Base){function Host(opts){Base.call(this,opts);this.defaults={}}if(Base)Host.__proto__=Base;Host.prototype=Object.create(Base&&Base.prototype);Host.prototype.constructor=Host;var prototypeAccessors={current:{configurable:true},currentId:{configurable:true},placement:{configurable:true},topmost:{configurable:true},windows:{configurable:true}};prototypeAccessors.current.get=function(){var top=this.get("topLevel");return this.getWindow(this.get("windows."+escape(top)+".id"))};prototypeAccessors.currentId.get=function(){var top=this.get("topLevel");return this.get("windows."+escape(top)+".id")};prototypeAccessors.placement.get=function(){return this.get("placement")};prototypeAccessors.placement.set=function(v){return this.set("placement",v)};prototypeAccessors.topmost.get=function(){var windows=this.get("windows");for(var k in windows){if(windows[k].topmost){return this.getWindow(windows[k].id)}}};prototypeAccessors.windows.get=function(){return Object.keys(this.get("windows"))};Host.prototype.addWindow=function addWindow(window,opts){var this$1=this;var options=Object.assign({},this.defaults,window.constructor.prototype.options,window.options,window.get("options"),opts);if(!(window instanceof Window)){throw new Error("Windows must be instances of Window")}if(!window.id){window.set("@.id",options.id||"window"+id++)}var cur=this.getWindow(window.id);if(cur&&cur!==window){throw new Error("duplicate window id",window.id)}if(!this.get("windows."+escape(window.id))){this.set("windows."+escape(window.id),Object.assign({show:options.show!==false,autosize:true,id:window.id,blockers:[],close:true,minimize:true,maximize:true,minWidth:"5em",minHeight:"5em"},options,{id:window.id}))}window.host=this;var promise=this.attachChild(window,{target:"window"});var parent;if(options.block){parent=options.block.id||options.block;if(typeof parent==="string"&&parent in this.get("windows")){this.push("windows."+escape(parent)+".blockers",window.id);window.set("control.blocking",parent)}else{parent=false}}window.minSize(options.minWidth||"5em",options.minHeight||"5em");if(options.slide){}else if(options.size==="fill"&&(parent||options.block)){var wnd;if(options.block===true){wnd=this.find(".rwhost-pane")}else if(wnd=this.getWindow(parent)){wnd=wnd.find(".rwindow")}if(wnd){window.size(wnd.clientWidth-(options.fillPad||20),wnd.clientHeight-(options.fillPad||20));if(options.block&&!(options.top||options.left)){options.top=options.left=Math.floor((options.fillPad||20)/2)}}}else if(options.width&&options.height){window.size(options.width,options.height)}else{window.size("auto")}if(options.slide){}else if(options.top&&options.left){window.move(options.top,options.left)}else{this.place(window)}this.raise(window,{show:options.show!==false,parent:options.stickToParent});window.on("close",function(){var blocking=window.get("control.blocking");if(blocking){var blockers=this$1.windowGet(blocking,"blockers")||[];this$1.splice("windows."+escape(blocking)+".blockers",blockers.indexOf(window.id),1)}this$1.detachChild(window).then(function(){return window.teardown()});this$1.set("windows."+escape(window.id)+".block",false);this$1.set("windows."+escape(window.id)+".index",-1);this$1.raise();this$1.set("windows."+escape(window.id),undefined);delete this$1.get("windows")[window.id]});this.update("windows."+escape(window.id)+".id",{force:true});this.fire("add",{},{window:window,options:options});return promise.then(function(){return window})};Host.prototype.changeWindowId=function changeWindowId(id,newId){var wnd=this.getWindow(id);if(!wnd){return}wnd.set("@.id",newId);this.set("windows."+escape(newId),this.get("windows."+escape(id)));wnd.link("windows."+escape(newId),"control",{instance:this});this.set("windows."+escape(id),undefined);delete this.get("windows")[id];this.set("windows."+escape(newId)+".id",newId)};Host.prototype.getWindow=function getWindow(id){return this.children.byName.window&&this.children.byName.window.filter(function(w){return w.instance.id===id}).map(function(w){return w.instance})[0]};Host.prototype.windowGet=function windowGet(id,path){return this.get("windows."+escape(id)+"."+path)};Host.prototype.windowSet=function windowSet(id,path,val){return this.set("windows."+escape(id)+"."+path,val)};Host.prototype.raise=function raise(window,opts){var this$1=this;if(opts===void 0)opts={};var wnd=window instanceof Window?window:this.children.byName.window.filter(function(a){return a.instance.id===window}).map(function(a){return a.instance})[0];var object=this.get("windows",{virtual:false});var host=this;var wnds=Object.keys(object).map(function(k){return object[k]});var top=(wnds.length+1)*2;var last=this.get("topLevel");var wasBlocked=this.get("blocked");var id=wnd?wnd.get("control.id"):wnds.reduce(function(a,c){return!a?c:c.index>a.index?c:a},null);if(!wnd&&id){wnd=this.children.byName.window.find(function(a){return a.instance.id===id})}function blocks(ctrl){if(ctrl.blockers){ctrl.blockers.forEach(function(b,i){var w=wnds.find(function(w){return w.id===b});if(!w){return}w.index=ctrl.index+i+1;blocks(w)})}}function liftBlocked(control,pos){if(!control){return}control.index=pos--;if(control.blocking){liftBlocked(wnds.find(function(w){return w.id===control.blocking}),pos)}blocks(control)}if(wnd){var ctrl=wnd.get("control");ctrl.index=opts.show===false?-1:top;blocks(ctrl);if(ctrl.blocking){liftBlocked(wnds.find(function(w){return w.id===ctrl.blocking}),top-1)}if(opts.show!==false&&!ctrl.show){wnd.show()}}wnds.filter(function(w){return w.show!==false&&w.block===true}).forEach(function(w){this$1.set("windows."+escape(w.id)+".index",(w.index||0)+top);blocks(w)});var ordered=wnds.sort(function(l,r){return!l.show?-1:!r.show?1:l.index<r.index?-1:1});var visible=ordered.filter(function(w){return w.show});top=ordered.indexOf(visible[visible.length-1]);var sets={};var modalIdx=null;ordered.forEach(function(w,i){var key=escape(w.id);if(w.block===true&&modalIdx===null){modalIdx=i}sets["windows."+key+".index"]=w.index=modalIdx!==null?i+2:i;sets["windows."+key+".topmost"]=i===top;sets["windows."+key+".stack"]=ordered.length-i});if(modalIdx!==null){sets.blocked=modalIdx+1}else{sets.blocked=0}if(~top&&ordered.length){sets.topLevel=ordered[top].id}else{sets.topLevel=null}this.set(sets);top=sets.topLevel;if(top&&top!==last&&this.get("currentMax")&&this.rendered){var leaving=this.get("windows."+escape(last));wnd=this.getWindow(top);var transition=this.get("transition");if(transition!==false&&!wnd.get("control.slide")&&(!leaving||!leaving.dialog&&!leaving.slide&&(!leaving.blocking||leaving.blocking&&leaving.blocking!==top))){wnd.transition(transition||"window",wnd.find("div"),{intro:true})}}this.fire("raise",{},{top:this.topmost});if(last!==this.get("topLevel")){var wnd$1=this.current;wnd$1&&wnd$1.fire("raise",{},{last:this.getWindow(last)})}};Host.prototype.place=function place(wnd){var this$1=this;if(!wnd.get("control.show")){return Promise.resolve()}return new Promise(function(ok){requestAnimationFrame(function(){var local=wnd.get("control");if(local.width===undefined&&!local.dialog){wnd.size("auto")}var left=0;var top=0;if(!(this$1.fragment&&this$1.fragment.rendered)){return}var host=this$1.find(".rwhost");var maxw=host.clientWidth;var maxh=host.clientHeight;var lw=local.width;var lh=local.height;if(local.dialog&&(!local.size||local.size==="auto"||!local.width||!local.height)){lw=sizeInEm(wnd.pane.clientWidth);lh=sizeInEm(wnd.pane.clientHeight)}var blocking=local.blocking;if(blocking){var key="windows."+escape(blocking);var blocked=this$1.get(key);var max=local.max||!local.dialog&&(this$1.get("max")||this$1.get("userMax"));var bmax=blocked.max||this$1.get("userMax")||this$1.get("max");var bw=bmax?this$1.host.clientWidth:sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-sizeInPx(lw)/2;top=(max?maxh:bh/2)+(max?0:bt)-sizeInPx(lh)/2}else{var place=this$1.get("placement");var pos;if(typeof place==="function"){try{pos=place(this$1,host,local)}catch(e){pos=placeGrid(this$1,host,local)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local);break;default:pos=placeGrid(this$1,host,local);break}}else{pos=placeGrid(this$1,host,local)}top=pos.top;left=pos.left}if(isNaN(left)||left<0){left=10}if(isNaN(top)||top<0){top=10}wnd.set({"control.top":top,"control.left":left});ok()})})};Host.prototype.placeAll=function placeAll(){var this$1=this;if(!(this.fragment&&this.fragment.rendered)){return}var winids=Object.keys(this.get("windows")||{}).filter(function(k){return this$1.get("windows."+Ractive.escapeKey(k)+".show")});var host=this.find(".rwhost");return new Promise(function(ok){requestAnimationFrame(function(){var maxw=host.clientWidth;var maxh=host.clientHeight;var winid;while(winid=winids[0]){var wnd=this$1.getWindow(winid);var local=wnd.get("control");if(local.width===undefined&&!local.dialog){wnd.size("auto")}var left=0;var top=0;var lw=local.width;var lh=local.height;if(local.dialog&&(!local.size||local.size==="auto"||!local.width||!local.height)){lw=sizeInEm(wnd.pane.clientWidth);lh=sizeInEm(wnd.pane.clientHeight)}var blocking=local.blocking;if(blocking){var key="windows."+escape(blocking);var blocked=this$1.get(key);var max=local.max||!local.dialog&&(this$1.get("max")||this$1.get("userMax"));var bmax=blocked.max||this$1.get("userMax")||this$1.get("max");var bw=bmax?this$1.host.clientWidth:sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-sizeInPx(lw)/2;top=(max?maxh:bh/2)+(max?0:bt)-sizeInPx(lh)/2}else{var place=this$1.get("placement");var pos=void 0;if(typeof place==="function"){try{pos=place(this$1,host,local,winids)}catch(e){pos=placeGrid(this$1,host,local,winids)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local,winids);break;default:pos=placeGrid(this$1,host,local,winids);break}}else{pos=placeGrid(this$1,host,local,winids)}top=pos.top;left=pos.left}if(isNaN(left)||left<0){left=10}if(isNaN(top)||top<0){top=10}wnd.set({"control.top":top,"control.left":left});winids.shift()}ok()})})};Object.defineProperties(Host.prototype,prototypeAccessors);return Host}(Base);function placeGrid(host,target,node){var maxw=target.clientWidth;var maxh=target.clientHeight;var top=0,left=0;var grid1=host._grid1===undefined?host._grid1=0:host._grid1>7?host._grid1=0:++host._grid1;var width=Math.floor(maxw/3);var height=Math.floor(maxh/3);var localWidth=sizeInPx(node.width);var localHeight=sizeInPx(node.height+"em");switch(grid1){case 5:case 7:case 8:top=maxh-localHeight-10;break;case 2:case 4:case 6:top=height+Math.floor((height-localHeight)/2);break;case 0:case 1:case 3:top=10;break}switch(grid1){case 3:case 6:case 8:left=maxw-localWidth-10;break;case 1:case 4:case 7:left=width+Math.floor((width-localWidth)/2);break;case 0:case 2:case 5:left=10;break}if(left+localWidth>maxw){left=maxw-localWidth-10}if(top+localHeight>maxh){top=maxh-localHeight-10}return{top:top,left:left}}function placeSmart(host,target,node,ignore){var maxw=target.clientWidth-10;var maxh=target.clientHeight-10;var i,j;var cell=16;var mh=Math.floor(maxh/cell),mw=Math.floor(maxw/cell);var grid=new Array(mh*mw);var dest=new Array(mh*mw);for(i=0;i<grid.length;i++){grid[i]=0}var win,t,l,w,h,wins=0;var windows=host.get("windows");for(var k in windows){if(ignore&&~ignore.indexOf(k)){continue}wins++;win=windows[k];t=Math.floor(win.top/cell);l=Math.floor(win.left/cell);h=Math.ceil(sizeInPx(win.height)/cell);w=Math.ceil(sizeInPx(win.width)/cell);for(i=t;i<t+h&&i<mh;i++){for(j=l;j<l+w&&j<mw;j++){grid[i*mw+j]++}}}var c,ii,jj;w=Math.ceil(sizeInPx(node.width)/cell);h=Math.ceil(sizeInPx(node.height)/cell);for(i=0;i<mh;i++){for(j=0;j<mw;j++){if(i+h>mh||j+w>mw){c=wins*w*h}else{c=0;for(ii=0;ii<h;ii++){for(jj=0;jj<w;jj++){c+=grid[(i+ii)*mw+j+jj]}}}if(c===0){return{top:i*cell+5,left:j*cell+5}}dest[i*mw+j]=c}}c=wins*w*h;ii=0;for(i=0;i<dest.length;i++){if(dest[i]<c){c=dest[i];ii=i}}return{top:Math.floor(ii/mw)*cell+5,left:ii%mw*cell+5}}Base.extendWith(Host,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"moving",f:[{t:2,r:"~/moving"}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},"{t:_0}":function(_0){return{t:_0}},"_0&&_1":function(_0,_1){return _0&&_1},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(_0,_1){return[_0.getWindow(_1).hide()]},"!_0&&_1":function(_0,_1){return!_0&&_1},"[_0.getWindow(_1).maximize()]":function(_0,_1){return[_0.getWindow(_1).maximize()]},"!_0&&_1&&_2":function(_0,_1,_2){return!_0&&_1&&_2},"[_0.getWindow(_1).close()]":function(_0,_1){return[_0.getWindow(_1).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(_0){return[_0.hide()]},"[_0.maximize()]":function(_0){return[_0.maximize()]},"[_0.close()]":function(_0){return[_0.close()]},"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6":function(_0,_1,_2,_3,_4,_5,_6){return!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6},'["content"]':function(){return["content"]},"!_0":function(_0){return!_0},"[_0.call(_1)]":function(_0,_1){return[_0.call(_1)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(_0){return _0!==false},"_0||_1":function(_0,_1){return _0||_1},"(_0||_1||_2)&&!_3&&!_4":function(_0,_1,_2,_3,_4){return(_0||_1||_2)&&!_3&&!_4},"[{from:_0}]":function(_0){return[{from:_0}]},"[_0._startResize(_1)]":function(_0,_1){return[_0._startResize(_1)]},"[_0._sizeHandle(_1)]":function(_0,_1){return[_0._sizeHandle(_1)]},"[_0._startMove(_1)]":function(_0,_1){return[_0._startMove(_1)]},"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5":function(_0,_1,_2,_3,_4,_5){return!(_4===false||(_0||_1)&&!_3||_2)&&(!_3||_4===true)&&!_5},"[_0.raise()]":function(_0){return[_0.raise()]},'["pane"]':function(){return["pane"]},"_0&&!_1":function(_0,_1){return _0&&!_1}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,x:{r:["window.dialog","window.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{t:4,f:[" ",{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[toast(),expand()],cssId:"window-host",noIntro:true,attributes:["placement","windows","transition"],observe:{"@style.raui.window.maxFrom":function _style_raui_window_maxFrom(){initMediaListener(this)},topLevel:function topLevel(v){if(v){this.link("windows."+escape(v),"current")}else{this.unlink("current")}},currentMax:{handler:function handler(v){(this.children.byName.window||[]).forEach(function(w){return w.instance.fire("resize")})},defer:true}},computed:{currentMax:function currentMax(){var top=this.get("topLevel");var max=this.get("windows."+escape(top)+".max");var user=this.get("userMax");return user||this.get("max")||max}},on:{config:function config(){var this$1=this;var content=this.partials.content;if(content&&Array.isArray(content)){content=this.partials.content=content.slice();var i=content.length;while(i--){var e=content[i];if(e.e==="max-top"){content.splice(i,1);this.set({_maxP:{t:e.f},hideTitleMax:true});if(e.m){this.set({_maxAttrsP:{t:e.m}})}}}}if(typeof window!=="undefined"){var tm;this._resizeListener=function(){if(tm){return}tm=setTimeout(function(){tm=null;this$1.fire("resize")},300)};window.addEventListener("resize",this._resizeListener)}},teardown:function teardown(){if(this._resizeListener){window.removeEventListener("resize",this._resizeListener)}}}});function initMediaListener(r){if(r._media){r._media.fn()}else{r._media={};r._media.fn=function(){if(!r.host){return}var max=sizeInPx(r.get("@style.raui.window.maxFrom"));var trans=r.transitionsEnabled;r.transitionsEnabled=false;r.set("max",r.host.clientWidth<=max);r.set("dimensions",{clientWidth:r.host.clientWidth,clientHeight:r.host.clientHeight});r.transitionsEnabled=trans};r._media.handle=r.root.on("*.resize",r._media.fn);setTimeout(r._media.fn)}}function findEvent(instance){var i=instance;while(i){if(i.event&&i.event){return i.event.event}i=i.parent}}function getEventCoords(event){var node=event.target;if(!node){return{x:0,y:0}}var rect=node.getBoundingClientRect();return{x:Math.round(rect.left+(rect.right-rect.left)/2),y:Math.round(rect.top+(rect.bottom-rect.top)/2)}}Ractive.transitions.modal=function(t,parms){var params=t.processParams(parms,{duration:400,easing:"easeOut",x:0,y:-50,event:true});var event=null;var current={x:t.node.offsetLeft,y:t.node.offsetTop};var styles;var overflow=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(!event&&!t.node._modalSrc){if(t.isIntro){styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0}}}else{var click=t.node._modalSrc||(event?getEventCoords(event):{x:current.x+params.x,y:current.y+params.y});var target={x:click.x-Math.round(t.node.clientWidth/2)-current.x,y:click.y-Math.round(t.node.clientHeight/2)-current.y};if(t.node.parentNode.style){t.node.parentNode.style.overflow="hidden"}if(t.isIntro){t.node._modalSrc=click;styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0}}}t.animateStyle(styles,params).then(function(){if(t.node.parentNode.style){t.node.parentNode.style.overflow=overflow}t.complete()})};var moveEvents=["mousemove","mouseup","touchmove","touchend"];var handleSize=7;export var Window=function(Base){function Window(opts){Base.call(this,opts)}if(Base)Window.__proto__=Base;Window.prototype=Object.create(Base&&Base.prototype);Window.prototype.constructor=Window;var prototypeAccessors$1={resizable:{configurable:true},title:{configurable:true},visible:{configurable:true},pad:{configurable:true},buttons:{configurable:true},blocked:{configurable:true},result:{configurable:true}};prototypeAccessors$1.resizable.get=function(){return this.get("control.resizable")};prototypeAccessors$1.resizable.set=function(v){return this.set("control.resizable",v)};prototypeAccessors$1.title.get=function(){return this.get("control.title")};prototypeAccessors$1.title.set=function(v){return this.set("control.title",v)};prototypeAccessors$1.visible.get=function(){return this.get("control.show")};prototypeAccessors$1.visible.set=function(v){if(v){this.show()}else{if(this.get("control.show")){try{this.fire("hide")}catch(e){}}this.set("control.show",v,{keep:true})}this.host.raise(this,{show:v})};prototypeAccessors$1.pad.get=function(){return this.get("pad")};prototypeAccessors$1.pad.set=function(v){this.set("pad",v)};prototypeAccessors$1.buttons.get=function(){return this.get("buttons")};prototypeAccessors$1.buttons.set=function(v){return this.set("buttons",v)};prototypeAccessors$1.blocked.get=function(){return this.get("control.blocked")};prototypeAccessors$1.blocked.set=function(v){return this.set("control.blocked",v)};prototypeAccessors$1.result.get=function(){var this$1=this;if(!this._result){this._result={};this._result.promise=new Promise(function(ok){this$1._result.ok=ok})}return this._result.promise};Window.prototype.setResult=function setResult(v){this.result;this._result.value=v};Window.prototype.close=function close(force,result){if(force!==true){if(!this.parent){return false}if(this.get("control.blockers.length")){return false}if(typeof this.beforeClose==="function"&&this.beforeClose()===false){return false}if(this.fire("beforeClose")===false){return false}}this.fire("close");if(this._result){this._result.ok(this._result.value||result)}return true};Window.prototype.maximize=function maximize(){this.toggle("root.userMax")};Window.prototype.hide=function hide(){this.visible=false};Window.prototype.raise=function raise(show){this.host.raise(this,{show:show})};Window.prototype.show=function show(){var shown=this.get("control.show");this.set("control.show",true);if(this.get("control.top")===undefined){this.host.place(this)}if(!shown){try{this.fire("show")}catch(e){}}};Window.prototype.size=function size(w,h){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(!this$1.visible){if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":sizeInEm(w),"control.height":sizeInEm(h),"control.naturalWidth":sizeInEm(w),"control.naturalHeight":sizeInEm(h),"control.autosize":false})}return ok()}var el=this$1.wrapper;if(!el){return ok()}if(w==="auto"){this$1.set("control.autosize",true);var nw=Math.ceil(sizeInEm(el.clientWidth+16));var nh=Math.ceil(sizeInEm(el.clientHeight+8));this$1.set({"control.width":nw,"control.height":nh,"control.naturalWidth":nw,"control.naturalHeight":nh,"control.autosize":false})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":sizeInEm(w),"control.height":sizeInEm(h),"control.naturalWidth":sizeInEm(w),"control.naturalHeight":sizeInEm(h),"control.autosize":false})}else if(typeof w==="string"&&typeof h==="string"){var ow=el.style.width;var oh=el.style.height;el.style.width=w;el.style.height=h;var nw$1=el.clientWidth;var nh$1=el.clientHeight;el.style.width=ow;el.style.height=oh;this$1.set({"control.width":sizeInEm(nw$1),"control.height":sizeInEm(nh$1),"control.naturalWidth":sizeInEm(nw$1),"control.naturalHeight":sizeInEm(nh$1),"control.autosize":false})}var hel=this$1.host.host;if(hel){var maxw=sizeInEm(hel.clientWidth-16);var maxh=sizeInEm(hel.clientHeight-16);if(this$1.get("control.width")>maxw){this$1.set("control.width",maxw)}if(this$1.get("control.height")>maxh){this$1.set("control.height",maxh)}}var minw=this$1.get("control.minWidth")||5;var minh=this$1.get("control.minHeight")||5;if(this$1.get("control.width")<minw){this$1.set("control.width",minw)}if(this$1.get("control.height")<minh){this$1.set("control.height",minh)}this$1.fire("resize");ok()})})};Window.prototype.minSize=function minSize(w,h){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(!this$1.visible){if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.minWidth":sizeInEm(w),"control.minHeight":sizeInEm(h)})}return ok()}var el=this$1.wrapper;if(!el){return ok()}if(w==="auto"){var auto=this$1.get("control.autosize");this$1.set("control.autosize",true);var nw=sizeInEm(el.clientWidth+16);var nh=sizeInEm(el.clientHeight);this$1.set({"control.minWidth":nw,"control.minHeight":nh,"control.autosize":auto})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.minWidth":sizeInEm(w),"control.minHeight":sizeInEm(h)})}else if(typeof w==="string"&&typeof h==="string"){var ow=el.style.width;var oh=el.style.height;el.style.width=w;el.style.height=h;var nw$1=el.clientWidth;var nh$1=el.clientHeight;el.style.width=ow;el.style.height=oh;this$1.set({"control.minWidth":sizeInEm(nw$1),"control.minHeight":sizeInEm(nh$1)})}ok()})})};Window.prototype.move=function move(top,left){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(top==="center"){top=this$1.host.modalPane.clientHeight/2-this$1.wrapper.clientHeight/2}else if(typeof top==="string"){top=sizeInEm(top)}if(left==="center"){left=this$1.host.modalPane.clientWidth/2-this$1.wrapper.clientWidth/2}if(typeof left==="string"){left=sizeInEm(left)}var set={};if(typeof top==="number"){set["control.top"]=top}if(typeof left==="number"){set["control.left"]=left}this$1.set(set);ok()})})};Window.prototype._startMove=function _startMove(event){var this$1=this;if(event.type==="mousedown"&&event.button!==0){return}if(!this.get("control.topmost")){this.raise()}if(~event.type.indexOf("mouse")){if(!this.top||!event.ctrlKey&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}else{if(event.targetTouches&&event.targetTouches.length===1&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}this.set("moving",true);var wnd=this.pane;var cursor=wnd.style.cursor;wnd.style.cursor="move";wnd.style.userSelect="none";var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=wnd.clientWidth;var oh=wnd.clientHeight;var _move=function(ev){var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var nx=ox+(x-sx);var ny=oy+(y-sy);if(nx<(ow<30?0:30-ow)){nx=ow<30?0:30-ow}if(ny<(oh<30?0:30-oh)){ny=oh<30?0:30-oh}if(nx<0){nx=0}if(ny<0){ny=0}this$1.set({"control.top":ny,"control.left":nx});if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_move,{passive:false})});wnd.style.cursor=cursor;wnd.style.userSelect="";this$1.set("moving",false)}else{ev.preventDefault()}};moveEvents.forEach(function(e){return document.addEventListener(e,_move,{passive:false})});if(event.type.indexOf("mouse")===0){return false}};Window.prototype._startResize=function _startResize(event){var this$1=this;if(event.target!==this.wrapper){return}if(event.type==="mousedown"&&event.button!==0){return}if(this.get("control.autosize")){this.size("auto")}if(!this.get("control.topmost")){this.raise()}this.set("control.resizing",true);this.set("moving",true);var el=this.wrapper;var ix=event.offsetX||event.targetTouches&&event.targetTouches[0].pageX-el.getBoundingClientRect().left;var iy=event.offsetY||event.targetTouches&&event.targetTouches[0].pageY-el.getBoundingClientRect().top;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size*2,bottom=el.clientHeight-size*2;var min=2*size;var l=ix<=min||ix>=right;var t=iy<=min||iy>=bottom;var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=sizeInPx(this.get("control.width"));var oh=sizeInPx(this.get("control.height"));var nh=sizeInPx(this.get("control.minHeight"));var nw=sizeInPx(this.get("control.minWidth"));var tm;var _resize=function(ev){ev.preventDefault();var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var dx=l?x-sx:0;var dy=t?y-sy:0;var set={};if(iy<=min){set["control.top"]=oy+dy;set["control.height"]=oh-dy}else{set["control.height"]=oh+dy}if(ix<=min){set["control.left"]=ox+dx;set["control.width"]=ow-dx}else{set["control.width"]=ow+dx}if(set["control.width"]<nw){delete set["control.width"];delete set["control.left"]}if(set["control.height"]<nh){delete set["control.height"];delete set["control.top"]}if(set["control.left"]<0){set["control.left"]=0}if(set["control.top"]<0){set["control.top"]=0}if(set["control.width"]){set["control.width"]=sizeInEm(set["control.width"])}if(set["control.height"]){set["control.height"]=sizeInEm(set["control.height"])}this$1.set(set);if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_resize,{passive:false})});this$1.set("control.resizing",false);this$1.set("moving",false);if(ow!==this$1.get("control.width")||oh!==this$1.get("control.height")){if(tm){clearTimeout(tm)}tm=null;this$1.fire("resize")}}else{if(!tm){tm=setTimeout(function(){this$1.fire("resize");tm=null},200)}}};moveEvents.forEach(function(e){return document.addEventListener(e,_resize,{passive:false})});return false};Window.prototype._sizeHandle=function _sizeHandle(event){if(event.target!==this.wrapper){return}var el=this.wrapper;if(event.type==="mouseout"){return el.style.cursor="auto"}var x=event.offsetX,y=event.offsetY;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size,bottom=el.clientHeight-size;var style=el.style;if(x<=size+size&&y<=size+size||x>=right-size&&y>=bottom-size){style.cursor="nwse-resize"}else if(x>=right-size&&y<=size+size||x<=size+size&&y>=bottom-size){style.cursor="nesw-resize"}else if((x<=size||x>=right)&&(y<bottom||y>size)){style.cursor="ew-resize"}else if((y<=size||y>=bottom)&&(x<right||x>size)){style.cursor="ns-resize"}else{style.cursor="auto"}};Object.defineProperties(Window.prototype,prototypeAccessors$1);return Window}(Base);var buttonAttrs=["left","right","center","condition"];Base.extendWith(Window,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{t:4,f:[" ",{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}]}.t,title:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}]}.t,contents:{v:4,t:""}.t,status:{v:4,t:""}.t},data:function data(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function leftButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="left"})},centerButtons:function centerButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="center"})},rightButtons:function rightButtons(){return(this.get("buttons")||[]).filter(function(b){return!b.where||b.where==="right"})}},decorators:{button:function button(node){var ctx=this.getContext(node);ctx.add("visibleButtons");return{update:function update(){},teardown:function teardown(){ctx.subtract("visibleButtons")}}}},on:{config:function config(){var parent=Window.prototype.template;var child=this.template;if(typeof parent!=="string"&&!Array.isArray(parent)&&parent.t){parent=parent.t}if(typeof child!=="string"&&!Array.isArray(child)&&child.t){child=child.t}if(parent!==child){if(!this.partials.hasOwnProperty("contents")){this.partials.contents=child}this.template=parent}},construct:function construct(){var wnd=this.constructor;if(!wnd._constructed){wnd._constructed=1;var tpl=wnd.prototype.template.t.slice();var btns=tpl.find(function(e){return e.e==="buttons"});wnd.prototype.template.t=tpl.filter(function(e){return e.e!=="buttons"});function mapButton(b){var attrs=b.m||[];var res={partial:{t:[{t:b.t,e:b.e,f:b.f,m:attrs.filter(function(a){return!~buttonAttrs.indexOf(a.n)})}]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};res.partial.t[0].m.push({t:71,n:"button"});return res}if(btns){wnd._btns=btns.f.filter(function(e){return e.e==="button"||e.e==="not-button"||e.t===4&&(e.n===50||e.n===51)&&e.f.find(function(e){return e.e==="button"||e.e==="not-button"})}).map(function(n){if(n.t===4){return n.f.filter(function(e){return e.e==="button"||e.e==="not-button"}).map(function(bb){var attrs=bb.m||[];var b=bb.e==="button"?mapButton(bb):{partial:{t:bb.f||[]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};var f={t:n.t,n:n.n,f:[b.partial.t[0]]};if(n.r){f.r=n.r}if(n.rx){f.rx=n.rx}if(n.x){f.x=n.x}b.partial={t:[f]};return b})}else if(n.e==="not-button"){var attrs=n.m||[];return[{partial:{t:n.f||[]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"}]}else{var b=mapButton(n);return[b]}}).reduce(function(a,c){return a.concat(c)},[])}}},init:function init(){var wnd=this.constructor;if(wnd._btns&&!this.get("buttons.length")){this.set("buttons",wnd._btns)}}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function handler(v,o,k){if(!this.get("control.id")){return}var max=this.get("control.max")||this.get("root.userMax")||this.get("root.max");var actual=this.get("control.actual")||{};if(max){if(!actual.max){var root=this.wrapper;if(this.wrapper){this.set("control.actual",{width:sizeInEm(this.wrapper.clientWidth),height:sizeInEm(this.wrapper.clientHeight),max:max})}}else if(~k.indexOf("client")&&typeof v==="number"){if(~k.indexOf("Width")){this.set("control.actual.width",sizeInEm(v))}else if(~k.indexOf("Height")){this.set("control.actual.height",sizeInEm(v))}}}else{if(typeof v==="number"){if(~k.indexOf("width")){this.set("control.actual.width",v)}else if(~k.indexOf("height")){this.set("control.actual.height",v)}}if(actual.max){this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:max})}this.set("control.actual.max",false)}},init:false,defer:true}}});export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"host"]=Host}}globalRegister("RauiWindowHost","components",Host);globalRegister("RauiWindow","components",Window);Host.prototype.Window=Window;export default plugin;
{
"name": "@evs-chris/raui",
"version": "0.15.8",
"version": "0.16.0",
"description": "Components, decorators, and helpers for Ractive apps that are generally Material-ish",

@@ -5,0 +5,0 @@ "homepage": "https://evs-chris.github.io/raui/demo",

@@ -41,2 +41,9 @@ export default function makeAceEditor(opts = {}) {

}
editor.commands.addCommand({
name: 'save',
bindKey: { win: 'Ctrl-S', mac: 'Command-S', sender: 'editor|cli' },
exec: function() {
ctx.raise('save');
}
});

@@ -48,14 +55,23 @@ handle.update = function(options) {

session.setTabSize(options.tabSize || 2);
if (typeof options.margin === 'boolean') editor.setShowPrintMargin(options.margin);
if (typeof options.wrap === 'boolean') session.setUseWrapMode(options.wrap);
if (typeof options.highlightActive === 'boolean') editor.setHighlightActiveLine(options.highlightActive);
if (typeof options.margin === 'boolean') { editor.setShowPrintMargin(options.margin); }
if (typeof options.wrap === 'boolean') { session.setUseWrapMode(options.wrap); }
if (typeof options.highlightActive === 'boolean') { editor.setHighlightActiveLine(options.highlightActive); }
if (typeof options.highlightSelected === 'boolean') { editor.setHighlightSelectedWord(options.highlightSelected); }
if (options.font) editor.setOptions({ fontFamily: options.font });
if (options.fontSize) editor.setOptions({ fontSize: options.fontSize });
if ('printMargin' in options) editor.setOption('showPrintMargin', options.printMargin);
if (typeof options.lineNumbers === 'boolean') editor.setOption('showLineNumbers', options.lineNumbers);
if (typeof options.relativeLineNumbers === 'boolean') editor.setOption('relativeLineNumbers', options.relativeLineNumbers);
if ('keymode' in options) editor.setKeyboardHandler(options.keymode);
if ('keymode' in options && options.keymode) editor.setKeyboardHandler(`ace/keyboard/${options.keymode}`);
else editor.setKeyboardHandler(null)
if (options.bind !== binding) {
if (observer) observer.cancel();
var old = observer;
if (old) observer.cancel();
if (options.bind) {
binding = options.bind;
observer = ctx.observe(binding, observed, { init: false });
if (old) setTimeout(function() { observed(ctx.get(options.bind)); });
}

@@ -99,2 +115,2 @@ }

return plugin;
}
}

@@ -345,2 +345,3 @@ // TODO: support for non-numeric formats?

g.value = +v;
if (g.type === 'M') g.value--;
}

@@ -347,0 +348,0 @@ }

@@ -404,2 +404,3 @@ import globalRegister from './globalRegister';

.just-the.field-tip,
label.field .field-tip {

@@ -415,6 +416,14 @@ display: inline-block;

margin-left: 0.5em;
line-height: 1.2em;
line-height: 1em;
font-family: monospace;
text-align: center;
margin-top: -0.2em;
cursor: help;
}
.just-the.field-tip.field-tip-error {
background-color: ${primary.error || '#ca3c3c'};
}
.just-the.field-tip.field-tip-warn {
background-color: ${primary.warn || '#f79e0b'};
}

@@ -678,3 +687,3 @@ label.field .field-solo-tip {

],
f: '?'
f: '?',
});

@@ -697,2 +706,26 @@ const inline = attrs.find(a => a.n === 'inline');

const tip = Ractive.macro(handle => {
handle.aliasLocal('__rtip');
const body = [{
t: 7, e: 'span', m: (handle.template.m || []).concat([
{ t: 13, n: 'class', f: [`just-the field-tip`, { t: 4, f: [' field-tip-error'], x: { r: ['__rtip.attrs.type'], s: '_0==="error"' } }, { t: 4, f: [' field-tip-warn'], x: { r: ['__rtip.attrs.type'], s: '_0==="warn"' } }] },
{ t: 13, n: 'title', f: Array.isArray(handle.template.f) || typeof handle.template.f === 'string' ? handle.template.f : [handle.template.f] },
{ t: 70, n: ['click'], f: { r: [], s: '[false]' } }
]),
f: [{ t: 4, f: [{ t: 3, r: '__rtip.attrs.sign' }], n: 50, r: '__rtip.attrs.sign' }, { t: 4, f: ['!'], n: 50, x: { r: ['__rtip.attrs.type'], s: '_0==="error"||_0==="warn"' }, l: 1 }, { t: 4, f: ['?'], n: 51, l: 1 }],
}];
handle.set('__rtip.attrs', handle.attributes);
handle.setTemplate(body);
return {
update() {
handle.set('__rtip.attrs', handle.attributes);
}
};
}, {
attributes: ['sign', 'type'],
});
export function autofocus(node, opts) {

@@ -725,2 +758,3 @@ if (typeof node.focus === 'function' && !node.disabled) {

instance.partials[opts.name || 'field'] = macro;
instance.partials[opts.tipName || 'tip'] = tip;
instance.decorators[opts.name || 'field'] = field;

@@ -733,4 +767,5 @@ instance.decorators[opts.autofocusName || 'autofocus'] = autofocus;

globalRegister('field', 'partials', macro);
globalRegister('tip', 'partials', tip);
globalRegister('autofocus', 'decorators', autofocus);
export default plugin;

@@ -51,2 +51,9 @@ (function (global, factory) {

}
editor.commands.addCommand({
name: 'save',
bindKey: { win: 'Ctrl-S', mac: 'Command-S', sender: 'editor|cli' },
exec: function() {
ctx.raise('save');
}
});

@@ -61,11 +68,20 @@ handle.update = function(options) {

if (typeof options.highlightActive === 'boolean') { editor.setHighlightActiveLine(options.highlightActive); }
if (typeof options.highlightSelected === 'boolean') { editor.setHighlightSelectedWord(options.highlightSelected); }
if (options.font) { editor.setOptions({ fontFamily: options.font }); }
if (options.fontSize) { editor.setOptions({ fontSize: options.fontSize }); }
if ('printMargin' in options) { editor.setOption('showPrintMargin', options.printMargin); }
if (typeof options.lineNumbers === 'boolean') { editor.setOption('showLineNumbers', options.lineNumbers); }
if (typeof options.relativeLineNumbers === 'boolean') { editor.setOption('relativeLineNumbers', options.relativeLineNumbers); }
if ('keymode' in options) { editor.setKeyboardHandler(options.keymode); }
if ('keymode' in options && options.keymode) { editor.setKeyboardHandler(("ace/keyboard/" + (options.keymode))); }
else { editor.setKeyboardHandler(null); }
if (options.bind !== binding) {
if (observer) { observer.cancel(); }
var old = observer;
if (old) { observer.cancel(); }
if (options.bind) {
binding = options.bind;
observer = ctx.observe(binding, observed, { init: false });
if (old) { setTimeout(function() { observed(ctx.get(options.bind)); }); }
}

@@ -72,0 +88,0 @@ }

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RauiAceEditor={})}(this,function(e){"use strict";e.default=function(e){void 0===e&&(e={});var t=e.ace;if(t||(t=window.ace),!t)throw new Error("Ace must be passed in or available globally.");function i(e,i){void 0===i&&(i={});var o={},n=Ractive.getContext(e),a=o.editor=t.edit(e);a.$blockScrolling=1/0;var r,s,c=a.getSession();e.classList.contains("ace-editor")||e.classList.add("ace-editor");var d=!1;function u(e){if(!d){d=!0;var t=a.getCursorPosition();a.setValue(e||"",-1),a.clearSelection(),a.moveCursorTo(t.row,t.column,!1),d=!1}}c.setUseSoftTabs(!1),c.setTabSize(2),a.on("change",function(){d||(d=!0,r&&n.set(r,a.getValue()),n.hasListener("change")&&n.raise("change"),d=!1)}),o.update=function(e){e&&(e.syntax&&a.getSession().setMode("ace/mode/"+e.syntax),e.theme&&a.setTheme("ace/theme/"+e.theme),c.setTabSize(e.tabSize||2),"boolean"==typeof e.margin&&a.setShowPrintMargin(e.margin),"boolean"==typeof e.wrap&&c.setUseWrapMode(e.wrap),"boolean"==typeof e.highlightActive&&a.setHighlightActiveLine(e.highlightActive),"keymode"in e?a.setKeyboardHandler(e.keymode):a.setKeyboardHandler(null),e.bind!==r&&(s&&s.cancel(),e.bind&&(r=e.bind,s=n.observe(r,u,{init:!1}))))},o.resize=function(){a&&a.resize()},o.focus=function(){a.focus()};var l=n.get("@.root").on("*.resize",o.resize);return window.addEventListener("resize",o.resize),o.teardown=function(){a.off("change"),a.destroy(),l.cancel(),window.removeEventListener("resize",o.resize),e.classList.remove("ace-editor")},o.update(i),i.bind&&setTimeout(function(){u(n.get(i.bind))}),o}function o(t){t.instance.decorators[e.name||"ace-editor"]=i}return o.plugin=o,o.aceEditor=i,o},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RauiAceEditor={})}(this,function(e){"use strict";e.default=function(e){void 0===e&&(e={});var t=e.ace;if(t||(t=window.ace),!t)throw new Error("Ace must be passed in or available globally.");function i(e,i){void 0===i&&(i={});var n={},o=Ractive.getContext(e),a=n.editor=t.edit(e);a.$blockScrolling=1/0;var r,s,c=a.getSession();e.classList.contains("ace-editor")||e.classList.add("ace-editor");var d=!1;function l(e){if(!d){d=!0;var t=a.getCursorPosition();a.setValue(e||"",-1),a.clearSelection(),a.moveCursorTo(t.row,t.column,!1),d=!1}}c.setUseSoftTabs(!1),c.setTabSize(2),a.on("change",function(){d||(d=!0,r&&o.set(r,a.getValue()),o.hasListener("change")&&o.raise("change"),d=!1)}),a.commands.addCommand({name:"save",bindKey:{win:"Ctrl-S",mac:"Command-S",sender:"editor|cli"},exec:function(){o.raise("save")}}),n.update=function(e){if(e&&(e.syntax&&a.getSession().setMode("ace/mode/"+e.syntax),e.theme&&a.setTheme("ace/theme/"+e.theme),c.setTabSize(e.tabSize||2),"boolean"==typeof e.margin&&a.setShowPrintMargin(e.margin),"boolean"==typeof e.wrap&&c.setUseWrapMode(e.wrap),"boolean"==typeof e.highlightActive&&a.setHighlightActiveLine(e.highlightActive),"boolean"==typeof e.highlightSelected&&a.setHighlightSelectedWord(e.highlightSelected),e.font&&a.setOptions({fontFamily:e.font}),e.fontSize&&a.setOptions({fontSize:e.fontSize}),"printMargin"in e&&a.setOption("showPrintMargin",e.printMargin),"boolean"==typeof e.lineNumbers&&a.setOption("showLineNumbers",e.lineNumbers),"boolean"==typeof e.relativeLineNumbers&&a.setOption("relativeLineNumbers",e.relativeLineNumbers),"keymode"in e&&e.keymode?a.setKeyboardHandler("ace/keyboard/"+e.keymode):a.setKeyboardHandler(null),e.bind!==r)){var t=s;t&&s.cancel(),e.bind&&(r=e.bind,s=o.observe(r,l,{init:!1}),t&&setTimeout(function(){l(o.get(e.bind))}))}},n.resize=function(){a&&a.resize()},n.focus=function(){a.focus()};var f=o.get("@.root").on("*.resize",n.resize);return window.addEventListener("resize",n.resize),n.teardown=function(){a.off("change"),a.destroy(),f.cancel(),window.removeEventListener("resize",n.resize),e.classList.remove("ace-editor")},n.update(i),i.bind&&setTimeout(function(){l(o.get(i.bind))}),n}function n(t){t.instance.decorators[e.name||"ace-editor"]=i}return n.plugin=n,n.aceEditor=i,n},Object.defineProperty(e,"__esModule",{value:!0})});

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],t):t(e.RauiAutocomplete={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:null;function i(e,t,i){if(n&&n.Ractive&&"object"==typeof n.Ractive[t]){var o=document.currentScript;if(o||(o=(o=document.querySelectorAll("script"))[o.length-1]),o){var r=o.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(e,t){var n=t.split("="),i=n[0],o=n[1];return e[i]=o,e},{})),Ractive[t][r&&r[e]||e]=i}}}function o(e,t){void 0===t&&(t={});var n=e.processParams(t,{duration:400,easing:"easeInOut"});t.dir=t.dir||!1;var i=t.distance||"20px",o=t.scale||"0.9",r="above"===t.dir?"translateY("+i+")":"left"===t.dir?"translateX("+i+")":"right"===t.dir?"translateX(-"+i+")":"translateY(-"+i+")";return e.isIntro||n.intro?(e.setStyle("opacity",0),e.setStyle("transform","scale("+o+") "+r),e.animateStyle({opacity:1,transform:"none"},n)):(e.setStyle("opacity",1),e.setStyle("transform","none"),e.animateStyle({opacity:0,transform:"scale("+o+") "+r},n))}function r(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"pop"]=o}}function a(e,t){var n=!1,i=!1;function o(n){for(var i=n.target;i;){if(i===e)return;if(!i.parentNode&&i!==document)return;i=i.parentNode}t(n)}return setTimeout(function(){n=!0,i||(document.body.addEventListener("click",o,{capture:!0}),document.body.addEventListener("touchstop",o,{capture:!0}))}),{teardown:function(){i=!0,n&&(document.body.removeEventListener("click",o,{capture:!0}),document.body.removeEventListener("touchstop",o,{capture:!0}))}}}function l(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return e.isIntro||n.intro?(e.setStyle("opacity",0),e.animateStyle("opacity",1,n)):(e.setStyle("opacity",1),e.animateStyle("opacity",0,n))}function c(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"fade"]=l}}i("pop","transitions",o),i("fade","transitions",l);var s,f,p,d={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content",z:[{n:"trigger",x:{r:"triggerContext"}}]}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(e){return e||"below"},'_0||"middle"':function(e){return e||"middle"},'[{dir:_0||"below"}]':function(e){return[{dir:e||"below"}]},'[_0.set("popped",false)]':function(e){return[e.set("popped",!1)]},"_0+(_1?3:0)":function(e,t){return e+(t?3:0)},"_0!=null":function(e){return null!=e},"_0+(_1?0:3)":function(e,t){return e+(t?0:3)},"_0-2":function(e){return e-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(e,t,n){return[e===t&&n.done(),!0]},"[_0.done()]":function(e){return[e.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}},u=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.position=function(t){var n=t||this.source,i=this.get("popped");if(n&&i){var o=this.find("div");if(n&&o&&o.offsetParent){n?this.set("triggerContext",e.getContext(n)):this.set("triggerContext",null);var r=o.offsetParent,a=r.getBoundingClientRect(),l=o.getBoundingClientRect(),c=n.getBoundingClientRect(),s=this.get("where")||"below",f=this.get("align")||"middle",p=this.get("tail"),d="above"===s||"below"===s,u=this.get("fit"),b=this.get("gap"),m="above"===s||"below"===s?0:"left"===s?-l.width-b:c.width+b,h="left"===s||"right"===s?-c.height:"above"===s?-c.height-l.height-b:b;"middle"===f?"below"===s||"above"===s?m-=(l.width-c.width)/2:"left"!==s&&"right"!==s||(h-=(l.height-c.height)/2):"end"===f&&("below"===s||"above"===s?m+=c.width-l.width:"left"!==s&&"right"!==s||(h+=c.height-l.height));var g={popTop:c.bottom-a.top+h,popLeft:c.left-a.left+m,tail:p,vert:"above"===s||"below"===s};if(r.scrollTop&&(g.popTop+=r.scrollTop),r.scrollLeft&&(g.popLeft+=r.scrollLeft),p){"above"===s?g.tailBottom=-10:"below"===s?g.tailTop=-10:"left"===s?g.tailRight=-10:"right"===s&&(g.tailLeft=-10);var v=this.tailSource?this.tailSource.getBoundingClientRect():c;"start"===f?d?g.tailLeft=Math.floor(v.width/2)-10:g.tailTop=Math.floor(v.height/2)-10:"end"===f?d?g.tailRight=Math.floor(v.width/2)-10:g.tailBottom=Math.floor(v.height/2)-10:"middle"===f&&(d?g.tailLeft=Math.floor(v.width/2)-10:g.tailTop=Math.floor(v.height/2)-10),v!==c?d?(null!=g.tailLeft&&(g.tailLeft+=v.left-c.left),null!=g.tailRight&&(g.tailRight+=c.right-v.right)):(null!=g.tailTop&&(g.tailTop+=v.top-c.top),null!=g.tailBottom&&(g.tailBottom+=c.bottom-v.bottom)):"middle"===f&&(d?(null!=g.tailLeft&&(g.tailLeft+=v.left-(g.popLeft+a.left)),null!=g.tailRight&&(g.tailRight+=g.popLeft+a.left+l.width-v.right)):(null!=g.tailTop&&(g.tailTop+=v.top-(g.popTop+a.top)),null!=g.tailBottom&&(g.tailBottom+=g.popTop+a.top+l.height-v.bottom)))}if(u){var y=r;if(this.get("offsets"))for(var x=this.get("offsets");x--;)y=y.offsetParent;var _=r.scrollWidth,w=r.scrollHeight;if(g.popLeft+l.width>_){var k=g.popLeft-(_-l.width);g.popLeft-=k,d&&g.tailLeft&&(g.tailLeft+=k),d&&g.tailRight&&(g.tailRight-=k),p&&!d&&(g.tail=!1)}if(g.popLeft<0){var T=-1*g.popLeft;g.popLeft+=T,d&&g.tailLeft&&(g.tailLeft-=T),d&&g.tailRight&&(g.tailRight+=T),p&&!d&&(g.tail=!1)}if(g.popTop+l.height>w){var L=g.popTop-(w-l.height);g.popTop-=L,!d&&g.tailTop&&(g.tailTop+=L),!d&&g.tailBottom&&(g.tailBottom-=L),p&&d&&(g.tail=!1)}if(g.popTop<0){var O=-1*g.popTop;g.popTop+=O,!d&&g.tailTop&&(g.tailTop-=O),!d&&g.tailBottom&&(g.tailBottom+=O),p&&d&&(g.tail=!1)}}if(a.left+g.popLeft<0){var B=0-(a.left+g.popLeft);g.popLeft+=B,d&&g.tailLeft&&(g.tailLeft-=B),d&&g.tailRight&&(g.tailRight+=B),p&&!d&&(g.tail=!1)}if(a.top+g.popTop<0){var A=0-(a.top+g.popTop);g.popTop+=A,!d&&g.tailTop&&(g.tailTop-=A),!d&&g.tailBottom&&(g.tailBottom+=A),p&&d&&(g.tail=!1)}g.tailLeft&&(g.tailLeft=Math.floor(g.tailLeft)),g.tailRight&&(g.tailRight=Math.floor(g.tailRight)),g.tailTop&&(g.tailTop=Math.floor(g.tailTop)),g.tailBottom&&(g.tailBottom=Math.floor(g.tailBottom)),this.set("position",g)}else this.set("position",null)}},t.prototype.show=function(e){return this.source=e,this.set("popped",!0),this._transdone},t.prototype.hide=function(){return this.set("popped",!1),this._transdone},t.prototype.popFind=function(e){return s?f.find(e):this.find(e)},t.prototype.popFindAll=function(e){return s?f.findAll(e):this.findAll(e)},t}(t);t.extendWith(u,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[r(),(void 0===p&&(p={}),function(e){e.instance.events[p.name||"clickout"]=a}),c()],template:d,css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.pop.primary")),n=(e("raui.themes")||[]).slice();return(e("raui.pop.themes")||[]).forEach(function(e){~n.indexOf(e)||n.push(e)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 21;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(t.bg||"#fff")+";\n color: "+(t.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 20;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(t.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(t.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(t.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(t.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(t.bc||"#ccc")+";\n }\n "+n.map(function(t){var n=Object.assign({},e("raui.primary"),e("raui.pop.primary"),e("raui."+t),e("raui.pop."+t));return"\n ."+t+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+t+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,e)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(e){var t,n=this,i=this._transdone=new Promise(function(e){return t=e});i.resolve=t,setTimeout(function(){n._transdone=i,n.get("popped")===e&&n.set("_popped",e)},1)},_popped:{handler:function(e){var t=this,n=this._transdone.resolve;if(e){var i=this.get("@style.raui.pop.mobile");if(i&&window.matchMedia("(max-width: "+i+")").matches){f||(f=new b({target:document.body,append:!0}));var o=this.getContext().getParent(!0);o.isContext=1,this.set("__popped",!1).then(n),f.unshift("contents",{content:this.partials.content,context:o,attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){t.set("popped",!1)}})}else this.set("__popped",!0)}else s?(f.shift("contents"),n()):this.set("__popped",!1).then(n)},defer:!0,init:!1},__popped:{handler:function(e){var t=this._transdone.resolve;if(e){var n=this.find("div"),i=n,o=i.offsetHeight+i.offsetTop,r=i.offsetWidth+i.offsetLeft,a=i.offsetParent;if(!this.overflows)for(var l=this.overflows={e:[],v:[]};n&&n.style;){if(n===a){if(n.offsetWidth>=r&&n.offsetHeight>=o)break;r+=n.offsetLeft,o+=n.offsetTop,a=n.offsetParent}var c=getComputedStyle(n);if("auto"===c.overflow)break;"hidden"===c.overflow&&(l.e.push(n),l.v.push(n.style.overflow),n.style.overflow="visible"),n=n.parentNode}this.position(),this.transition("pop",i,{intro:!0,dir:this.get("where")||"below"}).then(t)}else this.source=null,this.tailSource=null},defer:!0,init:!1},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(e){var t=this;return{teardown:function(){var e=t.overflows;if(e){t.overflows=null;for(var n=0;n<e.e.length;n++)e.e[n].style.overflow=e.v[n]}}}}},data:function(){return{gap:4}}});var b=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(t);function m(){}function h(e){~this.className.indexOf("focus")||(this.className+=" focus")}function g(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function v(e){var t,n,i,o,r,a,l,c,s,f,p,d,u,b=this.getContext(e);function v(){var b=y().split(/\s+/).filter(function(e){return!!e});(t=!!~b.indexOf("field"))||(b.push("field"),t=!0),(n=e.querySelector("input[type=checkbox]"))&&!~b.indexOf("check")&&b.push("check"),(i=e.querySelector("input[type=radio]"))&&!~b.indexOf("radio")&&b.push("radio");var m=n||i;m&&m.checked&&!~b.indexOf("checked")&&b.push("checked"),m&&m.disabled&&!~b.indexOf("disabled")&&b.push("disabled"),!m&&f?(f.cancel(),f=0,p&&(p.disconnect(),p=0),delete m._form_callback,u&&(delete u.checked,d=u=void 0)):m&&(m._form_callback=function(t,n){if(void 0===n&&(n=!0),n&&"radio"===m.type&&m.name){var i=[];i.push.apply(i,document.querySelectorAll("input[type=radio][name="+m.name+"]")),(i=i.filter(function(e){return e!==m})).forEach(function(e){return e._form_callback&&e._form_callback(t,!1)})}var o=m.checked;o&&!~e.className.indexOf("checked")?e.className+=" checked":!o&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(p=new MutationObserver(function(){var t;(t=m.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!t&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(m,{attributes:!0}),f=this.getContext(m).listen("change",m._form_callback),(d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(m),"checked"))&&d.configurable&&(u=m,Object.defineProperty(m,"checked",{get:d.get,set:function(e){d.set.call(u,e),m._form_callback()},enumerable:!0,configurable:!0}))),(o=!!e.querySelector("textarea"))&&!~b.indexOf("textarea")&&b.push("textarea"),(r=!!e.querySelector("select"))&&!~b.indexOf("select")&&b.push("select"),(a=!!e.querySelector("input[type=file]"))&&!~b.indexOf("file")&&b.push("file"),(l=!!(l=e.querySelector("button"))&&l.parentNode===e)&&!~b.indexOf("button")&&b.push("button"),(c=!!e.querySelector("div"))&&!~b.indexOf("plain")&&b.push("plain"),(s=!(n||i||a||!e.querySelector("input")))&&!~b.indexOf("input")&&b.push("input"),e.className=b.join(" ")}function y(){var f=e.className;return t||(f=f.replace(/\bfield\b/g,"").trim()),n||(f=f.replace(/\bcheck(ed)?\b/g,"").trim()),i||(f=f.replace(/\bradio\b/g,"").trim()),o||(f=f.replace(/\btextarea\b/g,"").trim()),r||(f=f.replace(/\bselect\b/g,"").trim()),a||(f=f.replace(/\bfile\b/g,"").trim()),l||(f=f.replace(/\bbutton\b/g,"").trim()),c||(f=f.replace(/\bplain\b/g,"").trim()),s||(f=f.replace(/\binput\b/g,"").trim()),f=f.replace(/ +/g," ")}var x=b.listen("focusin",h),_=b.listen("focusout",g);v.call(this);var w={update:m,invalidate:v.bind(this),teardown:function(){b.ractive.fire("fieldUnregistered",b,e,w);var t=y();t=t.replace(/\bfocus\b/g,"").trim(),x.cancel(),_.cancel(),f&&f.cancel(),p&&p.disconnect(),u&&(delete u.checked,d=u=void 0),e.className=t},setDisabled:function(t){e.querySelectorAll("input,button,select,textarea").forEach(function(e){return e.disabled=t}),this.invalidate()}};return b.ractive.fire("fieldRegistered",b,e,w),w}function y(e,t){if(!e)return!1;for(var n=0;n<e.length;n++){if(e[n].e===t)return!0;if(e[n].f&&y(e[n].f,t))return!0}return!1}t.extendWith(b,{template:{v:d.v,t:d.p.modal},data:function(){return{contents:[]}},use:[r(),c()],observe:{contents:function(e){s=(e||[]).length>0}},on:{init:function(){f?console.warn("More than one PopOver mobile host created."):f=this}}}),v.style=function(e){var t=Object.assign({},e("raui.primary"),e("raui.form.primary")),n=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),i=Object.assign({},e("raui.primary.disabled"),e("raui.form.primary.disabled")),o=e("raui.form.boxy");return"\n label.field, .field-manual {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(t.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(t.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(o?t.bg||"#fff":"transparent")+";\n color: "+(t.fg||"#222")+";\n }\n\n label.field.focus {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(o?"":"box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea,\n .field-manual .field-body\n {\n display: block;\n border-width: "+(o?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(o?t.bg||"#fff":"transparent")+";\n color: "+(t.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(o?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(o?"":":disabled")+",\n label.field select"+(o?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(o?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(i.bg||"#f4f4f4")+";\n color: "+(i.fg||"#444")+";\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(o?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(t.bc||"#ccc")+",\n -0.0625em 0.0625em "+(t.bc||"#ccc")+",\n 0.0625em -0.0625em "+(t.bc||"#ccc")+",\n -0.0625em -0.0625em "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check, label.field.radio {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -0.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\n background-color: "+(t.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(t.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(t.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(t.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(i.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(i.bc||"#ccc")+";\n background-color: "+(i.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(i.bc||"#ccc")+";\n }\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 1.125em;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(t.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(o?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(o?"":"box-shadow: 0 0.0625em 0 0 "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(t.fg||"#222")+";\n text-align: "+(o?"center":"left")+";\n padding: 0.5em "+(o?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(o?"\n border-radius: "+(t.radius||"0.2em")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(t.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(o?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(o?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(o?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(t.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(o?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(t.radius||"0.2em")+" "+(t.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(t.radius||"0.2em")+" 0 0 "+(t.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(o?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(t.fga||"#07e")+";\n color: "+(t.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "};var x=t.macro(function(e){var t=[],n=[],i=(e.template.m||[]).slice(),o=e.template.f||[],r=i.find(function(e){return"value"===e.n}),a=i.find(function(e){return"type"===e.n}),l=i.find(function(e){return"tip"===e.n}),c=i.find(function(e){return"disabled"===e.n}),s=i.find(function(e){return"maxlength"===e.n});if(l&&i.splice(i.indexOf(l),1),a&&"function"==typeof x.types[a.f])t.push.apply(t,x.types[a.f](i,o,e));else if(r){var f={t:7,e:"input",m:[r]};if(c&&f.m.push(c),s&&f.m.push(s),y(o,"option")&&(f.e="select",f.f=o),a&&(f.m.push(a),"checkbox"===a.f||"radio"===a.f)){var p=i.find(function(e){return"target"===e.n});p?f.m.push(Object.assign({},p,{n:"name"})):f.m.splice(f.m.indexOf(r),1,Object.assign({},r,{n:"checked"}))}f.m=f.m.concat(i.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),t.push(f);var d=o.filter(function(e){return"button"===e.e||y(e.f,"button")});d.length&&(t.push.apply(t,d),t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}else{o.forEach(function(e){"label"===e.e?e.f&&e.f.length&&n.push.apply(n,e.f):t.push(e)});var u=o.filter(function(e){return e.e});u.find(function(e){return"button"===e.e})&&u.length>1&&(t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}var b=i.find(function(e){return"label"===e.n});b&&b.f&&b.f.length&&n.push.apply(n,Array.isArray(b.f)?b.f:[b.f]),l&&t.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(n.length?"":" field-solo-tip"),g:1},{t:13,n:"title",f:l.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"});var m=i.find(function(e){return"inline"===e.n});n&&!m?t.unshift.apply(t,n):m||t.unshift(" ");var h={t:7,e:"label",m:[{t:71,n:"field"}].concat(i.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n&&"disabled"!==e.n})),f:t};m&&h.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([h])});function _(e,t){return"function"!=typeof e.focus||e.disabled||(t&&t.immediate?e.focus():setTimeout(function(){return!e.disabled&&e.focus()},(t||{}).timeout||250)),{teardown:m}}x.types={},i("field","decorators",v),i("field","partials",x),i("autofocus","decorators",_);var w={v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rautocomplete field-wrapper",g:1},{n:["pop"],t:70,f:{r:["@context","$1"],s:'[(_0).set("rac.pop",_1)]'}}],f:[{t:7,e:"input",m:[{t:8,r:"extra-attributes"},{n:["dblclick"],t:70,f:{r:["rac.pop","@node"],s:"[_0.show(_1)]"}},{n:["focus"],t:70,f:{r:["rac"],s:"[_0.stash()]"}},{n:["blur"],t:70,f:{r:["rac","@node"],s:"[_0.checkBlur(_1)]"}},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-drop",g:1},{n:["click"],t:70,f:{r:["rac.pop","@context"],s:'[_0.show((_1).find("input"))]'}}]}," ",{t:7,e:"rac-pop",m:[{t:13,n:"style",f:"padding: 0;",g:1},{t:13,n:"class",f:"rac-pop",g:1},{n:["init"],t:70,f:{r:["@context","$1"],s:'[(_0).raise("pop",{},_1)]'}},{n:"popped",t:13,f:[{t:2,r:"rac.popped"}]},{n:"where",f:"below",t:13,g:1},{n:"align",f:"end",t:13,g:1},{n:"gap",f:[{t:2,x:{r:[],s:"2"},s:1}],t:13},{n:"offsets",t:13,f:[{t:2,r:"rac.offsets"}]},{n:"fit",t:13,f:[{t:2,r:"rac.fit"}]}],f:[{t:4,f:[{t:7,e:"input",m:[{n:"class-rac-modal",t:13},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13},{n:["blur"],t:70,f:{r:["rac"],s:"[_0.checkBlur()]"}},{n:"autocompletefocus",t:71}]}],n:50,r:"inModal"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-list",g:1},{n:"tabindex",f:"-1",t:13,g:1}],f:[{t:55,f:[{f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Loading..."]}],t:4},{t:62,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item",g:1},{n:"tabindex",f:"-1",t:13,g:1},{t:4,f:[{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]}],n:50,r:"rac.valueBound"},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{t:4,f:[{n:["click"],t:70,f:{r:["@context",".","rac"],s:'[(_0).set("rac.value",_1),_2._drawDisplay()]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],n:50,r:"rac.popped"}],f:[{t:2,x:{r:["rac","."],s:"_0._display(_1)"}}]}],n:52,r:"items"}," "],n:"items"},{t:63,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Load failed."]}]}],r:"rac.list"}]}]}]}],e:{2:function(){return 2},'[(_0).set("rac.pop",_1)]':function(e,t){return[e.set("rac.pop",t)]},"[_0.show(_1)]":function(e,t){return[e.show(t)]},"[_0.stash()]":function(e){return[e.stash()]},"[_0.checkBlur(_1)]":function(e,t){return[e.checkBlur(t)]},"[_0.input(_1)]":function(e,t){return[e.input(t)]},"[_0.key(_1)]":function(e,t){return[e.key(t)]},'[_0.show((_1).find("input"))]':function(e,t){return[e.show(t.find("input"))]},'[(_0).raise("pop",{},_1)]':function(e,t){return[e.raise("pop",{},t)]},"[_0.checkBlur()]":function(e){return[e.checkBlur()]},"_0===_1":function(e,t){return e===t},'[(_0).set("rac.value",_1),_2._drawDisplay()]':function(e,t,n){return[e.set("rac.value",t),n._drawDisplay()]},'[(_0).set("rac.selected",_1)]':function(e,t){return[e.set("rac.selected",t)]},"_0._display(_1)":function(e,t){return e._display(t)}}};function k(e,t){return t.reduce(function(e,t){return e?e[t]:e},e)}var T=["INPUT","SELECT","TEXTAREA","BUTTON","BODY"],L=t.macro(function(e){var n,i,o;function r(t){null==t&&(t=null==e.get("rac.value")?"":e.get("rac.display")),t===e.get("rac.tempDisplay")&&(t="");var n=e.get("rac._items");if("function"==typeof n){var i=n(t);"object"==typeof i&&"function"==typeof i.then?i.then(function(t){return e.set("rac.list",t)}):e.set("rac.list",i)}else if(Array.isArray(n)){var o,r=e.get("rac._display");try{o=new RegExp(t||"","i")}catch(e){o=new RegExp((t||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}e.set("rac.list",n.filter(function(e){return o.test(r(e))}))}else e.set("rac.list",[])}function a(t,n){var i=e.get("rac.default");return null==(t=null!=t||n?t:e.get("rac.value"))&&i&&(t="function"==typeof i?i(e.get("rac.display")):i),t}function l(n,o,l){var s=e.get("rac.displayprop");if(e.get("rac.__display")!==s||void 0===e.get("rac._display")){var f=function(){return e.attributes["display-value"]?e.get("rac.display"):"(none)"};if("string"==typeof s){var p=t.splitKeypath(s);s=function(e){return null==e&&(e=a()),null==e?f():k(e,p)}}else if(Array.isArray(s)){var d=s;s=function(e){return null==e&&(e=a()),null==e?f():k(e,d)}}else s||(s=function(e){return null==e&&(e=a()),null==e?f():""+e});e.set("rac._display",s),e.set("rac.__display",e.get("rac.displayprop")),e.set("rac.display",s(e.get("rac.value")))}if(s=e.get("rac.member"),e.get("rac.__member")!==s||void 0===e.get("rac._member")){if("string"==typeof s){var u=t.splitKeypath(s);s=function(e){return k(a(e),u)}}else if(Array.isArray(s)){var b=s;s=function(e){return k(a(e),b)}}else s||(s=function(e){return a(e)});e.set("rac._member",s),e.set("rac.__member",e.get("rac.member"))}s=e.get("rac.items"),e.get("rac.__items")===s&&void 0!==e.get("rac._items")||(Array.isArray(s)?e.set("rac._items",s):"function"==typeof s?e.set("rac._items",s):"object"==typeof s&&"function"==typeof s.then?s.then(function(t){e.set("rac._items",t),r()}):e.set("rac._items",[]),e.set("rac.__items",e.get("rac.items"))),i&&"rac.display"===l&&e.get("rac.limit")&&!i.contains(document.activeElement)&&c(),r()}function c(){var t=e.get("rac._display");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac.display",n),e.set("rac.tempDisplay",n)}}function s(t){(t.items&&e.link(t.items,"rac.items"),t.value&&e.link(t.value,"rac._value"),e.set("rac.valueBound",!!t.value),t.selected&&e.link(t.selected,"rac.selected"),t["display-value"]&&e.link(t["display-value"],"rac.display"),"display"in t&&e.set("rac.displayprop",t.display),"member"in t&&e.set("rac.member",t.member),"offsets"in t?(e.set("rac.offsets",t.offsets),e.set("rac.fit",!("fit"in t)||t.fit)):e.set("rac.fit","fit"in t&&t.fit),e.set("rac.limit",t["limit-set"]),e.set("rac.default",t.default),e.get("rac.limit")&&e.get("input"))&&(e.get("input")!==document.activeElement&&c());l()}e.aliasLocal("rac"),e.set("rac.list",[]),e.set("rac.popped",!1),e.set("rac.stash",function(){e.set("rac.tempDisplay",e.get("rac.display")),e.set("rac.tempValue",e.get("rac.value"))}),e.set("rac.key",function(t){var n=t.which;if(27===n)e.set("rac.popped",!1),e.set("rac.display",e.get("rac.tempDisplay")),e.set("rac.value",e.get("rac.tempValue"));else if(38===n||40===n){t.preventDefault(),e.get("rac.pop").show(e.find("input"));var i=e.get("rac.selected"),o=e.get("rac.list");38===n?i<=0||null==i?e.set("rac.selected",Array.isArray(o)?o.length-1:0):e.set("rac.selected",i-1):Array.isArray(o)?e.set("rac.selected",i<o.length-1?i+1:0):e.set("rac.selected",0)}else if(10===n||13===n){var r=e.get("rac.list");Array.isArray(r)&&(e.set("rac.value",r[e.get("rac.selected")]),c())}else if(9===n){if(e.get("rac.popped")){var l=e.get("rac.list");if(Array.isArray(l)){var s=l[e.get("rac.selected")];null==s&&(s=a(s,!0)),e.set("rac.value",s)}e.get("rac.limit")||setTimeout(function(){return c()},140)}else null!=e.get("rac.value")&&~e.get("rac.selected")&&e.get("rac.display")==e.get("rac.tempDisplay")||e.set("rac.value",a(null,!0));e.set("rac.popped",!1),e.get("rac.updateDisplay")()}}),e.set("rac.input",function(t){n&&clearTimeout(n),n=setTimeout(function(){n=null,r(t.target.value);var i=e.find("input");i&&document.activeElement===i&&e.get("rac.pop").show(i)},500),e.attributes.lazy||e.set("rac.display",t.target.value)}),e.setTemplate(w),e.set("rac._drawDisplay",c),e.set("rac.updateDisplay",function(t){setTimeout(function(){i&&e.get("rac.limit")&&!i.contains(document.activeElement)&&c()},140)}),s(e.attributes);var f=!1,p={init:!1,defer:!0},d=[e.observe("rac.displayprop",l,p),e.observe("rac.memberprop",l,p),e.observe("rac.items",l,p),e.observe("rac.list",function(t){Array.isArray(t)?e.set("rac.selected",t.indexOf(e.get("rac.value"))):e.set("rac.selected",-1)},p),e.observe("rac.value",function(t){c(),function(){if(!e.get("rac._value")||e.get("rac.value")){var t=e.get("rac._member");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac._value",n)}e.ractive.getContext(e.find("input")).raise("selected",{},e.get("rac._value"),e.get("rac.display"))}}(),e.set("rac.popped",!1),e.set("rac.tempValue",t)}),e.observe("rac._value",function(t){var n=e.get("rac._member"),i=e.get("rac.list").find(function(e){return n(e)===t});i!==e.get("rac.value")&&e.set("rac.value",i),!i&&null!=t&&e.get("rac.valueBound")&&(e.set("rac.display",t),l())}),e.observe("rac.selected",function(){o&&clearTimeout(n),o=setTimeout(function(){o=null;var t=e.find(".rac-hover");t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},14)}),e.observe("rac.popped",function(e){e&&setTimeout(function(){return f=!1},300),f=!0})];return e.set("rac.checkBlur",function(t){if(f)return!1;var n=document.activeElement;if(~T.indexOf(n.nodeName)||n.getAttribute("tabindex")){var i=e.findAll("input").concat(e.get("rac.pop").popFindAll("input"));document.activeElement&&!~i.indexOf(document.activeElement)&&e.get("rac.key")({which:9})}}),{teardown:function(){e.unlink("rac.items"),e.unlink("rac._value"),e.unlink("rac.selected"),e.unlink("rac.display"),d.forEach(function(e){return e.cancel()})},update:s,render:function(){i=e.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","fit","offsets","display-value","default"],css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.autocomplete"),e("raui.autocomplete.primary")),n=Object.assign({},e("raui.autocomplete.drop"),e("raui.autocomplete.primary.drop")),i=e("raui.form.boxy");return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-drop {\n width: 2em;\n height: 100%;\n position: absolute;\n top: 0;\n right: 2px;\n cursor: pointer;\n }\n .rac-drop:after {\n font-family: "+(n.font||"sans-serif")+";\n content: "+(n.string||"'▾'")+";\n position: absolute;\n top: calc(50% - 0.5em);\n height: 1em;\n line-height: 1em;\n width: 100%;\n text-align: center;\n font-weight: "+(n.weight||"normal")+";\n color: "+(n.color||t.bc||"#ccc")+";\n }\n \n .rac-pop {\n min-width: 100%;\n }\n \n .rac-pop > .rpop {\n padding: 0;\n }\n \n .rac-list {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 2.125em;\n max-width: 100%;\n overflow: auto;\n }\n \n .rac-item {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bg||"#fff")+";\n padding: 0.25em;\n cursor: pointer;\n }\n \n .rac-selected {\n color: "+(t.bg||"#fff")+";\n background-color: "+(t.fga||"#07e")+";\n }\n \n .rac-hover {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bc||"#ccc")+";\n }\n \n .rac-selected.rac-hover {\n background-color: "+(t.bc||"#ccc")+";\n color: "+(t.fga||"#07e")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\n display: block;\n border-width: "+(i?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(i?t.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(i?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }"}.call(this,e)].join(" ")},cssId:"rautocomplete",noCssTransform:!0});function O(e){return void 0===e&&(e={}),function(t){var n=t.instance;n.partials[e.name||"autocomplete"]=L,n.components["rac-pop"]=u,n.decorators.autocompletefocus=_}}e.Autocomplete=L,e.FieldType=function(e){return void 0===e&&(e={}),function(t,n,i){return[{t:7,e:e.name||"autocomplete",m:t,f:n}]}},e.plugin=O,e.default=O,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],t):t(e.RauiAutocomplete={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:null;function i(e,t,i){if(n&&n.Ractive&&"object"==typeof n.Ractive[t]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var o=r.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(e,t){var n=t.split("="),i=n[0],r=n[1];return e[i]=r,e},{})),Ractive[t][o&&o[e]||e]=i}}}function r(e,t){void 0===t&&(t={});var n=e.processParams(t,{duration:400,easing:"easeInOut"});t.dir=t.dir||!1;var i=t.distance||"20px",r=t.scale||"0.9",o="above"===t.dir?"translateY("+i+")":"left"===t.dir?"translateX("+i+")":"right"===t.dir?"translateX(-"+i+")":"translateY(-"+i+")";return e.isIntro||n.intro?(e.setStyle("opacity",0),e.setStyle("transform","scale("+r+") "+o),e.animateStyle({opacity:1,transform:"none"},n)):(e.setStyle("opacity",1),e.setStyle("transform","none"),e.animateStyle({opacity:0,transform:"scale("+r+") "+o},n))}function o(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"pop"]=r}}function a(e,t){var n=!1,i=!1;function r(n){for(var i=n.target;i;){if(i===e)return;if(!i.parentNode&&i!==document)return;i=i.parentNode}t(n)}return setTimeout(function(){n=!0,i||(document.body.addEventListener("click",r,{capture:!0}),document.body.addEventListener("touchstop",r,{capture:!0}))}),{teardown:function(){i=!0,n&&(document.body.removeEventListener("click",r,{capture:!0}),document.body.removeEventListener("touchstop",r,{capture:!0}))}}}function l(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return e.isIntro||n.intro?(e.setStyle("opacity",0),e.animateStyle("opacity",1,n)):(e.setStyle("opacity",1),e.animateStyle("opacity",0,n))}function c(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"fade"]=l}}i("pop","transitions",r),i("fade","transitions",l);var s,f,p,d={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content",z:[{n:"trigger",x:{r:"triggerContext"}}]}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(e){return e||"below"},'_0||"middle"':function(e){return e||"middle"},'[{dir:_0||"below"}]':function(e){return[{dir:e||"below"}]},'[_0.set("popped",false)]':function(e){return[e.set("popped",!1)]},"_0+(_1?3:0)":function(e,t){return e+(t?3:0)},"_0!=null":function(e){return null!=e},"_0+(_1?0:3)":function(e,t){return e+(t?0:3)},"_0-2":function(e){return e-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(e,t,n){return[e===t&&n.done(),!0]},"[_0.done()]":function(e){return[e.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}},u=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.position=function(t){var n=t||this.source,i=this.get("popped");if(n&&i){var r=this.find("div");if(n&&r&&r.offsetParent){n?this.set("triggerContext",e.getContext(n)):this.set("triggerContext",null);var o=r.offsetParent,a=o.getBoundingClientRect(),l=r.getBoundingClientRect(),c=n.getBoundingClientRect(),s=this.get("where")||"below",f=this.get("align")||"middle",p=this.get("tail"),d="above"===s||"below"===s,u=this.get("fit"),b=this.get("gap"),m="above"===s||"below"===s?0:"left"===s?-l.width-b:c.width+b,h="left"===s||"right"===s?-c.height:"above"===s?-c.height-l.height-b:b;"middle"===f?"below"===s||"above"===s?m-=(l.width-c.width)/2:"left"!==s&&"right"!==s||(h-=(l.height-c.height)/2):"end"===f&&("below"===s||"above"===s?m+=c.width-l.width:"left"!==s&&"right"!==s||(h+=c.height-l.height));var g={popTop:c.bottom-a.top+h,popLeft:c.left-a.left+m,tail:p,vert:"above"===s||"below"===s};if(o.scrollTop&&(g.popTop+=o.scrollTop),o.scrollLeft&&(g.popLeft+=o.scrollLeft),p){"above"===s?g.tailBottom=-10:"below"===s?g.tailTop=-10:"left"===s?g.tailRight=-10:"right"===s&&(g.tailLeft=-10);var v=this.tailSource?this.tailSource.getBoundingClientRect():c;"start"===f?d?g.tailLeft=Math.floor(v.width/2)-10:g.tailTop=Math.floor(v.height/2)-10:"end"===f?d?g.tailRight=Math.floor(v.width/2)-10:g.tailBottom=Math.floor(v.height/2)-10:"middle"===f&&(d?g.tailLeft=Math.floor(v.width/2)-10:g.tailTop=Math.floor(v.height/2)-10),v!==c?d?(null!=g.tailLeft&&(g.tailLeft+=v.left-c.left),null!=g.tailRight&&(g.tailRight+=c.right-v.right)):(null!=g.tailTop&&(g.tailTop+=v.top-c.top),null!=g.tailBottom&&(g.tailBottom+=c.bottom-v.bottom)):"middle"===f&&(d?(null!=g.tailLeft&&(g.tailLeft+=v.left-(g.popLeft+a.left)),null!=g.tailRight&&(g.tailRight+=g.popLeft+a.left+l.width-v.right)):(null!=g.tailTop&&(g.tailTop+=v.top-(g.popTop+a.top)),null!=g.tailBottom&&(g.tailBottom+=g.popTop+a.top+l.height-v.bottom)))}if(u){var y=o;if(this.get("offsets"))for(var _=this.get("offsets");_--;)y=y.offsetParent;var x=o.scrollWidth,w=o.scrollHeight;if(g.popLeft+l.width>x){var k=g.popLeft-(x-l.width);g.popLeft-=k,d&&g.tailLeft&&(g.tailLeft+=k),d&&g.tailRight&&(g.tailRight-=k),p&&!d&&(g.tail=!1)}if(g.popLeft<0){var T=-1*g.popLeft;g.popLeft+=T,d&&g.tailLeft&&(g.tailLeft-=T),d&&g.tailRight&&(g.tailRight+=T),p&&!d&&(g.tail=!1)}if(g.popTop+l.height>w){var L=g.popTop-(w-l.height);g.popTop-=L,!d&&g.tailTop&&(g.tailTop+=L),!d&&g.tailBottom&&(g.tailBottom-=L),p&&d&&(g.tail=!1)}if(g.popTop<0){var O=-1*g.popTop;g.popTop+=O,!d&&g.tailTop&&(g.tailTop-=O),!d&&g.tailBottom&&(g.tailBottom+=O),p&&d&&(g.tail=!1)}}if(a.left+g.popLeft<0){var A=0-(a.left+g.popLeft);g.popLeft+=A,d&&g.tailLeft&&(g.tailLeft-=A),d&&g.tailRight&&(g.tailRight+=A),p&&!d&&(g.tail=!1)}if(a.top+g.popTop<0){var B=0-(a.top+g.popTop);g.popTop+=B,!d&&g.tailTop&&(g.tailTop-=B),!d&&g.tailBottom&&(g.tailBottom+=B),p&&d&&(g.tail=!1)}g.tailLeft&&(g.tailLeft=Math.floor(g.tailLeft)),g.tailRight&&(g.tailRight=Math.floor(g.tailRight)),g.tailTop&&(g.tailTop=Math.floor(g.tailTop)),g.tailBottom&&(g.tailBottom=Math.floor(g.tailBottom)),this.set("position",g)}else this.set("position",null)}},t.prototype.show=function(e){return this.source=e,this.set("popped",!0),this._transdone},t.prototype.hide=function(){return this.set("popped",!1),this._transdone},t.prototype.popFind=function(e){return s?f.find(e):this.find(e)},t.prototype.popFindAll=function(e){return s?f.findAll(e):this.findAll(e)},t}(t);t.extendWith(u,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[o(),(void 0===p&&(p={}),function(e){e.instance.events[p.name||"clickout"]=a}),c()],template:d,css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.pop.primary")),n=(e("raui.themes")||[]).slice();return(e("raui.pop.themes")||[]).forEach(function(e){~n.indexOf(e)||n.push(e)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 21;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(t.bg||"#fff")+";\n color: "+(t.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 20;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(t.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(t.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(t.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(t.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(t.bc||"#ccc")+";\n }\n "+n.map(function(t){var n=Object.assign({},e("raui.primary"),e("raui.pop.primary"),e("raui."+t),e("raui.pop."+t));return"\n ."+t+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+t+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,e)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(e){var t,n=this,i=this._transdone=new Promise(function(e){return t=e});i.resolve=t,setTimeout(function(){n._transdone=i,n.get("popped")===e&&n.set("_popped",e)},1)},_popped:{handler:function(e){var t=this,n=this._transdone.resolve;if(e){var i=this.get("@style.raui.pop.mobile");if(i&&window.matchMedia("(max-width: "+i+")").matches){f||(f=new b({target:document.body,append:!0}));var r=this.getContext().getParent(!0);r.isContext=1,this.set("__popped",!1).then(n),f.unshift("contents",{content:this.partials.content,context:r,attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){t.set("popped",!1)}})}else this.set("__popped",!0)}else s?(f.shift("contents"),n()):this.set("__popped",!1).then(n)},defer:!0,init:!1},__popped:{handler:function(e){var t=this._transdone.resolve;if(e){var n=this.find("div"),i=n,r=i.offsetHeight+i.offsetTop,o=i.offsetWidth+i.offsetLeft,a=i.offsetParent;if(!this.overflows)for(var l=this.overflows={e:[],v:[]};n&&n.style;){if(n===a){if(n.offsetWidth>=o&&n.offsetHeight>=r)break;o+=n.offsetLeft,r+=n.offsetTop,a=n.offsetParent}var c=getComputedStyle(n);if("auto"===c.overflow)break;"hidden"===c.overflow&&(l.e.push(n),l.v.push(n.style.overflow),n.style.overflow="visible"),n=n.parentNode}this.position(),this.transition("pop",i,{intro:!0,dir:this.get("where")||"below"}).then(t)}else this.source=null,this.tailSource=null},defer:!0,init:!1},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(e){var t=this;return{teardown:function(){var e=t.overflows;if(e){t.overflows=null;for(var n=0;n<e.e.length;n++)e.e[n].style.overflow=e.v[n]}}}}},data:function(){return{gap:4}}});var b=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(t);function m(){}function h(e){~this.className.indexOf("focus")||(this.className+=" focus")}function g(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function v(e){var t,n,i,r,o,a,l,c,s,f,p,d,u,b=this.getContext(e);function v(){var b=y().split(/\s+/).filter(function(e){return!!e});(t=!!~b.indexOf("field"))||(b.push("field"),t=!0),(n=e.querySelector("input[type=checkbox]"))&&!~b.indexOf("check")&&b.push("check"),(i=e.querySelector("input[type=radio]"))&&!~b.indexOf("radio")&&b.push("radio");var m=n||i;m&&m.checked&&!~b.indexOf("checked")&&b.push("checked"),m&&m.disabled&&!~b.indexOf("disabled")&&b.push("disabled"),!m&&f?(f.cancel(),f=0,p&&(p.disconnect(),p=0),delete m._form_callback,u&&(delete u.checked,d=u=void 0)):m&&(m._form_callback=function(t,n){if(void 0===n&&(n=!0),n&&"radio"===m.type&&m.name){var i=[];i.push.apply(i,document.querySelectorAll("input[type=radio][name="+m.name+"]")),(i=i.filter(function(e){return e!==m})).forEach(function(e){return e._form_callback&&e._form_callback(t,!1)})}var r=m.checked;r&&!~e.className.indexOf("checked")?e.className+=" checked":!r&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(p=new MutationObserver(function(){var t;(t=m.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!t&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(m,{attributes:!0}),f=this.getContext(m).listen("change",m._form_callback),(d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(m),"checked"))&&d.configurable&&(u=m,Object.defineProperty(m,"checked",{get:d.get,set:function(e){d.set.call(u,e),m._form_callback()},enumerable:!0,configurable:!0}))),(r=!!e.querySelector("textarea"))&&!~b.indexOf("textarea")&&b.push("textarea"),(o=!!e.querySelector("select"))&&!~b.indexOf("select")&&b.push("select"),(a=!!e.querySelector("input[type=file]"))&&!~b.indexOf("file")&&b.push("file"),(l=!!(l=e.querySelector("button"))&&l.parentNode===e)&&!~b.indexOf("button")&&b.push("button"),(c=!!e.querySelector("div"))&&!~b.indexOf("plain")&&b.push("plain"),(s=!(n||i||a||!e.querySelector("input")))&&!~b.indexOf("input")&&b.push("input"),e.className=b.join(" ")}function y(){var f=e.className;return t||(f=f.replace(/\bfield\b/g,"").trim()),n||(f=f.replace(/\bcheck(ed)?\b/g,"").trim()),i||(f=f.replace(/\bradio\b/g,"").trim()),r||(f=f.replace(/\btextarea\b/g,"").trim()),o||(f=f.replace(/\bselect\b/g,"").trim()),a||(f=f.replace(/\bfile\b/g,"").trim()),l||(f=f.replace(/\bbutton\b/g,"").trim()),c||(f=f.replace(/\bplain\b/g,"").trim()),s||(f=f.replace(/\binput\b/g,"").trim()),f=f.replace(/ +/g," ")}var _=b.listen("focusin",h),x=b.listen("focusout",g);v.call(this);var w={update:m,invalidate:v.bind(this),teardown:function(){b.ractive.fire("fieldUnregistered",b,e,w);var t=y();t=t.replace(/\bfocus\b/g,"").trim(),_.cancel(),x.cancel(),f&&f.cancel(),p&&p.disconnect(),u&&(delete u.checked,d=u=void 0),e.className=t},setDisabled:function(t){e.querySelectorAll("input,button,select,textarea").forEach(function(e){return e.disabled=t}),this.invalidate()}};return b.ractive.fire("fieldRegistered",b,e,w),w}function y(e,t){if(!e)return!1;for(var n=0;n<e.length;n++){if(e[n].e===t)return!0;if(e[n].f&&y(e[n].f,t))return!0}return!1}t.extendWith(b,{template:{v:d.v,t:d.p.modal},data:function(){return{contents:[]}},use:[o(),c()],observe:{contents:function(e){s=(e||[]).length>0}},on:{init:function(){f?console.warn("More than one PopOver mobile host created."):f=this}}}),v.style=function(e){var t=Object.assign({},e("raui.primary"),e("raui.form.primary")),n=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),i=Object.assign({},e("raui.primary.disabled"),e("raui.form.primary.disabled")),r=e("raui.form.boxy");return"\n label.field, .field-manual {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(t.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(t.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(r?t.bg||"#fff":"transparent")+";\n color: "+(t.fg||"#222")+";\n }\n\n label.field.focus {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(r?"":"box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea,\n .field-manual .field-body\n {\n display: block;\n border-width: "+(r?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(r?t.bg||"#fff":"transparent")+";\n color: "+(t.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(r?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(r?"":":disabled")+",\n label.field select"+(r?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(r?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(i.bg||"#f4f4f4")+";\n color: "+(i.fg||"#444")+";\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(r?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(t.bc||"#ccc")+",\n -0.0625em 0.0625em "+(t.bc||"#ccc")+",\n 0.0625em -0.0625em "+(t.bc||"#ccc")+",\n -0.0625em -0.0625em "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check, label.field.radio {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -0.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\n background-color: "+(t.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(t.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(t.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(t.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(i.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(i.bc||"#ccc")+";\n background-color: "+(i.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(i.bc||"#ccc")+";\n }\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 1.125em;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(t.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(r?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(r?"":"box-shadow: 0 0.0625em 0 0 "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(t.fg||"#222")+";\n text-align: "+(r?"center":"left")+";\n padding: 0.5em "+(r?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(r?"\n border-radius: "+(t.radius||"0.2em")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(t.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(r?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(r?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(r?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(t.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(r?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(t.radius||"0.2em")+" "+(t.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(t.radius||"0.2em")+" 0 0 "+(t.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(r?"15":"1")+"em;\n }\n\n .just-the.field-tip,\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(t.fga||"#07e")+";\n color: "+(t.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1em;\n font-family: monospace;\n text-align: center;\n margin-top: -0.2em;\n cursor: help;\n }\n .just-the.field-tip.field-tip-error {\n background-color: "+(t.error||"#ca3c3c")+";\n }\n .just-the.field-tip.field-tip-warn {\n background-color: "+(t.warn||"#f79e0b")+";\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "};var _=t.macro(function(e){var t=[],n=[],i=(e.template.m||[]).slice(),r=e.template.f||[],o=i.find(function(e){return"value"===e.n}),a=i.find(function(e){return"type"===e.n}),l=i.find(function(e){return"tip"===e.n}),c=i.find(function(e){return"disabled"===e.n}),s=i.find(function(e){return"maxlength"===e.n});if(l&&i.splice(i.indexOf(l),1),a&&"function"==typeof _.types[a.f])t.push.apply(t,_.types[a.f](i,r,e));else if(o){var f={t:7,e:"input",m:[o]};if(c&&f.m.push(c),s&&f.m.push(s),y(r,"option")&&(f.e="select",f.f=r),a&&(f.m.push(a),"checkbox"===a.f||"radio"===a.f)){var p=i.find(function(e){return"target"===e.n});p?f.m.push(Object.assign({},p,{n:"name"})):f.m.splice(f.m.indexOf(o),1,Object.assign({},o,{n:"checked"}))}f.m=f.m.concat(i.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),t.push(f);var d=r.filter(function(e){return"button"===e.e||y(e.f,"button")});d.length&&(t.push.apply(t,d),t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}else{r.forEach(function(e){"label"===e.e?e.f&&e.f.length&&n.push.apply(n,e.f):t.push(e)});var u=r.filter(function(e){return e.e});u.find(function(e){return"button"===e.e})&&u.length>1&&(t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}var b=i.find(function(e){return"label"===e.n});b&&b.f&&b.f.length&&n.push.apply(n,Array.isArray(b.f)?b.f:[b.f]),l&&t.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(n.length?"":" field-solo-tip"),g:1},{t:13,n:"title",f:l.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"});var m=i.find(function(e){return"inline"===e.n});n&&!m?t.unshift.apply(t,n):m||t.unshift(" ");var h={t:7,e:"label",m:[{t:71,n:"field"}].concat(i.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n&&"disabled"!==e.n})),f:t};m&&h.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([h])});_.types={};var x=t.macro(function(e){e.aliasLocal("__rtip");var t=[{t:7,e:"span",m:(e.template.m||[]).concat([{t:13,n:"class",f:["just-the field-tip",{t:4,f:[" field-tip-error"],x:{r:["__rtip.attrs.type"],s:'_0==="error"'}},{t:4,f:[" field-tip-warn"],x:{r:["__rtip.attrs.type"],s:'_0==="warn"'}}]},{t:13,n:"title",f:Array.isArray(e.template.f)||"string"==typeof e.template.f?e.template.f:[e.template.f]},{t:70,n:["click"],f:{r:[],s:"[false]"}}]),f:[{t:4,f:[{t:3,r:"__rtip.attrs.sign"}],n:50,r:"__rtip.attrs.sign"},{t:4,f:["!"],n:50,x:{r:["__rtip.attrs.type"],s:'_0==="error"||_0==="warn"'},l:1},{t:4,f:["?"],n:51,l:1}]}];return e.set("__rtip.attrs",e.attributes),e.setTemplate(t),{update:function(){e.set("__rtip.attrs",e.attributes)}}},{attributes:["sign","type"]});function w(e,t){return"function"!=typeof e.focus||e.disabled||(t&&t.immediate?e.focus():setTimeout(function(){return!e.disabled&&e.focus()},(t||{}).timeout||250)),{teardown:m}}i("field","decorators",v),i("field","partials",_),i("tip","partials",x),i("autofocus","decorators",w);var k={v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rautocomplete field-wrapper",g:1},{n:["pop"],t:70,f:{r:["@context","$1"],s:'[(_0).set("rac.pop",_1)]'}}],f:[{t:7,e:"input",m:[{t:8,r:"extra-attributes"},{n:["dblclick"],t:70,f:{r:["rac.pop","@node"],s:"[_0.show(_1)]"}},{n:["focus"],t:70,f:{r:["rac"],s:"[_0.stash()]"}},{n:["blur"],t:70,f:{r:["rac","@node"],s:"[_0.checkBlur(_1)]"}},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-drop",g:1},{n:["click"],t:70,f:{r:["rac.pop","@context"],s:'[_0.show((_1).find("input"))]'}}]}," ",{t:7,e:"rac-pop",m:[{t:13,n:"style",f:"padding: 0;",g:1},{t:13,n:"class",f:"rac-pop",g:1},{n:["init"],t:70,f:{r:["@context","$1"],s:'[(_0).raise("pop",{},_1)]'}},{n:"popped",t:13,f:[{t:2,r:"rac.popped"}]},{n:"where",f:"below",t:13,g:1},{n:"align",f:"end",t:13,g:1},{n:"gap",f:[{t:2,x:{r:[],s:"2"},s:1}],t:13},{n:"offsets",t:13,f:[{t:2,r:"rac.offsets"}]},{n:"fit",t:13,f:[{t:2,r:"rac.fit"}]}],f:[{t:4,f:[{t:7,e:"input",m:[{n:"class-rac-modal",t:13},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13},{n:["blur"],t:70,f:{r:["rac"],s:"[_0.checkBlur()]"}},{n:"autocompletefocus",t:71}]}],n:50,r:"inModal"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-list",g:1},{n:"tabindex",f:"-1",t:13,g:1}],f:[{t:55,f:[{f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Loading..."]}],t:4},{t:62,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item",g:1},{n:"tabindex",f:"-1",t:13,g:1},{t:4,f:[{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]}],n:50,r:"rac.valueBound"},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{t:4,f:[{n:["click"],t:70,f:{r:["@context",".","rac"],s:'[(_0).set("rac.value",_1),_2._drawDisplay()]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],n:50,r:"rac.popped"}],f:[{t:2,x:{r:["rac","."],s:"_0._display(_1)"}}]}],n:52,r:"items"}," "],n:"items"},{t:63,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Load failed."]}]}],r:"rac.list"}]}]}]}],e:{2:function(){return 2},'[(_0).set("rac.pop",_1)]':function(e,t){return[e.set("rac.pop",t)]},"[_0.show(_1)]":function(e,t){return[e.show(t)]},"[_0.stash()]":function(e){return[e.stash()]},"[_0.checkBlur(_1)]":function(e,t){return[e.checkBlur(t)]},"[_0.input(_1)]":function(e,t){return[e.input(t)]},"[_0.key(_1)]":function(e,t){return[e.key(t)]},'[_0.show((_1).find("input"))]':function(e,t){return[e.show(t.find("input"))]},'[(_0).raise("pop",{},_1)]':function(e,t){return[e.raise("pop",{},t)]},"[_0.checkBlur()]":function(e){return[e.checkBlur()]},"_0===_1":function(e,t){return e===t},'[(_0).set("rac.value",_1),_2._drawDisplay()]':function(e,t,n){return[e.set("rac.value",t),n._drawDisplay()]},'[(_0).set("rac.selected",_1)]':function(e,t){return[e.set("rac.selected",t)]},"_0._display(_1)":function(e,t){return e._display(t)}}};function T(e,t){return t.reduce(function(e,t){return e?e[t]:e},e)}var L=["INPUT","SELECT","TEXTAREA","BUTTON","BODY"],O=t.macro(function(e){var n,i,r;function o(t){null==t&&(t=null==e.get("rac.value")?"":e.get("rac.display")),t===e.get("rac.tempDisplay")&&(t="");var n=e.get("rac._items");if("function"==typeof n){var i=n(t);"object"==typeof i&&"function"==typeof i.then?i.then(function(t){return e.set("rac.list",t)}):e.set("rac.list",i)}else if(Array.isArray(n)){var r,o=e.get("rac._display");try{r=new RegExp(t||"","i")}catch(e){r=new RegExp((t||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}e.set("rac.list",n.filter(function(e){return r.test(o(e))}))}else e.set("rac.list",[])}function a(t,n){var i=e.get("rac.default");return null==(t=null!=t||n?t:e.get("rac.value"))&&i&&(t="function"==typeof i?i(e.get("rac.display")):i),t}function l(n,r,l){var s=e.get("rac.displayprop");if(e.get("rac.__display")!==s||void 0===e.get("rac._display")){var f=function(){return e.attributes["display-value"]?e.get("rac.display"):"(none)"};if("string"==typeof s){var p=t.splitKeypath(s);s=function(e){return null==e&&(e=a()),null==e?f():T(e,p)}}else if(Array.isArray(s)){var d=s;s=function(e){return null==e&&(e=a()),null==e?f():T(e,d)}}else s||(s=function(e){return null==e&&(e=a()),null==e?f():""+e});e.set("rac._display",s),e.set("rac.__display",e.get("rac.displayprop")),e.set("rac.display",s(e.get("rac.value")))}if(s=e.get("rac.member"),e.get("rac.__member")!==s||void 0===e.get("rac._member")){if("string"==typeof s){var u=t.splitKeypath(s);s=function(e){return T(a(e),u)}}else if(Array.isArray(s)){var b=s;s=function(e){return T(a(e),b)}}else s||(s=function(e){return a(e)});e.set("rac._member",s),e.set("rac.__member",e.get("rac.member"))}s=e.get("rac.items"),e.get("rac.__items")===s&&void 0!==e.get("rac._items")||(Array.isArray(s)?e.set("rac._items",s):"function"==typeof s?e.set("rac._items",s):"object"==typeof s&&"function"==typeof s.then?s.then(function(t){e.set("rac._items",t),o()}):e.set("rac._items",[]),e.set("rac.__items",e.get("rac.items"))),i&&"rac.display"===l&&e.get("rac.limit")&&!i.contains(document.activeElement)&&c(),o()}function c(){var t=e.get("rac._display");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac.display",n),e.set("rac.tempDisplay",n)}}function s(t){(t.items&&e.link(t.items,"rac.items"),t.value&&e.link(t.value,"rac._value"),e.set("rac.valueBound",!!t.value),t.selected&&e.link(t.selected,"rac.selected"),t["display-value"]&&e.link(t["display-value"],"rac.display"),"display"in t&&e.set("rac.displayprop",t.display),"member"in t&&e.set("rac.member",t.member),"offsets"in t?(e.set("rac.offsets",t.offsets),e.set("rac.fit",!("fit"in t)||t.fit)):e.set("rac.fit","fit"in t&&t.fit),e.set("rac.limit",t["limit-set"]),e.set("rac.default",t.default),e.get("rac.limit")&&e.get("input"))&&(e.get("input")!==document.activeElement&&c());l()}e.aliasLocal("rac"),e.set("rac.list",[]),e.set("rac.popped",!1),e.set("rac.stash",function(){e.set("rac.tempDisplay",e.get("rac.display")),e.set("rac.tempValue",e.get("rac.value"))}),e.set("rac.key",function(t){var n=t.which;if(27===n)e.set("rac.popped",!1),e.set("rac.display",e.get("rac.tempDisplay")),e.set("rac.value",e.get("rac.tempValue"));else if(38===n||40===n){t.preventDefault(),e.get("rac.pop").show(e.find("input"));var i=e.get("rac.selected"),r=e.get("rac.list");38===n?i<=0||null==i?e.set("rac.selected",Array.isArray(r)?r.length-1:0):e.set("rac.selected",i-1):Array.isArray(r)?e.set("rac.selected",i<r.length-1?i+1:0):e.set("rac.selected",0)}else if(10===n||13===n){var o=e.get("rac.list");Array.isArray(o)&&(e.set("rac.value",o[e.get("rac.selected")]),c())}else if(9===n){if(e.get("rac.popped")){var l=e.get("rac.list");if(Array.isArray(l)){var s=l[e.get("rac.selected")];null==s&&(s=a(s,!0)),e.set("rac.value",s)}e.get("rac.limit")||setTimeout(function(){return c()},140)}else null!=e.get("rac.value")&&~e.get("rac.selected")&&e.get("rac.display")==e.get("rac.tempDisplay")||e.set("rac.value",a(null,!0));e.set("rac.popped",!1),e.get("rac.updateDisplay")()}}),e.set("rac.input",function(t){n&&clearTimeout(n),n=setTimeout(function(){n=null,o(t.target.value);var i=e.find("input");i&&document.activeElement===i&&e.get("rac.pop").show(i)},500),e.attributes.lazy||e.set("rac.display",t.target.value)}),e.setTemplate(k),e.set("rac._drawDisplay",c),e.set("rac.updateDisplay",function(t){setTimeout(function(){i&&e.get("rac.limit")&&!i.contains(document.activeElement)&&c()},140)}),s(e.attributes);var f=!1,p={init:!1,defer:!0},d=[e.observe("rac.displayprop",l,p),e.observe("rac.memberprop",l,p),e.observe("rac.items",l,p),e.observe("rac.list",function(t){Array.isArray(t)?e.set("rac.selected",t.indexOf(e.get("rac.value"))):e.set("rac.selected",-1)},p),e.observe("rac.value",function(t){c(),function(){if(!e.get("rac._value")||e.get("rac.value")){var t=e.get("rac._member");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac._value",n)}e.ractive.getContext(e.find("input")).raise("selected",{},e.get("rac._value"),e.get("rac.display"))}}(),e.set("rac.popped",!1),e.set("rac.tempValue",t)}),e.observe("rac._value",function(t){var n=e.get("rac._member"),i=e.get("rac.list").find(function(e){return n(e)===t});i!==e.get("rac.value")&&e.set("rac.value",i),!i&&null!=t&&e.get("rac.valueBound")&&(e.set("rac.display",t),l())}),e.observe("rac.selected",function(){r&&clearTimeout(n),r=setTimeout(function(){r=null;var t=e.find(".rac-hover");t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},14)}),e.observe("rac.popped",function(t){t&&setTimeout(function(){return f=!1},300),f=!0;var n=e.get("rac.pop");t&&n&&setTimeout(function(){var e=n.find("div");e&&!e._completeevent&&(e.addEventListener("mousedown",u),e._completeevent="added")},300)})];function u(t){var n=e.find("input");return n&&n.focus(),t.preventDefault(),!1}return e.set("rac.checkBlur",function(t){if(f)return!1;var n=document.activeElement;if(~L.indexOf(n.nodeName)||n.getAttribute("tabindex")){var i=e.findAll("input").concat(e.get("rac.pop").popFindAll("input"));document.activeElement&&!~i.indexOf(document.activeElement)&&e.get("rac.key")({which:9})}}),{teardown:function(){e.unlink("rac.items"),e.unlink("rac._value"),e.unlink("rac.selected"),e.unlink("rac.display"),d.forEach(function(e){return e.cancel()})},update:s,render:function(){i=e.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","fit","offsets","display-value","default"],css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.autocomplete"),e("raui.autocomplete.primary")),n=Object.assign({},e("raui.autocomplete.drop"),e("raui.autocomplete.primary.drop")),i=e("raui.form.boxy");return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-drop {\n width: 2em;\n height: 100%;\n position: absolute;\n top: 0;\n right: 2px;\n cursor: pointer;\n }\n .rac-drop:after {\n font-family: "+(n.font||"sans-serif")+";\n content: "+(n.string||"'▾'")+";\n position: absolute;\n top: calc(50% - 0.5em);\n height: 1em;\n line-height: 1em;\n width: 100%;\n text-align: center;\n font-weight: "+(n.weight||"normal")+";\n color: "+(n.color||t.bc||"#ccc")+";\n }\n \n .rac-pop {\n min-width: 100%;\n }\n \n .rac-pop > .rpop {\n padding: 0;\n }\n \n .rac-list {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 2.125em;\n max-width: 100%;\n overflow: auto;\n }\n \n .rac-item {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bg||"#fff")+";\n padding: 0.25em;\n cursor: pointer;\n }\n \n .rac-selected {\n color: "+(t.bg||"#fff")+";\n background-color: "+(t.fga||"#07e")+";\n }\n \n .rac-hover {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bc||"#ccc")+";\n }\n \n .rac-selected.rac-hover {\n background-color: "+(t.bc||"#ccc")+";\n color: "+(t.fga||"#07e")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\n display: block;\n border-width: "+(i?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(i?t.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(i?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }"}.call(this,e)].join(" ")},cssId:"rautocomplete",noCssTransform:!0});function A(e){return void 0===e&&(e={}),function(t){var n=t.instance;n.partials[e.name||"autocomplete"]=O,n.components["rac-pop"]=u,n.decorators.autocompletefocus=w}}e.Autocomplete=O,e.FieldType=function(e){return void 0===e&&(e={}),function(t,n,i){return[{t:7,e:e.name||"autocomplete",m:t,f:n}]}},e.plugin=A,e.default=A,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -104,3 +104,3 @@ (function (global, factory) {

template: {v:4,t:[{t:7,e:"div",m:[{n:"class",f:["rg-graph rg-graph-",{t:2,r:".type"}],t:13},{t:4,f:[{n:"class-rg-graph-h",t:13,f:[{t:2,r:"graph.horiz"}]},{n:"class-rg-graph-v",t:13,f:[{t:2,x:{r:["graph.horiz"],s:"!_0"}}]}],n:50,x:{r:[".type"],s:"_0===\"bar\""}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-circular",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-middle",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-content",g:1}],f:[{t:16,z:[{n:"selected",x:{r:"~/selected"}},{n:"hovered",x:{r:"~/hovered"}}]}]}]}],n:50,x:{r:[".type","@this.partials.content"],s:"(_0===\"donut\"||_0===\"tire\"||_0===\"hoop\")&&_1"}}," ",{t:7,e:"svg",m:[{n:"width",f:"100%",t:13,g:1},{n:"height",f:"100%",t:13,g:1},{n:"viewBox",f:"-55 -55 110 110",t:13,g:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:[{t:2,r:".d"}],t:13},{n:"class",f:["rg-chonk rg-chonk-",{t:2,r:"@index"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:"[[\"select\",_0,_1,_2]]"}},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:"[[\"hover\",_0,_1,_2]]"}}],f:[{t:4,f:[{t:7,e:"title",f:[{t:2,r:".label"}," ",{t:4,f:["(",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:"\"\\n\"+_0"}}],n:50,r:".sublabel"}]}],n:50,r:".label"}]}],n:52,r:"chonks"}]}]}],n:50,x:{r:[".type"],s:"_0===\"pie\"||_0===\"donut\"||_0===\"tire\"||_0===\"hoop\""}},{t:4,f:[{t:7,e:"svg",m:[{n:"viewBox",f:["0 0 ",{t:2,x:{r:["graph.horiz","~/span","graph.span"],s:"_0?_1:_2"}}," ",{t:2,x:{r:["graph.horiz","graph.span","~/span"],s:"_0?_1:_2"}}],t:13},{t:4,f:[{n:"style-min-height",f:[{t:2,r:"graph.span"},"px"],t:13}],n:50,r:"graph.horiz"},{t:4,f:[{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".y"},",",{t:2,r:".x"}," ",{t:2,r:".y"},",",{t:2,r:".x2"},", ",{t:2,r:".y2"},",",{t:2,r:".x2"}," ",{t:2,r:".y2"},",",{t:2,r:".x"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:"[[\"select\",_0,_1,_2]]"}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:"[[\"hover\",_0,_1,_2]]"}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:"\"\\n\"+_0"}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,i:"idx",r:".points"}],n:52,i:"grp",r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:"graph.bottom"},",0 ",{t:2,r:"graph.bottom"},",",{t:2,r:"graph.span"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:50,r:"graph.horiz"},{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".x"},",",{t:2,r:".y"}," ",{t:2,r:".x"},",",{t:2,r:".y2"},", ",{t:2,r:".x2"},",",{t:2,r:".y2"}," ",{t:2,r:".x2"},",",{t:2,r:".y"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:"[[\"select\",_0,_1,_2]]"}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:"[[\"hover\",_0,_1,_2]]"}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:"\"\\n\"+_0"}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:51,l:1}]}," "],n:50,x:{r:[".type"],s:"_0===\"bar\""},l:1},{t:4,f:[" ",{t:7,e:"svg",m:[{n:"viewBox",f:[{t:2,x:{r:["~/dot"],s:"-_0"}}," ",{t:2,x:{r:["~/span","graph.maxY","~/dot"],s:"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))"}}," ",{t:2,x:{r:["graph.span","~/dot"],s:"_0+(2*_1)"}}," ",{t:2,x:{r:["~/span","graph.maxY","graph.minY","~/dot"],s:"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))"}}],t:13},{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}," ",{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,x:{r:["graph.minX","~/dot"],s:"_0+_1"}},",",{t:2,r:"graph.bottom"}," ",{t:4,f:[{t:4,f:[{t:4,f:["S ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:50,r:"~/project"},{t:4,f:["C ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".ex"},",",{t:2,r:".ey"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1}],n:50,x:{r:["."],s:"\"sx\" in _0"}},{t:4,f:["L ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1},{t:2,x:{r:[],s:"\" \""}}],n:52,r:".points"}," L ",{t:2,r:"~/graph.maxX"},",",{t:2,r:"~/graph.bottom"}," Z"],t:13},{n:"fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:"opacity",f:"0.6",t:13}],n:50,x:{r:["~/graph.groups.length"],s:"_0>1"}},{t:4,f:[{n:"opacity",f:"0.8",t:13}],n:51,l:1},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:52,r:"graph.groups"}," ",{t:4,f:[{t:4,f:[{t:7,e:"circle",m:[{n:"r",f:[{t:2,r:"~/dot"}],t:13},{n:"cx",f:[{t:2,r:".x"}],t:13},{n:"cy",f:[{t:2,r:".y2"}],t:13},{n:"fill",f:[{t:4,f:[{t:2,r:".color"}],n:50,x:{r:["~/graph.groups.length"],s:"_0===1"}},{t:4,f:[{t:2,r:"^^/color"}],n:51,l:1}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:"[[\"select\",_0,_1,_2]]"}},{n:"stroke-width",f:"1",t:13,g:1},{n:"stroke",f:"#000",t:13,g:1},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:"[[\"hover\",_0,_1,_2]]"}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:"\"\\n\"+_0"}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}]}],n:50,x:{r:[".type"],s:"_0===\"line\""},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend",g:1}],f:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"chonks"}],n:50,x:{r:[".type"],s:"_0!==\"bar\"&&_0!==\"line\""}},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups.0.points"}," "],n:50,x:{r:[".type","graph.groups.length"],s:"_0===\"line\"&&_1===1"},l:1},{t:4,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups"}],n:51,l:1}]}],n:50,r:"~/legend"}]}],e:{"!_0":function (_0){return(!_0);},"_0===\"bar\"":function (_0){return(_0==="bar");},"(_0===\"donut\"||_0===\"tire\"||_0===\"hoop\")&&_1":function (_0,_1){return((_0==="donut"||_0==="tire"||_0==="hoop")&&_1);},"[_0.click((_1),_2,_3,_4)]":function (_0,_1,_2,_3,_4){return([_0.click((_1),_2,_3,_4)]);},"[[\"select\",_0,_1,_2]]":function (_0,_1,_2){return([["select",_0,_1,_2]]);},"[[\"hover\",_0,_1,_2]]":function (_0,_1,_2){return([["hover",_0,_1,_2]]);},"\"\\n\"+_0":function (_0){return("\n"+_0);},"_0===\"pie\"||_0===\"donut\"||_0===\"tire\"||_0===\"hoop\"":function (_0){return(_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop");},"_0?_1:_2":function (_0,_1,_2){return(_0?_1:_2);},"-_0":function (_0){return(-_0);},"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))":function (_0,_1,_2){return(Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2)));},"_0+(2*_1)":function (_0,_1){return(_0+(2*_1));},"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))":function (_0,_1,_2,_3){return(Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3)));},"_0+_1":function (_0,_1){return(_0+_1);},"\"sx\" in _0":function (_0){return("sx" in _0);},"\" \"":function (){return(" ");},"_0>1":function (_0){return(_0>1);},"_0===1":function (_0){return(_0===1);},"_0===\"line\"":function (_0){return(_0==="line");},"_0!==\"bar\"&&_0!==\"line\"":function (_0){return(_0!=="bar"&&_0!=="line");},"_0===\"line\"&&_1===1":function (_0,_1){return(_0==="line"&&_1===1);}}},
css: " .rg-graph { position: relative; display: flex; flex-direction: row; width: 100%; height: 100%; box-sizing: border-box; } .rg-graph-circular { position: relative; width: 100%; height: 0; padding-bottom: 100%; } .rg-graph-circular svg { position: absolute; left: 0; top: 0; } .rg-graph svg { box-sizing: border-box; margin-left: auto; margin-right: auto; } .rg-graph-pie .rg-chonk, .rg-graph-donut .rg-chonk, .rg-graph-tire .rg-chonk { transition: transform 0.3s ease, opacity 0.3s ease; } .rg-chonk { opacity: 0.8; user-select: none; } .rg-chonk.clicky { cursor: pointer; } .rg-graph-pie .rg-chonk:hover, .rg-graph-donut .rg-chonk:hover, .rg-graph-tire .rg-chonk:hover { transform: scale(1.1); opacity: 1; } .rg-graph-pie .rg-chonk:active, .rg-graph-donut .rg-chonk:active, .rg-graph-tire .rg-chonk:active { transform: none; } .rg-graph-hoop .rg-chonk:hover { opacity: 1; } .rg-graph-middle { position: absolute; display: flex; align-items: center; justify-content: space-around; text-align: center; } .rg-graph-middle .rg-content { display: inline-block; } .rg-graph-donut .rg-graph-middle { top: 36%; left: 36%; width: 28%; height: 28%; } .rg-graph-tire .rg-graph-middle { left: 28%; top: 28%; height: 43%; width: 43%; } .rg-graph-hoop .rg-graph-middle { left: 14%; top: 14%; width: 72%; height: 72%; } /* bar */ .rg-graph-bar.rg-graph-h { overflow-y: auto; } .rg-graph-bar.rg-graph-h svg { width: 100%; } .rg-graph-bar.rg-graph-v, .rg-graph-line { overflow-x: auto; } .rg-graph-bar.rg-graph-v svg, .rg-graph-line svg { height: 100%; } .rg-legend { display: flex; flex-direction: column; padding-left: 0.5em; justify-content: center; } .rg-legend-entry { padding: 0.25em 0 0.25em 0; line-height: 0.9em; } .rg-legend-color { display: inline-block; width: 1em; height: 1em; }",
css: " .rg-graph { position: relative; display: flex; flex-direction: row; width: 100%; height: 100%; box-sizing: border-box; } .rg-graph-circular { position: relative; width: 100%; height: 0; padding-bottom: 100%; } .rg-graph-circular svg { position: absolute; left: 0; top: 0; } .rg-graph svg { box-sizing: border-box; margin: auto; } .rg-graph-pie .rg-chonk, .rg-graph-donut .rg-chonk, .rg-graph-tire .rg-chonk { transition: transform 0.3s ease, opacity 0.3s ease; } .rg-chonk { opacity: 0.8; user-select: none; } .rg-chonk.clicky { cursor: pointer; } .rg-graph-pie .rg-chonk:hover, .rg-graph-donut .rg-chonk:hover, .rg-graph-tire .rg-chonk:hover { transform: scale(1.1); opacity: 1; } .rg-graph-pie .rg-chonk:active, .rg-graph-donut .rg-chonk:active, .rg-graph-tire .rg-chonk:active { transform: none; } .rg-graph-hoop .rg-chonk:hover { opacity: 1; } .rg-graph-middle { position: absolute; display: flex; align-items: center; justify-content: space-around; text-align: center; } .rg-graph-middle .rg-content { display: inline-block; } .rg-graph-donut .rg-graph-middle { top: 36%; left: 36%; width: 28%; height: 28%; } .rg-graph-tire .rg-graph-middle { left: 28%; top: 28%; height: 43%; width: 43%; } .rg-graph-hoop .rg-graph-middle { left: 14%; top: 14%; width: 72%; height: 72%; } /* bar */ .rg-graph-bar.rg-graph-h { overflow-y: auto; } .rg-graph-bar.rg-graph-h svg { width: 100%; } .rg-graph-bar.rg-graph-v, .rg-graph-line { overflow-x: auto; } .rg-graph-bar.rg-graph-v svg, .rg-graph-line svg { height: 100%; } .rg-legend { display: flex; flex-direction: column; padding-left: 0.5em; justify-content: center; } .rg-legend-entry { padding: 0.25em 0 0.25em 0; line-height: 0.9em; } .rg-legend-color { display: inline-block; width: 1em; height: 1em; }",
cssId: 'rchart',

@@ -107,0 +107,0 @@ noCssTransform: true,

@@ -1,1 +0,1 @@

!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],r):r(t.RauiChart={},t.Ractive)}(this,function(t,r){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;var n="undefined"!=typeof window?window:null;function e(t,r,n,e,o){var a,i,l=n||r,s=e||r,c=s.x-l.x,g=s.y2-l.y2;return a=Math.sqrt(Math.pow(c,2)+Math.pow(g,2)),i=Math.atan2(g,c),t||(i+=Math.PI),a*=o,[r.x+Math.cos(i)*a,r.y2+Math.sin(i)*a]}var o=function(t){function r(r){t.call(this,r)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r}(r);function a(t){return void 0===t&&(t={}),function(r){r.instance.components[t.name||"chart"]=o}}r.extendWith(o,{template:{v:4,t:[{t:7,e:"div",m:[{n:"class",f:["rg-graph rg-graph-",{t:2,r:".type"}],t:13},{t:4,f:[{n:"class-rg-graph-h",t:13,f:[{t:2,r:"graph.horiz"}]},{n:"class-rg-graph-v",t:13,f:[{t:2,x:{r:["graph.horiz"],s:"!_0"}}]}],n:50,x:{r:[".type"],s:'_0==="bar"'}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-circular",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-middle",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-content",g:1}],f:[{t:16,z:[{n:"selected",x:{r:"~/selected"}},{n:"hovered",x:{r:"~/hovered"}}]}]}]}],n:50,x:{r:[".type","@this.partials.content"],s:'(_0==="donut"||_0==="tire"||_0==="hoop")&&_1'}}," ",{t:7,e:"svg",m:[{n:"width",f:"100%",t:13,g:1},{n:"height",f:"100%",t:13,g:1},{n:"viewBox",f:"-55 -55 110 110",t:13,g:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:[{t:2,r:".d"}],t:13},{n:"class",f:["rg-chonk rg-chonk-",{t:2,r:"@index"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:4,f:[{t:7,e:"title",f:[{t:2,r:".label"}," ",{t:4,f:["(",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}]}],n:50,r:".label"}]}],n:52,r:"chonks"}]}]}],n:50,x:{r:[".type"],s:'_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"'}},{t:4,f:[{t:7,e:"svg",m:[{n:"viewBox",f:["0 0 ",{t:2,x:{r:["graph.horiz","~/span","graph.span"],s:"_0?_1:_2"}}," ",{t:2,x:{r:["graph.horiz","graph.span","~/span"],s:"_0?_1:_2"}}],t:13},{t:4,f:[{n:"style-min-height",f:[{t:2,r:"graph.span"},"px"],t:13}],n:50,r:"graph.horiz"},{t:4,f:[{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".y"},",",{t:2,r:".x"}," ",{t:2,r:".y"},",",{t:2,r:".x2"},", ",{t:2,r:".y2"},",",{t:2,r:".x2"}," ",{t:2,r:".y2"},",",{t:2,r:".x"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,i:"idx",r:".points"}],n:52,i:"grp",r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:"graph.bottom"},",0 ",{t:2,r:"graph.bottom"},",",{t:2,r:"graph.span"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:50,r:"graph.horiz"},{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".x"},",",{t:2,r:".y"}," ",{t:2,r:".x"},",",{t:2,r:".y2"},", ",{t:2,r:".x2"},",",{t:2,r:".y2"}," ",{t:2,r:".x2"},",",{t:2,r:".y"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:51,l:1}]}," "],n:50,x:{r:[".type"],s:'_0==="bar"'},l:1},{t:4,f:[" ",{t:7,e:"svg",m:[{n:"viewBox",f:[{t:2,x:{r:["~/dot"],s:"-_0"}}," ",{t:2,x:{r:["~/span","graph.maxY","~/dot"],s:"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))"}}," ",{t:2,x:{r:["graph.span","~/dot"],s:"_0+(2*_1)"}}," ",{t:2,x:{r:["~/span","graph.maxY","graph.minY","~/dot"],s:"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))"}}],t:13},{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}," ",{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,x:{r:["graph.minX","~/dot"],s:"_0+_1"}},",",{t:2,r:"graph.bottom"}," ",{t:4,f:[{t:4,f:[{t:4,f:["S ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:50,r:"~/project"},{t:4,f:["C ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".ex"},",",{t:2,r:".ey"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1}],n:50,x:{r:["."],s:'"sx" in _0'}},{t:4,f:["L ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1},{t:2,x:{r:[],s:'" "'}}],n:52,r:".points"}," L ",{t:2,r:"~/graph.maxX"},",",{t:2,r:"~/graph.bottom"}," Z"],t:13},{n:"fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:"opacity",f:"0.6",t:13}],n:50,x:{r:["~/graph.groups.length"],s:"_0>1"}},{t:4,f:[{n:"opacity",f:"0.8",t:13}],n:51,l:1},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:52,r:"graph.groups"}," ",{t:4,f:[{t:4,f:[{t:7,e:"circle",m:[{n:"r",f:[{t:2,r:"~/dot"}],t:13},{n:"cx",f:[{t:2,r:".x"}],t:13},{n:"cy",f:[{t:2,r:".y2"}],t:13},{n:"fill",f:[{t:4,f:[{t:2,r:".color"}],n:50,x:{r:["~/graph.groups.length"],s:"_0===1"}},{t:4,f:[{t:2,r:"^^/color"}],n:51,l:1}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:"stroke-width",f:"1",t:13,g:1},{n:"stroke",f:"#000",t:13,g:1},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}]}],n:50,x:{r:[".type"],s:'_0==="line"'},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend",g:1}],f:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"chonks"}],n:50,x:{r:[".type"],s:'_0!=="bar"&&_0!=="line"'}},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups.0.points"}," "],n:50,x:{r:[".type","graph.groups.length"],s:'_0==="line"&&_1===1'},l:1},{t:4,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups"}],n:51,l:1}]}],n:50,r:"~/legend"}]}],e:{"!_0":function(t){return!t},'_0==="bar"':function(t){return"bar"===t},'(_0==="donut"||_0==="tire"||_0==="hoop")&&_1':function(t,r){return("donut"===t||"tire"===t||"hoop"===t)&&r},"[_0.click((_1),_2,_3,_4)]":function(t,r,n,e,o){return[t.click(r,n,e,o)]},'[["select",_0,_1,_2]]':function(t,r,n){return[["select",t,r,n]]},'[["hover",_0,_1,_2]]':function(t,r,n){return[["hover",t,r,n]]},'"\\n"+_0':function(t){return"\n"+t},'_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"':function(t){return"pie"===t||"donut"===t||"tire"===t||"hoop"===t},"_0?_1:_2":function(t,r,n){return t?r:n},"-_0":function(t){return-t},"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))":function(t,r,n){return Math.min(-2*n,t+2*n-r-2*n)},"_0+(2*_1)":function(t,r){return t+2*r},"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))":function(t,r,n,e){return Math.max(t+4*e,r+-1*Math.min(n,0)+4*e)},"_0+_1":function(t,r){return t+r},'"sx" in _0':function(t){return"sx"in t},'" "':function(){return" "},"_0>1":function(t){return t>1},"_0===1":function(t){return 1===t},'_0==="line"':function(t){return"line"===t},'_0!=="bar"&&_0!=="line"':function(t){return"bar"!==t&&"line"!==t},'_0==="line"&&_1===1':function(t,r){return"line"===t&&1===r}}},css:" .rg-graph { position: relative; display: flex; flex-direction: row; width: 100%; height: 100%; box-sizing: border-box; } .rg-graph-circular { position: relative; width: 100%; height: 0; padding-bottom: 100%; } .rg-graph-circular svg { position: absolute; left: 0; top: 0; } .rg-graph svg { box-sizing: border-box; margin-left: auto; margin-right: auto; } .rg-graph-pie .rg-chonk, .rg-graph-donut .rg-chonk, .rg-graph-tire .rg-chonk { transition: transform 0.3s ease, opacity 0.3s ease; } .rg-chonk { opacity: 0.8; user-select: none; } .rg-chonk.clicky { cursor: pointer; } .rg-graph-pie .rg-chonk:hover, .rg-graph-donut .rg-chonk:hover, .rg-graph-tire .rg-chonk:hover { transform: scale(1.1); opacity: 1; } .rg-graph-pie .rg-chonk:active, .rg-graph-donut .rg-chonk:active, .rg-graph-tire .rg-chonk:active { transform: none; } .rg-graph-hoop .rg-chonk:hover { opacity: 1; } .rg-graph-middle { position: absolute; display: flex; align-items: center; justify-content: space-around; text-align: center; } .rg-graph-middle .rg-content { display: inline-block; } .rg-graph-donut .rg-graph-middle { top: 36%; left: 36%; width: 28%; height: 28%; } .rg-graph-tire .rg-graph-middle { left: 28%; top: 28%; height: 43%; width: 43%; } .rg-graph-hoop .rg-graph-middle { left: 14%; top: 14%; width: 72%; height: 72%; } /* bar */ .rg-graph-bar.rg-graph-h { overflow-y: auto; } .rg-graph-bar.rg-graph-h svg { width: 100%; } .rg-graph-bar.rg-graph-v, .rg-graph-line { overflow-x: auto; } .rg-graph-bar.rg-graph-v svg, .rg-graph-line svg { height: 100%; } .rg-legend { display: flex; flex-direction: column; padding-left: 0.5em; justify-content: center; } .rg-legend-entry { padding: 0.25em 0 0.25em 0; line-height: 0.9em; } .rg-legend-color { display: inline-block; width: 1em; height: 1em; }",cssId:"rchart",noCssTransform:!0,attributes:["data","type","horizontal","colors","point","space","flip","dot","smooth","project","span","sub","legend","hole","clustergap","nolabelvalue"],computed:{chonks:function(){var t=this.get("data");Array.isArray(t)?Array.isArray(t[0])&&(t=t[0]):t=[];var r=t.reduce(function(t,r){return t+Math.abs(r.value)},0),n=this.get("type"),e=this.get("colors"),o=this.get("hole")||("pie"===n?0:"donut"===n?15:"tire"===n?25:40),a=0;return t.map(function(t,n){var i=Math.abs(t.value)/r,l=Object.assign({idx:n,percent:i,d:function(t,r,n,e){var o=360*(n>1?n/100:n)*(Math.PI/180),a=Math.cos(o),i=Math.sin(o);e>1&&(e/=100),e>=1&&(e=.99995);var l=360*e*(Math.PI/180),s=Math.cos(l),c=Math.sin(l),g=[0*a-t*i,0*i+t*a],f=[0*a-r*i,0*i+r*a],u=[g[0]*s-g[1]*c,g[0]*c+g[1]*s],p=[f[0]*s-f[1]*c,f[0]*c+f[1]*s],h=e<.5?["0 0 1","0 0 0"]:["0 1 1","0 1 0"];return"M "+g[0]+","+g[1]+" "+f[0]+","+f[1]+" A "+Math.abs(r)+","+Math.abs(r)+" "+h[0]+" "+p[0]+","+p[1]+" L "+u[0]+","+u[1]+" A "+Math.abs(t)+","+Math.abs(t)+" "+h[1]+" "+g[0]+","+g[1]+" Z"}(o,50,a,i),point:t},t);return l.color||(l.color=e[n%e.length]),a+=i,l})},graph:function(){var t=this,r=this.get("data");Array.isArray(r)||(r=[[]]),Array.isArray(r[0])||(r=[r]);var n,o=this.get("type"),a=r.reduce(function(t,r){return r.reduce(function(r,n){return n.value<t[0]&&(t[0]=n.value),n.value>t[1]&&(t[1]=n.value),t},0)},[0,0]),i=a[0],l=a[1],s=this.get("dot")||1,c=l-i,g=i<0?-1*i:-i,f=this.get("colors"),u=this.get("point"),p="line"===o?0:this.get("space"),h=this.get("horizontal"),d=h?this.get("flip"):!this.get("flip"),_=this.get("span"),v="line"===o&&this.get("smooth"),m=this.get("project");if("line"===o)n=r.map(function(t){return t.map(function(r,n){var e=Object.assign({x:n*u+n*p+p,y:g/c*_,y2:(r.value+g)/c*_,idx:n,point:r},r);if(e.x2=e.x+u,e.comp=e.y2,e.x+=s,e.x2+=s,v&&m&&n>0&&n+1<t.length){var o=(t[n-1].value+g)/c*_,a=(o+(t[n+1].value+g)/c*_+e.comp)/6;o>e.comp?e.comp=e.comp-a:e.comp=e.comp+a}return d&&(e.y=_-e.y,e.y2=_-e.y2),e.color||(e.color=f[n%f.length]),e})}),v&&n.forEach(function(t,r){t.forEach(function(r,n){var o,a;0!==n&&(o=e(!0,t[n-1],t[n-2],r,v),r.sx=o[0],r.sy=o[1],a=e(!1,r,t[n-1],t[n+1],v),r.ex=a[0],r.ey=a[1])})});else{var b=!1,x=r;1===r.length&&Array.isArray(r[0])&&(b=!0,r=r[0].map(function(t){return r[0]}));var y=u/r.length,k=this.get("sub")||"cluster",M=this.get("clustergap")||0;n=r.map(function(t,n){var e=t.map(function(t,e){return r[e]&&r[e][n]||{value:0}}).map(function(t,r){var e=Object.assign({x:n*u+n*p+p,y:g/c*_,y2:(t.value+g)/c*_,idx:n,point:t},t,{label:b?x[0][n].label:t.label});return e.x2=e.x+u,e.comp=e.y2,b||"cluster"!==k||(e.x+=y*r,e.x2=e.x+y-M),d&&(e.y=_-e.y,e.y2=_-e.y2),e.color||(e.color=f[(b?n:r)%f.length]),e});return"stack"===k&&e.sort(function(t,r){return t.value>r.value?-1:t.value<r.value?1:0}),e})}var w=n.map(function(n,e){var a={points:n,color:f[e%f.length]},i="bar"===o&&"stack"===t.get("sub")?r[e]:n;return i&&i[e]&&i[e].label&&(a.label=i[e].label),a});"line"===o&&(w.sort(function(t,r){var n=t.points.reduce(function(t,r){return t+r.value},0)/t.points.length,e=r.points.reduce(function(t,r){return t+r.value},0)/r.points.length;return n<e?1:n>e?-1:0}),w.forEach(function(t,r){return t.color=f[r%f.length]}));var A=r.reduce(function(t,r){return r.length>t?r.length:t},0);return{bottom:d?_-g/c*_:g/c*_,min:i,max:l,horiz:"line"!==o&&h,flip:d,span:("line"===o?A-1:A)*u+(A+2)*p+("line"===o?2*s:0),minX:n.reduce(function(t,r){return r.reduce(function(t,r){return r.x<t?r.x:t},t)},0),maxX:n.reduce(function(t,r){return r.reduce(function(t,r){return r.x>t?r.x:t},t)},0),minY:n.reduce(function(t,r){return r.reduce(function(t,r){return r.comp<t?r.comp:t},t)},0),maxY:n.reduce(function(t,r){return r.reduce(function(t,r){return r.comp>t?r.comp:t},t)},0),groups:w}}},data:function(){return{colors:["#1f5b93","#F8D306","#03aa0f","#d21a1a","#2DD3C7","#633294","#FB4700"],point:30,space:5,dot:3,span:200,color:"#1f5b93"}},on:{construct:function(){var t=this.component;if(t){var r=(t.template.f||[]).find(function(t){return"svg"===t.e});r&&(this._svgA=r.m)}},config:function(){this._svgA&&this.set("svgA",this._svgA)}}}),function(t,r,e){if(n&&n.Ractive&&"object"==typeof n.Ractive[r]){var o=document.currentScript;if(o||(o=(o=document.querySelectorAll("script"))[o.length-1]),o){var a=o.getAttribute("data-alias");a&&(a=(a=a.split("&")).reduce(function(t,r){var n=r.split("="),e=n[0],o=n[1];return t[e]=o,t},{})),Ractive[r][a&&a[t]||t]=e}}}("RauiChart","components",o),t.Chart=o,t.plugin=a,t.default=a,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],r):r(t.RauiChart={},t.Ractive)}(this,function(t,r){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;var n="undefined"!=typeof window?window:null;function e(t,r,n,e,o){var a,i,l=n||r,s=e||r,c=s.x-l.x,g=s.y2-l.y2;return a=Math.sqrt(Math.pow(c,2)+Math.pow(g,2)),i=Math.atan2(g,c),t||(i+=Math.PI),a*=o,[r.x+Math.cos(i)*a,r.y2+Math.sin(i)*a]}var o=function(t){function r(r){t.call(this,r)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r}(r);function a(t){return void 0===t&&(t={}),function(r){r.instance.components[t.name||"chart"]=o}}r.extendWith(o,{template:{v:4,t:[{t:7,e:"div",m:[{n:"class",f:["rg-graph rg-graph-",{t:2,r:".type"}],t:13},{t:4,f:[{n:"class-rg-graph-h",t:13,f:[{t:2,r:"graph.horiz"}]},{n:"class-rg-graph-v",t:13,f:[{t:2,x:{r:["graph.horiz"],s:"!_0"}}]}],n:50,x:{r:[".type"],s:'_0==="bar"'}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-circular",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-graph-middle",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-content",g:1}],f:[{t:16,z:[{n:"selected",x:{r:"~/selected"}},{n:"hovered",x:{r:"~/hovered"}}]}]}]}],n:50,x:{r:[".type","@this.partials.content"],s:'(_0==="donut"||_0==="tire"||_0==="hoop")&&_1'}}," ",{t:7,e:"svg",m:[{n:"width",f:"100%",t:13,g:1},{n:"height",f:"100%",t:13,g:1},{n:"viewBox",f:"-55 -55 110 110",t:13,g:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:[{t:2,r:".d"}],t:13},{n:"class",f:["rg-chonk rg-chonk-",{t:2,r:"@index"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:4,f:[{t:7,e:"title",f:[{t:2,r:".label"}," ",{t:4,f:["(",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}]}],n:50,r:".label"}]}],n:52,r:"chonks"}]}]}],n:50,x:{r:[".type"],s:'_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"'}},{t:4,f:[{t:7,e:"svg",m:[{n:"viewBox",f:["0 0 ",{t:2,x:{r:["graph.horiz","~/span","graph.span"],s:"_0?_1:_2"}}," ",{t:2,x:{r:["graph.horiz","graph.span","~/span"],s:"_0?_1:_2"}}],t:13},{t:4,f:[{n:"style-min-height",f:[{t:2,r:"graph.span"},"px"],t:13}],n:50,r:"graph.horiz"},{t:4,f:[{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".y"},",",{t:2,r:".x"}," ",{t:2,r:".y"},",",{t:2,r:".x2"},", ",{t:2,r:".y2"},",",{t:2,r:".x2"}," ",{t:2,r:".y2"},",",{t:2,r:".x"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,i:"idx",r:".points"}],n:52,i:"grp",r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:"graph.bottom"},",0 ",{t:2,r:"graph.bottom"},",",{t:2,r:"graph.span"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:50,r:"graph.horiz"},{t:4,f:[{t:4,f:[{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,r:".x"},",",{t:2,r:".y"}," ",{t:2,r:".x"},",",{t:2,r:".y2"},", ",{t:2,r:".x2"},",",{t:2,r:".y2"}," ",{t:2,r:".x2"},",",{t:2,r:".y"}," Z"],t:13},{n:"style-fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}," ",{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:51,l:1}]}," "],n:50,x:{r:[".type"],s:'_0==="bar"'},l:1},{t:4,f:[" ",{t:7,e:"svg",m:[{n:"viewBox",f:[{t:2,x:{r:["~/dot"],s:"-_0"}}," ",{t:2,x:{r:["~/span","graph.maxY","~/dot"],s:"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))"}}," ",{t:2,x:{r:["graph.span","~/dot"],s:"_0+(2*_1)"}}," ",{t:2,x:{r:["~/span","graph.maxY","graph.minY","~/dot"],s:"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))"}}],t:13},{n:"style-min-width",f:[{t:2,r:"graph.span"},"px"],t:13},{t:4,f:[{t:16,r:"svgA"}],n:50,r:"~/svgA"}],f:[{t:7,e:"path",m:[{n:"d",f:["M 0,",{t:2,r:"graph.bottom"}," ",{t:2,r:"graph.span"},",",{t:2,r:"graph.bottom"}," Z"],t:13},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}," ",{t:4,f:[{t:7,e:"path",m:[{n:"d",f:["M ",{t:2,x:{r:["graph.minX","~/dot"],s:"_0+_1"}},",",{t:2,r:"graph.bottom"}," ",{t:4,f:[{t:4,f:[{t:4,f:["S ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:50,r:"~/project"},{t:4,f:["C ",{t:2,r:".sx"},",",{t:2,r:".sy"}," ",{t:2,r:".ex"},",",{t:2,r:".ey"}," ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1}],n:50,x:{r:["."],s:'"sx" in _0'}},{t:4,f:["L ",{t:2,r:".x"},",",{t:2,r:".y2"}],n:51,l:1},{t:2,x:{r:[],s:'" "'}}],n:52,r:".points"}," L ",{t:2,r:"~/graph.maxX"},",",{t:2,r:"~/graph.bottom"}," Z"],t:13},{n:"fill",f:[{t:2,r:".color"}],t:13},{t:4,f:[{n:"opacity",f:"0.6",t:13}],n:50,x:{r:["~/graph.groups.length"],s:"_0>1"}},{t:4,f:[{n:"opacity",f:"0.8",t:13}],n:51,l:1},{n:"stroke",f:"#000",t:13,g:1},{n:"stroke-width",f:"1",t:13,g:1}]}],n:52,r:"graph.groups"}," ",{t:4,f:[{t:4,f:[{t:7,e:"circle",m:[{n:"r",f:[{t:2,r:"~/dot"}],t:13},{n:"cx",f:[{t:2,r:".x"}],t:13},{n:"cy",f:[{t:2,r:".y2"}],t:13},{n:"fill",f:[{t:4,f:[{t:2,r:".color"}],n:50,x:{r:["~/graph.groups.length"],s:"_0===1"}},{t:4,f:[{t:2,r:"^^/color"}],n:51,l:1}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:[".","@context",".value",".label",".point"],s:"[_0.click((_1),_2,_3,_4)]"}}],n:50,r:".click"},{n:["click"],t:70,f:{r:[".value",".label",".point"],s:'[["select",_0,_1,_2]]'}},{n:"stroke-width",f:"1",t:13,g:1},{n:"stroke",f:"#000",t:13,g:1},{n:["mouseenter"],t:70,f:{r:[".value",".label",".point"],s:'[["hover",_0,_1,_2]]'}}],f:[{t:7,e:"title",f:[{t:4,f:[{t:2,r:".label"},{t:4,f:[" (",{t:2,r:".value"},")"],n:51,r:"~/nolabelvalue"},{t:4,f:[{t:2,x:{r:[".sublabel"],s:'"\\n"+_0'}}],n:50,r:".sublabel"}],n:50,r:".label"},{t:4,f:[{t:2,r:".value"}],n:51,l:1}]}]}],n:52,r:".points"}],n:52,r:"graph.groups"}]}],n:50,x:{r:[".type"],s:'_0==="line"'},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend",g:1}],f:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"chonks"}],n:50,x:{r:[".type"],s:'_0!=="bar"&&_0!=="line"'}},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups.0.points"}," "],n:50,x:{r:[".type","graph.groups.length"],s:'_0==="line"&&_1===1'},l:1},{t:4,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-entry",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rg-legend-color",g:1},{n:"style",f:["background-color: ",{t:2,r:".color"},";"],t:13}]}," ",{t:2,r:".label"}]}],n:52,r:"graph.groups"}],n:51,l:1}]}],n:50,r:"~/legend"}]}],e:{"!_0":function(t){return!t},'_0==="bar"':function(t){return"bar"===t},'(_0==="donut"||_0==="tire"||_0==="hoop")&&_1':function(t,r){return("donut"===t||"tire"===t||"hoop"===t)&&r},"[_0.click((_1),_2,_3,_4)]":function(t,r,n,e,o){return[t.click(r,n,e,o)]},'[["select",_0,_1,_2]]':function(t,r,n){return[["select",t,r,n]]},'[["hover",_0,_1,_2]]':function(t,r,n){return[["hover",t,r,n]]},'"\\n"+_0':function(t){return"\n"+t},'_0==="pie"||_0==="donut"||_0==="tire"||_0==="hoop"':function(t){return"pie"===t||"donut"===t||"tire"===t||"hoop"===t},"_0?_1:_2":function(t,r,n){return t?r:n},"-_0":function(t){return-t},"Math.min(_2*-2,((_0+(2*_2))-_1)-(2*_2))":function(t,r,n){return Math.min(-2*n,t+2*n-r-2*n)},"_0+(2*_1)":function(t,r){return t+2*r},"Math.max(_0+(4*_3),_1+(-1*Math.min(_2,0))+(4*_3))":function(t,r,n,e){return Math.max(t+4*e,r+-1*Math.min(n,0)+4*e)},"_0+_1":function(t,r){return t+r},'"sx" in _0':function(t){return"sx"in t},'" "':function(){return" "},"_0>1":function(t){return t>1},"_0===1":function(t){return 1===t},'_0==="line"':function(t){return"line"===t},'_0!=="bar"&&_0!=="line"':function(t){return"bar"!==t&&"line"!==t},'_0==="line"&&_1===1':function(t,r){return"line"===t&&1===r}}},css:" .rg-graph { position: relative; display: flex; flex-direction: row; width: 100%; height: 100%; box-sizing: border-box; } .rg-graph-circular { position: relative; width: 100%; height: 0; padding-bottom: 100%; } .rg-graph-circular svg { position: absolute; left: 0; top: 0; } .rg-graph svg { box-sizing: border-box; margin: auto; } .rg-graph-pie .rg-chonk, .rg-graph-donut .rg-chonk, .rg-graph-tire .rg-chonk { transition: transform 0.3s ease, opacity 0.3s ease; } .rg-chonk { opacity: 0.8; user-select: none; } .rg-chonk.clicky { cursor: pointer; } .rg-graph-pie .rg-chonk:hover, .rg-graph-donut .rg-chonk:hover, .rg-graph-tire .rg-chonk:hover { transform: scale(1.1); opacity: 1; } .rg-graph-pie .rg-chonk:active, .rg-graph-donut .rg-chonk:active, .rg-graph-tire .rg-chonk:active { transform: none; } .rg-graph-hoop .rg-chonk:hover { opacity: 1; } .rg-graph-middle { position: absolute; display: flex; align-items: center; justify-content: space-around; text-align: center; } .rg-graph-middle .rg-content { display: inline-block; } .rg-graph-donut .rg-graph-middle { top: 36%; left: 36%; width: 28%; height: 28%; } .rg-graph-tire .rg-graph-middle { left: 28%; top: 28%; height: 43%; width: 43%; } .rg-graph-hoop .rg-graph-middle { left: 14%; top: 14%; width: 72%; height: 72%; } /* bar */ .rg-graph-bar.rg-graph-h { overflow-y: auto; } .rg-graph-bar.rg-graph-h svg { width: 100%; } .rg-graph-bar.rg-graph-v, .rg-graph-line { overflow-x: auto; } .rg-graph-bar.rg-graph-v svg, .rg-graph-line svg { height: 100%; } .rg-legend { display: flex; flex-direction: column; padding-left: 0.5em; justify-content: center; } .rg-legend-entry { padding: 0.25em 0 0.25em 0; line-height: 0.9em; } .rg-legend-color { display: inline-block; width: 1em; height: 1em; }",cssId:"rchart",noCssTransform:!0,attributes:["data","type","horizontal","colors","point","space","flip","dot","smooth","project","span","sub","legend","hole","clustergap","nolabelvalue"],computed:{chonks:function(){var t=this.get("data");Array.isArray(t)?Array.isArray(t[0])&&(t=t[0]):t=[];var r=t.reduce(function(t,r){return t+Math.abs(r.value)},0),n=this.get("type"),e=this.get("colors"),o=this.get("hole")||("pie"===n?0:"donut"===n?15:"tire"===n?25:40),a=0;return t.map(function(t,n){var i=Math.abs(t.value)/r,l=Object.assign({idx:n,percent:i,d:function(t,r,n,e){var o=360*(n>1?n/100:n)*(Math.PI/180),a=Math.cos(o),i=Math.sin(o);e>1&&(e/=100),e>=1&&(e=.99995);var l=360*e*(Math.PI/180),s=Math.cos(l),c=Math.sin(l),g=[0*a-t*i,0*i+t*a],f=[0*a-r*i,0*i+r*a],u=[g[0]*s-g[1]*c,g[0]*c+g[1]*s],p=[f[0]*s-f[1]*c,f[0]*c+f[1]*s],h=e<.5?["0 0 1","0 0 0"]:["0 1 1","0 1 0"];return"M "+g[0]+","+g[1]+" "+f[0]+","+f[1]+" A "+Math.abs(r)+","+Math.abs(r)+" "+h[0]+" "+p[0]+","+p[1]+" L "+u[0]+","+u[1]+" A "+Math.abs(t)+","+Math.abs(t)+" "+h[1]+" "+g[0]+","+g[1]+" Z"}(o,50,a,i),point:t},t);return l.color||(l.color=e[n%e.length]),a+=i,l})},graph:function(){var t=this,r=this.get("data");Array.isArray(r)||(r=[[]]),Array.isArray(r[0])||(r=[r]);var n,o=this.get("type"),a=r.reduce(function(t,r){return r.reduce(function(r,n){return n.value<t[0]&&(t[0]=n.value),n.value>t[1]&&(t[1]=n.value),t},0)},[0,0]),i=a[0],l=a[1],s=this.get("dot")||1,c=l-i,g=i<0?-1*i:-i,f=this.get("colors"),u=this.get("point"),p="line"===o?0:this.get("space"),h=this.get("horizontal"),d=h?this.get("flip"):!this.get("flip"),_=this.get("span"),v="line"===o&&this.get("smooth"),m=this.get("project");if("line"===o)n=r.map(function(t){return t.map(function(r,n){var e=Object.assign({x:n*u+n*p+p,y:g/c*_,y2:(r.value+g)/c*_,idx:n,point:r},r);if(e.x2=e.x+u,e.comp=e.y2,e.x+=s,e.x2+=s,v&&m&&n>0&&n+1<t.length){var o=(t[n-1].value+g)/c*_,a=(o+(t[n+1].value+g)/c*_+e.comp)/6;o>e.comp?e.comp=e.comp-a:e.comp=e.comp+a}return d&&(e.y=_-e.y,e.y2=_-e.y2),e.color||(e.color=f[n%f.length]),e})}),v&&n.forEach(function(t,r){t.forEach(function(r,n){var o,a;0!==n&&(o=e(!0,t[n-1],t[n-2],r,v),r.sx=o[0],r.sy=o[1],a=e(!1,r,t[n-1],t[n+1],v),r.ex=a[0],r.ey=a[1])})});else{var b=!1,x=r;1===r.length&&Array.isArray(r[0])&&(b=!0,r=r[0].map(function(t){return r[0]}));var y=u/r.length,k=this.get("sub")||"cluster",M=this.get("clustergap")||0;n=r.map(function(t,n){var e=t.map(function(t,e){return r[e]&&r[e][n]||{value:0}}).map(function(t,r){var e=Object.assign({x:n*u+n*p+p,y:g/c*_,y2:(t.value+g)/c*_,idx:n,point:t},t,{label:b?x[0][n].label:t.label});return e.x2=e.x+u,e.comp=e.y2,b||"cluster"!==k||(e.x+=y*r,e.x2=e.x+y-M),d&&(e.y=_-e.y,e.y2=_-e.y2),e.color||(e.color=f[(b?n:r)%f.length]),e});return"stack"===k&&e.sort(function(t,r){return t.value>r.value?-1:t.value<r.value?1:0}),e})}var w=n.map(function(n,e){var a={points:n,color:f[e%f.length]},i="bar"===o&&"stack"===t.get("sub")?r[e]:n;return i&&i[e]&&i[e].label&&(a.label=i[e].label),a});"line"===o&&(w.sort(function(t,r){var n=t.points.reduce(function(t,r){return t+r.value},0)/t.points.length,e=r.points.reduce(function(t,r){return t+r.value},0)/r.points.length;return n<e?1:n>e?-1:0}),w.forEach(function(t,r){return t.color=f[r%f.length]}));var A=r.reduce(function(t,r){return r.length>t?r.length:t},0);return{bottom:d?_-g/c*_:g/c*_,min:i,max:l,horiz:"line"!==o&&h,flip:d,span:("line"===o?A-1:A)*u+(A+2)*p+("line"===o?2*s:0),minX:n.reduce(function(t,r){return r.reduce(function(t,r){return r.x<t?r.x:t},t)},0),maxX:n.reduce(function(t,r){return r.reduce(function(t,r){return r.x>t?r.x:t},t)},0),minY:n.reduce(function(t,r){return r.reduce(function(t,r){return r.comp<t?r.comp:t},t)},0),maxY:n.reduce(function(t,r){return r.reduce(function(t,r){return r.comp>t?r.comp:t},t)},0),groups:w}}},data:function(){return{colors:["#1f5b93","#F8D306","#03aa0f","#d21a1a","#2DD3C7","#633294","#FB4700"],point:30,space:5,dot:3,span:200,color:"#1f5b93"}},on:{construct:function(){var t=this.component;if(t){var r=(t.template.f||[]).find(function(t){return"svg"===t.e});r&&(this._svgA=r.m)}},config:function(){this._svgA&&this.set("svgA",this._svgA)}}}),function(t,r,e){if(n&&n.Ractive&&"object"==typeof n.Ractive[r]){var o=document.currentScript;if(o||(o=(o=document.querySelectorAll("script"))[o.length-1]),o){var a=o.getAttribute("data-alias");a&&(a=(a=a.split("&")).reduce(function(t,r){var n=r.split("="),e=n[0],o=n[1];return t[e]=o,t},{})),Ractive[r][a&&a[t]||t]=e}}}("RauiChart","components",o),t.Chart=o,t.plugin=a,t.default=a,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -366,2 +366,3 @@ (function (global, factory) {

g.value = +v;
if (g.type === 'M') { g.value--; }
}

@@ -368,0 +369,0 @@ }

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RauiDate={})}(this,function(e){"use strict";var t=/[^\d]+/,n=/[^\d_]+/,a="_",l={y:0,M:1,d:2,H:3,m:4,s:5,S:6};function u(e,t,n){void 0===n&&(n="0");for(var a=null==e?"":""+e,l=a.length;l<t;l++)a=n+a;return a}function r(e,t,n){void 0===n&&(n="0");for(var a=null==e?"":""+e,l=a.length;l<t;l++)a+=n;return a}var i={mask:"yyyy-MM-dd",time:[0,0,0,0],date:function(){var e=new Date,t=i.time;return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t[0],t[1],t[2],t[3])},parseDate:function(e){return new Date(e)}};function s(e){if("start"===e)e=[0,0,0,0];else if("end"===e)e=[23,59,59,999];else if("mid"===e)e=[12,0,0,0];else if("now"===e)e=function(){var e=new Date;return[e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]};else if("string"==typeof e){var t=new Date("2000-05-13T"+e+"Z");+t&&(e=[t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()])}return Array.isArray(e)||"function"==typeof e||Array.isArray(e())||(e=[0,0,0,0]),e}function o(e,t,n){var a=t.value,l=d(e,t.selectionStart),u=0,r=e[u],i=e[u+1];e.forEach(function(e){return e.input=""});for(var s=0;s<a.length;s++)i&&a[s]===i.prefix[0]&&(l!==r||r.input.length>=r.length||a.length-s<n.length-r.end+(r.length-r.input.length))?(i.prefix.length>1&&(s+=i.prefix.length-1),a[s+1]===i.prefix[0]&&(s+=i.prefix.length),r=e[++u],i=e[u+1]):r.input+=a[s]}function v(e,l,i,s){void 0===i&&(i=0),void 0===s&&(s=!1);for(var o=!1,v=0;v<e.length;v++){var f=e[v],c=(f.input||"").replace(t,""),p=e[v+1]&&e[v+1].prefix&&n.test(f.input);if(c.length>f.length&&f===l){var d=c.length-l.length;c=c.substr(0,i-l.start)+c.substr(i-l.start+d)}else c=c.substr(0,f.length);if(f.input=c,"y"===f.type&&0===c.length&&(p||s))f.value=(new Date).getFullYear(),f.input=f.display=u(f.value,f.length),o=!0;else if("m"===f.type&&0===c.length&&(p||s))f.value=0,f.input=f.display=u(f.value,f.length),o=!0;else if("d"===f.type&&c.length!==f.length&&s)f.value=+c,f.display=g(f);else if(""===c)f.value=null,f.display=g(f);else if(f!==l)f.value=+c,"M"===f.type&&f.value--,f.display=g(f);else if("M"===f.type&&+c>1||"d"===f.type&&+c>3||"H"===f.type&&+c>2||("m"===f.type||"s"===f.type)&&+c>6)f.value=+c,"M"===f.type&&f.value--,f.display=u(c,f.length),o=!0;else if("y"===f.type&&2===c.length&&(p||s)){var y=(new Date).getFullYear(),h=100*Math.floor(y/100),m=Math.abs(y-(h+ +c))<20?h+ +c:h-100+ +c;f.value=m,f.input=f.display=u(m,f.length),o=!0}else f.display=r(c,f.length,a),f.value=+c}return o}function f(e,t,n){var a=(t=e.value=t&&M(t,n))?[t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]:[null,null,null,null,null,null,null];e.forEach(function(e){e.value=a[l[e.type]],e.input=e.display=g(e)})}function c(e,t,n,a,u){var r=e.value||a(),i=[r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()];if(!e.find(function(e){return"m"===e.type||"s"===e.type||"h"===e.type||"S"===e.type})){"function"==typeof u&&(u=u());for(var s=0;s<4;s++)i[s+3]=u[s]}if(e.forEach(function(e){var t=e.value;null!==t&&"M"===e.type?t<0?t=0:t>11&&(t=11):null===t||"m"!==e.type&&"s"!==e.type?null!==t&&"H"===e.type?t<0?t=0:t>23&&(t=23):null!==t&&"h"===e.type&&(t<1?t=1:t>12&&(t=12)):t<0?t=0:t>59&&(t=59),t!==e.value&&(e.value=t,e.display=g(e)),i[l[e.type]]=e.value}),null!==i[0]&&null!==i[1]&&null!==i[2]){var o=e.find(function(e){return"d"===e.type});if(o)if(i[2]<1)o.value=i[2]=1,o.display=g(o);else{var v=b(new Date(i[0],i[1],1));i[2]>v&&(o.value=i[2]=v,o.display=o.input=g(o))}}e.find(function(e){return null===e.value})||0===i[0]||i[1]>11||i[1]<0||0===i[2]?e.value=null:(i.unshift(null),e.value=new(Date.bind.apply(Date,i))),t(n)}function p(e,t){t.value=e.reduce(function(e,t){return e+t.prefix+t.display},"")+e.suffix}function d(e,t){return e.find(function(e){return t>=e.start&&t<=e.end})}function g(e){if(null===e.value)return u("",e.length,a);switch(e.type){case"y":return e.value?e.length<=2?(""+e.value).substr(2,2):""+u(e.value,e.length):u("",e.length,a);case"M":return~e.value?1===e.length?""+(e.value+1):2===e.length?(e.value<9?"0":"")+(e.value+1):3===e.length?h[e.value].substr(0,3):h[e.value]:u("",e.length,a);case"d":return e.value?1===e.length?""+e.value:2===e.length?(e.value<=9?"0":"")+e.value:3===e.length?m[e.groups.value.getDay()].substr(0,3):m[e.groups.value.getDay()]:u("",e.length,a);case"H":case"h":case"m":case"s":return 1===e.length?""+e.value:u(e.value,e.length);case"S":return 1===e.length?""+e.value:u(e.value,3)}}var y=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,h=["January","February","March","April","May","June","July","August","September","October","November","December"],m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],D={teardown:function(){}};function b(e){return new Date(new Date(e.getFullYear(),e.getMonth()+1,1)-864e5).getDate()}var w=new Date("0000-01-01T00:00:00");function M(e,t){var n=e;if("function"==typeof n&&(n=e()),"string"==typeof n)if("function"==typeof t)try{n=t(n)}catch(e){return defaultDate()}else try{n=new Date(n)}catch(e){return defaultDate()}return n instanceof Date?n:w}e.padl=u,e.padr=r,e.defaults=i,e.default=function(e){void 0===e&&(e={});var t=e.mask||i.mask,n=s(e.time||i.time),l=e.date||i.date;if("function"!=typeof l){var u=l;l=function(){return u}}return function(u){u.instance.decorators[e.name||"date"]=function(u,h,m){void 0===h&&(h={});var w=Object.assign({},e,"string"==typeof h?{value:h}:h,"string"==typeof m?{mask:m}:m);w.parseDate||(w.parseDate=e.parseDate||i.parseDate);var x=w.date||l,k=s(w.time||n);if("function"!=typeof x){var S=x;x=function(){return S}}var E=this.getContext(u),A=w.mask||t,T={observers:[],listeners:[]},H=!1;if("INPUT"!==u.tagName)return console.warn("Attempted to add a date decorator a "+u.tagName),D;if(!A)return D;for(var F,O=[],U=0;F=y.exec(A);){var Y={mask:F[0],type:F[0][0],length:F[0].length,start:F.index,end:F.index+F[0].length,chunk:O.length,prefix:A.substring(U,F.index),groups:O,value:null,display:r("",F[0].length,a)};U=Y.end,O.push(Y)}if(O.suffix=A.substring(O[O.length-1].end),O.last=null,O.slice(1).find(function(e){return!e.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+A+"'"),D;function C(e){if(null===O.value&&null===O.last||+O.value==+O.last)return 1;if(!e||!1===w.lazy){if(!1===w.null&&null===O.value)return f(O,O.last,w.parseDate),1;w.min&&O.value<w.min?(f(O,w.min,w.parseDate),p(O,u)):w.max&&O.value>w.max&&(f(O,w.max,w.parseDate),p(O,u)),O.last=O.value,"string"==typeof w.value&&(T.observers.forEach(function(e){return e.silence()}),E.set(w.value,O.value),T.observers.forEach(function(e){return e.resume()})),"string"==typeof w.display&&(T.observers.forEach(function(e){return e.silence()}),E.set(w.display,u.value),T.observers.forEach(function(e){return e.resume()}))}}w.min>w.max&&delete w.min,"string"==typeof w.value&&T.observers.push(E.observe(w.value,function(e){e||!1!==w.null||(e=x()),O.value=e,f(O,e,w.parseDate),O.last=e,p(O,u),(w.min&&e<w.min||w.max&&e>w.max)&&(O.last=null,setTimeout(C))},{defer:!0})),"string"==typeof w.display&&T.observers.push(E.observe(w.display,function(e){u.value=e||"",o(O,u,A),v(O),c(O,C,!0,x,k),p(O,u)},{defer:!0})),w.display||w.value||((w.date||!1===w.null)&&(O.value=M(w.date||x(),w.parseDate)),p(O,u));var P=function(e,t){void 0===t&&(t=u.selectionStart),e&&e.target&&(e=void 0),e||(e=t===u.value.length&&u.selectionEnd===u.value.length?O[0]:d(O,t)),H&&(H=!1,t<e.start&&(e=O[O.indexOf(e)-1])),document.activeElement===u&&u.setSelectionRange(e.start,e.end)};return T.listeners.push(E.listen("input",function(){var e=u.selectionStart,t=u.value;o(O,u,A);var n=d(O,e),a=v(O,n,e);if(c(O,C,!0,x,k),p(O,u),n&&(t.length>=A.length&&e===n.end||a)&&n!==O[O.length-1]){var l=O[O.indexOf(n)+1];P(l,e)}else u.setSelectionRange(e,e)})),T.listeners.push(E.listen("blur",function(){H=!1,C(!1)&&f(O,O.value,w.parseDate),null===O.value&&O.forEach(function(e){return e.value=null}),O.forEach(function(e){return e.display=g(e)}),p(O,u)})),T.listeners.push(E.listen("click",P)),T.listeners.push(E.listen("focus",P)),T.listeners.push(E.listen("keydown",function(e){switch(H=!1,e.key){case"Enter":case"Tab":var t=d(O,u.selectionStart),n=O.indexOf(t);v(O,t,u.selectionStart,!0)&&(p(O,u),c(O,C,e.shiftKey&&n>0||!e.shiftKey&&n+1<O.length,x,k)),e.shiftKey&&n>0?(P(O[n-1]),e.preventDefault(),e.stopPropagation()):!e.shiftKey&&n+1<O.length&&(P(O[n+1]),e.preventDefault(),e.stopPropagation());break;case"Backspace":H=!0;break;case"ArrowUp":case"ArrowDown":var a=[u.selectionStart,u.selectionEnd],l=a[0],r=a[1],i=d(O,l);null===i.value&&(i.value=1),function(e,t){switch(e.type){case"y":e.value=e.value+(t?-1:1);break;case"M":e.value=t?e.value<1?11:e.value-1:e.value>10?0:e.value+1;break;case"d":var n=e.groups,a=b(new Date((n.find(function(e){return"y"===e.type})||{value:1}).value,(n.find(function(e){return"M"===e.type})||{value:1}).value));e.value=t?e.value<2?a:e.value-1:e.value+1>a?1:e.value+1;break;case"H":e.value=t?e.value<1?23:e.value-1:e.value>22?0:e.value+1;break;case"h":e.value=t?e.value<1?12:e.value-1:e.value>11?1:e.value+1;break;case"m":case"s":e.value=t?e.value<1?59:e.value-1:e.value>58?0:e.value+1;break;case"S":e.value=t?e.value<1?999:e.value-1:e.value>998?0:e.value+1}}(i,"ArrowDown"===e.key),i.input=i.display=g(i),c(O,C,!0,x,k),p(O,u),e.preventDefault(),e.stopPropagation(),u.setSelectionRange(l,r)}})),{teardown:function(){T.observers.forEach(function(e){return e.cancel()}),T.listeners.forEach(function(e){return e.cancel()})}}}}},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RauiDate={})}(this,function(e){"use strict";var t=/[^\d]+/,n=/[^\d_]+/,a="_",l={y:0,M:1,d:2,H:3,m:4,s:5,S:6};function u(e,t,n){void 0===n&&(n="0");for(var a=null==e?"":""+e,l=a.length;l<t;l++)a=n+a;return a}function r(e,t,n){void 0===n&&(n="0");for(var a=null==e?"":""+e,l=a.length;l<t;l++)a+=n;return a}var i={mask:"yyyy-MM-dd",time:[0,0,0,0],date:function(){var e=new Date,t=i.time;return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t[0],t[1],t[2],t[3])},parseDate:function(e){return new Date(e)}};function s(e){if("start"===e)e=[0,0,0,0];else if("end"===e)e=[23,59,59,999];else if("mid"===e)e=[12,0,0,0];else if("now"===e)e=function(){var e=new Date;return[e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]};else if("string"==typeof e){var t=new Date("2000-05-13T"+e+"Z");+t&&(e=[t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()])}return Array.isArray(e)||"function"==typeof e||Array.isArray(e())||(e=[0,0,0,0]),e}function o(e,t,n){var a=t.value,l=d(e,t.selectionStart),u=0,r=e[u],i=e[u+1];e.forEach(function(e){return e.input=""});for(var s=0;s<a.length;s++)i&&a[s]===i.prefix[0]&&(l!==r||r.input.length>=r.length||a.length-s<n.length-r.end+(r.length-r.input.length))?(i.prefix.length>1&&(s+=i.prefix.length-1),a[s+1]===i.prefix[0]&&(s+=i.prefix.length),r=e[++u],i=e[u+1]):r.input+=a[s]}function v(e,l,i,s){void 0===i&&(i=0),void 0===s&&(s=!1);for(var o=!1,v=0;v<e.length;v++){var f=e[v],c=(f.input||"").replace(t,""),p=e[v+1]&&e[v+1].prefix&&n.test(f.input);if(c.length>f.length&&f===l){var d=c.length-l.length;c=c.substr(0,i-l.start)+c.substr(i-l.start+d)}else c=c.substr(0,f.length);if(f.input=c,"y"===f.type&&0===c.length&&(p||s))f.value=(new Date).getFullYear(),f.input=f.display=u(f.value,f.length),o=!0;else if("m"===f.type&&0===c.length&&(p||s))f.value=0,f.input=f.display=u(f.value,f.length),o=!0;else if("d"===f.type&&c.length!==f.length&&s)f.value=+c,f.display=g(f);else if(""===c)f.value=null,f.display=g(f);else if(f!==l)f.value=+c,"M"===f.type&&f.value--,f.display=g(f);else if("M"===f.type&&+c>1||"d"===f.type&&+c>3||"H"===f.type&&+c>2||("m"===f.type||"s"===f.type)&&+c>6)f.value=+c,"M"===f.type&&f.value--,f.display=u(c,f.length),o=!0;else if("y"===f.type&&2===c.length&&(p||s)){var y=(new Date).getFullYear(),h=100*Math.floor(y/100),m=Math.abs(y-(h+ +c))<20?h+ +c:h-100+ +c;f.value=m,f.input=f.display=u(m,f.length),o=!0}else f.display=r(c,f.length,a),f.value=+c,"M"===f.type&&f.value--}return o}function f(e,t,n){var a=(t=e.value=t&&w(t,n))?[t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]:[null,null,null,null,null,null,null];e.forEach(function(e){e.value=a[l[e.type]],e.input=e.display=g(e)})}function c(e,t,n,a,u){var r=e.value||a(),i=[r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()];if(!e.find(function(e){return"m"===e.type||"s"===e.type||"h"===e.type||"S"===e.type})){"function"==typeof u&&(u=u());for(var s=0;s<4;s++)i[s+3]=u[s]}if(e.forEach(function(e){var t=e.value;null!==t&&"M"===e.type?t<0?t=0:t>11&&(t=11):null===t||"m"!==e.type&&"s"!==e.type?null!==t&&"H"===e.type?t<0?t=0:t>23&&(t=23):null!==t&&"h"===e.type&&(t<1?t=1:t>12&&(t=12)):t<0?t=0:t>59&&(t=59),t!==e.value&&(e.value=t,e.display=g(e)),i[l[e.type]]=e.value}),null!==i[0]&&null!==i[1]&&null!==i[2]){var o=e.find(function(e){return"d"===e.type});if(o)if(i[2]<1)o.value=i[2]=1,o.display=g(o);else{var v=b(new Date(i[0],i[1],1));i[2]>v&&(o.value=i[2]=v,o.display=o.input=g(o))}}e.find(function(e){return null===e.value})||0===i[0]||i[1]>11||i[1]<0||0===i[2]?e.value=null:(i.unshift(null),e.value=new(Date.bind.apply(Date,i))),t(n)}function p(e,t){t.value=e.reduce(function(e,t){return e+t.prefix+t.display},"")+e.suffix}function d(e,t){return e.find(function(e){return t>=e.start&&t<=e.end})}function g(e){if(null===e.value)return u("",e.length,a);switch(e.type){case"y":return e.value?e.length<=2?(""+e.value).substr(2,2):""+u(e.value,e.length):u("",e.length,a);case"M":return~e.value?1===e.length?""+(e.value+1):2===e.length?(e.value<9?"0":"")+(e.value+1):3===e.length?h[e.value].substr(0,3):h[e.value]:u("",e.length,a);case"d":return e.value?1===e.length?""+e.value:2===e.length?(e.value<=9?"0":"")+e.value:3===e.length?m[e.groups.value.getDay()].substr(0,3):m[e.groups.value.getDay()]:u("",e.length,a);case"H":case"h":case"m":case"s":return 1===e.length?""+e.value:u(e.value,e.length);case"S":return 1===e.length?""+e.value:u(e.value,3)}}var y=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,h=["January","February","March","April","May","June","July","August","September","October","November","December"],m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],D={teardown:function(){}};function b(e){return new Date(new Date(e.getFullYear(),e.getMonth()+1,1)-864e5).getDate()}var M=new Date("0000-01-01T00:00:00");function w(e,t){var n=e;if("function"==typeof n&&(n=e()),"string"==typeof n)if("function"==typeof t)try{n=t(n)}catch(e){return defaultDate()}else try{n=new Date(n)}catch(e){return defaultDate()}return n instanceof Date?n:M}e.padl=u,e.padr=r,e.defaults=i,e.default=function(e){void 0===e&&(e={});var t=e.mask||i.mask,n=s(e.time||i.time),l=e.date||i.date;if("function"!=typeof l){var u=l;l=function(){return u}}return function(u){u.instance.decorators[e.name||"date"]=function(u,h,m){void 0===h&&(h={});var M=Object.assign({},e,"string"==typeof h?{value:h}:h,"string"==typeof m?{mask:m}:m);M.parseDate||(M.parseDate=e.parseDate||i.parseDate);var x=M.date||l,k=s(M.time||n);if("function"!=typeof x){var S=x;x=function(){return S}}var E=this.getContext(u),A=M.mask||t,T={observers:[],listeners:[]},H=!1;if("INPUT"!==u.tagName)return console.warn("Attempted to add a date decorator a "+u.tagName),D;if(!A)return D;for(var F,O=[],U=0;F=y.exec(A);){var Y={mask:F[0],type:F[0][0],length:F[0].length,start:F.index,end:F.index+F[0].length,chunk:O.length,prefix:A.substring(U,F.index),groups:O,value:null,display:r("",F[0].length,a)};U=Y.end,O.push(Y)}if(O.suffix=A.substring(O[O.length-1].end),O.last=null,O.slice(1).find(function(e){return!e.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+A+"'"),D;function C(e){if(null===O.value&&null===O.last||+O.value==+O.last)return 1;if(!e||!1===M.lazy){if(!1===M.null&&null===O.value)return f(O,O.last,M.parseDate),1;M.min&&O.value<M.min?(f(O,M.min,M.parseDate),p(O,u)):M.max&&O.value>M.max&&(f(O,M.max,M.parseDate),p(O,u)),O.last=O.value,"string"==typeof M.value&&(T.observers.forEach(function(e){return e.silence()}),E.set(M.value,O.value),T.observers.forEach(function(e){return e.resume()})),"string"==typeof M.display&&(T.observers.forEach(function(e){return e.silence()}),E.set(M.display,u.value),T.observers.forEach(function(e){return e.resume()}))}}M.min>M.max&&delete M.min,"string"==typeof M.value&&T.observers.push(E.observe(M.value,function(e){e||!1!==M.null||(e=x()),O.value=e,f(O,e,M.parseDate),O.last=e,p(O,u),(M.min&&e<M.min||M.max&&e>M.max)&&(O.last=null,setTimeout(C))},{defer:!0})),"string"==typeof M.display&&T.observers.push(E.observe(M.display,function(e){u.value=e||"",o(O,u,A),v(O),c(O,C,!0,x,k),p(O,u)},{defer:!0})),M.display||M.value||((M.date||!1===M.null)&&(O.value=w(M.date||x(),M.parseDate)),p(O,u));var P=function(e,t){void 0===t&&(t=u.selectionStart),e&&e.target&&(e=void 0),e||(e=t===u.value.length&&u.selectionEnd===u.value.length?O[0]:d(O,t)),H&&(H=!1,t<e.start&&(e=O[O.indexOf(e)-1])),document.activeElement===u&&u.setSelectionRange(e.start,e.end)};return T.listeners.push(E.listen("input",function(){var e=u.selectionStart,t=u.value;o(O,u,A);var n=d(O,e),a=v(O,n,e);if(c(O,C,!0,x,k),p(O,u),n&&(t.length>=A.length&&e===n.end||a)&&n!==O[O.length-1]){var l=O[O.indexOf(n)+1];P(l,e)}else u.setSelectionRange(e,e)})),T.listeners.push(E.listen("blur",function(){H=!1,C(!1)&&f(O,O.value,M.parseDate),null===O.value&&O.forEach(function(e){return e.value=null}),O.forEach(function(e){return e.display=g(e)}),p(O,u)})),T.listeners.push(E.listen("click",P)),T.listeners.push(E.listen("focus",P)),T.listeners.push(E.listen("keydown",function(e){switch(H=!1,e.key){case"Enter":case"Tab":var t=d(O,u.selectionStart),n=O.indexOf(t);v(O,t,u.selectionStart,!0)&&(p(O,u),c(O,C,e.shiftKey&&n>0||!e.shiftKey&&n+1<O.length,x,k)),e.shiftKey&&n>0?(P(O[n-1]),e.preventDefault(),e.stopPropagation()):!e.shiftKey&&n+1<O.length&&(P(O[n+1]),e.preventDefault(),e.stopPropagation());break;case"Backspace":H=!0;break;case"ArrowUp":case"ArrowDown":var a=[u.selectionStart,u.selectionEnd],l=a[0],r=a[1],i=d(O,l);null===i.value&&(i.value=1),function(e,t){switch(e.type){case"y":e.value=e.value+(t?-1:1);break;case"M":e.value=t?e.value<1?11:e.value-1:e.value>10?0:e.value+1;break;case"d":var n=e.groups,a=b(new Date((n.find(function(e){return"y"===e.type})||{value:1}).value,(n.find(function(e){return"M"===e.type})||{value:1}).value));e.value=t?e.value<2?a:e.value-1:e.value+1>a?1:e.value+1;break;case"H":e.value=t?e.value<1?23:e.value-1:e.value>22?0:e.value+1;break;case"h":e.value=t?e.value<1?12:e.value-1:e.value>11?1:e.value+1;break;case"m":case"s":e.value=t?e.value<1?59:e.value-1:e.value>58?0:e.value+1;break;case"S":e.value=t?e.value<1?999:e.value-1:e.value>998?0:e.value+1}}(i,"ArrowDown"===e.key),i.input=i.display=g(i),c(O,C,!0,x,k),p(O,u),e.preventDefault(),e.stopPropagation(),u.setSelectionRange(l,r)}})),{teardown:function(){T.observers.forEach(function(e){return e.cancel()}),T.listeners.forEach(function(e){return e.cancel()})}}}}},Object.defineProperty(e,"__esModule",{value:!0})});

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RauiDateInput={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=function(){try{var t=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(e){return new Date(2006,e,1).toLocaleString(t,{month:"long"})}),[1,2,3,4,5,6,7].map(function(e){return new Date(2006,0,e).toLocaleString(t,{weekday:"long"})})]}catch(t){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}(),r=n[0],i=n[1],a=i.map(function(t){return t[0]}).concat(i.map(function(t){return t[0].toUpperCase()})),o=r.map(function(t){return t.substr(0,3)}),l=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.month=function(t,e){void 0===e&&(e=0);var n,r=t||new Date;if(!(r instanceof Date))return{};isNaN(r)&&(r=new Date),e&&(r=new Date(r.getFullYear(),r.getMonth()+e,r.getDate()));try{n=+this.get("firstDay")}catch(t){}("number"!=typeof n||isNaN(n))&&(n=0),n>6&&(n=0);for(var i=new Date(r.getFullYear(),r.getMonth(),0),o=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),l=new Date(r.getFullYear(),r.getMonth()+1,1),s=new Date(r.getFullYear(),r.getMonth(),1).getDay(),f=[],c=f[0]=[],u=0;u<7;u++)f[0].unshift({y:i.getFullYear(),m:i.getMonth(),d:i.getDate()-u}),f[0].push({y:r.getFullYear(),m:r.getMonth(),d:u+1});f[0]=n<=s?f[0].slice(7-(s-n),14-(s-n)):f[0].slice(n-s,7+n-s),1===f[0][0].d&&f.unshift(c.slice(0,7));for(var p=f[f.length-1][f[f.length-1].length-1].d,d=f.length;d<5;d++){f[d]=[];for(var g=0;g<7&&p+1<=o;g++)f[d].push({y:r.getFullYear(),m:r.getMonth(),d:++p});if(f[d].length<7){for(var h=7-f[d].length,v=1;v<=h;v++)f[d].push({y:l.getFullYear(),m:l.getMonth(),d:v});f[d+1]=[];for(var m=0,y=h+1;m<7;m++,y++)f[d+1].push({y:l.getFullYear(),m:l.getMonth(),d:y})}}if(!f[5]){for(f[5]=[];p<o;)f[5].push({y:r.getFullYear(),m:r.getMonth(),d:++p});for(var b=1;b<8;b++)f[5].push({y:l.getFullYear(),m:l.getMonth(),d:b});f[5]=f[5].slice(0,7)}return{days:a.slice(n,n+7),weeks:f,year:r.getFullYear(),month:r.getMonth(),currentYear:(new Date).getFullYear()}},e.prototype.year=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+e,n.getMonth(),n.getDate()));for(var r=[],i=0;i<4;i++){r.push([]);for(var a=0;a<3;a++)r[i].push({m:3*i+a,y:n.getFullYear()})}return{year:n.getFullYear(),months:r}},e.prototype.decade=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+10*e,n.getMonth(),n.getDate()));for(var r=10*Math.floor(n.getFullYear()/10),i=r-1,a=[],o=0;o<4;o++){a.push([]);for(var l=0;l<3;l++)a[o].push({y:i+3*o+l})}return{start:r,end:r+9,years:a}},e.prototype.monthName=function(t){return r[t]},e.prototype.shortMonthName=function(t){return o[t]},e.prototype.dayName=function(t){return i[t]},e.prototype.select=function(t){if(t&&t instanceof Date)this.set("date",t);else{var e=this.get("safeCurrent");t&&this.set("date",new Date(t.y||e.getFullYear(),"number"==typeof t.m?t.m:e.getMonth(),t.d||e.getDate()));var n=this.get("mode");"year"===n?this.set("mode","months"):"months"===n&&this.set("mode","month"),this.set("target",this.get("date"))}},e.prototype.isCurrent=function(t){var e=this.get("safeCurrent");return!!e&&(t&&t.y===e.getFullYear()&&(null==t.m||t.m===e.getMonth())&&(null==t.d||t.d===e.getDate()))},e.prototype.next=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()+1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()+1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()+10,t.getMonth(),1))},e.prototype.prev=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()-1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()-1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()-10,t.getMonth(),1))},e.prototype.today=function(){this.set("date",new Date),this.set("target",this.get("date"))},e}(e);e.extendWith(l,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(t){return 0===t},"_0===_1":function(t,e){return t===e},true:function(){return!0},"[_0.prev(),false]":function(t){return[t.prev(),!1]},'[_0.set("mode","month"),false]':function(t){return[t.set("mode","month"),!1]},"[_0.next(),false]":function(t){return[t.next(),!1]},"_1>_0||_1<_2":function(t,e,n){return e>t||e<n},"_0.isCurrent(_1)":function(t,e){return t.isCurrent(e)},"[_0.select(_1),false]":function(t,e){return[t.select(e),!1]},"_0.decade(_1,_2)":function(t,e,n){return t.decade(e,n)},'[_0.set("mode","year"),false]':function(t){return[t.set("mode","year"),!1]},"_0.shortMonthName(_1)":function(t,e){return t.shortMonthName(e)},"_0.year(_1,_2)":function(t,e,n){return t.year(e,n)},'[_0.set("mode","months"),false]':function(t){return[t.set("mode","months"),!1]},"_0.monthName(_1)":function(t,e){return t.monthName(e)},"_0!==_1":function(t,e){return t!==e},"[_0.select(_1)]":function(t,e){return[t.select(e)]},"_0.month(_1,_2)":function(t,e,n){return t.month(e,n)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}],n:50,r:"left"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-title",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}],n:50,r:"right"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}],n:50,r:"left"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-title",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}],n:50,r:"right"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}],n:50,r:"left"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-title",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[" ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}],n:50,r:"right"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(t){return[function(t){return".rcal-wrapper {\n display: flex;\n flex-direction: column;\n width: 15em;\n height: 17em;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n line-height: 2em;\n height: 2em;\n align-items: center;\n }\n \n .rcal-arrow {\n width: 2em;\n }\n .rcal-title {\n flex-grow: 1;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n justify-content: space-between;\n flex-grow: 1;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 2em;\n display: flex;\n justify-content: space-between;\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n }\n \n .rcal-inner-pick {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 2em;\n height: 2em;\n text-align: center;\n line-height: 2em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(t("raui.datePicker.primary.bc")||t("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n "}.call(this,t)].join(" ")},noCssTransform:!0,data:function(){return{mode:"month",target:new Date}},computed:{safeCurrent:function(){var t=this.get("date");if("string"==typeof t)try{t=new Date(t)}catch(t){}return t&&t instanceof Date&&!isNaN(t)?t:new Date},safeTarget:function(){var t=this.get("target");if(t||(t=this.get("date")),"string"==typeof t)try{t=new Date(t)}catch(t){}return t&&t instanceof Date&&!isNaN(t)?t:new Date}}});var s="undefined"!=typeof window?window:null;function f(t,e,n){if(s&&s.Ractive&&"object"==typeof s.Ractive[e]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var i=r.getAttribute("data-alias");i&&(i=(i=i.split("&")).reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1];return t[r]=i,t},{})),Ractive[e][i&&i[t]||t]=n}}}function c(t,e){void 0===e&&(e={});var n=t.processParams(e,{duration:400,easing:"easeInOut"});e.dir=e.dir||!1;var r=e.distance||"20px",i=e.scale||"0.9",a="above"===e.dir?"translateY("+r+")":"left"===e.dir?"translateX("+r+")":"right"===e.dir?"translateX(-"+r+")":"translateY(-"+r+")";return t.isIntro||n.intro?(t.setStyle("opacity",0),t.setStyle("transform","scale("+i+") "+a),t.animateStyle({opacity:1,transform:"none"},n)):(t.setStyle("opacity",1),t.setStyle("transform","none"),t.animateStyle({opacity:0,transform:"scale("+i+") "+a},n))}function u(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"pop"]=c}}function p(t,e){var n=!1,r=!1;function i(n){for(var r=n.target;r;){if(r===t)return;if(!r.parentNode&&r!==document)return;r=r.parentNode}e(n)}return setTimeout(function(){n=!0,r||(document.body.addEventListener("click",i,{capture:!0}),document.body.addEventListener("touchstop",i,{capture:!0}))}),{teardown:function(){r=!0,n&&(document.body.removeEventListener("click",i,{capture:!0}),document.body.removeEventListener("touchstop",i,{capture:!0}))}}}function d(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"});return t.isIntro||n.intro?(t.setStyle("opacity",0),t.animateStyle("opacity",1,n)):(t.setStyle("opacity",1),t.animateStyle("opacity",0,n))}function g(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"fade"]=d}}f("pop","transitions",c),f("fade","transitions",d);var h,v,m,y,b={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content",z:[{n:"trigger",x:{r:"triggerContext"}}]}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(t){return t||"below"},'_0||"middle"':function(t){return t||"middle"},'[{dir:_0||"below"}]':function(t){return[{dir:t||"below"}]},'[_0.set("popped",false)]':function(t){return[t.set("popped",!1)]},"_0+(_1?3:0)":function(t,e){return t+(e?3:0)},"_0!=null":function(t){return null!=t},"_0+(_1?0:3)":function(t,e){return t+(e?0:3)},"_0-2":function(t){return t-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(t,e,n){return[t===e&&n.done(),!0]},"[_0.done()]":function(t){return[t.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function w(){}var x,_=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.position=function(e){var n=e||this.source,r=this.get("popped");if(n&&r){var i=this.find("div");if(n&&i&&i.offsetParent){n?this.set("triggerContext",t.getContext(n)):this.set("triggerContext",null);var a=i.offsetParent,o=a.getBoundingClientRect(),l=i.getBoundingClientRect(),s=n.getBoundingClientRect(),f=this.get("where")||"below",c=this.get("align")||"middle",u=this.get("tail"),p="above"===f||"below"===f,d=this.get("fit"),g=this.get("gap"),h="above"===f||"below"===f?0:"left"===f?-l.width-g:s.width+g,v="left"===f||"right"===f?-s.height:"above"===f?-s.height-l.height-g:g;"middle"===c?"below"===f||"above"===f?h-=(l.width-s.width)/2:"left"!==f&&"right"!==f||(v-=(l.height-s.height)/2):"end"===c&&("below"===f||"above"===f?h+=s.width-l.width:"left"!==f&&"right"!==f||(v+=s.height-l.height));var m={popTop:s.bottom-o.top+v,popLeft:s.left-o.left+h,tail:u,vert:"above"===f||"below"===f};if(a.scrollTop&&(m.popTop+=a.scrollTop),a.scrollLeft&&(m.popLeft+=a.scrollLeft),u){"above"===f?m.tailBottom=-10:"below"===f?m.tailTop=-10:"left"===f?m.tailRight=-10:"right"===f&&(m.tailLeft=-10);var y=this.tailSource?this.tailSource.getBoundingClientRect():s;"start"===c?p?m.tailLeft=Math.floor(y.width/2)-10:m.tailTop=Math.floor(y.height/2)-10:"end"===c?p?m.tailRight=Math.floor(y.width/2)-10:m.tailBottom=Math.floor(y.height/2)-10:"middle"===c&&(p?m.tailLeft=Math.floor(y.width/2)-10:m.tailTop=Math.floor(y.height/2)-10),y!==s?p?(null!=m.tailLeft&&(m.tailLeft+=y.left-s.left),null!=m.tailRight&&(m.tailRight+=s.right-y.right)):(null!=m.tailTop&&(m.tailTop+=y.top-s.top),null!=m.tailBottom&&(m.tailBottom+=s.bottom-y.bottom)):"middle"===c&&(p?(null!=m.tailLeft&&(m.tailLeft+=y.left-(m.popLeft+o.left)),null!=m.tailRight&&(m.tailRight+=m.popLeft+o.left+l.width-y.right)):(null!=m.tailTop&&(m.tailTop+=y.top-(m.popTop+o.top)),null!=m.tailBottom&&(m.tailBottom+=m.popTop+o.top+l.height-y.bottom)))}if(d){var b=a;if(this.get("offsets"))for(var w=this.get("offsets");w--;)b=b.offsetParent;var x=a.scrollWidth,_=a.scrollHeight;if(m.popLeft+l.width>x){var k=m.popLeft-(x-l.width);m.popLeft-=k,p&&m.tailLeft&&(m.tailLeft+=k),p&&m.tailRight&&(m.tailRight-=k),u&&!p&&(m.tail=!1)}if(m.popLeft<0){var D=-1*m.popLeft;m.popLeft+=D,p&&m.tailLeft&&(m.tailLeft-=D),p&&m.tailRight&&(m.tailRight+=D),u&&!p&&(m.tail=!1)}if(m.popTop+l.height>_){var M=m.popTop-(_-l.height);m.popTop-=M,!p&&m.tailTop&&(m.tailTop+=M),!p&&m.tailBottom&&(m.tailBottom-=M),u&&p&&(m.tail=!1)}if(m.popTop<0){var T=-1*m.popTop;m.popTop+=T,!p&&m.tailTop&&(m.tailTop-=T),!p&&m.tailBottom&&(m.tailBottom+=T),u&&p&&(m.tail=!1)}}if(o.left+m.popLeft<0){var L=0-(o.left+m.popLeft);m.popLeft+=L,p&&m.tailLeft&&(m.tailLeft-=L),p&&m.tailRight&&(m.tailRight+=L),u&&!p&&(m.tail=!1)}if(o.top+m.popTop<0){var S=0-(o.top+m.popTop);m.popTop+=S,!p&&m.tailTop&&(m.tailTop-=S),!p&&m.tailBottom&&(m.tailBottom+=S),u&&p&&(m.tail=!1)}m.tailLeft&&(m.tailLeft=Math.floor(m.tailLeft)),m.tailRight&&(m.tailRight=Math.floor(m.tailRight)),m.tailTop&&(m.tailTop=Math.floor(m.tailTop)),m.tailBottom&&(m.tailBottom=Math.floor(m.tailBottom)),this.set("position",m)}else this.set("position",null)}},e.prototype.show=function(t){return this.source=t,this.set("popped",!0),this._transdone},e.prototype.hide=function(){return this.set("popped",!1),this._transdone},e.prototype.popFind=function(t){return m?y.find(t):this.find(t)},e.prototype.popFindAll=function(t){return m?y.findAll(t):this.findAll(t)},e}(e);e.extendWith(_,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[u(),(void 0===x&&(x={}),function(t){t.instance.events[x.name||"clickout"]=p}),g()],template:b,css:function(t){return[function(t){var e=Object.assign({},t("raui.primary"),t("raui.pop.primary")),n=(t("raui.themes")||[]).slice();return(t("raui.pop.themes")||[]).forEach(function(t){~n.indexOf(t)||n.push(t)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 21;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(e.bg||"#fff")+";\n color: "+(e.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 20;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(e.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(e.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(e.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(e.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(e.bc||"#ccc")+";\n }\n "+n.map(function(e){var n=Object.assign({},t("raui.primary"),t("raui.pop.primary"),t("raui."+e),t("raui.pop."+e));return"\n ."+e+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+e+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,t)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(t){var e,n=this;t&&(h&&(this.source=h),v&&(this.tailSource=v));var r=this._transdone=new Promise(function(t){return e=t});r.resolve=e,setTimeout(function(){n._transdone=r,n.get("popped")===t&&n.set("_popped",t)},1)},_popped:{handler:function(t){var e=this,n=this._transdone.resolve;if(t){var r=this.get("@style.raui.pop.mobile");if(r&&window.matchMedia("(max-width: "+r+")").matches){y||(y=new k({target:document.body,append:!0}));var i=this.getContext().getParent(!0);i.isContext=1,this.set("__popped",!1).then(n),y.unshift("contents",{content:this.partials.content,context:i,attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){e.set("popped",!1)}})}else this.set("__popped",!0)}else m?(y.shift("contents"),n()):this.set("__popped",!1).then(n)},defer:!0,init:!1},__popped:{handler:function(t){var e=this._transdone.resolve;if(t){var n=this.find("div"),r=n,i=r.offsetHeight+r.offsetTop,a=r.offsetWidth+r.offsetLeft,o=r.offsetParent;if(!this.overflows)for(var l=this.overflows={e:[],v:[]};n&&n.style;){if(n===o){if(n.offsetWidth>=a&&n.offsetHeight>=i)break;a+=n.offsetLeft,i+=n.offsetTop,o=n.offsetParent}var s=getComputedStyle(n);if("auto"===s.overflow)break;"hidden"===s.overflow&&(l.e.push(n),l.v.push(n.style.overflow),n.style.overflow="visible"),n=n.parentNode}this.position(),this.transition("pop",r,{intro:!0,dir:this.get("where")||"below"}).then(e)}else this.source=null,this.tailSource=null},defer:!0,init:!1},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(t){var e=this;return{teardown:function(){var t=e.overflows;if(t){e.overflows=null;for(var n=0;n<t.e.length;n++)t.e[n].style.overflow=t.v[n]}}}}},data:function(){return{gap:4}}});var k=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(e);e.extendWith(k,{template:{v:b.v,t:b.p.modal},data:function(){return{contents:[]}},use:[u(),g()],observe:{contents:function(t){m=(t||[]).length>0}},on:{init:function(){y?console.warn("More than one PopOver mobile host created."):y=this}}});var D=/[^\d]+/,M=/[^\d_]+/,T="_",L={y:0,M:1,d:2,H:3,m:4,s:5,S:6};function S(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,i=r.length;i<e;i++)r=n+r;return r}function C(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,i=r.length;i<e;i++)r+=n;return r}var F={mask:"yyyy-MM-dd",time:[0,0,0,0],date:function(){var t=new Date,e=F.time;return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e[0],e[1],e[2],e[3])},parseDate:function(t){return new Date(t)}};function Y(t){if("start"===t)t=[0,0,0,0];else if("end"===t)t=[23,59,59,999];else if("mid"===t)t=[12,0,0,0];else if("now"===t)t=function(){var t=new Date;return[t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]};else if("string"==typeof t){var e=new Date("2000-05-13T"+t+"Z");+e&&(t=[e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()])}return Array.isArray(t)||"function"==typeof t||Array.isArray(t())||(t=[0,0,0,0]),t}function R(t){void 0===t&&(t={});var e=t.mask||F.mask,n=Y(t.time||F.time),r=t.date||F.date;if("function"!=typeof r){var i=r;r=function(){return i}}return function(i){i.instance.decorators[t.name||"date"]=function(i,a,o){void 0===a&&(a={});var l=Object.assign({},t,"string"==typeof a?{value:a}:a,"string"==typeof o?{mask:o}:o);l.parseDate||(l.parseDate=t.parseDate||F.parseDate);var s=l.date||r,f=Y(l.time||n);if("function"!=typeof s){var c=s;s=function(){return c}}var u=this.getContext(i),p=l.mask||e,d={observers:[],listeners:[]},g=!1;if("INPUT"!==i.tagName)return console.warn("Attempted to add a date decorator a "+i.tagName),W;if(!p)return W;for(var h,v=[],m=0;h=A.exec(p);){var y={mask:h[0],type:h[0][0],length:h[0].length,start:h.index,end:h.index+h[0].length,chunk:v.length,prefix:p.substring(m,h.index),groups:v,value:null,display:C("",h[0].length,T)};m=y.end,v.push(y)}if(v.suffix=p.substring(v[v.length-1].end),v.last=null,v.slice(1).find(function(t){return!t.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+p+"'"),W;function b(t){if(null===v.value&&null===v.last||+v.value==+v.last)return 1;if(!t||!1===l.lazy){if(!1===l.null&&null===v.value)return N(v,v.last,l.parseDate),1;l.min&&v.value<l.min?(N(v,l.min,l.parseDate),O(v,i)):l.max&&v.value>l.max&&(N(v,l.max,l.parseDate),O(v,i)),v.last=v.value,"string"==typeof l.value&&(d.observers.forEach(function(t){return t.silence()}),u.set(l.value,v.value),d.observers.forEach(function(t){return t.resume()})),"string"==typeof l.display&&(d.observers.forEach(function(t){return t.silence()}),u.set(l.display,i.value),d.observers.forEach(function(t){return t.resume()}))}}l.min>l.max&&delete l.min,"string"==typeof l.value&&d.observers.push(u.observe(l.value,function(t){t||!1!==l.null||(t=s()),v.value=t,N(v,t,l.parseDate),v.last=t,O(v,i),(l.min&&t<l.min||l.max&&t>l.max)&&(v.last=null,setTimeout(b))},{defer:!0})),"string"==typeof l.display&&d.observers.push(u.observe(l.display,function(t){i.value=t||"",P(v,i,p),B(v),E(v,b,!0,s,f),O(v,i)},{defer:!0})),l.display||l.value||((l.date||!1===l.null)&&(v.value=K(l.date||s(),l.parseDate)),O(v,i));var w=function(t,e){void 0===e&&(e=i.selectionStart),t&&t.target&&(t=void 0),t||(t=e===i.value.length&&i.selectionEnd===i.value.length?v[0]:j(v,e)),g&&(g=!1,e<t.start&&(t=v[v.indexOf(t)-1])),document.activeElement===i&&i.setSelectionRange(t.start,t.end)};return d.listeners.push(u.listen("input",function(){var t=i.selectionStart,e=i.value;P(v,i,p);var n=j(v,t),r=B(v,n,t);if(E(v,b,!0,s,f),O(v,i),n&&(e.length>=p.length&&t===n.end||r)&&n!==v[v.length-1]){var a=v[v.indexOf(n)+1];w(a,t)}else i.setSelectionRange(t,t)})),d.listeners.push(u.listen("blur",function(){g=!1,b(!1)&&N(v,v.value,l.parseDate),null===v.value&&v.forEach(function(t){return t.value=null}),v.forEach(function(t){return t.display=z(t)}),O(v,i)})),d.listeners.push(u.listen("click",w)),d.listeners.push(u.listen("focus",w)),d.listeners.push(u.listen("keydown",function(t){switch(g=!1,t.key){case"Enter":case"Tab":var e=j(v,i.selectionStart),n=v.indexOf(e);B(v,e,i.selectionStart,!0)&&(O(v,i),E(v,b,t.shiftKey&&n>0||!t.shiftKey&&n+1<v.length,s,f)),t.shiftKey&&n>0?(w(v[n-1]),t.preventDefault(),t.stopPropagation()):!t.shiftKey&&n+1<v.length&&(w(v[n+1]),t.preventDefault(),t.stopPropagation());break;case"Backspace":g=!0;break;case"ArrowUp":case"ArrowDown":var r=[i.selectionStart,i.selectionEnd],a=r[0],o=r[1],l=j(v,a);null===l.value&&(l.value=1),function(t,e){switch(t.type){case"y":t.value=t.value+(e?-1:1);break;case"M":t.value=e?t.value<1?11:t.value-1:t.value>10?0:t.value+1;break;case"d":var n=t.groups,r=U(new Date((n.find(function(t){return"y"===t.type})||{value:1}).value,(n.find(function(t){return"M"===t.type})||{value:1}).value));t.value=e?t.value<2?r:t.value-1:t.value+1>r?1:t.value+1;break;case"H":t.value=e?t.value<1?23:t.value-1:t.value>22?0:t.value+1;break;case"h":t.value=e?t.value<1?12:t.value-1:t.value>11?1:t.value+1;break;case"m":case"s":t.value=e?t.value<1?59:t.value-1:t.value>58?0:t.value+1;break;case"S":t.value=e?t.value<1?999:t.value-1:t.value>998?0:t.value+1}}(l,"ArrowDown"===t.key),l.input=l.display=z(l),E(v,b,!0,s,f),O(v,i),t.preventDefault(),t.stopPropagation(),i.setSelectionRange(a,o)}})),{teardown:function(){d.observers.forEach(function(t){return t.cancel()}),d.listeners.forEach(function(t){return t.cancel()})}}}}}function P(t,e,n){var r=e.value,i=j(t,e.selectionStart),a=0,o=t[a],l=t[a+1];t.forEach(function(t){return t.input=""});for(var s=0;s<r.length;s++)l&&r[s]===l.prefix[0]&&(i!==o||o.input.length>=o.length||r.length-s<n.length-o.end+(o.length-o.input.length))?(l.prefix.length>1&&(s+=l.prefix.length-1),r[s+1]===l.prefix[0]&&(s+=l.prefix.length),o=t[++a],l=t[a+1]):o.input+=r[s]}function B(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);for(var i=!1,a=0;a<t.length;a++){var o=t[a],l=(o.input||"").replace(D,""),s=t[a+1]&&t[a+1].prefix&&M.test(o.input);if(l.length>o.length&&o===e){var f=l.length-e.length;l=l.substr(0,n-e.start)+l.substr(n-e.start+f)}else l=l.substr(0,o.length);if(o.input=l,"y"===o.type&&0===l.length&&(s||r))o.value=(new Date).getFullYear(),o.input=o.display=S(o.value,o.length),i=!0;else if("m"===o.type&&0===l.length&&(s||r))o.value=0,o.input=o.display=S(o.value,o.length),i=!0;else if("d"===o.type&&l.length!==o.length&&r)o.value=+l,o.display=z(o);else if(""===l)o.value=null,o.display=z(o);else if(o!==e)o.value=+l,"M"===o.type&&o.value--,o.display=z(o);else if("M"===o.type&&+l>1||"d"===o.type&&+l>3||"H"===o.type&&+l>2||("m"===o.type||"s"===o.type)&&+l>6)o.value=+l,"M"===o.type&&o.value--,o.display=S(l,o.length),i=!0;else if("y"===o.type&&2===l.length&&(s||r)){var c=(new Date).getFullYear(),u=100*Math.floor(c/100),p=Math.abs(c-(u+ +l))<20?u+ +l:u-100+ +l;o.value=p,o.input=o.display=S(p,o.length),i=!0}else o.display=C(l,o.length,T),o.value=+l}return i}function N(t,e,n){var r=(e=t.value=e&&K(e,n))?[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]:[null,null,null,null,null,null,null];t.forEach(function(t){t.value=r[L[t.type]],t.input=t.display=z(t)})}function E(t,e,n,r,i){var a=t.value||r(),o=[a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()];if(!t.find(function(t){return"m"===t.type||"s"===t.type||"h"===t.type||"S"===t.type})){"function"==typeof i&&(i=i());for(var l=0;l<4;l++)o[l+3]=i[l]}if(t.forEach(function(t){var e=t.value;null!==e&&"M"===t.type?e<0?e=0:e>11&&(e=11):null===e||"m"!==t.type&&"s"!==t.type?null!==e&&"H"===t.type?e<0?e=0:e>23&&(e=23):null!==e&&"h"===t.type&&(e<1?e=1:e>12&&(e=12)):e<0?e=0:e>59&&(e=59),e!==t.value&&(t.value=e,t.display=z(t)),o[L[t.type]]=t.value}),null!==o[0]&&null!==o[1]&&null!==o[2]){var s=t.find(function(t){return"d"===t.type});if(s)if(o[2]<1)s.value=o[2]=1,s.display=z(s);else{var f=U(new Date(o[0],o[1],1));o[2]>f&&(s.value=o[2]=f,s.display=s.input=z(s))}}t.find(function(t){return null===t.value})||0===o[0]||o[1]>11||o[1]<0||0===o[2]?t.value=null:(o.unshift(null),t.value=new(Date.bind.apply(Date,o))),e(n)}function O(t,e){e.value=t.reduce(function(t,e){return t+e.prefix+e.display},"")+t.suffix}function j(t,e){return t.find(function(t){return e>=t.start&&e<=t.end})}function z(t){if(null===t.value)return S("",t.length,T);switch(t.type){case"y":return t.value?t.length<=2?(""+t.value).substr(2,2):""+S(t.value,t.length):S("",t.length,T);case"M":return~t.value?1===t.length?""+(t.value+1):2===t.length?(t.value<9?"0":"")+(t.value+1):3===t.length?H[t.value].substr(0,3):H[t.value]:S("",t.length,T);case"d":return t.value?1===t.length?""+t.value:2===t.length?(t.value<=9?"0":"")+t.value:3===t.length?I[t.groups.value.getDay()].substr(0,3):I[t.groups.value.getDay()]:S("",t.length,T);case"H":case"h":case"m":case"s":return 1===t.length?""+t.value:S(t.value,t.length);case"S":return 1===t.length?""+t.value:S(t.value,3)}}var A=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,H=["January","February","March","April","May","June","July","August","September","October","November","December"],I=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],W={teardown:function(){}};function U(t){return new Date(new Date(t.getFullYear(),t.getMonth()+1,1)-864e5).getDate()}var J=new Date("0000-01-01T00:00:00");function K(t,e){var n=t;if("function"==typeof n&&(n=t()),"string"==typeof n)if("function"==typeof e)try{n=e(n)}catch(t){return defaultDate()}else try{n=new Date(n)}catch(t){return defaultDate()}return n instanceof Date?n:J}function q(t){t.strObserver&&t.strObserver.cancel(),t.attributes.value?t.link(t.attributes.value,"rdi.val"):t.unlink("rdi.val"),t.attributes.display?t.link(t.attributes.display,"rdi.display"):t.unlink("rdi.display"),t.attributes.string&&(t.strObserver=t.observe("rdi.val",function(e){return t.set(t.attributes.string,e?e.toString():"")}));var e={};["null","lazy","eager","mask","min","max","mask","no-pick","time"].forEach(function(n){n in t.attributes&&(e[n.replace(/-/g,"")]=t.attributes[n]),"eager"===n&&n in t.attributes&&(e.lazy=!t.attributes.eager)}),t.attributes.value&&(e.value="rdi.val"),t.attributes.display&&(e.display="rdi.display"),t.set("rdi.opts",e)}var X=Ractive.macro(function(t){return t.aliasLocal("rdi"),q(t),t.setTemplate({v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rdi-date field-wrapper",g:1}],f:[{t:7,e:"input",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["node"]'}},{n:"rdi-date",t:71,f:{r:["rdi.opts"],s:"[_0]"}},{n:"class-rdi-date",t:13},{t:8,r:"extra-attributes"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-x",g:1},{n:["click"],t:70,f:{r:["@context"],s:'[(_0).set("rdi.val",null)]'}},{n:"title",f:"Clear",t:13,g:1}],f:["×"]}],n:50,x:{r:["rdi.opts.null","rdi.val"],s:"_0&&_1!==null"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-pop",g:1},{n:"rdi-pop",t:71,f:{r:["rdi.node","rdi.tail"],s:'[{path:"rdi.popped",node:_0,tail:_1}]'}},{n:["click"],t:70,f:{r:[],s:"[false,false]"}},{n:"title",f:"Select from calendar",t:13,g:1}],f:[{t:7,e:"svg",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["tail"]'}},{n:"x",f:"0px",t:13,g:1},{n:"y",f:"0px",t:13,g:1},{n:"viewBox",f:"0 0 48 48",t:13,g:1},{n:"xml:space",f:"preserve",t:13}],f:[{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.5;fill:none;stroke-width:1;",g:1},{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"46",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.8;stroke:none;",g:1},{t:13,n:"class",f:"rdi-today",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}]}]}],n:51,r:"rdi.opts.nopick"}]}," ",{t:7,e:"rdi-pop",m:[{n:"popped",t:13,f:[{t:2,r:"rdi.popped"}]},{n:"tail",f:0,t:13},{n:"align",f:"end",t:13,g:1}],f:[{t:7,e:"rdi-picker",m:[{n:["init"],t:70,f:{r:["@context","rdi.val"],s:'[(_0).component.set("target",_1)]'}},{n:"date",t:13,f:[{t:2,r:"rdi.val"}]}]}]}],e:{'["node"]':function(){return["node"]},"[_0]":function(t){return[t]},'[(_0).set("rdi.val",null)]':function(t){return[t.set("rdi.val",null)]},"_0&&_1!==null":function(t,e){return t&&null!==e},'[{path:"rdi.popped",node:_0,tail:_1}]':function(t,e){return[{path:"rdi.popped",node:t,tail:e}]},"[false,false]":function(){return[!1,!1]},'["tail"]':function(){return["tail"]},'[(_0).component.set("target",_1)]':function(t,e){return[t.component.set("target",e)]}}}),{update:function(){q(t)}}},{css:function(t){return[function(t){return".rdi-date {\n position: relative;\n display: inline-block;\n }\n \n .rdi-date input.rdi-date {\n width: 100%;\n box-sizing: border-box;\n }\n \n .rdi-x {\n position: absolute;\n right: 2em;\n top: 0.025em;\n cursor: pointer;\n }\n \n .rdi-pop {\n position: absolute;\n display: flex;\n justify-content: space-around;\n align-items: flex-end;\n flex-direction: column;\n right: 0.5em;\n height: 100%;\n top: 0;\n cursor: pointer;\n }\n \n .rdi-pop > svg {\n height: 48px;\n max-height: 60%;\n fill: "+(t("raui.dateInput.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n \n .rdi-today {\n fill: "+(t("raui.dateInput.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }"}.call(this,t)].join(" ")},cssId:"rdi",noCssTransform:!0,attributes:["value","null","lazy","eager","mask","string","display","min","max","no-pick","time"]});t.DateInput=X,t.default=function(t){return void 0===t&&(t={}),function(e){var n,r=e.instance;r.components["rdi-picker"]=l,r.components["rdi-pop"]=_,(void 0===(n={name:"rdi-pop"})&&(n={}),function(t){t.instance.decorators[n.name||"pop"]=function(t,e,r){if(void 0===r&&(r={}),!e)return{teardown:w};"string"==typeof e?r.path=e:"object"==typeof e&&(r=e);var i,a,o=this.getContext(t);function l(n){if("mouseover"!==n.type||!o.get(e)){if("click"!==n.type||!a||i){var l=h,s=v;"function"==typeof(h=r.node||t)&&(h=h()),h=h||t,"function"==typeof(v=r.tail)&&(v=v()),o.toggle(r.path),h=l,v=s}a&&"click"===n.type&&(i=o.observeOnce(r.path,function(){i=null}))}}function s(t){i||o.set(r.path,!1)}return("click"in r?r.click:!1!==n.click)&&o.listen("click",l),("hover"in r?r.hover:n.hover)&&(a=1,o.listen("mouseover",l),o.listen("mouseout",s)),{teardown:function(){o.unlisten("click",l),a&&(o.unlisten("mouseover",l),o.unlisten("mouseout",s),i&&i.cancel())}}}})({instance:r}),R({name:"rdi-date",parseDate:t.parseDate})({instance:r}),r.partials[t.name||"date-input"]=X,r.decorators["rdi-reg"]=function(t,e){return this.getContext(t).set("rdi."+e,function(){return t}),{teardown:function(){}}}}},Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RauiDateInput={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=function(){try{var t=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(e){return new Date(2006,e,1).toLocaleString(t,{month:"long"})}),[1,2,3,4,5,6,7].map(function(e){return new Date(2006,0,e).toLocaleString(t,{weekday:"long"})})]}catch(t){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}(),r=n[0],i=n[1],a=i.map(function(t){return t[0]}).concat(i.map(function(t){return t[0].toUpperCase()})),o=r.map(function(t){return t.substr(0,3)}),l=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.month=function(t,e){void 0===e&&(e=0);var n,r=t||new Date;if(!(r instanceof Date))return{};isNaN(r)&&(r=new Date),e&&(r=new Date(r.getFullYear(),r.getMonth()+e,r.getDate()));try{n=+this.get("firstDay")}catch(t){}("number"!=typeof n||isNaN(n))&&(n=0),n>6&&(n=0);for(var i=new Date(r.getFullYear(),r.getMonth(),0),o=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),l=new Date(r.getFullYear(),r.getMonth()+1,1),s=new Date(r.getFullYear(),r.getMonth(),1).getDay(),f=[],c=f[0]=[],u=0;u<7;u++)f[0].unshift({y:i.getFullYear(),m:i.getMonth(),d:i.getDate()-u}),f[0].push({y:r.getFullYear(),m:r.getMonth(),d:u+1});f[0]=n<=s?f[0].slice(7-(s-n),14-(s-n)):f[0].slice(n-s,7+n-s),1===f[0][0].d&&f.unshift(c.slice(0,7));for(var p=f[f.length-1][f[f.length-1].length-1].d,d=f.length;d<5;d++){f[d]=[];for(var g=0;g<7&&p+1<=o;g++)f[d].push({y:r.getFullYear(),m:r.getMonth(),d:++p});if(f[d].length<7){for(var h=7-f[d].length,v=1;v<=h;v++)f[d].push({y:l.getFullYear(),m:l.getMonth(),d:v});f[d+1]=[];for(var m=0,y=h+1;m<7;m++,y++)f[d+1].push({y:l.getFullYear(),m:l.getMonth(),d:y})}}if(!f[5]){for(f[5]=[];p<o;)f[5].push({y:r.getFullYear(),m:r.getMonth(),d:++p});for(var b=1;b<8;b++)f[5].push({y:l.getFullYear(),m:l.getMonth(),d:b});f[5]=f[5].slice(0,7)}return{days:a.slice(n,n+7),weeks:f,year:r.getFullYear(),month:r.getMonth(),currentYear:(new Date).getFullYear()}},e.prototype.year=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+e,n.getMonth(),n.getDate()));for(var r=[],i=0;i<4;i++){r.push([]);for(var a=0;a<3;a++)r[i].push({m:3*i+a,y:n.getFullYear()})}return{year:n.getFullYear(),months:r}},e.prototype.decade=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+10*e,n.getMonth(),n.getDate()));for(var r=10*Math.floor(n.getFullYear()/10),i=r-1,a=[],o=0;o<4;o++){a.push([]);for(var l=0;l<3;l++)a[o].push({y:i+3*o+l})}return{start:r,end:r+9,years:a}},e.prototype.monthName=function(t){return r[t]},e.prototype.shortMonthName=function(t){return o[t]},e.prototype.dayName=function(t){return i[t]},e.prototype.select=function(t){if(t&&t instanceof Date)this.set("date",t);else{var e=this.get("safeCurrent");t&&this.set("date",new Date(t.y||e.getFullYear(),"number"==typeof t.m?t.m:e.getMonth(),t.d||e.getDate()));var n=this.get("mode");"year"===n?this.set("mode","months"):"months"===n&&this.set("mode","month"),this.set("target",this.get("date"))}},e.prototype.isCurrent=function(t){var e=this.get("safeCurrent");return!!e&&(t&&t.y===e.getFullYear()&&(null==t.m||t.m===e.getMonth())&&(null==t.d||t.d===e.getDate()))},e.prototype.next=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()+1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()+1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()+10,t.getMonth(),1))},e.prototype.prev=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()-1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()-1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()-10,t.getMonth(),1))},e.prototype.today=function(){this.set("date",new Date),this.set("target",this.get("date"))},e}(e);e.extendWith(l,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(t){return 0===t},"_0===_1":function(t,e){return t===e},true:function(){return!0},"[_0.prev(),false]":function(t){return[t.prev(),!1]},'[_0.set("mode","month"),false]':function(t){return[t.set("mode","month"),!1]},"[_0.next(),false]":function(t){return[t.next(),!1]},"_1>_0||_1<_2":function(t,e,n){return e>t||e<n},"_0.isCurrent(_1)":function(t,e){return t.isCurrent(e)},"[_0.select(_1),false]":function(t,e){return[t.select(e),!1]},"_0.decade(_1,_2)":function(t,e,n){return t.decade(e,n)},'[_0.set("mode","year"),false]':function(t){return[t.set("mode","year"),!1]},"_0.shortMonthName(_1)":function(t,e){return t.shortMonthName(e)},"_0.year(_1,_2)":function(t,e,n){return t.year(e,n)},'[_0.set("mode","months"),false]':function(t){return[t.set("mode","months"),!1]},"_0.monthName(_1)":function(t,e){return t.monthName(e)},"_0!==_1":function(t,e){return t!==e},"[_0.select(_1)]":function(t,e){return[t.select(e)]},"_0.month(_1,_2)":function(t,e,n){return t.month(e,n)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}],n:50,r:"left"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-title",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month"),false]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}],n:50,r:"right"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}],n:50,r:"left"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-title",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year"),false]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}],n:50,r:"right"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1),false]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev(),false]"}}],n:50,r:"left"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-title",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months"),false]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[" ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click rcal-arrow",g:1},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.next(),false]"}}],n:50,r:"right"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(t){return[function(t){return".rcal-wrapper {\n display: flex;\n flex-direction: column;\n width: 15em;\n height: 17em;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n line-height: 2em;\n height: 2em;\n align-items: center;\n }\n \n .rcal-arrow {\n width: 2em;\n }\n .rcal-title {\n flex-grow: 1;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n justify-content: space-between;\n flex-grow: 1;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 2em;\n display: flex;\n justify-content: space-between;\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n }\n \n .rcal-inner-pick {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 2em;\n height: 2em;\n text-align: center;\n line-height: 2em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(t("raui.datePicker.primary.bc")||t("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n "}.call(this,t)].join(" ")},noCssTransform:!0,data:function(){return{mode:"month",target:new Date}},computed:{safeCurrent:function(){var t=this.get("date");if("string"==typeof t)try{t=new Date(t)}catch(t){}return t&&t instanceof Date&&!isNaN(t)?t:new Date},safeTarget:function(){var t=this.get("target");if(t||(t=this.get("date")),"string"==typeof t)try{t=new Date(t)}catch(t){}return t&&t instanceof Date&&!isNaN(t)?t:new Date}}});var s="undefined"!=typeof window?window:null;function f(t,e,n){if(s&&s.Ractive&&"object"==typeof s.Ractive[e]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var i=r.getAttribute("data-alias");i&&(i=(i=i.split("&")).reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1];return t[r]=i,t},{})),Ractive[e][i&&i[t]||t]=n}}}function c(t,e){void 0===e&&(e={});var n=t.processParams(e,{duration:400,easing:"easeInOut"});e.dir=e.dir||!1;var r=e.distance||"20px",i=e.scale||"0.9",a="above"===e.dir?"translateY("+r+")":"left"===e.dir?"translateX("+r+")":"right"===e.dir?"translateX(-"+r+")":"translateY(-"+r+")";return t.isIntro||n.intro?(t.setStyle("opacity",0),t.setStyle("transform","scale("+i+") "+a),t.animateStyle({opacity:1,transform:"none"},n)):(t.setStyle("opacity",1),t.setStyle("transform","none"),t.animateStyle({opacity:0,transform:"scale("+i+") "+a},n))}function u(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"pop"]=c}}function p(t,e){var n=!1,r=!1;function i(n){for(var r=n.target;r;){if(r===t)return;if(!r.parentNode&&r!==document)return;r=r.parentNode}e(n)}return setTimeout(function(){n=!0,r||(document.body.addEventListener("click",i,{capture:!0}),document.body.addEventListener("touchstop",i,{capture:!0}))}),{teardown:function(){r=!0,n&&(document.body.removeEventListener("click",i,{capture:!0}),document.body.removeEventListener("touchstop",i,{capture:!0}))}}}function d(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"});return t.isIntro||n.intro?(t.setStyle("opacity",0),t.animateStyle("opacity",1,n)):(t.setStyle("opacity",1),t.animateStyle("opacity",0,n))}function g(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"fade"]=d}}f("pop","transitions",c),f("fade","transitions",d);var h,v,m,y,b={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?3:0)"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:3)"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailTop"],s:"_0!=null"}},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailBottom"],s:"_0!=null"}},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailLeft"],s:"_0!=null"}},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,x:{r:["position.tailRight"],s:"_0!=null"}}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content",z:[{n:"trigger",x:{r:"triggerContext"}}]}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(t){return t||"below"},'_0||"middle"':function(t){return t||"middle"},'[{dir:_0||"below"}]':function(t){return[{dir:t||"below"}]},'[_0.set("popped",false)]':function(t){return[t.set("popped",!1)]},"_0+(_1?3:0)":function(t,e){return t+(e?3:0)},"_0!=null":function(t){return null!=t},"_0+(_1?0:3)":function(t,e){return t+(e?0:3)},"_0-2":function(t){return t-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(t,e,n){return[t===e&&n.done(),!0]},"[_0.done()]":function(t){return[t.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function w(){}var x,_=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.position=function(e){var n=e||this.source,r=this.get("popped");if(n&&r){var i=this.find("div");if(n&&i&&i.offsetParent){n?this.set("triggerContext",t.getContext(n)):this.set("triggerContext",null);var a=i.offsetParent,o=a.getBoundingClientRect(),l=i.getBoundingClientRect(),s=n.getBoundingClientRect(),f=this.get("where")||"below",c=this.get("align")||"middle",u=this.get("tail"),p="above"===f||"below"===f,d=this.get("fit"),g=this.get("gap"),h="above"===f||"below"===f?0:"left"===f?-l.width-g:s.width+g,v="left"===f||"right"===f?-s.height:"above"===f?-s.height-l.height-g:g;"middle"===c?"below"===f||"above"===f?h-=(l.width-s.width)/2:"left"!==f&&"right"!==f||(v-=(l.height-s.height)/2):"end"===c&&("below"===f||"above"===f?h+=s.width-l.width:"left"!==f&&"right"!==f||(v+=s.height-l.height));var m={popTop:s.bottom-o.top+v,popLeft:s.left-o.left+h,tail:u,vert:"above"===f||"below"===f};if(a.scrollTop&&(m.popTop+=a.scrollTop),a.scrollLeft&&(m.popLeft+=a.scrollLeft),u){"above"===f?m.tailBottom=-10:"below"===f?m.tailTop=-10:"left"===f?m.tailRight=-10:"right"===f&&(m.tailLeft=-10);var y=this.tailSource?this.tailSource.getBoundingClientRect():s;"start"===c?p?m.tailLeft=Math.floor(y.width/2)-10:m.tailTop=Math.floor(y.height/2)-10:"end"===c?p?m.tailRight=Math.floor(y.width/2)-10:m.tailBottom=Math.floor(y.height/2)-10:"middle"===c&&(p?m.tailLeft=Math.floor(y.width/2)-10:m.tailTop=Math.floor(y.height/2)-10),y!==s?p?(null!=m.tailLeft&&(m.tailLeft+=y.left-s.left),null!=m.tailRight&&(m.tailRight+=s.right-y.right)):(null!=m.tailTop&&(m.tailTop+=y.top-s.top),null!=m.tailBottom&&(m.tailBottom+=s.bottom-y.bottom)):"middle"===c&&(p?(null!=m.tailLeft&&(m.tailLeft+=y.left-(m.popLeft+o.left)),null!=m.tailRight&&(m.tailRight+=m.popLeft+o.left+l.width-y.right)):(null!=m.tailTop&&(m.tailTop+=y.top-(m.popTop+o.top)),null!=m.tailBottom&&(m.tailBottom+=m.popTop+o.top+l.height-y.bottom)))}if(d){var b=a;if(this.get("offsets"))for(var w=this.get("offsets");w--;)b=b.offsetParent;var x=a.scrollWidth,_=a.scrollHeight;if(m.popLeft+l.width>x){var k=m.popLeft-(x-l.width);m.popLeft-=k,p&&m.tailLeft&&(m.tailLeft+=k),p&&m.tailRight&&(m.tailRight-=k),u&&!p&&(m.tail=!1)}if(m.popLeft<0){var D=-1*m.popLeft;m.popLeft+=D,p&&m.tailLeft&&(m.tailLeft-=D),p&&m.tailRight&&(m.tailRight+=D),u&&!p&&(m.tail=!1)}if(m.popTop+l.height>_){var M=m.popTop-(_-l.height);m.popTop-=M,!p&&m.tailTop&&(m.tailTop+=M),!p&&m.tailBottom&&(m.tailBottom-=M),u&&p&&(m.tail=!1)}if(m.popTop<0){var T=-1*m.popTop;m.popTop+=T,!p&&m.tailTop&&(m.tailTop-=T),!p&&m.tailBottom&&(m.tailBottom+=T),u&&p&&(m.tail=!1)}}if(o.left+m.popLeft<0){var L=0-(o.left+m.popLeft);m.popLeft+=L,p&&m.tailLeft&&(m.tailLeft-=L),p&&m.tailRight&&(m.tailRight+=L),u&&!p&&(m.tail=!1)}if(o.top+m.popTop<0){var S=0-(o.top+m.popTop);m.popTop+=S,!p&&m.tailTop&&(m.tailTop-=S),!p&&m.tailBottom&&(m.tailBottom+=S),u&&p&&(m.tail=!1)}m.tailLeft&&(m.tailLeft=Math.floor(m.tailLeft)),m.tailRight&&(m.tailRight=Math.floor(m.tailRight)),m.tailTop&&(m.tailTop=Math.floor(m.tailTop)),m.tailBottom&&(m.tailBottom=Math.floor(m.tailBottom)),this.set("position",m)}else this.set("position",null)}},e.prototype.show=function(t){return this.source=t,this.set("popped",!0),this._transdone},e.prototype.hide=function(){return this.set("popped",!1),this._transdone},e.prototype.popFind=function(t){return m?y.find(t):this.find(t)},e.prototype.popFindAll=function(t){return m?y.findAll(t):this.findAll(t)},e}(e);e.extendWith(_,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[u(),(void 0===x&&(x={}),function(t){t.instance.events[x.name||"clickout"]=p}),g()],template:b,css:function(t){return[function(t){var e=Object.assign({},t("raui.primary"),t("raui.pop.primary")),n=(t("raui.themes")||[]).slice();return(t("raui.pop.themes")||[]).forEach(function(t){~n.indexOf(t)||n.push(t)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 21;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(e.bg||"#fff")+";\n color: "+(e.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 20;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(e.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(e.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(e.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(e.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(e.bc||"#ccc")+";\n }\n "+n.map(function(e){var n=Object.assign({},t("raui.primary"),t("raui.pop.primary"),t("raui."+e),t("raui.pop."+e));return"\n ."+e+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+e+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,t)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(t){var e,n=this;t&&(h&&(this.source=h),v&&(this.tailSource=v));var r=this._transdone=new Promise(function(t){return e=t});r.resolve=e,setTimeout(function(){n._transdone=r,n.get("popped")===t&&n.set("_popped",t)},1)},_popped:{handler:function(t){var e=this,n=this._transdone.resolve;if(t){var r=this.get("@style.raui.pop.mobile");if(r&&window.matchMedia("(max-width: "+r+")").matches){y||(y=new k({target:document.body,append:!0}));var i=this.getContext().getParent(!0);i.isContext=1,this.set("__popped",!1).then(n),y.unshift("contents",{content:this.partials.content,context:i,attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){e.set("popped",!1)}})}else this.set("__popped",!0)}else m?(y.shift("contents"),n()):this.set("__popped",!1).then(n)},defer:!0,init:!1},__popped:{handler:function(t){var e=this._transdone.resolve;if(t){var n=this.find("div"),r=n,i=r.offsetHeight+r.offsetTop,a=r.offsetWidth+r.offsetLeft,o=r.offsetParent;if(!this.overflows)for(var l=this.overflows={e:[],v:[]};n&&n.style;){if(n===o){if(n.offsetWidth>=a&&n.offsetHeight>=i)break;a+=n.offsetLeft,i+=n.offsetTop,o=n.offsetParent}var s=getComputedStyle(n);if("auto"===s.overflow)break;"hidden"===s.overflow&&(l.e.push(n),l.v.push(n.style.overflow),n.style.overflow="visible"),n=n.parentNode}this.position(),this.transition("pop",r,{intro:!0,dir:this.get("where")||"below"}).then(e)}else this.source=null,this.tailSource=null},defer:!0,init:!1},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(t){var e=this;return{teardown:function(){var t=e.overflows;if(t){e.overflows=null;for(var n=0;n<t.e.length;n++)t.e[n].style.overflow=t.v[n]}}}}},data:function(){return{gap:4}}});var k=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(e);e.extendWith(k,{template:{v:b.v,t:b.p.modal},data:function(){return{contents:[]}},use:[u(),g()],observe:{contents:function(t){m=(t||[]).length>0}},on:{init:function(){y?console.warn("More than one PopOver mobile host created."):y=this}}});var D=/[^\d]+/,M=/[^\d_]+/,T="_",L={y:0,M:1,d:2,H:3,m:4,s:5,S:6};function S(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,i=r.length;i<e;i++)r=n+r;return r}function C(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,i=r.length;i<e;i++)r+=n;return r}var F={mask:"yyyy-MM-dd",time:[0,0,0,0],date:function(){var t=new Date,e=F.time;return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e[0],e[1],e[2],e[3])},parseDate:function(t){return new Date(t)}};function Y(t){if("start"===t)t=[0,0,0,0];else if("end"===t)t=[23,59,59,999];else if("mid"===t)t=[12,0,0,0];else if("now"===t)t=function(){var t=new Date;return[t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]};else if("string"==typeof t){var e=new Date("2000-05-13T"+t+"Z");+e&&(t=[e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()])}return Array.isArray(t)||"function"==typeof t||Array.isArray(t())||(t=[0,0,0,0]),t}function R(t){void 0===t&&(t={});var e=t.mask||F.mask,n=Y(t.time||F.time),r=t.date||F.date;if("function"!=typeof r){var i=r;r=function(){return i}}return function(i){i.instance.decorators[t.name||"date"]=function(i,a,o){void 0===a&&(a={});var l=Object.assign({},t,"string"==typeof a?{value:a}:a,"string"==typeof o?{mask:o}:o);l.parseDate||(l.parseDate=t.parseDate||F.parseDate);var s=l.date||r,f=Y(l.time||n);if("function"!=typeof s){var c=s;s=function(){return c}}var u=this.getContext(i),p=l.mask||e,d={observers:[],listeners:[]},g=!1;if("INPUT"!==i.tagName)return console.warn("Attempted to add a date decorator a "+i.tagName),W;if(!p)return W;for(var h,v=[],m=0;h=A.exec(p);){var y={mask:h[0],type:h[0][0],length:h[0].length,start:h.index,end:h.index+h[0].length,chunk:v.length,prefix:p.substring(m,h.index),groups:v,value:null,display:C("",h[0].length,T)};m=y.end,v.push(y)}if(v.suffix=p.substring(v[v.length-1].end),v.last=null,v.slice(1).find(function(t){return!t.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+p+"'"),W;function b(t){if(null===v.value&&null===v.last||+v.value==+v.last)return 1;if(!t||!1===l.lazy){if(!1===l.null&&null===v.value)return N(v,v.last,l.parseDate),1;l.min&&v.value<l.min?(N(v,l.min,l.parseDate),O(v,i)):l.max&&v.value>l.max&&(N(v,l.max,l.parseDate),O(v,i)),v.last=v.value,"string"==typeof l.value&&(d.observers.forEach(function(t){return t.silence()}),u.set(l.value,v.value),d.observers.forEach(function(t){return t.resume()})),"string"==typeof l.display&&(d.observers.forEach(function(t){return t.silence()}),u.set(l.display,i.value),d.observers.forEach(function(t){return t.resume()}))}}l.min>l.max&&delete l.min,"string"==typeof l.value&&d.observers.push(u.observe(l.value,function(t){t||!1!==l.null||(t=s()),v.value=t,N(v,t,l.parseDate),v.last=t,O(v,i),(l.min&&t<l.min||l.max&&t>l.max)&&(v.last=null,setTimeout(b))},{defer:!0})),"string"==typeof l.display&&d.observers.push(u.observe(l.display,function(t){i.value=t||"",P(v,i,p),B(v),E(v,b,!0,s,f),O(v,i)},{defer:!0})),l.display||l.value||((l.date||!1===l.null)&&(v.value=K(l.date||s(),l.parseDate)),O(v,i));var w=function(t,e){void 0===e&&(e=i.selectionStart),t&&t.target&&(t=void 0),t||(t=e===i.value.length&&i.selectionEnd===i.value.length?v[0]:j(v,e)),g&&(g=!1,e<t.start&&(t=v[v.indexOf(t)-1])),document.activeElement===i&&i.setSelectionRange(t.start,t.end)};return d.listeners.push(u.listen("input",function(){var t=i.selectionStart,e=i.value;P(v,i,p);var n=j(v,t),r=B(v,n,t);if(E(v,b,!0,s,f),O(v,i),n&&(e.length>=p.length&&t===n.end||r)&&n!==v[v.length-1]){var a=v[v.indexOf(n)+1];w(a,t)}else i.setSelectionRange(t,t)})),d.listeners.push(u.listen("blur",function(){g=!1,b(!1)&&N(v,v.value,l.parseDate),null===v.value&&v.forEach(function(t){return t.value=null}),v.forEach(function(t){return t.display=z(t)}),O(v,i)})),d.listeners.push(u.listen("click",w)),d.listeners.push(u.listen("focus",w)),d.listeners.push(u.listen("keydown",function(t){switch(g=!1,t.key){case"Enter":case"Tab":var e=j(v,i.selectionStart),n=v.indexOf(e);B(v,e,i.selectionStart,!0)&&(O(v,i),E(v,b,t.shiftKey&&n>0||!t.shiftKey&&n+1<v.length,s,f)),t.shiftKey&&n>0?(w(v[n-1]),t.preventDefault(),t.stopPropagation()):!t.shiftKey&&n+1<v.length&&(w(v[n+1]),t.preventDefault(),t.stopPropagation());break;case"Backspace":g=!0;break;case"ArrowUp":case"ArrowDown":var r=[i.selectionStart,i.selectionEnd],a=r[0],o=r[1],l=j(v,a);null===l.value&&(l.value=1),function(t,e){switch(t.type){case"y":t.value=t.value+(e?-1:1);break;case"M":t.value=e?t.value<1?11:t.value-1:t.value>10?0:t.value+1;break;case"d":var n=t.groups,r=U(new Date((n.find(function(t){return"y"===t.type})||{value:1}).value,(n.find(function(t){return"M"===t.type})||{value:1}).value));t.value=e?t.value<2?r:t.value-1:t.value+1>r?1:t.value+1;break;case"H":t.value=e?t.value<1?23:t.value-1:t.value>22?0:t.value+1;break;case"h":t.value=e?t.value<1?12:t.value-1:t.value>11?1:t.value+1;break;case"m":case"s":t.value=e?t.value<1?59:t.value-1:t.value>58?0:t.value+1;break;case"S":t.value=e?t.value<1?999:t.value-1:t.value>998?0:t.value+1}}(l,"ArrowDown"===t.key),l.input=l.display=z(l),E(v,b,!0,s,f),O(v,i),t.preventDefault(),t.stopPropagation(),i.setSelectionRange(a,o)}})),{teardown:function(){d.observers.forEach(function(t){return t.cancel()}),d.listeners.forEach(function(t){return t.cancel()})}}}}}function P(t,e,n){var r=e.value,i=j(t,e.selectionStart),a=0,o=t[a],l=t[a+1];t.forEach(function(t){return t.input=""});for(var s=0;s<r.length;s++)l&&r[s]===l.prefix[0]&&(i!==o||o.input.length>=o.length||r.length-s<n.length-o.end+(o.length-o.input.length))?(l.prefix.length>1&&(s+=l.prefix.length-1),r[s+1]===l.prefix[0]&&(s+=l.prefix.length),o=t[++a],l=t[a+1]):o.input+=r[s]}function B(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);for(var i=!1,a=0;a<t.length;a++){var o=t[a],l=(o.input||"").replace(D,""),s=t[a+1]&&t[a+1].prefix&&M.test(o.input);if(l.length>o.length&&o===e){var f=l.length-e.length;l=l.substr(0,n-e.start)+l.substr(n-e.start+f)}else l=l.substr(0,o.length);if(o.input=l,"y"===o.type&&0===l.length&&(s||r))o.value=(new Date).getFullYear(),o.input=o.display=S(o.value,o.length),i=!0;else if("m"===o.type&&0===l.length&&(s||r))o.value=0,o.input=o.display=S(o.value,o.length),i=!0;else if("d"===o.type&&l.length!==o.length&&r)o.value=+l,o.display=z(o);else if(""===l)o.value=null,o.display=z(o);else if(o!==e)o.value=+l,"M"===o.type&&o.value--,o.display=z(o);else if("M"===o.type&&+l>1||"d"===o.type&&+l>3||"H"===o.type&&+l>2||("m"===o.type||"s"===o.type)&&+l>6)o.value=+l,"M"===o.type&&o.value--,o.display=S(l,o.length),i=!0;else if("y"===o.type&&2===l.length&&(s||r)){var c=(new Date).getFullYear(),u=100*Math.floor(c/100),p=Math.abs(c-(u+ +l))<20?u+ +l:u-100+ +l;o.value=p,o.input=o.display=S(p,o.length),i=!0}else o.display=C(l,o.length,T),o.value=+l,"M"===o.type&&o.value--}return i}function N(t,e,n){var r=(e=t.value=e&&K(e,n))?[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]:[null,null,null,null,null,null,null];t.forEach(function(t){t.value=r[L[t.type]],t.input=t.display=z(t)})}function E(t,e,n,r,i){var a=t.value||r(),o=[a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()];if(!t.find(function(t){return"m"===t.type||"s"===t.type||"h"===t.type||"S"===t.type})){"function"==typeof i&&(i=i());for(var l=0;l<4;l++)o[l+3]=i[l]}if(t.forEach(function(t){var e=t.value;null!==e&&"M"===t.type?e<0?e=0:e>11&&(e=11):null===e||"m"!==t.type&&"s"!==t.type?null!==e&&"H"===t.type?e<0?e=0:e>23&&(e=23):null!==e&&"h"===t.type&&(e<1?e=1:e>12&&(e=12)):e<0?e=0:e>59&&(e=59),e!==t.value&&(t.value=e,t.display=z(t)),o[L[t.type]]=t.value}),null!==o[0]&&null!==o[1]&&null!==o[2]){var s=t.find(function(t){return"d"===t.type});if(s)if(o[2]<1)s.value=o[2]=1,s.display=z(s);else{var f=U(new Date(o[0],o[1],1));o[2]>f&&(s.value=o[2]=f,s.display=s.input=z(s))}}t.find(function(t){return null===t.value})||0===o[0]||o[1]>11||o[1]<0||0===o[2]?t.value=null:(o.unshift(null),t.value=new(Date.bind.apply(Date,o))),e(n)}function O(t,e){e.value=t.reduce(function(t,e){return t+e.prefix+e.display},"")+t.suffix}function j(t,e){return t.find(function(t){return e>=t.start&&e<=t.end})}function z(t){if(null===t.value)return S("",t.length,T);switch(t.type){case"y":return t.value?t.length<=2?(""+t.value).substr(2,2):""+S(t.value,t.length):S("",t.length,T);case"M":return~t.value?1===t.length?""+(t.value+1):2===t.length?(t.value<9?"0":"")+(t.value+1):3===t.length?H[t.value].substr(0,3):H[t.value]:S("",t.length,T);case"d":return t.value?1===t.length?""+t.value:2===t.length?(t.value<=9?"0":"")+t.value:3===t.length?I[t.groups.value.getDay()].substr(0,3):I[t.groups.value.getDay()]:S("",t.length,T);case"H":case"h":case"m":case"s":return 1===t.length?""+t.value:S(t.value,t.length);case"S":return 1===t.length?""+t.value:S(t.value,3)}}var A=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,H=["January","February","March","April","May","June","July","August","September","October","November","December"],I=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],W={teardown:function(){}};function U(t){return new Date(new Date(t.getFullYear(),t.getMonth()+1,1)-864e5).getDate()}var J=new Date("0000-01-01T00:00:00");function K(t,e){var n=t;if("function"==typeof n&&(n=t()),"string"==typeof n)if("function"==typeof e)try{n=e(n)}catch(t){return defaultDate()}else try{n=new Date(n)}catch(t){return defaultDate()}return n instanceof Date?n:J}function q(t){t.strObserver&&t.strObserver.cancel(),t.attributes.value?t.link(t.attributes.value,"rdi.val"):t.unlink("rdi.val"),t.attributes.display?t.link(t.attributes.display,"rdi.display"):t.unlink("rdi.display"),t.attributes.string&&(t.strObserver=t.observe("rdi.val",function(e){return t.set(t.attributes.string,e?e.toString():"")}));var e={};["null","lazy","eager","mask","min","max","mask","no-pick","time"].forEach(function(n){n in t.attributes&&(e[n.replace(/-/g,"")]=t.attributes[n]),"eager"===n&&n in t.attributes&&(e.lazy=!t.attributes.eager)}),t.attributes.value&&(e.value="rdi.val"),t.attributes.display&&(e.display="rdi.display"),t.set("rdi.opts",e)}var X=Ractive.macro(function(t){return t.aliasLocal("rdi"),q(t),t.setTemplate({v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rdi-date field-wrapper",g:1}],f:[{t:7,e:"input",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["node"]'}},{n:"rdi-date",t:71,f:{r:["rdi.opts"],s:"[_0]"}},{n:"class-rdi-date",t:13},{t:8,r:"extra-attributes"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-x",g:1},{n:["click"],t:70,f:{r:["@context"],s:'[(_0).set("rdi.val",null)]'}},{n:"title",f:"Clear",t:13,g:1}],f:["×"]}],n:50,x:{r:["rdi.opts.null","rdi.val"],s:"_0&&_1!==null"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-pop",g:1},{n:"rdi-pop",t:71,f:{r:["rdi.node","rdi.tail"],s:'[{path:"rdi.popped",node:_0,tail:_1}]'}},{n:["click"],t:70,f:{r:[],s:"[false,false]"}},{n:"title",f:"Select from calendar",t:13,g:1}],f:[{t:7,e:"svg",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["tail"]'}},{n:"x",f:"0px",t:13,g:1},{n:"y",f:"0px",t:13,g:1},{n:"viewBox",f:"0 0 48 48",t:13,g:1},{n:"xml:space",f:"preserve",t:13}],f:[{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.5;fill:none;stroke-width:1;",g:1},{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"46",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.8;stroke:none;",g:1},{t:13,n:"class",f:"rdi-today",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}]}]}],n:51,r:"rdi.opts.nopick"}]}," ",{t:7,e:"rdi-pop",m:[{n:"popped",t:13,f:[{t:2,r:"rdi.popped"}]},{n:"tail",f:0,t:13},{n:"align",f:"end",t:13,g:1}],f:[{t:7,e:"rdi-picker",m:[{n:["init"],t:70,f:{r:["@context","rdi.val"],s:'[(_0).component.set("target",_1)]'}},{n:"date",t:13,f:[{t:2,r:"rdi.val"}]}]}]}],e:{'["node"]':function(){return["node"]},"[_0]":function(t){return[t]},'[(_0).set("rdi.val",null)]':function(t){return[t.set("rdi.val",null)]},"_0&&_1!==null":function(t,e){return t&&null!==e},'[{path:"rdi.popped",node:_0,tail:_1}]':function(t,e){return[{path:"rdi.popped",node:t,tail:e}]},"[false,false]":function(){return[!1,!1]},'["tail"]':function(){return["tail"]},'[(_0).component.set("target",_1)]':function(t,e){return[t.component.set("target",e)]}}}),{update:function(){q(t)}}},{css:function(t){return[function(t){return".rdi-date {\n position: relative;\n display: inline-block;\n }\n \n .rdi-date input.rdi-date {\n width: 100%;\n box-sizing: border-box;\n }\n \n .rdi-x {\n position: absolute;\n right: 2em;\n top: 0.025em;\n cursor: pointer;\n }\n \n .rdi-pop {\n position: absolute;\n display: flex;\n justify-content: space-around;\n align-items: flex-end;\n flex-direction: column;\n right: 0.5em;\n height: 100%;\n top: 0;\n cursor: pointer;\n }\n \n .rdi-pop > svg {\n height: 48px;\n max-height: 60%;\n fill: "+(t("raui.dateInput.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n \n .rdi-today {\n fill: "+(t("raui.dateInput.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }"}.call(this,t)].join(" ")},cssId:"rdi",noCssTransform:!0,attributes:["value","null","lazy","eager","mask","string","display","min","max","no-pick","time"]});t.DateInput=X,t.default=function(t){return void 0===t&&(t={}),function(e){var n,r=e.instance;r.components["rdi-picker"]=l,r.components["rdi-pop"]=_,(void 0===(n={name:"rdi-pop"})&&(n={}),function(t){t.instance.decorators[n.name||"pop"]=function(t,e,r){if(void 0===r&&(r={}),!e)return{teardown:w};"string"==typeof e?r.path=e:"object"==typeof e&&(r=e);var i,a,o=this.getContext(t);function l(n){if("mouseover"!==n.type||!o.get(e)){if("click"!==n.type||!a||i){var l=h,s=v;"function"==typeof(h=r.node||t)&&(h=h()),h=h||t,"function"==typeof(v=r.tail)&&(v=v()),o.toggle(r.path),h=l,v=s}a&&"click"===n.type&&(i=o.observeOnce(r.path,function(){i=null}))}}function s(t){i||o.set(r.path,!1)}return("click"in r?r.click:!1!==n.click)&&o.listen("click",l),("hover"in r?r.hover:n.hover)&&(a=1,o.listen("mouseover",l),o.listen("mouseout",s)),{teardown:function(){o.unlisten("click",l),a&&(o.unlisten("mouseover",l),o.unlisten("mouseout",s),i&&i.cancel())}}}})({instance:r}),R({name:"rdi-date",parseDate:t.parseDate})({instance:r}),r.partials[t.name||"date-input"]=X,r.decorators["rdi-reg"]=function(t,e){return this.getContext(t).set("rdi."+e,function(){return t}),{teardown:function(){}}}}},Object.defineProperty(t,"__esModule",{value:!0})});

@@ -43,3 +43,3 @@ (function (global, factory) {

return ("\n label.field, .field-manual {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid " + (primary.bc || '#ccc') + ";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: " + (primary.radius || '0.2em') + ";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n color: " + (primary.fg || '#222') + ";\n }\n\n label.field.focus {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n\n label.field.textarea.focus {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input,\n label.field select,\n label.field textarea,\n .field-manual .field-body\n {\n display: block;\n border-width: " + (boxy ? '0.0625em' : '0 0 0.0625em 0') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n box-sizing: border-box;\n background-color: " + (boxy ? primary.bg || '#fff' : 'transparent') + ";\n color: " + (primary.fg || '#222') + ";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";") : '') + "\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input" + (boxy ? '' : ':disabled') + ",\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding: 0 0.75em;\n }\n label.field select" + (boxy ? '' : ':disabled') + " {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: " + (disabled.bg || '#f4f4f4') + ";\n color: " + (disabled.fg || '#444') + ";\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n " + (!boxy ? ("label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em 0.0625em " + (primary.bc || '#ccc') + ",\n 0.0625em -0.0625em " + (primary.bc || '#ccc') + ",\n -0.0625em -0.0625em " + (primary.bc || '#ccc') + ";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em 0.0625em " + (active.fg || primary.fga || '#07e') + ",\n 0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ",\n -0.0625em -0.0625em " + (active.fg || primary.fga || '#07e') + ";\n }") : '') + "\n\n /**** CHECK BOXES ****/\n\n label.field.check, label.field.radio {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -0.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\n background-color: " + (primary.bc || '#ccc') + ";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: " + (primary.fg || '#222') + ";\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: '';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"" + ((primary.bg || '#fff').replace(/#/g, '%23')) + "\" d=\"m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z\" /></svg>') " + (primary.fga || '#07e') + ";\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><circle fill=\"" + ((primary.bg || '#fff').replace(/#/g, '%23')) + "\" cx=\"8\" cy=\"8\" r=\"5\" /></svg>') " + (primary.fga || '#07e') + ";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: " + (primary.fga || '#07e') + ";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: " + (disabled.fg || '#444') + ";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: " + (disabled.bc || '#ccc') + ";\n background-color: " + (disabled.bg || '#f4f4f4') + ";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: " + (disabled.bc || '#ccc') + ";\n }\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 1.125em;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: " + (primary.bc || '#ccc') + ";\n }\n\n label.field textarea {\n border: none;" + (boxy ? "\n padding: 0;" : '') + "\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: " + (active.fg || primary.fga || '#07e') + ";\n " + (!boxy ? ("box-shadow: 0 0.0625em 0 0 " + (active.fg || primary.fga || '#07e') + ";") : '') + "\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: " + (active.fg || primary.fga || '#07e') + ";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: " + (primary.fg || '#222') + ";\n text-align: " + (boxy ? 'center' : 'left') + ";\n padding: 0.5em " + (boxy ? '0.5em' : '0') + ";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;" + (boxy ? ("\n border-radius: " + (primary.radius || '0.2em') + ";\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0.0625em;") : ("\n border-bottom-color: " + (primary.bc || '#ccc') + ";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")) + "\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: " + (boxy ? '1.7' : '1.958') + "em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: " + (boxy ? '0.15em' : '0') + ";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n " + (boxy ? ("height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid " + (primary.bg || '#fff') + ";\n margin-left: 0;") :
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n ");
"height: 2.25em;") + "\n }" + (boxy ? ("\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 " + (primary.radius || '0.2em') + " " + (primary.radius || '0.2em') + " 0;\n }\n label.field .with-buttons input {\n border-radius: " + (primary.radius || '0.2em') + " 0 0 " + (primary.radius || '0.2em') + ";\n min-width: 0;\n }\n ") : '') + "\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1." + (boxy ? '15' : '1') + "em;\n }\n\n .just-the.field-tip,\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff;') + ";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1em;\n font-family: monospace;\n text-align: center;\n margin-top: -0.2em;\n cursor: help;\n }\n .just-the.field-tip.field-tip-error {\n background-color: " + (primary.error || '#ca3c3c') + ";\n }\n .just-the.field-tip.field-tip-warn {\n background-color: " + (primary.warn || '#f79e0b') + ";\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n ");
// TODO: other themes

@@ -300,3 +300,3 @@ }

],
f: '?'
f: '?',
}); }

@@ -319,2 +319,26 @@ var inline = attrs.find(function (a) { return a.n === 'inline'; });

var tip = Ractive$1.macro(function (handle) {
handle.aliasLocal('__rtip');
var body = [{
t: 7, e: 'span', m: (handle.template.m || []).concat([
{ t: 13, n: 'class', f: ["just-the field-tip", { t: 4, f: [' field-tip-error'], x: { r: ['__rtip.attrs.type'], s: '_0==="error"' } }, { t: 4, f: [' field-tip-warn'], x: { r: ['__rtip.attrs.type'], s: '_0==="warn"' } }] },
{ t: 13, n: 'title', f: Array.isArray(handle.template.f) || typeof handle.template.f === 'string' ? handle.template.f : [handle.template.f] },
{ t: 70, n: ['click'], f: { r: [], s: '[false]' } }
]),
f: [{ t: 4, f: [{ t: 3, r: '__rtip.attrs.sign' }], n: 50, r: '__rtip.attrs.sign' }, { t: 4, f: ['!'], n: 50, x: { r: ['__rtip.attrs.type'], s: '_0==="error"||_0==="warn"' }, l: 1 }, { t: 4, f: ['?'], n: 51, l: 1 }],
}];
handle.set('__rtip.attrs', handle.attributes);
handle.setTemplate(body);
return {
update: function update() {
handle.set('__rtip.attrs', handle.attributes);
}
};
}, {
attributes: ['sign', 'type'],
});
function autofocus(node, opts) {

@@ -352,2 +376,3 @@ if (typeof node.focus === 'function' && !node.disabled) {

instance.partials[opts.name || 'field'] = macro;
instance.partials[opts.tipName || 'tip'] = tip;
instance.decorators[opts.name || 'field'] = field;

@@ -360,2 +385,3 @@ instance.decorators[opts.autofocusName || 'autofocus'] = autofocus;

globalRegister('field', 'partials', macro);
globalRegister('tip', 'partials', tip);
globalRegister('autofocus', 'decorators', autofocus);

@@ -362,0 +388,0 @@

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(e.RauiForm={},e.Ractive)}(this,function(e,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var i="undefined"!=typeof window?window:null;function l(e,n,l){if(i&&i.Ractive&&"object"==typeof i.Ractive[n]){var t=document.currentScript;if(t||(t=(t=document.querySelectorAll("script"))[t.length-1]),t){var a=t.getAttribute("data-alias");a&&(a=(a=a.split("&")).reduce(function(e,n){var i=n.split("="),l=i[0],t=i[1];return e[l]=t,e},{})),Ractive[n][a&&a[e]||e]=l}}}function t(e){var n=Object.assign({},e("raui.primary"),e("raui.form.primary")),i=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),l=Object.assign({},e("raui.primary.disabled"),e("raui.form.primary.disabled")),t=e("raui.form.boxy");return"\n label.field, .field-manual {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(n.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(n.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(t?n.bg||"#fff":"transparent")+";\n color: "+(n.fg||"#222")+";\n }\n\n label.field.focus {\n color: "+(i.fg||n.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(i.fg||n.fga||"#07e")+";\n "+(t?"":"box-shadow: 0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n 0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea,\n .field-manual .field-body\n {\n display: block;\n border-width: "+(t?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(t?n.bg||"#fff":"transparent")+";\n color: "+(n.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(t?"\n border-radius: "+(n.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(t?"":":disabled")+",\n label.field select"+(t?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(t?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(l.bg||"#f4f4f4")+";\n color: "+(l.fg||"#444")+";\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(t?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(n.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(n.bc||"#ccc")+",\n -0.0625em 0.0625em "+(n.bc||"#ccc")+",\n 0.0625em -0.0625em "+(n.bc||"#ccc")+",\n -0.0625em -0.0625em "+(n.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em 0.0625em "+(i.fg||n.fga||"#07e")+",\n 0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+",\n -0.0625em -0.0625em "+(i.fg||n.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check, label.field.radio {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -0.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\n background-color: "+(n.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(n.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(n.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(n.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(n.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(n.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(n.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(l.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(l.bc||"#ccc")+";\n background-color: "+(l.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(l.bc||"#ccc")+";\n }\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 1.125em;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(n.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(t?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(i.fg||n.fga||"#07e")+";\n "+(t?"":"box-shadow: 0 0.0625em 0 0 "+(i.fg||n.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(i.fg||n.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(n.fg||"#222")+";\n text-align: "+(t?"center":"left")+";\n padding: 0.5em "+(t?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(t?"\n border-radius: "+(n.radius||"0.2em")+";\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(n.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(t?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(t?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(t?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(n.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(t?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(n.radius||"0.2em")+" "+(n.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(n.radius||"0.2em")+" 0 0 "+(n.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(t?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(n.fga||"#07e")+";\n color: "+(n.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "}function a(){}function r(e){~this.className.indexOf("focus")||(this.className+=" focus")}function o(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function c(e){var n,i,l,t,c,d,f,s,b,u,p,m,h,g=this.getContext(e);function y(){var a=v().split(/\s+/).filter(function(e){return!!e});(n=!!~a.indexOf("field"))||(a.push("field"),n=!0),(i=e.querySelector("input[type=checkbox]"))&&!~a.indexOf("check")&&a.push("check"),(l=e.querySelector("input[type=radio]"))&&!~a.indexOf("radio")&&a.push("radio");var r=i||l;r&&r.checked&&!~a.indexOf("checked")&&a.push("checked"),r&&r.disabled&&!~a.indexOf("disabled")&&a.push("disabled"),!r&&u?(u.cancel(),u=0,p&&(p.disconnect(),p=0),delete r._form_callback,h&&(delete h.checked,m=h=void 0)):r&&(r._form_callback=function(n,i){if(void 0===i&&(i=!0),i&&"radio"===r.type&&r.name){var l=[];l.push.apply(l,document.querySelectorAll("input[type=radio][name="+r.name+"]")),(l=l.filter(function(e){return e!==r})).forEach(function(e){return e._form_callback&&e._form_callback(n,!1)})}var t=r.checked;t&&!~e.className.indexOf("checked")?e.className+=" checked":!t&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(p=new MutationObserver(function(){var n;(n=r.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!n&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(r,{attributes:!0}),u=this.getContext(r).listen("change",r._form_callback),(m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"checked"))&&m.configurable&&(h=r,Object.defineProperty(r,"checked",{get:m.get,set:function(e){m.set.call(h,e),r._form_callback()},enumerable:!0,configurable:!0}))),(t=!!e.querySelector("textarea"))&&!~a.indexOf("textarea")&&a.push("textarea"),(c=!!e.querySelector("select"))&&!~a.indexOf("select")&&a.push("select"),(d=!!e.querySelector("input[type=file]"))&&!~a.indexOf("file")&&a.push("file"),(f=!!(f=e.querySelector("button"))&&f.parentNode===e)&&!~a.indexOf("button")&&a.push("button"),(s=!!e.querySelector("div"))&&!~a.indexOf("plain")&&a.push("plain"),(b=!(i||l||d||!e.querySelector("input")))&&!~a.indexOf("input")&&a.push("input"),e.className=a.join(" ")}function v(){var a=e.className;return n||(a=a.replace(/\bfield\b/g,"").trim()),i||(a=a.replace(/\bcheck(ed)?\b/g,"").trim()),l||(a=a.replace(/\bradio\b/g,"").trim()),t||(a=a.replace(/\btextarea\b/g,"").trim()),c||(a=a.replace(/\bselect\b/g,"").trim()),d||(a=a.replace(/\bfile\b/g,"").trim()),f||(a=a.replace(/\bbutton\b/g,"").trim()),s||(a=a.replace(/\bplain\b/g,"").trim()),b||(a=a.replace(/\binput\b/g,"").trim()),a=a.replace(/ +/g," ")}var x=g.listen("focusin",r),k=g.listen("focusout",o);y.call(this);var w={update:a,invalidate:y.bind(this),teardown:function(){g.ractive.fire("fieldUnregistered",g,e,w);var n=v();n=n.replace(/\bfocus\b/g,"").trim(),x.cancel(),k.cancel(),u&&u.cancel(),p&&p.disconnect(),h&&(delete h.checked,m=h=void 0),e.className=n},setDisabled:function(n){e.querySelectorAll("input,button,select,textarea").forEach(function(e){return e.disabled=n}),this.invalidate()}};return g.ractive.fire("fieldRegistered",g,e,w),w}function d(e,n){if(!e)return!1;for(var i=0;i<e.length;i++){if(e[i].e===n)return!0;if(e[i].f&&d(e[i].f,n))return!0}return!1}c.style=t;var f=n.macro(function(e){var n=[],i=[],l=(e.template.m||[]).slice(),t=e.template.f||[],a=l.find(function(e){return"value"===e.n}),r=l.find(function(e){return"type"===e.n}),o=l.find(function(e){return"tip"===e.n}),c=l.find(function(e){return"disabled"===e.n}),s=l.find(function(e){return"maxlength"===e.n});if(o&&l.splice(l.indexOf(o),1),r&&"function"==typeof f.types[r.f])n.push.apply(n,f.types[r.f](l,t,e));else if(a){var b={t:7,e:"input",m:[a]};if(c&&b.m.push(c),s&&b.m.push(s),d(t,"option")&&(b.e="select",b.f=t),r&&(b.m.push(r),"checkbox"===r.f||"radio"===r.f)){var u=l.find(function(e){return"target"===e.n});u?b.m.push(Object.assign({},u,{n:"name"})):b.m.splice(b.m.indexOf(a),1,Object.assign({},a,{n:"checked"}))}b.m=b.m.concat(l.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),n.push(b);var p=t.filter(function(e){return"button"===e.e||d(e.f,"button")});p.length&&(n.push.apply(n,p),n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}else{t.forEach(function(e){"label"===e.e?e.f&&e.f.length&&i.push.apply(i,e.f):n.push(e)});var m=t.filter(function(e){return e.e});m.find(function(e){return"button"===e.e})&&m.length>1&&(n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}var h=l.find(function(e){return"label"===e.n});h&&h.f&&h.f.length&&i.push.apply(i,Array.isArray(h.f)?h.f:[h.f]),o&&n.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(i.length?"":" field-solo-tip"),g:1},{t:13,n:"title",f:o.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"});var g=l.find(function(e){return"inline"===e.n});i&&!g?n.unshift.apply(n,i):g||n.unshift(" ");var y={t:7,e:"label",m:[{t:71,n:"field"}].concat(l.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n&&"disabled"!==e.n})),f:n};g&&y.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([y])});function s(e,n){return"function"!=typeof e.focus||e.disabled||(n&&n.immediate?e.focus():setTimeout(function(){return!e.disabled&&e.focus()},(n||{}).timeout||250)),{teardown:a}}function b(e){return void 0===e&&(e={}),function(n){var i=n.Ractive,l=n.instance;if(!i.isInstance(l)&&e.includeStyle)if(l===i)i.addCSS("form-decorator",t);else{var a=l.css;l.css=function(e){return("function"!=typeof a?a||"":a(e))+t(e)}}l.partials[e.name||"field"]=f,l.decorators[e.name||"field"]=c,l.decorators[e.autofocusName||"autofocus"]=s}}f.types={},l("field","decorators",c),l("field","partials",f),l("autofocus","decorators",s),e.style=t,e.field=c,e.macro=f,e.autofocus=s,e.plugin=b,e.default=b,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(e.RauiForm={},e.Ractive)}(this,function(e,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var t="undefined"!=typeof window?window:null;function i(e,n,i){if(t&&t.Ractive&&"object"==typeof t.Ractive[n]){var l=document.currentScript;if(l||(l=(l=document.querySelectorAll("script"))[l.length-1]),l){var a=l.getAttribute("data-alias");a&&(a=(a=a.split("&")).reduce(function(e,n){var t=n.split("="),i=t[0],l=t[1];return e[i]=l,e},{})),Ractive[n][a&&a[e]||e]=i}}}function l(e){var n=Object.assign({},e("raui.primary"),e("raui.form.primary")),t=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),i=Object.assign({},e("raui.primary.disabled"),e("raui.form.primary.disabled")),l=e("raui.form.boxy");return"\n label.field, .field-manual {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(n.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(n.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(l?n.bg||"#fff":"transparent")+";\n color: "+(n.fg||"#222")+";\n }\n\n label.field.focus {\n color: "+(t.fg||n.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(t.fg||n.fga||"#07e")+";\n "+(l?"":"box-shadow: 0.0625em 0.0625em "+(t.fg||n.fga||"#07e")+",\n -0.0625em 0.0625em "+(t.fg||n.fga||"#07e")+",\n 0.0625em -0.0625em "+(t.fg||n.fga||"#07e")+",\n -0.0625em -0.0625em "+(t.fg||n.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea,\n .field-manual .field-body\n {\n display: block;\n border-width: "+(l?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(l?n.bg||"#fff":"transparent")+";\n color: "+(n.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(l?"\n border-radius: "+(n.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(l?"":":disabled")+",\n label.field select"+(l?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(l?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field input[readonly],\n label.field select:disabled,\n label.field textarea:disabled,\n label.field textarea[readonly] {\n background: "+(i.bg||"#f4f4f4")+";\n color: "+(i.fg||"#444")+";\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(l?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(n.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(n.bc||"#ccc")+",\n -0.0625em 0.0625em "+(n.bc||"#ccc")+",\n 0.0625em -0.0625em "+(n.bc||"#ccc")+",\n -0.0625em -0.0625em "+(n.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(t.fg||n.fga||"#07e")+",\n -0.0625em 0.0625em "+(t.fg||n.fga||"#07e")+",\n 0.0625em -0.0625em "+(t.fg||n.fga||"#07e")+",\n -0.0625em -0.0625em "+(t.fg||n.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check, label.field.radio {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline, label.field.radio.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input, label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -0.5em;\n top: 1em;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 3.2em;\n height: 3.2em;\n background-color: "+(n.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input, label.field.inline.radio input {\n top: -0.45em;\n left: -0.55em;\n }\n\n label.field.check input:checked, label.field.radio input:checked {\n background-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check:hover > input, label.field.radio:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus, label.field.radio input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus, label.field.radio:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active, label.field.radio input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before, label.field.radio:before {\n content: '';\n display: inline-block;\n box-sizing: border-box;\n margin: 0 0.5em 0.2em 0.1em;\n border: solid 0.125em; /* Safari */\n border-color: "+(n.fg||"#222")+';\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after, label.field.radio:after {\n content: \'\';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 2.3em;\n left: 0.6em;\n border-radius: 0.125em;\n }\n label.field.check.inline:after, label.field.radio.inline:after {\n top: 0.8em;\n }\n\n label.field.check.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(n.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(n.fga||"#07e")+';\n }\n\n label.field.radio.checked:after {\n opacity: 1;\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle fill="'+(n.bg||"#fff").replace(/#/g,"%23")+'" cx="8" cy="8" r="5" /></svg>\') '+(n.fga||"#07e")+";\n }\n\n label.field.check.checked:before, label.field.radio.checked:before {\n border-color: "+(n.fga||"#07e")+";\n }\n label.field.check.focus:before, label.field.radio.focus:before {\n border-color: "+(n.fga||"#07e")+";\n }\n\n label.field.check input:disabled, label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled, label.field.radio.disabled {\n color: "+(i.fg||"#444")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before, label.field.radio.disabled:before {\n border-color: "+(i.bc||"#ccc")+";\n background-color: "+(i.bg||"#f4f4f4")+";\n }\n\n label.field.check.checked.disabled:after, label.field.radio.checked.disabled:after {\n border-color: transparent;\n background-color: "+(i.bc||"#ccc")+";\n }\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 1.125em;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(n.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(l?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(t.fg||n.fga||"#07e")+";\n "+(l?"":"box-shadow: 0 0.0625em 0 0 "+(t.fg||n.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(t.fg||n.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(n.fg||"#222")+";\n text-align: "+(l?"center":"left")+";\n padding: 0.5em "+(l?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(l?"\n border-radius: "+(n.radius||"0.2em")+";\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(n.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(l?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(l?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(l?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(n.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(l?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(n.radius||"0.2em")+" "+(n.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(n.radius||"0.2em")+" 0 0 "+(n.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n font-weight: normal;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n min-height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(l?"15":"1")+"em;\n }\n\n .just-the.field-tip,\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(n.fga||"#07e")+";\n color: "+(n.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1em;\n font-family: monospace;\n text-align: center;\n margin-top: -0.2em;\n cursor: help;\n }\n .just-the.field-tip.field-tip-error {\n background-color: "+(n.error||"#ca3c3c")+";\n }\n .just-the.field-tip.field-tip-warn {\n background-color: "+(n.warn||"#f79e0b")+";\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "}function a(){}function r(e){~this.className.indexOf("focus")||(this.className+=" focus")}function o(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function c(e){var n,t,i,l,c,f,d,s,b,u,p,m,h,g=this.getContext(e);function y(){var a=v().split(/\s+/).filter(function(e){return!!e});(n=!!~a.indexOf("field"))||(a.push("field"),n=!0),(t=e.querySelector("input[type=checkbox]"))&&!~a.indexOf("check")&&a.push("check"),(i=e.querySelector("input[type=radio]"))&&!~a.indexOf("radio")&&a.push("radio");var r=t||i;r&&r.checked&&!~a.indexOf("checked")&&a.push("checked"),r&&r.disabled&&!~a.indexOf("disabled")&&a.push("disabled"),!r&&u?(u.cancel(),u=0,p&&(p.disconnect(),p=0),delete r._form_callback,h&&(delete h.checked,m=h=void 0)):r&&(r._form_callback=function(n,t){if(void 0===t&&(t=!0),t&&"radio"===r.type&&r.name){var i=[];i.push.apply(i,document.querySelectorAll("input[type=radio][name="+r.name+"]")),(i=i.filter(function(e){return e!==r})).forEach(function(e){return e._form_callback&&e._form_callback(n,!1)})}var l=r.checked;l&&!~e.className.indexOf("checked")?e.className+=" checked":!l&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(p=new MutationObserver(function(){var n;(n=r.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!n&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(r,{attributes:!0}),u=this.getContext(r).listen("change",r._form_callback),(m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"checked"))&&m.configurable&&(h=r,Object.defineProperty(r,"checked",{get:m.get,set:function(e){m.set.call(h,e),r._form_callback()},enumerable:!0,configurable:!0}))),(l=!!e.querySelector("textarea"))&&!~a.indexOf("textarea")&&a.push("textarea"),(c=!!e.querySelector("select"))&&!~a.indexOf("select")&&a.push("select"),(f=!!e.querySelector("input[type=file]"))&&!~a.indexOf("file")&&a.push("file"),(d=!!(d=e.querySelector("button"))&&d.parentNode===e)&&!~a.indexOf("button")&&a.push("button"),(s=!!e.querySelector("div"))&&!~a.indexOf("plain")&&a.push("plain"),(b=!(t||i||f||!e.querySelector("input")))&&!~a.indexOf("input")&&a.push("input"),e.className=a.join(" ")}function v(){var a=e.className;return n||(a=a.replace(/\bfield\b/g,"").trim()),t||(a=a.replace(/\bcheck(ed)?\b/g,"").trim()),i||(a=a.replace(/\bradio\b/g,"").trim()),l||(a=a.replace(/\btextarea\b/g,"").trim()),c||(a=a.replace(/\bselect\b/g,"").trim()),f||(a=a.replace(/\bfile\b/g,"").trim()),d||(a=a.replace(/\bbutton\b/g,"").trim()),s||(a=a.replace(/\bplain\b/g,"").trim()),b||(a=a.replace(/\binput\b/g,"").trim()),a=a.replace(/ +/g," ")}var x=g.listen("focusin",r),k=g.listen("focusout",o);y.call(this);var w={update:a,invalidate:y.bind(this),teardown:function(){g.ractive.fire("fieldUnregistered",g,e,w);var n=v();n=n.replace(/\bfocus\b/g,"").trim(),x.cancel(),k.cancel(),u&&u.cancel(),p&&p.disconnect(),h&&(delete h.checked,m=h=void 0),e.className=n},setDisabled:function(n){e.querySelectorAll("input,button,select,textarea").forEach(function(e){return e.disabled=n}),this.invalidate()}};return g.ractive.fire("fieldRegistered",g,e,w),w}function f(e,n){if(!e)return!1;for(var t=0;t<e.length;t++){if(e[t].e===n)return!0;if(e[t].f&&f(e[t].f,n))return!0}return!1}c.style=l;var d=n.macro(function(e){var n=[],t=[],i=(e.template.m||[]).slice(),l=e.template.f||[],a=i.find(function(e){return"value"===e.n}),r=i.find(function(e){return"type"===e.n}),o=i.find(function(e){return"tip"===e.n}),c=i.find(function(e){return"disabled"===e.n}),s=i.find(function(e){return"maxlength"===e.n});if(o&&i.splice(i.indexOf(o),1),r&&"function"==typeof d.types[r.f])n.push.apply(n,d.types[r.f](i,l,e));else if(a){var b={t:7,e:"input",m:[a]};if(c&&b.m.push(c),s&&b.m.push(s),f(l,"option")&&(b.e="select",b.f=l),r&&(b.m.push(r),"checkbox"===r.f||"radio"===r.f)){var u=i.find(function(e){return"target"===e.n});u?b.m.push(Object.assign({},u,{n:"name"})):b.m.splice(b.m.indexOf(a),1,Object.assign({},a,{n:"checked"}))}b.m=b.m.concat(i.filter(function(e){return 73===e.t||73===e.t||"placeholder"===e.n})),n.push(b);var p=l.filter(function(e){return"button"===e.e||f(e.f,"button")});p.length&&(n.push.apply(n,p),n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}else{l.forEach(function(e){"label"===e.e?e.f&&e.f.length&&t.push.apply(t,e.f):n.push(e)});var m=l.filter(function(e){return e.e});m.find(function(e){return"button"===e.e})&&m.length>1&&(n=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:n}])}var h=i.find(function(e){return"label"===e.n});h&&h.f&&h.f.length&&t.push.apply(t,Array.isArray(h.f)?h.f:[h.f]),o&&n.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(t.length?"":" field-solo-tip"),g:1},{t:13,n:"title",f:o.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"});var g=i.find(function(e){return"inline"===e.n});t&&!g?n.unshift.apply(n,t):g||n.unshift(" ");var y={t:7,e:"label",m:[{t:71,n:"field"}].concat(i.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n&&"disabled"!==e.n})),f:n};g&&y.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([y])});d.types={};var s=n.macro(function(e){e.aliasLocal("__rtip");var n=[{t:7,e:"span",m:(e.template.m||[]).concat([{t:13,n:"class",f:["just-the field-tip",{t:4,f:[" field-tip-error"],x:{r:["__rtip.attrs.type"],s:'_0==="error"'}},{t:4,f:[" field-tip-warn"],x:{r:["__rtip.attrs.type"],s:'_0==="warn"'}}]},{t:13,n:"title",f:Array.isArray(e.template.f)||"string"==typeof e.template.f?e.template.f:[e.template.f]},{t:70,n:["click"],f:{r:[],s:"[false]"}}]),f:[{t:4,f:[{t:3,r:"__rtip.attrs.sign"}],n:50,r:"__rtip.attrs.sign"},{t:4,f:["!"],n:50,x:{r:["__rtip.attrs.type"],s:'_0==="error"||_0==="warn"'},l:1},{t:4,f:["?"],n:51,l:1}]}];return e.set("__rtip.attrs",e.attributes),e.setTemplate(n),{update:function(){e.set("__rtip.attrs",e.attributes)}}},{attributes:["sign","type"]});function b(e,n){return"function"!=typeof e.focus||e.disabled||(n&&n.immediate?e.focus():setTimeout(function(){return!e.disabled&&e.focus()},(n||{}).timeout||250)),{teardown:a}}function u(e){return void 0===e&&(e={}),function(n){var t=n.Ractive,i=n.instance;if(!t.isInstance(i)&&e.includeStyle)if(i===t)t.addCSS("form-decorator",l);else{var a=i.css;i.css=function(e){return("function"!=typeof a?a||"":a(e))+l(e)}}i.partials[e.name||"field"]=d,i.partials[e.tipName||"tip"]=s,i.decorators[e.name||"field"]=c,i.decorators[e.autofocusName||"autofocus"]=b}}i("field","decorators",c),i("field","partials",d),i("tip","partials",s),i("autofocus","decorators",b),e.style=l,e.field=c,e.macro=d,e.autofocus=b,e.plugin=u,e.default=u,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -115,2 +115,11 @@ (function (global, factory) {

Split.prototype.size = function size (idx, size$1) {
if (this.get(("splits." + idx))) {
var sets = {};
sets[("splits." + idx + ".lastSet")] = sets[("splits." + idx + ".curSize")] = sets[("splits." + idx + ".size")] = size$1;
this.set(sets);
this._adjustSizes();
}
};
return Split;

@@ -117,0 +126,0 @@ }(Ractive$1));

@@ -1,1 +0,1 @@

!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],i):i(t.RauiSplit={},t.Ractive)}(this,function(t,i){"use strict";i=i&&i.hasOwnProperty("default")?i.default:i;var e="undefined"!=typeof window?window:null;var n=function(t){function i(i){t.call(this,i)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype._adjustSizes=function(){var t=this;this._sizing=!0;var i=this.get("splits"),e=0,n=0;i.forEach(function(r){var s=r.sizePath?+t.get(r.sizePath):r.size;void 0===r.curSize?r.min?(r.curSize=0,r.lastSize=Math.floor(100/i.length)):(r.curSize=s,n+=s,e++):r.min&&r.curSize?(r.lastSize=r.curSize,r.curSize=0):r.min||r.curSize||!r.lastSize?s&&!r.min&&r.lastSet&&r.lastSet!==s?(r.curSize=s,r.lastSize=!1,n+=s):r.curSize?(n+=r.curSize,e++):r.curSize||r.min||(r.curSize=.1,e++):(n+=r.lastSize,r.curSize=r.lastSize,r.lastSize=!1)});var r=(100-n)/(e||1),s={};i.forEach(function(i,e){setTimeout(function(){var n=t._sizing;t._sizing=!0,t.set(i.sizePath?i.sizePath:"splits."+e+".size",i.curSize),t._sizing=n}),s["splits."+e+".curSize"]=!1===i.lastSize||i.min?i.curSize:i.curSize+r,s["splits."+e+".lastSet"]=s["splits."+e+".curSize"],i.lastSize||(i.lastSize=null)}),this.set(s),setTimeout(function(){return t.fire("resize")},320),this._sizing=!1},i.prototype.maximize=function(t){this.get("splits."+t+".min")?this.toggle("splits."+t+".min"):this.toggle("splits."+(t+1)+".min"),this._adjustSizes()},i.prototype.minimize=function(t){this.get("splits."+(t+1)+".min")?this.toggle("splits."+(t+1)+".min"):this.toggle("splits."+t+".min"),this._adjustSizes()},i}(i);function r(t){return void 0===t&&(t={}),function(i){i.instance.components[t.name||"split"]=n}}i.extendWith(n,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit",g:1},{n:"class-rsplit-vertical",t:13,f:[{t:2,r:"vertical"}]},{n:"class-rsplit-horizontal",t:13,f:[{t:2,x:{r:["vertical"],s:"!_0"}}]},{n:"class-rsplit-draggable",t:13,f:[{t:2,r:"draggable"}]},{t:16,r:"extra-attributes"},{n:"class-rsplit-flex",t:13,f:[{t:2,r:"flex"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-split",g:1},{t:4,f:[{n:"style-transition",f:"width 0.3s ease-in-out, height 0.3s ease-in-out",t:13}],n:51,r:"~/dragging"},{t:4,f:[{n:"style-width",f:["calc(",{t:2,r:".curSize"},"% - ",{t:2,x:{r:["@style.split.handle.width","@last"],s:"_1*(_0||14)/(_1+1)"}},"px)"],t:13}],n:50,r:"~/vertical"},{t:4,f:[{n:"style-height",f:["calc(",{t:2,r:".curSize"},"% - ",{t:2,x:{r:["@style.split.handle.width","@last"],s:"_1*(_0||14)/(_1+1)"}},"px)"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:".attrs"}],n:50,r:".attrs"}],f:[{t:16,r:".content"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-block",g:1}]}],n:50,x:{r:["~/draggable","~/dragging"],s:"_0&&_1"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep",g:1},{t:4,f:[{n:"sizeHandle",t:71,f:{r:["~/vertical","@index"],s:"[_0,_1]"}}],n:50,x:{r:[".",".draggable","~/draggable"],s:'"draggable" in _0?_1:_2'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-max",g:1},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0.maximize(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-max-btn",g:1}]}]}],n:50,x:{r:[".",".maximizable","~/maximizable",".min","@index","../"],s:'"maximizable" in _0?_1:_2&&(_3||!_5[_4+1].min)'}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-min",g:1},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0.minimize(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-min-btn",g:1}]}]}],n:50,x:{r:[".",".minimizable","~/minimizable",".min"],s:'"minimizable" in _0?_1:_2&&!_3'}}]}],n:50,x:{r:["@index","@last"],s:"_0!==_1"}}],n:52,r:"splits"}]}],e:{"!_0":function(t){return!t},"_1*(_0||14)/(_1+1)":function(t,i){return i*(t||14)/(i+1)},"_0&&_1":function(t,i){return t&&i},"[_0,_1]":function(t,i){return[t,i]},'"draggable" in _0?_1:_2':function(t,i,e){return"draggable"in t?i:e},"[_0.maximize(_1)]":function(t,i){return[t.maximize(i)]},'"maximizable" in _0?_1:_2&&(_3||!_5[_4+1].min)':function(t,i,e,n,r,s){return"maximizable"in t?i:e&&(n||!s[r+1].min)},"[_0.minimize(_1)]":function(t,i){return[t.minimize(i)]},'"minimizable" in _0?_1:_2&&!_3':function(t,i,e,n){return"minimizable"in t?i:e&&!n},"_0!==_1":function(t,i){return t!==i}}},css:function(t){return[" .rsplit { position: absolute; width: 100%; height: 100%; flex-grow: 1; display: flex; } .rsplit.rsplit-vertical { flex-direction: row; } .rsplit.rsplit-horizontal { flex-direction: column; } .rsplit > .rsplit-split { display: inline-block; overflow: auto; position: relative; } .rsplit.rsplit-flex > .rsplit-split { display: flex; } .rsplit.rsplit-vertical > .rsplit-split { height: 100%; } .rsplit.rsplit-horizontal > .rsplit-split { width: 100%; } .rsplit-block { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 999; } .rsplit.rsplit-draggable.rsplit-vertical > .rsplit-sep { cursor: ew-resize; } .rsplit.rsplit-draggable.rsplit-horizontal > .rsplit-sep { cursor: ns-resize; } .rsplit > .rsplit-sep { display: flex; justify-content: center; overflow: hidden; touch-action: none; flex-shrink: 0; } .rsplit.rsplit-vertical > .rsplit-sep { flex-direction: column; } .rsplit > .rsplit-sep .rsplit-sep-max, .rsplit > .rsplit-sep .rsplit-sep-min { text-align: center; display: inline-block; position: relative; cursor: pointer; } .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-max, .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-min { width: 3em; height: 100%; margin: 0 1em; } .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-max, .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-min { width: 100%; height: 1em; padding: 1em 0; margin: 0.5em 0; } .rsplit > .rsplit-sep .rsplit-sep-max-btn, .rsplit > .rsplit-sep .rsplit-sep-min-btn { display: inline-block; border-style: solid; position: relative; width: 0; height: 0; box-sizing: border-box; }",function(t){var i=Object.assign({bg:"rgba(0, 0, 0, 0.1)",fg:"rgba(0, 0, 0, 0.4)",width:14},t("raui.split.handle"));return"\n .rsplit > .rsplit-sep {\n background-color: "+i.bg+";\n color: "+i.fg+";\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep {\n width: "+i.width+"px;\n height: 100%;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep {\n height: "+i.width+"px;\n width: 100%;\n }\n \n .rsplit > .rsplit-sep {\n font-size: "+i.width+"px;\n }\n \n .rsplit > .rsplit-sep .rsplit-sep-max-btn,\n .rsplit > .rsplit-sep .rsplit-sep-min-btn {\n border-width: "+i.width/2+"px;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-max-btn {\n top: "+i.width/4+"px;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-min-btn {\n bottom: "+i.width/4+"px;\n border-top-color: transparent;\n border-right-color: transparent;\n border-left-color: transparent;\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-max-btn {\n left: "+i.width/4+"px;\n border-top-color: transparent;\n border-right-color: transparent;\n border-bottom-color: transparent;\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-min-btn {\n right: "+i.width/4+"px;\n border-top-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n "}.call(this,t)].join(" ")},cssId:"split",noCssTransform:!0,attributes:["vertical","draggable","maximizable","minimizable","flex"],data:function(){return{draggable:!0,maximizable:!0,minimizable:!0}},decorators:{sizeHandle:function(t,i,e){var n,r,s,l,a,o=this.getContext(t),p=o.get("../"+e),c=o.get("../"+(e+1)),u=t.parentNode,m=i,f=m?"screenX":"screenY";function d(i){i.target!==t&&i.target.parentNode!==t||(o.ractive._sizing=!0,o.set("~/dragging",!0),l=m?u.clientWidth:u.clientHeight,document.addEventListener("touchmove",h,!0),document.addEventListener("mousemove",h,!0),document.addEventListener("mouseup",z,!0),document.addEventListener("touchend",z,!0),r=p.curSize,s=c.curSize,n=f in i?i[f]:i.touches[0][f],i.preventDefault())}function h(t){var i,u,m,d,h=f in t?t[f]:t.touches[0][f],z=h-n;u=Math.abs(z)/l*100,z<0?(m=r-u,d=s+u):(m=r+u,d=s-u),m<p.min&&(d-=p.min-m,m+=p.min-m),d<c.min&&(m-=c.min-d,d+=c.min-d),m<0&&(m=0,d=r+s),d<0&&(m=r+s,d=0),o.set(((i={})[p.sizePath?"~/"+p.sizePath:"../"+e+".size"]=m,i[c.sizePath?"~/"+c.sizePath:"../"+(e+1)+".size"]=d,i["../"+e+".curSize"]=m,i["../"+e+".lastSet"]=m,i["../"+e+".min"]=!1,i["../"+(e+1)+".curSize"]=d,i["../"+(e+1)+".lastSet"]=d,i["../"+(e+1)+".min"]=!1,i)),a||setTimeout(function(){o.ractive.fire("resize"),a=null},300)}function z(){o.ractive._sizing=!1,o.set("~/dragging",!1),document.removeEventListener("touchmove",h,!0),document.removeEventListener("mousemove",h,!0),document.removeEventListener("mouseup",z,!0),document.removeEventListener("touchend",z,!0),a&&clearTimeout(a),o.ractive.fire("resize")}return o.listen("mousedown",d),o.listen("touchstart",d),{teardown:function(){o.unlisten("mousedown",d),o.unlisten("touchstart",d),z()},update:function(t){m=t,f=t?"screenX":"screenY"}}}},on:{construct:function(){var t=this,i=this.component;if(i){var e=i.template.f||[],n=i.template.m?i.template.m.slice():[],r=i.template;i.template={e:r.e,f:r.f,t:r.t,m:n};var s=0,l=e.filter(function(t){return t.e});this._mappedSizes=[],this._splits=l.map(function(i,e){var n=(i.m||[]).slice(),r={e:i.e,f:i.f,t:i.t,m:n.filter(function(t){return"size"!==t.n&&"minimize"!==t.n})},s={content:"pane"===r.e?r.f:[r]};"pane"===r.e&&r.m&&(s.attrs=r.m.slice());var l=n.find(function(t){return"size"===t.n});return l&&(l.f&&"string"==typeof l.f?s.size=+l.f:(s.sizePath=p(l).r,t._mappedSizes.push(s.sizePath))),n.find(function(t){return"minimize"===t.n})&&(s.min=!0),s});var a=100-this._splits.reduce(function(t,i){return t+(i.min?0:i.size||0)},0),o=this._splits.reduce(function(t,i){return t+("size"in i?0:1)},0);this._splits.forEach(function(t){"size"in t||(t.size=a/o),t.min?(t.lastSize=t.size,t.curSize=0):t.curSize=t.size})}function p(t,i){if(t&&t.f&&1===t.f.length&&2===t.f[0].t){var e="_a"+s++;return n.push({t:13,n:e,f:t.f}),i?{t:[{t:2,r:"~/"+e}]}:{t:2,r:"~/"+e}}return t&&t.f}},config:function(){this._splits&&this.set("splits",this._splits)},init:function(){var t=this;this.observe(this._mappedSizes.concat("splits.*.size").join(" "),function(){t._sizing||t._tm||(t._tm=setTimeout(function(){t._adjustSizes(),t._tm=null}))})}}}),function(t,i,n){if(e&&e.Ractive&&"object"==typeof e.Ractive[i]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var s=r.getAttribute("data-alias");s&&(s=(s=s.split("&")).reduce(function(t,i){var e=i.split("="),n=e[0],r=e[1];return t[n]=r,t},{})),Ractive[i][s&&s[t]||t]=n}}}("RauiSplit","components",n),t.Split=n,t.plugin=r,t.default=r,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],i):i(t.RauiSplit={},t.Ractive)}(this,function(t,i){"use strict";i=i&&i.hasOwnProperty("default")?i.default:i;var e="undefined"!=typeof window?window:null;var n=function(t){function i(i){t.call(this,i)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype._adjustSizes=function(){var t=this;this._sizing=!0;var i=this.get("splits"),e=0,n=0;i.forEach(function(s){var r=s.sizePath?+t.get(s.sizePath):s.size;void 0===s.curSize?s.min?(s.curSize=0,s.lastSize=Math.floor(100/i.length)):(s.curSize=r,n+=r,e++):s.min&&s.curSize?(s.lastSize=s.curSize,s.curSize=0):s.min||s.curSize||!s.lastSize?r&&!s.min&&s.lastSet&&s.lastSet!==r?(s.curSize=r,s.lastSize=!1,n+=r):s.curSize?(n+=s.curSize,e++):s.curSize||s.min||(s.curSize=.1,e++):(n+=s.lastSize,s.curSize=s.lastSize,s.lastSize=!1)});var s=(100-n)/(e||1),r={};i.forEach(function(i,e){setTimeout(function(){var n=t._sizing;t._sizing=!0,t.set(i.sizePath?i.sizePath:"splits."+e+".size",i.curSize),t._sizing=n}),r["splits."+e+".curSize"]=!1===i.lastSize||i.min?i.curSize:i.curSize+s,r["splits."+e+".lastSet"]=r["splits."+e+".curSize"],i.lastSize||(i.lastSize=null)}),this.set(r),setTimeout(function(){return t.fire("resize")},320),this._sizing=!1},i.prototype.maximize=function(t){this.get("splits."+t+".min")?this.toggle("splits."+t+".min"):this.toggle("splits."+(t+1)+".min"),this._adjustSizes()},i.prototype.minimize=function(t){this.get("splits."+(t+1)+".min")?this.toggle("splits."+(t+1)+".min"):this.toggle("splits."+t+".min"),this._adjustSizes()},i.prototype.size=function(t,i){if(this.get("splits."+t)){var e={};e["splits."+t+".lastSet"]=e["splits."+t+".curSize"]=e["splits."+t+".size"]=i,this.set(e),this._adjustSizes()}},i}(i);function s(t){return void 0===t&&(t={}),function(i){i.instance.components[t.name||"split"]=n}}i.extendWith(n,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit",g:1},{n:"class-rsplit-vertical",t:13,f:[{t:2,r:"vertical"}]},{n:"class-rsplit-horizontal",t:13,f:[{t:2,x:{r:["vertical"],s:"!_0"}}]},{n:"class-rsplit-draggable",t:13,f:[{t:2,r:"draggable"}]},{t:16,r:"extra-attributes"},{n:"class-rsplit-flex",t:13,f:[{t:2,r:"flex"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-split",g:1},{t:4,f:[{n:"style-transition",f:"width 0.3s ease-in-out, height 0.3s ease-in-out",t:13}],n:51,r:"~/dragging"},{t:4,f:[{n:"style-width",f:["calc(",{t:2,r:".curSize"},"% - ",{t:2,x:{r:["@style.split.handle.width","@last"],s:"_1*(_0||14)/(_1+1)"}},"px)"],t:13}],n:50,r:"~/vertical"},{t:4,f:[{n:"style-height",f:["calc(",{t:2,r:".curSize"},"% - ",{t:2,x:{r:["@style.split.handle.width","@last"],s:"_1*(_0||14)/(_1+1)"}},"px)"],t:13}],n:51,l:1},{t:4,f:[{t:16,r:".attrs"}],n:50,r:".attrs"}],f:[{t:16,r:".content"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-block",g:1}]}],n:50,x:{r:["~/draggable","~/dragging"],s:"_0&&_1"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep",g:1},{t:4,f:[{n:"sizeHandle",t:71,f:{r:["~/vertical","@index"],s:"[_0,_1]"}}],n:50,x:{r:[".",".draggable","~/draggable"],s:'"draggable" in _0?_1:_2'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-max",g:1},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0.maximize(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-max-btn",g:1}]}]}],n:50,x:{r:[".",".maximizable","~/maximizable",".min","@index","../"],s:'"maximizable" in _0?_1:_2&&(_3||!_5[_4+1].min)'}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-min",g:1},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0.minimize(_1)]"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rsplit-sep-min-btn",g:1}]}]}],n:50,x:{r:[".",".minimizable","~/minimizable",".min"],s:'"minimizable" in _0?_1:_2&&!_3'}}]}],n:50,x:{r:["@index","@last"],s:"_0!==_1"}}],n:52,r:"splits"}]}],e:{"!_0":function(t){return!t},"_1*(_0||14)/(_1+1)":function(t,i){return i*(t||14)/(i+1)},"_0&&_1":function(t,i){return t&&i},"[_0,_1]":function(t,i){return[t,i]},'"draggable" in _0?_1:_2':function(t,i,e){return"draggable"in t?i:e},"[_0.maximize(_1)]":function(t,i){return[t.maximize(i)]},'"maximizable" in _0?_1:_2&&(_3||!_5[_4+1].min)':function(t,i,e,n,s,r){return"maximizable"in t?i:e&&(n||!r[s+1].min)},"[_0.minimize(_1)]":function(t,i){return[t.minimize(i)]},'"minimizable" in _0?_1:_2&&!_3':function(t,i,e,n){return"minimizable"in t?i:e&&!n},"_0!==_1":function(t,i){return t!==i}}},css:function(t){return[" .rsplit { position: absolute; width: 100%; height: 100%; flex-grow: 1; display: flex; } .rsplit.rsplit-vertical { flex-direction: row; } .rsplit.rsplit-horizontal { flex-direction: column; } .rsplit > .rsplit-split { display: inline-block; overflow: auto; position: relative; } .rsplit.rsplit-flex > .rsplit-split { display: flex; } .rsplit.rsplit-vertical > .rsplit-split { height: 100%; } .rsplit.rsplit-horizontal > .rsplit-split { width: 100%; } .rsplit-block { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 999; } .rsplit.rsplit-draggable.rsplit-vertical > .rsplit-sep { cursor: ew-resize; } .rsplit.rsplit-draggable.rsplit-horizontal > .rsplit-sep { cursor: ns-resize; } .rsplit > .rsplit-sep { display: flex; justify-content: center; overflow: hidden; touch-action: none; flex-shrink: 0; } .rsplit.rsplit-vertical > .rsplit-sep { flex-direction: column; } .rsplit > .rsplit-sep .rsplit-sep-max, .rsplit > .rsplit-sep .rsplit-sep-min { text-align: center; display: inline-block; position: relative; cursor: pointer; } .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-max, .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-min { width: 3em; height: 100%; margin: 0 1em; } .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-max, .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-min { width: 100%; height: 1em; padding: 1em 0; margin: 0.5em 0; } .rsplit > .rsplit-sep .rsplit-sep-max-btn, .rsplit > .rsplit-sep .rsplit-sep-min-btn { display: inline-block; border-style: solid; position: relative; width: 0; height: 0; box-sizing: border-box; }",function(t){var i=Object.assign({bg:"rgba(0, 0, 0, 0.1)",fg:"rgba(0, 0, 0, 0.4)",width:14},t("raui.split.handle"));return"\n .rsplit > .rsplit-sep {\n background-color: "+i.bg+";\n color: "+i.fg+";\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep {\n width: "+i.width+"px;\n height: 100%;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep {\n height: "+i.width+"px;\n width: 100%;\n }\n \n .rsplit > .rsplit-sep {\n font-size: "+i.width+"px;\n }\n \n .rsplit > .rsplit-sep .rsplit-sep-max-btn,\n .rsplit > .rsplit-sep .rsplit-sep-min-btn {\n border-width: "+i.width/2+"px;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-max-btn {\n top: "+i.width/4+"px;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .rsplit.rsplit-horizontal > .rsplit-sep .rsplit-sep-min-btn {\n bottom: "+i.width/4+"px;\n border-top-color: transparent;\n border-right-color: transparent;\n border-left-color: transparent;\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-max-btn {\n left: "+i.width/4+"px;\n border-top-color: transparent;\n border-right-color: transparent;\n border-bottom-color: transparent;\n }\n \n .rsplit.rsplit-vertical > .rsplit-sep .rsplit-sep-min-btn {\n right: "+i.width/4+"px;\n border-top-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n "}.call(this,t)].join(" ")},cssId:"split",noCssTransform:!0,attributes:["vertical","draggable","maximizable","minimizable","flex"],data:function(){return{draggable:!0,maximizable:!0,minimizable:!0}},decorators:{sizeHandle:function(t,i,e){var n,s,r,l,a,o=this.getContext(t),p=o.get("../"+e),c=o.get("../"+(e+1)),u=t.parentNode,m=i,f=m?"screenX":"screenY";function d(i){i.target!==t&&i.target.parentNode!==t||(o.ractive._sizing=!0,o.set("~/dragging",!0),l=m?u.clientWidth:u.clientHeight,document.addEventListener("touchmove",h,!0),document.addEventListener("mousemove",h,!0),document.addEventListener("mouseup",z,!0),document.addEventListener("touchend",z,!0),s=p.curSize,r=c.curSize,n=f in i?i[f]:i.touches[0][f],i.preventDefault())}function h(t){var i,u,m,d,h=f in t?t[f]:t.touches[0][f],z=h-n;u=Math.abs(z)/l*100,z<0?(m=s-u,d=r+u):(m=s+u,d=r-u),m<p.min&&(d-=p.min-m,m+=p.min-m),d<c.min&&(m-=c.min-d,d+=c.min-d),m<0&&(m=0,d=s+r),d<0&&(m=s+r,d=0),o.set(((i={})[p.sizePath?"~/"+p.sizePath:"../"+e+".size"]=m,i[c.sizePath?"~/"+c.sizePath:"../"+(e+1)+".size"]=d,i["../"+e+".curSize"]=m,i["../"+e+".lastSet"]=m,i["../"+e+".min"]=!1,i["../"+(e+1)+".curSize"]=d,i["../"+(e+1)+".lastSet"]=d,i["../"+(e+1)+".min"]=!1,i)),a||setTimeout(function(){o.ractive.fire("resize"),a=null},300)}function z(){o.ractive._sizing=!1,o.set("~/dragging",!1),document.removeEventListener("touchmove",h,!0),document.removeEventListener("mousemove",h,!0),document.removeEventListener("mouseup",z,!0),document.removeEventListener("touchend",z,!0),a&&clearTimeout(a),o.ractive.fire("resize")}return o.listen("mousedown",d),o.listen("touchstart",d),{teardown:function(){o.unlisten("mousedown",d),o.unlisten("touchstart",d),z()},update:function(t){m=t,f=t?"screenX":"screenY"}}}},on:{construct:function(){var t=this,i=this.component;if(i){var e=i.template.f||[],n=i.template.m?i.template.m.slice():[],s=i.template;i.template={e:s.e,f:s.f,t:s.t,m:n};var r=0,l=e.filter(function(t){return t.e});this._mappedSizes=[],this._splits=l.map(function(i,e){var n=(i.m||[]).slice(),s={e:i.e,f:i.f,t:i.t,m:n.filter(function(t){return"size"!==t.n&&"minimize"!==t.n})},r={content:"pane"===s.e?s.f:[s]};"pane"===s.e&&s.m&&(r.attrs=s.m.slice());var l=n.find(function(t){return"size"===t.n});return l&&(l.f&&"string"==typeof l.f?r.size=+l.f:(r.sizePath=p(l).r,t._mappedSizes.push(r.sizePath))),n.find(function(t){return"minimize"===t.n})&&(r.min=!0),r});var a=100-this._splits.reduce(function(t,i){return t+(i.min?0:i.size||0)},0),o=this._splits.reduce(function(t,i){return t+("size"in i?0:1)},0);this._splits.forEach(function(t){"size"in t||(t.size=a/o),t.min?(t.lastSize=t.size,t.curSize=0):t.curSize=t.size})}function p(t,i){if(t&&t.f&&1===t.f.length&&2===t.f[0].t){var e="_a"+r++;return n.push({t:13,n:e,f:t.f}),i?{t:[{t:2,r:"~/"+e}]}:{t:2,r:"~/"+e}}return t&&t.f}},config:function(){this._splits&&this.set("splits",this._splits)},init:function(){var t=this;this.observe(this._mappedSizes.concat("splits.*.size").join(" "),function(){t._sizing||t._tm||(t._tm=setTimeout(function(){t._adjustSizes(),t._tm=null}))})}}}),function(t,i,n){if(e&&e.Ractive&&"object"==typeof e.Ractive[i]){var s=document.currentScript;if(s||(s=(s=document.querySelectorAll("script"))[s.length-1]),s){var r=s.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(t,i){var e=i.split("="),n=e[0],s=e[1];return t[n]=s,t},{})),Ractive[i][r&&r[t]||t]=n}}}("RauiSplit","components",n),t.Split=n,t.plugin=s,t.default=s,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],t):t(e.RauiTable={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:null;function r(e,t,r){if(n&&n.Ractive&&"object"==typeof n.Ractive[t]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var o=i.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(e,t){var n=t.split("="),r=n[0],i=n[1];return e[r]=i,e},{})),Ractive[t][o&&o[e]||e]=r}}}function i(e,t){var n=t.context||this.getContext(e),r={position:e.style.position,overflowY:e.style.overflowY};""!==e.style.position&&"static"!==e.style.position||(e.style.position="relative");var i=function(){t.offsetWidth&&n.set(t.offsetWidth,e.offsetWidth),t.offsetHeight&&n.set(t.offsetHeight,e.offsetHeight),t.clientWidth&&n.set(t.clientWidth,e.clientWidth),t.clientHeight&&n.set(t.clientHeight,e.clientHeight),t.diffWidth&&n.set(t.diffWidth,e.offsetWidth-e.clientWidth),t.diffHeight&&n.set(t.diffHeight,e.offsetHeight-e.clientHeight)},a=o(e,i);return{refresh:i,teardown:function(){e.removeChild(a),e.style.position=r.position,e.style.overflowY=r.overflowY}}}function o(e,t){var n=document.createElement("object");return n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),n.setAttribute("tabindex","-1"),n.type="text/html",n.onload=function(){n.contentDocument.defaultView.addEventListener("resize",t),t()},/Trident/.test(navigator.userAgent)?(e.appendChild(n),n.data="about:blank"):(n.data="about:blank",e.appendChild(n)),n}var a,l=16;function s(e){l=e}function d(e){return a||function e(){!a&&window&&"document"in window&&"function"==typeof document.createElement&&((a=document.createElement("div")).setAttribute("style","position: absolute; left: -2em; width: 1em; height: 1em;"),o(a,function(){return s(a.getBoundingClientRect().width)}),window.addEventListener("resize",function(){e(),s(a.getBoundingClientRect().width)})),a&&!a.parent&&document.body.appendChild(a)}(),"string"==typeof e&&(e=e.replace(/[^-.\d]/g,"")),+e*l}var c={tiny:{units:[2,3,4,5,6,8],max:"0",value:0},xsmall:{units:[2,3,4,5,6,8,10,12],max:"20em",prefix:"xs",value:10},small:{units:[2,3,4,5,6,8,10,12],max:"36em",value:20},medium:{units:[2,3,4,5,6,8,10,12],max:"48em",value:30},large:{units:[2,3,4,5,6,8,10,12,16,20],max:"64em",value:40},xlarge:{units:[2,3,4,5,6,8,10,12,16,20],max:"100em",value:50},ginormous:{units:[2,3,4,5,6,8,10,12,16,20],max:"150em",value:60}},f={"grid grid-root":/\bgrid grid-root\b/g},u=/\s+/g;function h(e,t){var n,r,o=this.getContext(e),a=this,l=t||{};function s(t){if("number"==typeof l.offset&&(t-=l.offset),!l.type||"class"===l.type){var i,a=e.className,s=-1,d=[];for(var c in n)f[c].lastIndex=-1,n[c]<=t?(f[c].test(a)||(a+=" "+c),n[c]>s&&(s=n[c],i=c,d.push(i))):a=a.replace(f[c],"").trim();if(e.className=a.replace(u," "),!i)return;l.value&&o.set(l.value,r[i].value),l.name&&o.set(l.name,i),l.size&&o.set(l.size,t),l.max&&o.set(l.max,s),l.classes&&o.set(l.classes,d.join(" ")),l.matches&&o.set(l.matches,d)}}function h(){for(var t in r=a.get("@style.break")||c,n={},r)n[t]=d(r[t].max),f[t]||(f[t]=new RegExp("\\b"+t+"\\b","g"));s(e.clientWidth)}var b=this.observe("@style.break",h,{init:!1}),p=o.observe("@local.width",s,{init:!1}),g=i.call(this,e,{clientWidth:"@local.width"});return e.className+=" grid grid-root",l.immediate?h():requestAnimationFrame(h),{update:function(t){l=t||{},requestAnimationFrame(function(){return s(e.clientWidth)})},teardown:function(){e.className=e.className.replace(f["grid grid-root"],"").trim(),p.cancel(),b.cancel(),g.teardown()}}}function b(e,t){var n=e("raui.grid.break")||t||c,r=(e("raui.grid.wrappers")||[".row-wrap > ",".row-wrap > .row-wrap > "]).slice();r.unshift("");var i=".row > * { position: relative; width: 100%; transition-duration: 0.2s; transition-timing-function: ease-in-out; transition-property: padding, margin; box-sizing: border-box; }\n.grid { display: block; }\n.grid .row { display: flex !important; flex-wrap: wrap; min-height: fit-content; width: 100%; align-content: flex-start; }\n.grid .row.row-pad > * { padding: "+(e("raui.grid.padding")||"0.5em")+"; }\n.grid .row > .pad { display: flex; flex-direction: column; padding: "+(e("raui.grid.padding")||"0.5em")+"; box-sizing: border-box; }",o=Object.keys(n).map(function(e){return(n[e].key=e)&&n[e]});return o.sort(function(e,t){return e.value>t.value?1:e.value<t.value?-1:0}),o.forEach(function(t){var n=t.prefix||t.key[0],o={};t.units.forEach(function(e){for(var t=1;t<e;t++){var n=""+t/e*100;n=n.substr(0,n.indexOf(".")+3),o[n]||(o[n]=[]),o[n].push(t+"-"+e)}});var a=t.key;i+="\n"+[r.map(function(e){return"."+a+" > "+e+"."+n+"1, ."+a+" > "+e+".row > ."+n+"1"}).join(", "),"."+a+" ."+n+"-n1, ."+a+" .row-"+n+"-n1 > *"].filter(function(e){return e}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: 100%; flex-grow: 0; flex-shrink: 0; }\n"+[r.map(function(e){return"."+a+" > "+e+"."+n+"0, ."+a+" > "+e+".row > ."+n+"0"}).join(", "),"."+a+" ."+n+"-n0, ."+a+" .row-"+n+"-n0 > *"].filter(function(e){return e}).join(", ")+" { display: none; flex-grow: 0; flex-shrink: 0: }\n"+Object.keys(o).map(function(t){return o[t].map(function(e){return""+[r.map(function(t){return"."+a+" > "+t+".row-"+n+e+" > *, ."+a+" > "+t+"."+n+e+", ."+a+" > "+t+".row > ."+n+e}).join(", "),"."+a+" .row-"+n+"-n"+e+" > * .row > ."+n+"-n"+e+", ."+a+" ."+n+"-n"+e+", ."+a+" .row-"+n+"-n"+e+" > *"].filter(function(e){return e}).join(", ")}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: "+t+"%; flex-grow: 0; flex-shrink: 0; }"}).join("\n")+"\n"+[r.map(function(e){return"."+a+" > "+e+".row > "+n+"-fill, ."+a+" >"+e+".row > ."+n+"-auto"}).join(", "),"."+a+" ."+n+"-nfill, ."+a+" ."+n+"-nauto"].filter(function(e){return e}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: auto; flex-grow: 1; flex-shrink: 1; }"}),i}h.style=b,r("grid","decorators",h);var p=250;function g(e){return void 0===e&&(e={}),function(t){var n=t.Ractive;t.instance.events[e.name||(e.count||"")+"clicks"]=function(t,r,i){var o,a=Object.assign({},e,i);return(o=t.__r_clicks__)?o.subscribe(a.count||1,!!a.hold,r):(o=new v(n.getContext(t),a.delay||p,a.bubble||!1),t.__r_clicks__=o,o.subscribe(a.count||1,!!a.hold,r)),{teardown:function(){o.unsubscribe(a.count||1,!!a.hold,r)}}}}}g({name:"click",count:1}),g({name:"dblclick",count:2}),g({name:"trpclick",count:3});var v=function(e,t,n){this.context=e,this.node=e.node,this.delay=t,this.fires={},this.refs=0,this.bubble=n,this.bind()};function m(e){return this.__r_clicks__.mousedown(e)}function w(e){return this.__r_clicks__.touchdown(e)}function x(){this.addEventListener("keydown",y,!1),this.addEventListener("blur",_,!1)}function _(){this.removeEventListener("keydown",y,!1),this.removeEventListener("blur",_,!1)}function y(e){if(32===e.which||10===e.which||13===e.which)return this.__r_clicks__.fire()}function k(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return new Promise(function(t){requestAnimationFrame(function(){e.setStyle("overflow","hidden");var r="x"===n.axis?"width":"height";if(e.isIntro||n.intro){var i=e.getStyle(r);e.setStyle(r,0),e.setStyle("opacity",0),t(e.animateStyle(r,i,n).then(function(){return e.animateStyle("opacity",1,n)}).then(function(){e.setStyle(r,""),e.setStyle("overflow","")}))}else e.setStyle(r,e.getStyle(r)),e.setStyle("opacity",1),t(e.animateStyle("opacity",0,n).then(function(){return e.animateStyle(r,0,n)}))})})}function O(e,t){void 0===t&&(t={});var n="string"==typeof t?t:t.bind;if("string"!=typeof n)return{teardown:function(){}};var r,i=t.allow||2,o=this.getContext(e),a=!1;function l(){a=!1;var t="";e.scrollHeight>e.clientHeight&&(t+="vscroll"),e.scrollWidth>e.clientWidth&&(t+=(t?" ":"")+"hscroll"),e.scrollTop<=i&&(t+=" top"),e.scrollTop>=e.scrollHeight-e.clientHeight-i&&(t+=" bottom"),~t.indexOf("top")||~t.indexOf("bottom")||(t+=" vmiddle"),e.scrollLeft<=i&&(t+=" left"),e.scrollLeft>=e.scrollWidth-e.clientWidth-i?t+=" right":~t.indexOf("left")||~t.indexOf("right")||(t+=" hmiddle"),o.set(n,t),o.hasListener("scrolled")&&o.raise("scrolled",{})}return e.addEventListener("scroll",l,{passive:!0}),requestAnimationFrame(l),{refresh:function(){a||(r&&clearTimeout(r),r=setTimeout(function(){r=null,a=!0,requestAnimationFrame(l)},250))},teardown:function(){e.removeEventListener("scroll",l),o.set(n,"")}}}function S(e){return"string"==typeof e}function P(e){return"number"==typeof e}function E(e){return"object"==typeof e}v.prototype.subscribe=function(e,t,n){(this.fires[e+","+t]||(this.fires[e+","+t]=[])).push(n),this.refs++},v.prototype.unsubscribe=function(e,t,n){var r=this.fires[e+","+t]||[];r.splice(r.indexOf(n),1),this.refs--,this.refs||this.teardown()},v.prototype.bind=function(){window.PointerEvent||window.navigator.pointerEnabled?this.node.addEventListener("pointerdown",m):window.navigator.msPointerEnabled?this.node.addEventListener("MSPointerDown",m):(this.node.addEventListener("mousedown",m),this.node.addEventListener("touchstart",w)),"A"!==this.node.tagName&&"BUTTON"!==this.node.tagName&&"button"!==this.node.type&&"submit"!==this.node.type&&"checkbox"!==this.node.type&&"radio"!==this.node.type||this.node.addEventListener("focus",x)},v.prototype.fire=function(e,t,n,r){var i=this;this.tm?(this.tmCount++,clearTimeout(this.tm)):this.tmCount=1;var o=function(){i.tm=null,(i.fires[i.tmCount+","+!!r]||[]).forEach(function(o){o({node:i.node,original:e,x:t,y:n,hold:!!r})})};return r?o():this.tm=setTimeout(o,this.delay),this.bubble},v.prototype.mousedown=function(e){var t=this;if(!this.preventMousedownEvents&&(void 0===e.which||1===e.which)){var n,r=e.clientX,i=e.clientY,o=e.pointerId,a=function(e){e.pointerId==o&&(t.fire(e,r,i),s())},l=function(e){e.pointerId==o&&(Math.abs(e.clientX-r)>=12||Math.abs(e.clientY-i)>=12)&&s()},s=function(){n&&clearTimeout(n),t.node.removeEventListener("MSPointerUp",a,!1),document.removeEventListener("MSPointerMove",l,!1),document.removeEventListener("MSPointerCancel",s,!1),t.node.removeEventListener("pointerup",a,!1),document.removeEventListener("pointermove",l,!1),document.removeEventListener("pointercancel",s,!1),t.node.removeEventListener("click",a,!1),document.removeEventListener("mousemove",l,!1)};return window.PointerEvent||window.navigator.pointerEnabled?(this.node.addEventListener("pointerup",a,!1),document.addEventListener("pointermove",l,!1),document.addEventListener("pointercancel",s,!1)):window.navigator.msPointerEnabled?(this.node.addEventListener("MSPointerUp",a,!1),document.addEventListener("MSPointerMove",l,!1),document.addEventListener("MSPointerCancel",s,!1)):(this.node.addEventListener("click",a,!1),document.addEventListener("mousemove",l,!1)),n=setTimeout(function(){s(),t.fire(e,r,i,!0)},400),this.bubble||e.stopPropagation(),this.bubble}},v.prototype.touchdown=function(e){var t,n=this,r=e.touches[0],i=r.clientX,o=r.clientY,a=r.identifier,l=function(e){e.changedTouches[0].identifier===a?(e.preventDefault(),n.preventMousedownEvents=!0,clearTimeout(n.preventMousedownTimeout),n.preventMousedownTimeout=setTimeout(function(){n.preventMousedownEvents=!1},400),n.fire(e,i,o),d()):d()},s=function(e){1===e.touches.length&&e.touches[0].identifier===a||d();var t=e.touches[0];(Math.abs(t.clientX-i)>=12||Math.abs(t.clientY-o)>=12)&&d()},d=function(){t&&clearTimeout(t),n.node.removeEventListener("touchend",l,!1),window.removeEventListener("touchmove",s,!1),window.removeEventListener("touchcancel",d,!1)};return this.node.addEventListener("touchend",l,!1),window.addEventListener("touchmove",s,!1),window.addEventListener("touchcancel",d,!1),t=setTimeout(function(){d(),n.fire(e,i,o,!0)},400),this.bubble||e.stopPropagation(),this.bubble},v.prototype.teardown=function(){this.node.removeEventListener("pointerdown",m),this.node.removeEventListener("MSPointerDown",m),this.node.removeEventListener("mousedown",m),this.node.removeEventListener("touchstart",w),this.node.removeEventListener("focus",x),delete this.node.__r_clicks__},r("expand","transitions",k);var L,A,z=function(e){function t(t){e.call(this,t)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selections:{configurable:!0},selected:{configurable:!0},rows:{configurable:!0},visibleRows:{configurable:!0},allRows:{configurable:!0}};return t.prototype._allSelected=function(){for(var e=this.get("selections"),t="virtual"===this.get("paginate")?this.get("rows"):this.get("visibleRows"),n=0;n<t.length;n++)if(!~e.indexOf(t[n]))return!1;return t.length&&!0},t.prototype._setSort=function(e,t){var n=[this.get("sort-handler"),this.get("@style.raui.table.sort-handler")],r=n[0]||n[1];if(r)r(this,this.get("columns."+e),e,t);else{var i=this.get("sort")||"",o=this.get("columns."+e).id;i===o||i.substr(1)===o?"-"===i[0]?this.set("sort",o):this.set("sort","-"+o):this.set("sort",o)}},t.prototype.nodeSet=function(e,t,n){e[t]=n},t.prototype._expand=function(e){var t=this,n=this.get("visibleRows")[e],r=this.get("expanded"),i=this.find(".rtable-row-expand");i?this.transition("expand",i,{outro:!0}).then(function(){r===n?t.set("expanded",null):(t.set("expanded",n),t.transition("expand",t.find(".rtable-row-expand"),{intro:!0}))}):n===r?this.set("expanded",null):(this.set("expanded",n),this.transition("expand",this.find(".rtable-row-expand"),{intro:!0}))},t.prototype._hover=function(e){return this.set("hovered",this.get("~/visibleRows")[e]),!1},t.prototype._unhover=function(e){if(!this.find(".rtable-top .rtable-row-wrap:hover"))return this.set("hovered",void 0),!1},t.prototype._select=function(e,t){var n=this.get("selections");n||(n=[],this.set("selections",n));var r=n.indexOf(e);return~r?this.splice("selections",r,1):this.push("selections",e),(r>=n.length||1===n.length)&&this.set("selected",n[n.length-1]),this.fire("selection",{},{item:n[n.length-1],items:n}),setTimeout(function(){return t.target.checked=!~r}),!1},t.prototype._open=function(e,t,n){var r=this;this._opentm||(this.fire("selected",{},e,t,n),this._opentm=setTimeout(function(){r._opentm=null},500))},t.prototype.select=function(){var e=this.get("selected");e&&this.fire("selected",{},e,this.get("rows").indexOf(e),this.get("visibleRows").indexOf(e))},t.prototype.deselect=function(){this.set({selections:[],selected:void 0})},n.selections.get=function(){return this.get("selections")||[]},n.selections.set=function(e){var t=this.get("rows"),n=Array.isArray(e)?e.filter(function(e){return~t.indexOf(e)}):[];this.set("selections",n)},n.selected.get=function(){return this.get("selected")},n.selected.set=function(e){this.set({selected:e,selections:[e]})},n.rows.get=function(){return this.get("rows")},n.visibleRows.get=function(){return this.get("visibleRows")},n.allRows.get=function(){return this.get("items")},t.prototype.selectionOffset=function(e){var t=this.get("selected"),n=this.get("visibleRows");if(t&&~n.indexOf(t)){var r=n.indexOf(t);if(e>0?r+e>=n.length:r+e<0){var i=e<1?-1:1;(i<0&&this.get("page")+i>=0||i>0&&this.get("page")+i<this.get("pagination.total"))&&this.add("page",i),n=this.get("visibleRows");var o=e>0?n[0]:n[n.length-1];this.set({selected:o,selections:[o]})}else this.set({selected:n[r+e],selections:[n[r+e]]})}else{var a=e>0?n[0]:n[n.length-1];this.set({selected:a,selections:[a]})}this.fire("selection",{},{item:this.get("selected"),items:this.get("selections")})},t.prototype.selectionDown=function(){this.selectionOffset(1)},t.prototype.selectionUp=function(){this.selectionOffset(-1)},t.prototype._selectGroup=function(e){var t=e;this.get("page")&&(t+=this.get("page")*this.get("pagination.per"));var n,r=this.get("rows"),i=this.get("groups"),o=this.get("selections"),a=r[t++],l=["selections"],s=[];for(~(n=o.indexOf(a))?s.push(n):l.push(a);t<r.length&&!(t in i);)a=r[t++],~(n=o.indexOf(a))?s.push(n):l.push(a);if(1===l.length)for(n=s.length;n--;)this.splice("selections",s[n],1);else this.push.apply(this,l);return!1},t.prototype._groupSelected=function(e){var t=e;this.get("page")&&(t+=this.get("page")*this.get("pagination.per"));var n=this.get("rows"),r=this.get("groups"),i=this.get("selections");if(!~i.indexOf(n[t++]))return!1;for(;t<n.length&&!(t in r);)if(!~i.indexOf(n[t++]))return!1;return!0},t.prototype._rows=function(){var e=(this.get("items")||[]).slice(),t=this.get("filter"),n=this.get("sort"),r=[this.get("data-handler"),this.get("@style.raui.table.data-handler")],i=r[0]||r[1]||j;if(!t&&!n)return this.set("isFiltered",!1),this.set("rows",e);var o=i(this,e,t,n,this.get("parameters",{virtual:!0}));this.set("isFiltered",o.length!==e.length),this.set("rows",o);var a=this.get("selections");this.set("selections",a.filter(function(t){return~e.indexOf(t)})),~e.indexOf(this.get("selection"))||this.set("selected",void 0)},t.prototype.replaceColumns=function(e){var t=M(e),n=t[0],r=t[1];this.set("columns",e),this.resetPartial("grid-row-cols",r),this.resetPartial("grid-head-cols",n)},Object.defineProperties(t.prototype,n),t}(t);z.settings={valign:"center",border:!1,"fixed-header":!0,"allow-select":!0,"allow-select-all":!0,"auto-titles":!1,paginate:"virtual"},t.extendWith(z,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable",g:1},{n:"class-rtable-virtual",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="virtual"'}}]},{n:"class-rtable-auto",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="auto"'}}]},{n:"class-rtable-fixed",t:13,f:[{t:2,r:"~/fixed"}]},{n:"class-rtable-border",t:13,f:[{t:2,r:"~/border"}]},{n:"class-rtable-fixed-header",t:13,f:[{t:2,r:"~/fixedHeader"}]},{n:"class-rtable-scrolled-down",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{n:"class-rtable-scrolled-up",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("bottom")'}}]},{n:"class-rtable-with-select",t:13,f:[{t:2,r:"~/allowSelect"}]},{n:"class-rtable-valign-top",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="top"'}}]},{n:"class-rtable-valign-center",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="center"'}}]},{n:"class-rtable-valign-bottom",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="bottom"'}}]},{n:"class-rtable-nowrap",t:13,f:[{t:2,r:"~/noWrap"}]},{n:"class-rtable-wrap",t:13,f:[{t:2,x:{r:["~/noWrap"],s:"!_0"}}]},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-fixed",g:1},{n:"grid",t:71,f:{r:["~/scrollOffset"],s:"[{offset:_0}]"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,r:"meta.top"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1},{t:4,f:[{n:"scrollother",t:71,f:{r:[],s:'[".rtable-top"]'}}],n:50,r:"~/noWrap"}],f:[{t:8,r:"grid-head"}]}],n:51,r:"~/noHeader"}]}],n:50,x:{r:["~/noHeader","meta.top","~/fixedHeader"],s:"(!_0||_1)&&_2"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-top",g:1},{t:4,f:[{n:["scrolled"],t:70,f:"scroll"},{n:"sized",t:71,f:{r:[],s:'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]'}}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scroll"]'}}],n:50,x:{r:["~/noHeader","~/fixedHeader","~/meta.bottom","~/paginate"],s:'(!_0&&_1)||_2||_3==="virtual"'}},{t:4,f:[{n:"scrollother",t:71,f:{r:[],s:'[".rtable-header-wrapper"]'}}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,x:{r:["~/fixedHeader","meta.top"],s:"!_0&&_1"}}," ",{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]'}},{t:4,f:[{n:"style-margin-top",f:[{t:2,r:"~/virtual.above"},"px"],t:13},{n:"style-margin-bottom",f:[{t:2,r:"~/virtual.below"},"px"],t:13}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&!_1"}}," ",{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,z:[{n:"source",x:{r:"~/items"}},{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/visibleRows"}],n:50,r:"~/shuffle"},{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,r:"~/visibleRows"}],n:51,l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-row row t1",g:1}],f:[{t:16,r:"empty",z:[{n:"message",x:{r:"~/empty"}}]}]}],n:50,x:{r:["~/rows.length"],s:"!_0"}}]}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-bottom",g:1},{t:4,f:[{t:16,r:"meta.bottomAttrs"}],n:50,r:"meta.bottomAttrs"}],f:[{t:4,f:[{t:16,r:"meta.bottom",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}],n:50,r:"~/meta.bottom"}," ",{t:4,f:[{t:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],n:50,x:{r:["~/paginate","~/meta.bottom"],s:'_0!=="virtual"||_1'}}]}],e:{'_0==="virtual"':function(e){return"virtual"===e},'_0==="auto"':function(e){return"auto"===e},'!~(_0||"").indexOf("top")':function(e){return!~(e||"").indexOf("top")},'!~(_0||"").indexOf("bottom")':function(e){return!~(e||"").indexOf("bottom")},'_0==="top"':function(e){return"top"===e},'_0==="center"':function(e){return"center"===e},'_0==="bottom"':function(e){return"bottom"===e},"!_0":function(e){return!e},"[{offset:_0}]":function(e){return[{offset:e}]},'[".rtable-top"]':function(){return[".rtable-top"]},"(!_0||_1)&&_2":function(e,t,n){return(!e||t)&&n},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},'(!_0&&_1)||_2||_3==="virtual"':function(e,t,n,r){return!e&&t||n||"virtual"===r},'[".rtable-header-wrapper"]':function(){return[".rtable-header-wrapper"]},"_0&&_1":function(e,t){return e&&t},"!_0&&_1":function(e,t){return!e&&t},'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]':function(){return[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]},"!_0&&!_1":function(e,t){return!e&&!t},true:function(){return!0},'_0!=="virtual"':function(e){return"virtual"!==e},'_0!=="virtual"||_1':function(e,t){return"virtual"!==e||t},"(_0+_1)%2===1":function(e,t){return(e+t)%2==1},"[_0._setSort(_1,_2)]":function(e,t,n){return[e._setSort(t,n)]},"[_0._select(_1,_2),false]":function(e,t,n){return[e._select(t,n),!1]},"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]":function(e,t,n,r){return[e._open(r,t.indexOf(r),n.indexOf(r))]},"[_0._expand(_1)]":function(e,t){return[e._expand(t)]},"[_0.stopPropagation()]":function(e){return[e.stopPropagation()]},"_0.indexOf(_1)":function(e,t){return e.indexOf(t)},"_0===_1":function(e,t){return e===t},"_0>0":function(e){return e>0},"!_0&&_1>0":function(e,t){return!e&&t>0},'_0==="boolean"':function(e){return"boolean"===e},"_0._allSelected()":function(e){return e._allSelected()},'_0||"No data."':function(e){return e||"No data."},"_0*_1+1":function(e,t){return e*t+1},"_2+1===_0?_1:(_2+1)*_3":function(e,t,n,r){return n+1===e?t:(n+1)*r},"_0===1":function(e){return 1===e},"_0._allSelected()&&_1<_2":function(e,t,n){return e._allSelected()&&t<n},'[_0.set("page",_1-1)]':function(e,t){return[e.set("page",t-1)]},'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]':function(e,t,n,r,i){return[/^\d+$/.test(t)&&+t>0&&+t<=e&&n.set("page",+t-1)||n.nodeSet(r,"value",i+1)]},"_0==_1+1":function(e,t){return e==t+1},'[_0.set("page",_2[_1-1])]':function(e,t,n){return[e.set("page",n[t-1])]},'_0==="..."':function(e){return"..."===e},'[_0.set("page",_1+1)]':function(e,t){return[e.set("page",t+1)]},"_0<_1-1":function(e,t){return e<t-1}},p:{"csp-dummy":[{t:7,e:"div",m:[{n:"class-rtable-odd",t:13,f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{n:"class-top",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="top"'}}]},{n:"class-bottom",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="bottom"'}}]},{n:"class-center",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="center"'}}]},{n:["click"],t:70,f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}},{n:["click"],t:70,f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}},{n:["click"],t:70,f:{r:["@this","~/rows","~/visibleRows","."],s:"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]"}},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},{n:["click"],t:70,f:{r:["@event"],s:"[_0.stopPropagation()]"}}]}," ",{t:4,f:["..."],n:50,x:{r:["~/selections","."],s:"_0.indexOf(_1)"}}," ",{t:4,f:["..."],n:50,x:{r:[".","~/expanded"],s:"_0===_1"}}," ",{t:4,f:["..."],n:50,x:{r:["~/virtual.offset"],s:"_0>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/columns.0.type"],s:'_0==="boolean"'}}," ",{t:4,f:["..."],n:50,x:{r:["@this"],s:"_0._allSelected()"}}],empty:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:2,x:{r:["message"],s:'_0||"No data."'}}]}]}],pagination:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pagination",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-info",g:1}],f:[{t:4,f:[{t:2,x:{r:["~/page","~/pagination.per"],s:"_0*_1+1"}}," - ",{t:2,x:{r:["~/pagination.total","~/rows.length","~/page","~/pagination.per"],s:"_2+1===_0?_1:(_2+1)*_3"}}," of ",{t:2,r:"~/rows.length"},{t:4,f:[" (",{t:2,r:"~/items.length"}," total)"],n:50,r:"~/isFiltered"}],n:50,x:{r:["pagination","rows.length"],s:"_0&&_1"}}," ",{t:4,f:["​"],n:50,x:{r:["_paginate"],s:"_0===1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-select-all-all",g:1}],f:[{t:4,f:[{t:7,e:"strong",f:[{t:2,r:"selections.length"}]}," of ",{t:7,e:"strong",f:[{t:2,r:"rows.length"}]}," selected",{t:4,f:[" - ",{t:7,e:"a",m:[{n:"href",f:"#",t:13,g:1},{n:["click"],t:70,f:"selectAllAll"}],f:["Select All"]}],n:50,x:{r:["@this","selections.length","rows.length"],s:"_0._allSelected()&&_1<_2"}}],n:50,x:{r:["selections.length"],s:"_0>0"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pages",g:1}],f:[{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1-1)]'}}],f:["Previous"]}],n:50,x:{r:["~/page"],s:"_0>0"}}," ",{t:4,f:[{t:4,f:[{t:7,e:"input",m:[{n:["change"],t:70,f:{r:["~/pagination.total","@node.value","@this","@node","~/page"],s:'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]'}},{n:"value",f:[{t:2,r:"."}],t:13},{t:73,v:"t",f:"false"}]}],n:50,x:{r:[".","~/page"],s:"_0==_1+1"}},{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","@index","../"],s:'[_0.set("page",_2[_1-1])]'}}],f:["..."]}," "],n:50,x:{r:["."],s:'_0==="..."'},l:1},{t:4,f:[" ",{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","."],s:'[_0.set("page",_1-1)]'}}],f:[{t:2,r:"."}]}],n:51,l:1}],n:52,r:"~/pagination.array"}," ",{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1+1)]'}}],f:["Next"]}],n:50,x:{r:["~/page","~/pagination.total"],s:"_0<_1-1"}}]}]}]}},css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.table.primary")),n=Object.assign({},t,e("raui.primary.active"),e("raui.table.primary.active")),r=Object.assign({selected:{},header:{},footer:{}},e("raui.table"));return"\n .rtable {\n display: flex;\n flex-direction: column;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n }\n \n .rtable.rtable-border {\n border: 1px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header {\n min-height: 2em;\n }\n \n .rtable-group > div > div,\n .rtable-header > div > div,\n .rtable-row > div > div {\n padding: "+(r.padding||"0.5em")+";\n overflow: inherit;\n text-overflow: inherit;\n line-height: 1em;\n }\n .rtable-row > .rtable-no-pad > div {\n padding: 0;\n }\n \n .rtable-auto .row > *,\n .rtable-fixed .row > *\n {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n \n .rtable-header > div > div, .rtable-column {\n overflow: hidden;\n }\n \n .rtable-number-column {\n text-align: right;\n }\n .rtable-date-column {\n text-align: right;\n }\n \n .rtable-sortable {\n cursor: pointer;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .grid .row.rtable-row, .grid .rtable-header > .row {\n width: auto;\n min-width: min-content;\n flex-grow: 1;\n }\n \n .rtable-nowrap .grid .rtable-row, .rtable-nowrap .grid .rtable-header > .row {\n flex-wrap: nowrap;\n }\n .rtable-nowrap .rtable-row-wrap, .rtable-inner-row-wrap {\n flex-grow: 1;\n } \n \n .rtable-row-wrap {\n display: flex;\n flex-grow: 1;\n align-items: center;\n z-index: 2;\n align-items: stretch;\n color: "+(t.fg||"#222")+";\n background-color: "+(r.even||t.bga||"#f4f4f4")+";\n }\n .rtable-row-wrap:focus-within {\n z-index: 3;\n }\n .rtable-row-wrap.rtable-odd {\n background-color: "+(r.odd||t.bg||"#fff")+";\n }\n .rtable-row-wrap:hover .rtable-inner-row-wrap, .rtable-row-wrap:hover .rtable-select-row {\n background-color: "+(r.over||n.bg||"#e6f0fa")+";\n }\n .rtable-row-wrap:hover .rtable-inner-row-wrap,\n .rtable-wrap .rtable-row-wrap:hover .rtable-select-row {\n position: relative;\n }\n .rtable-row-wrap:hover .rtable-select-row {\n overflow: visible;\n }\n \n .rtable-row-wrap:hover {\n border-bottom: "+(r.dividerSize||"4px")+" solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-row-wrap.rtable-selected {\n background-color: "+(r.selected.bg||"#cee5fd")+";\n color: "+(r.selected.fg||t.fg||"#222")+";\n }\n .rtable-row-wrap.rtable-selected.rtable-odd {\n background-color: "+(r.selected.odd||"#c5dffb")+";\n }\n \n .rtable-nowrap .rtable-row-wrap {\n display: inline-flex;\n min-width: 100%;\n box-sizing: border-box;\n }\n \n .rtable-nowrap > .rtable-top > .grid {\n line-height: 1em;\n }\n \n .rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 0 0 1px;\n margin: 0 0 0 -1px;\n }\n .rtable-wrap.rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-width: 0 0 1px 1px;\n margin: 0 0 -1px -1px;\n }\n \n .rtable-border .rtable-header .rtable-column {\n border-width: 0 0 0 0;\n margin: 0 0 0 0;\n }\n .rtable-wrap.rtable-border .rtable-header .rtable-column {\n border-width: 0 0 1px 0;\n margin: 0 0 -1px 0;\n }\n \n .rtable-border .rtable-row .rtable-column:nth-child(1),\n .rtable-border .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 0;\n }\n .rtable-border.rtable-with-select .rtable-row .rtable-column:nth-child(1),\n .rtable-border.rtable-with-select .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 1px;\n }\n \n .rtable-border .rtable-row-wrap {\n border-bottom-width: 1px;\n }\n \n .rtable-border .rtable-row-expand, .rtable-border .rtable-row-extra {\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin-left: -1px;\n width: 100%;\n }\n .rtable-border.rtable-with-select .rtable-row-expand, .rtable-border.rtable-with-select .rtable-row-extra {\n border-left-width: 1px;\n }\n \n .rtable-row-expand, .rtable-row-extra {\n box-sizing: border-box;\n padding: "+(r.padding||"0.5em")+";\n }\n \n .rtable-row-hover {\n pointer-events: none;\n position: relative;\n z-index: 1;\n }\n .rtable-row-hover-content {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n }\n .rtable-row-hover-content > * {\n pointer-events: visible;\n }\n \n .rtable-group {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header.rtable-row-wrap:hover {\n font-weight: bold;\n background-color: "+(r.header.bg||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n background-color: "+(r.header.bg||"#dedede")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header-extra.rtable-noheader {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header-extra {\n background-color: "+(r.header.bg||"#dedede")+";\n padding: "+(r.padding||"0.5em")+";\n line-height: 1em;\n z-index: 4;\n box-sizing: border-box;\n min-width: 100%;\n }\n .rtable-nowrap .rtable-header-extra {\n position: sticky;\n left: 0;\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n position: relative;\n z-index: 3;\n }\n .rtable-fixed-header.rtable-scrolled-down .rtable-header-fixed {\n box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15), 0 0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper::-webkit-scrollbar {\n height: 0;\n }\n .rtable-fixed-header .rtable-header-fixed::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n \n .rtable-nowrap .rtable-fixed-column, .rtable-nowrap .rtable-row-extra, .rtable-nowrap .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n position: -webkit-sticky;\n position: sticky;\n left: 0;\n }\n .rtable-border..rtable-nowrap .rtable-fixed-column, .rtable-border.rtable-nowrap .rtable-row-extra, .rtable-border.rtable-nowrap .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: 1px;\n }\n .rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtable-nowrap.rtable-with-select .rtable-row-extra, .rtable-nowrap.rtable-with-select .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: "+(r.selectWidth||"2em")+";\n }\n .rtabe-border.rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-extra, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: "+(r.selectWidth||"2em")+";\n }\n \n .rtable-nowrap .rtable-inner-row-wrap {\n background-color: inherit;\n }\n \n .rtable-nowrap .row,\n .rtable-nowrap .rtable-fixed-column,\n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n background-color: inherit;\n z-index: 1;\n }\n \n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n position: sticky;\n position: -webkit-sticky;\n left: 0;\n z-index: 1;\n }\n .rtable-nowrap .rtable-select-header {\n z-index: 2;\n }\n \n .rtable-nowrap.rtable-border .rtable-fixed-column {\n border-right-width: 1px;\n }\n \n .rtable-scrolled-up .rtable-bottom {\n box-shadow: 0 -1px 2px 0 rgba(60, 64, 67, 0.3), 0 -1px 3px 1px rgba(60, 64, 67, 0.15), 0 -0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-bottom {\n padding: "+(r.padding||"0.5em")+";\n background-color: "+(r.footer.bg||r.header.bg||"#dedede")+";\n border-top: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-pagination {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n justify-content: space-between;\n user-select: none;\n }\n \n .rtable-pages span {\n margin: 0.3em;\n cursor: pointer;\n }\n .rtable-pages span:first-of-type {\n margin-left: 0;\n }\n .rtable-pages input {\n text-align: center;\n width: 2.5em;\n font-size: 1em;\n background-color: transparent;\n border: none;\n padding: 0;\n font-weight: bold;\n text-decoration: underline;\n }\n \n /* checkboxes */\n .rtable-select {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n position: absolute;\n display: block;\n margin: 0;\n width: 3em;\n height: 3em;\n box-shadow: none;\n outline: none;\n opacity: 0;\n top: -0.75em;\n left: -0.75em;\n border-radius: 2em;\n transition: transform 0.2s, opacity 0.2s;\n background-color: "+(t.bc||"#ccc")+";\n cursor: pointer;\n }\n \n .rtable-select-header > div, .rtable-select-row > div, .rtable-header > div.rtable-select-header > div {\n padding: 0;\n overflow: visible;\n width: 1.5em;\n height: 1.5em;\n position: relative;\n line-height: 1.8em;\n cursor: pointer;\n display: flex;\n justify-content: space-around;\n align-items: center;\n flex-grow: 0;\n display: block;\n }\n \n .rtable-select:checked {\n background-color: "+(t.fga||"#07e")+';\n }\n \n .rtable-select-header:hover .rtable-select, .rtable-select-row:hover .rtable-select {\n opacity: 0.04;\n }\n \n .rtable-select:focus {\n opacity: 0.12;\n transform: scale(1);\n }\n \n .rtable-select-header:hover .rtable-select:focus, .rtable-select-row:hover .rtable.select:focus {\n opacity: 0.16;\n }\n \n .rtable-select:active {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n \n .rtable-select-row > div:before, .rtable-select-header > div:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n border: solid 0.125em; /* Safari */\n border-color: '+(t.fg||"#222")+";\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n position: absolute;\n top: 0.3em;\n left: 0.15em;\n transition: border-color 0.2s, background-color 0.2s;\n }\n \n .rtable-select-row > div:after, .rtable-select-header > div:after {\n content: '';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 0.3em;\n left: 0.15em;\n border-radius: 0.125em;\n }\n \n .rtable-selected .rtable-select-row > div:before, .rtable-all-selected > div:before {\n border-color: "+(t.fga||"#07e")+";\n }\n \n .rtable-selected .rtable-select-row > div:after, .rtable-all-selected > div:after {\n border-color: "+(t.bg||"#fff")+';\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(t.fga||"#07e")+";\n opacity: 1;\n }\n \n .rtable-row-wrap > .rtable-select-header,\n .rtable-row-wrap > .rtable-select-row {\n text-align: center;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: "+(r.selectWidth||"2em")+";\n }\n \n .rtable-row-wrap > .rtable-select-row {\n border-style: solid;\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n }\n \n .rtable-inner-row-wrap {\n border-style: solid;\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n }\n \n .rtable-column button, .rtable-column .btn {\n padding: 0 0.5em;\n margin: 0.2em 0.5em;\n min-height: 0;\n }\n \n .rtable-column.rtable-editing, .rtable-column.rtable-editing > .rtable-edit {\n padding: 0;\n }\n .rtable-column.rtable-editing input {\n width: 100%;\n box-sizing: border-box;\n height: 100%;\n margin: 0;\n border: none;\n background-color: transparent;\n padding: 0.25em 0.5em;\n }\n \n .rtable-valign-top .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-top > div {\n display: flex;\n height: 100%;\n align-items: flex-start;\n box-sizing: border-box;\n }\n .rtable-valign-bottom .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-bottom > div {\n display: flex;\n height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n }\n .rtable-valign-center .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-center > div {\n display: flex;\n height: 100%;\n align-items: center;\n box-sizing: border-box;\n }\n "+(e("table.includeGrid")?b(e):"")}.call(this,e)].join(" ")},cssId:"rtable",noCssTransform:!0,attributes:["auto-titles","paginate","items","filter","data-handler","sort-handler","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap","parameters"],components:{table:!1,Table:!1},syncComputedChildren:!0,decorators:{grid:h,sized:i,scrollother:function e(t,n){var r=this,i=function(i){e.lock&&e.lock!==t||(e.tm&&clearTimeout(e.tm),e.lock=t,r.find(n).scrollLeft=i.target.scrollLeft,e.tm=setTimeout(function(){e.tm=null,e.lock=!1},100))};return t.addEventListener("scroll",i,{passive:!0}),{teardown:function(){t.removeEventListener("scroll",i)}}}},events:{},use:[g({name:"clickd",count:1}),g({name:"dblclickd",count:2}),(void 0===A&&(A={}),function(e){e.instance.transitions[A.name||"expand"]=k}),(void 0===L&&(L={}),function(e){e.instance.decorators[L.name||"scrolled"]=O})],on:{construct:function(){var e,t,n,r,i,o,a,l,s=this.component;if(!s)return;var d=s.template.f||[],c=s.template.m?s.template.m.slice():[],f=s.template;s.template={e:f.e,f:f.f,t:f.t,m:c};var u=0;function h(e,t,n){if(e&&e.f&&1===e.f.length&&2===e.f[0].t){var r="_a"+u++;return c.push({t:13,n:r,f:e.f}),n?r:t?{t:[{t:2,r:"~/"+r}]}:{t:2,r:"~/"+r}}return e&&e.f}function b(e){var t=[],n=[];return e.forEach(function(e){if("column"===e.e||"col"===e.e){var r,i={},o=e.m||N;if(i.index=t.length,t.push(i),i.content=(e.f||[]).filter(function(e){return"edit"!==e.e&&"header"!==e.e}),i.editP=(e.f||[]).find(function(e){return"edit"===e.e}),i.editP&&(i.editP=i.editP.f),(r=o.find(function(e){return"id"===e.n}))&&S(r.f)&&(i.id=r.f),i.label=(e.f||[]).find(function(e){return"header"===e.e}),i.label?(i.label=i.label.f,i.title=o.find(function(e){return"label"===e.n}),i.title||(i.title=o.find(function(e){return"header"===e.n})),i.title&&i.title.f&&(i.title=h(i.title))):(i.label=o.find(function(e){return"label"===e.n}),i.label||(i.label=o.find(function(e){return"header"===e.n})),i.label&&i.label.f&&(i.label=h(i.label))),i.label||(i.label=""),i.id||(i.id=i.label),Array.isArray(i.label)||(i.label=[i.label]),i.type=o.find(function(e){return"type"===e.n}),i.type&&i.type.f&&(i.type=i.type.f),i.type||(i.type="string"),i.filter=o.find(function(e){return"filter"===e.n}),i.filter&&i.filter.f&&(i.filter=h(i.filter),i.filter.r&&(i.filter=i.filter.r)),i.sort=o.find(function(e){return"sort"===e.n}),i.sort&&i.sort.f&&(i.sort=h(i.sort),i.sort.r&&(i.sort=i.sort.r)),i.dir=o.find(function(e){return"dir"===e.n}),i.dir&&i.dir.f&&(i.dir=h(i.dir),i.dir.r&&(i.dir=i.dir.r)),i.hidden=o.find(function(e){return"hidden"===e.n}),i.hidden&&0===i.hidden.f?i.hidden=!0:i.hidden&&E(i.hidden.f)?i.hidden=h(i.hidden):i.hidden=!1,S(i.hidden)&&(i.hidden=!1),i.noPad=o.find(function(e){return"no-pad"===e.n}),i.noPad&&0===i.noPad.f?i.noPad=0:i.noPad&&E(i.noPad.f)?i.noPad=h(i.noPad):delete i.noPad,i.editable=o.find(function(e){return"editable"===e.n}),i.editable&&0===i.editable.f?i.editable=!0:i.editable&&E(i.editable.f)?i.editable=h(i.editable):i.editable=!1,i.valign=o.find(function(e){return"valign"===e.n}),i.valign&&E(i.valign.f)?i.valign=h(i.valign):i.valign&&"string"==typeof i.valign.f&&(i.valign=i.valign.f),i.fixed=o.find(function(e){return"fixed"===e.n}),i.fixed&&E(i.fixed.f)?i.fixed={path:h(i.fixed,!1,!0)}:i.fixed&&"string"==typeof i.fixed.f&&(i.fixed=i.fixed.f),(r=o.find(function(e){return"get"===e.n}))&&r.f){var a=h(r,!1,!0);field.get=function(e){var t=this.get(a);return"function"==typeof t?t.call(this,e):void 0}}i.attrs=o.filter(function(e){return!~R.indexOf(e.n)}),i.attrs.forEach(function(e,t){C.test(e.n)&&(i.attrs[t]={t:13,n:"class-"+e.n})})}else if("field"===e.e){var l,s={},d=e.m||N;if(S(l=d.find(function(e){return"path"===e.n}))?s.path=l:l&&l.f&&(s.path=h(l)),(l=d.find(function(e){return"value"===e.n}))&&l.f&&(s.value=h(l)),S(l=d.find(function(e){return"type"===e.n}))?s.type=l:l&&l.f&&(s.type=h(l)),S((l=d.find(function(e){return"id"===e.n})).f)&&(s.id=l.f),S(l=d.find(function(e){return"dir"===e.n}))?s.dir=l:l&&S(l.f)&&(s.dir=l.f),S(l=d.find(function(e){return"label"===e.n}))?s.label=l:l&&l.f&&(s.label=h(l)),(l=d.find(function(e){return"get"===e.n}))&&l.f){var c=h(l,!1,!0);s.get=function(e){var t=this.get(c);return"function"==typeof t?t.call(this,e):void 0}}s.id||(s.id=s.label),s.path||(s.path=s.id),n.push(s)}}),{fields:n,columns:t}}e=d.find(function(e){return"expand"===e.e}),t=d.find(function(e){return"hover"===e.e}),n=d.find(function(e){return"group"===e.e}),r=d.find(function(e){return"wrapper"===e.e}),i=d.find(function(e){return"row"===e.e}),o=d.find(function(e){return"top"===e.e}),a=d.find(function(e){return"bottom"===e.e}),this._init={sets:b(d),partials:{}};var p=this._init.sets.columns;this._init.sets["meta.expand"]=e&&e.f&&e.f.length&&e.f,this._init.sets["meta.hover"]=t&&t.f&&t.f.length&&t.f,this._init.sets["meta.extra"]=i&&i.f&&i.f.length&&i.f,this._init.sets["meta.top"]=o&&o.f&&o.f.length&&o.f,this._init.sets["meta.topAttrs"]=o&&o.m,this._init.sets["meta.bottom"]=a&&a.f&&a.f.length&&a.f,this._init.sets["meta.bottomAttrs"]=a&&a.m;var g=M(p),v=g[0],m=g[1],w=g[2],x=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-header"},{t:4,f:[{n:"style-opacity",f:"0",t:13}],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}},{t:4,n:50,r:"~/fixedHeader",f:[{t:13,n:"style-padding-right",f:[{t:2,r:"~/scrollOffset"},"px"]}]}],f:[{t:7,e:"div",f:[{t:8,r:"grid-head-cols"}],m:[{t:13,n:"class-row"}]}]}];x[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-header"},{t:13,n:"class-rtable-column"},{t:13,n:"title",f:[{t:2,r:"selections.length"}," items selected"]},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]}],f:[{t:7,e:"div",f:[{t:4,n:50,r:"~/allowSelectAll",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:"selectAll"}]}]}],m:[{t:70,n:["clickd"],f:"selectAll"}]}]}]});var _,y=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-rtable-odd",f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-live"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-inner-row-wrap"}],f:[{t:7,e:"div",f:[{t:8,r:"grid-row-cols"}],m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-row"},{t:70,n:e&&e.f?["dblclickd"]:["click","dblclick"],f:{r:["@this","~/rows","~/visibleRows","."],s:"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]"}}]}]}]}];i&&i.m&&i.m.length&&(this._init.sets.rowAttrs=i.m.slice(),y[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."},z:w}));r&&r.m&&r.m.length&&(this._init.sets.wrapperAttrs=r.m.slice(),y[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."},z:w}));i&&i.f&&i.f.length&&y[0].f[0].f.push({t:7,e:"div",m:[{t:13,n:"class-rtable-row-extra"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."},z:w}]});if(e&&e.f&&e.f.length){var k={t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},O=e.m&&e.m.find(function(e){return"skip"===e.n});O=O&&O.f&&O.f[0]&&2===O.f[0].t?Object.assign({},O.f[0],{t:4,n:51,f:[k]}):k,y[0].f[0].f.push({t:4,n:50,x:{r:[".","~/expanded"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/meta.expand",c:{r:"."},z:w}]}],m:[{t:13,n:"class-rtable-row-expand"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]}),y[0].f[0].f[0].m.push(O),y[0].f[0].f[1].f[0].m.push({t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}})}t&&t.f&&t.f.length&&(y[0].f[0].f.unshift({t:4,n:50,x:{r:[".","~/hovered"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-hover-content"}].concat(t.m||[]),f:[{t:16,r:"~/meta.hover",c:{r:"."},z:w}]}],m:[{t:13,n:"class-rtable-row-hover"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]}),y[0].m.push({t:70,n:["mouseenter"],f:{r:["@this","@index"],s:"[_0._hover(_1)]"}},{t:70,n:["mouseleave"],f:{r:["@this","@index"],s:"[_0._unhover(_1)]"}}));if(y[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}]}]}]}]}),n&&n.m&&(_=n.m.find(function(e){return"by"===e.n}))&&(S(_.f)||1===_.length&&2===_[0].t)){var P={t:4,n:50,f:[{t:7,e:"div",m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-group"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:70,n:e&&e.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}].concat(n.m.filter(function(e){return"by"!==e.n&&"select"!==e.n}))}],x:{s:"_0&&_1[(_1&&(_2*_3+_4))||_4]",r:["~/showGroups","~/groups","~/page","~/pagination.per","@index"]}};y.unshift(P),this._init.by=_.f;var L,A=b(n.f).columns.filter(function(e){return!0!==e.hidden}).map(function(e){var t={t:7,e:"div",f:[{t:7,e:"div",f:e.content}],m:e.attrs};e.type&&t.m.unshift({t:13,n:"class-rtable-"+e.type+"-column"}),t.m.push({t:13,n:"class-rtable-column"}),t.m.find(function(e){return"title"===e.n})||t.m.unshift({t:13,n:"title",f:e.content});var n=t;return e.hidden&&e.hidden.r&&(n={t:4,n:51,r:e.hidden.r,f:[t]}),n});A.unshift({t:4,n:50,r:"~/allowGroupSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}}]}]}]}]}),(L=n.m.find(function(e){return"select"===e.n}))&&(l||(l=[])).push(Object.assign({},L,{n:"allowGroupSelect"})),(L=n.m.find(function(e){return"show"===e.n}))&&(l||(l=[])).push(Object.assign({},L,{n:"showGroups"})),P.f[0].f=A}this._init.partials["grid-row"]=y,this._init.partials["grid-row-cols"]=m,this._init.partials["grid-head"]=x,this._init.partials["grid-head-cols"]=v,l&&this.component&&(this.component.mappings=l)},config:function(){this.set(this._init.sets),Object.assign(this.partials,this._init.partials)},render:function(){this._autoObserver&&this._autoObserver.fire()},selectAll:function(){var e,t;return this._allSelected()?(t=null,e=[],this.set({selections:e,selected:t})):(t=(e=("virtual"===this.get("paginate")?this.get("rows"):this.get("visibleRows")).slice())[0],this.set({selections:e,selected:t})),this.fire("selection",{},{item:t,items:e}),!1},selectAllAll:function(){var e=this.get("rows").slice();return this.set({selections:e,selected:null}),this.fire("selection",{},{item:null,items:e}),!1}},observe:{_rows:function(){var e=this;this._rowbounce&&clearTimeout(this._rowbounce),setTimeout(function(){return e._rows()},this.get("@style.raui.table.debounce")||160)},paginate:{handler:function(e){var n=this;if("auto"===e||"virtual"===e||e instanceof t){this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();("auto"===e||"virtual"===e)&&this.root;var r,i=!1,o=function(){if(n.rendered){var t=n.find(".rtable-top");if(t)if(n.get("items.length")){var r=t.clientHeight+","+t.clientWidth;if(o.last!==r||!i){var a=n.getContext(t);a.decorators&&a.decorators.scrolled&&a.decorators.scrolled.refresh();var l=n.find(".rtable-header")||{},s=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight});if(s.length<5){var d=Math.floor(t.clientHeight/(l.offsetHeight||1));d<5&&(d=5),n.set("_paginate",d),s=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight})}s.length>0?i=!0:s=[25];var c=Math.ceil(s.reduce(function(e,t){return e+t},0)/s.length);n._avgSize=c;var f=Math.floor((t.clientHeight-(l.offsetHeight||1))/c);"virtual"===e&&(f+=10)<30&&(f=30),n.set("_paginate",f),o.last=r}}else n._autoLenObserver||(n._autoLenObserver=n.observeOnce("items",function(){n._autoLenObserver=0,setTimeout(o)}))}},a=function(){r&&clearTimeout(r),r=setTimeout(function(){o(),r=null,i&&n._scrollListener&&n._scrollListener.fn()},50)};if(this._autoObserver=this.observe("~/tableHeight",a),this._autoObserver.fire=a,"virtual"===e){var l,s=!1,d=function(){if(n.rendered){if(l||(l=n.find(".rtable-top")),!i)return a();var e=l.scrollTop,t=n.get("virtual")||{},r=t.offset,o=n.get("_paginate"),d=o-10,c=n.get("rows.length");o>c&&(o=c);var f=n._avgSize,u=d*f,h=Math.floor(e/f)-5;h<0&&(h=0);var b=h;if(h+o>c&&(h=c-o),r===h&&!isNaN(t.top))return s=!1;if(!P(r)||isNaN(r)||isNaN(t.top)||e<t.top+u||e>t.bottom-u||r>0&&e<f*d){var p=b,g=c-b-o;p<0?(g+=-1*p,p=0):p>c-o&&(p=c-o),g<0&&(g=0);var v,m,w=p*f,x=g*f;h<r+o&&h>r-o&&(v=h>r?n.findAll(".rtable-live")[h-r]:n.findAll(".rtable-live")[r-h]),v&&h>0&&v.offsetTop>l.scrollTop-u-5&&v.offsetTop<l.scrollTop+u&&(m=v.offsetTop),n.set({"virtual.above":w,"virtual.below":x,"virtual.offset":h}),"number"==typeof m&&m!==v.offsetTop&&n.set("virtual.above",w+(m-v.offsetTop)),n.set({"virtual.top":n.get("virtual.above"),"virtual.bottom":l.scrollHeight-x})}s=!1}else l=null},c=this._scrollListener=this.on("scroll",function(e){e.node;s||(s=!0,requestAnimationFrame(d))});c.fn=d,c.observer=this.observe("rows.length",function(){n.set("virtual.offset",null),d()},{init:!1,strict:!0,defer:!0});var f=c.cancel;c.cancel=function(){f(),c.observer.cancel()}}a()}else this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();P(e)&&this.set("_paginate",e)},defer:!0},"scrollOffset tableHeight":{handler:function(){var e=this;this.rendered&&requestAnimationFrame(function(){var t=e.find(".rtable-top"),n=t&&e.getContext(t);n&&n.decorators&&n.decorators.scrolled&&n.decorators.scrolled.refresh()})},init:!1},scroll:function(e,t){~(e||"").indexOf("top")&&!~(t||"").indexOf("top")&&this.fire("scrolltop",{}),~(e||"").indexOf("bottom")&&!~(t||"").indexOf("bottom")&&this.fire("scrollbottom",{})}},data:function(){return Object.assign({page:0,selections:[],showGroups:!0,allowGroupSelect:!0,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:!1,rows:[]},z.settings)},computed:{allowSelect:function(){return this.get("allow-select")},allowSelectAll:function(){return this.get("allow-select-all")},fixedHeader:function(){return this.get("fixed-header")},autoTitles:function(){return this.get("auto-titles")},noHeader:function(){return this.get("no-header")},noWrap:function(){return this.get("no-wrap")},_rows:function(){var e=(this.get("items")||[]).slice(),t=this.get("filter"),n=this.get("sort"),r=this.get("parameters"),i=(this.get("data-handler"),this.get("@style.raui.table.data-handler"),[this.get("data-pre-handler"),this.get("@style.raui.table.data-pre-handler")]),o=i[0],a=i[1];return(o||a)&&(o||a)(this,e,t,n,r),{}},visibleRows:function(){var e=this,n=this.get("rows"),r=this.get("paginate"),i=r,o=this.get("_paginate"),a=this.get("page")||0,l=this.get("virtual");return i?("number"!=typeof i&&isNaN(+i)&&(i="auto"===i||"virtual"===i||i instanceof t?o||1:30),i<this.get("minPerPage")&&(i=this.get("minPerPage")),"virtual"===r?(a=l&&l.offset||0,n.slice(a,a+i)):(a*i>n.length&&setTimeout(function(){return e.set("page",0)},0),n.slice(i*a,i*a+i))):n},pagination:function(){var e=this.get("items")||N,t=this.get("rows"),n=this.get("paginate"),r=n,i=this.get("page")||0;if("number"!=typeof r&&isNaN(r)&&(r=this.get("_paginate")),r<this.get("minPerPage")&&(r=this.get("minPerPage")),r){var o=Math.ceil(t.length/r),a={max:Math.ceil(e.length/r),total:o,per:r};if("virtual"===n&&(a.height=this._avg*t.length),a.total>14){var l=a.array=[];i>5?l.push(1,2,3,"..."):l.push(1,2,3,4,5,6,7,8),i>5&&i+6<o?l.push(i-1,i,i+1,i+2,i+3,"...",o-2,o-1,o):i+6<o?l.push("...",o-2,o-1,o):l.push(o-7,o-6,o-5,o-4,o-3,o-2,o-1,o)}else a.array=Array.apply(null,{length:a.total}).map(function(e,t){return t+1});return a}},groups:function(){for(var e,t,n=this.get("rows"),r={},i=0;i<n.length;i++)(t=n[i][this._init.by])!=e&&(r[i]=1),e=t;return r}}});var H=/^[^\d]*/;function W(e){return P(e)?e:e&&(e=(""+e).replace(H,""))?parseFloat(e):1/0}function T(e,n,r){if("function"==typeof n.get)return n.get;var i=(r?n.sort:0)||n.path||n.filter||n.id;if("string"==typeof i){var o=t.splitKeypath(i);return function(e){for(var t=e,n=0;n<o.length;n++)t=t&&t[o[n]];return t}}}function j(e,t,n,r){var i=[].concat(e.viewmodel.value.columns,e.viewmodel.value.fields),o=i.reduce(function(e,t){return e[t.id]=T(0,t),e},{}),a=Object.values(o),l=t||[];if((n instanceof RegExp||S(n))&&n){var s=n===""+n.toLowerCase()||n===""+n.toUpperCase();try{var d=S(n)?new RegExp(n,s?"i":""):n;l=l.filter(function(e){for(var t=a.length;t--;){var n=e&&a[t](e);if(n&&d.test(n))return!0}})}catch(e){}}return(S(r)||E(r)&&!Array.isArray(r))&&(r=[r]),Array.isArray(r)&&(r=r.map(function(t){if(S(t)){var n="-"===t[0]||"+"===t[0]?t.substr(1):t,r=i.find(function(e){return e.id===n});if(!r)return;var o={get:T(0,r,!0),dir:"-"===t[0]?-1:1};if(r&&"number"===r.type){var a=o.get;o.get=function(t){return W(a.call(e,t))}}return o}if(t&&"object"==typeof t){var l=i.find(function(e){return e.id===id});if(!l)return;var s={dir:P(t.dir)?t.dir:"desc"===t.dir?-1:1,get:T(0,l,!0)};if("number"===t.type||l&&"number"===l.type){var d=s.get;s.get=function(t){return W(d.call(e,t))}}return s}}).filter(function(e){return e&&e.get}),l.sort(function(t,n){for(var i,o,a,l=0;l<r.length;l++)if(i=r[l].get.call(e,t),o=r[l].get.call(e,n),0!==(a=r[l].dir*(i<o?-1:i>o?1:0)))return a;return a})),l}function M(e){var t=[{n:"gridValue",x:{r:"~/gridValue"}},{n:"gridName",x:{r:"~/gridName"}},{n:"gridSize",x:{r:"~/tableWidth"}},{n:"gridMax",x:{r:"~/gridMax"}},{n:"table",x:{r:"@this"}}];return[e.filter(function(e){return!0!==e.hidden}).map(function(e,n){null==e.index&&(e.index=n),e.attrsHP=e.attrs.filter(function(e){return"title"!==e.n});var r={t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/columns."+n+".label",c:{r:"."},z:t}]}],m:[{t:13,n:"title",f:e.title||e.label},{t:16,r:"~/columns."+n+".attrsHP",z:t}]};if(e.type&&r.m.push({t:13,n:"class-rtable-"+e.type+"-column"}),(e.filter||e.sort)&&r.m.push({t:13,n:"class-rtable-sortable"},{t:4,n:53,r:"~/columns."+n,f:[{t:70,n:["click"],f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}}]}),r.m.push({t:13,n:"class-rtable-column"}),e.fixed){var i=e.fixed.path||"~/columns."+n+".fixed";r.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:i}]}),r.m.push({t:4,n:50,x:{r:["~/noWrap",i],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:i}]}]})}var o=r;return e.hidden&&e.hidden.r&&(o={t:4,n:51,r:e.hidden.r,f:[r]}),o}),e.filter(function(e){return!0!==e.hidden}).map(function(e,n){var r=[{t:7,e:"div",f:[{t:16,r:"~/columns."+n+".content",c:{r:"."},z:t}]}];e.attrs.length?(e.attrsP=e.attrs,e.attrs=[{t:16,r:"~/columns."+n+".attrsP",c:{r:"."},z:t}]):e.attrs=[];var i=e.attrs;if(e.fixed){var o=e.fixed.path||"~/columns."+n+".fixed";i.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:o}]}),i.push({t:4,n:50,x:{r:["~/noWrap",o],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:o}]}]})}if(e.editable&&(e.filter||e.editP)){var a={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}},l=[{t:4,n:50,x:{r:["~/columns."+n+".editP"],s:"Array.isArray(_0)"},f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-edit"},a],f:[{t:16,r:"~/columns."+n+".editP"}]}]},{t:4,n:50,l:1,x:{r:["~/columns."+n+".type"],s:"_0==='boolean'"},f:[{t:7,e:"input",m:[{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,r:e.filter}]},a]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:e.filter}]},a]}]}];"object"==typeof e.editable?(i.push({t:13,n:"class-rtable-editing",f:e.editable}),r=[Object.assign({},e.editable,{t:4,n:50,f:l}),{t:4,n:51,l:1,f:r}]):(i.push({t:13,n:"class-rtable-editing"}),r=l)}e.valign&&i.push({t:13,n:"class-rtable-valign-col-top",f:[{t:2,x:{r:["~/columns."+n+".valign"],s:"_0==='top'"}}]},{t:13,n:"class-rtable-valign-col-bottom",f:[{t:2,x:{r:["~/columns."+n+".valign"],s:"_0==='bottom'"}}]},{t:13,n:"class-rtable-valign-col-center",f:[{t:2,x:{r:["~/columns."+n+".valign"],s:"_0==='center'"}}]});var s={t:7,e:"div",f:r,m:i};e.type&&i.unshift({t:13,n:"class-rtable-"+e.type+"-column"}),i.push({t:13,n:"class-rtable-column"});var d=e.attrsP&&e.attrsP.find(function(e){return"title"===e.n});d?d.f||(i.unshift({t:13,n:"title",f:e.content.find(function(e){return e.e})?e.label:e.content}),e.attrsP.splice(i.indexOf(d),1)):i.unshift({t:4,n:50,r:"~/autoTitles",f:[{t:13,n:"title",f:e.content.find(function(e){return e.e})?e.label:e.content}]}),0===e.noPad?i.push({t:13,n:"class-rtable-no-pad"}):e.noPad&&i.push({t:13,n:"class-rtable-no-pad",f:e.noPad});var c=s;return e.hidden&&e.hidden.r&&(c={t:4,n:51,r:e.hidden.r,f:[s]}),c}),t]}var R=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"],C=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/,N=[];function G(e){return void 0===e&&(e={}),function(t){var n=t.Ractive,r=t.instance;"includeGrid"in e&&n.styleSet("table.includeGrid",e.includeGrid),r.components[e.name||"data-table"]=z}}r("RauiTable","components",z),e.Table=z,e.numberify=W,e.plugin=G,e.default=G,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],t):t(e.RauiTable={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:null;function r(e,t,r){if(n&&n.Ractive&&"object"==typeof n.Ractive[t]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var o=i.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(e,t){var n=t.split("="),r=n[0],i=n[1];return e[r]=i,e},{})),Ractive[t][o&&o[e]||e]=r}}}function i(e,t){var n=t.context||this.getContext(e),r={position:e.style.position,overflowY:e.style.overflowY};""!==e.style.position&&"static"!==e.style.position||(e.style.position="relative");var i=function(){t.offsetWidth&&n.set(t.offsetWidth,e.offsetWidth),t.offsetHeight&&n.set(t.offsetHeight,e.offsetHeight),t.clientWidth&&n.set(t.clientWidth,e.clientWidth),t.clientHeight&&n.set(t.clientHeight,e.clientHeight),t.diffWidth&&n.set(t.diffWidth,e.offsetWidth-e.clientWidth),t.diffHeight&&n.set(t.diffHeight,e.offsetHeight-e.clientHeight)},a=o(e,i);return{refresh:i,teardown:function(){e.removeChild(a),e.style.position=r.position,e.style.overflowY=r.overflowY}}}function o(e,t){var n=document.createElement("object");return n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),n.setAttribute("tabindex","-1"),n.type="text/html",n.onload=function(){n.contentDocument.defaultView.addEventListener("resize",t),t()},/Trident/.test(navigator.userAgent)?(e.appendChild(n),n.data="about:blank"):(n.data="about:blank",e.appendChild(n)),n}var a,l=16;function s(e){l=e}function d(e){return a||function e(){!a&&window&&"document"in window&&"function"==typeof document.createElement&&((a=document.createElement("div")).setAttribute("style","position: absolute; left: -2em; width: 1em; height: 1em;"),o(a,function(){return s(a.getBoundingClientRect().width)}),window.addEventListener("resize",function(){e(),s(a.getBoundingClientRect().width)})),a&&!a.parent&&document.body.appendChild(a)}(),"string"==typeof e&&(e=e.replace(/[^-.\d]/g,"")),+e*l}var c={tiny:{units:[2,3,4,5,6,8],max:"0",value:0},xsmall:{units:[2,3,4,5,6,8,10,12],max:"20em",prefix:"xs",value:10},small:{units:[2,3,4,5,6,8,10,12],max:"36em",value:20},medium:{units:[2,3,4,5,6,8,10,12],max:"48em",value:30},large:{units:[2,3,4,5,6,8,10,12,16,20],max:"64em",value:40},xlarge:{units:[2,3,4,5,6,8,10,12,16,20],max:"100em",value:50},ginormous:{units:[2,3,4,5,6,8,10,12,16,20],max:"150em",value:60}},f={"grid grid-root":/\bgrid grid-root\b/g},u=/\s+/g;function h(e,t){var n,r,o=this.getContext(e),a=this,l=t||{};function s(t){if("number"==typeof l.offset&&(t-=l.offset),!l.type||"class"===l.type){var i,a=e.className,s=-1,d=[];for(var c in n)f[c].lastIndex=-1,n[c]<=t?(f[c].test(a)||(a+=" "+c),n[c]>s&&(s=n[c],i=c,d.push(i))):a=a.replace(f[c],"").trim();if(e.className=a.replace(u," "),!i)return;l.value&&o.set(l.value,r[i].value),l.name&&o.set(l.name,i),l.size&&o.set(l.size,t),l.max&&o.set(l.max,s),l.classes&&o.set(l.classes,d.join(" ")),l.matches&&o.set(l.matches,d)}}function h(){for(var t in r=a.get("@style.break")||c,n={},r)n[t]=d(r[t].max),f[t]||(f[t]=new RegExp("\\b"+t+"\\b","g"));s(e.clientWidth)}var b=this.observe("@style.break",h,{init:!1}),p=o.observe("@local.width",s,{init:!1}),g=i.call(this,e,{clientWidth:"@local.width"});return e.className+=" grid grid-root",l.immediate?h():requestAnimationFrame(h),{update:function(t){l=t||{},requestAnimationFrame(function(){return s(e.clientWidth)})},teardown:function(){e.className=e.className.replace(f["grid grid-root"],"").trim(),p.cancel(),b.cancel(),g.teardown()}}}function b(e,t){var n=e("raui.grid.break")||t||c,r=(e("raui.grid.wrappers")||[".row-wrap > ",".row-wrap > .row-wrap > "]).slice();r.unshift("");var i=".row > * { position: relative; width: 100%; transition-duration: 0.2s; transition-timing-function: ease-in-out; transition-property: padding, margin; box-sizing: border-box; }\n.grid { display: block; }\n.grid .row { display: flex !important; flex-wrap: wrap; min-height: fit-content; width: 100%; align-content: flex-start; }\n.grid .row.row-pad > * { padding: "+(e("raui.grid.padding")||"0.5em")+"; }\n.grid .row > .pad { display: flex; flex-direction: column; padding: "+(e("raui.grid.padding")||"0.5em")+"; box-sizing: border-box; }",o=Object.keys(n).map(function(e){return(n[e].key=e)&&n[e]});return o.sort(function(e,t){return e.value>t.value?1:e.value<t.value?-1:0}),o.forEach(function(t){var n=t.prefix||t.key[0],o={};t.units.forEach(function(e){for(var t=1;t<e;t++){var n=""+t/e*100;n=n.substr(0,n.indexOf(".")+3),o[n]||(o[n]=[]),o[n].push(t+"-"+e)}});var a=t.key;i+="\n"+[r.map(function(e){return"."+a+" > "+e+"."+n+"1, ."+a+" > "+e+".row > ."+n+"1"}).join(", "),"."+a+" ."+n+"-n1, ."+a+" .row-"+n+"-n1 > *"].filter(function(e){return e}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: 100%; flex-grow: 0; flex-shrink: 0; }\n"+[r.map(function(e){return"."+a+" > "+e+"."+n+"0, ."+a+" > "+e+".row > ."+n+"0"}).join(", "),"."+a+" ."+n+"-n0, ."+a+" .row-"+n+"-n0 > *"].filter(function(e){return e}).join(", ")+" { display: none; flex-grow: 0; flex-shrink: 0: }\n"+Object.keys(o).map(function(t){return o[t].map(function(e){return""+[r.map(function(t){return"."+a+" > "+t+".row-"+n+e+" > *, ."+a+" > "+t+"."+n+e+", ."+a+" > "+t+".row > ."+n+e}).join(", "),"."+a+" .row-"+n+"-n"+e+" > * .row > ."+n+"-n"+e+", ."+a+" ."+n+"-n"+e+", ."+a+" .row-"+n+"-n"+e+" > *"].filter(function(e){return e}).join(", ")}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: "+t+"%; flex-grow: 0; flex-shrink: 0; }"}).join("\n")+"\n"+[r.map(function(e){return"."+a+" > "+e+".row > "+n+"-fill, ."+a+" >"+e+".row > ."+n+"-auto"}).join(", "),"."+a+" ."+n+"-nfill, ."+a+" ."+n+"-nauto"].filter(function(e){return e}).join(", ")+" { display: "+(e("raui.grid.display")||"inline-block")+"; width: auto; flex-grow: 1; flex-shrink: 1; }"}),i}h.style=b,r("grid","decorators",h);var p=250;function g(e){return void 0===e&&(e={}),function(t){var n=t.Ractive;t.instance.events[e.name||(e.count||"")+"clicks"]=function(t,r,i){var o,a=Object.assign({},e,i);return(o=t.__r_clicks__)?o.subscribe(a.count||1,!!a.hold,r):(o=new v(n.getContext(t),a.delay||p,a.bubble||!1),t.__r_clicks__=o,o.subscribe(a.count||1,!!a.hold,r)),{teardown:function(){o.unsubscribe(a.count||1,!!a.hold,r)}}}}}g({name:"click",count:1}),g({name:"dblclick",count:2}),g({name:"trpclick",count:3});var v=function(e,t,n){this.context=e,this.node=e.node,this.delay=t,this.fires={},this.refs=0,this.bubble=n,this.bind()};function m(e){return this.__r_clicks__.mousedown(e)}function w(e){return this.__r_clicks__.touchdown(e)}function x(){this.addEventListener("keydown",y,!1),this.addEventListener("blur",_,!1)}function _(){this.removeEventListener("keydown",y,!1),this.removeEventListener("blur",_,!1)}function y(e){if(32===e.which||10===e.which||13===e.which)return this.__r_clicks__.fire()}function k(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return new Promise(function(t){requestAnimationFrame(function(){e.setStyle("overflow","hidden");var r="x"===n.axis?"width":"height";if(e.isIntro||n.intro){var i=e.getStyle(r);e.setStyle(r,0),e.setStyle("opacity",0),t(e.animateStyle(r,i,n).then(function(){return e.animateStyle("opacity",1,n)}).then(function(){e.setStyle(r,""),e.setStyle("overflow","")}))}else e.setStyle(r,e.getStyle(r)),e.setStyle("opacity",1),t(e.animateStyle("opacity",0,n).then(function(){return e.animateStyle(r,0,n)}))})})}function O(e,t){void 0===t&&(t={});var n="string"==typeof t?t:t.bind;if("string"!=typeof n)return{teardown:function(){}};var r,i=t.allow||2,o=this.getContext(e),a=!1;function l(){a=!1;var t="";e.scrollHeight>e.clientHeight&&(t+="vscroll"),e.scrollWidth>e.clientWidth&&(t+=(t?" ":"")+"hscroll"),e.scrollTop<=i&&(t+=" top"),e.scrollTop>=e.scrollHeight-e.clientHeight-i&&(t+=" bottom"),~t.indexOf("top")||~t.indexOf("bottom")||(t+=" vmiddle"),e.scrollLeft<=i&&(t+=" left"),e.scrollLeft>=e.scrollWidth-e.clientWidth-i?t+=" right":~t.indexOf("left")||~t.indexOf("right")||(t+=" hmiddle"),o.set(n,t),o.hasListener("scrolled")&&o.raise("scrolled",{})}return e.addEventListener("scroll",l,{passive:!0}),requestAnimationFrame(l),{refresh:function(){a||(r&&clearTimeout(r),r=setTimeout(function(){r=null,a=!0,requestAnimationFrame(l)},250))},teardown:function(){e.removeEventListener("scroll",l),o.set(n,"")}}}function S(e){return"string"==typeof e}function P(e){return"number"==typeof e}function E(e){return"object"==typeof e}v.prototype.subscribe=function(e,t,n){(this.fires[e+","+t]||(this.fires[e+","+t]=[])).push(n),this.refs++},v.prototype.unsubscribe=function(e,t,n){var r=this.fires[e+","+t]||[];r.splice(r.indexOf(n),1),this.refs--,this.refs||this.teardown()},v.prototype.bind=function(){window.PointerEvent||window.navigator.pointerEnabled?this.node.addEventListener("pointerdown",m):window.navigator.msPointerEnabled?this.node.addEventListener("MSPointerDown",m):(this.node.addEventListener("mousedown",m),this.node.addEventListener("touchstart",w)),"A"!==this.node.tagName&&"BUTTON"!==this.node.tagName&&"button"!==this.node.type&&"submit"!==this.node.type&&"checkbox"!==this.node.type&&"radio"!==this.node.type||this.node.addEventListener("focus",x)},v.prototype.fire=function(e,t,n,r){var i=this;this.tm?(this.tmCount++,clearTimeout(this.tm)):this.tmCount=1;var o=function(){i.tm=null,(i.fires[i.tmCount+","+!!r]||[]).forEach(function(o){o({node:i.node,original:e,x:t,y:n,hold:!!r})})};return r?o():this.tm=setTimeout(o,this.delay),this.bubble},v.prototype.mousedown=function(e){var t=this;if(!this.preventMousedownEvents&&(void 0===e.which||1===e.which)){var n,r=e.clientX,i=e.clientY,o=e.pointerId,a=function(e){e.pointerId==o&&(t.fire(e,r,i),s())},l=function(e){e.pointerId==o&&(Math.abs(e.clientX-r)>=12||Math.abs(e.clientY-i)>=12)&&s()},s=function(){n&&clearTimeout(n),t.node.removeEventListener("MSPointerUp",a,!1),document.removeEventListener("MSPointerMove",l,!1),document.removeEventListener("MSPointerCancel",s,!1),t.node.removeEventListener("pointerup",a,!1),document.removeEventListener("pointermove",l,!1),document.removeEventListener("pointercancel",s,!1),t.node.removeEventListener("click",a,!1),document.removeEventListener("mousemove",l,!1)};return window.PointerEvent||window.navigator.pointerEnabled?(this.node.addEventListener("pointerup",a,!1),document.addEventListener("pointermove",l,!1),document.addEventListener("pointercancel",s,!1)):window.navigator.msPointerEnabled?(this.node.addEventListener("MSPointerUp",a,!1),document.addEventListener("MSPointerMove",l,!1),document.addEventListener("MSPointerCancel",s,!1)):(this.node.addEventListener("click",a,!1),document.addEventListener("mousemove",l,!1)),n=setTimeout(function(){s(),t.fire(e,r,i,!0)},400),this.bubble||e.stopPropagation(),this.bubble}},v.prototype.touchdown=function(e){var t,n=this,r=e.touches[0],i=r.clientX,o=r.clientY,a=r.identifier,l=function(e){e.changedTouches[0].identifier===a?(e.preventDefault(),n.preventMousedownEvents=!0,clearTimeout(n.preventMousedownTimeout),n.preventMousedownTimeout=setTimeout(function(){n.preventMousedownEvents=!1},400),n.fire(e,i,o),d()):d()},s=function(e){1===e.touches.length&&e.touches[0].identifier===a||d();var t=e.touches[0];(Math.abs(t.clientX-i)>=12||Math.abs(t.clientY-o)>=12)&&d()},d=function(){t&&clearTimeout(t),n.node.removeEventListener("touchend",l,!1),window.removeEventListener("touchmove",s,!1),window.removeEventListener("touchcancel",d,!1)};return this.node.addEventListener("touchend",l,!1),window.addEventListener("touchmove",s,!1),window.addEventListener("touchcancel",d,!1),t=setTimeout(function(){d(),n.fire(e,i,o,!0)},400),this.bubble||e.stopPropagation(),this.bubble},v.prototype.teardown=function(){this.node.removeEventListener("pointerdown",m),this.node.removeEventListener("MSPointerDown",m),this.node.removeEventListener("mousedown",m),this.node.removeEventListener("touchstart",w),this.node.removeEventListener("focus",x),delete this.node.__r_clicks__},r("expand","transitions",k);var L,A,z=function(e){function t(t){e.call(this,t)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selections:{configurable:!0},selected:{configurable:!0},rows:{configurable:!0},visibleRows:{configurable:!0},allRows:{configurable:!0}};return t.prototype._allSelected=function(){for(var e=this.get("selections"),t="virtual"===this.get("paginate")?this.get("rows"):this.get("visibleRows"),n=0;n<t.length;n++)if(!~e.indexOf(t[n]))return!1;return t.length&&!0},t.prototype._setSort=function(e,t){var n=[this.get("sort-handler"),this.get("@style.raui.table.sort-handler")],r=n[0]||n[1];if(r)r(this,this.get("columns."+e),e,t);else{var i=this.get("sort")||"",o=this.get("columns."+e).id;i===o||i.substr(1)===o?"-"===i[0]?this.set("sort",o):this.set("sort","-"+o):this.set("sort",o)}},t.prototype.nodeSet=function(e,t,n){e[t]=n},t.prototype._expand=function(e){var t=this,n=this.get("visibleRows")[e],r=this.get("expanded"),i=this.find(".rtable-row-expand");i?this.transition("expand",i,{outro:!0}).then(function(){r===n?t.set("expanded",null):(t.set("expanded",n),t.transition("expand",t.find(".rtable-row-expand"),{intro:!0}))}):n===r?this.set("expanded",null):(this.set("expanded",n),this.transition("expand",this.find(".rtable-row-expand"),{intro:!0}))},t.prototype._hover=function(e){return this.set("hovered",this.get("~/visibleRows")[e]),!1},t.prototype._unhover=function(e){if(!this.find(".rtable-top .rtable-row-wrap:hover"))return this.set("hovered",void 0),!1},t.prototype._select=function(e,t){var n=this.get("selections");n||(n=[],this.set("selections",n));var r=n.indexOf(e);return~r?this.splice("selections",r,1):this.push("selections",e),(r>=n.length||1===n.length)&&this.set("selected",n[n.length-1]),this.fire("selection",{},{item:n[n.length-1],items:n}),setTimeout(function(){return t.target.checked=!~r}),!1},t.prototype._open=function(e,t,n){var r=this;this._opentm||(this.fire("selected",{},e,t,n),this._opentm=setTimeout(function(){r._opentm=null},500))},t.prototype.select=function(){var e=this.get("selected");e&&this.fire("selected",{},e,this.get("rows").indexOf(e),this.get("visibleRows").indexOf(e))},t.prototype.deselect=function(){this.set({selections:[],selected:void 0})},n.selections.get=function(){return this.get("selections")||[]},n.selections.set=function(e){var t=this.get("rows"),n=Array.isArray(e)?e.filter(function(e){return~t.indexOf(e)}):[];this.set("selections",n)},n.selected.get=function(){return this.get("selected")},n.selected.set=function(e){this.set({selected:e,selections:[e]})},n.rows.get=function(){return this.get("rows")},n.visibleRows.get=function(){return this.get("visibleRows")},n.allRows.get=function(){return this.get("items")},t.prototype.selectionOffset=function(e){var t=this.get("selected"),n=this.get("visibleRows");if(t&&~n.indexOf(t)){var r=n.indexOf(t);if(e>0?r+e>=n.length:r+e<0){var i=e<1?-1:1;(i<0&&this.get("page")+i>=0||i>0&&this.get("page")+i<this.get("pagination.total"))&&this.add("page",i),n=this.get("visibleRows");var o=e>0?n[0]:n[n.length-1];this.set({selected:o,selections:[o]})}else this.set({selected:n[r+e],selections:[n[r+e]]})}else{var a=e>0?n[0]:n[n.length-1];this.set({selected:a,selections:[a]})}this.fire("selection",{},{item:this.get("selected"),items:this.get("selections")})},t.prototype.selectionDown=function(){this.selectionOffset(1)},t.prototype.selectionUp=function(){this.selectionOffset(-1)},t.prototype._selectGroup=function(e){var t=e;this.get("page")&&(t+=this.get("page")*this.get("pagination.per"));var n,r=this.get("rows"),i=this.get("groups"),o=this.get("selections"),a=r[t++],l=["selections"],s=[];for(~(n=o.indexOf(a))?s.push(n):l.push(a);t<r.length&&!(t in i);)a=r[t++],~(n=o.indexOf(a))?s.push(n):l.push(a);if(1===l.length)for(n=s.length;n--;)this.splice("selections",s[n],1);else this.push.apply(this,l);return!1},t.prototype._groupSelected=function(e){var t=e;this.get("page")&&(t+=this.get("page")*this.get("pagination.per"));var n=this.get("rows"),r=this.get("groups"),i=this.get("selections");if(!~i.indexOf(n[t++]))return!1;for(;t<n.length&&!(t in r);)if(!~i.indexOf(n[t++]))return!1;return!0},t.prototype._rows=function(){var e=(this.get("items")||[]).slice(),t=this.get("filter"),n=this.get("sort"),r=[this.get("data-handler"),this.get("@style.raui.table.data-handler")],i=r[0]||r[1]||j;if(!t&&!n)return this.set("isFiltered",!1),this.set("rows",e);var o=i(this,e,t,n,this.get("parameters",{virtual:!0}));this.set("isFiltered",o.length!==e.length),this.set("rows",o);var a=this.get("selections");this.set("selections",a.filter(function(t){return~e.indexOf(t)})),~e.indexOf(this.get("selection"))||this.set("selected",void 0)},t.prototype.replaceColumns=function(e){var t=M(e),n=t[0],r=t[1];this.set("columns",e),this.resetPartial("grid-row-cols",r),this.resetPartial("grid-head-cols",n)},Object.defineProperties(t.prototype,n),t}(t);z.settings={valign:"center",border:!1,"fixed-header":!0,"allow-select":!0,"allow-select-all":!0,"auto-titles":!1,paginate:"virtual"},t.extendWith(z,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable",g:1},{n:"class-rtable-virtual",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="virtual"'}}]},{n:"class-rtable-auto",t:13,f:[{t:2,x:{r:["~/paginate"],s:'_0==="auto"'}}]},{n:"class-rtable-fixed",t:13,f:[{t:2,r:"~/fixed"}]},{n:"class-rtable-border",t:13,f:[{t:2,r:"~/border"}]},{n:"class-rtable-fixed-header",t:13,f:[{t:2,r:"~/fixedHeader"}]},{n:"class-rtable-scrolled-down",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("top")'}}]},{n:"class-rtable-scrolled-up",t:13,f:[{t:2,x:{r:["~/scroll"],s:'!~(_0||"").indexOf("bottom")'}}]},{n:"class-rtable-with-select",t:13,f:[{t:2,r:"~/allowSelect"}]},{n:"class-rtable-valign-top",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="top"'}}]},{n:"class-rtable-valign-center",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="center"'}}]},{n:"class-rtable-valign-bottom",t:13,f:[{t:2,x:{r:["~/valign"],s:'_0==="bottom"'}}]},{n:"class-rtable-nowrap",t:13,f:[{t:2,r:"~/noWrap"}]},{n:"class-rtable-wrap",t:13,f:[{t:2,x:{r:["~/noWrap"],s:"!_0"}}]},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-fixed",g:1},{n:"grid",t:71,f:{r:["~/scrollOffset"],s:"[{offset:_0}]"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,r:"meta.top"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1},{t:4,f:[{n:"scrollother",t:71,f:{r:[],s:'[".rtable-top"]'}}],n:50,r:"~/noWrap"}],f:[{t:8,r:"grid-head"}]}],n:51,r:"~/noHeader"}]}],n:50,x:{r:["~/noHeader","meta.top","~/fixedHeader"],s:"(!_0||_1)&&_2"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-top",g:1},{t:4,f:[{n:["scrolled"],t:70,f:"scroll"},{n:"sized",t:71,f:{r:[],s:'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]'}}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scroll"]'}}],n:50,x:{r:["~/noHeader","~/fixedHeader","~/meta.bottom","~/paginate"],s:'(!_0&&_1)||_2||_3==="virtual"'}},{t:4,f:[{n:"scrollother",t:71,f:{r:[],s:'[".rtable-header-wrapper"]'}}],n:50,x:{r:["~/fixedHeader","~/noWrap"],s:"_0&&_1"}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-extra",g:1},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/tableWidth"},"px"],t:13}],n:50,r:"~/noWrap"},{n:"class-rtable-noheader",t:13,f:[{t:2,r:"~/noHeader"}]},{t:4,f:[{t:16,r:"meta.topAttrs"}],n:50,r:"meta.topAttrs"}],f:[{t:16,r:"meta.top",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}]}],n:50,x:{r:["~/fixedHeader","meta.top"],s:"!_0&&_1"}}," ",{t:7,e:"div",m:[{n:"grid",t:71,f:{r:[],s:'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]'}},{t:4,f:[{n:"style-margin-top",f:[{t:2,r:"~/virtual.above"},"px"],t:13},{n:"style-margin-bottom",f:[{t:2,r:"~/virtual.below"},"px"],t:13}],n:50,x:{r:["~/paginate"],s:'_0==="virtual"'}}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-header-wrapper row-wrap",g:1}],f:[{t:8,r:"grid-head"}]}],n:50,x:{r:["~/noHeader","~/fixedHeader"],s:"!_0&&!_1"}}," ",{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,z:[{n:"source",x:{r:"~/items"}},{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/visibleRows"}],n:50,r:"~/shuffle"},{t:4,f:[{t:4,f:[{t:8,r:"grid-row"}],n:52,r:"~/visibleRows"}],n:51,l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-row row t1",g:1}],f:[{t:16,r:"empty",z:[{n:"message",x:{r:"~/empty"}}]}]}],n:50,x:{r:["~/rows.length"],s:"!_0"}}]}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-bottom",g:1},{t:4,f:[{t:16,r:"meta.bottomAttrs"}],n:50,r:"meta.bottomAttrs"}],f:[{t:4,f:[{t:16,r:"meta.bottom",z:[{n:"selectedCount",x:{r:"selections.length"}},{n:"rowCount",x:{r:"rows.length"}},{n:"table",x:{r:"@this"}},{n:"selected",x:{r:"selected"}},{n:"selections",x:{r:"selections"}}]}],n:50,r:"~/meta.bottom"}," ",{t:4,f:[{t:8,r:"pagination"}],n:50,x:{r:["~/paginate"],s:'_0!=="virtual"'}}]}],n:50,x:{r:["~/paginate","~/meta.bottom"],s:'_0!=="virtual"||_1'}}]}],e:{'_0==="virtual"':function(e){return"virtual"===e},'_0==="auto"':function(e){return"auto"===e},'!~(_0||"").indexOf("top")':function(e){return!~(e||"").indexOf("top")},'!~(_0||"").indexOf("bottom")':function(e){return!~(e||"").indexOf("bottom")},'_0==="top"':function(e){return"top"===e},'_0==="center"':function(e){return"center"===e},'_0==="bottom"':function(e){return"bottom"===e},"!_0":function(e){return!e},"[{offset:_0}]":function(e){return[{offset:e}]},'[".rtable-top"]':function(){return[".rtable-top"]},"(!_0||_1)&&_2":function(e,t,n){return(!e||t)&&n},'[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]':function(){return[{offsetHeight:"~/tableHeight",diffWidth:"~/scrollOffset"}]},'["~/scroll"]':function(){return["~/scroll"]},'(!_0&&_1)||_2||_3==="virtual"':function(e,t,n,r){return!e&&t||n||"virtual"===r},'[".rtable-header-wrapper"]':function(){return[".rtable-header-wrapper"]},"_0&&_1":function(e,t){return e&&t},"!_0&&_1":function(e,t){return!e&&t},'[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]':function(){return[{size:"~/tableWidth",value:"~/gridValue",name:"~/gridName",max:"~/gridMax"}]},"!_0&&!_1":function(e,t){return!e&&!t},true:function(){return!0},'_0!=="virtual"':function(e){return"virtual"!==e},'_0!=="virtual"||_1':function(e,t){return"virtual"!==e||t},"(_0+_1)%2===1":function(e,t){return(e+t)%2==1},"[_0._setSort(_1,_2)]":function(e,t,n){return[e._setSort(t,n)]},"[_0._select(_1,_2),false]":function(e,t,n){return[e._select(t,n),!1]},"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]":function(e,t,n,r){return[e._open(r,t.indexOf(r),n.indexOf(r))]},"[_0._expand(_1)]":function(e,t){return[e._expand(t)]},"[_0.stopPropagation()]":function(e){return[e.stopPropagation()]},"_0.indexOf(_1)":function(e,t){return e.indexOf(t)},"_0===_1":function(e,t){return e===t},"_0>0":function(e){return e>0},"!_0&&_1>0":function(e,t){return!e&&t>0},'_0==="boolean"':function(e){return"boolean"===e},"_0._allSelected()":function(e){return e._allSelected()},'_0||"No data."':function(e){return e||"No data."},"_0*_1+1":function(e,t){return e*t+1},"_2+1===_0?_1:(_2+1)*_3":function(e,t,n,r){return n+1===e?t:(n+1)*r},"_0===1":function(e){return 1===e},"_0._allSelected()&&_1<_2":function(e,t,n){return e._allSelected()&&t<n},'[_0.set("page",_1-1)]':function(e,t){return[e.set("page",t-1)]},'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]':function(e,t,n,r,i){return[/^\d+$/.test(t)&&+t>0&&+t<=e&&n.set("page",+t-1)||n.nodeSet(r,"value",i+1)]},"_0==_1+1":function(e,t){return e==t+1},'[_0.set("page",_2[_1-1])]':function(e,t,n){return[e.set("page",n[t-1])]},'_0==="..."':function(e){return"..."===e},'[_0.set("page",_1+1)]':function(e,t){return[e.set("page",t+1)]},"_0<_1-1":function(e,t){return e<t-1}},p:{"csp-dummy":[{t:7,e:"div",m:[{n:"class-rtable-odd",t:13,f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{n:"class-top",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="top"'}}]},{n:"class-bottom",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="bottom"'}}]},{n:"class-center",t:13,f:[{t:2,x:{r:[".valign"],s:'_0==="center"'}}]},{n:["click"],t:70,f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}},{n:["click"],t:70,f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}},{n:["click"],t:70,f:{r:["@this","~/rows","~/visibleRows","."],s:"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]"}},{n:["click"],t:70,f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},{n:["click"],t:70,f:{r:["@event"],s:"[_0.stopPropagation()]"}}]}," ",{t:4,f:["..."],n:50,x:{r:["~/selections","."],s:"_0.indexOf(_1)"}}," ",{t:4,f:["..."],n:50,x:{r:[".","~/expanded"],s:"_0===_1"}}," ",{t:4,f:["..."],n:50,x:{r:["~/virtual.offset"],s:"_0>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}}," ",{t:4,f:["..."],n:50,x:{r:["~/columns.0.type"],s:'_0==="boolean"'}}," ",{t:4,f:["..."],n:50,x:{r:["@this"],s:"_0._allSelected()"}}],empty:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:2,x:{r:["message"],s:'_0||"No data."'}}]}]}],pagination:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pagination",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-info",g:1}],f:[{t:4,f:[{t:2,x:{r:["~/page","~/pagination.per"],s:"_0*_1+1"}}," - ",{t:2,x:{r:["~/pagination.total","~/rows.length","~/page","~/pagination.per"],s:"_2+1===_0?_1:(_2+1)*_3"}}," of ",{t:2,r:"~/rows.length"},{t:4,f:[" (",{t:2,r:"~/items.length"}," total)"],n:50,r:"~/isFiltered"}],n:50,x:{r:["pagination","rows.length"],s:"_0&&_1"}}," ",{t:4,f:["​"],n:50,x:{r:["_paginate"],s:"_0===1"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-select-all-all",g:1}],f:[{t:4,f:[{t:7,e:"strong",f:[{t:2,r:"selections.length"}]}," of ",{t:7,e:"strong",f:[{t:2,r:"rows.length"}]}," selected",{t:4,f:[" - ",{t:7,e:"a",m:[{n:"href",f:"#",t:13,g:1},{n:["click"],t:70,f:"selectAllAll"}],f:["Select All"]}],n:50,x:{r:["@this","selections.length","rows.length"],s:"_0._allSelected()&&_1<_2"}}],n:50,x:{r:["selections.length"],s:"_0>0"}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtable-pages",g:1}],f:[{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1-1)]'}}],f:["Previous"]}],n:50,x:{r:["~/page"],s:"_0>0"}}," ",{t:4,f:[{t:4,f:[{t:7,e:"input",m:[{n:["change"],t:70,f:{r:["~/pagination.total","@node.value","@this","@node","~/page"],s:'[(/^\\d+$/.test(_1)&&+_1>0&&+_1<=_0&&_2.set("page",+_1-1))||_2.nodeSet(_3,"value",_4+1)]'}},{n:"value",f:[{t:2,r:"."}],t:13},{t:73,v:"t",f:"false"}]}],n:50,x:{r:[".","~/page"],s:"_0==_1+1"}},{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","@index","../"],s:'[_0.set("page",_2[_1-1])]'}}],f:["..."]}," "],n:50,x:{r:["."],s:'_0==="..."'},l:1},{t:4,f:[" ",{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","."],s:'[_0.set("page",_1-1)]'}}],f:[{t:2,r:"."}]}],n:51,l:1}],n:52,r:"~/pagination.array"}," ",{t:4,f:[{t:7,e:"span",m:[{n:["click"],t:70,f:{r:["@this","~/page"],s:'[_0.set("page",_1+1)]'}}],f:["Next"]}],n:50,x:{r:["~/page","~/pagination.total"],s:"_0<_1-1"}}]}]}]}},css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.table.primary")),n=Object.assign({},t,e("raui.primary.active"),e("raui.table.primary.active")),r=Object.assign({selected:{},header:{},footer:{}},e("raui.table"));return"\n .rtable {\n display: flex;\n flex-direction: column;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n }\n \n .rtable.rtable-border {\n border: 1px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header {\n min-height: 2em;\n }\n \n .rtable-group > div > div,\n .rtable-header > div > div,\n .rtable-row > div > div {\n padding: "+(r.padding||"0.5em")+";\n overflow: inherit;\n text-overflow: inherit;\n line-height: 1em;\n }\n .rtable-row > .rtable-no-pad > div {\n padding: 0;\n }\n \n .rtable-auto .row > *,\n .rtable-fixed .row > *\n {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n \n .rtable-header > div > div, .rtable-column {\n overflow: hidden;\n }\n \n .rtable-number-column {\n text-align: right;\n }\n .rtable-date-column {\n text-align: right;\n }\n \n .rtable-sortable {\n cursor: pointer;\n user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n \n .grid .row.rtable-row, .grid .rtable-header > .row {\n width: auto;\n min-width: min-content;\n flex-grow: 1;\n }\n \n .rtable-nowrap .grid .rtable-row, .rtable-nowrap .grid .rtable-header > .row {\n flex-wrap: nowrap;\n }\n .rtable-nowrap .rtable-row-wrap, .rtable-inner-row-wrap {\n flex-grow: 1;\n } \n \n .rtable-row-wrap {\n display: flex;\n flex-grow: 1;\n align-items: center;\n z-index: 2;\n align-items: stretch;\n color: "+(t.fg||"#222")+";\n background-color: "+(r.even||t.bga||"#f4f4f4")+";\n }\n .rtable-row-wrap:focus-within {\n z-index: 3;\n }\n .rtable-row-wrap.rtable-odd {\n background-color: "+(r.odd||t.bg||"#fff")+";\n }\n .rtable-row-wrap:hover .rtable-inner-row-wrap, .rtable-row-wrap:hover .rtable-select-row {\n background-color: "+(r.over||n.bg||"#e6f0fa")+";\n }\n .rtable-row-wrap:hover .rtable-inner-row-wrap,\n .rtable-wrap .rtable-row-wrap:hover .rtable-select-row {\n position: relative;\n }\n .rtable-row-wrap:hover .rtable-select-row {\n overflow: visible;\n }\n \n .rtable-row-wrap:hover {\n border-bottom: "+(r.dividerSize||"4px")+" solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-row-wrap.rtable-selected {\n background-color: "+(r.selected.bg||"#cee5fd")+";\n color: "+(r.selected.fg||t.fg||"#222")+";\n }\n .rtable-row-wrap.rtable-selected.rtable-odd {\n background-color: "+(r.selected.odd||"#c5dffb")+";\n }\n \n .rtable-nowrap .rtable-row-wrap {\n display: inline-flex;\n min-width: 100%;\n box-sizing: border-box;\n }\n \n .rtable-nowrap > .rtable-top > .grid {\n line-height: 1em;\n }\n \n .rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 0 0 1px;\n margin: 0 0 0 -1px;\n }\n .rtable-wrap.rtable-border .rtable-row .rtable-column,\n .rtable-border .rtable-group .rtable-column {\n border-width: 0 0 1px 1px;\n margin: 0 0 -1px -1px;\n }\n \n .rtable-border .rtable-header .rtable-column {\n border-width: 0 0 0 0;\n margin: 0 0 0 0;\n }\n .rtable-wrap.rtable-border .rtable-header .rtable-column {\n border-width: 0 0 1px 0;\n margin: 0 0 -1px 0;\n }\n \n .rtable-border .rtable-row .rtable-column:nth-child(1),\n .rtable-border .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 0;\n }\n .rtable-border.rtable-with-select .rtable-row .rtable-column:nth-child(1),\n .rtable-border.rtable-with-select .rtable-group .rtable-column:nth-child(1) {\n border-left-width: 1px;\n }\n \n .rtable-border .rtable-row-wrap {\n border-bottom-width: 1px;\n }\n \n .rtable-border .rtable-row-expand, .rtable-border .rtable-row-extra {\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin-left: -1px;\n width: 100%;\n }\n .rtable-border.rtable-with-select .rtable-row-expand, .rtable-border.rtable-with-select .rtable-row-extra {\n border-left-width: 1px;\n }\n \n .rtable-row-expand, .rtable-row-extra {\n box-sizing: border-box;\n padding: "+(r.padding||"0.5em")+";\n }\n \n .rtable-row-hover {\n pointer-events: none;\n position: relative;\n z-index: 1;\n }\n .rtable-row-hover-content {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n }\n .rtable-row-hover-content > * {\n pointer-events: visible;\n }\n \n .rtable-group {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header.rtable-row-wrap:hover {\n font-weight: bold;\n background-color: "+(r.header.bg||"#dedede")+";\n }\n .rtable-header-fixed {\n line-height: 1em;\n background-color: "+(r.header.bg||"#dedede")+";\n }\n \n .rtable-header.rtable-row-wrap, .rtable-header-extra.rtable-noheader {\n border-bottom: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-header-extra {\n background-color: "+(r.header.bg||"#dedede")+";\n padding: "+(r.padding||"0.5em")+";\n line-height: 1em;\n z-index: 4;\n box-sizing: border-box;\n min-width: 100%;\n }\n .rtable-nowrap .rtable-header-extra {\n position: sticky;\n left: 0;\n }\n \n .rtable-top {\n flex-grow: 5;\n flex-shrink: 1;\n overflow-y: auto;\n position: relative;\n }\n .rtable-fixed-header .rtable-header {\n position: relative;\n z-index: 3;\n }\n .rtable-fixed-header.rtable-scrolled-down .rtable-header-fixed {\n box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15), 0 0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-fixed-header .rtable-top {\n margin-top: 0;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper {\n flex-shrink: 0;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n }\n .rtable-nowrap.rtable-fixed-header .rtable-header-wrapper::-webkit-scrollbar {\n height: 0;\n }\n .rtable-fixed-header .rtable-header-fixed::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n \n .rtable-nowrap .rtable-fixed-column, .rtable-nowrap .rtable-row-extra, .rtable-nowrap .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n position: -webkit-sticky;\n position: sticky;\n left: 0;\n }\n .rtable-border..rtable-nowrap .rtable-fixed-column, .rtable-border.rtable-nowrap .rtable-row-extra, .rtable-border.rtable-nowrap .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: 1px;\n }\n .rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtable-nowrap.rtable-with-select .rtable-row-extra, .rtable-nowrap.rtable-with-select .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: "+(r.selectWidth||"2em")+";\n }\n .rtabe-border.rtable-nowrap.rtable-with-select .rtable-fixed-column, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-extra, .rtabe-border.rtable-nowrap.rtable-with-select .rtable-row-expand, .rtable-nowrap .rtable-row-hover {\n left: "+(r.selectWidth||"2em")+";\n }\n \n .rtable-nowrap .rtable-inner-row-wrap {\n background-color: inherit;\n }\n \n .rtable-nowrap .row,\n .rtable-nowrap .rtable-fixed-column,\n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n background-color: inherit;\n z-index: 1;\n }\n \n .rtable-nowrap .rtable-select-row,\n .rtable-nowrap .rtable-select-header {\n position: sticky;\n position: -webkit-sticky;\n left: 0;\n z-index: 1;\n }\n .rtable-nowrap .rtable-select-header {\n z-index: 2;\n }\n \n .rtable-nowrap.rtable-border .rtable-fixed-column {\n border-right-width: 1px;\n }\n \n .rtable-scrolled-up .rtable-bottom {\n box-shadow: 0 -1px 2px 0 rgba(60, 64, 67, 0.3), 0 -1px 3px 1px rgba(60, 64, 67, 0.15), 0 -0.25em 0.5em rgba(0,0,0,0.25);\n z-index: 3;\n }\n .rtable-bottom {\n padding: "+(r.padding||"0.5em")+";\n background-color: "+(r.footer.bg||r.header.bg||"#dedede")+";\n border-top: 2px solid "+(r.divider||t.bc||"#ccc")+";\n }\n \n .rtable-pagination {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n justify-content: space-between;\n user-select: none;\n }\n \n .rtable-pages span {\n margin: 0.3em;\n cursor: pointer;\n }\n .rtable-pages span:first-of-type {\n margin-left: 0;\n }\n .rtable-pages input {\n text-align: center;\n width: 2.5em;\n font-size: 1em;\n background-color: transparent;\n border: none;\n padding: 0;\n font-weight: bold;\n text-decoration: underline;\n }\n \n /* checkboxes */\n .rtable-select {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n position: absolute;\n display: block;\n margin: 0;\n width: 3em;\n height: 3em;\n box-shadow: none;\n outline: none;\n opacity: 0;\n top: -0.75em;\n left: -0.75em;\n border-radius: 2em;\n transition: transform 0.2s, opacity 0.2s;\n background-color: "+(t.bc||"#ccc")+";\n cursor: pointer;\n }\n \n .rtable-select-header > div, .rtable-select-row > div, .rtable-header > div.rtable-select-header > div {\n padding: 0;\n overflow: visible;\n width: 1.5em;\n height: 1.5em;\n position: relative;\n line-height: 1.8em;\n cursor: pointer;\n display: flex;\n justify-content: space-around;\n align-items: center;\n flex-grow: 0;\n display: block;\n }\n \n .rtable-select:checked {\n background-color: "+(t.fga||"#07e")+';\n }\n \n .rtable-select-header:hover .rtable-select, .rtable-select-row:hover .rtable-select {\n opacity: 0.04;\n }\n \n .rtable-select:focus {\n opacity: 0.12;\n transform: scale(1);\n }\n \n .rtable-select-header:hover .rtable-select:focus, .rtable-select-row:hover .rtable.select:focus {\n opacity: 0.16;\n }\n \n .rtable-select:active {\n opacity: 0.4;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n \n .rtable-select-row > div:before, .rtable-select-header > div:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n border: solid 0.125em; /* Safari */\n border-color: '+(t.fg||"#222")+";\n border-radius: 0.125em;\n width: 1.2em;\n height: 1.2em;\n position: absolute;\n top: 0.3em;\n left: 0.15em;\n transition: border-color 0.2s, background-color 0.2s;\n }\n \n .rtable-select-row > div:after, .rtable-select-header > div:after {\n content: '';\n display: inline-block;\n opacity: 0;\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n top: 0.3em;\n left: 0.15em;\n border-radius: 0.125em;\n }\n \n .rtable-selected .rtable-select-row > div:before, .rtable-all-selected > div:before {\n border-color: "+(t.fga||"#07e")+";\n }\n \n .rtable-selected .rtable-select-row > div:after, .rtable-all-selected > div:after {\n border-color: "+(t.bg||"#fff")+';\n background: no-repeat center/80% url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="'+(t.bg||"#fff").replace(/#/g,"%23")+'" d="m 15.378906,1.7050781 a 1.0583349,1.0583349 0 0 0 -1.478515,0.234375 L 6.6210937,11.960938 1.8652344,8.5058594 a 1.0583349,1.0583349 0 0 0 -1.47851565,0.234375 1.0583349,1.0583349 0 0 0 0.234375,1.4785156 L 6.234375,14.294922 A 1.0584408,1.0584408 0 0 0 7.7128906,14.060547 L 15.613281,3.1835938 A 1.0583349,1.0583349 0 0 0 15.378906,1.7050781 Z" /></svg>\') '+(t.fga||"#07e")+";\n opacity: 1;\n }\n \n .rtable-row-wrap > .rtable-select-header,\n .rtable-row-wrap > .rtable-select-row {\n text-align: center;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: space-around;\n width: "+(r.selectWidth||"2em")+";\n }\n \n .rtable-row-wrap > .rtable-select-row {\n border-style: solid;\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n }\n \n .rtable-inner-row-wrap {\n border-style: solid;\n border-color: "+(r.divider||t.bc||"#ccc")+";\n border-width: 0 0 1px 0;\n }\n \n .rtable-column button, .rtable-column .btn {\n padding: 0 0.5em;\n margin: 0.2em 0.5em;\n min-height: 0;\n }\n \n .rtable-column.rtable-editing, .rtable-column.rtable-editing > .rtable-edit {\n padding: 0;\n }\n .rtable-column.rtable-editing input {\n width: 100%;\n box-sizing: border-box;\n height: 100%;\n margin: 0;\n border: none;\n background-color: transparent;\n padding: 0.25em 0.5em;\n }\n \n .rtable-valign-top .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-top > div {\n display: flex;\n height: 100%;\n align-items: flex-start;\n box-sizing: border-box;\n }\n .rtable-valign-bottom .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-bottom > div {\n display: flex;\n height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n }\n .rtable-valign-center .rtable-row:not(.rtable-header) .rtable-column > div,\n .rtable .rtable-row:not(.rtable-header) > .rtable-column.rtable-valign-col-center > div {\n display: flex;\n height: 100%;\n align-items: center;\n box-sizing: border-box;\n }\n "+(e("table.includeGrid")?b(e):"")}.call(this,e)].join(" ")},cssId:"rtable",noCssTransform:!0,attributes:["auto-titles","paginate","items","filter","data-handler","sort-handler","sort","helpers","fixed","allow-select","allow-select-all","border","fixed-header","valign","no-header","empty","shuffle","no-wrap","parameters"],components:{table:!1,Table:!1},syncComputedChildren:!0,decorators:{grid:h,sized:i,scrollother:function e(t,n){var r=this,i=function(i){e.lock&&e.lock!==t||(e.tm&&clearTimeout(e.tm),e.lock=t,r.find(n).scrollLeft=i.target.scrollLeft,e.tm=setTimeout(function(){e.tm=null,e.lock=!1},100))};return t.addEventListener("scroll",i,{passive:!0}),{teardown:function(){t.removeEventListener("scroll",i)}}}},events:{},use:[g({name:"clickd",count:1}),g({name:"dblclickd",count:2}),(void 0===A&&(A={}),function(e){e.instance.transitions[A.name||"expand"]=k}),(void 0===L&&(L={}),function(e){e.instance.decorators[L.name||"scrolled"]=O})],on:{construct:function(){var e,t,n,r,i,o,a,l,s=this.component;if(!s)return;var d=s.template.f||[],c=s.template.m?s.template.m.slice():[],f=s.template;s.template={e:f.e,f:f.f,t:f.t,m:c};var u=0;function h(e,t,n){if(e&&e.f&&1===e.f.length&&2===e.f[0].t){var r="_a"+u++;return c.push({t:13,n:r,f:e.f}),n?r:t?{t:[{t:2,r:"~/"+r}]}:{t:2,r:"~/"+r}}return e&&e.f}function b(e){var t=[],n=[];return e.forEach(function(e){if("column"===e.e||"col"===e.e){var r,i={},o=e.m||N;if(i.index=t.length,t.push(i),i.content=(e.f||[]).filter(function(e){return"edit"!==e.e&&"header"!==e.e}),i.editP=(e.f||[]).find(function(e){return"edit"===e.e}),i.editP&&(i.editP=i.editP.f),(r=o.find(function(e){return"id"===e.n}))&&S(r.f)&&(i.id=r.f),i.label=(e.f||[]).find(function(e){return"header"===e.e}),i.label?(i.label=i.label.f,i.title=o.find(function(e){return"label"===e.n}),i.title||(i.title=o.find(function(e){return"header"===e.n})),i.title&&i.title.f&&(i.title=h(i.title))):(i.label=o.find(function(e){return"label"===e.n}),i.label||(i.label=o.find(function(e){return"header"===e.n})),i.label&&i.label.f&&(i.label=h(i.label))),i.label||(i.label=""),i.id||(i.id=i.label),Array.isArray(i.label)||(i.label=[i.label]),i.type=o.find(function(e){return"type"===e.n}),i.type&&i.type.f&&(i.type=i.type.f),i.type||(i.type="string"),i.filter=o.find(function(e){return"filter"===e.n}),i.filter&&i.filter.f&&(i.filter=h(i.filter),i.filter.r&&(i.filter=i.filter.r)),i.sort=o.find(function(e){return"sort"===e.n}),i.sort&&i.sort.f&&(i.sort=h(i.sort),i.sort.r&&(i.sort=i.sort.r)),i.dir=o.find(function(e){return"dir"===e.n}),i.dir&&i.dir.f&&(i.dir=h(i.dir),i.dir.r&&(i.dir=i.dir.r)),i.hidden=o.find(function(e){return"hidden"===e.n}),i.hidden&&0===i.hidden.f?i.hidden=!0:i.hidden&&E(i.hidden.f)?i.hidden=h(i.hidden):i.hidden=!1,S(i.hidden)&&(i.hidden=!1),i.noPad=o.find(function(e){return"no-pad"===e.n}),i.noPad&&0===i.noPad.f?i.noPad=0:i.noPad&&E(i.noPad.f)?i.noPad=h(i.noPad):delete i.noPad,i.editable=o.find(function(e){return"editable"===e.n}),i.editable&&0===i.editable.f?i.editable=!0:i.editable&&E(i.editable.f)?i.editable=h(i.editable):i.editable=!1,i.valign=o.find(function(e){return"valign"===e.n}),i.valign&&E(i.valign.f)?i.valign=h(i.valign):i.valign&&"string"==typeof i.valign.f&&(i.valign=i.valign.f),i.fixed=o.find(function(e){return"fixed"===e.n}),i.fixed&&E(i.fixed.f)?i.fixed={path:h(i.fixed,!1,!0)}:i.fixed&&"string"==typeof i.fixed.f&&(i.fixed=i.fixed.f),(r=o.find(function(e){return"get"===e.n}))&&r.f){var a=h(r,!1,!0);field.get=function(e){var t=this.get(a);return"function"==typeof t?t.call(this,e):void 0}}i.attrs=o.filter(function(e){return!~R.indexOf(e.n)}),i.attrs.forEach(function(e,t){C.test(e.n)&&(i.attrs[t]={t:13,n:"class-"+e.n})})}else if("field"===e.e){var l,s={},d=e.m||N;if(S(l=d.find(function(e){return"path"===e.n}))?s.path=l:l&&l.f&&(s.path=h(l)),(l=d.find(function(e){return"value"===e.n}))&&l.f&&(s.value=h(l)),S(l=d.find(function(e){return"type"===e.n}))?s.type=l:l&&l.f&&(s.type=h(l)),S((l=d.find(function(e){return"id"===e.n})).f)&&(s.id=l.f),S(l=d.find(function(e){return"dir"===e.n}))?s.dir=l:l&&S(l.f)&&(s.dir=l.f),S(l=d.find(function(e){return"label"===e.n}))?s.label=l:l&&l.f&&(s.label=h(l)),(l=d.find(function(e){return"get"===e.n}))&&l.f){var c=h(l,!1,!0);s.get=function(e){var t=this.get(c);return"function"==typeof t?t.call(this,e):void 0}}s.id||(s.id=s.label),s.path||(s.path=s.id),n.push(s)}}),{fields:n,columns:t}}e=d.find(function(e){return"expand"===e.e}),t=d.find(function(e){return"hover"===e.e}),n=d.find(function(e){return"group"===e.e}),r=d.find(function(e){return"wrapper"===e.e}),i=d.find(function(e){return"row"===e.e}),o=d.find(function(e){return"top"===e.e}),a=d.find(function(e){return"bottom"===e.e}),this._init={sets:b(d),partials:{}};var p=this._init.sets.columns;this._init.sets["meta.expand"]=e&&e.f&&e.f.length&&e.f,this._init.sets["meta.hover"]=t&&t.f&&t.f.length&&t.f,this._init.sets["meta.extra"]=i&&i.f&&i.f.length&&i.f,this._init.sets["meta.top"]=o&&o.f&&o.f.length&&o.f,this._init.sets["meta.topAttrs"]=o&&o.m,this._init.sets["meta.bottom"]=a&&a.f&&a.f.length&&a.f,this._init.sets["meta.bottomAttrs"]=a&&a.m;var g=M(p),v=g[0],m=g[1],w=g[2],x=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-header"},{t:4,f:[{n:"style-opacity",f:"0",t:13}],n:50,x:{r:["~/fixedHeader","~/virtual.offset"],s:"!_0&&_1>0"}},{t:4,n:50,r:"~/fixedHeader",f:[{t:13,n:"style-padding-right",f:[{t:2,r:"~/scrollOffset"},"px"]}]}],f:[{t:7,e:"div",f:[{t:8,r:"grid-head-cols"}],m:[{t:13,n:"class-row"}]}]}];x[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-header"},{t:13,n:"class-rtable-column"},{t:13,n:"title",f:[{t:2,r:"selections.length"}," items selected"]},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]}],f:[{t:7,e:"div",f:[{t:4,n:50,r:"~/allowSelectAll",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this"],s:"_0._allSelected()"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:"selectAll"}]}]}],m:[{t:70,n:["clickd"],f:"selectAll"}]}]}]});var _,y=[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-wrap"},{t:13,n:"class-rtable-odd",f:[{t:2,x:{r:["@index","~/virtual.offset"],s:"(_0+_1)%2===1"}}]},{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-live"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class-row-wrap"},{t:13,n:"class-rtable-inner-row-wrap"}],f:[{t:7,e:"div",f:[{t:8,r:"grid-row-cols"}],m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-row"},{t:70,n:e&&e.f?["dblclickd"]:["click","dblclick"],f:{r:["@this","~/rows","~/visibleRows","."],s:"[_0._open(_3,_1.indexOf(_3),_2.indexOf(_3))]"}}]}]}]}];i&&i.m&&i.m.length&&(this._init.sets.rowAttrs=i.m.slice(),y[0].f[0].f[0].m.push({t:16,r:"~/rowAttrs",c:{r:"."},z:w}));r&&r.m&&r.m.length&&(this._init.sets.wrapperAttrs=r.m.slice(),y[0].m.push({t:16,r:"~/wrapperAttrs",c:{r:"."},z:w}));i&&i.f&&i.f.length&&y[0].f[0].f.push({t:7,e:"div",m:[{t:13,n:"class-rtable-row-extra"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}],f:[{t:16,r:"~/meta.extra",c:{r:"."},z:w}]});if(e&&e.f&&e.f.length){var k={t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}},O=e.m&&e.m.find(function(e){return"skip"===e.n});O=O&&O.f&&O.f[0]&&2===O.f[0].t?Object.assign({},O.f[0],{t:4,n:51,f:[k]}):k,y[0].f[0].f.push({t:4,n:50,x:{r:[".","~/expanded"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/meta.expand",c:{r:"."},z:w}]}],m:[{t:13,n:"class-rtable-row-expand"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]}),y[0].f[0].f[0].m.push(O),y[0].f[0].f[1].f[0].m.push({t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._expand(_1)]"}})}t&&t.f&&t.f.length&&(y[0].f[0].f.unshift({t:4,n:50,x:{r:[".","~/hovered"],s:"_0===_1"},f:[{t:7,e:"div",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-row-hover-content"}].concat(t.m||[]),f:[{t:16,r:"~/meta.hover",c:{r:"."},z:w}]}],m:[{t:13,n:"class-rtable-row-hover"},{t:4,n:50,r:"~/noWrap",f:[{t:13,n:"style-width",f:[{t:2,x:{r:["~/tableWidth","~/allowSelect","@style.raui.table.selectWidth"],s:"_1?'calc('+_0+'px - '+(_2||'2em')+')':_0+'px'"}}]}]}]}]}),y[0].m.push({t:70,n:["mouseenter"],f:{r:["@this","@index"],s:"[_0._hover(_1)]"}},{t:70,n:["mouseleave"],f:{r:["@this","@index"],s:"[_0._unhover(_1)]"}}));if(y[0].f.unshift({t:4,n:50,r:"~/allowSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this",".","@event"],s:"[_0._select(_1,_2),false]"}}]}]}]}]}),n&&n.m&&(_=n.m.find(function(e){return"by"===e.n}))&&(S(_.f)||1===_.length&&2===_[0].t)){var P={t:4,n:50,f:[{t:7,e:"div",m:[{t:13,n:"class-row"},{t:13,n:"class-rtable-group"},{t:13,n:"class-rtable-selected",f:[{t:2,x:{r:["~/selections","."],s:"~_0.indexOf(_1)"}}]},{t:70,n:e&&e.f?["dblclickd"]:["click","dblclick"],f:{r:["~/rows","~/visibleRows","."],s:"[['selected',_2,_0.indexOf(_2),_1.indexOf(_2)]]"}}].concat(n.m.filter(function(e){return"by"!==e.n&&"select"!==e.n}))}],x:{s:"_0&&_1[(_1&&(_2*_3+_4))||_4]",r:["~/showGroups","~/groups","~/page","~/pagination.per","@index"]}};y.unshift(P),this._init.by=_.f;var L,A=b(n.f).columns.filter(function(e){return!0!==e.hidden}).map(function(e){var t={t:7,e:"div",f:[{t:7,e:"div",f:e.content}],m:e.attrs};e.type&&t.m.unshift({t:13,n:"class-rtable-"+e.type+"-column"}),t.m.push({t:13,n:"class-rtable-column"}),t.m.find(function(e){return"title"===e.n})||t.m.unshift({t:13,n:"title",f:e.content});var n=t;return e.hidden&&e.hidden.r&&(n={t:4,n:51,r:e.hidden.r,f:[t]}),n});A.unshift({t:4,n:50,r:"~/allowGroupSelect",f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-select-row"},{t:13,n:"class-rtable-column"},{t:70,n:["clickd"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}},{t:13,n:"class-rtable-all-selected",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]}],f:[{t:7,e:"div",f:[{t:7,e:"input",m:[{t:73,v:"t",f:"false"},{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,x:{r:["@this","@index"],s:"_0._groupSelected(_1)"}}]},{t:13,n:"class-rtable-select"},{t:70,n:["click"],f:{r:["@this","@index"],s:"[_0._selectGroup(_1),false]"}}]}]}]}]}),(L=n.m.find(function(e){return"select"===e.n}))&&(l||(l=[])).push(Object.assign({},L,{n:"allowGroupSelect"})),(L=n.m.find(function(e){return"show"===e.n}))&&(l||(l=[])).push(Object.assign({},L,{n:"showGroups"})),P.f[0].f=A}this._init.partials["grid-row"]=y,this._init.partials["grid-row-cols"]=m,this._init.partials["grid-head"]=x,this._init.partials["grid-head-cols"]=v,l&&this.component&&(this.component.mappings=l)},config:function(){this.set(this._init.sets),Object.assign(this.partials,this._init.partials)},render:function(){this._autoObserver&&this._autoObserver.fire()},selectAll:function(){var e,t;return this._allSelected()?(t=null,e=[],this.set({selections:e,selected:t})):(t=(e=("virtual"===this.get("paginate")?this.get("rows"):this.get("visibleRows")).slice())[0],this.set({selections:e,selected:t})),this.fire("selection",{},{item:t,items:e}),!1},selectAllAll:function(){var e=this.get("rows").slice();return this.set({selections:e,selected:null}),this.fire("selection",{},{item:null,items:e}),!1}},observe:{_rows:function(){var e=this;this._rowbounce&&clearTimeout(this._rowbounce),setTimeout(function(){return e._rows()},this.get("@style.raui.table.debounce")||160)},paginate:{handler:function(e){var n=this;if("auto"===e||"virtual"===e||e instanceof t){this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();("auto"===e||"virtual"===e)&&this.root;var r,i=!1,o=function(){if(n.rendered){var t=n.find(".rtable-top");if(t)if(n.get("items.length")){var r=t.clientHeight+","+t.clientWidth;if(o.last!==r||!i){var a=n.getContext(t);a.decorators&&a.decorators.scrolled&&a.decorators.scrolled.refresh();var l=n.find(".rtable-header")||{},s=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight});if(s.length<5){var d=Math.floor(t.clientHeight/(l.offsetHeight||1));d<5&&(d=5),n.set("_paginate",d),s=Array.apply(null,n.findAll(".rtable-live")).map(function(e){return e.offsetHeight})}s.length>0?i=!0:s=[25];var c=Math.ceil(s.reduce(function(e,t){return e+t},0)/s.length);n._avgSize=c;var f=Math.floor((t.clientHeight-(l.offsetHeight||1))/c);"virtual"===e&&(f+=10)<30&&(f=30),n.set("_paginate",f),o.last=r}}else n._autoLenObserver||(n._autoLenObserver=n.observeOnce("items",function(){n._autoLenObserver=0,setTimeout(o)}))}},a=function(){r&&clearTimeout(r),r=setTimeout(function(){o(),r=null,i&&n._scrollListener&&n._scrollListener.fn()},50)};if(this._autoObserver=this.observe("~/tableHeight",a),this._autoObserver.fire=a,"virtual"===e){var l,s=!1,d=function(){if(n.rendered){if(l||(l=n.find(".rtable-top")),!i)return a();var e=l.scrollTop,t=n.get("virtual")||{},r=t.offset,o=n.get("_paginate"),d=o-10,c=n.get("rows.length");o>c&&(o=c);var f=n._avgSize,u=d*f,h=Math.floor(e/f)-5;h<0&&(h=0);var b=h;if(h+o>c&&(h=c-o),r===h&&!isNaN(t.top))return s=!1;if(!P(r)||isNaN(r)||isNaN(t.top)||e<t.top+u||e>t.bottom-u||r>0&&e<f*d){var p=b,g=c-b-o;p<0?(g+=-1*p,p=0):p>c-o&&(p=c-o),g<0&&(g=0);var v,m,w=p*f,x=g*f;h<r+o&&h>r-o&&(v=h>r?n.findAll(".rtable-live")[h-r]:n.findAll(".rtable-live")[r-h]),v&&h>0&&v.offsetTop>l.scrollTop-u-5&&v.offsetTop<l.scrollTop+u&&(m=v.offsetTop),n.set({"virtual.above":w,"virtual.below":x,"virtual.offset":h}),"number"==typeof m&&m!==v.offsetTop&&n.set("virtual.above",w+(m-v.offsetTop)),n.set({"virtual.top":n.get("virtual.above"),"virtual.bottom":l.scrollHeight-x})}s=!1}else l=null},c=this._scrollListener=this.on("scroll",function(e){e.node;s||(s=!0,requestAnimationFrame(d))});c.fn=d,c.observer=this.observe("rows.length",function(){n.set("virtual.offset",null),d()},{init:!1,strict:!0,defer:!0});var f=c.cancel;c.cancel=function(){f(),c.observer.cancel()}}a()}else this._autoObserver&&this._autoObserver.cancel(),this._scrollListener&&this._scrollListener.cancel();P(e)&&this.set("_paginate",e)},defer:!0},"scrollOffset tableHeight":{handler:function(){var e=this;requestAnimationFrame(function(){if(e.rendered){var t=e.find(".rtable-top"),n=t&&e.getContext(t);n&&n.decorators&&n.decorators.scrolled&&n.decorators.scrolled.refresh()}})},init:!1},scroll:function(e,t){~(e||"").indexOf("top")&&!~(t||"").indexOf("top")&&this.fire("scrolltop",{}),~(e||"").indexOf("bottom")&&!~(t||"").indexOf("bottom")&&this.fire("scrollbottom",{})}},data:function(){return Object.assign({page:0,selections:[],showGroups:!0,allowGroupSelect:!0,expanded:null,minPerPage:10,virtual:{offset:0},shuffle:!1,rows:[]},z.settings)},computed:{allowSelect:function(){return this.get("allow-select")},allowSelectAll:function(){return this.get("allow-select-all")},fixedHeader:function(){return this.get("fixed-header")},autoTitles:function(){return this.get("auto-titles")},noHeader:function(){return this.get("no-header")},noWrap:function(){return this.get("no-wrap")},_rows:function(){var e=(this.get("items")||[]).slice(),t=this.get("filter"),n=this.get("sort"),r=this.get("parameters"),i=(this.get("data-handler"),this.get("@style.raui.table.data-handler"),[this.get("data-pre-handler"),this.get("@style.raui.table.data-pre-handler")]),o=i[0],a=i[1];return(o||a)&&(o||a)(this,e,t,n,r),{}},visibleRows:function(){var e=this,n=this.get("rows"),r=this.get("paginate"),i=r,o=this.get("_paginate"),a=this.get("page")||0,l=this.get("virtual");return i?("number"!=typeof i&&isNaN(+i)&&(i="auto"===i||"virtual"===i||i instanceof t?o||1:30),i<this.get("minPerPage")&&(i=this.get("minPerPage")),"virtual"===r?(a=l&&l.offset||0,n.slice(a,a+i)):(a*i>n.length&&setTimeout(function(){return e.set("page",0)},0),n.slice(i*a,i*a+i))):n},pagination:function(){var e=this.get("items")||N,t=this.get("rows"),n=this.get("paginate"),r=n,i=this.get("page")||0;if("number"!=typeof r&&isNaN(r)&&(r=this.get("_paginate")),r<this.get("minPerPage")&&(r=this.get("minPerPage")),r){var o=Math.ceil(t.length/r),a={max:Math.ceil(e.length/r),total:o,per:r};if("virtual"===n&&(a.height=this._avg*t.length),a.total>14){var l=a.array=[];i>5?l.push(1,2,3,"..."):l.push(1,2,3,4,5,6,7,8),i>5&&i+6<o?l.push(i-1,i,i+1,i+2,i+3,"...",o-2,o-1,o):i+6<o?l.push("...",o-2,o-1,o):l.push(o-7,o-6,o-5,o-4,o-3,o-2,o-1,o)}else a.array=Array.apply(null,{length:a.total}).map(function(e,t){return t+1});return a}},groups:function(){for(var e,t,n=this.get("rows"),r={},i=0;i<n.length;i++)(t=n[i][this._init.by])!=e&&(r[i]=1),e=t;return r}}});var H=/^[^\d]*/;function W(e){return P(e)?e:e&&(e=(""+e).replace(H,""))?parseFloat(e):1/0}function T(e,n,r){if("function"==typeof n.get)return n.get;var i=(r?n.sort:0)||n.path||n.filter||n.id;if("string"==typeof i){var o=t.splitKeypath(i);return function(e){for(var t=e,n=0;n<o.length;n++)t=t&&t[o[n]];return t}}}function j(e,t,n,r){var i=[].concat(e.viewmodel.value.columns,e.viewmodel.value.fields),o=i.reduce(function(e,t){return e[t.id]=T(0,t),e},{}),a=Object.values(o),l=t||[];if((n instanceof RegExp||S(n))&&n){var s=n===""+n.toLowerCase()||n===""+n.toUpperCase();try{var d=S(n)?new RegExp(n,s?"i":""):n;l=l.filter(function(e){for(var t=a.length;t--;){var n=e&&a[t](e);if(n&&d.test(n))return!0}})}catch(e){}}return(S(r)||E(r)&&!Array.isArray(r))&&(r=[r]),Array.isArray(r)&&(r=r.map(function(t){if(S(t)){var n="-"===t[0]||"+"===t[0]?t.substr(1):t,r=i.find(function(e){return e.id===n});if(!r)return;var o={get:T(0,r,!0),dir:"-"===t[0]?-1:1};if(r&&"number"===r.type){var a=o.get;o.get=function(t){return W(a.call(e,t))}}return o}if(t&&"object"==typeof t){var l=i.find(function(e){return e.id===id});if(!l)return;var s={dir:P(t.dir)?t.dir:"desc"===t.dir?-1:1,get:T(0,l,!0)};if("number"===t.type||l&&"number"===l.type){var d=s.get;s.get=function(t){return W(d.call(e,t))}}return s}}).filter(function(e){return e&&e.get}),l.sort(function(t,n){for(var i,o,a,l=0;l<r.length;l++)if(i=r[l].get.call(e,t),o=r[l].get.call(e,n),0!==(a=r[l].dir*(i<o?-1:i>o?1:0)))return a;return a})),l}function M(e){var t=[{n:"gridValue",x:{r:"~/gridValue"}},{n:"gridName",x:{r:"~/gridName"}},{n:"gridSize",x:{r:"~/tableWidth"}},{n:"gridMax",x:{r:"~/gridMax"}},{n:"table",x:{r:"@this"}}];return[e.filter(function(e){return!0!==e.hidden}).map(function(e,n){null==e.index&&(e.index=n),e.attrsHP=e.attrs.filter(function(e){return"title"!==e.n});var r={t:7,e:"div",f:[{t:7,e:"div",f:[{t:16,r:"~/columns."+n+".label",c:{r:"."},z:t}]}],m:[{t:13,n:"title",f:e.title||e.label},{t:16,r:"~/columns."+n+".attrsHP",z:t}]};if(e.type&&r.m.push({t:13,n:"class-rtable-"+e.type+"-column"}),(e.filter||e.sort)&&r.m.push({t:13,n:"class-rtable-sortable"},{t:4,n:53,r:"~/columns."+n,f:[{t:70,n:["click"],f:{r:["@this",".index","@event"],s:"[_0._setSort(_1,_2)]"}}]}),r.m.push({t:13,n:"class-rtable-column"}),e.fixed){var i=e.fixed.path||"~/columns."+n+".fixed";r.m.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:i}]}),r.m.push({t:4,n:50,x:{r:["~/noWrap",i],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:i}]}]})}var o=r;return e.hidden&&e.hidden.r&&(o={t:4,n:51,r:e.hidden.r,f:[r]}),o}),e.filter(function(e){return!0!==e.hidden}).map(function(e,n){var r=[{t:7,e:"div",f:[{t:16,r:"~/columns."+n+".content",c:{r:"."},z:t}]}];e.attrs.length?(e.attrsP=e.attrs,e.attrs=[{t:16,r:"~/columns."+n+".attrsP",c:{r:"."},z:t}]):e.attrs=[];var i=e.attrs;if(e.fixed){var o=e.fixed.path||"~/columns."+n+".fixed";i.push({t:13,n:"class-rtable-fixed-column",f:[{t:2,r:o}]}),i.push({t:4,n:50,x:{r:["~/noWrap",o],s:"_0&&typeof _1==='string'"},f:[{t:13,n:"style-left",f:[{t:2,r:o}]}]})}if(e.editable&&(e.filter||e.editP)){var a={t:70,n:["click","mousedown","pointerdown","MSPointerDown","touchstart"],f:{r:["@event"],s:"[_0.stopPropagation()]"}},l=[{t:4,n:50,x:{r:["~/columns."+n+".editP"],s:"Array.isArray(_0)"},f:[{t:7,e:"div",m:[{t:13,n:"class-rtable-edit"},a],f:[{t:16,r:"~/columns."+n+".editP"}]}]},{t:4,n:50,l:1,x:{r:["~/columns."+n+".type"],s:"_0==='boolean'"},f:[{t:7,e:"input",m:[{t:13,n:"type",f:"checkbox"},{t:13,n:"checked",f:[{t:2,r:e.filter}]},a]}]},{t:4,n:51,l:1,f:[{t:7,e:"input",m:[{t:13,n:"value",f:[{t:2,r:e.filter}]},a]}]}];"object"==typeof e.editable?(i.push({t:13,n:"class-rtable-editing",f:e.editable}),r=[Object.assign({},e.editable,{t:4,n:50,f:l}),{t:4,n:51,l:1,f:r}]):(i.push({t:13,n:"class-rtable-editing"}),r=l)}e.valign&&i.push({t:13,n:"class-rtable-valign-col-top",f:[{t:2,x:{r:["~/columns."+n+".valign"],s:"_0==='top'"}}]},{t:13,n:"class-rtable-valign-col-bottom",f:[{t:2,x:{r:["~/columns."+n+".valign"],s:"_0==='bottom'"}}]},{t:13,n:"class-rtable-valign-col-center",f:[{t:2,x:{r:["~/columns."+n+".valign"],s:"_0==='center'"}}]});var s={t:7,e:"div",f:r,m:i};e.type&&i.unshift({t:13,n:"class-rtable-"+e.type+"-column"}),i.push({t:13,n:"class-rtable-column"});var d=e.attrsP&&e.attrsP.find(function(e){return"title"===e.n});d?d.f||(i.unshift({t:13,n:"title",f:e.content.find(function(e){return e.e})?e.label:e.content}),e.attrsP.splice(i.indexOf(d),1)):i.unshift({t:4,n:50,r:"~/autoTitles",f:[{t:13,n:"title",f:e.content.find(function(e){return e.e})?e.label:e.content}]}),0===e.noPad?i.push({t:13,n:"class-rtable-no-pad"}):e.noPad&&i.push({t:13,n:"class-rtable-no-pad",f:e.noPad});var c=s;return e.hidden&&e.hidden.r&&(c={t:4,n:51,r:e.hidden.r,f:[s]}),c}),t]}var R=["label","type","filter","hidden","sort","no-pad","id","editable","fixed"],C=/^[a-z]{1,3}[0-9]+(?:-[0-9]+)?$/,N=[];function G(e){return void 0===e&&(e={}),function(t){var n=t.Ractive,r=t.instance;"includeGrid"in e&&n.styleSet("table.includeGrid",e.includeGrid),r.components[e.name||"data-table"]=z}}r("RauiTable","components",z),e.Table=z,e.numberify=W,e.plugin=G,e.default=G,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -286,3 +286,3 @@ (function (global, factory) {

return "\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n " + (!boxy ? ("box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";") :
("border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }" + (boxy ? ("\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }") : '') + "\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n \n .rtabs-tab-window-wrapper:before,\n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n height: 100%;\n width: " + (primary.indicator.size || '1em') + ";\n opacity: 0;\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n left: 0;\n }\n .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n right: 0;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after,\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 0.5;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n " + (!boxy ? (".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: " + (primary.bga || '#f4f4f4') + ";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: " + (primary.fga || '#07e') + ";\n }") : ("\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.bg || '#fff') + ";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.fga || '#07e') + ";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")) + "\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }" + (boxy ? "\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }" : '') + "\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;" + (boxy ? ("\n border-style: solid;\n border-width: 0 0 " + bottom + " 0;\n border-color: " + (primary.bc || '#ccc') + ";\n line-height: 1.5em;") : '') + "\n }\n \n .rtabs-tab {\n display: inline-block;\n padding: 0.5em 1em;\n height: 1.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;" + (!boxy ? "\n opacity: 0.9;" : ("\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0 1px " + bottom + " 0;\n margin-bottom: -" + bottom + ";\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected" + (boxy ? ",\n .alt > div > .rtabs-tab-window .rtabs-selected" : '') + " {\n opacity: 1;" + (boxy ? ("\n font-weight: bold;\n border-bottom-color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.selected.bg || primary.bg || '#fff') + ";\n color: " + (primary.selected.fg || primary.fg || '#222') + ";") : '') + "\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: " + (primary.indicator.color || primary.fga || '#07e') + ";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n }\n \n .rtabs {\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: flex;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-content-window:before,\n .rtabs-content-window:after {\n content: '';\n display: block;\n position: absolute;\n z-index: 999;\n height: " + (primary.indicator.size || '1em') + ";\n width: 100%;\n opacity: 0;\n pointer-events: none;\n }\n .rtabs-content-window:before {\n top: 0;\n background: linear-gradient(to bottom, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n }\n .rtabs-content-window:after {\n bottom: 0;\n background: linear-gradient(to top, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n }\n .rtabs-content-window.rtab-scroll-top:before,\n .rtabs-content-window.rtab-scroll-bottom:after {\n opacity: 0.5;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n " + themes.map(function (t) {
("border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }" + (boxy ? ("\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fga || '#07e') + ";\n }") : '') + "\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n \n .rtabs-tab-window-wrapper:before,\n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n height: 100%;\n width: " + (primary.indicator.size || '1em') + ";\n opacity: 0;\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n left: 0;\n }\n .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n right: 0;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after,\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 0.5;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n " + (!boxy ? (".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: " + (primary.bga || '#f4f4f4') + ";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: " + (primary.fga || '#07e') + ";\n }") : ("\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.bg || '#fff') + ";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: " + (primary.fga || '#07e') + ";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }")) + "\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }" + (boxy ? "\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }" : '') + "\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;" + (boxy ? ("\n border-style: solid;\n border-width: 0 0 " + bottom + " 0;\n border-color: " + (primary.bc || '#ccc') + ";\n line-height: 1.5em;") : '') + "\n }\n \n .rtabs-tab {\n display: inline-flex;\n align-items: center;\n padding: 0.5em 1em;\n height: 1.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;" + (!boxy ? "\n opacity: 0.9;" : ("\n border-color: " + (primary.bc || '#ccc') + ";\n border-style: solid;\n border-width: 0 1px " + bottom + " 0;\n margin-bottom: -" + bottom + ";\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bga || '#f4f4f4') + ";\n ")) + "\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected" + (boxy ? ",\n .alt > div > .rtabs-tab-window .rtabs-selected" : '') + " {\n opacity: 1;" + (boxy ? ("\n font-weight: bold;\n border-bottom-color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.selected.bg || primary.bg || '#fff') + ";\n color: " + (primary.selected.fg || primary.fg || '#222') + ";") : '') + "\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: " + (primary.indicator.color || primary.fga || '#07e') + ";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n }\n \n .rtabs {\n color: " + (primary.fg || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: flex;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-content-window:before,\n .rtabs-content-window:after {\n content: '';\n display: block;\n position: absolute;\n z-index: 999;\n height: " + (primary.indicator.size || '1em') + ";\n width: 100%;\n opacity: 0;\n pointer-events: none;\n }\n .rtabs-content-window:before {\n top: 0;\n background: linear-gradient(to bottom, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n }\n .rtabs-content-window:after {\n bottom: 0;\n background: linear-gradient(to top, " + (primary.indicator.highlight || primary.indicator.color || primary.fga || '#07e') + ", transparent);\n }\n .rtabs-content-window.rtab-scroll-top:before,\n .rtabs-content-window.rtab-scroll-bottom:after {\n opacity: 0.5;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n " + themes.map(function (t) {
var theme = Object.assign({}, data('raui.primary'), data('raui.tabs.primary'), data(("raui." + t)), data(("raui.tabs." + t)));

@@ -289,0 +289,0 @@ theme.selected = Object.assign({}, data('raui.tabs.selected'), data('raui.tabs.primary.selected'), data(("raui.tabs." + t + ".selected")));

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RauiTabs={},t.Ractive)}(this,function(t,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var e="undefined"!=typeof window?window:null;var r=function(t){function n(n){t.call(this,n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={selection:{configurable:!0},visibleSelection:{configurable:!0}};return n.prototype.addTab=function(t,n){t.template||(t.template=[]),"number"==typeof n?this.splice("tabs",n,0,t):this.push("tabs",t);var e=new o(this,t);return t.select&&this.select(e.index),e},n.prototype.getTab=function(t){var n=this.get("tabs"),e=n.find(function(n){return n.id===t});return e?new o(this,e):t in n&&"object"==typeof n[t]?new o(this,n[t]):void 0},n.prototype.updateIndicator=function(){if(this.rendered&&this._tabs){var t=this.getContext(this.find(".rtabs-tab-window"));if(t.decorators.scrolled&&t.decorators.scrolled.refresh(),!this.get("@style.raui.tabs.boxy")){var n=this._tabs[this.get("selected")];if(n&&n.offsetParent)if(n){var e=this.get("selectedLeft");if(void 0===e)this.set({selectedLeft:n.offsetLeft,selectedRight:n.offsetParent.clientWidth-(n.offsetLeft+n.offsetWidth)});else{var r=n.offsetParent.clientWidth,i=n.offsetLeft,s=r-i-n.clientWidth;this.set({direction:i<e?"left":"right",selectedLeft:i,selectedRight:s})}}else this.set({selectedLeft:0,selectedRight:this.find(".tabs").offsetWidth})}}},n.prototype.checkSelection=function(t,n){this.get("selected")!==n&&s.call(this,t,n)},n.prototype.select=function(t){return!(t<0||t>=(this.get("tabs.length")||0)||this._hidden(t))&&(this.fire("select",{},t),!0)},n.prototype._hidden=function(t){var n=this.get("tabs."+t+".hidden");return"string"==typeof n&&(n=this.get(n)),n},n.prototype.stopHorizontalScroll=function(t){t.scrollLeft&&(t.scrollLeft=0)},n.prototype._scrollsRight=function(t){if(/hscroll.*(hmiddle|left)/.test(t)&&!/right/.test(t))return!0},n.prototype._scrollsUp=function(t){if(/vscroll.*(vmiddle|bottom)/.test(t)&&!/top/.test(t))return!0},n.prototype._scrollsLeft=function(t){if(/hscroll.*(hmiddle|right)/.test(t)&&!/left/.test(t))return!0},n.prototype._scrollsDown=function(t){if(/vscroll.*(vmiddle|top)/.test(t)&&!/bottom/.test(t))return!0},e.selection.get=function(){return this.get("selected")},e.visibleSelection.get=function(){for(var t=0,n=this.get("tabs"),e=this.get("selected"),r=0;r<n.length;r++){var i=n[r];if(e===r)return t;var s=i.hidden;"string"==typeof s&&(s=this.get(s)),s||t++}return t},Object.defineProperties(n.prototype,e),n}(n),i=["closable","disabled","title","right","button","no-pad","hidden","id","load"];function s(t,n){var e,r=this;if(!(n<-1||n>=this.get("tabs.length"))){var i=this.get("selected"),s=this.get("transition");if(this._fadetm&&(this.set("opacity",1),clearTimeout(this._fadetm),this._fadetm=0),this._contents){var o=this._contents[n];if(o){var a=this.getContext(o);a.decorators.scrolled&&a.decorators.scrolled.refresh()}}if(i!==n)if(this.rendered){var l=this.getContext(this.find(".rtabs-selected")),c=this.find(".rtabs-content-window");if(~i&&this.set("scroll."+l.get("@index"),c.scrollTop),l.hasListener("leave")&&l.raise("leave"),"fade"===s){this.set({opacity:0,selected:n}),this.updateIndicator();var d=this.getContext(this.find(".rtabs-selected"));this._fadetm=setTimeout(function(){var t;r._fadetm=0,r.set(((t={selectedContent:n})["tabs."+n+".load"]=!0,t.opacity=1,t)),d.hasListener("enter")&&d.raise("enter"),c&&~i&&(c.scrollTop=r.get("scroll."+n)||0)},150)}else if("slide"===s){this.set("selected",n),this.set("tabs."+n+".load",!0),this.set("selectedContent",n),this.updateIndicator();var f=this.getContext(this.find(".rtabs-selected"));f.hasListener("enter")&&f.raise("enter"),c&&~i&&(c.scrollTop=this.get("scroll."+n)||0)}else{this.set(((e={selected:n})["tabs."+n+".load"]=!0,e.selectedContent=n,e)),this.updateIndicator();var b=this.getContext(this.find(".rtabs-selected"));b.hasListener("enter")&&b.raise("enter"),c&&(c.scrollTop=this.get("scroll."+n)||0)}~i&&c&&c.scrollLeft&&(c.scrollLeft=0)}else this.set({selected:n,selectedContent:n})}}n.extendWith(r,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs",g:1},{t:16,r:"extra-attributes"},{n:"class-rtabs-flat",t:13,f:[{t:2,r:"~/flat"}]},{n:"class-rtabs-margin",t:13,f:[{t:2,r:"~/margin"}]},{n:"class-rtabs-fill",t:13,f:[{t:2,r:"~/fill"}]},{n:"sized",t:71,f:{r:[],s:'[{clientWidth:"~/clientWidth"}]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window-wrapper",g:1},{n:"class-rtabs-scroll-right",t:13,f:[{t:2,x:{r:["@this","~/scrollStatus"],s:"_0._scrollsRight(_1)"}}]},{n:"class-rtabs-scroll-left",t:13,f:[{t:2,x:{r:["@this","~/scrollStatus"],s:"_0._scrollsLeft(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window",g:1},{t:4,f:[{n:"class-rtabs-going-left",t:13}],n:50,x:{r:[".direction"],s:'_0==="left"'}},{t:4,f:[{n:"class-rtabs-going-right",t:13}],n:51,l:1},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scrollStatus"]'}}],n:51,r:"@style.raui.tabs.noscrollindicators"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tabs",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-left",g:1},{n:"class-rtabs-center",t:13,f:[{t:2,r:"~/center"}]}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"!_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-right",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-indicator",g:1},{n:"style-left",f:[{t:2,r:".selectedLeft"},"px"],t:13},{t:4,f:[{n:"style-right",f:[{t:2,r:".selectedRight"},"px"],t:13}],n:50,x:{r:[".selectedRight"],s:"_0!==undefined"}}]}],n:51,r:"@style.raui.tabs.boxy"}]}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-window",g:1},{t:4,f:[{n:"class-rtabs-trans-fade",t:13}],n:50,x:{r:[".transition"],s:'_0==="fade"'}},{t:4,f:[{n:"class-rtabs-trans-slide",t:13}],n:50,x:{r:[".transition"],s:'_0==="slide"'},l:1},{n:["scroll"],t:70,f:{r:["@this","@node"],s:"[_0.stopHorizontalScroll(_1)]"}},{n:"class-rtab-scroll-right",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-left",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-top",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-bottom",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-contents",g:1},{n:"style-opacity",f:[{t:2,r:"~/opacity"}],t:13},{n:"style-left",f:[{t:2,x:{r:[".selectedContent"],s:"_0*-100"}},"%"],t:13},{n:"class-rtabs-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:4,f:[{t:8,r:"tab-content"}],n:52,r:".tabs"}]}]}]}]}],e:{'[{clientWidth:"~/clientWidth"}]':function(){return[{clientWidth:"~/clientWidth"}]},"_0._scrollsRight(_1)":function(t,n){return t._scrollsRight(n)},"_0._scrollsLeft(_1)":function(t,n){return t._scrollsLeft(n)},'_0==="left"':function(t){return"left"===t},'["~/scrollStatus"]':function(){return["~/scrollStatus"]},"!_0&&!_1._hidden(_2)":function(t,n,e){return!t&&!n._hidden(e)},"_0&&!_1._hidden(_2)":function(t,n,e){return t&&!n._hidden(e)},"_0!==undefined":function(t){return void 0!==t},'_0==="fade"':function(t){return"fade"===t},'_0==="slide"':function(t){return"slide"===t},"[_0.stopHorizontalScroll(_1)]":function(t,n){return[t.stopHorizontalScroll(n)]},"_0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)":function(t,n,e){return t._scrollsRight(e[n]&&e[n].scrollStatus)},"_0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)":function(t,n,e){return t._scrollsLeft(e[n]&&e[n].scrollStatus)},"_0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)":function(t,n,e){return t._scrollsUp(e[n]&&e[n].scrollStatus)},"_0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)":function(t,n,e){return t._scrollsDown(e[n]&&e[n].scrollStatus)},"_0*-100":function(t){return-100*t},"_0===_1":function(t,n){return t===n},'_0==="dynamic"':function(t){return"dynamic"===t},"_0!==_1":function(t,n){return t!==n},"_0===false":function(t){return!1===t},"[_0.checkSelection((_1),_2)]":function(t,n,e){return[t.checkSelection(n,e)]},'[".scrollStatus"]':function(){return[".scrollStatus"]},'["content",_0]':function(t){return["content",t]},'(_3==="always"&&_0===_1)||(_3&&_2)||!_3':function(t,n,e,r){return"always"===r&&t===n||r&&e||!r},"!_0":function(t){return!t},"_0===_1&&!_2":function(t,n,e){return t===n&&!e},'typeof _1==="string"?_0.get(_1):_1':function(t,n){return"string"==typeof n?t.get(n):n},'[["select",_0]]':function(t){return[["select",t]]},"[_0.button()]":function(t){return[t.button()]},'typeof _0==="function"':function(t){return"function"==typeof t},'["tab",_0]':function(t){return["tab",t]},'typeof _0==="string"':function(t){return"string"==typeof t},'[["close",_0]]':function(t){return[["close",t]]},"_0&&!_1":function(t,n){return t&&!n}},p:{"tab-content":[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-content",g:1},{n:"class-rtabs-selected-content",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0===_1"}}]},{n:"class-rtabs-dyna",t:13,f:[{t:2,x:{r:["~/height"],s:'_0==="dynamic"'}}]},{n:"class-rtabs-not-selected",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0!==_1"}}]},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"},{t:4,f:[{n:"class-rtabs-no-pad",t:13}],n:50,x:{r:[".pad"],s:"_0===false"}},{t:4,f:[{n:"class-rtabs-no-pad",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".padRef"}]}}]}],n:50,r:".padRef",l:1},{n:["focusin"],t:70,f:{r:["@this","@context","@index"],s:"[_0.checkSelection((_1),_2)]"}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'[".scrollStatus"]'}}],n:51,r:"@style.raui.tabs.noscrollindicators"},{n:"registered",t:71,f:{r:["@index"],s:'["content",_0]'}}],f:[{t:4,f:[{t:16,r:".template"}],n:50,x:{r:["~/selectedContent","@index",".load","~/defer"],s:'(_3==="always"&&_0===_1)||(_3&&_2)||!_3'}}]}],n:50,x:{r:[".button"],s:"!_0"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-placeholder",g:1}]}],n:51,l:1}],tab:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab",g:1},{n:"class-rtabs-selected",t:13,f:[{t:2,x:{r:["~/selected","@index",".button"],s:"_0===_1&&!_2"}}]},{t:4,f:[{n:"class-rtabs-disabled",t:13}],n:50,x:{r:["@this",".disabled"],s:'typeof _1==="string"?_0.get(_1):_1'}},{t:4,f:[{n:["click"],t:70,f:{r:["@index"],s:'[["select",_0]]'}}],n:50,x:{r:[".button"],s:"!_0"},l:1},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.button()]"}}],n:50,x:{r:[".button"],s:'typeof _0==="function"'},l:1},{n:"registered",t:71,f:{r:["@index"],s:'["tab",_0]'}},{t:4,f:[{t:16,r:".extraTab"}],n:50,r:".extraTab"},{n:"data-tab-index",f:[{t:2,r:"@index"}],t:13}],f:[{t:4,f:[{t:2,r:"title"}],n:50,x:{r:[".title"],s:'typeof _0==="string"'}},{t:4,f:[{t:16,r:".title"}],n:50,r:".title",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-close",g:1},{n:["click"],t:70,f:{r:["@index"],s:'[["close",_0]]'}}],f:["×"]}],n:50,x:{r:[".closable",".button"],s:"_0&&!_1"}}]}]}},cssId:"rtab",noCssTransform:!0,css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.tabs.primary"));n.selected=Object.assign({},t("raui.tabs.selected"),t("raui.tabs.primary.selected")),n.indicator=Object.assign({},t("raui.tabs.indicator"),t("raui.tabs.primary.indicator"));var e=(t("raui.themes")||[]).slice();(t("raui.tabs.themes")||[]).forEach(function(t){~e.indexOf(t)||e.push(t)});var r=t("raui.tabs.boxy")||t("raui.tabs.primary.boxy"),i=.0625*(t("raui.tabs.bottom")||1)+"em";return"\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n "+(r?"border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bga||"#f4f4f4")+";\n ":"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bg||"#fff")+";")+"\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fga||"#07e")+";\n }"+(r?"\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fga||"#07e")+";\n }":"")+"\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n \n .rtabs-tab-window-wrapper:before,\n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n height: 100%;\n width: "+(n.indicator.size||"1em")+";\n opacity: 0;\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(n.indicator.highlight||n.indicator.color||n.fga||"#07e")+", transparent);\n left: 0;\n }\n .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(n.indicator.highlight||n.indicator.color||n.fga||"#07e")+", transparent);\n right: 0;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after,\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 0.5;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n "+(r?"\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(n.bg||"#fff")+";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(n.fga||"#07e")+";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }":".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: "+(n.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: "+(n.fga||"#07e")+";\n }")+"\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }"+(r?"\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }":"")+"\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;"+(r?"\n border-style: solid;\n border-width: 0 0 "+i+" 0;\n border-color: "+(n.bc||"#ccc")+";\n line-height: 1.5em;":"")+"\n }\n \n .rtabs-tab {\n display: inline-block;\n padding: 0.5em 1em;\n height: 1.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;"+(r?"\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 1px "+i+" 0;\n margin-bottom: -"+i+";\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bga||"#f4f4f4")+";\n ":"\n opacity: 0.9;")+"\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected"+(r?",\n .alt > div > .rtabs-tab-window .rtabs-selected":"")+" {\n opacity: 1;"+(r?"\n font-weight: bold;\n border-bottom-color: "+(n.bg||"#fff")+";\n background-color: "+(n.selected.bg||n.bg||"#fff")+";\n color: "+(n.selected.fg||n.fg||"#222")+";":"")+"\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: "+(n.indicator.color||n.fga||"#07e")+";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(n.bg||"#fff")+";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n }\n \n .rtabs {\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bg||"#fff")+";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: flex;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-content-window:before,\n .rtabs-content-window:after {\n content: '';\n display: block;\n position: absolute;\n z-index: 999;\n height: "+(n.indicator.size||"1em")+";\n width: 100%;\n opacity: 0;\n pointer-events: none;\n }\n .rtabs-content-window:before {\n top: 0;\n background: linear-gradient(to bottom, "+(n.indicator.highlight||n.indicator.color||n.fga||"#07e")+", transparent);\n }\n .rtabs-content-window:after {\n bottom: 0;\n background: linear-gradient(to top, "+(n.indicator.highlight||n.indicator.color||n.fga||"#07e")+", transparent);\n }\n .rtabs-content-window.rtab-scroll-top:before,\n .rtabs-content-window.rtab-scroll-bottom:after {\n opacity: 0.5;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n "+e.map(function(n){var e=Object.assign({},t("raui.primary"),t("raui.tabs.primary"),t("raui."+n),t("raui.tabs."+n));e.selected=Object.assign({},t("raui.tabs.selected"),t("raui.tabs.primary.selected"),t("raui.tabs."+n+".selected")),e.indicator=Object.assign({},t("raui.tabs.indicator"),t("raui.tabs.primary.indicator"),t("raui.tabs."+n+".indicator"));var r="boxy"in e?e.boxy:t("raui.tabs.boxy");return".rtabs."+n+" > div > .rtabs-tab-window {\n "+(r?"border-color: "+(e.bc||"#ccc")+";\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bga||"#f4f4f4")+";\n ":"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bg||"#fff")+";")+"\n }\n .rtabs."+n+" > .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(e.indicator.highlight||e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+" > .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(e.indicator.highlight||e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+" > .rtabs-content-wrapper > .rtabs-content-window:before {\n background: linear-gradient(to bottom, "+(e.indicator.highlight||e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+" > .rtabs-content-wrapper > .rtabs-content-window:after {\n background: linear-gradient(to top, "+(e.indicator.highlight||e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+".alt > div > .rtabs-tab-window {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fga||"#07e")+";\n }"+(r?"\n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fga||"#07e")+";\n }":"")+"\n \n "+(r?"\n .rtabs-flat."+n+" > div > .rtabs-tab-window {\n background-color: "+(e.bg||"#fff")+";\n }\n .alt.rtabs-flat."+n+" > div > .rtabs-tab-window {\n background-color: "+(e.fga||"#07e")+";\n }":".rtabs-flat."+n+" > div > .rtabs-tab-window:after {\n background-color: "+(e.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt."+n+" > div > .rtabs-tab-window:after {\n background-color: "+(e.fga||"#07e")+";\n }")+"\n \n "+(r?".rtabs."+n+" > div > .rtabs-tab-window .rtabs-tabs {\n border-color: "+(e.bc||"#ccc")+";\n }":"")+"\n \n .rtabs."+n+" > div > .rtabs-tab-window > .rtabs-tab {\n cursor: pointer;"+(r?"\n border-color: "+(e.bc||"#ccc")+";\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bga||"#f4f4f4")+";\n ":"")+"\n }\n \n .rtabs."+n+" > div > .rtabs-tab-window .rtabs-selected"+(r?",\n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-selected":"")+" {"+(r?"\n border-bottom-color: "+(them.bg||"#fff")+";\n background-color: "+(e.selected.bg||e.bg||"#fff")+";"+(e.indicator?"\n background-image: linear-gradient(to bottom, "+(e.indicator.color||e.fga||"#07e")+", "+(e.bg||"#fff")+" 3px);":"")+"\n color: "+(e.selected.fg||e.fg||"#222")+";":"")+"\n }\n \n .rtabs."+n+" > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(e.indicator.color||e.fga||"#07e")+";\n }\n \n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(e.bg||"#fff")+";\n }\n \n .rtabs."+n+" {\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bg||"#fff")+";\n }\n "}).join("\n")}.call(this,t)].join(" ")},attributes:["transition","flat","pad","center","height","fill","defer","selected"],data:function(){return{tabs:[],rightTabs:[],selected:-1,selectedContent:-1,opacity:1,scrollStatus:""}},on:{construct:function(){var t=this.component;if(!t)return;var n=t.template.f||[],e=t.template.m?t.template.m.slice():[],r=t.template;t.template={e:r.e,f:r.f,t:r.t,m:e};var s=n.filter(function(t){return"tab"===t.e}).map(function(t){var n,r={template:{t:t.f.filter(function(t){return"title"!==t.e})}},s=[],o=[];return t.m&&t.m.forEach(function(t){if(13===t.t&&~i.indexOf(t.n))if("disabled"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var n="_cnd"+e.length;r.disabled=n,e.push({t:13,n:n,f:t.f})}else if("no-pad"===t.n)if(t.f){if(1===t.f.length&&2===t.f[0].t){var a="_cnd"+e.length;r.padRef=a,e.push({t:13,n:a,f:t.f})}}else r.pad=!1;else if("hidden"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var l="_cnd"+e.length;r.hidden=l,e.push({t:13,n:l,f:t.f})}else r[t.n]=0===t.f||("string"==typeof t.f?t.f:{t:t.f});else 70===t.t?o.push(t):s.push(t)}),(n=t.f.find(function(t){return"title"===t.e}))&&(r.title=n.f,n.m&&o.push.apply(o,n.m)),s.length&&(r.extra={t:s}),o.length&&(r.extraTab={t:o}),r});this._ctabs=s},config:function(){var t=this;this._ctabs&&this.set("tabs",(this.get("tabs")||[]).concat(this._ctabs),{shuffle:!0}),this._ctabs=0;var n=this.get("tabs"),e=this.indicatorObservers=[];n.forEach(function(n){"string"==typeof n.hidden&&e.push(t.observe(n.hidden,function(){return setTimeout(function(){return t.updateIndicator()})},{init:!1,defer:!0}))}),e.push(this.observe("tabs.*.hidden",function(){return setTimeout(function(){return t.updateIndicator()})},{init:!1,defer:!0})),this.once("render",function(){var n=t.get("selected");-1===n?t.select(0):t.set("selectedContent",n)})},select:s,close:function(t,n){var e=this.getContext(this._tabs[n]),r=!0;"function"==typeof e.onclose&&(r=!1!==e.onclose.call(void 0));r&&e.element.events.find(function(t){return t.events.find(function(t){return"close"===t.name})})&&(r=!1!==e.raise("close"));r&&this.splice("tabs",n,1);return!1},teardown:function(){this.indicatorObservers.forEach(function(t){return t.cancel()})}},observe:{selected:{handler:function(t){var n=this,e=this._hidden(t);this.get("tabs");e&&setTimeout(function(){var t=n.get("transition");n.set("transition","");for(var e=n.get("tabs"),r=0;r<e.length;r++){var i=e[r].hidden;if("string"==typeof i&&(i=n.get(i)),!i){n.select(r);break}}n.set("transition",t)})},init:!1},clientWidth:function(){this.updateIndicator()}},decorators:{registered:function(t,n,e){var r=this,i=this.getContext(t);return this._tabs||(this._tabs=[]),this._contents||(this._contents=[]),this["_"+n+"s"][e]=t,"tab"===n?this.updateIndicator():i.decorators.scrolled&&i.decorators.scrolled.refresh(),{teardown:function(){},invalidate:function(){"tab"===n?r.updateIndicator():i.decorators.scrolled&&i.decorators.scrolled.refresh()},update:function(e){r["_"+n+"s"][e]=t,"tab"===n?setTimeout(function(){return r.updateIndicator()}):i.decorators.scrolled&&setTimeout(function(){return i.decorators.scrolled.refresh()})}}},scrolled:function(t,n){void 0===n&&(n={});var e="string"==typeof n?n:n.bind;if("string"!=typeof e)return{teardown:function(){}};var r,i=n.allow||2,s=this.getContext(t),o=!1;function a(){o=!1;var n="";t.scrollHeight>t.clientHeight&&(n+="vscroll"),t.scrollWidth>t.clientWidth&&(n+=(n?" ":"")+"hscroll"),t.scrollTop<=i&&(n+=" top"),t.scrollTop>=t.scrollHeight-t.clientHeight-i&&(n+=" bottom"),~n.indexOf("top")||~n.indexOf("bottom")||(n+=" vmiddle"),t.scrollLeft<=i&&(n+=" left"),t.scrollLeft>=t.scrollWidth-t.clientWidth-i?n+=" right":~n.indexOf("left")||~n.indexOf("right")||(n+=" hmiddle"),s.set(e,n),s.hasListener("scrolled")&&s.raise("scrolled",{})}return t.addEventListener("scroll",a,{passive:!0}),requestAnimationFrame(a),{refresh:function(){o||(r&&clearTimeout(r),r=setTimeout(function(){r=null,o=!0,requestAnimationFrame(a)},250))},teardown:function(){t.removeEventListener("scroll",a),s.set(e,"")}}},sized:function(t,n){var e=n.context||this.getContext(t),r={position:t.style.position,overflowY:t.style.overflowY};""!==t.style.position&&"static"!==t.style.position||(t.style.position="relative");var i=function(){n.offsetWidth&&e.set(n.offsetWidth,t.offsetWidth),n.offsetHeight&&e.set(n.offsetHeight,t.offsetHeight),n.clientWidth&&e.set(n.clientWidth,t.clientWidth),n.clientHeight&&e.set(n.clientHeight,t.clientHeight),n.diffWidth&&e.set(n.diffWidth,t.offsetWidth-t.clientWidth),n.diffHeight&&e.set(n.diffHeight,t.offsetHeight-t.clientHeight)},s=function(t,n){var e=document.createElement("object");return e.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),e.setAttribute("tabindex","-1"),e.type="text/html",e.onload=function(){e.contentDocument.defaultView.addEventListener("resize",n),n()},/Trident/.test(navigator.userAgent)?(t.appendChild(e),e.data="about:blank"):(e.data="about:blank",t.appendChild(e)),e}(t,i);return{refresh:i,teardown:function(){t.removeChild(s),t.style.position=r.position,t.style.overflowY=r.overflowY}}}}});var o=function(t,n){this.tabs=t,this.item=n},a={keypath:{configurable:!0},id:{configurable:!0},index:{configurable:!0},title:{configurable:!0},template:{configurable:!0},hidden:{configurable:!0},right:{configurable:!0},pad:{configurable:!0},disabled:{configurable:!0},button:{configurable:!0},closable:{configurable:!0},load:{configurable:!0}};function l(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"tabs"]=r}}a.keypath.get=function(){if(!this.removed)return"tabs."+this.index},a.id.get=function(){return this.get("id")},a.id.set=function(t){this.set("id",t)},a.index.get=function(){return this.tabs.get("tabs").indexOf(this.item)},a.title.get=function(){return this.get("title")},a.title.set=function(t){this.set("title",t)},a.template.get=function(){return this.get("template")},a.template.set=function(t){return this.set("template",t)},a.hidden.get=function(){return this.get("hidden")},a.hidden.set=function(t){return this.set("hidden",t)},a.right.get=function(){return this.get("right")},a.right.set=function(t){return this.set("right",t)},a.pad.get=function(){return this.get("pad")},a.pad.set=function(t){return this.set("pad",t)},a.disabled.get=function(){return this.get("disabled")},a.disabled.set=function(t){return this.set("disabled",t)},a.button.get=function(){return this.get("button")},a.button.set=function(t){return this.set("button",t)},a.closable.get=function(){return this.get("closable")},a.closable.set=function(t){return this.set("closable",t)},a.load.get=function(){return this.get("load")},a.load.set=function(t){return this.set("load",t)},o.prototype.select=function(){this.removed||this.tabs.select(this.index)},o.prototype.remove=function(){return!this.removed&&(this.tabs.splice("tabs",this.index,1),this.removed=!0,!0)},o.prototype.get=function(t){if(this.removed)return!1;if(!t)return this.tabs.get(this.keypath);var n=t.replace(/^[\.\/]*/,"");return this.tabs.get(this.keypath+"."+n)},o.prototype.set=function(t,n){if(this.removed)return!1;var e=t.replace(/^[\.\/]*/,"");return this.tabs.set(this.keypath+"."+e,n)},Object.defineProperties(o.prototype,a),function(t,n,r){if(e&&e.Ractive&&"object"==typeof e.Ractive[n]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var s=i.getAttribute("data-alias");s&&(s=(s=s.split("&")).reduce(function(t,n){var e=n.split("="),r=e[0],i=e[1];return t[r]=i,t},{})),Ractive[n][s&&s[t]||t]=r}}}("RauiTabs","components",r),t.Tabs=r,t.Handle=o,t.plugin=l,t.default=l,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RauiTabs={},t.Ractive)}(this,function(t,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var e="undefined"!=typeof window?window:null;var r=function(t){function n(n){t.call(this,n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={selection:{configurable:!0},visibleSelection:{configurable:!0}};return n.prototype.addTab=function(t,n){t.template||(t.template=[]),"number"==typeof n?this.splice("tabs",n,0,t):this.push("tabs",t);var e=new o(this,t);return t.select&&this.select(e.index),e},n.prototype.getTab=function(t){var n=this.get("tabs"),e=n.find(function(n){return n.id===t});return e?new o(this,e):t in n&&"object"==typeof n[t]?new o(this,n[t]):void 0},n.prototype.updateIndicator=function(){if(this.rendered&&this._tabs){var t=this.getContext(this.find(".rtabs-tab-window"));if(t.decorators.scrolled&&t.decorators.scrolled.refresh(),!this.get("@style.raui.tabs.boxy")){var n=this._tabs[this.get("selected")];if(n&&n.offsetParent)if(n){var e=this.get("selectedLeft");if(void 0===e)this.set({selectedLeft:n.offsetLeft,selectedRight:n.offsetParent.clientWidth-(n.offsetLeft+n.offsetWidth)});else{var r=n.offsetParent.clientWidth,i=n.offsetLeft,s=r-i-n.clientWidth;this.set({direction:i<e?"left":"right",selectedLeft:i,selectedRight:s})}}else this.set({selectedLeft:0,selectedRight:this.find(".tabs").offsetWidth})}}},n.prototype.checkSelection=function(t,n){this.get("selected")!==n&&s.call(this,t,n)},n.prototype.select=function(t){return!(t<0||t>=(this.get("tabs.length")||0)||this._hidden(t))&&(this.fire("select",{},t),!0)},n.prototype._hidden=function(t){var n=this.get("tabs."+t+".hidden");return"string"==typeof n&&(n=this.get(n)),n},n.prototype.stopHorizontalScroll=function(t){t.scrollLeft&&(t.scrollLeft=0)},n.prototype._scrollsRight=function(t){if(/hscroll.*(hmiddle|left)/.test(t)&&!/right/.test(t))return!0},n.prototype._scrollsUp=function(t){if(/vscroll.*(vmiddle|bottom)/.test(t)&&!/top/.test(t))return!0},n.prototype._scrollsLeft=function(t){if(/hscroll.*(hmiddle|right)/.test(t)&&!/left/.test(t))return!0},n.prototype._scrollsDown=function(t){if(/vscroll.*(vmiddle|top)/.test(t)&&!/bottom/.test(t))return!0},e.selection.get=function(){return this.get("selected")},e.visibleSelection.get=function(){for(var t=0,n=this.get("tabs"),e=this.get("selected"),r=0;r<n.length;r++){var i=n[r];if(e===r)return t;var s=i.hidden;"string"==typeof s&&(s=this.get(s)),s||t++}return t},Object.defineProperties(n.prototype,e),n}(n),i=["closable","disabled","title","right","button","no-pad","hidden","id","load"];function s(t,n){var e,r=this;if(!(n<-1||n>=this.get("tabs.length"))){var i=this.get("selected"),s=this.get("transition");if(this._fadetm&&(this.set("opacity",1),clearTimeout(this._fadetm),this._fadetm=0),this._contents){var o=this._contents[n];if(o){var a=this.getContext(o);a.decorators.scrolled&&a.decorators.scrolled.refresh()}}if(i!==n)if(this.rendered){var l=this.getContext(this.find(".rtabs-selected")),c=this.find(".rtabs-content-window");if(~i&&this.set("scroll."+l.get("@index"),c.scrollTop),l.hasListener("leave")&&l.raise("leave"),"fade"===s){this.set({opacity:0,selected:n}),this.updateIndicator();var d=this.getContext(this.find(".rtabs-selected"));this._fadetm=setTimeout(function(){var t;r._fadetm=0,r.set(((t={selectedContent:n})["tabs."+n+".load"]=!0,t.opacity=1,t)),d.hasListener("enter")&&d.raise("enter"),c&&~i&&(c.scrollTop=r.get("scroll."+n)||0)},150)}else if("slide"===s){this.set("selected",n),this.set("tabs."+n+".load",!0),this.set("selectedContent",n),this.updateIndicator();var f=this.getContext(this.find(".rtabs-selected"));f.hasListener("enter")&&f.raise("enter"),c&&~i&&(c.scrollTop=this.get("scroll."+n)||0)}else{this.set(((e={selected:n})["tabs."+n+".load"]=!0,e.selectedContent=n,e)),this.updateIndicator();var b=this.getContext(this.find(".rtabs-selected"));b.hasListener("enter")&&b.raise("enter"),c&&(c.scrollTop=this.get("scroll."+n)||0)}~i&&c&&c.scrollLeft&&(c.scrollLeft=0)}else this.set({selected:n,selectedContent:n})}}n.extendWith(r,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs",g:1},{t:16,r:"extra-attributes"},{n:"class-rtabs-flat",t:13,f:[{t:2,r:"~/flat"}]},{n:"class-rtabs-margin",t:13,f:[{t:2,r:"~/margin"}]},{n:"class-rtabs-fill",t:13,f:[{t:2,r:"~/fill"}]},{n:"sized",t:71,f:{r:[],s:'[{clientWidth:"~/clientWidth"}]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window-wrapper",g:1},{n:"class-rtabs-scroll-right",t:13,f:[{t:2,x:{r:["@this","~/scrollStatus"],s:"_0._scrollsRight(_1)"}}]},{n:"class-rtabs-scroll-left",t:13,f:[{t:2,x:{r:["@this","~/scrollStatus"],s:"_0._scrollsLeft(_1)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-window",g:1},{t:4,f:[{n:"class-rtabs-going-left",t:13}],n:50,x:{r:[".direction"],s:'_0==="left"'}},{t:4,f:[{n:"class-rtabs-going-right",t:13}],n:51,l:1},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'["~/scrollStatus"]'}}],n:51,r:"@style.raui.tabs.noscrollindicators"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tabs",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-left",g:1},{n:"class-rtabs-center",t:13,f:[{t:2,r:"~/center"}]}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"!_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-right",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:"tab"}],n:50,x:{r:[".right","@this","@index"],s:"_0&&!_1._hidden(_2)"}}],n:52,r:".tabs"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-indicator",g:1},{n:"style-left",f:[{t:2,r:".selectedLeft"},"px"],t:13},{t:4,f:[{n:"style-right",f:[{t:2,r:".selectedRight"},"px"],t:13}],n:50,x:{r:[".selectedRight"],s:"_0!==undefined"}}]}],n:51,r:"@style.raui.tabs.boxy"}]}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-content-window",g:1},{t:4,f:[{n:"class-rtabs-trans-fade",t:13}],n:50,x:{r:[".transition"],s:'_0==="fade"'}},{t:4,f:[{n:"class-rtabs-trans-slide",t:13}],n:50,x:{r:[".transition"],s:'_0==="slide"'},l:1},{n:["scroll"],t:70,f:{r:["@this","@node"],s:"[_0.stopHorizontalScroll(_1)]"}},{n:"class-rtab-scroll-right",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-left",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-top",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)"}}]},{n:"class-rtab-scroll-bottom",t:13,f:[{t:2,x:{r:["@this","selected","tabs"],s:"_0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-contents",g:1},{n:"style-opacity",f:[{t:2,r:"~/opacity"}],t:13},{n:"style-left",f:[{t:2,x:{r:[".selectedContent"],s:"_0*-100"}},"%"],t:13},{n:"class-rtabs-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:4,f:[{t:8,r:"tab-content"}],n:52,r:".tabs"}]}]}]}]}],e:{'[{clientWidth:"~/clientWidth"}]':function(){return[{clientWidth:"~/clientWidth"}]},"_0._scrollsRight(_1)":function(t,n){return t._scrollsRight(n)},"_0._scrollsLeft(_1)":function(t,n){return t._scrollsLeft(n)},'_0==="left"':function(t){return"left"===t},'["~/scrollStatus"]':function(){return["~/scrollStatus"]},"!_0&&!_1._hidden(_2)":function(t,n,e){return!t&&!n._hidden(e)},"_0&&!_1._hidden(_2)":function(t,n,e){return t&&!n._hidden(e)},"_0!==undefined":function(t){return void 0!==t},'_0==="fade"':function(t){return"fade"===t},'_0==="slide"':function(t){return"slide"===t},"[_0.stopHorizontalScroll(_1)]":function(t,n){return[t.stopHorizontalScroll(n)]},"_0._scrollsRight(_2[_1]&&_2[_1].scrollStatus)":function(t,n,e){return t._scrollsRight(e[n]&&e[n].scrollStatus)},"_0._scrollsLeft(_2[_1]&&_2[_1].scrollStatus)":function(t,n,e){return t._scrollsLeft(e[n]&&e[n].scrollStatus)},"_0._scrollsUp(_2[_1]&&_2[_1].scrollStatus)":function(t,n,e){return t._scrollsUp(e[n]&&e[n].scrollStatus)},"_0._scrollsDown(_2[_1]&&_2[_1].scrollStatus)":function(t,n,e){return t._scrollsDown(e[n]&&e[n].scrollStatus)},"_0*-100":function(t){return-100*t},"_0===_1":function(t,n){return t===n},'_0==="dynamic"':function(t){return"dynamic"===t},"_0!==_1":function(t,n){return t!==n},"_0===false":function(t){return!1===t},"[_0.checkSelection((_1),_2)]":function(t,n,e){return[t.checkSelection(n,e)]},'[".scrollStatus"]':function(){return[".scrollStatus"]},'["content",_0]':function(t){return["content",t]},'(_3==="always"&&_0===_1)||(_3&&_2)||!_3':function(t,n,e,r){return"always"===r&&t===n||r&&e||!r},"!_0":function(t){return!t},"_0===_1&&!_2":function(t,n,e){return t===n&&!e},'typeof _1==="string"?_0.get(_1):_1':function(t,n){return"string"==typeof n?t.get(n):n},'[["select",_0]]':function(t){return[["select",t]]},"[_0.button()]":function(t){return[t.button()]},'typeof _0==="function"':function(t){return"function"==typeof t},'["tab",_0]':function(t){return["tab",t]},'typeof _0==="string"':function(t){return"string"==typeof t},'[["close",_0]]':function(t){return[["close",t]]},"_0&&!_1":function(t,n){return t&&!n}},p:{"tab-content":[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab-content",g:1},{n:"class-rtabs-selected-content",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0===_1"}}]},{n:"class-rtabs-dyna",t:13,f:[{t:2,x:{r:["~/height"],s:'_0==="dynamic"'}}]},{n:"class-rtabs-not-selected",t:13,f:[{t:2,x:{r:["~/selectedContent","@index"],s:"_0!==_1"}}]},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"},{t:4,f:[{n:"class-rtabs-no-pad",t:13}],n:50,x:{r:[".pad"],s:"_0===false"}},{t:4,f:[{n:"class-rtabs-no-pad",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".padRef"}]}}]}],n:50,r:".padRef",l:1},{n:["focusin"],t:70,f:{r:["@this","@context","@index"],s:"[_0.checkSelection((_1),_2)]"}},{t:4,f:[{n:"scrolled",t:71,f:{r:[],s:'[".scrollStatus"]'}}],n:51,r:"@style.raui.tabs.noscrollindicators"},{n:"registered",t:71,f:{r:["@index"],s:'["content",_0]'}}],f:[{t:4,f:[{t:16,r:".template"}],n:50,x:{r:["~/selectedContent","@index",".load","~/defer"],s:'(_3==="always"&&_0===_1)||(_3&&_2)||!_3'}}]}],n:50,x:{r:[".button"],s:"!_0"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-placeholder",g:1}]}],n:51,l:1}],tab:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-tab",g:1},{n:"class-rtabs-selected",t:13,f:[{t:2,x:{r:["~/selected","@index",".button"],s:"_0===_1&&!_2"}}]},{t:4,f:[{n:"class-rtabs-disabled",t:13}],n:50,x:{r:["@this",".disabled"],s:'typeof _1==="string"?_0.get(_1):_1'}},{t:4,f:[{n:["click"],t:70,f:{r:["@index"],s:'[["select",_0]]'}}],n:50,x:{r:[".button"],s:"!_0"},l:1},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.button()]"}}],n:50,x:{r:[".button"],s:'typeof _0==="function"'},l:1},{n:"registered",t:71,f:{r:["@index"],s:'["tab",_0]'}},{t:4,f:[{t:16,r:".extraTab"}],n:50,r:".extraTab"},{n:"data-tab-index",f:[{t:2,r:"@index"}],t:13}],f:[{t:4,f:[{t:2,r:"title"}],n:50,x:{r:[".title"],s:'typeof _0==="string"'}},{t:4,f:[{t:16,r:".title"}],n:50,r:".title",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtabs-close",g:1},{n:["click"],t:70,f:{r:["@index"],s:'[["close",_0]]'}}],f:["×"]}],n:50,x:{r:[".closable",".button"],s:"_0&&!_1"}}]}]}},cssId:"rtab",noCssTransform:!0,css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.tabs.primary"));n.selected=Object.assign({},t("raui.tabs.selected"),t("raui.tabs.primary.selected")),n.indicator=Object.assign({},t("raui.tabs.indicator"),t("raui.tabs.primary.indicator"));var e=(t("raui.themes")||[]).slice();(t("raui.tabs.themes")||[]).forEach(function(t){~e.indexOf(t)||e.push(t)});var r=t("raui.tabs.boxy")||t("raui.tabs.primary.boxy"),i=.0625*(t("raui.tabs.bottom")||1)+"em";return"\n .rtabs {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n \n .rtabs-tab-window {\n overflow-y: hidden;\n overflow-x: auto;\n "+(r?"border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 1px 1px 0 1px;\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bga||"#f4f4f4")+";\n ":"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bg||"#fff")+";")+"\n position: relative;\n flex-shrink: 0;\n }\n .alt > div > .rtabs-tab-window {\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fga||"#07e")+";\n }"+(r?"\n .alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fga||"#07e")+";\n }":"")+"\n \n .rtabs-tab-window-wrapper {\n position: relative;\n z-index: 10;\n }\n \n .rtabs-tab-window-wrapper:before,\n .rtabs-tab-window-wrapper:after {\n content: '';\n position: absolute;\n top: 0;\n height: 100%;\n width: "+(n.indicator.size||"1em")+";\n opacity: 0;\n z-index: 999;\n pointer-events: none;\n }\n .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(n.indicator.highlight||n.indicator.color||n.fga||"#07e")+", transparent);\n left: 0;\n }\n .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(n.indicator.highlight||n.indicator.color||n.fga||"#07e")+", transparent);\n right: 0;\n }\n .rtabs-tab-window-wrapper.rtabs-scroll-right:after,\n .rtabs-tab-window-wrapper.rtabs-scroll-left:before {\n opacity: 0.5;\n }\n \n .rtabs-flat > div > .rtabs-tab-window {\n box-shadow: none;\n border-width: 0;\n }\n "+(r?"\n .rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(n.bg||"#fff")+";\n }\n .alt.rtabs-flat > div > .rtabs-tab-window {\n background-color: "+(n.fga||"#07e")+";\n }\n .rtabs-flat > div > .rtabs-tab-window .rtabs-tab {\n border-top-width: 1px;\n }":".rtabs-flat > div > .rtabs-tab-window:after {\n content: '';\n height: 0.15em;\n position: absolute;\n bottom: 0px;\n width: 100%;\n display: block;\n background-color: "+(n.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt > div > .rtabs-tab-window:after {\n background-color: "+(n.fga||"#07e")+";\n }")+"\n \n .rtabs-center.rtabs-left {\n text-align: center;\n }"+(r?"\n .rtabs-center > .rtabs-tab:first-child {\n border-left-width: 1px;\n }":"")+"\n \n .rtabs-pad {\n padding: 1em;\n }\n \n .rtabs-fill {\n flex-grow: 1;\n height: 100%;\n }\n \n .rtabs-tabs {\n display: table;\n position: relative;\n min-width: 100%;\n white-space: nowrap;"+(r?"\n border-style: solid;\n border-width: 0 0 "+i+" 0;\n border-color: "+(n.bc||"#ccc")+";\n line-height: 1.5em;":"")+"\n }\n \n .rtabs-tab {\n display: inline-flex;\n align-items: center;\n padding: 0.5em 1em;\n height: 1.5em;\n transition: opacity 0.2s ease-in-out;\n user-select: none;\n cursor: pointer;"+(r?"\n border-color: "+(n.bc||"#ccc")+";\n border-style: solid;\n border-width: 0 1px "+i+" 0;\n margin-bottom: -"+i+";\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bga||"#f4f4f4")+";\n ":"\n opacity: 0.9;")+"\n }\n .rtabs-tab:hover {\n opacity: 1;\n }\n \n .rtabs-selected"+(r?",\n .alt > div > .rtabs-tab-window .rtabs-selected":"")+" {\n opacity: 1;"+(r?"\n font-weight: bold;\n border-bottom-color: "+(n.bg||"#fff")+";\n background-color: "+(n.selected.bg||n.bg||"#fff")+";\n color: "+(n.selected.fg||n.fg||"#222")+";":"")+"\n }\n \n .rtabs-disabled {\n opacity: 0.4;\n }\n \n .rtabs-right {\n text-align: right;\n display: table-cell;\n }\n \n .rtabs-left {\n text-align: left;\n display: table-cell;\n }\n \n .rtabs-close {\n display: inline-block;\n margin-right: -0.5em;\n font-weight: 700;\n opacity: 0.3;\n transition: opacity: 0.2s ease-in-out;\n }\n \n .rtabs-close:hover {\n opacity: 1;\n }\n \n .rtabs-indicator {\n position: absolute;\n bottom: 0;\n height: 0.15em;\n background-color: "+(n.indicator.color||n.fga||"#07e")+";\n z-index: 2;\n }\n \n .alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(n.bg||"#fff")+";\n }\n \n .rtabs-going-left .rtabs-indicator {\n transition: left 0.2s ease-in-out, right 0.2s ease-in-out 0.1s;\n }\n .rtabs-going-right .rtabs-indicator {\n transition: left 0.2s ease-in-out 0.1s, right 0.2s ease-in-out;\n }\n \n .rtabs-content-wrapper {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 2;\n overflow: hidden;\n }\n \n .rtabs-content-window {\n width: 100%;\n display: flex;\n flex-grow: 1;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n }\n \n .rtabs {\n color: "+(n.fg||"#222")+";\n background-color: "+(n.bg||"#fff")+";\n }\n \n .rtabs-contents {\n list-style: none;\n padding: 0;\n margin: 0;\n position: relative;\n left: 0;\n display: flex;\n flex-wrap: nowrap;\n white-space: nowrap;\n width: 100%;\n }\n .rtabs-trans-slide > .rtabs-contents {\n transition: left 0.2s ease-in-out;\n }\n .rtabs-trans-fade > .rtabs-contents {\n transition: opacity 0.15s ease;\n opacity: 1;\n white-space: nowrap;\n }\n \n .rtabs-fill > div > div > .rtabs-contents {\n display: flex;\n }\n \n .rtabs-tab-content {\n position: relative;\n width: 100%;\n overflow: auto;\n vertical-align: top;\n white-space: initial;\n transition: opacity 0.1s ease-in-out;\n flex-shrink: 0;\n white-space: initial;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n }\n \n .rtabs-content-window:before,\n .rtabs-content-window:after {\n content: '';\n display: block;\n position: absolute;\n z-index: 999;\n height: "+(n.indicator.size||"1em")+";\n width: 100%;\n opacity: 0;\n pointer-events: none;\n }\n .rtabs-content-window:before {\n top: 0;\n background: linear-gradient(to bottom, "+(n.indicator.highlight||n.indicator.color||n.fga||"#07e")+", transparent);\n }\n .rtabs-content-window:after {\n bottom: 0;\n background: linear-gradient(to top, "+(n.indicator.highlight||n.indicator.color||n.fga||"#07e")+", transparent);\n }\n .rtabs-content-window.rtab-scroll-top:before,\n .rtabs-content-window.rtab-scroll-bottom:after {\n opacity: 0.5;\n }\n \n .rtabs-placeholder {\n display: inline-block;\n width: 100%;\n height: 1px;\n flex-shrink: 0;\n }\n .rtabs-dyna.rtabs-not-selected {\n height: 1px;\n opacity: 0;\n overflow: hidden;\n }\n .rtabs-pad > .rtabs-tab-content {\n padding: 1em;\n box-sizing: border-box;\n }\n .rtabs-pad > .rtabs-tab-content.rtabs-no-pad {\n padding: 0;\n }\n .rtabs > .rtabs-tab-content.rtabs-pad {\n padding: 1em;\n box-sizing: border-box;\n }\n "+e.map(function(n){var e=Object.assign({},t("raui.primary"),t("raui.tabs.primary"),t("raui."+n),t("raui.tabs."+n));e.selected=Object.assign({},t("raui.tabs.selected"),t("raui.tabs.primary.selected"),t("raui.tabs."+n+".selected")),e.indicator=Object.assign({},t("raui.tabs.indicator"),t("raui.tabs.primary.indicator"),t("raui.tabs."+n+".indicator"));var r="boxy"in e?e.boxy:t("raui.tabs.boxy");return".rtabs."+n+" > div > .rtabs-tab-window {\n "+(r?"border-color: "+(e.bc||"#ccc")+";\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bga||"#f4f4f4")+";\n ":"box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12),\n 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bg||"#fff")+";")+"\n }\n .rtabs."+n+" > .rtabs-tab-window-wrapper:before {\n background: linear-gradient(to right, "+(e.indicator.highlight||e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+" > .rtabs-tab-window-wrapper:after {\n background: linear-gradient(to left, "+(e.indicator.highlight||e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+" > .rtabs-content-wrapper > .rtabs-content-window:before {\n background: linear-gradient(to bottom, "+(e.indicator.highlight||e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+" > .rtabs-content-wrapper > .rtabs-content-window:after {\n background: linear-gradient(to top, "+(e.indicator.highlight||e.indicator.color||e.fga||"#07e")+", transparent);\n }\n .rtabs."+n+".alt > div > .rtabs-tab-window {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fga||"#07e")+";\n }"+(r?"\n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-tab {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fga||"#07e")+";\n }":"")+"\n \n "+(r?"\n .rtabs-flat."+n+" > div > .rtabs-tab-window {\n background-color: "+(e.bg||"#fff")+";\n }\n .alt.rtabs-flat."+n+" > div > .rtabs-tab-window {\n background-color: "+(e.fga||"#07e")+";\n }":".rtabs-flat."+n+" > div > .rtabs-tab-window:after {\n background-color: "+(e.bga||"#f4f4f4")+";\n }\n .rtabs-flat.alt."+n+" > div > .rtabs-tab-window:after {\n background-color: "+(e.fga||"#07e")+";\n }")+"\n \n "+(r?".rtabs."+n+" > div > .rtabs-tab-window .rtabs-tabs {\n border-color: "+(e.bc||"#ccc")+";\n }":"")+"\n \n .rtabs."+n+" > div > .rtabs-tab-window > .rtabs-tab {\n cursor: pointer;"+(r?"\n border-color: "+(e.bc||"#ccc")+";\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bga||"#f4f4f4")+";\n ":"")+"\n }\n \n .rtabs."+n+" > div > .rtabs-tab-window .rtabs-selected"+(r?",\n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-selected":"")+" {"+(r?"\n border-bottom-color: "+(them.bg||"#fff")+";\n background-color: "+(e.selected.bg||e.bg||"#fff")+";"+(e.indicator?"\n background-image: linear-gradient(to bottom, "+(e.indicator.color||e.fga||"#07e")+", "+(e.bg||"#fff")+" 3px);":"")+"\n color: "+(e.selected.fg||e.fg||"#222")+";":"")+"\n }\n \n .rtabs."+n+" > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(e.indicator.color||e.fga||"#07e")+";\n }\n \n .rtabs."+n+".alt > div > .rtabs-tab-window .rtabs-indicator {\n background-color: "+(e.bg||"#fff")+";\n }\n \n .rtabs."+n+" {\n color: "+(e.fg||"#222")+";\n background-color: "+(e.bg||"#fff")+";\n }\n "}).join("\n")}.call(this,t)].join(" ")},attributes:["transition","flat","pad","center","height","fill","defer","selected"],data:function(){return{tabs:[],rightTabs:[],selected:-1,selectedContent:-1,opacity:1,scrollStatus:""}},on:{construct:function(){var t=this.component;if(!t)return;var n=t.template.f||[],e=t.template.m?t.template.m.slice():[],r=t.template;t.template={e:r.e,f:r.f,t:r.t,m:e};var s=n.filter(function(t){return"tab"===t.e}).map(function(t){var n,r={template:{t:t.f.filter(function(t){return"title"!==t.e})}},s=[],o=[];return t.m&&t.m.forEach(function(t){if(13===t.t&&~i.indexOf(t.n))if("disabled"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var n="_cnd"+e.length;r.disabled=n,e.push({t:13,n:n,f:t.f})}else if("no-pad"===t.n)if(t.f){if(1===t.f.length&&2===t.f[0].t){var a="_cnd"+e.length;r.padRef=a,e.push({t:13,n:a,f:t.f})}}else r.pad=!1;else if("hidden"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var l="_cnd"+e.length;r.hidden=l,e.push({t:13,n:l,f:t.f})}else r[t.n]=0===t.f||("string"==typeof t.f?t.f:{t:t.f});else 70===t.t?o.push(t):s.push(t)}),(n=t.f.find(function(t){return"title"===t.e}))&&(r.title=n.f,n.m&&o.push.apply(o,n.m)),s.length&&(r.extra={t:s}),o.length&&(r.extraTab={t:o}),r});this._ctabs=s},config:function(){var t=this;this._ctabs&&this.set("tabs",(this.get("tabs")||[]).concat(this._ctabs),{shuffle:!0}),this._ctabs=0;var n=this.get("tabs"),e=this.indicatorObservers=[];n.forEach(function(n){"string"==typeof n.hidden&&e.push(t.observe(n.hidden,function(){return setTimeout(function(){return t.updateIndicator()})},{init:!1,defer:!0}))}),e.push(this.observe("tabs.*.hidden",function(){return setTimeout(function(){return t.updateIndicator()})},{init:!1,defer:!0})),this.once("render",function(){var n=t.get("selected");-1===n?t.select(0):t.set("selectedContent",n)})},select:s,close:function(t,n){var e=this.getContext(this._tabs[n]),r=!0;"function"==typeof e.onclose&&(r=!1!==e.onclose.call(void 0));r&&e.element.events.find(function(t){return t.events.find(function(t){return"close"===t.name})})&&(r=!1!==e.raise("close"));r&&this.splice("tabs",n,1);return!1},teardown:function(){this.indicatorObservers.forEach(function(t){return t.cancel()})}},observe:{selected:{handler:function(t){var n=this,e=this._hidden(t);this.get("tabs");e&&setTimeout(function(){var t=n.get("transition");n.set("transition","");for(var e=n.get("tabs"),r=0;r<e.length;r++){var i=e[r].hidden;if("string"==typeof i&&(i=n.get(i)),!i){n.select(r);break}}n.set("transition",t)})},init:!1},clientWidth:function(){this.updateIndicator()}},decorators:{registered:function(t,n,e){var r=this,i=this.getContext(t);return this._tabs||(this._tabs=[]),this._contents||(this._contents=[]),this["_"+n+"s"][e]=t,"tab"===n?this.updateIndicator():i.decorators.scrolled&&i.decorators.scrolled.refresh(),{teardown:function(){},invalidate:function(){"tab"===n?r.updateIndicator():i.decorators.scrolled&&i.decorators.scrolled.refresh()},update:function(e){r["_"+n+"s"][e]=t,"tab"===n?setTimeout(function(){return r.updateIndicator()}):i.decorators.scrolled&&setTimeout(function(){return i.decorators.scrolled.refresh()})}}},scrolled:function(t,n){void 0===n&&(n={});var e="string"==typeof n?n:n.bind;if("string"!=typeof e)return{teardown:function(){}};var r,i=n.allow||2,s=this.getContext(t),o=!1;function a(){o=!1;var n="";t.scrollHeight>t.clientHeight&&(n+="vscroll"),t.scrollWidth>t.clientWidth&&(n+=(n?" ":"")+"hscroll"),t.scrollTop<=i&&(n+=" top"),t.scrollTop>=t.scrollHeight-t.clientHeight-i&&(n+=" bottom"),~n.indexOf("top")||~n.indexOf("bottom")||(n+=" vmiddle"),t.scrollLeft<=i&&(n+=" left"),t.scrollLeft>=t.scrollWidth-t.clientWidth-i?n+=" right":~n.indexOf("left")||~n.indexOf("right")||(n+=" hmiddle"),s.set(e,n),s.hasListener("scrolled")&&s.raise("scrolled",{})}return t.addEventListener("scroll",a,{passive:!0}),requestAnimationFrame(a),{refresh:function(){o||(r&&clearTimeout(r),r=setTimeout(function(){r=null,o=!0,requestAnimationFrame(a)},250))},teardown:function(){t.removeEventListener("scroll",a),s.set(e,"")}}},sized:function(t,n){var e=n.context||this.getContext(t),r={position:t.style.position,overflowY:t.style.overflowY};""!==t.style.position&&"static"!==t.style.position||(t.style.position="relative");var i=function(){n.offsetWidth&&e.set(n.offsetWidth,t.offsetWidth),n.offsetHeight&&e.set(n.offsetHeight,t.offsetHeight),n.clientWidth&&e.set(n.clientWidth,t.clientWidth),n.clientHeight&&e.set(n.clientHeight,t.clientHeight),n.diffWidth&&e.set(n.diffWidth,t.offsetWidth-t.clientWidth),n.diffHeight&&e.set(n.diffHeight,t.offsetHeight-t.clientHeight)},s=function(t,n){var e=document.createElement("object");return e.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),e.setAttribute("tabindex","-1"),e.type="text/html",e.onload=function(){e.contentDocument.defaultView.addEventListener("resize",n),n()},/Trident/.test(navigator.userAgent)?(t.appendChild(e),e.data="about:blank"):(e.data="about:blank",t.appendChild(e)),e}(t,i);return{refresh:i,teardown:function(){t.removeChild(s),t.style.position=r.position,t.style.overflowY=r.overflowY}}}}});var o=function(t,n){this.tabs=t,this.item=n},a={keypath:{configurable:!0},id:{configurable:!0},index:{configurable:!0},title:{configurable:!0},template:{configurable:!0},hidden:{configurable:!0},right:{configurable:!0},pad:{configurable:!0},disabled:{configurable:!0},button:{configurable:!0},closable:{configurable:!0},load:{configurable:!0}};function l(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"tabs"]=r}}a.keypath.get=function(){if(!this.removed)return"tabs."+this.index},a.id.get=function(){return this.get("id")},a.id.set=function(t){this.set("id",t)},a.index.get=function(){return this.tabs.get("tabs").indexOf(this.item)},a.title.get=function(){return this.get("title")},a.title.set=function(t){this.set("title",t)},a.template.get=function(){return this.get("template")},a.template.set=function(t){return this.set("template",t)},a.hidden.get=function(){return this.get("hidden")},a.hidden.set=function(t){return this.set("hidden",t)},a.right.get=function(){return this.get("right")},a.right.set=function(t){return this.set("right",t)},a.pad.get=function(){return this.get("pad")},a.pad.set=function(t){return this.set("pad",t)},a.disabled.get=function(){return this.get("disabled")},a.disabled.set=function(t){return this.set("disabled",t)},a.button.get=function(){return this.get("button")},a.button.set=function(t){return this.set("button",t)},a.closable.get=function(){return this.get("closable")},a.closable.set=function(t){return this.set("closable",t)},a.load.get=function(){return this.get("load")},a.load.set=function(t){return this.set("load",t)},o.prototype.select=function(){this.removed||this.tabs.select(this.index)},o.prototype.remove=function(){return!this.removed&&(this.tabs.splice("tabs",this.index,1),this.removed=!0,!0)},o.prototype.get=function(t){if(this.removed)return!1;if(!t)return this.tabs.get(this.keypath);var n=t.replace(/^[\.\/]*/,"");return this.tabs.get(this.keypath+"."+n)},o.prototype.set=function(t,n){if(this.removed)return!1;var e=t.replace(/^[\.\/]*/,"");return this.tabs.set(this.keypath+"."+e,n)},Object.defineProperties(o.prototype,a),function(t,n,r){if(e&&e.Ractive&&"object"==typeof e.Ractive[n]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var s=i.getAttribute("data-alias");s&&(s=(s=s.split("&")).reduce(function(t,n){var e=n.split("="),r=e[0],i=e[1];return t[r]=i,t},{})),Ractive[n][s&&s[t]||t]=r}}}("RauiTabs","components",r),t.Tabs=r,t.Handle=o,t.plugin=l,t.default=l,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RauiWindow={},t.Ractive)}(this,function(t,n){"use strict";var e="default"in n?n.default:n,o="undefined"!=typeof window?window:null;function i(t,n,e){if(o&&o.Ractive&&"object"==typeof o.Ractive[n]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var r=i.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(t,n){var e=n.split("="),o=e[0],i=e[1];return t[o]=i,t},{})),Ractive[n][r&&r[t]||t]=e}}}function r(t,n){var e=t.processParams(n,{duration:200,easing:"easeInOut"});return new Promise(function(n){requestAnimationFrame(function(){t.setStyle("overflow","hidden");var o="x"===e.axis?"width":"height";if(t.isIntro||e.intro){var i=t.getStyle(o);t.setStyle(o,0),t.setStyle("opacity",0),n(t.animateStyle(o,i,e).then(function(){return t.animateStyle("opacity",1,e)}).then(function(){t.setStyle(o,""),t.setStyle("overflow","")}))}else t.setStyle(o,t.getStyle(o)),t.setStyle("opacity",1),n(t.animateStyle("opacity",0,e).then(function(){return t.animateStyle(o,0,e)}))})})}i("expand","transitions",r);var s={timeout:6e3,top:!0,stack:!1};var a=function(t,n){this.holder=t,this.data=n},l={message:{configurable:!0},more:{configurable:!0},showMore:{configurable:!0},left:{configurable:!0},context:{configurable:!0},type:{configurable:!0},class:{configurable:!0},dismissable:{configurable:!0},closeButton:{configurable:!0},buttons:{configurable:!0},live:{configurable:!0},closed:{configurable:!0}};a.prototype.close=function(t){var n=this;return this.data.timeout=t,this.data===this.holder.active?(this.holder.tm&&clearTimeout(this.holder.tm),t?this.holder.tm=setTimeout(function(){n.data.close(),n.holder.tm=null},t):this.data.close()):t?this.data.timeout=t:this.data.close(),this.closed},a.prototype.cancelClose=function(){this.data===this.holder.active?(clearTimeout(this.holder.tm),this.holder.tm=null):this.data.timeout=0},a.prototype.updateButtons=function(){this.data.instance.update("_toast")},a.prototype.set=function(t,n){if("object"==typeof t){for(var e in t)this.data[e]=t[e];return this.data.instance.update("_toast")}return this.data[t]=n,this.data.instance.update("_toast")},l.message.get=function(){return this.data.message},l.message.set=function(t){this.data.message=t,this.data.instance.update("_toast")},l.more.get=function(){return this.data.more},l.more.set=function(t){this.data.more=t,this.data.instance.update("_toast")},l.showMore.get=function(){return this.data.showMore},l.showMore.set=function(t){this.data.showMore=t,this.data.instance.update("_toast")},l.left.get=function(){return this.data.left},l.left.set=function(t){this.data.left=t,this.data.right=!1,this.data.instance.update("_toast")},l.context.get=function(){return this.data.context},l.context.set=function(t){this.data.context=t,this.data.instance.update("_toast")},l.type.get=function(){return this.data.type},l.type.set=function(t){this.data.type=t,this.data.instance.update("_toast")},l.class.get=function(){return this.data.class},l.class.set=function(t){this.data.class=t,this.data.instance.update("_toast")},l.dismissable.get=function(){return this.data.dismissable},l.dismissable.set=function(t){this.data.dismissable=t,this.data.instance.update("_toast")},l.closeButton.get=function(){return this.data.closeButton},l.closeButton.set=function(t){this.data.closeButton=t,this.data.instance.update("_toast")},l.buttons.get=function(){return this.data.buttons},l.buttons.set=function(t){this.data.buttons=t,this.data.instance.update("_toast")},l.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)},l.closed.get=function(){var t=this;return this._promise||(this._promise=new Promise(function(n){t.data.onclose=n})),this._promise},Object.defineProperties(a.prototype,l);var c,f=16;function d(t){f=t}function u(){var t,n,e;!c&&window&&"document"in window&&"function"==typeof document.createElement&&((c=document.createElement("div")).setAttribute("style","position: absolute; left: -2em; width: 1em; height: 1em;"),t=c,n=function(){return d(c.getBoundingClientRect().width)},(e=document.createElement("object")).setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),e.setAttribute("tabindex","-1"),e.type="text/html",e.onload=function(){e.contentDocument.defaultView.addEventListener("resize",n),n()},/Trident/.test(navigator.userAgent)?(t.appendChild(e),e.data="about:blank"):(e.data="about:blank",t.appendChild(e)),window.addEventListener("resize",function(){u(),d(c.getBoundingClientRect().width)})),c&&!c.parent&&document.body.appendChild(c)}function h(t){return c||u(),"string"==typeof t&&(t=t.replace(/[^-.\d]/g,"")),+t/f}function w(t){return c||u(),"string"==typeof t&&(t=t.replace(/[^-.\d]/g,"")),+t*f}var m,g=e.escapeKey,p=function(t){function n(n){t.call(this,n)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n}(e);e.extendWith(p,{css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.window.primary"));return n.action=Object.assign({},t("raui.window.action"),t("raui.window.primary.action")),n.host=Object.assign({},t("raui.window.host"),t("raui.window.primary.host")),n.title=Object.assign({inactive:{}},t("raui.window.title"),t("raui.window.primary.title")),n.topmost=Object.assign({},t("raui.primary"),t("raui.window.primary"),t("raui.window.primary.topmost")),"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: "+(n.host.bg||n.bg||"#fff")+";\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n width: 100%;\n height: 100%;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(n.handleSize||7)+"px;\n }\n \n .rwindow-slide-left {\n height: 100%;\n left: 0;\n }\n .rwindow-slide-right {\n height: 100%;\n right: 0;\n }\n .rwindow-slide-top {\n width: 100%;\n top: 0;\n }\n .rwindow-slide-bottom {\n width: 100%;\n bottom: 0;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 "+(n.topmost.shadow||"rgba(0, 0, 0, 0.14)")+", 0 1px 18px 0 "+(n.topmost.shadow||"rgba(0, 0, 0, 0.12)")+", 0 3px 5px -1px "+(n.topmost.shadow||"rgba(0, 0, 0, 0.3)")+";\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n .rwindow-modal.rwindow-move {\n z-index: 50;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 "+(n.shadow||"rgba(0, 0, 0, 0.14)")+", 0 1px 5px 0 "+(n.shadow||"rgba(0, 0, 0, 0.12)")+", 0 3px 1px -2px "+(n.shadow||"rgba(0, 0, 0, 0.2)")+";\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(n.minWidth||"6em")+";\n min-height: "+(n.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(n.title.inactive.bg||n.fg||"#222")+";\n color: "+(n.title.inactive.fg||n.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n min-height: 2em;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(n.title.bg||n.fga||"#07e")+";\n color: "+(n.title.fg||n.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(n.action.bc||n.bc||"#ccc")+";\n background-color: "+(n.action.bg||n.bg||"#fff")+";\n color: "+(n.action.fg||n.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n cursor: default;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+("function"==typeof t("raui.window.extra")?t("raui.window.extra").call(this,t):"")+"\n "}.call(this,t)].join(" ")},cssId:"rwindow",noCssTransform:!0,delegate:!1,decorators:{tracked:function(t,n){return this[n]=t,{teardown:function(){this[n]===t&&(this[n]=null)}}}},transitions:{window:function(t,n){if(m)return t.complete();m=t;var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"";o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?(t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0}),setTimeout(function(){t.animateStyle({transform:"none",opacity:1},e).then(function(){t.setStyle("opacity",1),m=!1,t.complete(),o.style&&(o.style.overflow=i)})})):(t.setStyle({transform:"none",opacity:1}),t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},e).then(function(){m=!1,t.complete(),o.style&&(o.style.overflow=i)}))},slide:function(t,n){var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"",r=function(){t.complete(),o.style&&setTimeout(function(){return o.style.overflow=i})};o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?"top"===e.from?(t.setStyle({transform:"translateY(-100%)"}),t.animateStyle({transform:"translateY(0)"},e).then(r)):"bottom"===e.from?(t.setStyle({transform:"translateY(100%)"}),t.animateStyle({transform:"translateY(0)"},e).then(r)):"left"===e.from?(t.setStyle({transform:"translateX(-100%)"}),t.animateStyle({transform:"translateX(0)"},e).then(r)):"right"===e.from&&(t.setStyle({transform:"translateX(100%)"}),t.animateStyle({transform:"translateX(0)"},e).then(r)):"top"===e.from?(t.setStyle({transform:"translateY(0)"}),t.animateStyle({transform:"translateY(-100%)"},e).then(r)):"bottom"===e.from?(t.setStyle({transform:"translateY(0)"}),t.animateStyle({transform:"translateY(100%)"},e).then(r)):"left"===e.from?(t.setStyle({transform:"translateX(0)"}),t.animateStyle({transform:"translateX(-100%)"},e).then(r)):"right"===e.from&&(t.setStyle({transform:"translateX(0)"}),t.animateStyle({transform:"translateX(100%)"},e).then(r))}}});var b,x=0,y=function(t){function n(n){t.call(this,n),this.defaults={}}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var o={current:{configurable:!0},currentId:{configurable:!0},placement:{configurable:!0},topmost:{configurable:!0},windows:{configurable:!0}};return o.current.get=function(){var t=this.get("topLevel");return this.getWindow(this.get("windows."+g(t)+".id"))},o.currentId.get=function(){var t=this.get("topLevel");return this.get("windows."+g(t)+".id")},o.placement.get=function(){return this.get("placement")},o.placement.set=function(t){return this.set("placement",t)},o.topmost.get=function(){var t=this.get("windows");for(var n in t)if(t[n].topmost)return this.getWindow(t[n].id)},o.windows.get=function(){return Object.keys(this.get("windows"))},n.prototype.addWindow=function(t,n){var e=this,o=Object.assign({},this.defaults,t.constructor.prototype.options,t.options,t.get("options"),n);if(!(t instanceof k))throw new Error("Windows must be instances of Window");t.id||t.set("@.id",o.id||"window"+x++),this.get("windows."+g(t.id))||this.set("windows."+g(t.id),Object.assign({show:!1!==o.show,autosize:!0,id:t.id,blockers:[],close:!0,minimize:!0,maximize:!0,minWidth:"5em",minHeight:"5em"},o,{id:t.id})),t.host=this;var i,r=this.attachChild(t,{target:"window"});if(o.block&&("string"==typeof(i=o.block.id||o.block)&&i in this.get("windows")?(this.push("windows."+g(i)+".blockers",t.id),t.set("control.blocking",i)):i=!1),t.minSize(o.minWidth||"5em",o.minHeight||"5em"),o.slide);else if("fill"===o.size&&(i||o.block)){var s;!0===o.block?s=this.find(".rwhost-pane"):(s=this.getWindow(i))&&(s=s.find(".rwindow")),s&&(t.size(s.clientWidth-(o.fillPad||20),s.clientHeight-(o.fillPad||20)),!o.block||o.top||o.left||(o.top=o.left=Math.floor((o.fillPad||20)/2)))}else o.width&&o.height?t.size(o.width,o.height):t.size("auto");return o.slide||(o.top&&o.left?t.move(o.top,o.left):this.place(t)),this.raise(t,{show:!1!==o.show,parent:o.stickToParent}),t.on("close",function(){var n=t.get("control.blocking");if(n){var o=e.windowGet(n,"blockers")||[];e.splice("windows."+g(n)+".blockers",o.indexOf(t.id),1)}e.detachChild(t).then(function(){return t.teardown()}),e.set("windows."+g(t.id)+".block",!1),e.set("windows."+g(t.id)+".index",-1),e.raise(),e.set("windows."+g(t.id),void 0),delete e.get("windows")[t.id]}),this.update("windows."+g(t.id)+".id",{force:!0}),this.fire("add",{},{window:t,options:o}),r.then(function(){return t})},n.prototype.getWindow=function(t){return this.children.byName.window&&this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0]},n.prototype.windowGet=function(t,n){return this.get("windows."+g(t)+"."+n)},n.prototype.windowSet=function(t,n,e){return this.set("windows."+g(t)+"."+n,e)},n.prototype.raise=function(t,n){var e=this;void 0===n&&(n={});var o=t instanceof k?t:this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0],i=this.get("windows",{virtual:!1}),r=Object.keys(i).map(function(t){return i[t]}),s=2*(r.length+1),a=this.get("topLevel"),l=(this.get("blocked"),o?o.get("control.id"):r.reduce(function(t,n){return t?n.index>t.index?n:t:n},null));function c(t){t.blockers&&t.blockers.forEach(function(n,e){var o=r.find(function(t){return t.id===n});o&&(o.index=t.index+e+1,c(o))})}if(!o&&l&&(o=this.children.byName.window.find(function(t){return t.instance.id===l})),o){var f=o.get("control");f.index=!1===n.show?-1:s,c(f),f.blocking&&function t(n,e){n&&(n.index=e--,n.blocking&&t(r.find(function(t){return t.id===n.blocking}),e),c(n))}(r.find(function(t){return t.id===f.blocking}),s-1),!1===n.show||f.show||o.show()}r.filter(function(t){return!1!==t.show&&!0===t.block}).forEach(function(t){e.set("windows."+g(t.id)+".index",(t.index||0)+s),c(t)});var d=r.sort(function(t,n){return t.show?n.show&&t.index<n.index?-1:1:-1}),u=d.filter(function(t){return t.show});s=d.indexOf(u[u.length-1]);var h={},w=null;if(d.forEach(function(t,n){var e=g(t.id);!0===t.block&&null===w&&(w=n),h["windows."+e+".index"]=t.index=null!==w?n+2:n,h["windows."+e+".topmost"]=n===s,h["windows."+e+".stack"]=d.length-n}),h.blocked=null!==w?w+1:0,~s&&d.length?h.topLevel=d[s].id:h.topLevel=null,this.set(h),(s=h.topLevel)&&s!==a&&this.get("currentMax")&&this.rendered){var m=this.get("windows."+g(a));o=this.getWindow(s);var p=this.get("transition");!1===p||o.get("control.slide")||m&&(m.dialog||m.slide||m.blocking&&(!m.blocking||m.blocking===s))||o.transition(p||"window",o.find("div"),{intro:!0})}if(this.fire("raise",{},{top:this.topmost}),a!==this.get("topLevel")){var b=this.current;b&&b.fire("raise",{},{last:this.getWindow(a)})}},n.prototype.place=function(t){var n=this;return t.get("control.show")?new Promise(function(e){requestAnimationFrame(function(){var o=t.get("control");void 0!==o.width||o.dialog||t.size("auto");var i=0,r=0;if(n.fragment&&n.fragment.rendered){var s=n.find(".rwhost"),a=s.clientWidth,l=s.clientHeight,c=o.width,f=o.height;!o.dialog||o.size&&"auto"!==o.size&&o.width&&o.height||(c=h(t.pane.clientWidth),f=h(t.pane.clientHeight));var d=o.blocking;if(d){var u="windows."+g(d),m=n.get(u),p=o.max||!o.dialog&&(n.get("max")||n.get("userMax")),b=m.max||n.get("userMax")||n.get("max"),x=b?n.host.clientWidth:w(m.width+"em"),y=b?n.host.clientHeight:w(m.height+"em"),z=b?0:m.left,k=b?0:m.top;i=(p?a:x/2)+(p?0:z)-w(c)/2,r=(p?l:y/2)+(p?0:k)-w(f)/2}else{var S,W=n.get("placement");if("function"==typeof W)try{S=W(n,s,o)}catch(t){S=v(n,s,o)}else if("string"==typeof W)switch(W){case"smart":S=_(n,s,o);break;default:S=v(n,s,o)}else S=v(n,s,o);r=S.top,i=S.left}(isNaN(i)||i<0)&&(i=10),(isNaN(r)||r<0)&&(r=10),t.set({"control.top":r,"control.left":i}),e()}})}):Promise.resolve()},n.prototype.placeAll=function(){var t=this;if(this.fragment&&this.fragment.rendered){var n=Object.keys(this.get("windows")||{}).filter(function(n){return t.get("windows."+e.escapeKey(n)+".show")}),o=this.find(".rwhost");return new Promise(function(e){requestAnimationFrame(function(){for(var i,r=o.clientWidth,s=o.clientHeight;i=n[0];){var a=t.getWindow(i),l=a.get("control");void 0!==l.width||l.dialog||a.size("auto");var c=0,f=0,d=l.width,u=l.height;!l.dialog||l.size&&"auto"!==l.size&&l.width&&l.height||(d=h(a.pane.clientWidth),u=h(a.pane.clientHeight));var m=l.blocking;if(m){var p="windows."+g(m),b=t.get(p),x=l.max||!l.dialog&&(t.get("max")||t.get("userMax")),y=b.max||t.get("userMax")||t.get("max"),z=y?t.host.clientWidth:w(b.width+"em"),k=y?t.host.clientHeight:w(b.height+"em"),S=y?0:b.left,W=y?0:b.top;c=(x?r:z/2)+(x?0:S)-w(d)/2,f=(x?s:k/2)+(x?0:W)-w(u)/2}else{var M=t.get("placement"),T=void 0;if("function"==typeof M)try{T=M(t,o,l,n)}catch(n){T=v(t,o,l)}else if("string"==typeof M)switch(M){case"smart":T=_(t,o,l,n);break;default:T=v(t,o,l)}else T=v(t,o,l);f=T.top,c=T.left}(isNaN(c)||c<0)&&(c=10),(isNaN(f)||f<0)&&(f=10),a.set({"control.top":f,"control.left":c}),n.shift()}e()})})}},Object.defineProperties(n.prototype,o),n}(p);function v(t,n,e){var o=n.clientWidth,i=n.clientHeight,r=0,s=0,a=void 0===t._grid1?t._grid1=0:t._grid1>7?t._grid1=0:++t._grid1,l=Math.floor(o/3),c=Math.floor(i/3),f=w(e.width),d=w(e.height+"em");switch(a){case 5:case 7:case 8:r=i-d-10;break;case 2:case 4:case 6:r=c+Math.floor((c-d)/2);break;case 0:case 1:case 3:r=10}switch(a){case 3:case 6:case 8:s=o-f-10;break;case 1:case 4:case 7:s=l+Math.floor((l-f)/2);break;case 0:case 2:case 5:s=10}return s+f>o&&(s=o-f-10),r+d>i&&(r=i-d-10),{top:r,left:s}}function _(t,n,e,o){var i,r,s=n.clientWidth-10,a=n.clientHeight-10,l=Math.floor(a/16),c=Math.floor(s/16),f=new Array(l*c),d=new Array(l*c);for(i=0;i<f.length;i++)f[i]=0;var u,h,m,g,p,b,x,y,v=0,_=t.get("windows");for(var z in _)if(!o||!~o.indexOf(z))for(v++,u=_[z],h=Math.floor(u.top/16),m=Math.floor(u.left/16),p=Math.ceil(w(u.height)/16),g=Math.ceil(w(u.width)/16),i=h;i<h+p&&i<l;i++)for(r=m;r<m+g&&r<c;r++)f[i*c+r]++;for(g=Math.ceil(w(e.width)/16),p=Math.ceil(w(e.height)/16),i=0;i<l;i++)for(r=0;r<c;r++){if(i+p>l||r+g>c)b=v*g*p;else for(b=0,x=0;x<p;x++)for(y=0;y<g;y++)b+=f[(i+x)*c+r+y];if(0===b)return{top:16*i+5,left:16*r+5};d[i*c+r]=b}for(b=v*g*p,x=0,i=0;i<d.length;i++)d[i]<b&&(b=d[i],x=i);return{top:16*Math.floor(x/c)+5,left:x%c*16+5}}p.extendWith(y,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"moving",f:[{t:2,r:"~/moving"}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},"{t:_0}":function(t){return{t:t}},"_0&&_1":function(t,n){return t&&n},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(t,n){return[t.getWindow(n).hide()]},"!_0&&_1":function(t,n){return!t&&n},"[_0.getWindow(_1).maximize()]":function(t,n){return[t.getWindow(n).maximize()]},"!_0&&_1&&_2":function(t,n,e){return!t&&n&&e},"[_0.getWindow(_1).close()]":function(t,n){return[t.getWindow(n).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(t){return[t.hide()]},"[_0.maximize()]":function(t){return[t.maximize()]},"[_0.close()]":function(t){return[t.close()]},"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6":function(t,n,e,o,i,r,s){return!((t||n||e)&&o&&!i||r||s)},'["content"]':function(){return["content"]},"!_0":function(t){return!t},"[_0.call(_1)]":function(t,n){return[t.call(n)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(t){return!1!==t},"_0||_1":function(t,n){return t||n},"(_0||_1||_2)&&!_3&&!_4":function(t,n,e,o,i){return(t||n||e)&&!o&&!i},"[{from:_0}]":function(t){return[{from:t}]},"[_0._startResize(_1)]":function(t,n){return[t._startResize(n)]},"[_0._sizeHandle(_1)]":function(t,n){return[t._sizeHandle(n)]},"[_0._startMove(_1)]":function(t,n){return[t._startMove(n)]},"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5":function(t,n,e,o,i,r){return!(!1===i||(t||n)&&!o||e||o&&!0!==i||r)},"[_0.raise()]":function(t){return[t.raise()]},'["pane"]':function(){return["pane"]},"_0&&!_1":function(t,n){return t&&!n}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,x:{r:["window.dialog","window.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{t:4,f:[" ",{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[function(t){void 0===t&&(t={});var n=function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.toast.primary"));return"\n .rtoast-wrapper {\n position: absolute;\n display: flex;\n flex-direction: column;\n flex-wrap: no-wrap;\n align-items: center;\n overflow: hidden;\n top: 0.8em;\n left: 0.8em;\n right: 0.8em;\n bottom: auto;\n z-index: 5;\n pointer-events: none;\n overflow: auto;\n max-height: 80%;\n }\n .rtoast {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n margin: 0.2em;\n }\n .rtoast-message {\n flex-grow: 2;\n display: flex;\n align-items: center;\n }\n .rtoast-string {\n white-space: pre-wrap;\n line-height: 1.3em;\n padding-top: 0.3em;\n }\n .rtoast-upper .rtoast-string {\n \n }\n .rtoast-expand .rtoast-string {\n padding-top: 0.5em;\n }\n .rtoast-buttons {\n display: flex;\n padding-left: 0.5em;\n flex-shrink: 1;\n align-items: center;\n max-height: max-content;\n margin-left: auto;\n }\n .rtoast-buttons button {\n cursor: pointer;\n }\n .rtoast-button {\n background-color: transparent;\n border: none;\n color: inherit;\n padding: 0.5em 0.75em;\n margin: 0 0 0 0.5em;\n line-height: 1em;\n box-shadow: none;\n }\n .rtoast-more {\n cursor: pointer;\n width: 2em;\n position: relative;\n flex-shrink: 2;\n background-color: transparent;\n border: none;\n color: inherit;\n margin: 0 0 0 0.5em;\n height: 2em;\n }\n .rtoast-more:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n height: 0.6em;\n top: calc(50% - 0.55em);\n left: calc(50% - 0.3em);\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;\n pointer-events: none;\n }\n .rtoast-expanded .rtoast-more:after {\n transform: rotate(225deg);\n top: calc(50% - 0.1em);\n }\n .rtoast-bottom {\n bottom: 0.8em;\n top: auto;\n }\n .rtoast-left {\n align-items: flex-start;\n }\n .rtoast-right {\n align-items: flex-end;\n }\n .rtoast-body {\n border-radius: 0.2em;\n padding: 1em;\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0.95;\n pointer-events: all;\n transition: color 0.5s ease-in-out, background 0.5s ease-in-out;\n flex-shrink: 1;\n display: flex;\n flex-direction: column;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: nowrap;\n justify-content: space-between;\n }\n \n .rtoast-expand {\n padding-top: 1em;\n }\n \n .rtoast-expand .rtoast-string {\n max-height: 15em;\n overflow: auto;\n border-radius: 0.2em;\n padding: 0.5em;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n overflow: auto;\n }\n \n .rtoast-success {\n color: "+(t("raui.toast.success.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.success.bg")||"#4caf50")+";\n }\n .rtoast-info {\n color: "+(t("raui.toast.info.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.info.bg")||"#07e")+";\n }\n .rtoast-warn {\n color: "+(t("raui.toast.warn.fg")||"#222")+";\n background-color: "+(t("raui.warn.success.bg")||"#ffc107")+";\n }\n .rtoast-error {\n color: "+(t("raui.toast.error.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.error.bg")||"#ff5252")+";\n }\n "}.call(this,t)].join(" ")},e={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-wrapper",g:1},{n:"class-rtoast-bottom",t:13,f:[{t:2,r:"@this.toastDefaults.bottom"}]},{n:"class-rtoast-left",t:13,f:[{t:2,r:"@this.toastDefaults.left"}]},{n:"class-rtoast-right",t:13,f:[{t:2,r:"@this.toastDefaults.right"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast",g:1},{n:"class-rtoast-expanded",t:13,f:[{t:2,r:".showMore"}]}],f:[{t:7,e:"div",m:[{n:"toast",t:72,v:"t0"},{n:"class",f:["rtoast-body",{t:4,f:[" rtoast-",{t:2,r:".type"}],n:50,r:".type"},{t:4,f:[{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.close()]"}}],n:50,x:{r:[".dismissable"],s:"_0!==false"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-upper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-message",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".message",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".message"}],n:51,l:1}],n:50,x:{r:[".message"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".message"}]}],n:51,l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-buttons",g:1}],f:[{t:4,f:[{t:7,e:"button",m:[{n:"class",f:["rtoast-button",{t:4,f:[" ",{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.action()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}}],f:[{t:2,r:".label"}]}],n:52,r:".buttons"},{t:4,f:[{t:7,e:"button",m:[{t:13,n:"class",f:"rtoast-button",g:1}],f:["Close"]}],n:50,x:{r:[".dismissable",".closeButton"],s:"_0!==false&&_1!==false"},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-more",g:1},{n:"title",f:"Toggle more",t:13,g:1},{n:["click"],t:70,f:{r:[".","@context"],s:'[_0.expand(),(_1).toggle(".showMore"),false]'}}]}],n:50,r:".more"}]}],n:50,x:{r:[".dismissable",".closeButton",".buttons.length",".more"],s:"(_0!==false&&_1!==false)||_2||_3"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-expand",g:1},{n:"toast-expand",t:72,v:"t0"},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:4,f:[{t:4,f:[{t:8,r:".more",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".more"}],n:51,l:1}],n:50,x:{r:[".more"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".more"}]}],n:51,l:1}]}],n:50,x:{r:[".more",".showMore"],s:"_0&&_1"}}]}]}],n:52,z:[{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/_toast"}]}],n:50,r:"~/_toast"}],e:{"[_0.close()]":function(t){return[t.close()]},"_0!==false":function(t){return!1!==t},"!!_0":function(t){return!!t},"Array.isArray(_0)":function(t){return Array.isArray(t)},"[_0.action()]":function(t){return[t.action()]},'typeof _0==="function"':function(t){return"function"==typeof t},"_0!==false&&_1!==false":function(t,n){return!1!==t&&!1!==n},'[_0.expand(),(_1).toggle(".showMore"),false]':function(t,n){return[t.expand(),n.toggle(".showMore"),!1]},"(_0!==false&&_1!==false)||_2||_3":function(t,n,e,o){return!1!==t&&!1!==n||e||o},"[false,false]":function(){return[!1,!1]},"_0&&_1":function(t,n){return t&&n},true:function(){return!0}}};return function(o){var i=o.Ractive,r=o.instance,l=o.proto;r.partials[t.name||"toast"]=e;var c,f=Object.assign({},s,t),d=[],u={toasts:d};function h(n,e){var o=Object.assign(t,e.toastDefaults);if(c!==n)d.splice(d.indexOf(n),1),e.set("_toast",c?o.stack?[c].concat(d):[c]:null).then(function(){"function"==typeof n.onclose&&n.onclose()});else{u.tm&&(clearTimeout(u.tm),u.tm=null);var i=d.shift();e.shift("_toast").then(function(){e.set("_toast",i?o.stack?[i].concat(d):[i]:null).then(function(){e&&e.fire("toasted",null,n),"function"==typeof n.onclose&&n.onclose(),u.active=c=i,c&&c.timeout&&!c.showMore&&(u.tm&&clearTimeout(u.tm),u.tm=setTimeout(function(){c.close(),u.tm=null},c.timeout))})})}}if(Object.defineProperty(l,"toastDefaults",{value:f,writable:!1,configurable:!0}),l.toast=function(t,n){var e=this;delete n.top,delete n.bottom,delete n.left,delete n.right;var o,i=Object.assign({message:t,instance:this},f,this.toastDefaults,n);return i.close=function(){return h(i,e)},i.expand=function(){(i.stack||u.active===i)&&(u.tm&&(clearTimeout(u.tm),u.tm=null),i.showMore&&i.timeout&&(u.tm=setTimeout(function(){i.close(),u.tm=null},i.timeout)))},d.push(i),c&&!i.stack||(o=i.stack,c||(u.active=c=d.shift()),c.instance.set("_toast",o?[c].concat(d):[c]).then(function(){c.timeout&&!c.showMore&&(u.tm&&clearTimeout(u.tm),u.tm=setTimeout(function(){c.close(),u.tm=null},c.timeout))})),new a(u,i)},l.on=l.on||{},r.transitions.toast=function(t,n){var e=t.processParams({duration:200},n),o=t.getStyle("opacity");return t.isIntro?(t.setStyle({opacity:0,transform:"translateY("+(c.bottom?"":"-")+"1em)"}),t.animateStyle({opacity:o,transform:"none"},e)):(t.setStyle({opacity:o,transform:"none"}),t.animateStyle({opacity:0,transform:"translateY("+(c.bottom?"":"-")+"1em)"},e))},r.transitions["toast-expand"]=function(t,n){var e=t.processParams({duration:200,nested:!1},n);if(t.isIntro){var o=t.getStyle("height"),i=t.getStyle("width");return t.setStyle("height",0),t.setStyle("width",0),t.animateStyle("width",i,e).then(function(){return t.animateStyle("height",o,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})}var r=t.getStyle("height");return t.setStyle("height",r),t.setStyle("width",t.getStyle("width")),t.animateStyle("height",0,e).then(function(){return t.animateStyle("width",0,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})},l.on["close-toast"]=function(){c&&c.close()},r===i||i.isInstance(r))i.hasCSS("toast-css")||i.addCSS("toast",n);else{var w=r.css;r.css=function(t){var e="";return"string"==typeof w?e+=w:"function"==typeof w&&(e+=w(t)),n(t)+e}}return l}}(),(void 0===b&&(b={}),function(t){t.instance.transitions[b.name||"expand"]=r})],cssId:"window-host",noIntro:!0,attributes:["placement","windows","transition"],observe:{"@style.raui.window.maxFrom":function(){var t;(t=this)._media?t._media.fn():(t._media={},t._media.fn=function(){if(t.host){var n=w(t.get("@style.raui.window.maxFrom")),e=t.transitionsEnabled;t.transitionsEnabled=!1,t.set("max",t.host.clientWidth<=n),t.set("dimensions",{clientWidth:t.host.clientWidth,clientHeight:t.host.clientHeight}),t.transitionsEnabled=e}},t._media.handle=t.root.on("*.resize",t._media.fn),setTimeout(t._media.fn))},topLevel:function(t){t?this.link("windows."+g(t),"current"):this.unlink("current")},currentMax:{handler:function(t){(this.children.byName.window||[]).forEach(function(t){return t.instance.fire("resize")})},defer:!0}},computed:{currentMax:function(){var t=this.get("topLevel"),n=this.get("windows."+g(t)+".max");return this.get("userMax")||this.get("max")||n}},on:{config:function(){var t,n=this,e=this.partials.content;if(e&&Array.isArray(e))for(var o=(e=this.partials.content=e.slice()).length;o--;){var i=e[o];"max-top"===i.e&&(e.splice(o,1),this.set({_maxP:{t:i.f},hideTitleMax:!0}),i.m&&this.set({_maxAttrsP:{t:i.m}}))}"undefined"!=typeof window&&(this._resizeListener=function(){t||(t=setTimeout(function(){t=null,n.fire("resize")},300))},window.addEventListener("resize",this._resizeListener))},teardown:function(){this._resizeListener&&window.removeEventListener("resize",this._resizeListener)}}}),e.transitions.modal=function(t,n){var e,o=t.processParams(n,{duration:400,easing:"easeOut",x:0,y:-50,event:!0}),i=t.node.offsetLeft,r=t.node.offsetTop,s=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(t.node._modalSrc){var a=t.node._modalSrc||{x:i+o.x,y:r+o.y},l={x:a.x-Math.round(t.node.clientWidth/2)-i,y:a.y-Math.round(t.node.clientHeight/2)-r};t.node.parentNode.style&&(t.node.parentNode.style.overflow="hidden"),t.isIntro?(t.node._modalSrc=a,e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+l.x+"px, "+l.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+l.x+"px, "+l.y+"px) scale(0.5, 0.5)",opacity:0}}else t.isIntro?(e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0};t.animateStyle(e,o).then(function(){t.node.parentNode.style&&(t.node.parentNode.style.overflow=s),t.complete()})};var z=["mousemove","mouseup","touchmove","touchend"],k=function(t){function n(n){t.call(this,n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={resizable:{configurable:!0},title:{configurable:!0},visible:{configurable:!0},pad:{configurable:!0},buttons:{configurable:!0},blocked:{configurable:!0},result:{configurable:!0}};return e.resizable.get=function(){return this.get("control.resizable")},e.resizable.set=function(t){return this.set("control.resizable",t)},e.title.get=function(){return this.get("control.title")},e.title.set=function(t){return this.set("control.title",t)},e.visible.get=function(){return this.get("control.show")},e.visible.set=function(t){if(t)this.show();else{if(this.get("control.show"))try{this.fire("hide")}catch(t){}this.set("control.show",t,{keep:!0})}this.host.raise(this,{show:t})},e.pad.get=function(){return this.get("pad")},e.pad.set=function(t){this.set("pad",t)},e.buttons.get=function(){return this.get("buttons")},e.buttons.set=function(t){return this.set("buttons",t)},e.blocked.get=function(){return this.get("control.blocked")},e.blocked.set=function(t){return this.set("control.blocked",t)},e.result.get=function(){var t=this;return this._result||(this._result={},this._result.promise=new Promise(function(n){t._result.ok=n})),this._result.promise},n.prototype.setResult=function(t){this.result,this._result.value=t},n.prototype.close=function(t,n){if(!0!==t){if(!this.parent)return!1;if(this.get("control.blockers.length"))return!1;if("function"==typeof this.beforeClose&&!1===this.beforeClose())return!1;if(!1===this.fire("beforeClose"))return!1}return this.fire("close"),this._result&&this._result.ok(this._result.value||n),!0},n.prototype.maximize=function(){this.toggle("root.userMax")},n.prototype.hide=function(){this.visible=!1},n.prototype.raise=function(t){this.host.raise(this,{show:t})},n.prototype.show=function(){var t=this.get("control.show");if(this.set("control.show",!0),void 0===this.get("control.top")&&this.host.place(this),!t)try{this.fire("show")}catch(t){}},n.prototype.size=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(!e.visible)return"number"==typeof t&&"number"==typeof n&&e.set({"control.width":h(t),"control.height":h(n),"control.naturalWidth":h(t),"control.naturalHeight":h(n),"control.autosize":!1}),o();var i=e.wrapper;if(!i)return o();if("auto"===t){e.set("control.autosize",!0);var r=Math.ceil(h(i.clientWidth+16)),s=Math.ceil(h(i.clientHeight+8));e.set({"control.width":r,"control.height":s,"control.naturalWidth":r,"control.naturalHeight":s,"control.autosize":!1})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.width":h(t),"control.height":h(n),"control.naturalWidth":h(t),"control.naturalHeight":h(n),"control.autosize":!1});else if("string"==typeof t&&"string"==typeof n){var a=i.style.width,l=i.style.height;i.style.width=t,i.style.height=n;var c=i.clientWidth,f=i.clientHeight;i.style.width=a,i.style.height=l,e.set({"control.width":h(c),"control.height":h(f),"control.naturalWidth":h(c),"control.naturalHeight":h(f),"control.autosize":!1})}var d=e.host.host;if(d){var u=h(d.clientWidth-16),w=h(d.clientHeight-16);e.get("control.width")>u&&e.set("control.width",u),e.get("control.height")>w&&e.set("control.height",w)}var m=e.get("control.minWidth")||5,g=e.get("control.minHeight")||5;e.get("control.width")<m&&e.set("control.width",m),e.get("control.height")<g&&e.set("control.height",g),e.fire("resize"),o()})})},n.prototype.minSize=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(!e.visible)return"number"==typeof t&&"number"==typeof n&&e.set({"control.minWidth":h(t),"control.minHeight":h(n)}),o();var i=e.wrapper;if(!i)return o();if("auto"===t){var r=e.get("control.autosize");e.set("control.autosize",!0);var s=h(i.clientWidth+16),a=h(i.clientHeight);e.set({"control.minWidth":s,"control.minHeight":a,"control.autosize":r})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.minWidth":h(t),"control.minHeight":h(n)});else if("string"==typeof t&&"string"==typeof n){var l=i.style.width,c=i.style.height;i.style.width=t,i.style.height=n;var f=i.clientWidth,d=i.clientHeight;i.style.width=l,i.style.height=c,e.set({"control.minWidth":h(f),"control.minHeight":h(d)})}o()})})},n.prototype.move=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){"center"===t?t=e.host.modalPane.clientHeight/2-e.wrapper.clientHeight/2:"string"==typeof t&&(t=h(t)),"center"===n&&(n=e.host.modalPane.clientWidth/2-e.wrapper.clientWidth/2),"string"==typeof n&&(n=h(n));var i={};"number"==typeof t&&(i["control.top"]=t),"number"==typeof n&&(i["control.left"]=n),e.set(i),o()})})},n.prototype._startMove=function(t){var n=this;if("mousedown"!==t.type||0===t.button){if(this.get("control.topmost")||this.raise(),~t.type.indexOf("mouse")){if(!this.top||!t.ctrlKey&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return}else if(t.targetTouches&&1===t.targetTouches.length&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return;this.set("moving",!0);var e=this.pane,o=e.style.cursor;e.style.cursor="move",e.style.userSelect="none";var i=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,r=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,s=this.get("control.left")||0,a=this.get("control.top")||0,l=e.clientWidth,c=e.clientHeight,f=function(t){var d=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,u=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,h=s+(d-i),w=a+(u-r);h<(l<30?0:30-l)&&(h=l<30?0:30-l),w<(c<30?0:30-c)&&(w=c<30?0:30-c),h<0&&(h=0),w<0&&(w=0),n.set({"control.top":w,"control.left":h}),"touchend"===t.type||"mouseup"===t.type?(z.forEach(function(t){return document.removeEventListener(t,f,{passive:!1})}),e.style.cursor=o,e.style.userSelect="",n.set("moving",!1)):t.preventDefault()};return z.forEach(function(t){return document.addEventListener(t,f,{passive:!1})}),0!==t.type.indexOf("mouse")&&void 0}},n.prototype._startResize=function(t){var n=this;if(t.target===this.wrapper&&("mousedown"!==t.type||0===t.button)){this.get("control.autosize")&&this.size("auto"),this.get("control.topmost")||this.raise(),this.set("control.resizing",!0),this.set("moving",!0);var e,o=this.wrapper,i=t.offsetX||t.targetTouches&&t.targetTouches[0].pageX-o.getBoundingClientRect().left,r=t.offsetY||t.targetTouches&&t.targetTouches[0].pageY-o.getBoundingClientRect().top,s=this.get("@style.window.handleSize")||7,a=o.clientWidth-2*s,l=o.clientHeight-2*s,c=2*s,f=i<=c||i>=a,d=r<=c||r>=l,u=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,m=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,g=this.get("control.left")||0,p=this.get("control.top")||0,b=w(this.get("control.width")),x=w(this.get("control.height")),y=w(this.get("control.minHeight")),v=w(this.get("control.minWidth")),_=function(t){t.preventDefault();var o=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,a=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,l=f?o-u:0,c=d?a-m:0,w={};r<=s?(w["control.top"]=p+c,w["control.height"]=x-c):w["control.height"]=x+c,i<=s?(w["control.left"]=g+l,w["control.width"]=b-l):w["control.width"]=b+l,w["control.width"]<v&&(delete w["control.width"],delete w["control.left"]),w["control.height"]<y&&(delete w["control.height"],delete w["control.top"]),w["control.left"]<0&&(w["control.left"]=0),w["control.top"]<0&&(w["control.top"]=0),w["control.width"]&&(w["control.width"]=h(w["control.width"])),w["control.height"]&&(w["control.height"]=h(w["control.height"])),n.set(w),"touchend"===t.type||"mouseup"===t.type?(z.forEach(function(t){return document.removeEventListener(t,_,{passive:!1})}),n.set("control.resizing",!1),n.set("moving",!1),b===n.get("control.width")&&x===n.get("control.height")||(e&&clearTimeout(e),e=null,n.fire("resize"))):e||(e=setTimeout(function(){n.fire("resize"),e=null},200))};return z.forEach(function(t){return document.addEventListener(t,_,{passive:!1})}),!1}},n.prototype._sizeHandle=function(t){if(t.target===this.wrapper){var n=this.wrapper;if("mouseout"===t.type)return n.style.cursor="auto";var e=t.offsetX,o=t.offsetY,i=this.get("@style.window.handleSize")||7,r=n.clientWidth-i,s=n.clientHeight-i,a=n.style;a.cursor=e<=i+i&&o<=i+i||e>=r-i&&o>=s-i?"nwse-resize":e>=r-i&&o<=i+i||e<=i+i&&o>=s-i?"nesw-resize":(e<=i||e>=r)&&(o<s||o>i)?"ew-resize":(o<=i||o>=s)&&(e<r||e>i)?"ns-resize":"auto"}},Object.defineProperties(n.prototype,e),n}(p),S=["left","right","center","condition"];function W(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"host"]=y}}p.extendWith(k,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{t:4,f:[" ",{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],contents:"",status:""},data:function(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"left"===t.where})},centerButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"center"===t.where})},rightButtons:function(){return(this.get("buttons")||[]).filter(function(t){return!t.where||"right"===t.where})}},decorators:{button:function(t){var n=this.getContext(t);return n.add("visibleButtons"),{update:function(){},teardown:function(){n.subtract("visibleButtons")}}}},on:{config:function(){var t=k.prototype.template,n=this.template;"string"!=typeof t&&!Array.isArray(t)&&t.t&&(t=t.t),"string"!=typeof n&&!Array.isArray(n)&&n.t&&(n=n.t),t!==n&&(this.partials.hasOwnProperty("contents")||(this.partials.contents=n),this.template=t)},construct:function(){var t=this.constructor;if(!t._constructed){t._constructed=1;var n=t.prototype.template.t.slice(),e=n.find(function(t){return"buttons"===t.e});function o(t){var n=t.m||[],e={partial:{t:[{t:t.t,e:t.e,f:t.f,m:n.filter(function(t){return!~S.indexOf(t.n)})}]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"};return e.partial.t[0].m.push({t:71,n:"button"}),e}t.prototype.template.t=n.filter(function(t){return"buttons"!==t.e}),e&&(t._btns=e.f.filter(function(t){return"button"===t.e||"not-button"===t.e||4===t.t&&(50===t.n||51===t.n)&&t.f.find(function(t){return"button"===t.e||"not-button"===t.e})}).map(function(t){if(4===t.t)return t.f.filter(function(t){return"button"===t.e||"not-button"===t.e}).map(function(n){var e=n.m||[],i="button"===n.e?o(n):{partial:{t:n.f||[]},where:e.find(function(t){return"left"===t.n})?"left":e.find(function(t){return"center"===t.n})?"center":"right"},r={t:t.t,n:t.n,f:[i.partial.t[0]]};return t.r&&(r.r=t.r),t.rx&&(r.rx=t.rx),t.x&&(r.x=t.x),i.partial={t:[r]},i});if("not-button"===t.e){var n=t.m||[];return[{partial:{t:t.f||[]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"}]}return[o(t)]}).reduce(function(t,n){return t.concat(n)},[]))}},init:function(){var t=this.constructor;t._btns&&!this.get("buttons.length")&&this.set("buttons",t._btns)}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function(t,n,e){if(this.get("control.id")){var o=this.get("control.max")||this.get("root.userMax")||this.get("root.max"),i=this.get("control.actual")||{};if(o)if(i.max)~e.indexOf("client")&&"number"==typeof t&&(~e.indexOf("Width")?this.set("control.actual.width",h(t)):~e.indexOf("Height")&&this.set("control.actual.height",h(t)));else{this.wrapper;this.wrapper&&this.set("control.actual",{width:h(this.wrapper.clientWidth),height:h(this.wrapper.clientHeight),max:o})}else"number"==typeof t&&(~e.indexOf("width")?this.set("control.actual.width",t):~e.indexOf("height")&&this.set("control.actual.height",t)),i.max&&this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:o}),this.set("control.actual.max",!1)}},init:!1,defer:!0}}}),i("RauiWindowHost","components",y),i("RauiWindow","components",k),y.prototype.Window=k,t.Base=p,t.Host=y,t.Window=k,t.plugin=W,t.default=W,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RauiWindow={},t.Ractive)}(this,function(t,n){"use strict";var e="default"in n?n.default:n,o="undefined"!=typeof window?window:null;function i(t,n,e){if(o&&o.Ractive&&"object"==typeof o.Ractive[n]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var r=i.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(t,n){var e=n.split("="),o=e[0],i=e[1];return t[o]=i,t},{})),Ractive[n][r&&r[t]||t]=e}}}function r(t,n){var e=t.processParams(n,{duration:200,easing:"easeInOut"});return new Promise(function(n){requestAnimationFrame(function(){t.setStyle("overflow","hidden");var o="x"===e.axis?"width":"height";if(t.isIntro||e.intro){var i=t.getStyle(o);t.setStyle(o,0),t.setStyle("opacity",0),n(t.animateStyle(o,i,e).then(function(){return t.animateStyle("opacity",1,e)}).then(function(){t.setStyle(o,""),t.setStyle("overflow","")}))}else t.setStyle(o,t.getStyle(o)),t.setStyle("opacity",1),n(t.animateStyle("opacity",0,e).then(function(){return t.animateStyle(o,0,e)}))})})}i("expand","transitions",r);var s={timeout:6e3,top:!0,stack:!1};var a=function(t,n){this.holder=t,this.data=n},l={message:{configurable:!0},more:{configurable:!0},showMore:{configurable:!0},left:{configurable:!0},context:{configurable:!0},type:{configurable:!0},class:{configurable:!0},dismissable:{configurable:!0},closeButton:{configurable:!0},buttons:{configurable:!0},live:{configurable:!0},closed:{configurable:!0}};a.prototype.close=function(t){var n=this;return this.data.timeout=t,this.data===this.holder.active?(this.holder.tm&&clearTimeout(this.holder.tm),t?this.holder.tm=setTimeout(function(){n.data.close(),n.holder.tm=null},t):this.data.close()):t?this.data.timeout=t:this.data.close(),this.closed},a.prototype.cancelClose=function(){this.data===this.holder.active?(clearTimeout(this.holder.tm),this.holder.tm=null):this.data.timeout=0},a.prototype.updateButtons=function(){this.data.instance.update("_toast")},a.prototype.set=function(t,n){if("object"==typeof t){for(var e in t)this.data[e]=t[e];return this.data.instance.update("_toast")}return this.data[t]=n,this.data.instance.update("_toast")},l.message.get=function(){return this.data.message},l.message.set=function(t){this.data.message=t,this.data.instance.update("_toast")},l.more.get=function(){return this.data.more},l.more.set=function(t){this.data.more=t,this.data.instance.update("_toast")},l.showMore.get=function(){return this.data.showMore},l.showMore.set=function(t){this.data.showMore=t,this.data.instance.update("_toast")},l.left.get=function(){return this.data.left},l.left.set=function(t){this.data.left=t,this.data.right=!1,this.data.instance.update("_toast")},l.context.get=function(){return this.data.context},l.context.set=function(t){this.data.context=t,this.data.instance.update("_toast")},l.type.get=function(){return this.data.type},l.type.set=function(t){this.data.type=t,this.data.instance.update("_toast")},l.class.get=function(){return this.data.class},l.class.set=function(t){this.data.class=t,this.data.instance.update("_toast")},l.dismissable.get=function(){return this.data.dismissable},l.dismissable.set=function(t){this.data.dismissable=t,this.data.instance.update("_toast")},l.closeButton.get=function(){return this.data.closeButton},l.closeButton.set=function(t){this.data.closeButton=t,this.data.instance.update("_toast")},l.buttons.get=function(){return this.data.buttons},l.buttons.set=function(t){this.data.buttons=t,this.data.instance.update("_toast")},l.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)},l.closed.get=function(){var t=this;return this._promise||(this._promise=new Promise(function(n){t.data.onclose=n})),this._promise},Object.defineProperties(a.prototype,l);var c,f=16;function d(t){f=t}function u(){var t,n,e;!c&&window&&"document"in window&&"function"==typeof document.createElement&&((c=document.createElement("div")).setAttribute("style","position: absolute; left: -2em; width: 1em; height: 1em;"),t=c,n=function(){return d(c.getBoundingClientRect().width)},(e=document.createElement("object")).setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),e.setAttribute("tabindex","-1"),e.type="text/html",e.onload=function(){e.contentDocument.defaultView.addEventListener("resize",n),n()},/Trident/.test(navigator.userAgent)?(t.appendChild(e),e.data="about:blank"):(e.data="about:blank",t.appendChild(e)),window.addEventListener("resize",function(){u(),d(c.getBoundingClientRect().width)})),c&&!c.parent&&document.body.appendChild(c)}function h(t){return c||u(),"string"==typeof t&&(t=t.replace(/[^-.\d]/g,"")),+t/f}function w(t){return c||u(),"string"==typeof t&&(t=t.replace(/[^-.\d]/g,"")),+t*f}var m,g=e.escapeKey,p=function(t){function n(n){t.call(this,n)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n}(e);e.extendWith(p,{css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.window.primary"));return n.action=Object.assign({},t("raui.window.action"),t("raui.window.primary.action")),n.host=Object.assign({},t("raui.window.host"),t("raui.window.primary.host")),n.title=Object.assign({inactive:{}},t("raui.window.title"),t("raui.window.primary.title")),n.topmost=Object.assign({},t("raui.primary"),t("raui.window.primary"),t("raui.window.primary.topmost")),"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: "+(n.host.bg||n.bg||"#fff")+";\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n width: 100%;\n height: 100%;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(n.handleSize||7)+"px;\n }\n \n .rwindow-slide-left {\n height: 100%;\n left: 0;\n }\n .rwindow-slide-right {\n height: 100%;\n right: 0;\n }\n .rwindow-slide-top {\n width: 100%;\n top: 0;\n }\n .rwindow-slide-bottom {\n width: 100%;\n bottom: 0;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 "+(n.topmost.shadow||"rgba(0, 0, 0, 0.14)")+", 0 1px 18px 0 "+(n.topmost.shadow||"rgba(0, 0, 0, 0.12)")+", 0 3px 5px -1px "+(n.topmost.shadow||"rgba(0, 0, 0, 0.3)")+";\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n .rwindow-modal.rwindow-move {\n z-index: 50;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 "+(n.shadow||"rgba(0, 0, 0, 0.14)")+", 0 1px 5px 0 "+(n.shadow||"rgba(0, 0, 0, 0.12)")+", 0 3px 1px -2px "+(n.shadow||"rgba(0, 0, 0, 0.2)")+";\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(n.minWidth||"6em")+";\n min-height: "+(n.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(n.title.inactive.bg||n.fg||"#222")+";\n color: "+(n.title.inactive.fg||n.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n min-height: 2em;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(n.title.bg||n.fga||"#07e")+";\n color: "+(n.title.fg||n.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(n.action.bc||n.bc||"#ccc")+";\n background-color: "+(n.action.bg||n.bg||"#fff")+";\n color: "+(n.action.fg||n.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n cursor: default;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+("function"==typeof t("raui.window.extra")?t("raui.window.extra").call(this,t):"")+"\n "}.call(this,t)].join(" ")},cssId:"rwindow",noCssTransform:!0,delegate:!1,decorators:{tracked:function(t,n){return this[n]=t,{teardown:function(){this[n]===t&&(this[n]=null)}}}},transitions:{window:function(t,n){if(m)return t.complete();m=t;var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"";o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?(t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0}),setTimeout(function(){t.animateStyle({transform:"none",opacity:1},e).then(function(){t.setStyle("opacity",1),m=!1,t.complete(),o.style&&(o.style.overflow=i)})})):(t.setStyle({transform:"none",opacity:1}),t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},e).then(function(){m=!1,t.complete(),o.style&&(o.style.overflow=i)}))},slide:function(t,n){var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"",r=function(){t.complete(),o.style&&setTimeout(function(){return o.style.overflow=i})};o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?"top"===e.from?(t.setStyle({transform:"translateY(-100%)"}),t.animateStyle({transform:"translateY(0)"},e).then(r)):"bottom"===e.from?(t.setStyle({transform:"translateY(100%)"}),t.animateStyle({transform:"translateY(0)"},e).then(r)):"left"===e.from?(t.setStyle({transform:"translateX(-100%)"}),t.animateStyle({transform:"translateX(0)"},e).then(r)):"right"===e.from&&(t.setStyle({transform:"translateX(100%)"}),t.animateStyle({transform:"translateX(0)"},e).then(r)):"top"===e.from?(t.setStyle({transform:"translateY(0)"}),t.animateStyle({transform:"translateY(-100%)"},e).then(r)):"bottom"===e.from?(t.setStyle({transform:"translateY(0)"}),t.animateStyle({transform:"translateY(100%)"},e).then(r)):"left"===e.from?(t.setStyle({transform:"translateX(0)"}),t.animateStyle({transform:"translateX(-100%)"},e).then(r)):"right"===e.from&&(t.setStyle({transform:"translateX(0)"}),t.animateStyle({transform:"translateX(100%)"},e).then(r))}}});var b,x=0,y=function(t){function n(n){t.call(this,n),this.defaults={}}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var o={current:{configurable:!0},currentId:{configurable:!0},placement:{configurable:!0},topmost:{configurable:!0},windows:{configurable:!0}};return o.current.get=function(){var t=this.get("topLevel");return this.getWindow(this.get("windows."+g(t)+".id"))},o.currentId.get=function(){var t=this.get("topLevel");return this.get("windows."+g(t)+".id")},o.placement.get=function(){return this.get("placement")},o.placement.set=function(t){return this.set("placement",t)},o.topmost.get=function(){var t=this.get("windows");for(var n in t)if(t[n].topmost)return this.getWindow(t[n].id)},o.windows.get=function(){return Object.keys(this.get("windows"))},n.prototype.addWindow=function(t,n){var e=this,o=Object.assign({},this.defaults,t.constructor.prototype.options,t.options,t.get("options"),n);if(!(t instanceof k))throw new Error("Windows must be instances of Window");t.id||t.set("@.id",o.id||"window"+x++);var i=this.getWindow(t.id);if(i&&i!==t)throw new Error("duplicate window id",t.id);this.get("windows."+g(t.id))||this.set("windows."+g(t.id),Object.assign({show:!1!==o.show,autosize:!0,id:t.id,blockers:[],close:!0,minimize:!0,maximize:!0,minWidth:"5em",minHeight:"5em"},o,{id:t.id})),t.host=this;var r,s=this.attachChild(t,{target:"window"});if(o.block&&("string"==typeof(r=o.block.id||o.block)&&r in this.get("windows")?(this.push("windows."+g(r)+".blockers",t.id),t.set("control.blocking",r)):r=!1),t.minSize(o.minWidth||"5em",o.minHeight||"5em"),o.slide);else if("fill"===o.size&&(r||o.block)){var a;!0===o.block?a=this.find(".rwhost-pane"):(a=this.getWindow(r))&&(a=a.find(".rwindow")),a&&(t.size(a.clientWidth-(o.fillPad||20),a.clientHeight-(o.fillPad||20)),!o.block||o.top||o.left||(o.top=o.left=Math.floor((o.fillPad||20)/2)))}else o.width&&o.height?t.size(o.width,o.height):t.size("auto");return o.slide||(o.top&&o.left?t.move(o.top,o.left):this.place(t)),this.raise(t,{show:!1!==o.show,parent:o.stickToParent}),t.on("close",function(){var n=t.get("control.blocking");if(n){var o=e.windowGet(n,"blockers")||[];e.splice("windows."+g(n)+".blockers",o.indexOf(t.id),1)}e.detachChild(t).then(function(){return t.teardown()}),e.set("windows."+g(t.id)+".block",!1),e.set("windows."+g(t.id)+".index",-1),e.raise(),e.set("windows."+g(t.id),void 0),delete e.get("windows")[t.id]}),this.update("windows."+g(t.id)+".id",{force:!0}),this.fire("add",{},{window:t,options:o}),s.then(function(){return t})},n.prototype.changeWindowId=function(t,n){var e=this.getWindow(t);e&&(e.set("@.id",n),this.set("windows."+g(n),this.get("windows."+g(t))),e.link("windows."+g(n),"control",{instance:this}),this.set("windows."+g(t),void 0),delete this.get("windows")[t],this.set("windows."+g(n)+".id",n))},n.prototype.getWindow=function(t){return this.children.byName.window&&this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0]},n.prototype.windowGet=function(t,n){return this.get("windows."+g(t)+"."+n)},n.prototype.windowSet=function(t,n,e){return this.set("windows."+g(t)+"."+n,e)},n.prototype.raise=function(t,n){var e=this;void 0===n&&(n={});var o=t instanceof k?t:this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0],i=this.get("windows",{virtual:!1}),r=Object.keys(i).map(function(t){return i[t]}),s=2*(r.length+1),a=this.get("topLevel"),l=(this.get("blocked"),o?o.get("control.id"):r.reduce(function(t,n){return t?n.index>t.index?n:t:n},null));function c(t){t.blockers&&t.blockers.forEach(function(n,e){var o=r.find(function(t){return t.id===n});o&&(o.index=t.index+e+1,c(o))})}if(!o&&l&&(o=this.children.byName.window.find(function(t){return t.instance.id===l})),o){var f=o.get("control");f.index=!1===n.show?-1:s,c(f),f.blocking&&function t(n,e){n&&(n.index=e--,n.blocking&&t(r.find(function(t){return t.id===n.blocking}),e),c(n))}(r.find(function(t){return t.id===f.blocking}),s-1),!1===n.show||f.show||o.show()}r.filter(function(t){return!1!==t.show&&!0===t.block}).forEach(function(t){e.set("windows."+g(t.id)+".index",(t.index||0)+s),c(t)});var d=r.sort(function(t,n){return t.show?n.show&&t.index<n.index?-1:1:-1}),u=d.filter(function(t){return t.show});s=d.indexOf(u[u.length-1]);var h={},w=null;if(d.forEach(function(t,n){var e=g(t.id);!0===t.block&&null===w&&(w=n),h["windows."+e+".index"]=t.index=null!==w?n+2:n,h["windows."+e+".topmost"]=n===s,h["windows."+e+".stack"]=d.length-n}),h.blocked=null!==w?w+1:0,~s&&d.length?h.topLevel=d[s].id:h.topLevel=null,this.set(h),(s=h.topLevel)&&s!==a&&this.get("currentMax")&&this.rendered){var m=this.get("windows."+g(a));o=this.getWindow(s);var p=this.get("transition");!1===p||o.get("control.slide")||m&&(m.dialog||m.slide||m.blocking&&(!m.blocking||m.blocking===s))||o.transition(p||"window",o.find("div"),{intro:!0})}if(this.fire("raise",{},{top:this.topmost}),a!==this.get("topLevel")){var b=this.current;b&&b.fire("raise",{},{last:this.getWindow(a)})}},n.prototype.place=function(t){var n=this;return t.get("control.show")?new Promise(function(e){requestAnimationFrame(function(){var o=t.get("control");void 0!==o.width||o.dialog||t.size("auto");var i=0,r=0;if(n.fragment&&n.fragment.rendered){var s=n.find(".rwhost"),a=s.clientWidth,l=s.clientHeight,c=o.width,f=o.height;!o.dialog||o.size&&"auto"!==o.size&&o.width&&o.height||(c=h(t.pane.clientWidth),f=h(t.pane.clientHeight));var d=o.blocking;if(d){var u="windows."+g(d),m=n.get(u),p=o.max||!o.dialog&&(n.get("max")||n.get("userMax")),b=m.max||n.get("userMax")||n.get("max"),x=b?n.host.clientWidth:w(m.width+"em"),y=b?n.host.clientHeight:w(m.height+"em"),z=b?0:m.left,k=b?0:m.top;i=(p?a:x/2)+(p?0:z)-w(c)/2,r=(p?l:y/2)+(p?0:k)-w(f)/2}else{var S,W=n.get("placement");if("function"==typeof W)try{S=W(n,s,o)}catch(t){S=v(n,s,o)}else if("string"==typeof W)switch(W){case"smart":S=_(n,s,o);break;default:S=v(n,s,o)}else S=v(n,s,o);r=S.top,i=S.left}(isNaN(i)||i<0)&&(i=10),(isNaN(r)||r<0)&&(r=10),t.set({"control.top":r,"control.left":i}),e()}})}):Promise.resolve()},n.prototype.placeAll=function(){var t=this;if(this.fragment&&this.fragment.rendered){var n=Object.keys(this.get("windows")||{}).filter(function(n){return t.get("windows."+e.escapeKey(n)+".show")}),o=this.find(".rwhost");return new Promise(function(e){requestAnimationFrame(function(){for(var i,r=o.clientWidth,s=o.clientHeight;i=n[0];){var a=t.getWindow(i),l=a.get("control");void 0!==l.width||l.dialog||a.size("auto");var c=0,f=0,d=l.width,u=l.height;!l.dialog||l.size&&"auto"!==l.size&&l.width&&l.height||(d=h(a.pane.clientWidth),u=h(a.pane.clientHeight));var m=l.blocking;if(m){var p="windows."+g(m),b=t.get(p),x=l.max||!l.dialog&&(t.get("max")||t.get("userMax")),y=b.max||t.get("userMax")||t.get("max"),z=y?t.host.clientWidth:w(b.width+"em"),k=y?t.host.clientHeight:w(b.height+"em"),S=y?0:b.left,W=y?0:b.top;c=(x?r:z/2)+(x?0:S)-w(d)/2,f=(x?s:k/2)+(x?0:W)-w(u)/2}else{var M=t.get("placement"),T=void 0;if("function"==typeof M)try{T=M(t,o,l,n)}catch(n){T=v(t,o,l)}else if("string"==typeof M)switch(M){case"smart":T=_(t,o,l,n);break;default:T=v(t,o,l)}else T=v(t,o,l);f=T.top,c=T.left}(isNaN(c)||c<0)&&(c=10),(isNaN(f)||f<0)&&(f=10),a.set({"control.top":f,"control.left":c}),n.shift()}e()})})}},Object.defineProperties(n.prototype,o),n}(p);function v(t,n,e){var o=n.clientWidth,i=n.clientHeight,r=0,s=0,a=void 0===t._grid1?t._grid1=0:t._grid1>7?t._grid1=0:++t._grid1,l=Math.floor(o/3),c=Math.floor(i/3),f=w(e.width),d=w(e.height+"em");switch(a){case 5:case 7:case 8:r=i-d-10;break;case 2:case 4:case 6:r=c+Math.floor((c-d)/2);break;case 0:case 1:case 3:r=10}switch(a){case 3:case 6:case 8:s=o-f-10;break;case 1:case 4:case 7:s=l+Math.floor((l-f)/2);break;case 0:case 2:case 5:s=10}return s+f>o&&(s=o-f-10),r+d>i&&(r=i-d-10),{top:r,left:s}}function _(t,n,e,o){var i,r,s=n.clientWidth-10,a=n.clientHeight-10,l=Math.floor(a/16),c=Math.floor(s/16),f=new Array(l*c),d=new Array(l*c);for(i=0;i<f.length;i++)f[i]=0;var u,h,m,g,p,b,x,y,v=0,_=t.get("windows");for(var z in _)if(!o||!~o.indexOf(z))for(v++,u=_[z],h=Math.floor(u.top/16),m=Math.floor(u.left/16),p=Math.ceil(w(u.height)/16),g=Math.ceil(w(u.width)/16),i=h;i<h+p&&i<l;i++)for(r=m;r<m+g&&r<c;r++)f[i*c+r]++;for(g=Math.ceil(w(e.width)/16),p=Math.ceil(w(e.height)/16),i=0;i<l;i++)for(r=0;r<c;r++){if(i+p>l||r+g>c)b=v*g*p;else for(b=0,x=0;x<p;x++)for(y=0;y<g;y++)b+=f[(i+x)*c+r+y];if(0===b)return{top:16*i+5,left:16*r+5};d[i*c+r]=b}for(b=v*g*p,x=0,i=0;i<d.length;i++)d[i]<b&&(b=d[i],x=i);return{top:16*Math.floor(x/c)+5,left:x%c*16+5}}p.extendWith(y,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"moving",f:[{t:2,r:"~/moving"}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},"{t:_0}":function(t){return{t:t}},"_0&&_1":function(t,n){return t&&n},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(t,n){return[t.getWindow(n).hide()]},"!_0&&_1":function(t,n){return!t&&n},"[_0.getWindow(_1).maximize()]":function(t,n){return[t.getWindow(n).maximize()]},"!_0&&_1&&_2":function(t,n,e){return!t&&n&&e},"[_0.getWindow(_1).close()]":function(t,n){return[t.getWindow(n).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(t){return[t.hide()]},"[_0.maximize()]":function(t){return[t.maximize()]},"[_0.close()]":function(t){return[t.close()]},"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6":function(t,n,e,o,i,r,s){return!((t||n||e)&&o&&!i||r||s)},'["content"]':function(){return["content"]},"!_0":function(t){return!t},"[_0.call(_1)]":function(t,n){return[t.call(n)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(t){return!1!==t},"_0||_1":function(t,n){return t||n},"(_0||_1||_2)&&!_3&&!_4":function(t,n,e,o,i){return(t||n||e)&&!o&&!i},"[{from:_0}]":function(t){return[{from:t}]},"[_0._startResize(_1)]":function(t,n){return[t._startResize(n)]},"[_0._sizeHandle(_1)]":function(t,n){return[t._sizeHandle(n)]},"[_0._startMove(_1)]":function(t,n){return[t._startMove(n)]},"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5":function(t,n,e,o,i,r){return!(!1===i||(t||n)&&!o||e||o&&!0!==i||r)},"[_0.raise()]":function(t){return[t.raise()]},'["pane"]':function(){return["pane"]},"_0&&!_1":function(t,n){return t&&!n}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,x:{r:["window.dialog","window.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{t:4,f:[" ",{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[function(t){void 0===t&&(t={});var n=function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.toast.primary"));return"\n .rtoast-wrapper {\n position: absolute;\n display: flex;\n flex-direction: column;\n flex-wrap: no-wrap;\n align-items: center;\n overflow: hidden;\n top: 0.8em;\n left: 0.8em;\n right: 0.8em;\n bottom: auto;\n z-index: 5;\n pointer-events: none;\n overflow: auto;\n max-height: 80%;\n }\n .rtoast {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n margin: 0.2em;\n }\n .rtoast-message {\n flex-grow: 2;\n display: flex;\n align-items: center;\n }\n .rtoast-string {\n white-space: pre-wrap;\n line-height: 1.3em;\n padding-top: 0.3em;\n }\n .rtoast-upper .rtoast-string {\n \n }\n .rtoast-expand .rtoast-string {\n padding-top: 0.5em;\n }\n .rtoast-buttons {\n display: flex;\n padding-left: 0.5em;\n flex-shrink: 1;\n align-items: center;\n max-height: max-content;\n margin-left: auto;\n }\n .rtoast-buttons button {\n cursor: pointer;\n }\n .rtoast-button {\n background-color: transparent;\n border: none;\n color: inherit;\n padding: 0.5em 0.75em;\n margin: 0 0 0 0.5em;\n line-height: 1em;\n box-shadow: none;\n }\n .rtoast-more {\n cursor: pointer;\n width: 2em;\n position: relative;\n flex-shrink: 2;\n background-color: transparent;\n border: none;\n color: inherit;\n margin: 0 0 0 0.5em;\n height: 2em;\n }\n .rtoast-more:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n height: 0.6em;\n top: calc(50% - 0.55em);\n left: calc(50% - 0.3em);\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;\n pointer-events: none;\n }\n .rtoast-expanded .rtoast-more:after {\n transform: rotate(225deg);\n top: calc(50% - 0.1em);\n }\n .rtoast-bottom {\n bottom: 0.8em;\n top: auto;\n }\n .rtoast-left {\n align-items: flex-start;\n }\n .rtoast-right {\n align-items: flex-end;\n }\n .rtoast-body {\n border-radius: 0.2em;\n padding: 1em;\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0.95;\n pointer-events: all;\n transition: color 0.5s ease-in-out, background 0.5s ease-in-out;\n flex-shrink: 1;\n display: flex;\n flex-direction: column;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: nowrap;\n justify-content: space-between;\n }\n \n .rtoast-expand {\n padding-top: 1em;\n }\n \n .rtoast-expand .rtoast-string {\n max-height: 15em;\n overflow: auto;\n border-radius: 0.2em;\n padding: 0.5em;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n overflow: auto;\n }\n \n .rtoast-success {\n color: "+(t("raui.toast.success.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.success.bg")||"#4caf50")+";\n }\n .rtoast-info {\n color: "+(t("raui.toast.info.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.info.bg")||"#07e")+";\n }\n .rtoast-warn {\n color: "+(t("raui.toast.warn.fg")||"#222")+";\n background-color: "+(t("raui.warn.success.bg")||"#ffc107")+";\n }\n .rtoast-error {\n color: "+(t("raui.toast.error.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.error.bg")||"#ff5252")+";\n }\n "}.call(this,t)].join(" ")},e={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-wrapper",g:1},{n:"class-rtoast-bottom",t:13,f:[{t:2,r:"@this.toastDefaults.bottom"}]},{n:"class-rtoast-left",t:13,f:[{t:2,r:"@this.toastDefaults.left"}]},{n:"class-rtoast-right",t:13,f:[{t:2,r:"@this.toastDefaults.right"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast",g:1},{n:"class-rtoast-expanded",t:13,f:[{t:2,r:".showMore"}]}],f:[{t:7,e:"div",m:[{n:"toast",t:72,v:"t0"},{n:"class",f:["rtoast-body",{t:4,f:[" rtoast-",{t:2,r:".type"}],n:50,r:".type"},{t:4,f:[{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.close()]"}}],n:50,x:{r:[".dismissable"],s:"_0!==false"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-upper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-message",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".message",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".message"}],n:51,l:1}],n:50,x:{r:[".message"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".message"}]}],n:51,l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-buttons",g:1}],f:[{t:4,f:[{t:7,e:"button",m:[{n:"class",f:["rtoast-button",{t:4,f:[" ",{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.action()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}}],f:[{t:2,r:".label"}]}],n:52,r:".buttons"},{t:4,f:[{t:7,e:"button",m:[{t:13,n:"class",f:"rtoast-button",g:1}],f:["Close"]}],n:50,x:{r:[".dismissable",".closeButton"],s:"_0!==false&&_1!==false"},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-more",g:1},{n:"title",f:"Toggle more",t:13,g:1},{n:["click"],t:70,f:{r:[".","@context"],s:'[_0.expand(),(_1).toggle(".showMore"),false]'}}]}],n:50,r:".more"}]}],n:50,x:{r:[".dismissable",".closeButton",".buttons.length",".more"],s:"(_0!==false&&_1!==false)||_2||_3"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-expand",g:1},{n:"toast-expand",t:72,v:"t0"},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:4,f:[{t:4,f:[{t:8,r:".more",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".more"}],n:51,l:1}],n:50,x:{r:[".more"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".more"}]}],n:51,l:1}]}],n:50,x:{r:[".more",".showMore"],s:"_0&&_1"}}]}]}],n:52,z:[{n:"shuffle",x:{x:{r:[],s:"true"}}}],r:"~/_toast"}]}],n:50,r:"~/_toast"}],e:{"[_0.close()]":function(t){return[t.close()]},"_0!==false":function(t){return!1!==t},"!!_0":function(t){return!!t},"Array.isArray(_0)":function(t){return Array.isArray(t)},"[_0.action()]":function(t){return[t.action()]},'typeof _0==="function"':function(t){return"function"==typeof t},"_0!==false&&_1!==false":function(t,n){return!1!==t&&!1!==n},'[_0.expand(),(_1).toggle(".showMore"),false]':function(t,n){return[t.expand(),n.toggle(".showMore"),!1]},"(_0!==false&&_1!==false)||_2||_3":function(t,n,e,o){return!1!==t&&!1!==n||e||o},"[false,false]":function(){return[!1,!1]},"_0&&_1":function(t,n){return t&&n},true:function(){return!0}}};return function(o){var i=o.Ractive,r=o.instance,l=o.proto;r.partials[t.name||"toast"]=e;var c,f=Object.assign({},s,t),d=[],u={toasts:d};function h(n,e){var o=Object.assign(t,e.toastDefaults);if(c!==n)d.splice(d.indexOf(n),1),e.set("_toast",c?o.stack?[c].concat(d):[c]:null).then(function(){"function"==typeof n.onclose&&n.onclose()});else{u.tm&&(clearTimeout(u.tm),u.tm=null);var i=d.shift();e.shift("_toast").then(function(){e.set("_toast",i?o.stack?[i].concat(d):[i]:null).then(function(){e&&e.fire("toasted",null,n),"function"==typeof n.onclose&&n.onclose(),u.active=c=i,c&&c.timeout&&!c.showMore&&(u.tm&&clearTimeout(u.tm),u.tm=setTimeout(function(){c.close(),u.tm=null},c.timeout))})})}}if(Object.defineProperty(l,"toastDefaults",{value:f,writable:!1,configurable:!0}),l.toast=function(t,n){var e=this;delete n.top,delete n.bottom,delete n.left,delete n.right;var o,i=Object.assign({message:t,instance:this},f,this.toastDefaults,n);return i.close=function(){return h(i,e)},i.expand=function(){(i.stack||u.active===i)&&(u.tm&&(clearTimeout(u.tm),u.tm=null),i.showMore&&i.timeout&&(u.tm=setTimeout(function(){i.close(),u.tm=null},i.timeout)))},d.push(i),c&&!i.stack||(o=i.stack,c||(u.active=c=d.shift()),c.instance.set("_toast",o?[c].concat(d):[c]).then(function(){c.timeout&&!c.showMore&&(u.tm&&clearTimeout(u.tm),u.tm=setTimeout(function(){c.close(),u.tm=null},c.timeout))})),new a(u,i)},l.on=l.on||{},r.transitions.toast=function(t,n){var e=t.processParams({duration:200},n),o=t.getStyle("opacity");return t.isIntro?(t.setStyle({opacity:0,transform:"translateY("+(c.bottom?"":"-")+"1em)"}),t.animateStyle({opacity:o,transform:"none"},e)):(t.setStyle({opacity:o,transform:"none"}),t.animateStyle({opacity:0,transform:"translateY("+(c.bottom?"":"-")+"1em)"},e))},r.transitions["toast-expand"]=function(t,n){var e=t.processParams({duration:200,nested:!1},n);if(t.isIntro){var o=t.getStyle("height"),i=t.getStyle("width");return t.setStyle("height",0),t.setStyle("width",0),t.animateStyle("width",i,e).then(function(){return t.animateStyle("height",o,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})}var r=t.getStyle("height");return t.setStyle("height",r),t.setStyle("width",t.getStyle("width")),t.animateStyle("height",0,e).then(function(){return t.animateStyle("width",0,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})},l.on["close-toast"]=function(){c&&c.close()},r===i||i.isInstance(r))i.hasCSS("toast-css")||i.addCSS("toast",n);else{var w=r.css;r.css=function(t){var e="";return"string"==typeof w?e+=w:"function"==typeof w&&(e+=w(t)),n(t)+e}}return l}}(),(void 0===b&&(b={}),function(t){t.instance.transitions[b.name||"expand"]=r})],cssId:"window-host",noIntro:!0,attributes:["placement","windows","transition"],observe:{"@style.raui.window.maxFrom":function(){var t;(t=this)._media?t._media.fn():(t._media={},t._media.fn=function(){if(t.host){var n=w(t.get("@style.raui.window.maxFrom")),e=t.transitionsEnabled;t.transitionsEnabled=!1,t.set("max",t.host.clientWidth<=n),t.set("dimensions",{clientWidth:t.host.clientWidth,clientHeight:t.host.clientHeight}),t.transitionsEnabled=e}},t._media.handle=t.root.on("*.resize",t._media.fn),setTimeout(t._media.fn))},topLevel:function(t){t?this.link("windows."+g(t),"current"):this.unlink("current")},currentMax:{handler:function(t){(this.children.byName.window||[]).forEach(function(t){return t.instance.fire("resize")})},defer:!0}},computed:{currentMax:function(){var t=this.get("topLevel"),n=this.get("windows."+g(t)+".max");return this.get("userMax")||this.get("max")||n}},on:{config:function(){var t,n=this,e=this.partials.content;if(e&&Array.isArray(e))for(var o=(e=this.partials.content=e.slice()).length;o--;){var i=e[o];"max-top"===i.e&&(e.splice(o,1),this.set({_maxP:{t:i.f},hideTitleMax:!0}),i.m&&this.set({_maxAttrsP:{t:i.m}}))}"undefined"!=typeof window&&(this._resizeListener=function(){t||(t=setTimeout(function(){t=null,n.fire("resize")},300))},window.addEventListener("resize",this._resizeListener))},teardown:function(){this._resizeListener&&window.removeEventListener("resize",this._resizeListener)}}}),e.transitions.modal=function(t,n){var e,o=t.processParams(n,{duration:400,easing:"easeOut",x:0,y:-50,event:!0}),i=t.node.offsetLeft,r=t.node.offsetTop,s=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(t.node._modalSrc){var a=t.node._modalSrc||{x:i+o.x,y:r+o.y},l={x:a.x-Math.round(t.node.clientWidth/2)-i,y:a.y-Math.round(t.node.clientHeight/2)-r};t.node.parentNode.style&&(t.node.parentNode.style.overflow="hidden"),t.isIntro?(t.node._modalSrc=a,e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+l.x+"px, "+l.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+l.x+"px, "+l.y+"px) scale(0.5, 0.5)",opacity:0}}else t.isIntro?(e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0};t.animateStyle(e,o).then(function(){t.node.parentNode.style&&(t.node.parentNode.style.overflow=s),t.complete()})};var z=["mousemove","mouseup","touchmove","touchend"],k=function(t){function n(n){t.call(this,n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={resizable:{configurable:!0},title:{configurable:!0},visible:{configurable:!0},pad:{configurable:!0},buttons:{configurable:!0},blocked:{configurable:!0},result:{configurable:!0}};return e.resizable.get=function(){return this.get("control.resizable")},e.resizable.set=function(t){return this.set("control.resizable",t)},e.title.get=function(){return this.get("control.title")},e.title.set=function(t){return this.set("control.title",t)},e.visible.get=function(){return this.get("control.show")},e.visible.set=function(t){if(t)this.show();else{if(this.get("control.show"))try{this.fire("hide")}catch(t){}this.set("control.show",t,{keep:!0})}this.host.raise(this,{show:t})},e.pad.get=function(){return this.get("pad")},e.pad.set=function(t){this.set("pad",t)},e.buttons.get=function(){return this.get("buttons")},e.buttons.set=function(t){return this.set("buttons",t)},e.blocked.get=function(){return this.get("control.blocked")},e.blocked.set=function(t){return this.set("control.blocked",t)},e.result.get=function(){var t=this;return this._result||(this._result={},this._result.promise=new Promise(function(n){t._result.ok=n})),this._result.promise},n.prototype.setResult=function(t){this.result,this._result.value=t},n.prototype.close=function(t,n){if(!0!==t){if(!this.parent)return!1;if(this.get("control.blockers.length"))return!1;if("function"==typeof this.beforeClose&&!1===this.beforeClose())return!1;if(!1===this.fire("beforeClose"))return!1}return this.fire("close"),this._result&&this._result.ok(this._result.value||n),!0},n.prototype.maximize=function(){this.toggle("root.userMax")},n.prototype.hide=function(){this.visible=!1},n.prototype.raise=function(t){this.host.raise(this,{show:t})},n.prototype.show=function(){var t=this.get("control.show");if(this.set("control.show",!0),void 0===this.get("control.top")&&this.host.place(this),!t)try{this.fire("show")}catch(t){}},n.prototype.size=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(!e.visible)return"number"==typeof t&&"number"==typeof n&&e.set({"control.width":h(t),"control.height":h(n),"control.naturalWidth":h(t),"control.naturalHeight":h(n),"control.autosize":!1}),o();var i=e.wrapper;if(!i)return o();if("auto"===t){e.set("control.autosize",!0);var r=Math.ceil(h(i.clientWidth+16)),s=Math.ceil(h(i.clientHeight+8));e.set({"control.width":r,"control.height":s,"control.naturalWidth":r,"control.naturalHeight":s,"control.autosize":!1})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.width":h(t),"control.height":h(n),"control.naturalWidth":h(t),"control.naturalHeight":h(n),"control.autosize":!1});else if("string"==typeof t&&"string"==typeof n){var a=i.style.width,l=i.style.height;i.style.width=t,i.style.height=n;var c=i.clientWidth,f=i.clientHeight;i.style.width=a,i.style.height=l,e.set({"control.width":h(c),"control.height":h(f),"control.naturalWidth":h(c),"control.naturalHeight":h(f),"control.autosize":!1})}var d=e.host.host;if(d){var u=h(d.clientWidth-16),w=h(d.clientHeight-16);e.get("control.width")>u&&e.set("control.width",u),e.get("control.height")>w&&e.set("control.height",w)}var m=e.get("control.minWidth")||5,g=e.get("control.minHeight")||5;e.get("control.width")<m&&e.set("control.width",m),e.get("control.height")<g&&e.set("control.height",g),e.fire("resize"),o()})})},n.prototype.minSize=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(!e.visible)return"number"==typeof t&&"number"==typeof n&&e.set({"control.minWidth":h(t),"control.minHeight":h(n)}),o();var i=e.wrapper;if(!i)return o();if("auto"===t){var r=e.get("control.autosize");e.set("control.autosize",!0);var s=h(i.clientWidth+16),a=h(i.clientHeight);e.set({"control.minWidth":s,"control.minHeight":a,"control.autosize":r})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.minWidth":h(t),"control.minHeight":h(n)});else if("string"==typeof t&&"string"==typeof n){var l=i.style.width,c=i.style.height;i.style.width=t,i.style.height=n;var f=i.clientWidth,d=i.clientHeight;i.style.width=l,i.style.height=c,e.set({"control.minWidth":h(f),"control.minHeight":h(d)})}o()})})},n.prototype.move=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){"center"===t?t=e.host.modalPane.clientHeight/2-e.wrapper.clientHeight/2:"string"==typeof t&&(t=h(t)),"center"===n&&(n=e.host.modalPane.clientWidth/2-e.wrapper.clientWidth/2),"string"==typeof n&&(n=h(n));var i={};"number"==typeof t&&(i["control.top"]=t),"number"==typeof n&&(i["control.left"]=n),e.set(i),o()})})},n.prototype._startMove=function(t){var n=this;if("mousedown"!==t.type||0===t.button){if(this.get("control.topmost")||this.raise(),~t.type.indexOf("mouse")){if(!this.top||!t.ctrlKey&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return}else if(t.targetTouches&&1===t.targetTouches.length&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return;this.set("moving",!0);var e=this.pane,o=e.style.cursor;e.style.cursor="move",e.style.userSelect="none";var i=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,r=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,s=this.get("control.left")||0,a=this.get("control.top")||0,l=e.clientWidth,c=e.clientHeight,f=function(t){var d=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,u=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,h=s+(d-i),w=a+(u-r);h<(l<30?0:30-l)&&(h=l<30?0:30-l),w<(c<30?0:30-c)&&(w=c<30?0:30-c),h<0&&(h=0),w<0&&(w=0),n.set({"control.top":w,"control.left":h}),"touchend"===t.type||"mouseup"===t.type?(z.forEach(function(t){return document.removeEventListener(t,f,{passive:!1})}),e.style.cursor=o,e.style.userSelect="",n.set("moving",!1)):t.preventDefault()};return z.forEach(function(t){return document.addEventListener(t,f,{passive:!1})}),0!==t.type.indexOf("mouse")&&void 0}},n.prototype._startResize=function(t){var n=this;if(t.target===this.wrapper&&("mousedown"!==t.type||0===t.button)){this.get("control.autosize")&&this.size("auto"),this.get("control.topmost")||this.raise(),this.set("control.resizing",!0),this.set("moving",!0);var e,o=this.wrapper,i=t.offsetX||t.targetTouches&&t.targetTouches[0].pageX-o.getBoundingClientRect().left,r=t.offsetY||t.targetTouches&&t.targetTouches[0].pageY-o.getBoundingClientRect().top,s=this.get("@style.window.handleSize")||7,a=o.clientWidth-2*s,l=o.clientHeight-2*s,c=2*s,f=i<=c||i>=a,d=r<=c||r>=l,u=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,m=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,g=this.get("control.left")||0,p=this.get("control.top")||0,b=w(this.get("control.width")),x=w(this.get("control.height")),y=w(this.get("control.minHeight")),v=w(this.get("control.minWidth")),_=function(t){t.preventDefault();var o=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,s=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,a=f?o-u:0,l=d?s-m:0,w={};r<=c?(w["control.top"]=p+l,w["control.height"]=x-l):w["control.height"]=x+l,i<=c?(w["control.left"]=g+a,w["control.width"]=b-a):w["control.width"]=b+a,w["control.width"]<v&&(delete w["control.width"],delete w["control.left"]),w["control.height"]<y&&(delete w["control.height"],delete w["control.top"]),w["control.left"]<0&&(w["control.left"]=0),w["control.top"]<0&&(w["control.top"]=0),w["control.width"]&&(w["control.width"]=h(w["control.width"])),w["control.height"]&&(w["control.height"]=h(w["control.height"])),n.set(w),"touchend"===t.type||"mouseup"===t.type?(z.forEach(function(t){return document.removeEventListener(t,_,{passive:!1})}),n.set("control.resizing",!1),n.set("moving",!1),b===n.get("control.width")&&x===n.get("control.height")||(e&&clearTimeout(e),e=null,n.fire("resize"))):e||(e=setTimeout(function(){n.fire("resize"),e=null},200))};return z.forEach(function(t){return document.addEventListener(t,_,{passive:!1})}),!1}},n.prototype._sizeHandle=function(t){if(t.target===this.wrapper){var n=this.wrapper;if("mouseout"===t.type)return n.style.cursor="auto";var e=t.offsetX,o=t.offsetY,i=this.get("@style.window.handleSize")||7,r=n.clientWidth-i,s=n.clientHeight-i,a=n.style;a.cursor=e<=i+i&&o<=i+i||e>=r-i&&o>=s-i?"nwse-resize":e>=r-i&&o<=i+i||e<=i+i&&o>=s-i?"nesw-resize":(e<=i||e>=r)&&(o<s||o>i)?"ew-resize":(o<=i||o>=s)&&(e<r||e>i)?"ns-resize":"auto"}},Object.defineProperties(n.prototype,e),n}(p),S=["left","right","center","condition"];function W(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"host"]=y}}p.extendWith(k,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{t:4,f:[" ",{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:"title",f:"Minimize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:"title",f:"Maximize window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:"title",f:"Close window",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],contents:"",status:""},data:function(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"left"===t.where})},centerButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"center"===t.where})},rightButtons:function(){return(this.get("buttons")||[]).filter(function(t){return!t.where||"right"===t.where})}},decorators:{button:function(t){var n=this.getContext(t);return n.add("visibleButtons"),{update:function(){},teardown:function(){n.subtract("visibleButtons")}}}},on:{config:function(){var t=k.prototype.template,n=this.template;"string"!=typeof t&&!Array.isArray(t)&&t.t&&(t=t.t),"string"!=typeof n&&!Array.isArray(n)&&n.t&&(n=n.t),t!==n&&(this.partials.hasOwnProperty("contents")||(this.partials.contents=n),this.template=t)},construct:function(){var t=this.constructor;if(!t._constructed){t._constructed=1;var n=t.prototype.template.t.slice(),e=n.find(function(t){return"buttons"===t.e});function o(t){var n=t.m||[],e={partial:{t:[{t:t.t,e:t.e,f:t.f,m:n.filter(function(t){return!~S.indexOf(t.n)})}]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"};return e.partial.t[0].m.push({t:71,n:"button"}),e}t.prototype.template.t=n.filter(function(t){return"buttons"!==t.e}),e&&(t._btns=e.f.filter(function(t){return"button"===t.e||"not-button"===t.e||4===t.t&&(50===t.n||51===t.n)&&t.f.find(function(t){return"button"===t.e||"not-button"===t.e})}).map(function(t){if(4===t.t)return t.f.filter(function(t){return"button"===t.e||"not-button"===t.e}).map(function(n){var e=n.m||[],i="button"===n.e?o(n):{partial:{t:n.f||[]},where:e.find(function(t){return"left"===t.n})?"left":e.find(function(t){return"center"===t.n})?"center":"right"},r={t:t.t,n:t.n,f:[i.partial.t[0]]};return t.r&&(r.r=t.r),t.rx&&(r.rx=t.rx),t.x&&(r.x=t.x),i.partial={t:[r]},i});if("not-button"===t.e){var n=t.m||[];return[{partial:{t:t.f||[]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"}]}return[o(t)]}).reduce(function(t,n){return t.concat(n)},[]))}},init:function(){var t=this.constructor;t._btns&&!this.get("buttons.length")&&this.set("buttons",t._btns)}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function(t,n,e){if(this.get("control.id")){var o=this.get("control.max")||this.get("root.userMax")||this.get("root.max"),i=this.get("control.actual")||{};if(o)if(i.max)~e.indexOf("client")&&"number"==typeof t&&(~e.indexOf("Width")?this.set("control.actual.width",h(t)):~e.indexOf("Height")&&this.set("control.actual.height",h(t)));else{this.wrapper;this.wrapper&&this.set("control.actual",{width:h(this.wrapper.clientWidth),height:h(this.wrapper.clientHeight),max:o})}else"number"==typeof t&&(~e.indexOf("width")?this.set("control.actual.width",t):~e.indexOf("height")&&this.set("control.actual.height",t)),i.max&&this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:o}),this.set("control.actual.max",!1)}},init:!1,defer:!0}}}),i("RauiWindowHost","components",y),i("RauiWindow","components",k),y.prototype.Window=k,t.Base=p,t.Host=y,t.Window=k,t.plugin=W,t.default=W,Object.defineProperty(t,"__esModule",{value:!0})});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc