// Generated by Haxe 3.4.2 (function ($global) { "use strict"; var $estr = function() { return js_Boot.__string_rec(this,''); }; function $extend(from, fields) { function Inherit() {} Inherit.prototype = from; var proto = new Inherit(); for (var name in fields) proto[name] = fields[name]; if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString; return proto; } var StringTools = function() { }; StringTools.__name__ = ["StringTools"]; StringTools.htmlEscape = function(s,quotes) { s = s.split("&").join("&").split("<").join("<").split(">").join(">"); if(quotes) { return s.split("\"").join(""").split("'").join("'"); } else { return s; } }; StringTools.htmlUnescape = function(s) { return s.split(">").join(">").split("<").join("<").split(""").join("\"").split("'").join("'").split("&").join("&"); }; StringTools.startsWith = function(s,start) { if(s.length >= start.length) { return HxOverrides.substr(s,0,start.length) == start; } else { return false; } }; StringTools.isSpace = function(s,pos) { var c = HxOverrides.cca(s,pos); if(!(c > 8 && c < 14)) { return c == 32; } else { return true; } }; StringTools.ltrim = function(s) { var l = s.length; var r = 0; while(r < l && StringTools.isSpace(s,r)) ++r; if(r > 0) { return HxOverrides.substr(s,r,l - r); } else { return s; } }; StringTools.rtrim = function(s) { var l = s.length; var r = 0; while(r < l && StringTools.isSpace(s,l - r - 1)) ++r; if(r > 0) { return HxOverrides.substr(s,0,l - r); } else { return s; } }; StringTools.trim = function(s) { return StringTools.ltrim(StringTools.rtrim(s)); }; StringTools.replace = function(s,sub,by) { return s.split(sub).join(by); }; StringTools.hex = function(n,digits) { var s = ""; var hexChars = "0123456789ABCDEF"; while(true) { s = hexChars.charAt(n & 15) + s; n >>>= 4; if(!(n > 0)) { break; } } if(digits != null) { while(s.length < digits) s = "0" + s; } return s; }; var HxOverrides = function() { }; HxOverrides.__name__ = ["HxOverrides"]; HxOverrides.cca = function(s,index) { var x = s.charCodeAt(index); if(x != x) { return undefined; } return x; }; HxOverrides.substr = function(s,pos,len) { if(len == null) { len = s.length; } else if(len < 0) { if(pos == 0) { len = s.length + len; } else { return ""; } } return s.substr(pos,len); }; HxOverrides.remove = function(a,obj) { var i = a.indexOf(obj); if(i == -1) { return false; } a.splice(i,1); return true; }; HxOverrides.iter = function(a) { return { cur : 0, arr : a, hasNext : function() { return this.cur < this.arr.length; }, next : function() { return this.arr[this.cur++]; }}; }; var Dom = function() { }; Dom.__name__ = ["Dom"]; Dom["is"] = function(e,property) { var _g = property.split("."); switch(_g.length) { case 1: var name = _g[0]; return e.hasAttribute("data-" + name); case 2: if(_g[0] == "") { var name1 = _g[1]; return e.classList.contains(name1); } else { throw new js__$Boot_HaxeError("invalid usage"); } break; default: throw new js__$Boot_HaxeError("invalid usage"); } }; Dom.toggle = function(e,property,on) { var add = function() { var _g = property.split("."); switch(_g.length) { case 1: var name = _g[0]; e.setAttribute("data-" + name,""); break; case 2: if(_g[0] == "") { var name1 = _g[1]; e.classList.add(name1); } else { throw new js__$Boot_HaxeError("invalid usage"); } break; default: throw new js__$Boot_HaxeError("invalid usage"); } return true; }; var rem = function() { var _g1 = property.split("."); switch(_g1.length) { case 1: var name2 = _g1[0]; e.removeAttribute("data-" + name2); break; case 2: if(_g1[0] == "") { var name3 = _g1[1]; e.classList.remove(name3); } else { throw new js__$Boot_HaxeError("invalid usage"); } break; default: throw new js__$Boot_HaxeError("invalid usage"); } return false; }; var _g2 = Dom["is"](e,property); if(on == null) { switch(_g2) { case false: return add(); case true: return rem(); } } else { switch(on) { case false: if(_g2 == false) { return on; } else { return rem(); } break; case true: if(_g2 == true) { return on; } else { return add(); } break; } } }; Dom.toggleAria = function(e,attribute,on) { var set = function(value) { e.removeAttribute("" + attribute); e.setAttribute("" + attribute,"" + value); return false; }; switch(on) { case false: return set("false"); case true: return set("true"); } }; Dom.tag = function(name,attr,children) { var parts = name.split("."); var ret = window.document.createElement(parts.shift()); var _g = 0; while(_g < parts.length) { var cls = parts[_g]; ++_g; ret.classList.add(cls); } if(attr != null) { var _g1 = 0; var _g11 = Reflect.fields(attr); while(_g1 < _g11.length) { var f = _g11[_g1]; ++_g1; var _g2 = Reflect.field(attr,f); if(_g2 != null) { var v = _g2; ret.setAttribute(f,v); } } } if(children != null) { var _g3 = 0; while(_g3 < children.length) { var c = children[_g3]; ++_g3; ret.appendChild(c); } } return ret; }; Dom.gets = function(target,event) { var a1 = target; var a2 = event; var a11 = target; var a21 = event; return tink_core__$Signal_Signal_$Impl_$.ofClassical(function(a3) { return Dom.on(a1,a2,a3); },function(a31) { return Dom.on(a11,a21,a31); }); }; Dom.getElement = function(html,__tink_tmp142) { if(__tink_tmp142 == null) { __tink_tmp142 = { }; } var cached = __tink_tmp142.cached == null ? false : __tink_tmp142.cached; var init = __tink_tmp142.init == null ? null : __tink_tmp142.init; var get = function() { var helper = window.document.createElement("div"); helper.innerHTML = html; var ret = helper.firstElementChild; if(init != null) { init(ret); } return ret; }; if(cached) { var _g = Dom.cache.get(html); if(_g == null) { var this1 = Dom.cache; var v = get(); this1.set(html,v); return v; } else { var v1 = _g; return v1; } } else { return get(); } }; Dom.nearest = function(at,selector) { return Dom.parents(at,selector)[0]; }; Dom.parents = function(at,selector) { var ret = []; while(at != null) { if($bind(at,at.matches) != null && at.matches(selector)) { ret.push(at); } at = at.parentElement != null ? at.parentElement : at.parentNode; } return ret; }; Dom.transform = function(e,transform) { e.style.transform = transform; }; Dom.unsafe = function(f) { try { f(); } catch( e ) { } }; Dom.abruptly = function(e,f) { var isDry = e.classList.contains("dry"); if(!isDry) { e.classList.add("dry"); } f(); var x = e.clientHeight; if(!isDry) { e.classList.remove("dry"); } }; Dom.toggleFullScreen = function(target,fullscreen) { Dom.unsafe(function() { if(fullscreen) { target.requestFullscreen(); } else { window.document.exitFullscreen(); } }); }; Dom.query = function(s,ctx) { if(ctx == null) { return window.document.querySelectorAll(s); } var prefix; if(Dom.hasScope) { prefix = ":scope"; } else { var _g = ctx.id; if(_g == null) { if(!window.document.documentElement.contains(ctx)) { prefix = "#" + (ctx.id = "_hx_" + Dom.counter++); } else { var cur = ctx; var _g1 = []; while(cur != window.document.documentElement) { var name = cur.tagName.toLowerCase(); cur = cur.parentElement; _g1.push(name); } var path = _g1; path.reverse(); prefix = path.join(">"); } } else if(_g == "") { if(!window.document.documentElement.contains(ctx)) { prefix = "#" + (ctx.id = "_hx_" + Dom.counter++); } else { var cur1 = ctx; var _g2 = []; while(cur1 != window.document.documentElement) { var name1 = cur1.tagName.toLowerCase(); cur1 = cur1.parentElement; _g2.push(name1); } var path1 = _g2; path1.reverse(); prefix = path1.join(">"); } } else { var v = _g; prefix = "#" + v; } } var ret = ctx.querySelectorAll("" + prefix + " " + s); return ret; }; Dom.once = function(target,type,handler) { var ret = null; ret = Dom.on(target,type,function(x) { tink_core__$Callback_Callback_$Impl_$.invoke(handler,x); if(ret != null) { ret.dissolve(); } }); return ret; }; Dom.on = function(target,type,handler) { if(target == null) { var this1 = new tink_core__$Callback_SimpleLink(function() { }); return this1; } var f = function(e) { tink_core__$Callback_Callback_$Impl_$.invoke(handler,e); }; var remove = function() { var _g = 0; var _g1 = type.split(" "); while(_g < _g1.length) { var type1 = _g1[_g]; ++_g; if(type1 != "") { target.removeEventListener(type1,f); } } }; var _g2 = 0; var _g11 = type.split(" "); while(_g2 < _g11.length) { var type2 = _g11[_g2]; ++_g2; if(type2 != "") { target.addEventListener(type2,f); } } var this2 = new tink_core__$Callback_SimpleLink(remove); return this2; }; var _$Dom_QueryResult_$Impl_$ = {}; _$Dom_QueryResult_$Impl_$.__name__ = ["_Dom","QueryResult_Impl_"]; _$Dom_QueryResult_$Impl_$.toArray = function(this1) { var _g = []; var _g1 = 0; while(_g1 < this1.length) { var x = this1[_g1]; ++_g1; _g.push(x); } return _g; }; _$Dom_QueryResult_$Impl_$.query = function(scope,query) { return Dom.query(query,scope); }; _$Dom_QueryResult_$Impl_$.on = function(selector,eventType,scope,handler) { if(scope == null) { return _$Dom_QueryResult_$Impl_$.on(selector,eventType,window.document,handler); } else { return Dom.on(scope,eventType,function(e) { var _g = 0; var _g1 = Dom.parents(e.target,selector); while(_g < _g1.length) { var at = _g1[_g]; ++_g; tink_core__$Callback_Callback_$Impl_$.invoke(handler,{ at : at, event : e}); if(e.defaultPrevented) { return; } } }); } }; var EReg = function(r,opt) { this.r = new RegExp(r,opt.split("u").join("")); }; EReg.__name__ = ["EReg"]; EReg.prototype = { match: function(s) { if(this.r.global) { this.r.lastIndex = 0; } this.r.m = this.r.exec(s); this.r.s = s; return this.r.m != null; } ,__class__: EReg }; var Lambda = function() { }; Lambda.__name__ = ["Lambda"]; Lambda.map = function(it,f) { var l = new List(); var x = $iterator(it)(); while(x.hasNext()) { var x1 = x.next(); l.add(f(x1)); } return l; }; Lambda.has = function(it,elt) { var x = $iterator(it)(); while(x.hasNext()) { var x1 = x.next(); if(x1 == elt) { return true; } } return false; }; Lambda.filter = function(it,f) { var l = new List(); var x = $iterator(it)(); while(x.hasNext()) { var x1 = x.next(); if(f(x1)) { l.add(x1); } } return l; }; Lambda.count = function(it,pred) { var n = 0; if(pred == null) { var _ = $iterator(it)(); while(_.hasNext()) { var _1 = _.next(); ++n; } } else { var x = $iterator(it)(); while(x.hasNext()) { var x1 = x.next(); if(pred(x1)) { ++n; } } } return n; }; var List = function() { this.length = 0; }; List.__name__ = ["List"]; List.prototype = { add: function(item) { var x = new _$List_ListNode(item,null); if(this.h == null) { this.h = x; } else { this.q.next = x; } this.q = x; this.length++; } ,push: function(item) { var x = new _$List_ListNode(item,this.h); this.h = x; if(this.q == null) { this.q = x; } this.length++; } ,first: function() { if(this.h == null) { return null; } else { return this.h.item; } } ,pop: function() { if(this.h == null) { return null; } var x = this.h.item; this.h = this.h.next; if(this.h == null) { this.q = null; } this.length--; return x; } ,iterator: function() { return new _$List_ListIterator(this.h); } ,join: function(sep) { var s_b = ""; var first = true; var l = this.h; while(l != null) { if(first) { first = false; } else { s_b += sep == null ? "null" : "" + sep; } s_b += Std.string(l.item); l = l.next; } return s_b; } ,__class__: List }; var _$List_ListNode = function(item,next) { this.item = item; this.next = next; }; _$List_ListNode.__name__ = ["_List","ListNode"]; _$List_ListNode.prototype = { __class__: _$List_ListNode }; var _$List_ListIterator = function(head) { this.head = head; }; _$List_ListIterator.__name__ = ["_List","ListIterator"]; _$List_ListIterator.prototype = { hasNext: function() { return this.head != null; } ,next: function() { var val = this.head.item; this.head = this.head.next; return val; } ,__class__: _$List_ListIterator }; Math.__name__ = ["Math"]; var Reflect = function() { }; Reflect.__name__ = ["Reflect"]; Reflect.field = function(o,field) { try { return o[field]; } catch( e ) { return null; } }; Reflect.fields = function(o) { var a = []; if(o != null) { var hasOwnProperty = Object.prototype.hasOwnProperty; for( var f in o ) { if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) { a.push(f); } } } return a; }; Reflect.compare = function(a,b) { if(a == b) { return 0; } else if(a > b) { return 1; } else { return -1; } }; Reflect.copy = function(o) { var o2 = { }; var _g = 0; var _g1 = Reflect.fields(o); while(_g < _g1.length) { var f = _g1[_g]; ++_g; o2[f] = Reflect.field(o,f); } return o2; }; var Std = function() { }; Std.__name__ = ["Std"]; Std.string = function(s) { return js_Boot.__string_rec(s,""); }; Std.parseInt = function(x) { var v = parseInt(x,10); if(v == 0 && (HxOverrides.cca(x,1) == 120 || HxOverrides.cca(x,1) == 88)) { v = parseInt(x); } if(isNaN(v)) { return null; } return v; }; Std.parseFloat = function(x) { return parseFloat(x); }; var StringBuf = function() { this.b = ""; }; StringBuf.__name__ = ["StringBuf"]; StringBuf.prototype = { __class__: StringBuf }; var Type = function() { }; Type.__name__ = ["Type"]; Type.getClassName = function(c) { var a = c.__name__; if(a == null) { return null; } return a.join("."); }; var _$UInt_UInt_$Impl_$ = {}; _$UInt_UInt_$Impl_$.__name__ = ["_UInt","UInt_Impl_"]; _$UInt_UInt_$Impl_$.toFloat = function(this1) { var $int = this1; if($int < 0) { return 4294967296.0 + $int; } else { return $int + 0.0; } }; var Xml = function(nodeType) { this.nodeType = nodeType; this.children = []; this.attributeMap = new haxe_ds_StringMap(); }; Xml.__name__ = ["Xml"]; Xml.parse = function(str) { return haxe_xml_Parser.parse(str); }; Xml.createElement = function(name) { var xml = new Xml(Xml.Element); if(xml.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + xml.nodeType); } xml.nodeName = name; return xml; }; Xml.createPCData = function(data) { var xml = new Xml(Xml.PCData); if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); } xml.nodeValue = data; return xml; }; Xml.createCData = function(data) { var xml = new Xml(Xml.CData); if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); } xml.nodeValue = data; return xml; }; Xml.createComment = function(data) { var xml = new Xml(Xml.Comment); if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); } xml.nodeValue = data; return xml; }; Xml.createDocType = function(data) { var xml = new Xml(Xml.DocType); if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); } xml.nodeValue = data; return xml; }; Xml.createProcessingInstruction = function(data) { var xml = new Xml(Xml.ProcessingInstruction); if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); } xml.nodeValue = data; return xml; }; Xml.createDocument = function() { return new Xml(Xml.Document); }; Xml.prototype = { get: function(att) { if(this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType); } var _this = this.attributeMap; if(__map_reserved[att] != null) { return _this.getReserved(att); } else { return _this.h[att]; } } ,set: function(att,value) { if(this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType); } var _this = this.attributeMap; if(__map_reserved[att] != null) { _this.setReserved(att,value); } else { _this.h[att] = value; } } ,exists: function(att) { if(this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType); } var _this = this.attributeMap; if(__map_reserved[att] != null) { return _this.existsReserved(att); } else { return _this.h.hasOwnProperty(att); } } ,attributes: function() { if(this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType); } return this.attributeMap.keys(); } ,elements: function() { if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); } var _g = []; var _g1 = 0; var _g2 = this.children; while(_g1 < _g2.length) { var child = _g2[_g1]; ++_g1; if(child.nodeType == Xml.Element) { _g.push(child); } } var ret = _g; return HxOverrides.iter(ret); } ,firstElement: function() { if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); } var _g = 0; var _g1 = this.children; while(_g < _g1.length) { var child = _g1[_g]; ++_g; if(child.nodeType == Xml.Element) { return child; } } return null; } ,addChild: function(x) { if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); } if(x.parent != null) { x.parent.removeChild(x); } this.children.push(x); x.parent = this; } ,removeChild: function(x) { if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); } if(HxOverrides.remove(this.children,x)) { x.parent = null; return true; } return false; } ,__class__: Xml }; var coconut_data_Model = function() { }; coconut_data_Model.__name__ = ["coconut","data","Model"]; var vdom_Widget = function() { this.type = "Widget"; }; vdom_Widget.__name__ = ["vdom","Widget"]; vdom_Widget.prototype = { init: function() { throw new js__$Boot_HaxeError("abstract"); } ,update: function(prev,elt) { throw new js__$Boot_HaxeError("abstract"); } ,destroy: function() { } ,__class__: vdom_Widget }; var coconut_vdom_Renderable = function(rendered,key) { vdom_Widget.call(this); this.__rendered = rendered; if(key == null) { key = vdom__$Attr_Key_$Impl_$.ofObj(this.__rendered); } this.key = key; }; coconut_vdom_Renderable.__name__ = ["coconut","vdom","Renderable"]; coconut_vdom_Renderable.__super__ = vdom_Widget; coconut_vdom_Renderable.prototype = $extend(vdom_Widget.prototype,{ init: function() { this.__lastRender = tink_state__$Observable_Observable_$Impl_$.get_value(this.__rendered); this.beforeInit(); this.__dom = vdom_VDom.create(this.__lastRender); this.afterInit(this.__dom); this.__setupBinding(); return this.__dom; } ,__setupBinding: function() { var _gthis = this; this.__binding = tink_state__$Observable_Observable_$Impl_$.bind(this.__rendered,null,function(next) { if(next != _gthis.__lastRender) { _gthis.__apply(next); } }); } ,__apply: function(next) { var changes = vdom_VDom.diff(this.__lastRender,next); this.beforePatching(this.__dom); this.__dom = vdom_VDom.patch(this.__dom,changes); this.__lastRender = next; this.afterPatching(this.__dom); } ,toElement: function() { var _g = this.__dom; if(_g == null) { return this.init(); } else { var v = _g; return v; } } ,beforeInit: function() { } ,afterInit: function(element) { } ,beforePatching: function(element) { } ,afterPatching: function(element) { } ,update: function(x,y) { var _g = (x instanceof coconut_vdom_Renderable) ? x : null; if(_g != null) { var v = _g; this.__reuseRender(v); } return this.toElement(); } ,__reuseRender: function(that) { this.__dom = that.__dom; this.__lastRender = that.__lastRender; this.__apply(tink_state__$Observable_Observable_$Impl_$.get_value(this.__rendered)); this.__setupBinding(); that.destroy(); } ,destroy: function() { var this1 = this.__binding; if(this1 != null) { this1.dissolve(); } vdom_Widget.prototype.destroy.call(this); } ,__class__: coconut_vdom_Renderable }); var coconut_ui_BaseView = function(data,render) { this.__coco__cache = new coconut_ui_tools_ViewCache(); var _gthis = this; var this1 = { f : function() { var f = render; var a1 = data; var this2 = function() { return f(a1); }; return _gthis.__coco__cache.cached(this2); }}; coconut_vdom_Renderable.call(this,tink_state__$Observable_Observable_$Impl_$.auto(this1)); }; coconut_ui_BaseView.__name__ = ["coconut","ui","BaseView"]; coconut_ui_BaseView.__super__ = coconut_vdom_Renderable; coconut_ui_BaseView.prototype = $extend(coconut_vdom_Renderable.prototype,{ __class__: coconut_ui_BaseView }); var coconut_ui_View = function(data,render) { coconut_ui_BaseView.call(this,data,render); }; coconut_ui_View.__name__ = ["coconut","ui","View"]; coconut_ui_View.__super__ = coconut_ui_BaseView; coconut_ui_View.prototype = $extend(coconut_ui_BaseView.prototype,{ __class__: coconut_ui_View }); var coconut_ui_tools__$ViewCache_Stack = function(create) { this.stored = []; this.counter = 0; this.create = create; }; coconut_ui_tools__$ViewCache_Stack.__name__ = ["coconut","ui","tools","_ViewCache","Stack"]; coconut_ui_tools__$ViewCache_Stack.prototype = { purge: function() { this.stored.splice(this.counter,this.stored.length); this.counter = 0; } ,poll: function() { var _g = this.stored[this.counter++]; if(_g == null) { var ret = this.create(); this.stored.push(ret); return ret; } else { var v = _g; return v; } } ,__class__: coconut_ui_tools__$ViewCache_Stack }; var coconut_ui_tools__$ViewCache_Factory = function(render) { this.stackByData = new haxe_ds_ObjectMap(); this.render = render; }; coconut_ui_tools__$ViewCache_Factory.__name__ = ["coconut","ui","tools","_ViewCache","Factory"]; coconut_ui_tools__$ViewCache_Factory.prototype = { purge: function() { var s = this.stackByData.iterator(); while(s.hasNext()) { var s1 = s.next(); s1.purge(); } } ,make: function(data) { var stack; var _g = this.stackByData.get(data); if(_g == null) { var this1 = this.stackByData; var f = this.render; var a1 = data; var v = new coconut_ui_tools__$ViewCache_Stack(function() { return f(a1); }); this1.set(data,v); stack = v; } else { var v1 = _g; stack = v1; } return stack.poll(); } ,__class__: coconut_ui_tools__$ViewCache_Factory }; var coconut_ui_tools_ViewCache = function() { this.__cache = new haxe_ds_StringMap(); }; coconut_ui_tools_ViewCache.__name__ = ["coconut","ui","tools","ViewCache"]; coconut_ui_tools_ViewCache.prototype = { cached: function(f) { var o = { cache : this}; coconut_ui_tools_ViewCache.stack.push(o); var ret = f(); HxOverrides.remove(coconut_ui_tools_ViewCache.stack,o); this.purge(); return ret; } ,purge: function() { var _this = this.__cache; var f = new haxe_ds__$StringMap_StringMapIterator(_this,_this.arrayKeys()); while(f.hasNext()) { var f1 = f.next(); f1.purge(); } } ,getFactory: function(cls,make) { var _g = this.__cache.get(cls); var tmp; if(_g == null) { var this1 = this.__cache; var v = new coconut_ui_tools__$ViewCache_Factory(make); this1.set(cls,v); tmp = v; } else { var v1 = _g; tmp = v1; } return tmp; } ,__class__: coconut_ui_tools_ViewCache }; var contraptions_TransitionResult = { __ename__ : true, __constructs__ : ["Completed","Aborted","Exchanged"] }; contraptions_TransitionResult.Completed = ["Completed",0]; contraptions_TransitionResult.Completed.toString = $estr; contraptions_TransitionResult.Completed.__enum__ = contraptions_TransitionResult; contraptions_TransitionResult.Aborted = function(instead) { var $x = ["Aborted",1,instead]; $x.__enum__ = contraptions_TransitionResult; $x.toString = $estr; return $x; }; contraptions_TransitionResult.Exchanged = function(instead,completion) { var $x = ["Exchanged",2,instead,completion]; $x.__enum__ = contraptions_TransitionResult; $x.toString = $estr; return $x; }; var epaper_debug_DebugUi = function() { }; epaper_debug_DebugUi.__name__ = ["epaper","debug","DebugUi"]; epaper_debug_DebugUi.init = function(root,visible,config) { if(visible == null) { visible = false; } if(root == null) { root = window.document.body.querySelector(".epaper-root"); } if(!epaper_debug_DebugUi.initialized) { epaper_debug_DebugUi.changeSignal = tink_core__$Signal_Signal_$Impl_$.trigger(); } else { return tink_core__$Signal_Signal_$Impl_$.filter(epaper_debug_DebugUi.changeSignal,function(_) { return epaper_debug_DebugUi.active; }); } var ui = Dom.getElement(epaper_debug_DebugUi.render(visible,"/* debug.sass */\n/* globaltools.sass */\n.nodisplay {\n display: none !important;\n}\n\n.scroll-container {\n overflow-x: hidden;\n overflow-y: hidden;\n position: relative;\n}\n\n.scroll-container .virtual-scollbar {\n z-index: 1;\n pointer-events: none;\n position: absolute;\n height: 100%;\n -moz-transition: opacity, right, width, background;\n transition: opacity, right, width, background;\n -moz-transition-duration: .15s;\n transition-duration: .15s;\n visibility: hidden;\n opacity: 0;\n right: 1px;\n width: 3px;\n background: #f0f;\n -moz-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n}\n\n.scroll-container[data-scrollable] .virtual-scollbar {\n visibility: visible;\n opacity: .25;\n}\n\n.scroll-container:hover .virtual-scollbar {\n opacity: .55;\n}\n\n.scroll-container .scroll-box {\n position: relative;\n height: 100%;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n.scroll-container .scroll-box::-webkit-scrollbar {\n display: none;\n}\n\n[data-show-overflow=\"no\"].epaper-root {\n overflow: hidden;\n}\n\n:not([data-debug-device=\"dynamic\"])[data-show-overflow=\"yes\"].epaper-root::after {\n border: 1px solid red;\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n content: ' ';\n pointer-events: none;\n}\n\n[data-input=\"touch\"].epaper-root * {\n cursor: crosshair !important;\n cursor: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjNJREFUeNrEl8kvBEEUxqvLOrETEmLfb4ib5YKDg6ODv86JC4lws0SEg2RCHCwRCRfEkkFCLLOZ9j35WjqT0Ro93S/5TSadTr+v3lL1ylhY21W/sBrQBlr4vxTkgFfwAK7ACTgHcTcfzHXxjgHaQQ9oBiVAA9P2ThFpBH0gAo7AAXj8j4B6MAo6QB5Igvc053aT5wUU2goGwDYIg8RvBMiqB8EIVybhjLlMk2lzVg4mQCdYAvduBMizcTDE1cbU3y3JxXSDCjDP+vgynWHl4nzYFu7/mkQkCqrBFKh1EjDAlUvIU8pbk29WgklQnEmAVXBOReaFiAYwli5A03mRR2H/SUQ/95MvAa1stbjKvqXY0pJuQ7PwevnQVP5YkptbrQio4saRVP6ZRKEQdGmGvsSH3GcS0aR5sGjlv4mACs0NwgxAgPgMiYAyFYxJBPK1yyM5W6ZFwEtAzqX9E5qTTFACYppjlBFE+MGz5gwXDaAVPxcvPxfgjsOl3214pjnxHPkcgVwOrqeW033Oa361pER7D7xZAp44vfqRhjwW/k76RBRmQRZmufDk0Fu19h+7gARH51vZIrPkXFK8Do6/G0qlDua4ORV4nHNxvgU2naZixbacAZdMh/Yg59JyK2A5fdr+7uNSJNMsTJMpMf7QahLFGzALNjKN+k5tJ0WyCA45QLYxIikbpm1fN7gg6+IaYavtOB14bvr+lNTJDCdjFK9ZIUZG2+6Oz+Ca75/x2u5oHwIMAKGvgmea61TDAAAAAElFTkSuQmCC\") 16 16, crosshair !important;\n}\n\nbody::-webkit-scrollbar {\n width: 10px !important;\n height: 10px !important;\n}\n\nbody::-webkit-scrollbar-track {\n background: grey !important;\n}\n\nbody::-webkit-scrollbar-thumb {\n background: red !important;\n}\n\n.debug-ui {\n position: fixed;\n z-index: 10;\n top: 20px;\n left: 50%;\n -moz-transform: translateX(-50%);\n transform: translateX(-50%);\n max-width: -moz-calc(100vw - 10px);\n max-width: calc(100vw - 10px);\n max-height: -moz-calc(100vh - 10px);\n max-height: calc(100vh - 10px);\n overflow-y: auto;\n padding: 10px;\n opacity: 0.5;\n background: #ccc;\n display: -moz-box;\n display: flex;\n -moz-box-orient: vertical;\n -moz-box-direction: normal;\n flex-direction: column;\n}\n\n.debug-ui .row {\n display: -moz-box;\n display: flex;\n -moz-box-orient: horizontal;\n -moz-box-direction: normal;\n flex-direction: row;\n -moz-box-pack: justify;\n justify-content: space-between;\n}\n\n.debug-ui .col {\n display: -moz-box;\n display: flex;\n -moz-box-orient: vertical;\n -moz-box-direction: normal;\n flex-direction: column;\n}\n\n.debug-ui:hover {\n opacity: 0.8;\n}\n\n.debug-ui h1 {\n font-size: 15px;\n}\n\n.debug-ui .devices {\n display: -moz-box;\n display: flex;\n -moz-box-orient: horizontal;\n -moz-box-direction: normal;\n flex-direction: row;\n -moz-box-align: start;\n align-items: flex-start;\n}\n\n.debug-ui .switches {\n display: -moz-box;\n display: flex;\n}\n\n.debug-ui .switches.passive {\n -moz-box-orient: horizontal;\n -moz-box-direction: normal;\n flex-direction: row;\n -moz-box-align: start;\n align-items: flex-start;\n}\n\n.debug-ui .switches.active {\n -moz-box-align: end;\n align-items: flex-end;\n -moz-box-orient: horizontal;\n -moz-box-direction: normal;\n flex-direction: row;\n border-bottom: 1px solid #333;\n width: 595px;\n position: relative;\n}\n\n.debug-ui .switches .switch {\n display: -moz-box;\n display: flex;\n -moz-box-orient: vertical;\n -moz-box-direction: normal;\n flex-direction: column;\n margin-bottom: 10px;\n}\n\n.debug-ui .properties {\n display: -moz-box;\n display: flex;\n flex-wrap: wrap;\n}\n\n.debug-ui .properties > li {\n list-style: none;\n margin: 0 5px;\n font-size: 10px;\n}\n\n.debug-ui .properties > li select {\n font-size: 12px;\n}\n\n.debug-ui .properties > li select option {\n font-size: 15px;\n}\n\n.debug-ui .options {\n display: -moz-box;\n display: flex;\n flex-wrap: no-wrap;\n}\n\n.debug-ui .debug-infos {\n font-size: 10px;\n}\n\n.debug-ui:not(:hover) {\n background: #333;\n}\n\n.debug-ui:not(:hover) .device-input:checked + label {\n background: #111;\n}\n\n.debug-ui:not(:hover) .switch[data-highlight]:before {\n color: white;\n}\n\n.debug-ui:not(:hover) h1,\n.debug-ui:not(:hover) .device-input:not(:checked) + label,\n.debug-ui:not(:hover) .switches.active,\n.debug-ui:not(:hover) .switch:not([data-highlight]),\n.debug-ui:not(:hover) .debug-option-label {\n display: none;\n}\n\n.debug-ui:not(:hover) .properties {\n display: none;\n}\n\n.debug-ui:not(:hover) .debug-infos {\n display: none;\n}\n\n.debug-ui .device-input,\n.debug-ui .switch input,\n.debug-ui .debug-option-input {\n display: none;\n}\n\n.debug-ui .device-input:checked + label,\n.debug-ui .switch input:checked + label,\n.debug-ui .debug-option-input:checked + label {\n background: #333;\n color: white;\n}\n\n.debug-ui .device-label,\n.debug-ui .switch label,\n.debug-ui .debug-option-label {\n background: #eee;\n margin: 0 5px;\n padding: 5px;\n cursor: pointer;\n display: -moz-box;\n display: flex;\n -moz-box-orient: vertical;\n -moz-box-direction: normal;\n flex-direction: column;\n min-width: 75px;\n max-width: 75px;\n word-wrap: break-word;\n font-size: 12px;\n}\n\n.debug-ui .device-label .head,\n.debug-ui .switch label .head,\n.debug-ui .debug-option-label .head {\n font-size: 12px;\n}\n\n.debug-ui .device-label .desc,\n.debug-ui .switch label .desc,\n.debug-ui .debug-option-label .desc {\n font-size: 9px;\n}\n\n.debug-ui .switch::before {\n content: attr(data-prop);\n font-size: 10px;\n text-align: center;\n}\n\n.debug-ui .switch[data-highlight] input:checked + label {\n -moz-animation: flash-red 3s;\n animation: flash-red 3s;\n}\n\n@-moz-keyframes flash-red {\n 0%, 30% {\n background: red;\n }\n 100% {\n background: #333;\n }\n}\n\n@keyframes flash-red {\n 0%, 30% {\n background: red;\n }\n 100% {\n background: #333;\n }\n}\n\nbody {\n background: #333;\n overflow-x: auto !important;\n overflow-y: auto !important;\n position: static !important;\n}\n\n.device-mock {\n pointer-events: none;\n position: absolute;\n background-repeat: no-repeat;\n display: none;\n}\n\n[data-debug-device=\"dynamic\"].epaper-root {\n width: 100%;\n height: 100%;\n}\n\n[data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 3840px;\n height: 2160px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 3840px;\n height: 2160px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 2160px;\n height: 3840px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 2160px;\n height: 3840px;\n}\n\n[data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 2560px;\n height: 1440px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 2560px;\n height: 1440px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1440px;\n height: 2560px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1440px;\n height: 2560px;\n}\n\n[data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1920px;\n height: 1080px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1920px;\n height: 1080px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1080px;\n height: 1920px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1080px;\n height: 1920px;\n}\n\n[data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1280px;\n height: 800px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1280px;\n height: 800px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 800px;\n height: 1280px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 800px;\n height: 1280px;\n}\n\n[data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 640px;\n height: 800px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 640px;\n height: 800px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 800px;\n height: 640px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 800px;\n height: 640px;\n}\n\n[data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 800px;\n height: 600px;\n margin-left: -moz-calc(-800px/2);\n margin-left: calc(-800px/2);\n margin-top: -moz-calc(-600px/2);\n margin-top: calc(-600px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 800px;\n height: 600px;\n margin-left: -moz-calc(-800px/2);\n margin-left: calc(-800px/2);\n margin-top: -moz-calc(-600px/2);\n margin-top: calc(-600px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 600px;\n height: 800px;\n margin-left: -moz-calc(-600px/2);\n margin-left: calc(-600px/2);\n margin-top: -moz-calc(-800px/2);\n margin-top: calc(-800px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 600px;\n height: 800px;\n margin-left: -moz-calc(-600px/2);\n margin-left: calc(-600px/2);\n margin-top: -moz-calc(-800px/2);\n margin-top: calc(-800px/2);\n}\n\n[data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 475px;\n height: 275px;\n margin-left: -moz-calc(-475px/2);\n margin-left: calc(-475px/2);\n margin-top: -moz-calc(-275px/2);\n margin-top: calc(-275px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 475px;\n height: 275px;\n margin-left: -moz-calc(-475px/2);\n margin-left: calc(-475px/2);\n margin-top: -moz-calc(-275px/2);\n margin-top: calc(-275px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 275px;\n height: 475px;\n margin-left: -moz-calc(-275px/2);\n margin-left: calc(-275px/2);\n margin-top: -moz-calc(-475px/2);\n margin-top: calc(-475px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 275px;\n height: 475px;\n margin-left: -moz-calc(-275px/2);\n margin-left: calc(-275px/2);\n margin-top: -moz-calc(-475px/2);\n margin-top: calc(-475px/2);\n}\n\n[data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 475px;\n height: 275px;\n margin-left: -moz-calc(-475px/2);\n margin-left: calc(-475px/2);\n margin-top: -moz-calc(-275px/2);\n margin-top: calc(-275px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 475px;\n height: 275px;\n margin-left: -moz-calc(-475px/2);\n margin-left: calc(-475px/2);\n margin-top: -moz-calc(-275px/2);\n margin-top: calc(-275px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 275px;\n height: 475px;\n margin-left: -moz-calc(-275px/2);\n margin-left: calc(-275px/2);\n margin-top: -moz-calc(-475px/2);\n margin-top: calc(-475px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 275px;\n height: 475px;\n margin-left: -moz-calc(-275px/2);\n margin-left: calc(-275px/2);\n margin-top: -moz-calc(-475px/2);\n margin-top: calc(-475px/2);\n}\n\n[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 360px;\n height: 640px;\n margin-left: -moz-calc(-360px/2);\n margin-left: calc(-360px/2);\n margin-top: -moz-calc(-640px/2);\n margin-top: calc(-640px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 360px;\n height: 640px;\n margin-left: -moz-calc(-360px/2);\n margin-left: calc(-360px/2);\n margin-top: -moz-calc(-640px/2);\n margin-top: calc(-640px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 640px;\n height: 360px;\n margin-left: -moz-calc(-640px/2);\n margin-left: calc(-640px/2);\n margin-top: -moz-calc(-360px/2);\n margin-top: calc(-360px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 640px;\n height: 360px;\n margin-left: -moz-calc(-640px/2);\n margin-left: calc(-640px/2);\n margin-top: -moz-calc(-360px/2);\n margin-top: calc(-360px/2);\n}\n\n[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/galaxyS7.png);\n width: 397px;\n height: 753px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-397px/2);\n margin-left: calc(-397px/2);\n margin-top: -moz-calc(-753px/2);\n margin-top: calc(-753px/2);\n}\n\n[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/galaxyS7.png);\n width: 397px;\n height: 753px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-397px/2);\n margin-left: calc(-397px/2);\n margin-top: -moz-calc(-753px/2);\n margin-top: calc(-753px/2);\n}\n\n[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 600px;\n height: 960px;\n margin-left: -moz-calc(-600px/2);\n margin-left: calc(-600px/2);\n margin-top: -moz-calc(-960px/2);\n margin-top: calc(-960px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 600px;\n height: 960px;\n margin-left: -moz-calc(-600px/2);\n margin-left: calc(-600px/2);\n margin-top: -moz-calc(-960px/2);\n margin-top: calc(-960px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 960px;\n height: 600px;\n margin-left: -moz-calc(-960px/2);\n margin-left: calc(-960px/2);\n margin-top: -moz-calc(-600px/2);\n margin-top: calc(-600px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 960px;\n height: 600px;\n margin-left: -moz-calc(-960px/2);\n margin-left: calc(-960px/2);\n margin-top: -moz-calc(-600px/2);\n margin-top: calc(-600px/2);\n}\n\n[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/nexus7.png);\n width: 674px;\n height: 1204px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-674px/2);\n margin-left: calc(-674px/2);\n margin-top: -moz-calc(-1204px/2);\n margin-top: calc(-1204px/2);\n}\n\n[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/nexus7.png);\n width: 674px;\n height: 1204px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-674px/2);\n margin-left: calc(-674px/2);\n margin-top: -moz-calc(-1204px/2);\n margin-top: calc(-1204px/2);\n}\n\n[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 320px;\n height: 568px;\n margin-left: -moz-calc(-320px/2);\n margin-left: calc(-320px/2);\n margin-top: -moz-calc(-568px/2);\n margin-top: calc(-568px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 320px;\n height: 568px;\n margin-left: -moz-calc(-320px/2);\n margin-left: calc(-320px/2);\n margin-top: -moz-calc(-568px/2);\n margin-top: calc(-568px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 568px;\n height: 320px;\n margin-left: -moz-calc(-568px/2);\n margin-left: calc(-568px/2);\n margin-top: -moz-calc(-320px/2);\n margin-top: calc(-320px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 568px;\n height: 320px;\n margin-left: -moz-calc(-568px/2);\n margin-left: calc(-568px/2);\n margin-top: -moz-calc(-320px/2);\n margin-top: calc(-320px/2);\n}\n\n[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone5.png);\n width: 379px;\n height: 803px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-379px/2);\n margin-left: calc(-379px/2);\n margin-top: -moz-calc(-803px/2);\n margin-top: calc(-803px/2);\n}\n\n[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone5.png);\n width: 379px;\n height: 803px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-379px/2);\n margin-left: calc(-379px/2);\n margin-top: -moz-calc(-803px/2);\n margin-top: calc(-803px/2);\n}\n\n[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 375px;\n height: 667px;\n margin-left: -moz-calc(-375px/2);\n margin-left: calc(-375px/2);\n margin-top: -moz-calc(-667px/2);\n margin-top: calc(-667px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 375px;\n height: 667px;\n margin-left: -moz-calc(-375px/2);\n margin-left: calc(-375px/2);\n margin-top: -moz-calc(-667px/2);\n margin-top: calc(-667px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 667px;\n height: 375px;\n margin-left: -moz-calc(-667px/2);\n margin-left: calc(-667px/2);\n margin-top: -moz-calc(-375px/2);\n margin-top: calc(-375px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 667px;\n height: 375px;\n margin-left: -moz-calc(-667px/2);\n margin-left: calc(-667px/2);\n margin-top: -moz-calc(-375px/2);\n margin-top: calc(-375px/2);\n}\n\n[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone6.png);\n width: 436px;\n height: 884px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-436px/2);\n margin-left: calc(-436px/2);\n margin-top: -moz-calc(-884px/2);\n margin-top: calc(-884px/2);\n}\n\n[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone6.png);\n width: 436px;\n height: 884px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-436px/2);\n margin-left: calc(-436px/2);\n margin-top: -moz-calc(-884px/2);\n margin-top: calc(-884px/2);\n}\n\n[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 414px;\n height: 736px;\n margin-left: -moz-calc(-414px/2);\n margin-left: calc(-414px/2);\n margin-top: -moz-calc(-736px/2);\n margin-top: calc(-736px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 414px;\n height: 736px;\n margin-left: -moz-calc(-414px/2);\n margin-left: calc(-414px/2);\n margin-top: -moz-calc(-736px/2);\n margin-top: calc(-736px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 736px;\n height: 414px;\n margin-left: -moz-calc(-736px/2);\n margin-left: calc(-736px/2);\n margin-top: -moz-calc(-414px/2);\n margin-top: calc(-414px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 736px;\n height: 414px;\n margin-left: -moz-calc(-736px/2);\n margin-left: calc(-736px/2);\n margin-top: -moz-calc(-414px/2);\n margin-top: calc(-414px/2);\n}\n\n[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone6plus.png);\n width: 481px;\n height: 975px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-481px/2);\n margin-left: calc(-481px/2);\n margin-top: -moz-calc(-975px/2);\n margin-top: calc(-975px/2);\n}\n\n[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone6plus.png);\n width: 481px;\n height: 975px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-481px/2);\n margin-left: calc(-481px/2);\n margin-top: -moz-calc(-975px/2);\n margin-top: calc(-975px/2);\n}\n\n[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 768px;\n height: 1024px;\n margin-left: -moz-calc(-768px/2);\n margin-left: calc(-768px/2);\n margin-top: -moz-calc(-1024px/2);\n margin-top: calc(-1024px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 768px;\n height: 1024px;\n margin-left: -moz-calc(-768px/2);\n margin-left: calc(-768px/2);\n margin-top: -moz-calc(-1024px/2);\n margin-top: calc(-1024px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1024px;\n height: 768px;\n margin-left: -moz-calc(-1024px/2);\n margin-left: calc(-1024px/2);\n margin-top: -moz-calc(-768px/2);\n margin-top: calc(-768px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1024px;\n height: 768px;\n margin-left: -moz-calc(-1024px/2);\n margin-left: calc(-1024px/2);\n margin-top: -moz-calc(-768px/2);\n margin-top: calc(-768px/2);\n}\n\n[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/ipadAir.png);\n width: 876px;\n height: 1242px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-876px/2);\n margin-left: calc(-876px/2);\n margin-top: -moz-calc(-1242px/2);\n margin-top: calc(-1242px/2);\n}\n\n[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/ipadAir.png);\n width: 876px;\n height: 1242px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-876px/2);\n margin-left: calc(-876px/2);\n margin-top: -moz-calc(-1242px/2);\n margin-top: calc(-1242px/2);\n}\n\n[data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1024px;\n height: 1366px;\n margin-left: -moz-calc(-1024px/2);\n margin-left: calc(-1024px/2);\n margin-top: -moz-calc(-1366px/2);\n margin-top: calc(-1366px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1024px;\n height: 1366px;\n margin-left: -moz-calc(-1024px/2);\n margin-left: calc(-1024px/2);\n margin-top: -moz-calc(-1366px/2);\n margin-top: calc(-1366px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1366px;\n height: 1024px;\n margin-left: -moz-calc(-1366px/2);\n margin-left: calc(-1366px/2);\n margin-top: -moz-calc(-1024px/2);\n margin-top: calc(-1024px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1366px;\n height: 1024px;\n margin-left: -moz-calc(-1366px/2);\n margin-left: calc(-1366px/2);\n margin-top: -moz-calc(-1024px/2);\n margin-top: calc(-1024px/2);\n}\n")); epaper_debug_DebugUi.active = true; window.document.body.appendChild(Dom.getElement(epaper_debug_DebugUi.renderMock())); window.document.body.appendChild(ui); if(config != null) { var tmp = Dom.getElement(epaper_debug_DebugUi.debugInfos(config)); ui.appendChild(tmp); } var apply = function(e) { var apply1 = "data-" + e.getAttribute("name"); var apply2 = e.getAttribute("value"); root.setAttribute(apply1,apply2); tink_core__$Callback_CallbackList_$Impl_$.invoke(epaper_debug_DebugUi.changeSignal.handlers,tink_core_Noise.Noise); }; var updateScreenRes = function() { var screenResEl = ui.querySelector("input.device-input:checked+label .screen-res"); if(screenResEl == null) { root.removeAttribute("data-debug-screen-width"); root.removeAttribute("data-debug-screen-height"); } else { var a = screenResEl.textContent.split("x"); if(a.length == 2) { var width = a[0]; var height = a[1]; root.setAttribute("data-debug-screen-width",width); root.setAttribute("data-debug-screen-height",height); } } }; var triggerWindowResize = function() { var evt = window.document.createEvent("UIEvents"); evt.initUIEvent("resize",true,false,window,0); window.dispatchEvent(evt); }; var switches = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(ui,".switches.passive .switch[data-prop]")); var switchInputs = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(ui,".switches .switch input")); var __tmp = new haxe_ds_StringMap(); var _g = 0; while(_g < switches.length) { var s = switches[_g]; ++_g; var key = s.getAttribute("data-prop"); if(__map_reserved[key] != null) { __tmp.setReserved(key,s); } else { __tmp.h[key] = s; } } var switchesByName = __tmp; var changeDevice = function(e1) { var device = e1.getAttribute("id"); root.setAttribute("data-debug-device",device); var p = new tink_url__$Query_QueryStringParser(e1.value,"&","=",0); while(p.hasNext()) { var p1 = p.next(); var key1 = p1.name; var ie2 = _$Dom_QueryResult_$Impl_$.query(__map_reserved[key1] != null ? switchesByName.getReserved(key1) : switchesByName.h[key1],"input[value=\"" + tink_url__$Portion_Portion_$Impl_$.toString(p1.value) + "\"]")[0]; ie2.checked = true; } epaper_debug_DebugUi.active = false; var _g1 = 0; while(_g1 < switchInputs.length) { var ie3 = switchInputs[_g1]; ++_g1; if(ie3.checked) { apply(ie3); } } updateScreenRes(); triggerWindowResize(); epaper_debug_DebugUi.active = true; tink_core__$Callback_CallbackList_$Impl_$.invoke(epaper_debug_DebugUi.changeSignal.handlers,tink_core_Noise.Noise); }; var timers = new haxe_ds_ObjectMap(); var updateSwitch = function(name,value) { var t; var el; var ie; el = __map_reserved[name] != null ? switchesByName.getReserved(name) : switchesByName.h[name]; if(el != null) { ie = _$Dom_QueryResult_$Impl_$.query(el,"input[name=\"" + name + "\"][value=\"" + value + "\"]")[0]; if(ie != null) { if(ie.checked != true) { ie.checked = true; el.setAttribute("data-highlight",""); if(timers.h[el.__id__] != null) { timers.h[el.__id__].stop(); timers.set(el,null); } t = haxe_Timer.delay(function() { el.removeAttribute("data-highlight"); },3000); timers.set(el,t); } } } }; var allSwitches = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(ui,".switches .switch[data-prop]")); var attrName; var attrVal; var _g2 = 0; while(_g2 < allSwitches.length) { var sw = allSwitches[_g2]; ++_g2; attrName = sw.getAttribute("data-prop"); attrVal = root.getAttribute("data-" + attrName); if(attrVal != null) { updateSwitch(attrName,attrVal); } } _$Dom_QueryResult_$Impl_$.on(".device-input","change",ui,function(e2) { changeDevice(e2.at); }); var tmp1 = _$Dom_QueryResult_$Impl_$.query(window.document.body,".device-input[id=\"dynamic\"]")[0]; changeDevice(tmp1); var changeOption = function(e3) { var changeOption1 = "data-" + e3.getAttribute("id"); root.setAttribute(changeOption1,e3.checked ? "yes" : "no"); }; _$Dom_QueryResult_$Impl_$.on(".debug-option-input","change",ui,function(e4) { changeOption(e4.at); }); var _g3 = 0; var _g11 = _$Dom_QueryResult_$Impl_$.query(window.document.body,".debug-option-input"); while(_g3 < _g11.length) { var e5 = _g11[_g3]; ++_g3; changeOption(e5); } var changeSwitch = function(e6) { var changeSwitch1 = "data-" + e6.getAttribute("name"); var changeSwitch2 = e6.getAttribute("value"); root.setAttribute(changeSwitch1,changeSwitch2); }; _$Dom_QueryResult_$Impl_$.on(".switch input","change",ui,function(e7) { changeSwitch(e7.at); }); _$Dom_QueryResult_$Impl_$.on(".switch input[name=\"orientation\"]","change",ui,function(e8) { updateScreenRes(); triggerWindowResize(); }); var observer = new MutationObserver(function(changes,obs) { var _g4 = 0; while(_g4 < changes.length) { var i = changes[_g4]; ++_g4; var name1; var value1; name1 = HxOverrides.substr(i.attributeName,5,null); value1 = root.getAttribute(i.attributeName); updateSwitch(name1,value1); } }); observer.observe(root,{ attributes : true}); epaper_debug_DebugUi.initialized = true; return tink_core__$Signal_Signal_$Impl_$.filter(epaper_debug_DebugUi.changeSignal,function(_1) { return epaper_debug_DebugUi.active; }); }; epaper_debug_DebugUi.render = function(visible,css) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n
\n

Debug Options

\n
  • \n \n \n \n \n
  • \n

    Active Properties

    \n
    \n \n \n \n \n
    \n
    \n

    Devices

    \n \n

    Passive Properties

    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n"; ret.s += this4; var this5 = ret.s; return this5; }; epaper_debug_DebugUi.renderMock = function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n
    \n"; ret.s += this1; var this2 = ret.s; return this2; }; epaper_debug_DebugUi.debugInfos = function(config) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n
    \n

    Debug Infos

    \n \n
    \n"; ret.s += this14; var this15 = ret.s; return this15; }; var epaper_directory_Directory = function(items,visibleAtStart,hideAtItemClick,descriptionAsTooltip,showThumbnails,book) { this.enabled = true; this.items = items; this.visibleAtStart = visibleAtStart; this.hideAtItemClick = hideAtItemClick; this.descriptionAsTooltip = descriptionAsTooltip; this.showThumbnails = showThumbnails; this.book = book; if(items == null || items.length == 0) { this.enabled = false; visibleAtStart = false; } }; epaper_directory_Directory.__name__ = ["epaper","directory","Directory"]; epaper_directory_Directory.prototype = { renderTo: function(elt) { var _gthis = this; this.target = elt; if(!this.enabled) { return; } var menuItemElement = Dom.getElement(this.renderMenuItem()); if(this.visibleAtStart) { menuItemElement.setAttribute("data-pinned",""); } _$Dom_QueryResult_$Impl_$.query(menuItemElement,".popout ul")[0].innerHTML = this.renderDirectoryItems(this.items); this.target.appendChild(menuItemElement); _$Dom_QueryResult_$Impl_$.on("a[href^=\"#\"]","click",menuItemElement,function(on) { var isTouch = Dom.query(".epaper-root")[0].getAttribute("data-input") == "touch"; if(isTouch || _gthis.hideAtItemClick) { menuItemElement.removeAttribute("data-pinned"); } }); var items = _$Dom_QueryResult_$Impl_$.query(menuItemElement,"nav>ul")[0]; tink_state__$Observable_Observable_$Impl_$.bind(this.book.get_position(),null,function(pos) { var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(items,".active-item"); while(_g < _g1.length) { var old = _g1[_g]; ++_g; old.classList.remove("active-item"); } var _g2 = 0; var _g11 = _gthis.book.getPages(pos.cur); while(_g2 < _g11.length) { var page = _g11[_g2]; ++_g2; var this1 = "[data-page-id=\"" + page.get_index() + "\"]"; var result = _$Dom_QueryResult_$Impl_$.query(items,this1)[0]; if(result != null) { result.classList.add("active-item"); } } }); var correctIEScrollContainerHeight = function() { var popOut = menuItemElement.querySelector(".popout"); if(popOut.getBoundingClientRect().height < 10) { return; } var title = menuItemElement.querySelector(".popout-title"); var scrollContainer = menuItemElement.querySelector(".popout-scrollcontainer"); var correctIEScrollContainerHeight1 = popOut.getBoundingClientRect().height - title.getBoundingClientRect().height; scrollContainer.style.maxHeight = correctIEScrollContainerHeight1 + "px"; }; var rxIE = new EReg("Trident/7\\.",""); if(rxIE.match(window.navigator.userAgent)) { window.addEventListener("resize",correctIEScrollContainerHeight); correctIEScrollContainerHeight(); } } ,renderMenuItem: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n\t\t
  • \n \n \n
  • \n"; ret.s += this7; var this8 = ret.s; return this8; } ,renderDirectoryItems: function(items) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n\t\t"; ret.s += this1; var _g = 0; while(_g < items.length) { var item = items[_g]; ++_g; var this2 = "\n\t\t
  • \n\t\t\t\t"; ret.s += this9; if(this.showThumbnails) { var this10 = "\n \"";\n "; ret.s += this12; } var this13 = "
    \n\t\t\t\t\t"; ret.s += this13; if(item["short"] != null) { var this14 = "

    "; ret.s += this14; ret.s += item["short"]; var this15 = "

    "; ret.s += this15; } var this16 = "

    \n "; ret.s += this16; if(item.page.title.length != null && item.page.title.length > 0) { var this17 = "\n "; ret.s += this17; var _g1 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g1.setReserved("lv","Lapa"); } else { _g1.h["lv"] = "Lapa"; } if(__map_reserved["tr"] != null) { _g1.setReserved("tr","Sayfa"); } else { _g1.h["tr"] = "Sayfa"; } if(__map_reserved["en"] != null) { _g1.setReserved("en","Page"); } else { _g1.h["en"] = "Page"; } if(__map_reserved["pl"] != null) { _g1.setReserved("pl","Strona"); } else { _g1.h["pl"] = "Strona"; } if(__map_reserved["fi"] != null) { _g1.setReserved("fi","Sivu"); } else { _g1.h["fi"] = "Sivu"; } if(__map_reserved["zh_Hans"] != null) { _g1.setReserved("zh_Hans","页"); } else { _g1.h["zh_Hans"] = "页"; } if(__map_reserved["ro"] != null) { _g1.setReserved("ro","Pagină"); } else { _g1.h["ro"] = "Pagină"; } if(__map_reserved["sk"] != null) { _g1.setReserved("sk","Strana"); } else { _g1.h["sk"] = "Strana"; } if(__map_reserved["ko"] != null) { _g1.setReserved("ko","페이지"); } else { _g1.h["ko"] = "페이지"; } if(__map_reserved["it"] != null) { _g1.setReserved("it","Pagina"); } else { _g1.h["it"] = "Pagina"; } if(__map_reserved["sq"] != null) { _g1.setReserved("sq","Faqe"); } else { _g1.h["sq"] = "Faqe"; } if(__map_reserved["ru"] != null) { _g1.setReserved("ru","Страница"); } else { _g1.h["ru"] = "Страница"; } if(__map_reserved["pt"] != null) { _g1.setReserved("pt","Página"); } else { _g1.h["pt"] = "Página"; } if(__map_reserved["da"] != null) { _g1.setReserved("da","Side"); } else { _g1.h["da"] = "Side"; } if(__map_reserved["el"] != null) { _g1.setReserved("el","Σελίδα"); } else { _g1.h["el"] = "Σελίδα"; } if(__map_reserved["nl"] != null) { _g1.setReserved("nl","Pagina"); } else { _g1.h["nl"] = "Pagina"; } if(__map_reserved["bg"] != null) { _g1.setReserved("bg","Страница"); } else { _g1.h["bg"] = "Страница"; } if(__map_reserved["fr"] != null) { _g1.setReserved("fr","Page"); } else { _g1.h["fr"] = "Page"; } if(__map_reserved["sr"] != null) { _g1.setReserved("sr","Страна"); } else { _g1.h["sr"] = "Страна"; } if(__map_reserved["hr"] != null) { _g1.setReserved("hr","Stranica"); } else { _g1.h["hr"] = "Stranica"; } if(__map_reserved["es"] != null) { _g1.setReserved("es","Página"); } else { _g1.h["es"] = "Página"; } if(__map_reserved["de"] != null) { _g1.setReserved("de","Seite"); } else { _g1.h["de"] = "Seite"; } if(__map_reserved["hu"] != null) { _g1.setReserved("hu","Oldal"); } else { _g1.h["hu"] = "Oldal"; } if(__map_reserved["sv"] != null) { _g1.setReserved("sv","Sida"); } else { _g1.h["sv"] = "Sida"; } if(__map_reserved["cs"] != null) { _g1.setReserved("cs","Stránka"); } else { _g1.h["cs"] = "Stránka"; } if(__map_reserved["ja"] != null) { _g1.setReserved("ja","ページ"); } else { _g1.h["ja"] = "ページ"; } if(__map_reserved["nb_NO"] != null) { _g1.setReserved("nb_NO","Side"); } else { _g1.h["nb_NO"] = "Side"; } var b6 = new epaper_i18n_Localizable("DIRECTORY_PAGE",_g1).toHTML(); ret.s += b6; var this18 = " "; ret.s += this18; ret.s += item.page.title; var this19 = "\n "; ret.s += this19; } if(item.author != null) { var this20 = "\n — "; ret.s += this20; ret.s += item.author; var this21 = "\n "; ret.s += this21; } var this22 = "

    \n\t\t\t\t\t"; ret.s += this22; if(!this.descriptionAsTooltip && item["long"] != null) { var this23 = "

    "; ret.s += this23; ret.s += item["long"]; var this24 = "

    "; ret.s += this24; } var this25 = "
    \n\t\t\t\n\t\t
  • \n\t\t"; ret.s += this25; } var this26 = "\n"; ret.s += this26; var this27 = ret.s; return this27; } ,__class__: epaper_directory_Directory }; var epaper_download_Downloads = function(allEnabled,allLink,downloads) { this.allEnabled = allEnabled; this.allLink = allLink; this.downloads = downloads; }; epaper_download_Downloads.__name__ = ["epaper","download","Downloads"]; epaper_download_Downloads.prototype = { renderTo: function(elt) { this.target = elt; this.target.appendChild(Dom.getElement(this.renderMenuItem())); this.downloadRoot = _$Dom_QueryResult_$Impl_$.query(this.target,".download")[0]; this.all = this.downloadRoot.querySelector(".all a"); this.left = this.downloadRoot.querySelector(".left a"); this.right = this.downloadRoot.querySelector(".right a"); this.single = this.downloadRoot.querySelector(".single a"); if(!this.allEnabled) { this.all.parentElement.classList.add("nodisplay"); } if(this.single != null) { tink_state__$Observable_Observable_$Impl_$.bind(this.downloads,null,$bind(this,this.update)); } } ,update: function(urls) { var setPageRef = function(downloadRoot,url) { switch(url[1]) { case 0: var v = url[2]; downloadRoot.parentElement.classList.remove("nodisplay"); downloadRoot.setAttribute("href",v); break; case 1: downloadRoot.parentElement.classList.add("nodisplay"); break; } }; var tmp = this.downloadRoot; var tmp1; switch(urls.length) { case 1: var single = urls[0]; setPageRef(this.single,single); setPageRef(this.left,haxe_ds_Option.None); setPageRef(this.right,haxe_ds_Option.None); tmp1 = "single"; break; case 2: var right = urls[1]; var left = urls[0]; setPageRef(this.single,haxe_ds_Option.None); setPageRef(this.left,left); setPageRef(this.right,right); tmp1 = "double"; break; default: throw new js__$Boot_HaxeError("assert"); } tmp.setAttribute("data-pages",tmp1); var _this = Dom.nearest(this.downloadRoot,".download").classList; var force = this.downloadRoot.querySelectorAll(".popout li:not(.nodisplay)").length == 0; if(force == null) { force = !_this.contains("disabled"); } if(force) { _this.add("disabled"); } else { _this.remove("disabled"); } } ,renderMenuItem: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n
  • \n \n \n
  • \n"; ret.s += this11; var this12 = ret.s; return this12; } ,__class__: epaper_download_Downloads }; var epaper_flipbook_PageOverView = function() { }; epaper_flipbook_PageOverView.__name__ = ["epaper","flipbook","PageOverView"]; epaper_flipbook_PageOverView.prototype = { __class__: epaper_flipbook_PageOverView }; var epaper_flipbook_Engine = function() { }; epaper_flipbook_Engine.__name__ = ["epaper","flipbook","Engine"]; epaper_flipbook_Engine.prototype = { __class__: epaper_flipbook_Engine }; var epaper_flipbook_DomEngine = function(bookViewPageMode,pageShadowEnabled,defaultZoomMultiplier,root) { this.pointerDist = -1; var _gthis = this; this.lazy_isOpen = new tink_core__$Lazy_LazyFunc(function() { return tink_state__$Observable_Observable_$Impl_$.map(_gthis.view.grid.get_state(),tink_state__$Observable_Transform_$Impl_$.plain(function(v) { return v != flipbook_pagegrid_GridState.SinglePage; })); }); this._navigate = new tink_core_SignalTrigger(); this._mediaOpened = new tink_core_SignalTrigger(); this.focus = new epaper_media_MediaFocus(); this.mediaOpened = this._mediaOpened; this.navigate = this._navigate; this.root = root; this.view = new flipbook_BookView(root,{ pageMode : bookViewPageMode, autoSize : true}); var from = haxe_ds_Option.None; var last = this.view.pagination.page; var mkpos = function(page,from1) { if(from1 == null) { from1 = haxe_ds_Option.None; } return new epaper_flipbook_BookPosition(2 - _gthis.view.pagination.get_step(),page,_gthis.view.pagination.get_length() - 1,from1); }; var get = function() { return mkpos(_gthis.view.pagination.page,from); }; var t = tink_core__$Signal_Signal_$Impl_$.trigger(); this.view.pagination.get_pageChanged().handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { var from2 = tink_core__$Signal_Signal_$Impl_$.trigger(); from = haxe_ds_Option.Some(new epaper_flipbook_PageTransition(last,from2)); last = _gthis.view.pagination.page; var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { from = haxe_ds_Option.None; tink_core__$Callback_CallbackList_$Impl_$.invoke(t.handlers,tink_core_Noise.Noise); },650),$bind($_,$_.stop))); var tmp = root.querySelector(".book button.prev.hoverable.button-resetted"); var tmp1; var tmp2 = _gthis.view.pagination.firstPage(); if(last == tmp2) { tmp1 = "true"; } else { tmp1 = "false"; } tmp.setAttribute("aria-disabled",tmp1); var tmp3 = root.querySelector(".book button.next.hoverable.button-resetted"); var tmp4; var tmp5 = _gthis.view.pagination.lastPage(); if(last == tmp5) { tmp4 = "true"; } else { tmp4 = "false"; } tmp3.setAttribute("aria-disabled",tmp4); })); var changed = tink_core__$Signal_Signal_$Impl_$.join(this.view.pagination.get_pageChanged(),t); var this2 = tink_state__$Observable_Observable_$Impl_$.create(function() { var this3; var this4 = new tink_core_MPair(get(),tink_core__$Signal_Signal_$Impl_$.nextTime(changed,null)); this3 = this4; return this3; }); this.position = this2; this.zoom = new epaper_flipbook__$DomEngine_DomZoomController(this.view.zoom); var get1 = function() { if(_gthis.view.pagination.get_step() == 1) { return epaper_flipbook_PageMode.Single; } else { return epaper_flipbook_PageMode.Double; } }; var changed1 = this.view.pagination.get_pageChanged(); var this5 = tink_state__$Observable_Observable_$Impl_$.create(function() { var this6; var this7 = new tink_core_MPair(get1(),tink_core__$Signal_Signal_$Impl_$.nextTime(changed1,null)); this6 = this7; return this6; }); this.pageMode = this5; var __tmp = []; var iterator_p = this.view.pagination.iterator(); var iterator_i_step; var iterator_i_offset; var iterator_i_max; var iterator_i_cur; iterator_i_step = 1; iterator_i_offset = 0; iterator_i_cur = 0; iterator_i_max = Math.ceil(this.view.pagination.get_length() / 1); while(iterator_i_cur < iterator_i_max && iterator_p.hasNext()) { var p = iterator_p.next(); var i = iterator_i_offset + iterator_i_cur++ * iterator_i_step; __tmp.push(new epaper_flipbook__$DomEngine_DomPageView(i,p,this.get_focus(),$bind(this,this.flipTo),this._mediaOpened,($_=this._navigate,$bind($_,$_.trigger)))); } this.pages = __tmp; this.pointerEvtCache = []; root.setAttribute("data-page-shadow",pageShadowEnabled); var _g = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g.setReserved("lv",""); } else { _g.h["lv"] = ""; } if(__map_reserved["tr"] != null) { _g.setReserved("tr","Önceki sayfa"); } else { _g.h["tr"] = "Önceki sayfa"; } if(__map_reserved["en"] != null) { _g.setReserved("en","Previous Page"); } else { _g.h["en"] = "Previous Page"; } if(__map_reserved["pl"] != null) { _g.setReserved("pl","Poprzednia strona"); } else { _g.h["pl"] = "Poprzednia strona"; } if(__map_reserved["fi"] != null) { _g.setReserved("fi","Edellinen sivu"); } else { _g.h["fi"] = "Edellinen sivu"; } if(__map_reserved["zh_Hans"] != null) { _g.setReserved("zh_Hans","上一页"); } else { _g.h["zh_Hans"] = "上一页"; } if(__map_reserved["ro"] != null) { _g.setReserved("ro","Pagina anterioară"); } else { _g.h["ro"] = "Pagina anterioară"; } if(__map_reserved["sk"] != null) { _g.setReserved("sk","Predchádzajúca strana"); } else { _g.h["sk"] = "Predchádzajúca strana"; } if(__map_reserved["ko"] != null) { _g.setReserved("ko","이전 페이지"); } else { _g.h["ko"] = "이전 페이지"; } if(__map_reserved["it"] != null) { _g.setReserved("it","Pagina precedente"); } else { _g.h["it"] = "Pagina precedente"; } if(__map_reserved["sq"] != null) { _g.setReserved("sq","Faqja e mëparshme"); } else { _g.h["sq"] = "Faqja e mëparshme"; } if(__map_reserved["ru"] != null) { _g.setReserved("ru","Предыдущая страница"); } else { _g.h["ru"] = "Предыдущая страница"; } if(__map_reserved["pt"] != null) { _g.setReserved("pt","Página anterior"); } else { _g.h["pt"] = "Página anterior"; } if(__map_reserved["da"] != null) { _g.setReserved("da","Forrige side"); } else { _g.h["da"] = "Forrige side"; } if(__map_reserved["el"] != null) { _g.setReserved("el","Προηγούμενη σελίδα"); } else { _g.h["el"] = "Προηγούμενη σελίδα"; } if(__map_reserved["nl"] != null) { _g.setReserved("nl","Vorige pagina"); } else { _g.h["nl"] = "Vorige pagina"; } if(__map_reserved["bg"] != null) { _g.setReserved("bg","Предишна страница"); } else { _g.h["bg"] = "Предишна страница"; } if(__map_reserved["fr"] != null) { _g.setReserved("fr","Page précédente"); } else { _g.h["fr"] = "Page précédente"; } if(__map_reserved["sr"] != null) { _g.setReserved("sr","Претходна страна"); } else { _g.h["sr"] = "Претходна страна"; } if(__map_reserved["hr"] != null) { _g.setReserved("hr","Prethodna stranica"); } else { _g.h["hr"] = "Prethodna stranica"; } if(__map_reserved["es"] != null) { _g.setReserved("es","Página anterior"); } else { _g.h["es"] = "Página anterior"; } if(__map_reserved["de"] != null) { _g.setReserved("de","Vorige Seite"); } else { _g.h["de"] = "Vorige Seite"; } if(__map_reserved["hu"] != null) { _g.setReserved("hu","Előző oldal"); } else { _g.h["hu"] = "Előző oldal"; } if(__map_reserved["sv"] != null) { _g.setReserved("sv","Föregående sida"); } else { _g.h["sv"] = "Föregående sida"; } if(__map_reserved["cs"] != null) { _g.setReserved("cs","Předchozí stránka"); } else { _g.h["cs"] = "Předchozí stránka"; } if(__map_reserved["ja"] != null) { _g.setReserved("ja","前のページ"); } else { _g.h["ja"] = "前のページ"; } if(__map_reserved["nb_NO"] != null) { _g.setReserved("nb_NO","Forrige side"); } else { _g.h["nb_NO"] = "Forrige side"; } var previousPageLabel = new epaper_i18n_Localizable("BOOK_VIEW_PREVIOUS_PAGE",_g).toString(); var _g1 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g1.setReserved("lv",""); } else { _g1.h["lv"] = ""; } if(__map_reserved["tr"] != null) { _g1.setReserved("tr","Sonraki sayfa"); } else { _g1.h["tr"] = "Sonraki sayfa"; } if(__map_reserved["en"] != null) { _g1.setReserved("en","Next Page"); } else { _g1.h["en"] = "Next Page"; } if(__map_reserved["pl"] != null) { _g1.setReserved("pl","Następna strona"); } else { _g1.h["pl"] = "Następna strona"; } if(__map_reserved["fi"] != null) { _g1.setReserved("fi","Seuraava sivu"); } else { _g1.h["fi"] = "Seuraava sivu"; } if(__map_reserved["zh_Hans"] != null) { _g1.setReserved("zh_Hans","下一页"); } else { _g1.h["zh_Hans"] = "下一页"; } if(__map_reserved["ro"] != null) { _g1.setReserved("ro","Pagina următoare"); } else { _g1.h["ro"] = "Pagina următoare"; } if(__map_reserved["sk"] != null) { _g1.setReserved("sk","Ďalšia strana"); } else { _g1.h["sk"] = "Ďalšia strana"; } if(__map_reserved["ko"] != null) { _g1.setReserved("ko","다음 페이지"); } else { _g1.h["ko"] = "다음 페이지"; } if(__map_reserved["it"] != null) { _g1.setReserved("it","Pagina successiva"); } else { _g1.h["it"] = "Pagina successiva"; } if(__map_reserved["sq"] != null) { _g1.setReserved("sq","Faqja tjetër"); } else { _g1.h["sq"] = "Faqja tjetër"; } if(__map_reserved["ru"] != null) { _g1.setReserved("ru","Следующая страница"); } else { _g1.h["ru"] = "Следующая страница"; } if(__map_reserved["pt"] != null) { _g1.setReserved("pt","Próxima página"); } else { _g1.h["pt"] = "Próxima página"; } if(__map_reserved["da"] != null) { _g1.setReserved("da","Næste side"); } else { _g1.h["da"] = "Næste side"; } if(__map_reserved["el"] != null) { _g1.setReserved("el","Επόμενη σελίδα"); } else { _g1.h["el"] = "Επόμενη σελίδα"; } if(__map_reserved["nl"] != null) { _g1.setReserved("nl","Volgende pagina"); } else { _g1.h["nl"] = "Volgende pagina"; } if(__map_reserved["bg"] != null) { _g1.setReserved("bg","Следваща страница"); } else { _g1.h["bg"] = "Следваща страница"; } if(__map_reserved["fr"] != null) { _g1.setReserved("fr","Page suivante"); } else { _g1.h["fr"] = "Page suivante"; } if(__map_reserved["sr"] != null) { _g1.setReserved("sr","Следећа страна"); } else { _g1.h["sr"] = "Следећа страна"; } if(__map_reserved["hr"] != null) { _g1.setReserved("hr","Sljedeća stranica"); } else { _g1.h["hr"] = "Sljedeća stranica"; } if(__map_reserved["es"] != null) { _g1.setReserved("es","Página siguiente"); } else { _g1.h["es"] = "Página siguiente"; } if(__map_reserved["de"] != null) { _g1.setReserved("de","Nächste Seite"); } else { _g1.h["de"] = "Nächste Seite"; } if(__map_reserved["hu"] != null) { _g1.setReserved("hu","Következő oldal"); } else { _g1.h["hu"] = "Következő oldal"; } if(__map_reserved["sv"] != null) { _g1.setReserved("sv","Nästa sida"); } else { _g1.h["sv"] = "Nästa sida"; } if(__map_reserved["cs"] != null) { _g1.setReserved("cs","Další stránka"); } else { _g1.h["cs"] = "Další stránka"; } if(__map_reserved["ja"] != null) { _g1.setReserved("ja","次のページ"); } else { _g1.h["ja"] = "次のページ"; } if(__map_reserved["nb_NO"] != null) { _g1.setReserved("nb_NO","Neste side"); } else { _g1.h["nb_NO"] = "Neste side"; } var nextPageLabel = new epaper_i18n_Localizable("BOOK_VIEW_NEXT_PAGE",_g1).toString(); var _g2 = root.querySelector(".book"); if(_g2 != null) { var v1 = _g2; v1.appendChild(Dom.tag("button.prev.hoverable.button-resetted",{ "type" : "button", "aria-label" : previousPageLabel, "aria-disabled" : this.view.pagination.page == this.view.pagination.firstPage() ? "true" : "false", "title" : previousPageLabel})); v1.appendChild(Dom.tag("button.next.hoverable.button-resetted",{ "type" : "button", "aria-label" : nextPageLabel, "aria-disabled" : this.view.pagination.page == this.view.pagination.lastPage() ? "true" : "false", "title" : nextPageLabel})); } this.view.zoom.calcDefaultFactor = function() { var minDefaultZoom = 2; var ZoomRange = _gthis.view.zoom.get_maxFactor() - minDefaultZoom; var defaultZoom = minDefaultZoom + ZoomRange * ((-1 + defaultZoomMultiplier) / 9); return defaultZoom; }; var touchUI = "ontouchstart" in document; if(!touchUI) { Dom.on(this.view.zoom.book,"pointerdown",$bind(this,this.pointerDown)); Dom.on(this.view.zoom.book,"pointermove",$bind(this,this.pointerMove)); Dom.on(this.view.zoom.book,"pointerup pointercancel pointerout pointerleave",$bind(this,this.pointerUp)); } Dom.on(this.view.zoom.book,"wheel",$bind(this,this.wheelZoom)); Dom.on(this.view.zoom.book,"mousedown",$bind(this,this.startDrag)); Dom.on(this.view.zoom.book,"dblclick",function(e) { var _g3 = e.target.tagName; switch(_g3) { case "A":case "BUTTON":case "INPUT":case "LABEL":case "NAV": break; default: var _gthis1 = _gthis.view.zoom; var tmp6 = _gthis.point(e); _gthis1.toggle(_gthis.clientToViewport(tmp6)); } }); var firstUp = null; var secondUp = null; var timeOut = null; var startTime; var startPt; if(touchUI) { Dom.on(this.view.zoom.book,"touchstart",function(e1) { if(e1.touches.length != 1) { return; } if(firstUp != null || secondUp != null || timeOut != null) { return; } startTime = new Date().getTime() / 1000; startPt = _gthis.point(e1.touches[0]); firstUp = Dom.once(_gthis.view.zoom.book,"touchend",function(e2) { firstUp = null; if(e2.touches.length != 0 || e2.changedTouches.length != 1) { return; } if(new Date().getTime() / 1000 - startTime > 0.15) { return; } var a = _gthis.point(e2.changedTouches[0]); var this8; var this9 = new tink_core_MPair(a.a - startPt.a,a.b - startPt.b); this8 = this9; var this10 = this8; if(Math.sqrt(this10.a * this10.a + this10.b * this10.b) > 10) { return; } var this11 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { if(secondUp != null) { secondUp.dissolve(); } secondUp = null; timeOut = null; },300),$bind($_,$_.stop))); timeOut = this11; secondUp = Dom.once(_gthis.view.zoom.book,"touchend",function(e3) { secondUp = null; if(e3.touches.length != 0 || e3.changedTouches.length != 1) { return; } if(timeOut != null) { timeOut.dissolve(); } timeOut = null; var _gthis2 = _gthis.view.zoom; var secondUp1 = _gthis.point(e3.changedTouches[0]); _gthis2.toggle(_gthis.clientToViewport(secondUp1)); }); }); }); } var touch = new util_touch_TouchHandler(); var inBook = function(p1) { return _gthis.view.zoom.book.contains(p1.target); }; touch.get_pinch().handle(function(p2) { if(inBook(p2)) { _gthis.view.zoom.scaleBy(p2.scale,{ center : _gthis.clientToViewport(p2.center)}); } }); var isPanning = tink_state__$State_State_$Impl_$.ofConstant(false); this.currentInteraction = tink_state__$Observable_Observable_$Impl_$.map(isPanning,tink_state__$Observable_Transform_$Impl_$.plain(function(panning) { if(panning) { return epaper_flipbook_BookInteraction.Panning; } else { return epaper_flipbook_BookInteraction.Idle; } })); var singleTouchTrail; var singleTouchMoveCallback; var baseTransform; var pullOffset = 0; Dom.on(this.view.zoom.book,"touchstart",function(e4) { singleTouchTrail = []; if(e4.touches.length == 1) { _gthis.view.zoom.applyTransform(_gthis.view.zoom.transform,{ animated : false, boundsCheck : true}); baseTransform = _gthis.view.zoom.transform; singleTouchMoveCallback = Dom.on(_gthis.view.zoom.book,"touchmove",function(e5) { if(e5.touches.length == 1) { var singleTouchMoveCallback1 = _gthis.point(e5.changedTouches[0]); singleTouchTrail.push(new epaper_flipbook_PointerStamp(singleTouchMoveCallback1)); if(_gthis.view.zoom.get_factor() <= 1) { var _g31 = tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.get_position()).from; switch(_g31[1]) { case 0: break; case 1: pullOffset = singleTouchTrail[singleTouchTrail.length - 1].point.a - singleTouchTrail[0].point.a; var _gthis3 = _gthis.view.zoom; var this12; var this13 = new tink_core_MPair(pullOffset,0); this12 = this13; _gthis3.applyTransform(tink_geom2__$Matrix_Matrix_$Impl_$.move(baseTransform,this12),{ animated : false, boundsCheck : false}); break; } } } }); } else { if(singleTouchMoveCallback != null) { singleTouchMoveCallback.dissolve(); } singleTouchMoveCallback = null; } }); window.document.addEventListener("touchend",function(e6) { if(singleTouchMoveCallback != null) { singleTouchMoveCallback.dissolve(); } singleTouchMoveCallback = null; if(e6.touches.length == 0) { isPanning.set(false); } if(e6.touches.length == 0 && pullOffset != 0 && baseTransform != null) { setTimeout(function(baseTransform1) { _gthis.view.zoom.applyTransform(baseTransform1,{ animated : true, boundsCheck : false}); },125,baseTransform); pullOffset = 0; baseTransform = null; } if(_gthis.view.zoom.get_factor() > 1) { if(_gthis.view.zoom.get_factor() < 1.2) { _gthis.view.zoom.scaleTo(1,{ animated : true}); } else if(e6.touches.length == 0 && singleTouchTrail.length > 0) { var now = new Date().getTime() / 1000; var speedEvalTouch = null; var timeDiff = 0; while(singleTouchTrail.length > 0) { speedEvalTouch = singleTouchTrail.pop(); timeDiff = now - speedEvalTouch.timestamp; if(timeDiff > .03) { break; } } singleTouchTrail = []; if(timeDiff > .03) { var touchObj = e6.changedTouches[0]; var touchPt = _gthis.point(touchObj); var b = speedEvalTouch.point; var this14; var this15 = new tink_core_MPair(touchPt.a - b.a,touchPt.b - b.b); this14 = this15; var ptDist = this14; var dist = Math.sqrt(ptDist.a * ptDist.a + ptDist.b * ptDist.b); if(dist > 10) { var _gthis4 = _gthis.view.zoom; var _gthis5 = _gthis.view.zoom.transform; var this16; var this17 = new tink_core_MPair(ptDist.a * 5,ptDist.b * 5); this16 = this17; _gthis4.applyTransform(tink_geom2__$Matrix_Matrix_$Impl_$.move(_gthis5,this16),{ animated : true, boundsCheck : true},true); } } } } },true); touch.get_move().handle(function(p3) { if(inBook(p3)) { if(_gthis.view.zoom.get_factor() > 1) { _gthis.view.zoom.applyTransform(tink_geom2__$Matrix_Matrix_$Impl_$.move(_gthis.view.zoom.transform,p3.delta)); } if(_gthis.view.zoom.get_factor() > 1) { isPanning.set(true); } } }); touch.get_jet().handle(function(p4) { if(inBook(p4)) { if(!(_gthis.view.zoom.get_factor() > 1)) { var this18 = p4.v; if(Math.sqrt(this18.a * this18.a + this18.b * this18.b) > 50) { var this19 = p4.v; if(Math.abs(Math.atan2(this19.b,this19.a)) < Math.PI * .25) { _gthis.view.pagination.prev(); } else { var this20 = p4.v; if(Math.abs(Math.atan2(this20.b,this20.a)) > Math.PI * .75) { _gthis.view.pagination.next(); } } } } } }); this.view.grid.get_clicked().handle(($_=this.view.grid,$bind($_,$_.openPage))); tink_state__$Observable_Observable_$Impl_$.bind(this.get_position(),null,$bind(this,this.updateOnPageMedia)); var t1 = new haxe_Timer(250); t1.run = function() { _gthis.view.updateViewport({ boundsCheck : true, animated : true}); }; var this21 = new tink_core__$Callback_SimpleLink($bind(t1,t1.stop)); }; epaper_flipbook_DomEngine.__name__ = ["epaper","flipbook","DomEngine"]; epaper_flipbook_DomEngine.__interfaces__ = [epaper_flipbook_PageOverView,epaper_flipbook_Engine]; epaper_flipbook_DomEngine.prototype = { toggle: function(force) { if(force == null) { return this.toggle(!tink_state__$Observable_Observable_$Impl_$.get_value(this.get_isOpen())); } else { switch(force) { case false: this.view.grid.openPage(this.view.pagination.page); return false; case true: this.view.grid.showAll(); return true; } } } ,page: function(index) { return this.pages[index]; } ,updateOnPageMedia: function(pos) { this.get_focus().clear(); var _g = pos.from; switch(_g[1]) { case 0: var _g1 = 0; var _g11 = _$Dom_QueryResult_$Impl_$.query(this.view.zoom.book,".page .content .overlay"); while(_g1 < _g11.length) { var overlay = _g11[_g1]; ++_g1; overlay.innerHTML = ""; } break; case 1: var _g2 = 0; var _g12 = this.getPages(pos.cur); while(_g2 < _g12.length) { var p = _g12[_g2]; ++_g2; var p1 = p; var _g21 = 0; var _g3 = p1.get_media().frames; while(_g21 < _g3.length) { var frame = _g3[_g21]; ++_g21; p1.get_overlay().appendChild(frame.toElement()); } } break; } } ,getDirectory: function() { var __tmp = []; var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(this.root,".book .meta ul.directory a"); while(_g < _g1.length) { var link = [_g1[_g]]; ++_g; var get = (function(link1) { return function(selector) { var _g2 = _$Dom_QueryResult_$Impl_$.query(link1[0],selector)[0]; if(_g2 == null) { return null; } else { var found = _g2; var this1 = found.innerHTML; return this1; } }; })(link); __tmp.push({ page : { index : Std.parseInt(HxOverrides.substr(link[0].getAttribute("href"),1,null)), title : link[0].getAttribute("title"), thumb : link[0].getAttribute("data-thumb")}, indent : Std.parseInt(link[0].getAttribute("data-indent")), author : get(".author"), 'short' : get("h1"), 'long' : get("p")}); } return __tmp; } ,getPages: function(index) { var _g = tink_state__$Observable_Observable_$Impl_$.get_value(this.get_pageMode()); switch(_g[1]) { case 0: return [this.pages[index]]; case 1: index |= 1; return [this.pages[index - 1],this.pages[index]].filter(function(p) { return p != null; }); } } ,allPages: function() { return this.pages.slice(); } ,panTo: function(dest) { this.view.zoom.panTo(dest); } ,flipTo: function(dest) { if(tink_state__$Observable_Observable_$Impl_$.get_value(this.get_isOpen())) { switch(dest[1]) { case 0: this.view.pagination.jumpTo(this.view.pagination.page - this.view.pagination.get_step()); break; case 1: this.view.pagination.jumpTo(this.view.pagination.page + this.view.pagination.get_step()); break; case 2: var position = dest[2]; this.view.pagination.jumpTo(position); break; } this.get_overview().toggle(false); } else { switch(dest[1]) { case 0: this.view.pagination.prev(); break; case 1: this.view.pagination.next(); break; case 2: if(dest[3] == null) { var position1 = dest[2]; this.view.pagination.flipTo(position1); } else if(dest[3] == true) { var position2 = dest[2]; this.view.pagination.jumpTo(position2); } else { var position3 = dest[2]; this.view.pagination.flipTo(position3); } break; } } } ,point: function(e) { var this1; var this2 = new tink_core_MPair(e.clientX,e.clientY); this1 = this2; return this1; } ,clientToViewport: function(p) { var this1 = this.view.get_viewportRect(); var this2; var this3 = new tink_core_MPair(this1.left * .5 + this1.right * 0.5,this1.top * .5 + this1.bottom * 0.5); this2 = this3; var b = this2; var this4; var this5 = new tink_core_MPair(p.a - b.a,p.b - b.b); this4 = this5; return this4; } ,wheelZoom: function(e) { var delta = -e.deltaY; var animated = false; var _g = e.deltaMode; if(_g == 1) { delta *= 10; animated = true; } var deltaScale = Math.pow(1.05,delta / 10); deltaScale = Math.sqrt(deltaScale); if(Math.abs(Math.log(deltaScale)) > .1) { animated = true; } e.preventDefault(); e.stopImmediatePropagation(); this.view.zoom.scaleBy(deltaScale,{ center : this.clientToViewport(this.point(e)), animated : animated}); } ,pointerDown: function(e) { this.pointerEvtCache.push(e); } ,pointerMove: function(e) { var _g = 0; var _g1 = this.pointerEvtCache; while(_g < _g1.length) { var cacheEvt = _g1[_g]; ++_g; if(e.pointerId == cacheEvt.pointerId) { var i = this.pointerEvtCache.indexOf(cacheEvt); this.pointerEvtCache[i] = e; } } if(this.pointerEvtCache.length == 2) { var this1; var this2 = new tink_core_MPair(this.pointerEvtCache[0].clientX,this.pointerEvtCache[0].clientY); this1 = this2; var p0 = this1; var this3; var this4 = new tink_core_MPair(this.pointerEvtCache[1].clientX,this.pointerEvtCache[1].clientY); this3 = this4; var p1 = this3; var this5; var this6 = new tink_core_MPair(p0.a - p1.a,p0.b - p1.b); this5 = this6; var this7 = this5; var curDist = Math.sqrt(this7.a * this7.a + this7.b * this7.b); if(this.pointerDist > 0) { var scale = curDist / this.pointerDist; var this8; var this9 = new tink_core_MPair(p0.a + p1.a,p0.b + p1.b); this8 = this9; var p = this8; var this10; var this11 = new tink_core_MPair(p.a * .5,p.b * .5); this10 = this11; var center = this10; this.view.zoom.scaleBy(scale,{ center : this.clientToViewport(center)}); } this.pointerDist = curDist; } } ,pointerUp: function(e) { var _g = 0; var _g1 = this.pointerEvtCache; while(_g < _g1.length) { var cacheEvt = _g1[_g]; ++_g; if(e.pointerId == cacheEvt.pointerId) { var i = this.pointerEvtCache.indexOf(cacheEvt); this.pointerEvtCache.splice(i,1); } } if(this.pointerEvtCache.length < 2) { this.pointerDist = -1; } } ,startDrag: function(e) { var _gthis = this; var start = this.point(e); var initial = start; var mouseTrail = []; var done = Dom.on(window.document,"mousemove",function(e1) { var now = _gthis.point(e1); var _gthis1 = _gthis.view.zoom; var _gthis2 = _gthis.view.zoom.transform; var this1; var this2 = new tink_core_MPair(now.a - start.a,now.b - start.b); this1 = this2; _gthis1.applyTransform(tink_geom2__$Matrix_Matrix_$Impl_$.move(_gthis2,this1)); start = now; var done1 = _gthis.point(e1); mouseTrail.push(new epaper_flipbook_PointerStamp(done1)); e1.preventDefault(); }); Dom.once(window.document,"mouseup",function(e2) { var now1 = _gthis.point(e2); if(done != null) { done.dissolve(); } if(_gthis.view.zoom.get_factor() <= 1) { var this3; var this4 = new tink_core_MPair(now1.a - initial.a,now1.b - initial.b); this3 = this4; var delta = this3; if(Math.abs(delta.a) > Math.abs(delta.b) && Math.sqrt(delta.a * delta.a + delta.b * delta.b) > 10) { if(delta.a < 0) { _gthis.view.pagination.next(); } else { _gthis.view.pagination.prev(); } } } else { var now2 = new Date().getTime() / 1000; var speedEvalStamp = null; var timeDiff = 0; while(mouseTrail.length > 0) { speedEvalStamp = mouseTrail.pop(); timeDiff = now2 - speedEvalStamp.timestamp; if(timeDiff > .03) { break; } } mouseTrail = []; if(timeDiff > .03) { var nowPt = _gthis.point(e2); var b = speedEvalStamp.point; var this5; var this6 = new tink_core_MPair(nowPt.a - b.a,nowPt.b - b.b); this5 = this6; var ptDist = this5; var dist = Math.sqrt(ptDist.a * ptDist.a + ptDist.b * ptDist.b); if(dist > 10) { var _gthis3 = _gthis.view.zoom; var _gthis4 = _gthis.view.zoom.transform; var this7; var this8 = new tink_core_MPair(ptDist.a * 5,ptDist.b * 5); this7 = this8; _gthis3.applyTransform(tink_geom2__$Matrix_Matrix_$Impl_$.move(_gthis4,this7),{ animated : true, boundsCheck : true},true); } } } }); } ,get_focus: function() { return this.focus; } ,get_mediaOpened: function() { return this.mediaOpened; } ,get_navigate: function() { return this.navigate; } ,get_resized: function() { return this.view.get_viewportChanged(); } ,get_currentInteraction: function() { return this.currentInteraction; } ,get_isOpen: function() { return this.lazy_isOpen.get(); } ,get_overview: function() { return this; } ,get_position: function() { return this.position; } ,get_zoom: function() { return this.zoom; } ,get_pageMode: function() { return this.pageMode; } ,__class__: epaper_flipbook_DomEngine }; var epaper_flipbook_ZoomController = function() { }; epaper_flipbook_ZoomController.__name__ = ["epaper","flipbook","ZoomController"]; epaper_flipbook_ZoomController.prototype = { __class__: epaper_flipbook_ZoomController }; var epaper_flipbook__$DomEngine_DomZoomController = function(target) { this.target = target; var get = function() { return target.get_factor(); }; var changed = tink_core__$Signal_Signal_$Impl_$.noise(target.get_changed()); var this1 = tink_state__$Observable_Observable_$Impl_$.create(function() { var this2; var this3 = new tink_core_MPair(get(),tink_core__$Signal_Signal_$Impl_$.nextTime(changed,null)); this2 = this3; return this2; }); this.factor = this1; var get1 = function() { return target.get_maxFactor(); }; var changed1 = tink_core__$Signal_Signal_$Impl_$.noise(target.get_changed()); var this4 = tink_state__$Observable_Observable_$Impl_$.create(function() { var this5; var this6 = new tink_core_MPair(get1(),tink_core__$Signal_Signal_$Impl_$.nextTime(changed1,null)); this5 = this6; return this5; }); this.maxFactor = this4; }; epaper_flipbook__$DomEngine_DomZoomController.__name__ = ["epaper","flipbook","_DomEngine","DomZoomController"]; epaper_flipbook__$DomEngine_DomZoomController.__interfaces__ = [epaper_flipbook_ZoomController]; epaper_flipbook__$DomEngine_DomZoomController.prototype = { scaleTo: function(factor) { this.target.scaleTo(factor,{ animated : true}); } ,moveBy: function(pt) { this.target.applyTransform(tink_geom2__$Matrix_Matrix_$Impl_$.move(this.target.transform,pt),{ animated : true, boundsCheck : true},true); } ,toggle: function() { this.target.toggle(); } ,get_factor: function() { return this.factor; } ,get_maxFactor: function() { return this.maxFactor; } ,__class__: epaper_flipbook__$DomEngine_DomZoomController }; var epaper_flipbook_PageView = function() { }; epaper_flipbook_PageView.__name__ = ["epaper","flipbook","PageView"]; epaper_flipbook_PageView.prototype = { __class__: epaper_flipbook_PageView }; var epaper_flipbook__$DomEngine_DomPageView = function(index,view,focus,flipTo,mediaOpened,navigate) { var _gthis = this; this.lazy_media = new tink_core__$Lazy_LazyFunc(function() { return _gthis.initMedia(); }); this.lazy_textPositions = new tink_core__$Lazy_LazyFunc(function() { var _g = view.target.querySelector(".meta .searchable[data-textpos]"); if(_g == null) { return null; } else { var v = _g; if(window.document.location.protocol == "file:") { return null; } var filePath = v.getAttribute("data-textpos"); var request = new XMLHttpRequest(); request.open("GET",filePath,false); request.send(); var textPositions = tink_core_OutcomeTools.sure(new tink_xml_Parser_$0().read(tink_xml__$Source_Source_$Impl_$.fromString(request.responseText))); return new tink_json_Writer0().write(textPositions); } }); this.lazy_textContent = new tink_core__$Lazy_LazyFunc(function() { var _g1 = view.target.querySelector(".meta .searchable .text"); if(_g1 == null) { return ""; } else { var v1 = _g1; return v1.innerHTML; } }); this.lazy_overlay = new tink_core__$Lazy_LazyFunc(function() { var ret = Dom.tag("div.overlay.epaper-flipbook__overlay"); var _g2 = view.target.querySelector(".content"); if(_g2 != null) { var v2 = _g2; v2.appendChild(ret); } return ret; }); this.lazy_searchHighlightingLayer = new tink_core__$Lazy_LazyFunc(function() { var ret1 = Dom.tag("div.search-layer"); var svg = window.document.createElementNS("http://www.w3.org/2000/svg","svg"); svg.setAttribute("style","position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; width:100%; height:100%; opacity:0.5;"); ret1.appendChild(svg); var _g3 = view.target.querySelector(".content"); if(_g3 != null) { var v3 = _g3; v3.appendChild(ret1); } return svg; }); this.index = index; this.view = view; this.focus = focus; this.flipTo = flipTo; this.mediaOpened = mediaOpened; this.navigate = navigate; var this1 = new tink_state__$State_StateObject(this.calcState(),null); this._state = this1; var observer = new MutationObserver(function(_,_1) { var next = _gthis.calcState(); _gthis._state.set(next); if(next[1] == 1) { var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { _gthis._state.set(_gthis.calcState()); },500),$bind($_,$_.stop))); } }); observer.observe(view.target,{ attributes : true}); }; epaper_flipbook__$DomEngine_DomPageView.__name__ = ["epaper","flipbook","_DomEngine","DomPageView"]; epaper_flipbook__$DomEngine_DomPageView.__interfaces__ = [epaper_flipbook_PageView]; epaper_flipbook__$DomEngine_DomPageView.prototype = { getMedia: function() { return this.get_media().items; } ,getSearchHighlightingLayer: function() { return this.get_searchHighlightingLayer(); } ,calcState: function() { if(this.view.target.parentElement == null) { return epaper_flipbook_PageState.Unlinked; } else if(this.view.target.classList.contains("hidden")) { return epaper_flipbook_PageState.Standby; } else { var _g = this.view.target.getAttribute("data-animation"); if(_g == null) { return epaper_flipbook_PageState.Active; } else if(_g == "") { return epaper_flipbook_PageState.Active; } else { var v = _g; if(StringTools.startsWith(v,"show")) { return epaper_flipbook_PageState.Showing; } else { return epaper_flipbook_PageState.Hiding; } } } } ,initMedia: function() { var _gthis = this; var frames = []; var items = []; var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(this.view.target,".media>li>*"); while(_g < _g1.length) { var m = [_g1[_g]]; ++_g; var desc = [new tink_json_Parser0().parse(m[0].getAttribute("data-config"))]; var url = [m[0].getAttribute("href")]; var inlineStyle = [m[0].getAttribute("data-style")]; var gallery = [new tink_core__$Lazy_LazyFunc((function(m1) { return function() { var __tmp = []; var _g2 = 0; var _g3 = _$Dom_QueryResult_$Impl_$.query(m1[0],"a"); while(_g2 < _g3.length) { var img = _g3[_g2]; ++_g2; __tmp.push(epaper_media_MediaViewItem.Image(img.getAttribute("href"),img.getAttribute("title"))); } return __tmp; }; })(m))]; var triggerOpen = [null]; var url1 = url[0]; var props = new epaper_media_MediaItem({ open : (function(triggerOpen1,gallery1,inlineStyle1,url2,m2) { return function() { var _g21 = m2[0].getAttribute("target"); var _g31 = m2[0].className; switch(_g31) { case "gallery": epaper_media_MediaView.get_EXPANDED().setContent(gallery1[0].get()); break; case "video": var props1 = epaper_media_MediaViewItem.Video(url2[0],inlineStyle1[0]); epaper_media_MediaView.get_EXPANDED().setContent([props1]); break; default: if(_g21 == "mediaview-iframe") { var props2 = epaper_media_MediaViewItem.IFrame(url2[0],inlineStyle1[0]); epaper_media_MediaView.get_EXPANDED().setContent([props2]); } else { var other = _g31; var target = _g21; _gthis.navigate({ url : url2[0], target : target}); } } triggerOpen1[0](); }; })(triggerOpen,gallery,inlineStyle,url,m), focus : this.focus, getDetails : (function(desc1,m3) { return function() { var s = desc1[0]["short"]; var this1 = s == null ? "" : s; var s1 = desc1[0]["long"]; var this2 = s1 == null ? "" : s1; var _g22 = desc1[0].thumb; var props3; if(_g22 == null) { props3 = null; } else if(_g22.src == null) { props3 = null; } else if(_g22.src == "") { props3 = null; } else { var t = _g22; props3 = { width : t.width, height : t.height, url : t.src}; } return { frameOnly : desc1[0].frameOnly, title : this1, type : m3[0].className, description : this2, thumb : props3, icon : desc1[0].iconId, mediabarContains : desc1[0].mediabarContains, bubbleUsedWith : desc1[0].bubbleUsedWith, bubbleContains : desc1[0].bubbleContains}; }; })(desc,m)}); var desc2 = desc[0].geo; var desc3 = desc[0]["short"]; var props4; if(desc[0].iconOnGeo == null) { if(desc[0].iconId == null) { props4 = "mediaicon-linkextern"; } else { var v = desc[0].iconId; props4 = "mediaicon-" + v.split(".")[0]; } } else if(desc[0].iconOnGeo == false) { props4 = null; } else if(desc[0].iconId == null) { props4 = "mediaicon-linkextern"; } else { var v1 = desc[0].iconId; props4 = "mediaicon-" + v1.split(".")[0]; } var props5 = [{ url : url1, item : props, pos : desc2, title : desc3, icon : props4}]; var tmp = (function(props6) { return function() { tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis.mediaOpened.handlers,props6[0].item); }; })(props5); triggerOpen[0] = tmp; items.push(props5[0].item); if(desc[0].geo != null) { var _g23 = m[0].className; var tmp1; switch(_g23) { case "article": var this3 = { f : (function(props7,m4) { return function() { var __v_0 = props7[0]; return { target : m4[0].getAttribute("target"), icon : __v_0.icon, item : __v_0.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_0.pos), title : __v_0.title, url : __v_0.url}; }; })(props5,m)}; tmp1 = new epaper_flipbook__$DomEngine_Link(tink_state__$Observable_Observable_$Impl_$.auto(this3)); break; case "email": var this4 = { f : (function(props8,m5) { return function() { var __v_01 = props8[0]; return { target : m5[0].getAttribute("target"), icon : __v_01.icon, item : __v_01.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_01.pos), title : __v_01.title, url : __v_01.url}; }; })(props5,m)}; tmp1 = new epaper_flipbook__$DomEngine_Link(tink_state__$Observable_Observable_$Impl_$.auto(this4)); break; case "gallery": if(desc[0].embedded) { var this5 = { f : (function(props9,gallery2) { return function() { var __v_02 = props9[0]; return { content : new vdom_Foreign(epaper_media_MediaView.embedded(gallery2[0])), item : __v_02.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_02.pos), title : __v_02.title}; }; })(props5,gallery)}; tmp1 = new epaper_flipbook__$DomEngine_Gallery(tink_state__$Observable_Observable_$Impl_$.auto(this5)); } else { var this6 = { f : (function(props10) { return function() { var __v_03 = props10[0]; return { target : "_self", icon : __v_03.icon, item : __v_03.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_03.pos), title : __v_03.title, url : __v_03.url}; }; })(props5)}; tmp1 = new epaper_flipbook__$DomEngine_Link(tink_state__$Observable_Observable_$Impl_$.auto(this6)); } break; case "iframe": var this7 = { f : (function(props11) { return function() { var __v_04 = props11[0]; return { item : __v_04.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_04.pos), title : __v_04.title, url : __v_04.url}; }; })(props5)}; tmp1 = new epaper_flipbook__$DomEngine_IFrame(tink_state__$Observable_Observable_$Impl_$.auto(this7)); break; case "internal": var this8 = { f : (function(props12) { return function() { var __v_05 = props12[0]; return { target : "_self", icon : __v_05.icon, item : __v_05.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_05.pos), title : __v_05.title, url : __v_05.url}; }; })(props5)}; tmp1 = new epaper_flipbook__$DomEngine_Link(tink_state__$Observable_Observable_$Impl_$.auto(this8)); break; case "pdf":case "url":case "zip": var this9 = { f : (function(props13,m6) { return function() { var __v_06 = props13[0]; return { target : m6[0].getAttribute("target"), icon : __v_06.icon, item : __v_06.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_06.pos), title : __v_06.title, url : __v_06.url}; }; })(props5,m)}; tmp1 = new epaper_flipbook__$DomEngine_Link(tink_state__$Observable_Observable_$Impl_$.auto(this9)); break; case "video": if(desc[0].embedded) { var this10 = { f : (function(props14) { return function() { var __v_07 = props14[0]; return { item : __v_07.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_07.pos), title : __v_07.title, url : __v_07.url}; }; })(props5)}; tmp1 = new epaper_flipbook__$DomEngine_Video(tink_state__$Observable_Observable_$Impl_$.auto(this10)); } else { var this11 = { f : (function(props15) { return function() { var __v_08 = props15[0]; return { target : "_blank", icon : __v_08.icon, item : __v_08.item, pos : epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry(__v_08.pos), title : __v_08.title, url : __v_08.url}; }; })(props5)}; tmp1 = new epaper_flipbook__$DomEngine_Link(tink_state__$Observable_Observable_$Impl_$.auto(this11)); } break; default: var v2 = _g23; throw new js__$Boot_HaxeError("invalid type: " + v2); } frames.push(tmp1); } } return { frames : frames, items : items}; } ,makeThumb: function() { return flipbook__$PageView_PageThumb_$Impl_$.makeElement(this.view.getThumb()); } ,get_index: function() { return this.index; } ,get_searchHighlightingLayer: function() { return this.lazy_searchHighlightingLayer.get(); } ,get_overlay: function() { return this.lazy_overlay.get(); } ,get_textContent: function() { return this.lazy_textContent.get(); } ,get_textPositions: function() { return this.lazy_textPositions.get(); } ,get_label: function() { return this.view.get_title(); } ,get_downloadUrl: function() { var _g = this.view.target.querySelector(".media[data-download]"); if(_g == null) { return haxe_ds_Option.None; } else { var v = _g; return haxe_ds_Option.Some(v.getAttribute("data-download")); } } ,get_media: function() { return this.lazy_media.get(); } ,get_thumb: function() { return flipbook__$PageView_PageThumb_$Impl_$.getUrl(this.view.getThumb()); } ,__class__: epaper_flipbook__$DomEngine_DomPageView }; var epaper_flipbook__$DomEngine_FramePos_$Impl_$ = {}; epaper_flipbook__$DomEngine_FramePos_$Impl_$.__name__ = ["epaper","flipbook","_DomEngine","FramePos_Impl_"]; epaper_flipbook__$DomEngine_FramePos_$Impl_$.ofGeometry = function(g) { var this1 = { left : 100 * g.x1 + "%", top : 100 * g.y1 + "%", width : 100 * (g.x2 - g.x1) + "%", height : 100 * (g.y2 - g.y1) + "%"}; return this1; }; var epaper_flipbook__$DomEngine_Video = function(data) { var _gthis = this; coconut_ui_View.call(this,data,function(data1) { var tmp = tink_state__$Observable_Observable_$Impl_$.get_value(data1); return _gthis.render(tmp); }); }; epaper_flipbook__$DomEngine_Video.__name__ = ["epaper","flipbook","_DomEngine","Video"]; epaper_flipbook__$DomEngine_Video.__super__ = coconut_ui_View; epaper_flipbook__$DomEngine_Video.prototype = $extend(coconut_ui_View.prototype,{ render: function(__data__) { var url = __data__.url; var title = __data__.title; var pos = __data__.pos; var item = __data__.item; var __v_0 = item.interactions({ dom : false}); return vdom_VDom.h("div",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("epaper-flipbook__video video"), style : pos, onclick : function(event) { }, onmouseenter : __v_0.onmouseenter, onmouseleave : __v_0.onmouseleave},[vdom_VDom.h("video",{ src : url, controls : true})]); } ,__class__: epaper_flipbook__$DomEngine_Video }); var epaper_flipbook__$DomEngine_Gallery = function(data) { var _gthis = this; coconut_ui_View.call(this,data,function(data1) { var tmp = tink_state__$Observable_Observable_$Impl_$.get_value(data1); return _gthis.render(tmp); }); }; epaper_flipbook__$DomEngine_Gallery.__name__ = ["epaper","flipbook","_DomEngine","Gallery"]; epaper_flipbook__$DomEngine_Gallery.__super__ = coconut_ui_View; epaper_flipbook__$DomEngine_Gallery.prototype = $extend(coconut_ui_View.prototype,{ render: function(__data__) { var title = __data__.title; var pos = __data__.pos; var item = __data__.item; var content = __data__.content; var attr = { className : vdom__$Attr_ClassName_$Impl_$.ofString("epaper-flipbook__gallery gallery embedded"), style : pos}; var __v_0 = item.interactions({ dom : false}); return vdom_VDom.h("div",attr,[content,vdom_VDom.h("button",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("epaper-flipbook__gallery-button button-resetted"), onclick : tink_core__$Callback_Callback_$Impl_$.fromNiladic(item.get_open()), onmouseenter : __v_0.onmouseenter, onmouseleave : __v_0.onmouseleave},[vdom_VDom.h("span",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("sr-only")},[title])])]); } ,__class__: epaper_flipbook__$DomEngine_Gallery }); var epaper_flipbook__$DomEngine_Link = function(data) { var _gthis = this; coconut_ui_View.call(this,data,function(data1) { var tmp = tink_state__$Observable_Observable_$Impl_$.get_value(data1); return _gthis.render(tmp); }); }; epaper_flipbook__$DomEngine_Link.__name__ = ["epaper","flipbook","_DomEngine","Link"]; epaper_flipbook__$DomEngine_Link.__super__ = coconut_ui_View; epaper_flipbook__$DomEngine_Link.prototype = $extend(coconut_ui_View.prototype,{ render: function(__data__) { var url = __data__.url; var title = __data__.title; var target = __data__.target; var pos = __data__.pos; var item = __data__.item; var icon = __data__.icon; var __v_0 = item.interactions({ dom : false}); return vdom_VDom.h("a",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("epaper-flipbook__link"), target : target, title : title, href : url, style : pos, attributes : { 'data-icon' : icon, 'aria-label' : title, 'data-hovered' : item.get_isActive() ? "" : undefined}, onclick : __v_0.onclick, onmouseenter : __v_0.onmouseenter, onmouseleave : __v_0.onmouseleave},null); } ,__class__: epaper_flipbook__$DomEngine_Link }); var epaper_flipbook__$DomEngine_IFrame = function(data) { var _gthis = this; coconut_ui_View.call(this,data,function(data1) { var tmp = tink_state__$Observable_Observable_$Impl_$.get_value(data1); return _gthis.render(tmp); }); }; epaper_flipbook__$DomEngine_IFrame.__name__ = ["epaper","flipbook","_DomEngine","IFrame"]; epaper_flipbook__$DomEngine_IFrame.__super__ = coconut_ui_View; epaper_flipbook__$DomEngine_IFrame.prototype = $extend(coconut_ui_View.prototype,{ render: function(__data__) { var url = __data__.url; var title = __data__.title; var pos = __data__.pos; var item = __data__.item; return vdom_VDom.h("div",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("epaper-flipbook__iframe iframe-wrapper"), style : pos},[vdom_VDom.h("iframe",{ src : url, allowFullscreen : true, scrolling : "no", title : title},null)]); } ,__class__: epaper_flipbook__$DomEngine_IFrame }); var epaper_flipbook_PointerStamp = function(p) { this.timestamp = new Date().getTime() / 1000; this.point = p; }; epaper_flipbook_PointerStamp.__name__ = ["epaper","flipbook","PointerStamp"]; epaper_flipbook_PointerStamp.prototype = { __class__: epaper_flipbook_PointerStamp }; var epaper_flipbook_BookInteraction = { __ename__ : true, __constructs__ : ["Idle","Panning","Zooming"] }; epaper_flipbook_BookInteraction.Idle = ["Idle",0]; epaper_flipbook_BookInteraction.Idle.toString = $estr; epaper_flipbook_BookInteraction.Idle.__enum__ = epaper_flipbook_BookInteraction; epaper_flipbook_BookInteraction.Panning = ["Panning",1]; epaper_flipbook_BookInteraction.Panning.toString = $estr; epaper_flipbook_BookInteraction.Panning.__enum__ = epaper_flipbook_BookInteraction; epaper_flipbook_BookInteraction.Zooming = ["Zooming",2]; epaper_flipbook_BookInteraction.Zooming.toString = $estr; epaper_flipbook_BookInteraction.Zooming.__enum__ = epaper_flipbook_BookInteraction; var epaper_flipbook_FlipDestination = { __ename__ : true, __constructs__ : ["Prev","Next","Page"] }; epaper_flipbook_FlipDestination.Prev = ["Prev",0]; epaper_flipbook_FlipDestination.Prev.toString = $estr; epaper_flipbook_FlipDestination.Prev.__enum__ = epaper_flipbook_FlipDestination; epaper_flipbook_FlipDestination.Next = ["Next",1]; epaper_flipbook_FlipDestination.Next.toString = $estr; epaper_flipbook_FlipDestination.Next.__enum__ = epaper_flipbook_FlipDestination; epaper_flipbook_FlipDestination.Page = function(index,immediate) { var $x = ["Page",2,index,immediate]; $x.__enum__ = epaper_flipbook_FlipDestination; $x.toString = $estr; return $x; }; var epaper_flipbook_PageMode = { __ename__ : true, __constructs__ : ["Single","Double"] }; epaper_flipbook_PageMode.Single = ["Single",0]; epaper_flipbook_PageMode.Single.toString = $estr; epaper_flipbook_PageMode.Single.__enum__ = epaper_flipbook_PageMode; epaper_flipbook_PageMode.Double = ["Double",1]; epaper_flipbook_PageMode.Double.toString = $estr; epaper_flipbook_PageMode.Double.__enum__ = epaper_flipbook_PageMode; var epaper_flipbook_BookPosition = function(min,cur,max,from) { this.min = min; this.cur = cur; this.max = max; this.from = from; }; epaper_flipbook_BookPosition.__name__ = ["epaper","flipbook","BookPosition"]; epaper_flipbook_BookPosition.prototype = { __class__: epaper_flipbook_BookPosition }; var epaper_flipbook_PageTransition = function(origin,progress) { this.origin = origin; this.progress = progress; }; epaper_flipbook_PageTransition.__name__ = ["epaper","flipbook","PageTransition"]; epaper_flipbook_PageTransition.prototype = { __class__: epaper_flipbook_PageTransition }; var epaper_flipbook_PageState = { __ename__ : true, __constructs__ : ["Unlinked","Standby","Showing","Active","Hiding"] }; epaper_flipbook_PageState.Unlinked = ["Unlinked",0]; epaper_flipbook_PageState.Unlinked.toString = $estr; epaper_flipbook_PageState.Unlinked.__enum__ = epaper_flipbook_PageState; epaper_flipbook_PageState.Standby = ["Standby",1]; epaper_flipbook_PageState.Standby.toString = $estr; epaper_flipbook_PageState.Standby.__enum__ = epaper_flipbook_PageState; epaper_flipbook_PageState.Showing = ["Showing",2]; epaper_flipbook_PageState.Showing.toString = $estr; epaper_flipbook_PageState.Showing.__enum__ = epaper_flipbook_PageState; epaper_flipbook_PageState.Active = ["Active",3]; epaper_flipbook_PageState.Active.toString = $estr; epaper_flipbook_PageState.Active.__enum__ = epaper_flipbook_PageState; epaper_flipbook_PageState.Hiding = ["Hiding",4]; epaper_flipbook_PageState.Hiding.toString = $estr; epaper_flipbook_PageState.Hiding.__enum__ = epaper_flipbook_PageState; var haxe_ds_Option = { __ename__ : true, __constructs__ : ["Some","None"] }; haxe_ds_Option.Some = function(v) { var $x = ["Some",0,v]; $x.__enum__ = haxe_ds_Option; $x.toString = $estr; return $x; }; haxe_ds_Option.None = ["None",1]; haxe_ds_Option.None.toString = $estr; haxe_ds_Option.None.__enum__ = haxe_ds_Option; var epaper_i18n_Localizable = function(id,mapping) { this.id = id; this.mapping = mapping; }; epaper_i18n_Localizable.__name__ = ["epaper","i18n","Localizable"]; epaper_i18n_Localizable.prototype = { toHTML: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var _g = epaper_i18n_Localizable.currentLocale; switch(_g[1]) { case 0: var lang = _g[2]; var this1 = "\r\n"; ret.s += this1; var b = tink_template__$Html_Html_$Impl_$.escape(this.resolve(lang)); ret.s += b; var this2 = "\r\n"; ret.s += this2; break; case 1: var this3 = "\r\n"; ret.s += this3; var _g1 = 0; var _g11 = ["en","es","fi","fr","hr","hu","it","ja","ko","lv","nb_NO","nl","pl","pt","ro","ru","sk","sq","sr","sv","tr","zh_Hans"]; while(_g1 < _g11.length) { var lang1 = _g11[_g1]; ++_g1; var this4 = "\r\n"; ret.s += this5; var b2 = tink_template__$Html_Html_$Impl_$.escape(this.resolve(lang1)); ret.s += b2; var this6 = "\r\n"; ret.s += this6; } var this7 = "\r\n"; ret.s += this7; break; } var this8 = "\r\n"; ret.s += this8; var this9 = ret.s; return this9; } ,toVNode: function() { var o = epaper_i18n_Localizable.currentLocale; var s; if(o[1] == 0) { var v = o[2]; s = v; } else { s = null; } return this.resolve(s); } ,toString: function() { var o = epaper_i18n_Localizable.currentLocale; var tmp; if(o[1] == 0) { var v = o[2]; tmp = v; } else { tmp = null; } return this.resolve(tmp); } ,resolve: function(lang) { var _g = this.mapping.get(lang); if(_g == null) { return this.id; } else { var v = _g; return v; } } ,__class__: epaper_i18n_Localizable }; var epaper_media_MediaBar = function(direction) { this.direction = direction; this.container = Dom.tag("div.media-bar." + direction); this.lists = []; }; epaper_media_MediaBar.__name__ = ["epaper","media","MediaBar"]; epaper_media_MediaBar.prototype = { setParent: function(element,before) { if(before != null) { element.insertBefore(this.container,before); } else { element.appendChild(this.container); } } ,update: function(items) { var _gthis = this; var _g = 0; var _g1 = this.lists; while(_g < _g1.length) { var l = [_g1[_g]]; ++_g; if(tink_state__$State_State_$Impl_$.get_value(l[0].__coco_active__)) { l[0].__coco_active__.set(false); var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay((function(l1) { return function() { var elt = l1[0].toElement(); _gthis.container.removeChild(elt); l1[0].destroy(); HxOverrides.remove(_gthis.lists,l1[0]); }; })(l),2000),$bind($_,$_.stop))); } } if(items != null) { if(items.length != 0) { var this2 = { f : function() { return { items : tink_pure__$List_List_$Impl_$.fromArray(items)}; }}; var nu = new epaper_media__$MediaBar_MediaList(tink_state__$Observable_Observable_$Impl_$.auto(this2)); this.lists.push(nu); var listElt = nu.toElement(); this.container.appendChild(listElt); this.latestContent = _$Dom_QueryResult_$Impl_$.query(listElt,".scroll-content")[0]; new scroller_Scroller(listElt); var this3 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { nu.__coco_active__.set(true); },100),$bind($_,$_.stop))); } } } ,getLatestContentHeight: function() { if(this.latestContent != null) { return this.latestContent.getBoundingClientRect().height; } else { return 99999; } } ,setMaxHeight: function(h) { var _g = 0; var _g1 = this.lists; while(_g < _g1.length) { var l = _g1[_g]; ++_g; var param = Math.floor(h); l.__coco_maxHeight__.set(param); } } ,__class__: epaper_media_MediaBar }; var epaper_media__$MediaBar_MediaList = function(data) { var _gthis = this; coconut_ui_View.call(this,data,function(data1) { var tmp = tink_state__$Observable_Observable_$Impl_$.get_value(data1); return _gthis.render(tmp); }); var this1 = new tink_state__$State_StateObject(false,null); this.__coco_active__ = this1; var this2 = new tink_state__$State_StateObject(0,null); this.__coco_maxHeight__ = this2; }; epaper_media__$MediaBar_MediaList.__name__ = ["epaper","media","_MediaBar","MediaList"]; epaper_media__$MediaBar_MediaList.__super__ = coconut_ui_View; epaper_media__$MediaBar_MediaList.prototype = $extend(coconut_ui_View.prototype,{ render: function(__data__) { var items = __data__.items; var attr = { className : vdom__$Attr_ClassName_$Impl_$.ofString("contents")}; var children = vdom_VDom.h("div",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("hitzone"), style : vdom__$Style_Style_$Impl_$.ofString("max-height:" + tink_state__$State_State_$Impl_$.get_value(this.__coco_maxHeight__) + "px")},null); var _g = new haxe_ds_StringMap(); if(__map_reserved["scroll-container"] != null) { _g.setReserved("scroll-container",true); } else { _g.h["scroll-container"] = true; } var value = tink_state__$State_State_$Impl_$.get_value(this.__coco_active__); if(__map_reserved["active"] != null) { _g.setReserved("active",value); } else { _g.h["active"] = value; } var attr1 = { className : vdom__$Attr_ClassName_$Impl_$.ofMap(_g), style : vdom__$Style_Style_$Impl_$.ofString("max-height:" + tink_state__$State_State_$Impl_$.get_value(this.__coco_maxHeight__) + "px")}; var children1 = vdom_VDom.h("div",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("virtual-scollbar")},null); var attr2 = { className : vdom__$Attr_ClassName_$Impl_$.ofString("scroll-box")}; var attr3 = { className : vdom__$Attr_ClassName_$Impl_$.ofString("scroll-content")}; var _g1 = []; var _g2 = new tink_pure_NodeIterator(items); while(_g2.list.length > 0) { var item = _g2.next(); _g1.push(vdom__$VNode_VNode_$Impl_$.flatten([!item.get_details().frameOnly ? vdom__$VNode_VNode_$Impl_$.flatten([this.__coco__cache.getFactory("MediaThumb",function(data) { return new epaper_media_MediaThumb(data); }).make(item)]) : vdom__$VNode_VNode_$Impl_$.flatten([])])); } var children2 = [vdom__$VNode_VNode_$Impl_$.flatten(_g1)]; var children3 = vdom_VDom.h("div",attr1,[children1,vdom_VDom.h("div",attr2,[vdom_VDom.h("nav",attr3,[vdom_VDom.h("ul",{ },children2)])])]); var _g21 = []; var _g3 = new tink_pure_NodeIterator(items); while(_g3.list.length > 0) { var item1 = _g3.next(); _g21.push(vdom__$VNode_VNode_$Impl_$.flatten([this.__coco__cache.getFactory("MediaBubble",function(data1) { return new epaper_media_MediaBubble(data1); }).make(item1)])); } return vdom_VDom.h("div",attr,[children,children3,vdom__$VNode_VNode_$Impl_$.flatten(_g21)]); } ,__class__: epaper_media__$MediaBar_MediaList }); var tink_geom2__$FitRect_FitRect_$Impl_$ = {}; tink_geom2__$FitRect_FitRect_$Impl_$.__name__ = ["tink","geom2","_FitRect","FitRect_Impl_"]; tink_geom2__$FitRect_FitRect_$Impl_$.ofConstraint = function(c) { var c1 = c; return function(a1,a2,a3) { return tink_geom2__$FitRect_FitRect_$Impl_$.checkSide(a1,a2,a3,c1); }; }; tink_geom2__$FitRect_FitRect_$Impl_$.compound = function(fitters) { return function(area,anchor,required) { var _g = 0; while(_g < fitters.length) { var s = fitters[_g]; ++_g; var _g1 = s(area,anchor,required); if(_g1[1] != 1) { var v = _g1; return v; } } return haxe_ds_Option.None; }; }; tink_geom2__$FitRect_FitRect_$Impl_$.allSides = function(preferences) { var ret = []; var added = new haxe_ds_StringMap(); var add = function(sides) { if(sides != null) { var _g = 0; while(_g < sides.length) { var s = sides[_g]; ++_g; if(!added.get(s)) { added.set(s,true); var add1 = (function(c) { return function(a1,a2,a3) { return tink_geom2__$FitRect_FitRect_$Impl_$.checkSide(a1,a2,a3,c[0]); }; })([{ side : s}]); ret.push(add1); } } } }; add(preferences); add(tink_geom2__$FitRect_FitRect_$Impl_$.ALL); return tink_geom2__$FitRect_FitRect_$Impl_$.compound(ret); }; tink_geom2__$FitRect_FitRect_$Impl_$.checkSide = function(area,anchor,required,c) { var normal; switch(c.side) { case "lefthand":case "righthand": normal = "horizontal"; break; default: normal = "vertical"; } var origin; switch(c.side) { case "above":case "lefthand": origin = "start"; break; default: origin = "end"; } var sidewards = normal == "vertical" ? "horizontal" : "vertical"; var dest = origin == "end" ? "start" : "end"; var f = c.align; var alignSelf = isNaN(f) ? .5 : f; var f1 = c.alignOnAnchor; var alignOnAnchor = isNaN(f1) ? alignSelf : f1; var this1 = tink_geom2__$Rect_Rect_$Impl_$.extent(anchor,normal); var value; switch(origin) { case "end": value = this1.b; break; case "start": value = this1.a; break; } var delta = normal == "horizontal" ? required.a : required.b; var tmp = value + (origin == "end" ? delta : -delta); var this2 = tink_geom2__$Rect_Rect_$Impl_$.extent(area,normal); var tmp1; switch(origin) { case "end": tmp1 = this2.b; break; case "start": tmp1 = this2.a; break; } if(tink_geom2__$Position_Position_$Impl_$.isBeyond(origin,tmp,tmp1)) { return haxe_ds_Option.None; } else { var this3 = tink_geom2__$Rect_Rect_$Impl_$.extent(anchor,sidewards); var anchorPos = this3.a + alignOnAnchor * (this3.b - this3.a) - alignSelf * (sidewards == "horizontal" ? required.a : required.b); var this4 = tink_geom2__$Rect_Rect_$Impl_$.extent(area,normal); var a; switch(dest) { case "end": a = this4.b; break; case "start": a = this4.a; break; } var this5 = tink_geom2__$Rect_Rect_$Impl_$.extent(anchor,normal); var b; switch(origin) { case "end": b = this5.b; break; case "start": b = this5.a; break; } var contact = dest == "end" ? Math.min(a,b) : Math.max(a,b); var sideDrift = Math.min(tink_geom2__$Rect_Rect_$Impl_$.extent(area,sidewards).b - (sidewards == "horizontal" ? required.a : required.b),Math.max(tink_geom2__$Rect_Rect_$Impl_$.extent(area,sidewards).a,anchorPos)); if(c.withoutSideDrift && anchorPos != sideDrift) { return haxe_ds_Option.None; } else { var delta1 = normal == "horizontal" ? required.a : required.b; var start = contact + (origin == "end" ? delta1 : -delta1); var normal1 = origin == "end" ? tink_geom2__$Extent_Extent_$Impl_$._new(contact,start) : tink_geom2__$Extent_Extent_$Impl_$._new(start,contact); var sidewards1 = tink_geom2__$Extent_Extent_$Impl_$._new(sideDrift,sideDrift + (sidewards == "horizontal" ? required.a : required.b)); var tmp2; if(normal == "vertical") { var this6; var this7 = new tink_core_MPair(sidewards1,normal1); this6 = this7; tmp2 = this6; } else { var this8; var this9 = new tink_core_MPair(normal1,sidewards1); this8 = this9; tmp2 = this8; } return haxe_ds_Option.Some(tmp2); } } }; var tink_geom2__$Position_Position_$Impl_$ = {}; tink_geom2__$Position_Position_$Impl_$.__name__ = ["tink","geom2","_Position","Position_Impl_"]; tink_geom2__$Position_Position_$Impl_$.isBeyond = function(this1,pos,bound) { if(this1 == "end") { return pos > bound; } else { return pos < bound; } }; var tink_geom2__$Rect_Rect_$Impl_$ = {}; tink_geom2__$Rect_Rect_$Impl_$.__name__ = ["tink","geom2","_Rect","Rect_Impl_"]; tink_geom2__$Rect_Rect_$Impl_$.extent = function(this1,dimension) { switch(dimension) { case "horizontal": return this1.a; case "vertical": return this1.b; } }; var tink_geom2__$Extent_Extent_$Impl_$ = {}; tink_geom2__$Extent_Extent_$Impl_$.__name__ = ["tink","geom2","_Extent","Extent_Impl_"]; tink_geom2__$Extent_Extent_$Impl_$._new = function(start,end) { var this1; var this2 = new tink_core_MPair(start,end); this1 = this2; return this1; }; tink_geom2__$Extent_Extent_$Impl_$.rect = function(a,b) { var this1; var this2 = new tink_core_MPair(a,b); this1 = this2; return this1; }; var tink_core_MPair = function(a,b) { this.a = a; this.b = b; }; tink_core_MPair.__name__ = ["tink","core","MPair"]; tink_core_MPair.prototype = { __class__: tink_core_MPair }; var epaper_media_MediaBubble = function(data) { coconut_ui_View.call(this,data,$bind(this,this.render)); }; epaper_media_MediaBubble.__name__ = ["epaper","media","MediaBubble"]; epaper_media_MediaBubble.getIcon = function(item) { var _g = item.icon; if(_g == null) { return "linkextern"; } else { var v = _g; return v.split(".")[0]; } }; epaper_media_MediaBubble.__super__ = coconut_ui_View; epaper_media_MediaBubble.prototype = $extend(coconut_ui_View.prototype,{ render: function(item) { this.anchor = item.get_anchor(); this.active = item.get_isActive(); var details = item.get_details(); var showBubbleOnActive = function() { if(details.bubbleUsedWith == null) { return false; } if(item.get_isActive() && item.get_isActivedOverMediabar() && details.bubbleUsedWith.indexOf("mediabar") != -1) { return true; } if(item.get_isActive() && !item.get_isActivedOverMediabar() && details.bubbleUsedWith.indexOf("frame") != -1) { return true; } return false; }; var attr = { className : vdom__$Attr_ClassName_$Impl_$.ofString("media-bubble"), onmouseenter : function(event) { var attr1 = item.get_anchor(); item.activate(attr1); }, onmouseleave : function(event1) { item.deactivate(); }, attributes : { 'data-open' : showBubbleOnActive() ? "" : undefined}}; var attr2 = details.title; var attr3 = { className : vdom__$Attr_ClassName_$Impl_$.ofString("content media-bubble__button button-resetted"), onclick : function(event2) { (item.get_open())(); }, attributes : { 'aria-label' : attr2}}; var children = details.thumb != null && details.bubbleContains != null && details.bubbleContains.indexOf("thumb") != -1 ? vdom__$VNode_VNode_$Impl_$.flatten([vdom_VDom.h("img",{ src : details.thumb.url})]) : vdom__$VNode_VNode_$Impl_$.flatten([]); var children1 = details.bubbleContains != null && details.bubbleContains.indexOf("short") != -1 ? vdom__$VNode_VNode_$Impl_$.flatten([vdom_HtmlFragment.create({ tag : "h3", content : details.title})]) : vdom__$VNode_VNode_$Impl_$.flatten([]); var children2; if(details.bubbleContains != null && details.bubbleContains.indexOf("long") != -1) { var attr4 = details.description; children2 = vdom__$VNode_VNode_$Impl_$.flatten([vdom_HtmlFragment.create({ tag : "div", className : vdom__$Attr_ClassName_$Impl_$.ofString("description"), content : attr4})]); } else { children2 = vdom__$VNode_VNode_$Impl_$.flatten([]); } var children3; if(details.bubbleContains != null && details.bubbleContains.indexOf("icon") != -1) { var attr5 = { className : vdom__$Attr_ClassName_$Impl_$.ofString("cta"), attributes : { 'data-icon' : "mediaicon-" + epaper_media_MediaBubble.getIcon(details)}}; var _g = details.type; var children4; switch(_g) { case "article": var _g1 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g1.setReserved("lv","Lasīt artikulu"); } else { _g1.h["lv"] = "Lasīt artikulu"; } if(__map_reserved["tr"] != null) { _g1.setReserved("tr","Aç"); } else { _g1.h["tr"] = "Aç"; } if(__map_reserved["en"] != null) { _g1.setReserved("en","Open"); } else { _g1.h["en"] = "Open"; } if(__map_reserved["pl"] != null) { _g1.setReserved("pl","Otwórz"); } else { _g1.h["pl"] = "Otwórz"; } if(__map_reserved["fi"] != null) { _g1.setReserved("fi","Avaa"); } else { _g1.h["fi"] = "Avaa"; } if(__map_reserved["zh_Hans"] != null) { _g1.setReserved("zh_Hans","打开"); } else { _g1.h["zh_Hans"] = "打开"; } if(__map_reserved["ro"] != null) { _g1.setReserved("ro","Deschide"); } else { _g1.h["ro"] = "Deschide"; } if(__map_reserved["sk"] != null) { _g1.setReserved("sk","Otvoriť"); } else { _g1.h["sk"] = "Otvoriť"; } if(__map_reserved["ko"] != null) { _g1.setReserved("ko","열기"); } else { _g1.h["ko"] = "열기"; } if(__map_reserved["it"] != null) { _g1.setReserved("it","Apri"); } else { _g1.h["it"] = "Apri"; } if(__map_reserved["sq"] != null) { _g1.setReserved("sq","Lexo artikullin"); } else { _g1.h["sq"] = "Lexo artikullin"; } if(__map_reserved["ru"] != null) { _g1.setReserved("ru","Открыть"); } else { _g1.h["ru"] = "Открыть"; } if(__map_reserved["pt"] != null) { _g1.setReserved("pt","Abrir"); } else { _g1.h["pt"] = "Abrir"; } if(__map_reserved["da"] != null) { _g1.setReserved("da","Åbn"); } else { _g1.h["da"] = "Åbn"; } if(__map_reserved["el"] != null) { _g1.setReserved("el","Άνοιγμα"); } else { _g1.h["el"] = "Άνοιγμα"; } if(__map_reserved["nl"] != null) { _g1.setReserved("nl","Openen"); } else { _g1.h["nl"] = "Openen"; } if(__map_reserved["bg"] != null) { _g1.setReserved("bg","Отваряне"); } else { _g1.h["bg"] = "Отваряне"; } if(__map_reserved["fr"] != null) { _g1.setReserved("fr","Ouvrir"); } else { _g1.h["fr"] = "Ouvrir"; } if(__map_reserved["sr"] != null) { _g1.setReserved("sr","Прочитај чланак"); } else { _g1.h["sr"] = "Прочитај чланак"; } if(__map_reserved["hr"] != null) { _g1.setReserved("hr","Otvori"); } else { _g1.h["hr"] = "Otvori"; } if(__map_reserved["es"] != null) { _g1.setReserved("es","Abrir"); } else { _g1.h["es"] = "Abrir"; } if(__map_reserved["de"] != null) { _g1.setReserved("de","Öffnen"); } else { _g1.h["de"] = "Öffnen"; } if(__map_reserved["hu"] != null) { _g1.setReserved("hu","Megnyitás"); } else { _g1.h["hu"] = "Megnyitás"; } if(__map_reserved["sv"] != null) { _g1.setReserved("sv","Öppna"); } else { _g1.h["sv"] = "Öppna"; } if(__map_reserved["cs"] != null) { _g1.setReserved("cs","Otevřít"); } else { _g1.h["cs"] = "Otevřít"; } if(__map_reserved["ja"] != null) { _g1.setReserved("ja","開く"); } else { _g1.h["ja"] = "開く"; } if(__map_reserved["nb_NO"] != null) { _g1.setReserved("nb_NO","Åpne"); } else { _g1.h["nb_NO"] = "Åpne"; } children4 = vdom__$VNode_VNode_$Impl_$.flatten([new epaper_i18n_Localizable("MEDIABAR_GOTO_ARTICLE",_g1).toVNode()]); break; case "email": var _g2 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g2.setReserved("lv","Sūtīt e-pastu"); } else { _g2.h["lv"] = "Sūtīt e-pastu"; } if(__map_reserved["tr"] != null) { _g2.setReserved("tr","Aç"); } else { _g2.h["tr"] = "Aç"; } if(__map_reserved["en"] != null) { _g2.setReserved("en","Open"); } else { _g2.h["en"] = "Open"; } if(__map_reserved["pl"] != null) { _g2.setReserved("pl","Otwórz"); } else { _g2.h["pl"] = "Otwórz"; } if(__map_reserved["fi"] != null) { _g2.setReserved("fi","Avaa"); } else { _g2.h["fi"] = "Avaa"; } if(__map_reserved["zh_Hans"] != null) { _g2.setReserved("zh_Hans","打开"); } else { _g2.h["zh_Hans"] = "打开"; } if(__map_reserved["ro"] != null) { _g2.setReserved("ro","Deschide"); } else { _g2.h["ro"] = "Deschide"; } if(__map_reserved["sk"] != null) { _g2.setReserved("sk","Otvoriť"); } else { _g2.h["sk"] = "Otvoriť"; } if(__map_reserved["ko"] != null) { _g2.setReserved("ko","열기"); } else { _g2.h["ko"] = "열기"; } if(__map_reserved["it"] != null) { _g2.setReserved("it","Apri"); } else { _g2.h["it"] = "Apri"; } if(__map_reserved["sq"] != null) { _g2.setReserved("sq","Dërgo e-mail"); } else { _g2.h["sq"] = "Dërgo e-mail"; } if(__map_reserved["ru"] != null) { _g2.setReserved("ru","Открыть"); } else { _g2.h["ru"] = "Открыть"; } if(__map_reserved["pt"] != null) { _g2.setReserved("pt","Abrir"); } else { _g2.h["pt"] = "Abrir"; } if(__map_reserved["da"] != null) { _g2.setReserved("da","Åbn"); } else { _g2.h["da"] = "Åbn"; } if(__map_reserved["el"] != null) { _g2.setReserved("el","Άνοιγμα"); } else { _g2.h["el"] = "Άνοιγμα"; } if(__map_reserved["nl"] != null) { _g2.setReserved("nl","Openen"); } else { _g2.h["nl"] = "Openen"; } if(__map_reserved["bg"] != null) { _g2.setReserved("bg","Отваряне"); } else { _g2.h["bg"] = "Отваряне"; } if(__map_reserved["fr"] != null) { _g2.setReserved("fr","Ouvrir"); } else { _g2.h["fr"] = "Ouvrir"; } if(__map_reserved["sr"] != null) { _g2.setReserved("sr","Пошаљи е-пошту"); } else { _g2.h["sr"] = "Пошаљи е-пошту"; } if(__map_reserved["hr"] != null) { _g2.setReserved("hr","Otvori"); } else { _g2.h["hr"] = "Otvori"; } if(__map_reserved["es"] != null) { _g2.setReserved("es","Abrir"); } else { _g2.h["es"] = "Abrir"; } if(__map_reserved["de"] != null) { _g2.setReserved("de","Öffnen"); } else { _g2.h["de"] = "Öffnen"; } if(__map_reserved["hu"] != null) { _g2.setReserved("hu","Megnyitás"); } else { _g2.h["hu"] = "Megnyitás"; } if(__map_reserved["sv"] != null) { _g2.setReserved("sv","Öppna"); } else { _g2.h["sv"] = "Öppna"; } if(__map_reserved["cs"] != null) { _g2.setReserved("cs","Otevřít"); } else { _g2.h["cs"] = "Otevřít"; } if(__map_reserved["ja"] != null) { _g2.setReserved("ja","開く"); } else { _g2.h["ja"] = "開く"; } if(__map_reserved["nb_NO"] != null) { _g2.setReserved("nb_NO","Åpne"); } else { _g2.h["nb_NO"] = "Åpne"; } children4 = vdom__$VNode_VNode_$Impl_$.flatten([new epaper_i18n_Localizable("MEDIABAR_GOTO_EMAIL",_g2).toVNode()]); break; case "gallery": var _g3 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g3.setReserved("lv","Atvērt Galeriju"); } else { _g3.h["lv"] = "Atvērt Galeriju"; } if(__map_reserved["tr"] != null) { _g3.setReserved("tr","Galeriyi aç"); } else { _g3.h["tr"] = "Galeriyi aç"; } if(__map_reserved["en"] != null) { _g3.setReserved("en","Open Gallery"); } else { _g3.h["en"] = "Open Gallery"; } if(__map_reserved["pl"] != null) { _g3.setReserved("pl","Otwórz galerię"); } else { _g3.h["pl"] = "Otwórz galerię"; } if(__map_reserved["fi"] != null) { _g3.setReserved("fi","Avaa galleria"); } else { _g3.h["fi"] = "Avaa galleria"; } if(__map_reserved["zh_Hans"] != null) { _g3.setReserved("zh_Hans","打开图库"); } else { _g3.h["zh_Hans"] = "打开图库"; } if(__map_reserved["ro"] != null) { _g3.setReserved("ro","Deschide galeria"); } else { _g3.h["ro"] = "Deschide galeria"; } if(__map_reserved["sk"] != null) { _g3.setReserved("sk","Otvoriť galériu"); } else { _g3.h["sk"] = "Otvoriť galériu"; } if(__map_reserved["ko"] != null) { _g3.setReserved("ko","갤러리 열기"); } else { _g3.h["ko"] = "갤러리 열기"; } if(__map_reserved["it"] != null) { _g3.setReserved("it","Apri galleria"); } else { _g3.h["it"] = "Apri galleria"; } if(__map_reserved["sq"] != null) { _g3.setReserved("sq","Hap galerinë"); } else { _g3.h["sq"] = "Hap galerinë"; } if(__map_reserved["ru"] != null) { _g3.setReserved("ru","Открыть галерею"); } else { _g3.h["ru"] = "Открыть галерею"; } if(__map_reserved["pt"] != null) { _g3.setReserved("pt","Abrir galeria"); } else { _g3.h["pt"] = "Abrir galeria"; } if(__map_reserved["da"] != null) { _g3.setReserved("da","Åbn galleri"); } else { _g3.h["da"] = "Åbn galleri"; } if(__map_reserved["el"] != null) { _g3.setReserved("el","Άνοιγμα πινακοθήκης"); } else { _g3.h["el"] = "Άνοιγμα πινακοθήκης"; } if(__map_reserved["nl"] != null) { _g3.setReserved("nl","Galerij openen"); } else { _g3.h["nl"] = "Galerij openen"; } if(__map_reserved["bg"] != null) { _g3.setReserved("bg","Отвори галерия"); } else { _g3.h["bg"] = "Отвори галерия"; } if(__map_reserved["fr"] != null) { _g3.setReserved("fr","Ouvrir la galerie"); } else { _g3.h["fr"] = "Ouvrir la galerie"; } if(__map_reserved["sr"] != null) { _g3.setReserved("sr","Отвори галерију"); } else { _g3.h["sr"] = "Отвори галерију"; } if(__map_reserved["hr"] != null) { _g3.setReserved("hr","Otvori galeriju"); } else { _g3.h["hr"] = "Otvori galeriju"; } if(__map_reserved["es"] != null) { _g3.setReserved("es","Abrir galería"); } else { _g3.h["es"] = "Abrir galería"; } if(__map_reserved["de"] != null) { _g3.setReserved("de","Galerie öffnen"); } else { _g3.h["de"] = "Galerie öffnen"; } if(__map_reserved["hu"] != null) { _g3.setReserved("hu","Galéria megnyitása"); } else { _g3.h["hu"] = "Galéria megnyitása"; } if(__map_reserved["sv"] != null) { _g3.setReserved("sv","Öppna galleriet"); } else { _g3.h["sv"] = "Öppna galleriet"; } if(__map_reserved["cs"] != null) { _g3.setReserved("cs","Otevřít galerii"); } else { _g3.h["cs"] = "Otevřít galerii"; } if(__map_reserved["ja"] != null) { _g3.setReserved("ja","ギャラリーを開く"); } else { _g3.h["ja"] = "ギャラリーを開く"; } if(__map_reserved["nb_NO"] != null) { _g3.setReserved("nb_NO","Åpne galleri"); } else { _g3.h["nb_NO"] = "Åpne galleri"; } children4 = vdom__$VNode_VNode_$Impl_$.flatten([new epaper_i18n_Localizable("MEDIABAR_GOTO_GALLERY",_g3).toVNode()]); break; case "internal": var _g4 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g4.setReserved("lv","Iet uz lapu"); } else { _g4.h["lv"] = "Iet uz lapu"; } if(__map_reserved["tr"] != null) { _g4.setReserved("tr","Sayfaya git"); } else { _g4.h["tr"] = "Sayfaya git"; } if(__map_reserved["en"] != null) { _g4.setReserved("en","Go to page"); } else { _g4.h["en"] = "Go to page"; } if(__map_reserved["pl"] != null) { _g4.setReserved("pl","Przejdź do strony"); } else { _g4.h["pl"] = "Przejdź do strony"; } if(__map_reserved["fi"] != null) { _g4.setReserved("fi","Siirry sivulle"); } else { _g4.h["fi"] = "Siirry sivulle"; } if(__map_reserved["zh_Hans"] != null) { _g4.setReserved("zh_Hans","转到页"); } else { _g4.h["zh_Hans"] = "转到页"; } if(__map_reserved["ro"] != null) { _g4.setReserved("ro","Mergi la pagina"); } else { _g4.h["ro"] = "Mergi la pagina"; } if(__map_reserved["sk"] != null) { _g4.setReserved("sk","Prejsť na stranu"); } else { _g4.h["sk"] = "Prejsť na stranu"; } if(__map_reserved["ko"] != null) { _g4.setReserved("ko","페이지로 가기"); } else { _g4.h["ko"] = "페이지로 가기"; } if(__map_reserved["it"] != null) { _g4.setReserved("it","Vai alla pagina"); } else { _g4.h["it"] = "Vai alla pagina"; } if(__map_reserved["sq"] != null) { _g4.setReserved("sq","Shko tek faqja"); } else { _g4.h["sq"] = "Shko tek faqja"; } if(__map_reserved["ru"] != null) { _g4.setReserved("ru","Перейти к странице"); } else { _g4.h["ru"] = "Перейти к странице"; } if(__map_reserved["pt"] != null) { _g4.setReserved("pt","Ir para a página"); } else { _g4.h["pt"] = "Ir para a página"; } if(__map_reserved["da"] != null) { _g4.setReserved("da","Gå til side"); } else { _g4.h["da"] = "Gå til side"; } if(__map_reserved["el"] != null) { _g4.setReserved("el","Μετάβαση στη σελίδα"); } else { _g4.h["el"] = "Μετάβαση στη σελίδα"; } if(__map_reserved["nl"] != null) { _g4.setReserved("nl","Ga naar pagina"); } else { _g4.h["nl"] = "Ga naar pagina"; } if(__map_reserved["bg"] != null) { _g4.setReserved("bg","Отиди на страница"); } else { _g4.h["bg"] = "Отиди на страница"; } if(__map_reserved["fr"] != null) { _g4.setReserved("fr","Aller à la page"); } else { _g4.h["fr"] = "Aller à la page"; } if(__map_reserved["sr"] != null) { _g4.setReserved("sr","Иди на страну"); } else { _g4.h["sr"] = "Иди на страну"; } if(__map_reserved["hr"] != null) { _g4.setReserved("hr","Idi na stranicu"); } else { _g4.h["hr"] = "Idi na stranicu"; } if(__map_reserved["es"] != null) { _g4.setReserved("es","Ir a la página"); } else { _g4.h["es"] = "Ir a la página"; } if(__map_reserved["de"] != null) { _g4.setReserved("de","Gehe zur Seite"); } else { _g4.h["de"] = "Gehe zur Seite"; } if(__map_reserved["hu"] != null) { _g4.setReserved("hu","Menjen a köv oldalra"); } else { _g4.h["hu"] = "Menjen a köv oldalra"; } if(__map_reserved["sv"] != null) { _g4.setReserved("sv","Gå till sidan"); } else { _g4.h["sv"] = "Gå till sidan"; } if(__map_reserved["cs"] != null) { _g4.setReserved("cs","Přejdi na stránku"); } else { _g4.h["cs"] = "Přejdi na stránku"; } if(__map_reserved["ja"] != null) { _g4.setReserved("ja","ページに移動"); } else { _g4.h["ja"] = "ページに移動"; } if(__map_reserved["nb_NO"] != null) { _g4.setReserved("nb_NO","Gå til side"); } else { _g4.h["nb_NO"] = "Gå til side"; } children4 = vdom__$VNode_VNode_$Impl_$.flatten([new epaper_i18n_Localizable("MEDIABAR_GOTO_PAGE",_g4).toVNode()]); break; case "url": var _g5 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g5.setReserved("lv","Atvērt saiti"); } else { _g5.h["lv"] = "Atvērt saiti"; } if(__map_reserved["tr"] != null) { _g5.setReserved("tr","Bağlantıyı aç"); } else { _g5.h["tr"] = "Bağlantıyı aç"; } if(__map_reserved["en"] != null) { _g5.setReserved("en","Go to Link"); } else { _g5.h["en"] = "Go to Link"; } if(__map_reserved["pl"] != null) { _g5.setReserved("pl","Otwórz łącze"); } else { _g5.h["pl"] = "Otwórz łącze"; } if(__map_reserved["fi"] != null) { _g5.setReserved("fi","Avaa linkki"); } else { _g5.h["fi"] = "Avaa linkki"; } if(__map_reserved["zh_Hans"] != null) { _g5.setReserved("zh_Hans","打开链接"); } else { _g5.h["zh_Hans"] = "打开链接"; } if(__map_reserved["ro"] != null) { _g5.setReserved("ro","Deschide link"); } else { _g5.h["ro"] = "Deschide link"; } if(__map_reserved["sk"] != null) { _g5.setReserved("sk","Otvoriť link"); } else { _g5.h["sk"] = "Otvoriť link"; } if(__map_reserved["ko"] != null) { _g5.setReserved("ko","링크 열기"); } else { _g5.h["ko"] = "링크 열기"; } if(__map_reserved["it"] != null) { _g5.setReserved("it","Apri link"); } else { _g5.h["it"] = "Apri link"; } if(__map_reserved["sq"] != null) { _g5.setReserved("sq","Hap linkun"); } else { _g5.h["sq"] = "Hap linkun"; } if(__map_reserved["ru"] != null) { _g5.setReserved("ru","Открыть ссылку"); } else { _g5.h["ru"] = "Открыть ссылку"; } if(__map_reserved["pt"] != null) { _g5.setReserved("pt","Abrir link"); } else { _g5.h["pt"] = "Abrir link"; } if(__map_reserved["da"] != null) { _g5.setReserved("da","Åbn link"); } else { _g5.h["da"] = "Åbn link"; } if(__map_reserved["el"] != null) { _g5.setReserved("el","Άνοιγμα συνδέσμου"); } else { _g5.h["el"] = "Άνοιγμα συνδέσμου"; } if(__map_reserved["nl"] != null) { _g5.setReserved("nl","Link openen"); } else { _g5.h["nl"] = "Link openen"; } if(__map_reserved["bg"] != null) { _g5.setReserved("bg","Отвори линк"); } else { _g5.h["bg"] = "Отвори линк"; } if(__map_reserved["fr"] != null) { _g5.setReserved("fr","Ouvrir le lien"); } else { _g5.h["fr"] = "Ouvrir le lien"; } if(__map_reserved["sr"] != null) { _g5.setReserved("sr","Отвори линк"); } else { _g5.h["sr"] = "Отвори линк"; } if(__map_reserved["hr"] != null) { _g5.setReserved("hr","Otvori poveznicu"); } else { _g5.h["hr"] = "Otvori poveznicu"; } if(__map_reserved["es"] != null) { _g5.setReserved("es","Abrir enlace"); } else { _g5.h["es"] = "Abrir enlace"; } if(__map_reserved["de"] != null) { _g5.setReserved("de","Link öffnen"); } else { _g5.h["de"] = "Link öffnen"; } if(__map_reserved["hu"] != null) { _g5.setReserved("hu","Link megnyitása"); } else { _g5.h["hu"] = "Link megnyitása"; } if(__map_reserved["sv"] != null) { _g5.setReserved("sv","Öppna länken"); } else { _g5.h["sv"] = "Öppna länken"; } if(__map_reserved["cs"] != null) { _g5.setReserved("cs","Otevřít odkaz"); } else { _g5.h["cs"] = "Otevřít odkaz"; } if(__map_reserved["ja"] != null) { _g5.setReserved("ja","リンクを開く"); } else { _g5.h["ja"] = "リンクを開く"; } if(__map_reserved["nb_NO"] != null) { _g5.setReserved("nb_NO","Åpne kobling"); } else { _g5.h["nb_NO"] = "Åpne kobling"; } children4 = vdom__$VNode_VNode_$Impl_$.flatten([new epaper_i18n_Localizable("MEDIABAR_GOTO_URL",_g5).toVNode()]); break; case "video": var _g6 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g6.setReserved("lv","Atvērt Video"); } else { _g6.h["lv"] = "Atvērt Video"; } if(__map_reserved["tr"] != null) { _g6.setReserved("tr","Video'yu aç"); } else { _g6.h["tr"] = "Video'yu aç"; } if(__map_reserved["en"] != null) { _g6.setReserved("en","Open Video"); } else { _g6.h["en"] = "Open Video"; } if(__map_reserved["pl"] != null) { _g6.setReserved("pl","Otwórz wideo"); } else { _g6.h["pl"] = "Otwórz wideo"; } if(__map_reserved["fi"] != null) { _g6.setReserved("fi","Avaa video"); } else { _g6.h["fi"] = "Avaa video"; } if(__map_reserved["zh_Hans"] != null) { _g6.setReserved("zh_Hans","打开视频"); } else { _g6.h["zh_Hans"] = "打开视频"; } if(__map_reserved["ro"] != null) { _g6.setReserved("ro","Deschide video"); } else { _g6.h["ro"] = "Deschide video"; } if(__map_reserved["sk"] != null) { _g6.setReserved("sk","Otvoriť video"); } else { _g6.h["sk"] = "Otvoriť video"; } if(__map_reserved["ko"] != null) { _g6.setReserved("ko","비디오 열기"); } else { _g6.h["ko"] = "비디오 열기"; } if(__map_reserved["it"] != null) { _g6.setReserved("it","Apri video"); } else { _g6.h["it"] = "Apri video"; } if(__map_reserved["sq"] != null) { _g6.setReserved("sq","Hap videon"); } else { _g6.h["sq"] = "Hap videon"; } if(__map_reserved["ru"] != null) { _g6.setReserved("ru","Открыть видео"); } else { _g6.h["ru"] = "Открыть видео"; } if(__map_reserved["pt"] != null) { _g6.setReserved("pt","Abrir vídeo"); } else { _g6.h["pt"] = "Abrir vídeo"; } if(__map_reserved["da"] != null) { _g6.setReserved("da","Åbn video"); } else { _g6.h["da"] = "Åbn video"; } if(__map_reserved["el"] != null) { _g6.setReserved("el","Άνοιγμα βίντεο"); } else { _g6.h["el"] = "Άνοιγμα βίντεο"; } if(__map_reserved["nl"] != null) { _g6.setReserved("nl","Video openen"); } else { _g6.h["nl"] = "Video openen"; } if(__map_reserved["bg"] != null) { _g6.setReserved("bg","Отвори видео"); } else { _g6.h["bg"] = "Отвори видео"; } if(__map_reserved["fr"] != null) { _g6.setReserved("fr","Ouvrir la vidéo"); } else { _g6.h["fr"] = "Ouvrir la vidéo"; } if(__map_reserved["sr"] != null) { _g6.setReserved("sr","Отвори видео"); } else { _g6.h["sr"] = "Отвори видео"; } if(__map_reserved["hr"] != null) { _g6.setReserved("hr","Otvori videozapis"); } else { _g6.h["hr"] = "Otvori videozapis"; } if(__map_reserved["es"] != null) { _g6.setReserved("es","Abrir vídeo"); } else { _g6.h["es"] = "Abrir vídeo"; } if(__map_reserved["de"] != null) { _g6.setReserved("de","Video öffnen"); } else { _g6.h["de"] = "Video öffnen"; } if(__map_reserved["hu"] != null) { _g6.setReserved("hu","Videó megnyitása"); } else { _g6.h["hu"] = "Videó megnyitása"; } if(__map_reserved["sv"] != null) { _g6.setReserved("sv","Öppna video"); } else { _g6.h["sv"] = "Öppna video"; } if(__map_reserved["cs"] != null) { _g6.setReserved("cs","Otevřít video"); } else { _g6.h["cs"] = "Otevřít video"; } if(__map_reserved["ja"] != null) { _g6.setReserved("ja","ビデオを開く"); } else { _g6.h["ja"] = "ビデオを開く"; } if(__map_reserved["nb_NO"] != null) { _g6.setReserved("nb_NO","Åpne video"); } else { _g6.h["nb_NO"] = "Åpne video"; } children4 = vdom__$VNode_VNode_$Impl_$.flatten([new epaper_i18n_Localizable("MEDIABAR_GOTO_VIDEO",_g6).toVNode()]); break; default: var _g7 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g7.setReserved("lv","Atvērt"); } else { _g7.h["lv"] = "Atvērt"; } if(__map_reserved["tr"] != null) { _g7.setReserved("tr","Aç"); } else { _g7.h["tr"] = "Aç"; } if(__map_reserved["en"] != null) { _g7.setReserved("en","Open"); } else { _g7.h["en"] = "Open"; } if(__map_reserved["pl"] != null) { _g7.setReserved("pl","Otwórz"); } else { _g7.h["pl"] = "Otwórz"; } if(__map_reserved["fi"] != null) { _g7.setReserved("fi","Avaa"); } else { _g7.h["fi"] = "Avaa"; } if(__map_reserved["zh_Hans"] != null) { _g7.setReserved("zh_Hans","打开"); } else { _g7.h["zh_Hans"] = "打开"; } if(__map_reserved["ro"] != null) { _g7.setReserved("ro","Deschide"); } else { _g7.h["ro"] = "Deschide"; } if(__map_reserved["sk"] != null) { _g7.setReserved("sk","Otvoriť"); } else { _g7.h["sk"] = "Otvoriť"; } if(__map_reserved["ko"] != null) { _g7.setReserved("ko","열기"); } else { _g7.h["ko"] = "열기"; } if(__map_reserved["it"] != null) { _g7.setReserved("it","Apri"); } else { _g7.h["it"] = "Apri"; } if(__map_reserved["sq"] != null) { _g7.setReserved("sq","Hap"); } else { _g7.h["sq"] = "Hap"; } if(__map_reserved["ru"] != null) { _g7.setReserved("ru","Открыть"); } else { _g7.h["ru"] = "Открыть"; } if(__map_reserved["pt"] != null) { _g7.setReserved("pt","Abrir"); } else { _g7.h["pt"] = "Abrir"; } if(__map_reserved["da"] != null) { _g7.setReserved("da","Åbn"); } else { _g7.h["da"] = "Åbn"; } if(__map_reserved["el"] != null) { _g7.setReserved("el","Άνοιγμα"); } else { _g7.h["el"] = "Άνοιγμα"; } if(__map_reserved["nl"] != null) { _g7.setReserved("nl","Openen"); } else { _g7.h["nl"] = "Openen"; } if(__map_reserved["bg"] != null) { _g7.setReserved("bg","Отваряне"); } else { _g7.h["bg"] = "Отваряне"; } if(__map_reserved["fr"] != null) { _g7.setReserved("fr","Ouvrir"); } else { _g7.h["fr"] = "Ouvrir"; } if(__map_reserved["sr"] != null) { _g7.setReserved("sr","Отвори"); } else { _g7.h["sr"] = "Отвори"; } if(__map_reserved["hr"] != null) { _g7.setReserved("hr","Otvori"); } else { _g7.h["hr"] = "Otvori"; } if(__map_reserved["es"] != null) { _g7.setReserved("es","Abrir"); } else { _g7.h["es"] = "Abrir"; } if(__map_reserved["de"] != null) { _g7.setReserved("de","Öffnen"); } else { _g7.h["de"] = "Öffnen"; } if(__map_reserved["hu"] != null) { _g7.setReserved("hu","Megnyitás"); } else { _g7.h["hu"] = "Megnyitás"; } if(__map_reserved["sv"] != null) { _g7.setReserved("sv","Öppna"); } else { _g7.h["sv"] = "Öppna"; } if(__map_reserved["cs"] != null) { _g7.setReserved("cs","Otevřít"); } else { _g7.h["cs"] = "Otevřít"; } if(__map_reserved["ja"] != null) { _g7.setReserved("ja","開く"); } else { _g7.h["ja"] = "開く"; } if(__map_reserved["nb_NO"] != null) { _g7.setReserved("nb_NO","Åpne"); } else { _g7.h["nb_NO"] = "Åpne"; } children4 = vdom__$VNode_VNode_$Impl_$.flatten([new epaper_i18n_Localizable("MEDIABAR_GOTO_OPEN",_g7).toVNode()]); } children3 = vdom__$VNode_VNode_$Impl_$.flatten([vdom_VDom.h("div",attr5,[vdom_VDom.h("span",{ },[children4])])]); } else { children3 = vdom__$VNode_VNode_$Impl_$.flatten([]); } return vdom_VDom.h("div",attr,[vdom_VDom.h("button",attr3,[children,children1,children2,children3])]); } ,afterPatching: function(e) { if(Dom.nearest(e,".epaper-root") == null) { this.destroy(); return; } if(this.active) { var findPos = epaper_media_MediaBubble.centered; var r = Dom.nearest(e,".epaper-root").getBoundingClientRect(); var this1; var this2 = new tink_core_MPair(tink_geom2__$Extent_Extent_$Impl_$._new(r.left,r.right),tink_geom2__$Extent_Extent_$Impl_$._new(r.top,r.bottom)); this1 = this2; var root = this1; var anchor; var _g = this.anchor; switch(_g[1]) { case 0: var e1 = _g[2]; findPos = epaper_media_MediaBubble.sideways; var r1 = e1.getBoundingClientRect(); var this3; var this4 = new tink_core_MPair(tink_geom2__$Extent_Extent_$Impl_$._new(r1.left,r1.right),tink_geom2__$Extent_Extent_$Impl_$._new(r1.top,r1.bottom)); this3 = this4; var bounds = this3; var _g1 = Dom.nearest(e1,".contents>ul"); if(_g1 != null) { var v = _g1; var r2 = v.getBoundingClientRect(); var this5; var this6 = new tink_core_MPair(tink_geom2__$Extent_Extent_$Impl_$._new(r2.left,r2.right),tink_geom2__$Extent_Extent_$Impl_$._new(r2.top,r2.bottom)); this5 = this6; bounds = tink_geom2__$Extent_Extent_$Impl_$.rect(this5.a,bounds.b); } if(bounds.a.a < root.a.a) { var this7 = bounds.a; anchor = tink_geom2__$Extent_Extent_$Impl_$.rect(tink_geom2__$Extent_Extent_$Impl_$._new(root.a.a,root.a.a + (this7.b - this7.a)),bounds.b); } else if(bounds.a.b > root.a.b) { var this8 = bounds.a; anchor = tink_geom2__$Extent_Extent_$Impl_$.rect(tink_geom2__$Extent_Extent_$Impl_$._new(root.a.b - (this8.b - this8.a),root.a.b),bounds.b); } else { anchor = bounds; } break; case 1: var r3 = _g[2]; anchor = r3(); break; } var r4 = e.getBoundingClientRect(); var this9; var this10 = new tink_core_MPair(tink_geom2__$Extent_Extent_$Impl_$._new(r4.left,r4.right),tink_geom2__$Extent_Extent_$Impl_$._new(r4.top,r4.bottom)); this9 = this10; var this11 = this9; var this12 = this11.a; var this13 = this11.b; var this14; var this15 = new tink_core_MPair(this12.b - this12.a,this13.b - this13.a); this14 = this15; var _g11 = findPos(root,anchor,this14); switch(_g11[1]) { case 0: var v1 = _g11[2]; e.style.top = v1.b.a - root.b.a + "px"; e.style.left = v1.a.a - root.a.a + "px"; break; case 1: break; } } } ,__class__: epaper_media_MediaBubble }); var epaper_media_MediaController = function(root,media) { this.root = root; this.media = media; var __tmp = []; var _g = 0; var _g1 = ["left","right"]; while(_g < _g1.length) { var side = _g1[_g]; ++_g; __tmp.push(new epaper_media_MediaBar(side)); } this.bars = __tmp; var _g2 = 0; var _g11 = this.bars; while(_g2 < _g11.length) { var b = _g11[_g2]; ++_g2; b.setParent(root,root.querySelector(".main-controls")); } tink_state__$Observable_Observable_$Impl_$.bind(media,null,$bind(this,this.updateMedia)); window.addEventListener("resize",$bind(this,this.updateMaxHeightInViewport)); this.updateMaxHeightInViewport(); }; epaper_media_MediaController.__name__ = ["epaper","media","MediaController"]; epaper_media_MediaController.prototype = { updateMaxHeightInViewport: function() { var rootBox = this.root.getBoundingClientRect(); this.maxHeightInViewport = rootBox.bottom - rootBox.top - epaper_media_MediaController.MAIN_CONTROLS_HEIGHT - epaper_media_MediaController.BAR_TOP_OFFSET - epaper_media_MediaController.BAR_BOTTOM_OFFSET; var _g = 0; var _g1 = this.bars; while(_g < _g1.length) { var bar = _g1[_g]; ++_g; this.updateMediabarMaxHeight(bar); } } ,updateMediabarMaxHeight: function(bar) { var _gthis = this; bar.setMaxHeight(this.maxHeightInViewport); var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { var f = Math.min(_gthis.maxHeightInViewport,bar.getLatestContentHeight() + 3); bar.setMaxHeight(f); },100),$bind($_,$_.stop))); } ,updateMedia: function(pageMedia) { var iterator_bar_pos; var iterator_bar_a; var a = this.bars; iterator_bar_a = a; iterator_bar_pos = a.length; var iterator_media_pos; var iterator_media_a = pageMedia; iterator_media_pos = pageMedia.length; while(iterator_bar_pos > 0) { var bar = iterator_bar_a[--iterator_bar_pos]; var media = iterator_media_pos > 0 ? iterator_media_a[--iterator_media_pos] : []; bar.update(media); this.updateMediabarMaxHeight(bar); } } ,__class__: epaper_media_MediaController }; var epaper_media_MediaFocus = function(initial) { if(initial == null) { initial = { }; } this.__coco_current = tink_state__$State_State_$Impl_$.ofConstant(haxe_ds_Option.None); var this1 = new tink_state__$State_StateObject(0,null); this.__coco_transitionCount = this1; this.errorTrigger = tink_core__$Signal_Signal_$Impl_$.trigger(); this.transitionErrors = this.errorTrigger; this.observables = { current : this.__coco_current, isInTransition : tink_state__$Observable_Observable_$Impl_$.map(this.__coco_transitionCount,tink_state__$Observable_Transform_$Impl_$.plain(function(c) { return c > 0; }))}; }; epaper_media_MediaFocus.__name__ = ["epaper","media","MediaFocus"]; epaper_media_MediaFocus.__interfaces__ = [coconut_data_Model]; epaper_media_MediaFocus.prototype = { clear: function() { var _gthis = this; var ret = tink_core__$Promise_Promise_$Impl_$.ofOutcome(tink_core_Outcome.Success({ current : haxe_ds_Option.None})); var sync = true; var done = false; ret.handle(function(o) { done = true; if(!sync) { var tmp = tink_state__$State_State_$Impl_$.get_value(_gthis.__coco_transitionCount) - 1; _gthis.__coco_transitionCount.set(tmp); } switch(o[1]) { case 0: var v = o[2]; _gthis.__cocoupdate(v); break; case 1: var e = o[2]; tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis.errorTrigger.handlers,e); break; } }); if(!done) { sync = false; } if(!sync) { this.__coco_transitionCount.set(tink_state__$State_State_$Impl_$.get_value(this.__coco_transitionCount) + 1); } return ret; } ,toggleActive: function(m) { var _gthis = this; var d; var o = _gthis.get_current(); var d1; if(o[1] == 0) { var v = o[2]; d1 = v == m; } else { d1 = false; } if(d1) { d = haxe_ds_Option.None; } else { d = haxe_ds_Option.Some(m); } var ret = tink_core__$Promise_Promise_$Impl_$.ofOutcome(tink_core_Outcome.Success({ current : d})); var sync = true; var done = false; ret.handle(function(o1) { done = true; if(!sync) { var tmp = tink_state__$State_State_$Impl_$.get_value(_gthis.__coco_transitionCount) - 1; _gthis.__coco_transitionCount.set(tmp); } switch(o1[1]) { case 0: var v1 = o1[2]; _gthis.__cocoupdate(v1); break; case 1: var e = o1[2]; tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis.errorTrigger.handlers,e); break; } }); if(!done) { sync = false; } if(!sync) { this.__coco_transitionCount.set(tink_state__$State_State_$Impl_$.get_value(this.__coco_transitionCount) + 1); } return ret; } ,get_current: function() { return tink_state__$State_State_$Impl_$.get_value(this.__coco_current); } ,__cocoupdate: function(delta) { var this1 = { }; var sparse = this1; var delta1 = delta; var _g = 0; var _g1 = Reflect.fields(delta1); while(_g < _g1.length) { var k = _g1[_g]; ++_g; var this2; var this3 = new Array(1); this2 = this3; var ret = this2; ret[0] = delta1[k]; sparse[k] = ret; } var delta2 = sparse; if(delta2.current != null) { this.__coco_current.set(delta2.current[0]); } } ,__class__: epaper_media_MediaFocus }; var epaper_media_MediaItem = function(initial) { var _gthis = this; this.open = $bind(initial,initial.open); this.focus = initial.focus; this.getDetails = $bind(initial,initial.getDetails); var this1 = { f : function() { return (_gthis.get_getDetails())(); }}; this.__coco_details = tink_state__$Observable_Observable_$Impl_$.auto(this1); var this2 = { f : function() { var o = _gthis.get_focus().get_current(); if(o[1] == 0) { var v = o[2]; return v == _gthis; } else { return false; } }}; this.__coco_isActive = tink_state__$Observable_Observable_$Impl_$.auto(this2); this.__coco_isActivedOverMediabar = tink_state__$State_State_$Impl_$.ofConstant(false); this.__coco_anchor = tink_state__$State_State_$Impl_$.ofConstant(null); var this3 = new tink_state__$State_StateObject(0,null); this.__coco_transitionCount = this3; this.errorTrigger = tink_core__$Signal_Signal_$Impl_$.trigger(); this.transitionErrors = this.errorTrigger; this.observables = { open : tink_state__$Observable_Observable_$Impl_$["const"](this.get_open()), getDetails : tink_state__$Observable_Observable_$Impl_$["const"](this.get_getDetails()), details : this.__coco_details, isActive : this.__coco_isActive, isActivedOverMediabar : this.__coco_isActivedOverMediabar, anchor : this.__coco_anchor, isInTransition : tink_state__$Observable_Observable_$Impl_$.map(this.__coco_transitionCount,tink_state__$Observable_Transform_$Impl_$.plain(function(c) { return c > 0; }))}; }; epaper_media_MediaItem.__name__ = ["epaper","media","MediaItem"]; epaper_media_MediaItem.__interfaces__ = [coconut_data_Model]; epaper_media_MediaItem.prototype = { activate: function(anchor) { this.set_anchor(anchor); if(!this.get_isActive()) { var tmp; switch(anchor[1]) { case 0: var e = anchor[2]; tmp = true; break; case 1: var r = anchor[2]; tmp = false; break; } this.set_isActivedOverMediabar(tmp); this.get_focus().toggleActive(this); } } ,deactivate: function() { if(this.get_isActive()) { this.get_focus().toggleActive(this); } } ,interactions: function(options) { var _gthis = this; var anchor = function(e) { if(options.dom) { return epaper_media_Anchor.Dom(e); } else { return epaper_media_Anchor.Geom(function() { var r = e.getBoundingClientRect(); var this1; var this2 = new tink_core_MPair(tink_geom2__$Extent_Extent_$Impl_$._new(r.left,r.right),tink_geom2__$Extent_Extent_$Impl_$._new(r.top,r.bottom)); this1 = this2; return this1; }); } }; var $is = function(flag,value) { return window.document.querySelector(".epaper-root").getAttribute("data-" + flag) == value; }; return { onmouseenter : function(e1) { if(!$is("input","touch")) { var tmp = anchor(e1.target); _gthis.activate(tmp); } }, onmouseleave : function(e2) { if(!$is("input","touch")) { _gthis.deactivate(); } }, onclick : function(e3) { if($is("input","touch")) { if(!_gthis.get_isActive()) { if(_gthis.useBubbleInsteadOfClick(e3)) { var tmp1 = anchor(e3.target); _gthis.activate(tmp1); var this3 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { var f = tink_state__$Observable_Observable_$Impl_$.nextTime(_gthis.get_focus().observables.current,null,function(c) { return c == haxe_ds_Option.None; }); var this4 = Dom.once(window.document,"click",tink_core__$Callback_Callback_$Impl_$.fromNiladic($bind(_gthis,_gthis.deactivate))); f.handle(function(_) { this4.dissolve(); }); },100),$bind($_,$_.stop))); } else { (_gthis.get_open())(); } } else { _gthis.deactivate(); } } else { (_gthis.get_open())(); } e3.preventDefault(); e3.stopImmediatePropagation(); }}; } ,useBubbleInsteadOfClick: function(e) { if(this.get_details().bubbleUsedWith == null) { return false; } var currElt = e.currentTarget; var mediaBarElts = window.document.querySelectorAll(".epaper-root .media-bar"); var isOverMediabar = false; var _g = 0; while(_g < mediaBarElts.length) { var mb = mediaBarElts[_g]; ++_g; if(!isOverMediabar) { isOverMediabar = mb.contains(currElt); } else { isOverMediabar = true; } } if(isOverMediabar && this.get_details().bubbleUsedWith.indexOf("mediabar") != -1) { return true; } if(!isOverMediabar && this.get_details().bubbleUsedWith.indexOf("frame") != -1) { return true; } return false; } ,get_open: function() { return this.open; } ,get_focus: function() { return this.focus; } ,get_getDetails: function() { return this.getDetails; } ,get_details: function() { return tink_state__$Observable_Observable_$Impl_$.get_value(this.__coco_details); } ,get_isActive: function() { return tink_state__$Observable_Observable_$Impl_$.get_value(this.__coco_isActive); } ,get_isActivedOverMediabar: function() { return tink_state__$State_State_$Impl_$.get_value(this.__coco_isActivedOverMediabar); } ,set_isActivedOverMediabar: function(param) { this.__coco_isActivedOverMediabar.set(param); return param; } ,get_anchor: function() { return tink_state__$State_State_$Impl_$.get_value(this.__coco_anchor); } ,set_anchor: function(param) { this.__coco_anchor.set(param); return param; } ,__class__: epaper_media_MediaItem }; var epaper_media_Anchor = { __ename__ : true, __constructs__ : ["Dom","Geom"] }; epaper_media_Anchor.Dom = function(e) { var $x = ["Dom",0,e]; $x.__enum__ = epaper_media_Anchor; $x.toString = $estr; return $x; }; epaper_media_Anchor.Geom = function(r) { var $x = ["Geom",1,r]; $x.__enum__ = epaper_media_Anchor; $x.toString = $estr; return $x; }; var epaper_media_MediaThumb = function(data) { coconut_ui_View.call(this,data,$bind(this,this.render)); }; epaper_media_MediaThumb.__name__ = ["epaper","media","MediaThumb"]; epaper_media_MediaThumb.thumbStyle = function(thumb,mediabarContains) { if(mediabarContains == null || mediabarContains.indexOf("thumb") == -1) { return { }; } if(thumb == null) { return { }; } else if(thumb.url == null) { return { }; } else if(thumb.url == "") { return { }; } else { return { paddingTop : thumb.height / thumb.width * 100 + "%", backgroundImage : "url(\"" + thumb.url + "\")", backgroundColor : thumb.color}; } }; epaper_media_MediaThumb.getIcon = function(item) { var _g = item.icon; if(_g == null) { return "linkextern"; } else { var v = _g; return v.split(".")[0]; } }; epaper_media_MediaThumb.getAsHTML = function(text) { return new vdom_HtmlFragment(text); }; epaper_media_MediaThumb.__super__ = coconut_ui_View; epaper_media_MediaThumb.prototype = $extend(coconut_ui_View.prototype,{ render: function(__data__) { var isInTransition = tink_state__$Observable_Observable_$Impl_$.get_value(__data__.observables.isInTransition); var transitionErrors = __data__.transitionErrors; var observables = __data__.observables; var interactions = $bind(__data__,__data__.interactions); var deactivate = $bind(__data__,__data__.deactivate); var activate = $bind(__data__,__data__.activate); var anchor = __data__.get_anchor(); var isActivedOverMediabar = __data__.get_isActivedOverMediabar(); var isActive = __data__.get_isActive(); var details = __data__.get_details(); var getDetails = __data__.get_getDetails(); var open = __data__.get_open(); var __v_0 = interactions({ dom : true}); var children = [vdom_VDom.h("a",{ href : "#", tabIndex : 0, className : vdom__$Attr_ClassName_$Impl_$.ofString("media-thumb__button button-resetted"), attributes : { 'aria-label' : details.title, 'data-type' : details.type, 'data-hovered' : isActive ? "" : undefined}, onclick : __v_0.onclick, onmouseenter : __v_0.onmouseenter, onmouseleave : __v_0.onmouseleave},[details.mediabarContains != null && details.mediabarContains.indexOf("thumb") != -1 ? vdom__$VNode_VNode_$Impl_$.flatten([vdom_VDom.h("div",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("media-thumb__thumb thumb"), style : epaper_media_MediaThumb.thumbStyle(details.thumb,details.mediabarContains)},null)]) : vdom__$VNode_VNode_$Impl_$.flatten([]),details.mediabarContains != null && details.mediabarContains.indexOf("short") != -1 ? vdom__$VNode_VNode_$Impl_$.flatten([vdom_VDom.h("div",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("media-thumb__title title")},[epaper_media_MediaThumb.getAsHTML(details.title)])]) : vdom__$VNode_VNode_$Impl_$.flatten([]),details.mediabarContains != null && details.mediabarContains.indexOf("long") != -1 ? vdom__$VNode_VNode_$Impl_$.flatten([vdom_VDom.h("div",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("media-thumb__desc desc")},[epaper_media_MediaThumb.getAsHTML(details.description)])]) : vdom__$VNode_VNode_$Impl_$.flatten([]),details.mediabarContains != null && details.mediabarContains.indexOf("icon") != -1 ? vdom__$VNode_VNode_$Impl_$.flatten([vdom_VDom.h("div",{ className : vdom__$Attr_ClassName_$Impl_$.ofString("media-thumb__icon icon"), attributes : { 'data-icon' : "mediaicon-" + epaper_media_MediaThumb.getIcon(details)}},null)]) : vdom__$VNode_VNode_$Impl_$.flatten([])])]; return vdom_VDom.h("li",{ },children); } ,__class__: epaper_media_MediaThumb }); var epaper_media_MediaView = function(mode) { this.pos = 0; this.element = Dom.getElement(epaper_media_MediaView.renderContainer(mode)); this.container = this.element.querySelector(".gallery-container"); var intercept = function(handler) { return function(o) { o.event.preventDefault(); o.event.stopImmediatePropagation(); handler(); }; }; _$Dom_QueryResult_$Impl_$.on(".prev","click",this.element,intercept($bind(this,this.prev))); _$Dom_QueryResult_$Impl_$.on(".next","click",this.element,intercept($bind(this,this.next))); }; epaper_media_MediaView.__name__ = ["epaper","media","MediaView"]; epaper_media_MediaView.get_EXPANDED = function() { if(epaper_media_MediaView.EXPANDED == null) { epaper_media_MediaView.EXPANDED = new epaper_media__$MediaView_ExpandedView(); window.document.querySelector(".epaper-root").appendChild(epaper_media_MediaView.EXPANDED.element); } return epaper_media_MediaView.EXPANDED; }; epaper_media_MediaView.embedded = function(content) { var ret = new epaper_media_MediaView("embedded"); ret.setContent(content.get()); return ret.element; }; epaper_media_MediaView.renderContainer = function(mode) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
    \r\n \r\n \r\n
    \r\n "; ret.s += this5; var _g3 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g3.setReserved("lv","Notiek ielāde..."); } else { _g3.h["lv"] = "Notiek ielāde..."; } if(__map_reserved["tr"] != null) { _g3.setReserved("tr","Yükleniyor ..."); } else { _g3.h["tr"] = "Yükleniyor ..."; } if(__map_reserved["en"] != null) { _g3.setReserved("en","Loading ..."); } else { _g3.h["en"] = "Loading ..."; } if(__map_reserved["pl"] != null) { _g3.setReserved("pl","Wczytywanie ..."); } else { _g3.h["pl"] = "Wczytywanie ..."; } if(__map_reserved["fi"] != null) { _g3.setReserved("fi","Lataa ..."); } else { _g3.h["fi"] = "Lataa ..."; } if(__map_reserved["zh_Hans"] != null) { _g3.setReserved("zh_Hans","加载……"); } else { _g3.h["zh_Hans"] = "加载……"; } if(__map_reserved["ro"] != null) { _g3.setReserved("ro","Încarcă ..."); } else { _g3.h["ro"] = "Încarcă ..."; } if(__map_reserved["sk"] != null) { _g3.setReserved("sk","Načítava sa..."); } else { _g3.h["sk"] = "Načítava sa..."; } if(__map_reserved["ko"] != null) { _g3.setReserved("ko","로딩중..."); } else { _g3.h["ko"] = "로딩중..."; } if(__map_reserved["it"] != null) { _g3.setReserved("it","Caricamento in corso ..."); } else { _g3.h["it"] = "Caricamento in corso ..."; } if(__map_reserved["sq"] != null) { _g3.setReserved("sq","Duke u ngarkuar …"); } else { _g3.h["sq"] = "Duke u ngarkuar …"; } if(__map_reserved["ru"] != null) { _g3.setReserved("ru","Идет загрузка ..."); } else { _g3.h["ru"] = "Идет загрузка ..."; } if(__map_reserved["pt"] != null) { _g3.setReserved("pt","Carregando ..."); } else { _g3.h["pt"] = "Carregando ..."; } if(__map_reserved["da"] != null) { _g3.setReserved("da","Indlæser ..."); } else { _g3.h["da"] = "Indlæser ..."; } if(__map_reserved["el"] != null) { _g3.setReserved("el","Φορτώνει ..."); } else { _g3.h["el"] = "Φορτώνει ..."; } if(__map_reserved["nl"] != null) { _g3.setReserved("nl","Bezig met downloaden ..."); } else { _g3.h["nl"] = "Bezig met downloaden ..."; } if(__map_reserved["bg"] != null) { _g3.setReserved("bg","Зарежда ..."); } else { _g3.h["bg"] = "Зарежда ..."; } if(__map_reserved["fr"] != null) { _g3.setReserved("fr","Charge ..."); } else { _g3.h["fr"] = "Charge ..."; } if(__map_reserved["sr"] != null) { _g3.setReserved("sr","Преузимање ..."); } else { _g3.h["sr"] = "Преузимање ..."; } if(__map_reserved["hr"] != null) { _g3.setReserved("hr","Učitava se ..."); } else { _g3.h["hr"] = "Učitava se ..."; } if(__map_reserved["es"] != null) { _g3.setReserved("es","Cargando ..."); } else { _g3.h["es"] = "Cargando ..."; } if(__map_reserved["de"] != null) { _g3.setReserved("de","Lädt ..."); } else { _g3.h["de"] = "Lädt ..."; } if(__map_reserved["hu"] != null) { _g3.setReserved("hu","Töltés folyamatban ..."); } else { _g3.h["hu"] = "Töltés folyamatban ..."; } if(__map_reserved["sv"] != null) { _g3.setReserved("sv","Läser in..."); } else { _g3.h["sv"] = "Läser in..."; } if(__map_reserved["cs"] != null) { _g3.setReserved("cs","Načítám ..."); } else { _g3.h["cs"] = "Načítám ..."; } if(__map_reserved["ja"] != null) { _g3.setReserved("ja","読み込んでいます..."); } else { _g3.h["ja"] = "読み込んでいます..."; } if(__map_reserved["nb_NO"] != null) { _g3.setReserved("nb_NO","Laster…"); } else { _g3.h["nb_NO"] = "Laster…"; } var b4 = new epaper_i18n_Localizable("MEDIA_LOADING",_g3).toHTML(); ret.s += b4; var this6 = "\r\n
    \r\n\r\n
    \r\n"; ret.s += this6; var this7 = ret.s; return this7; }; epaper_media_MediaView.description = function(item) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n "; ret.s += this1; if(item[1] == 2) { var desc = item[3]; var this2 = "\r\n "; ret.s += this2; if(desc.length > 0) { var this3 = "data-description=\""; ret.s += this3; var b = tink_template__$Html_Html_$Impl_$.escape(desc); ret.s += b; var this4 = "\" "; ret.s += this4; } } else { var this5 = "\r\n "; ret.s += this5; } var this6 = "\r\n"; ret.s += this6; var this7 = ret.s; return this7; }; epaper_media_MediaView.imageDescriptionAttributes = function(item) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n "; ret.s += this1; if(item[1] == 2) { var desc = item[3]; var this2 = "\r\n "; ret.s += this2; if(desc.length > 0) { var this3 = "alt=\""; ret.s += this3; var b = tink_template__$Html_Html_$Impl_$.escape(desc); ret.s += b; var this4 = "\""; ret.s += this4; } } else { var this5 = "\r\n "; ret.s += this5; } var this6 = "\r\n"; ret.s += this6; var this7 = ret.s; return this7; }; epaper_media_MediaView.renderItem = function(item,pos) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n\r\n
  • \r\n "; ret.s += this3; switch(item[1]) { case 0: var style = item[3]; var url = item[2]; var this4 = "\r\n \r\n "; ret.s += this6; break; case 1: var style1 = item[3]; var url1 = item[2]; var this7 = "\r\n
    \r\n \r\n
    \r\n "; ret.s += this9; break; case 2: var url2 = item[2]; var this10 = "\r\n
    \r\n \r\n "; ret.s += this14; ret.s += markup; var this15 = "\r\n
    \r\n "; ret.s += this15; break; } var this16 = "\r\n
  • \r\n"; ret.s += this16; var this17 = ret.s; return this17; }; epaper_media_MediaView.prototype = { prev: function() { if(this.pos > 0) { this.pos--; this.update(); } } ,next: function() { if(this.pos < this.views.length - 1) { this.pos++; this.update(); } } ,setContent: function(content) { this.container.innerHTML = ""; var __tmp = []; var iterator_item = HxOverrides.iter(content); var iterator_pos_step; var iterator_pos_offset; var iterator_pos_max; var iterator_pos_cur; iterator_pos_step = 1; iterator_pos_offset = 0; iterator_pos_cur = 0; iterator_pos_max = 100000; while(iterator_pos_cur < iterator_pos_max && iterator_item.hasNext()) { var item = iterator_item.next(); var pos = iterator_pos_offset + iterator_pos_cur++ * iterator_pos_step; __tmp.push(epaper_media_MediaView.renderItem(item,pos)); } this.views = __tmp; this.pos = 0; this.update(); var _this = this.container.classList; var force = content.length == 1; if(force == null) { force = !_this.contains("single-item"); } if(force) { _this.add("single-item"); } else { _this.remove("single-item"); } } ,update: function() { var _gthis = this; this.container.innerHTML = ""; var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { var prev = _gthis.element.querySelector(".prev"); if(prev != null) { if(_gthis.pos == 0) { prev.classList.add("nodisplay"); } else { prev.classList.remove("nodisplay"); } } var next = _gthis.element.querySelector(".next"); if(next != null) { if(_gthis.pos == _gthis.views.length - 1) { next.classList.add("nodisplay"); } else { next.classList.remove("nodisplay"); } } _gthis.container.innerHTML = _gthis.views[_gthis.pos]; },100),$bind($_,$_.stop))); } ,__class__: epaper_media_MediaView }; var epaper_media__$MediaView_ExpandedView = function() { epaper_media_MediaView.call(this,"expanded"); var this1 = new tink_state__$State_StateObject(false,null); this._isOpen = this1; this.isOpen = this._isOpen; Dom.on(this.element.querySelector(".close"),"click",tink_core__$Callback_Callback_$Impl_$.fromNiladic($bind(this,this.close))); this.close(); }; epaper_media__$MediaView_ExpandedView.__name__ = ["epaper","media","_MediaView","ExpandedView"]; epaper_media__$MediaView_ExpandedView.__super__ = epaper_media_MediaView; epaper_media__$MediaView_ExpandedView.prototype = $extend(epaper_media_MediaView.prototype,{ close: function() { this.element.classList.add("nodisplay"); this.container.innerHTML = ""; this._isOpen.set(false); } ,setContent: function(content) { epaper_media_MediaView.prototype.setContent.call(this,content); this.element.classList.remove("nodisplay"); this._isOpen.set(true); } ,__class__: epaper_media__$MediaView_ExpandedView }); var epaper_media_MediaViewItem = { __ename__ : true, __constructs__ : ["Video","IFrame","Image","HTMLContent"] }; epaper_media_MediaViewItem.Video = function(url,dataStyle) { var $x = ["Video",0,url,dataStyle]; $x.__enum__ = epaper_media_MediaViewItem; $x.toString = $estr; return $x; }; epaper_media_MediaViewItem.IFrame = function(url,dataStyle) { var $x = ["IFrame",1,url,dataStyle]; $x.__enum__ = epaper_media_MediaViewItem; $x.toString = $estr; return $x; }; epaper_media_MediaViewItem.Image = function(url,caption) { var $x = ["Image",2,url,caption]; $x.__enum__ = epaper_media_MediaViewItem; $x.toString = $estr; return $x; }; epaper_media_MediaViewItem.HTMLContent = function(html,dataStyle) { var $x = ["HTMLContent",3,html,dataStyle]; $x.__enum__ = epaper_media_MediaViewItem; $x.toString = $estr; return $x; }; var epaper_navbar_NavBar = function(book,target) { this._possibleTargetPage = 0; this.draging = false; var _gthis = this; this._possibleTargetPageUpdated = new tink_core_SignalTrigger(); this.book = book; this.target = target; this.possibleTargetPageUpdated = this._possibleTargetPageUpdated; var get = function() { return _gthis._possibleTargetPage; }; var changed = tink_core__$Signal_Signal_$Impl_$.noise(this.get_possibleTargetPageUpdated()); var this1 = tink_state__$Observable_Observable_$Impl_$.create(function() { var this2; var this3 = new tink_core_MPair(get(),tink_core__$Signal_Signal_$Impl_$.nextTime(changed,null)); this2 = this3; return this2; }); this.possibleTargetPage = this1; var calcPossibleTargetPage = function(val) { var doublePage = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_pageMode()) == epaper_flipbook_PageMode.Double; var evenNumPages = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).max % 2 == 0; var minPage = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).min; var maxPage = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).max; var segments = maxPage - js_Boot.__cast(!doublePage || !evenNumPages ? 1 : 0 , Int); var targetPage; if(doublePage) { targetPage = Math.ceil(val * segments); } else { targetPage = Math.round(val * segments) + 1; } if(targetPage < minPage) { targetPage = minPage; } if(targetPage > maxPage) { targetPage = maxPage; } var possiblePage = book.getPages(targetPage)[0].get_index(); return possiblePage; }; tink_state__$Observable_Observable_$Impl_$.bind(book.get_position(),null,function(pos) { if(_gthis.draging) { return; } _gthis._possibleTargetPage = pos.cur; tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._possibleTargetPageUpdated.handlers,tink_core_Noise.Noise); }); target.insertBefore(Dom.getElement(this.renderNavbar()),target.firstChild); this.barElt = target.querySelector(".nav-bar"); var pos1 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()); var s = new slider_Slider(this.barElt,null,null,null,null,tink_state__$Observable_Observable_$Impl_$.map(this.get_possibleTargetPage(),tink_state__$Observable_Transform_$Impl_$.plain(function(page) { var doublePage1 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_pageMode()) == epaper_flipbook_PageMode.Double; var evenNumPages1 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).max % 2 == 0; var minPage1 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).min; var maxPage1 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).max; var segments1 = maxPage1 - js_Boot.__cast(!doublePage1 || !evenNumPages1 ? 1 : 0 , Int); var ratio = (page - minPage1) / segments1; return ratio; })),function(value) { _gthis._possibleTargetPage = calcPossibleTargetPage(value); tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._possibleTargetPageUpdated.handlers,tink_core_Noise.Noise); }); var goToTargetPage = function(e,page1) { e.preventDefault(); book.flipTo(epaper_flipbook_FlipDestination.Page(page1)); _gthis.draging = false; }; Dom.on(this.barElt,"touchstart",function(ev) { _gthis.draging = true; Dom.once(window.document,"touchend",function(e1) { goToTargetPage(e1,_gthis._possibleTargetPage); }); ev.preventDefault(); }); Dom.on(this.barElt,"mousedown",function(ev1) { _gthis.draging = true; Dom.once(window.document,"mouseup",function(e2) { goToTargetPage(e2,_gthis._possibleTargetPage); }); ev1.preventDefault(); }); var track = this.barElt.querySelector(".track"); var preview = Dom.tag("div.preview"); this.barElt.appendChild(preview); var setupInput = function(event,getPos) { Dom.on(s.target,event,function(e3) { var doublePage2 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_pageMode()) == epaper_flipbook_PageMode.Double; var evenNumPages2 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).max % 2 == 0; var minPage2 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).min; var maxPage2 = tink_state__$Observable_Observable_$Impl_$.get_value(book.get_position()).max; var segments2 = maxPage2 - js_Boot.__cast(!doublePage2 || !evenNumPages2 ? 1 : 0 , Int); var rect = track.getBoundingClientRect(); var ratio1 = (getPos(e3) - rect.left) / (rect.right - rect.left); var thumbTarget; if(doublePage2) { thumbTarget = Math.ceil(ratio1 * segments2); } else { thumbTarget = Math.round(ratio1 * segments2) + 1; } if(thumbTarget < minPage2) { thumbTarget = minPage2; } if(thumbTarget > maxPage2) { thumbTarget = maxPage2; } preview.innerHTML = ""; var _g = 0; var _g1 = book.getPages(thumbTarget); while(_g < _g1.length) { var p = _g1[_g]; ++_g; try { var setupInput1 = p.makeThumb(); preview.appendChild(setupInput1); } catch( e4 ) { } } var setupInput2 = getPos(e3) - rect.left; preview.style.left = setupInput2 + "px"; }); }; setupInput("mousemove",function(e5) { return e5.clientX; }); setupInput("touchmove",function(e6) { return e6.touches[0].clientX; }); setupInput("touchstart",function(e7) { return e7.touches[0].clientX; }); }; epaper_navbar_NavBar.__name__ = ["epaper","navbar","NavBar"]; epaper_navbar_NavBar.prototype = { renderNavbar: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n \n"; ret.s += this1; var this2 = ret.s; return this2; } ,get_possibleTargetPageUpdated: function() { return this.possibleTargetPageUpdated; } ,get_possibleTargetPage: function() { return this.possibleTargetPage; } ,__class__: epaper_navbar_NavBar }; var epaper_search_Highlighting = function(page) { this.textPositions = new tink_json_Parser1().parse(page.get_textPositions()); this.svg = page.getSearchHighlightingLayer(); this.initPageDimension(); this.initSvgDimension(); }; epaper_search_Highlighting.__name__ = ["epaper","search","Highlighting"]; epaper_search_Highlighting.prototype = { initPageDimension: function() { var points = this.getCoordsFromString(this.textPositions.page.bbox); var o_width; var o_height; o_width = points.x2; o_height = points.y2; var this1; var this2 = new tink_core_MPair(o_width,o_height); this1 = this2; this.pageDimension = this1; } ,initSvgDimension: function() { var o_width; var o_height; if(this.svg.clientWidth > 0) { o_width = this.svg.clientWidth; } else { o_width = this.svg.parentNode.clientWidth; } if(this.svg.clientHeight > 0) { o_height = this.svg.clientHeight; } else { o_height = this.svg.parentNode.clientHeight; } var this1; var this2 = new tink_core_MPair(o_width,o_height); this1 = this2; this.svgDimension = this1; } ,getCoordsFromString: function(coords) { var points = coords.split(","); var textCoords = { x1 : points[0], y1 : points[1], x2 : points[2], y2 : points[3]}; return textCoords; } ,highlightSearchWord: function(searchWord) { this.clearSvg(); if(searchWord.length < 2) { return false; } var query = epaper_search__$Query_Query_$Impl_$._new(searchWord,true); var words = epaper_search__$Query_Query_$Impl_$.words(query); var searchRects = []; var _g = 0; while(_g < words.length) { var word = words[_g]; ++_g; var _g1 = 0; var _g2 = this.findCoordsByString(word); while(_g1 < _g2.length) { var points = _g2[_g1]; ++_g1; var searchRect = { x : points.x1, y : points.y1, width : points.x2 - points.x1, height : points.y2 - points.y1}; searchRects.push(searchRect); } } var _g3 = 0; while(_g3 < searchRects.length) { var searchRect1 = searchRects[_g3]; ++_g3; this.drawRectangle(searchRect1); } return true; } ,findCoordsByString: function(searchWord) { var coords = []; var stringLength = searchWord.length; var _g = 0; var _g1 = this.textPositions.page.textbox; while(_g < _g1.length) { var textbox = _g1[_g]; ++_g; var _g2 = 0; var _g3 = textbox.textline; while(_g2 < _g3.length) { var textline = _g3[_g2]; ++_g2; var i = 0; var _g4 = 0; var _g5 = textline.text; while(_g4 < _g5.length) { var text = _g5[_g4]; ++_g4; var lastIndex = i + (stringLength - 1); if(text.character.toLowerCase() == searchWord.substring(0,1).toLowerCase() && (lastIndex < textline.text.length && textline.text[lastIndex] != null && textline.text[lastIndex].character.toLowerCase() == searchWord.substring(stringLength - 1,stringLength).toLowerCase())) { var x = 1; var matchError = false; while(x < stringLength && matchError == false) { if(textline.text[i + x].character != " " && searchWord.substring(x,x + 1) != " " && searchWord.substring(x,x + 1).toLowerCase() != textline.text[i + x].character.toLowerCase()) { matchError = true; } ++x; } if(!matchError) { var pointsStart = this.transformTextCoords(this.getCoordsFromString(text.bbox)); var pointsEnd = this.transformTextCoords(this.getCoordsFromString(textline.text[lastIndex].bbox)); var searchWordCoords = { x1 : pointsStart.x1, y1 : pointsStart.y1, x2 : pointsEnd.x2, y2 : pointsEnd.y2}; coords.push(searchWordCoords); } } ++i; } } } return coords; } ,transformTextCoords: function(points) { var textCoords = { x1 : this.ptToPx(points.x1) * this.svgDimension.a / this.ptToPx(this.pageDimension.a), y1 : this.ptToPx(this.pageDimension.b - points.y2) * this.svgDimension.b / this.ptToPx(this.pageDimension.b), x2 : this.ptToPx(points.x2) * this.svgDimension.a / this.ptToPx(this.pageDimension.a), y2 : this.ptToPx(this.pageDimension.b - points.y1) * this.svgDimension.b / this.ptToPx(this.pageDimension.b)}; return textCoords; } ,ptToPx: function(val) { return val * 96 / 72; } ,clearSvg: function() { this.svg.textContent = ""; } ,drawRectangle: function(searchRect) { var x = searchRect.x; var y = searchRect.y; var width = searchRect.width; var height = searchRect.height; var rect = window.document.createElementNS("http://www.w3.org/2000/svg","rect"); rect.setAttributeNS(null,"x",x); rect.setAttributeNS(null,"y",y); rect.setAttributeNS(null,"width",width); rect.setAttributeNS(null,"height",height); rect.setAttributeNS(null,"stroke","#ea2e2c"); rect.setAttributeNS(null,"fill","#e9b1b0"); rect.setAttributeNS(null,"stroke-width","1"); this.svg.appendChild(rect); } ,__class__: epaper_search_Highlighting }; var tink_core__$Future_FutureObject = function() { }; tink_core__$Future_FutureObject.__name__ = ["tink","core","_Future","FutureObject"]; tink_core__$Future_FutureObject.prototype = { __class__: tink_core__$Future_FutureObject }; var tink_core__$Future_SimpleFuture = function(f) { this.f = f; }; tink_core__$Future_SimpleFuture.__name__ = ["tink","core","_Future","SimpleFuture"]; tink_core__$Future_SimpleFuture.__interfaces__ = [tink_core__$Future_FutureObject]; tink_core__$Future_SimpleFuture.prototype = { handle: function(callback) { return this.f(callback); } ,map: function(f) { var _gthis = this; return new tink_core__$Future_SimpleFuture(function(cb) { return _gthis.f(function(v) { var tmp = f(v); tink_core__$Callback_Callback_$Impl_$.invoke(cb,tmp); }); }); } ,flatMap: function(f) { var f1 = f; var _gthis = this; return tink_core__$Future_Future_$Impl_$.flatten(new tink_core__$Future_SimpleFuture(function(cb) { return _gthis.f(function(v) { var tmp = f1(v); tink_core__$Callback_Callback_$Impl_$.invoke(cb,tmp); }); })); } ,gather: function() { return tink_core_FutureTrigger.gatherFuture(this); } ,__class__: tink_core__$Future_SimpleFuture }; var epaper_search_Index = function(texts,labels) { this.cache = new haxe_ds_StringMap(); this.texts = texts; this.labels = labels; }; epaper_search_Index.__name__ = ["epaper","search","Index"]; epaper_search_Index.forBook = function(book) { var __tmp = []; var _g = 0; var _g1 = book.allPages().slice(1); while(_g < _g1.length) { var p = _g1[_g]; ++_g; __tmp.push(p.get_textContent()); } var tmp = __tmp; var __tmp1 = new haxe_ds_StringMap(); var _g2 = 0; var _g11 = book.allPages().slice(1); while(_g2 < _g11.length) { var p1 = _g11[_g2]; ++_g2; var key = p1.get_label(); var value = p1.get_index(); if(__map_reserved[key] != null) { __tmp1.setReserved(key,value); } else { __tmp1.h[key] = value; } } return new epaper_search_Index(tmp,__tmp1); }; epaper_search_Index.prototype = { getResults: function(query,rawInput) { var ret = []; var words = epaper_search__$Query_Query_$Impl_$.words(query); var iterator_text = HxOverrides.iter(this.texts); var iterator_page_step; var iterator_page_offset; var iterator_page_max; var iterator_page_cur; iterator_page_step = 1; iterator_page_offset = 0; iterator_page_cur = 0; iterator_page_max = Math.ceil(this.texts.length / 1); while(iterator_page_cur < iterator_page_max && iterator_text.hasNext()) { var text = iterator_text.next(); var page = iterator_page_offset + iterator_page_cur++ * iterator_page_step; var __tmp = []; var _g = 0; while(_g < words.length) { var w = words[_g]; ++_g; __tmp.push(text.toLowerCase().indexOf(w.toLowerCase())); } var first = __tmp; if(Lambda.has(first,-1)) { continue; } var __tmp1 = []; var iterator_w = HxOverrides.iter(words); var iterator_i = HxOverrides.iter(first); while(iterator_i.hasNext() && iterator_w.hasNext()) { var w1 = iterator_w.next(); var i = iterator_i.next(); var positions = []; while(i != -1) { positions.push(i); i = text.toLowerCase().indexOf(w1.toLowerCase(),i + 1); } __tmp1.push({ word : w1, positions : positions}); } ret.push({ page : page, text : text, hits : __tmp1}); } var exact = []; return exact.concat(ret); } ,renderResult: function(s) { var min = s.text.length; var _g = 0; var _g1 = s.hits; while(_g < _g1.length) { var h = _g1[_g]; ++_g; if(h.positions[0] < min) { min = h.positions[0]; } } min -= 20; if(min < 0) { min = 0; } var ret_b = ""; if(min > 0) { ret_b += "... "; } var __tmp = []; var _g2 = 0; while(_g2 < 50) { var i = _g2++; __tmp.push(false); } var bold = __tmp; var _g3 = 0; var _g11 = s.hits; while(_g3 < _g11.length) { var h1 = _g11[_g3]; ++_g3; var _g21 = 0; var _g31 = h1.positions; while(_g21 < _g31.length) { var p = _g31[_g21]; ++_g21; if(p >= min + bold.length) { break; } var _g5 = p; var _g4 = p + h1.word.length; while(_g5 < _g4) { var i1 = _g5++; var pos = i1 - min; if(pos > bold.length) { break; } bold[pos] = true; } } } var last = false; var iterator_b = HxOverrides.iter(bold); var iterator_i_step; var iterator_i_offset; var iterator_i_max; var iterator_i_cur; iterator_i_step = 1; iterator_i_offset = min; iterator_i_cur = 0; iterator_i_max = Math.ceil((100000 - min) / 1); while(iterator_i_cur < iterator_i_max && iterator_b.hasNext()) { var b = iterator_b.next(); var i2 = iterator_i_offset + iterator_i_cur++ * iterator_i_step; if(last != b) { var x; last = b; if(last) { x = ""; } else { x = ""; } ret_b += Std.string(x); } ret_b += Std.string(s.text.charAt(i2)); } if(last) { ret_b += ""; } var this1 = ret_b += " ..."; return this1; } ,getQuickJump: function(input) { var _g = this.labels.get(input); if(_g == null) { return haxe_ds_Option.None; } else { var v = _g; return haxe_ds_Option.Some(v); } } ,search: function(input) { var _gthis = this; var search = function(exact) { var query = epaper_search__$Query_Query_$Impl_$._new(input,!exact); if(query == null) { return []; } else { var _g = _gthis.cache.get(query); if(_g == null) { var this1 = _gthis.cache; var __tmp = []; var _g1 = 0; var _g11 = _gthis.getResults(query,input); while(_g1 < _g11.length) { var result = _g11[_g1]; ++_g1; var this2 = new tink_core_MPair(result.page,_gthis.renderResult(result)); __tmp.push(this2); } var v = __tmp; this1.set(query,v); return v; } else { var v1 = _g; return v1; } } }; var exact1 = search(true); var __tmp1 = new haxe_ds_IntMap(); var _g2 = 0; while(_g2 < exact1.length) { var res = exact1[_g2]; ++_g2; __tmp1.h[res.a] = true; } var hasExact = __tmp1; var loose = search(false).filter(function(res1) { return !hasExact.h[res1.a]; }); var _g3 = exact1.concat(loose); if(_g3.length == 0) { return haxe_ds_Option.None; } else { var v2 = _g3; return haxe_ds_Option.Some(v2); } } ,__class__: epaper_search_Index }; var epaper_search__$Query_Query_$Impl_$ = {}; epaper_search__$Query_Query_$Impl_$.__name__ = ["epaper","search","_Query","Query_Impl_"]; epaper_search__$Query_Query_$Impl_$._new = function(raw,normalize) { var this1; if(normalize) { var words = []; var _g = 0; var _g1 = raw.split(" "); while(_g < _g1.length) { var s = _g1[_g]; ++_g; var _g2 = StringTools.trim(s).toLowerCase(); var $short = _g2; if($short.length >= 2) { var v = _g2; words.push(v); } } words.sort(function(a,b) { var _g3 = b.length - a.length; if(_g3 == 0) { return Reflect.compare(a,b); } else { var v1 = _g3; return v1; } }); this1 = "n" + words.join(" "); } else { this1 = "r" + StringTools.trim(raw); } if(this1.length < 3) { this1 = null; } return this1; }; epaper_search__$Query_Query_$Impl_$.words = function(this1) { if(this1 == null) { return []; } else if(this1.charAt(0) == "n") { return HxOverrides.substr(this1,1,null).split(" "); } else { return [HxOverrides.substr(this1,1,null)]; } }; var epaper_search_Search = function(book) { var _gthis = this; this.lazy_index = new tink_core__$Lazy_LazyFunc(function() { return epaper_search_Index.forBook(book); }); this.lazy_state = new tink_core__$Lazy_LazyFunc(function() { var get = $bind(_gthis,_gthis.updateSearch); var changed = Dom.gets(_gthis.input,"keyup"); var this1 = tink_state__$Observable_Observable_$Impl_$.create(function() { var this2; var this3 = new tink_core_MPair(get(),tink_core__$Signal_Signal_$Impl_$.nextTime(changed,null)); this2 = this3; return this2; }); return this1; }); this.book = book; }; epaper_search_Search.__name__ = ["epaper","search","Search"]; epaper_search_Search.searchPanelResult = function(pageId,pageTitle,pageThumb,result) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "
  • \n \n \n

    "; ret.s += this4; var _g = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g.setReserved("lv","Lapa"); } else { _g.h["lv"] = "Lapa"; } if(__map_reserved["tr"] != null) { _g.setReserved("tr","Sayfa"); } else { _g.h["tr"] = "Sayfa"; } if(__map_reserved["en"] != null) { _g.setReserved("en","Page"); } else { _g.h["en"] = "Page"; } if(__map_reserved["pl"] != null) { _g.setReserved("pl","Strona"); } else { _g.h["pl"] = "Strona"; } if(__map_reserved["fi"] != null) { _g.setReserved("fi","Sivu"); } else { _g.h["fi"] = "Sivu"; } if(__map_reserved["zh_Hans"] != null) { _g.setReserved("zh_Hans","页"); } else { _g.h["zh_Hans"] = "页"; } if(__map_reserved["ro"] != null) { _g.setReserved("ro","Pagină"); } else { _g.h["ro"] = "Pagină"; } if(__map_reserved["sk"] != null) { _g.setReserved("sk","Strana"); } else { _g.h["sk"] = "Strana"; } if(__map_reserved["ko"] != null) { _g.setReserved("ko","페이지"); } else { _g.h["ko"] = "페이지"; } if(__map_reserved["it"] != null) { _g.setReserved("it","Pagina"); } else { _g.h["it"] = "Pagina"; } if(__map_reserved["sq"] != null) { _g.setReserved("sq","Faqe"); } else { _g.h["sq"] = "Faqe"; } if(__map_reserved["ru"] != null) { _g.setReserved("ru","Страница"); } else { _g.h["ru"] = "Страница"; } if(__map_reserved["pt"] != null) { _g.setReserved("pt","Página"); } else { _g.h["pt"] = "Página"; } if(__map_reserved["da"] != null) { _g.setReserved("da","Side"); } else { _g.h["da"] = "Side"; } if(__map_reserved["el"] != null) { _g.setReserved("el","Σελίδα"); } else { _g.h["el"] = "Σελίδα"; } if(__map_reserved["nl"] != null) { _g.setReserved("nl","Pagina"); } else { _g.h["nl"] = "Pagina"; } if(__map_reserved["bg"] != null) { _g.setReserved("bg","Страница"); } else { _g.h["bg"] = "Страница"; } if(__map_reserved["fr"] != null) { _g.setReserved("fr","Page"); } else { _g.h["fr"] = "Page"; } if(__map_reserved["sr"] != null) { _g.setReserved("sr","Страна"); } else { _g.h["sr"] = "Страна"; } if(__map_reserved["hr"] != null) { _g.setReserved("hr","Stranica"); } else { _g.h["hr"] = "Stranica"; } if(__map_reserved["es"] != null) { _g.setReserved("es","Página"); } else { _g.h["es"] = "Página"; } if(__map_reserved["de"] != null) { _g.setReserved("de","Seite"); } else { _g.h["de"] = "Seite"; } if(__map_reserved["hu"] != null) { _g.setReserved("hu","Oldal"); } else { _g.h["hu"] = "Oldal"; } if(__map_reserved["sv"] != null) { _g.setReserved("sv","Sida"); } else { _g.h["sv"] = "Sida"; } if(__map_reserved["cs"] != null) { _g.setReserved("cs","Stránka"); } else { _g.h["cs"] = "Stránka"; } if(__map_reserved["ja"] != null) { _g.setReserved("ja","ページ"); } else { _g.h["ja"] = "ページ"; } if(__map_reserved["nb_NO"] != null) { _g.setReserved("nb_NO","Side"); } else { _g.h["nb_NO"] = "Side"; } var b3 = new epaper_i18n_Localizable("SEARCH_PAGE",_g).toHTML(); ret.s += b3; var this5 = " "; ret.s += this5; var b4 = tink_template__$Html_Html_$Impl_$.escape(pageTitle); ret.s += b4; var this6 = "

    \n

    "; ret.s += this6; ret.s += result; var this7 = "

    \n
    \n
  • "; ret.s += this7; var this8 = ret.s; return this8; }; epaper_search_Search.prototype = { renderTo: function(elt) { this.target = elt; this.target.appendChild(Dom.getElement(this.menuItem())); this.init(); } ,init: function() { var _gthis = this; this.searchMenuItem = this.target.querySelector("li.search"); this.searchRoot = this.target.querySelector(".search>.popout"); this.closeBtn = this.searchRoot.querySelector(".close-btn"); this.results = _$Dom_QueryResult_$Impl_$.query(this.searchRoot,".results")[0]; this.foundresultsTxt = _$Dom_QueryResult_$Impl_$.query(this.searchRoot,".found-results")[0]; this.noresultsTxt = _$Dom_QueryResult_$Impl_$.query(this.searchRoot,".no-results")[0]; this.jumpTxt = _$Dom_QueryResult_$Impl_$.query(this.searchRoot,".jump")[0]; this.form = _$Dom_QueryResult_$Impl_$.query(this.searchRoot,"form")[0]; this.input = _$Dom_QueryResult_$Impl_$.query(this.form,"input[name=\"search-query\"]")[0]; this.quickJump = _$Dom_QueryResult_$Impl_$.query(this.form,"button[type=\"submit\"]")[0]; _$Dom_QueryResult_$Impl_$.on("a[href^=\"#\"]","click",this.searchMenuItem,function(on) { if(Dom.query(".epaper-root")[0].getAttribute("data-input") == "touch") { _gthis.blurInput(); _gthis.searchMenuItem.removeAttribute("data-pinned"); } }); var observer = new MutationObserver(function(changes,obs) { var _g = 0; while(_g < changes.length) { var i = changes[_g]; ++_g; var _g1 = i.attributeName; if(_g1 == "data-pinned") { var isPinned = _gthis.searchMenuItem.hasAttribute("data-pinned"); var isActive = _gthis.searchMenuItem.hasAttribute("data-search-active"); if(isPinned && !isActive) { _gthis.focusInput(); } if(!isPinned) { _gthis.blurInput(); } } } }); observer.observe(this.searchMenuItem,{ attributes : true}); this.closeBtn.onclick = function() { _gthis.blurInput(); }; this.form.onreset = function() { _gthis.closeBtn.click(); var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { var evt = window.document.createEvent("KeyboardEvent"); evt.initEvent("keyup",true,true); _gthis.input.dispatchEvent(evt); },50),$bind($_,$_.stop))); }; Dom.on(this.form,"submit",function(e) { _gthis.blurInput(); if(_gthis.quickJump.classList.contains("active")) { _gthis.book.flipTo(epaper_flipbook_FlipDestination.Page(Std.parseInt(_gthis.quickJump.getAttribute("data-page")))); } e.preventDefault(); return false; }); var rxIE = new EReg("Trident/7\\.",""); var isIE = rxIE.match(window.navigator.userAgent); var popOut = this.searchMenuItem.querySelector(".popout"); var title = this.searchMenuItem.querySelector(".popout-title"); var resultTxt = this.searchMenuItem.querySelector(".result-text"); var inputForm = this.searchMenuItem.querySelector(".query-input"); var scrollContainer = this.searchMenuItem.querySelector(".popout-scrollcontainer"); var correctIEScrollContainerHeight = function() { if(popOut.getBoundingClientRect().height < 10) { return; } var correctIEScrollContainerHeight1 = Std.parseInt(window.getComputedStyle(popOut).maxHeight) - title.getBoundingClientRect().height - resultTxt.getBoundingClientRect().height - inputForm.getBoundingClientRect().height - 20; scrollContainer.style.maxHeight = correctIEScrollContainerHeight1 + "px"; }; if(isIE) { popOut.style.maxWidth = "300px"; window.addEventListener("resize",correctIEScrollContainerHeight); } tink_state__$Observable_Observable_$Impl_$.bind(this.get_state(),null,function(hits) { switch(hits[1]) { case 0: var v = hits[2]; _gthis.searchMenuItem.setAttribute("data-search-active",""); _gthis.updateTxtToInput(); if(v.length > 0) { var __tmp = []; var iterator___tink_tmp34 = HxOverrides.iter(v); while(iterator___tink_tmp34.hasNext()) { var __tink_tmp34 = iterator___tink_tmp34.next(); var html = __tink_tmp34.b; var id = __tink_tmp34.a; var page = _gthis.book.page(id + 1); __tmp.push(epaper_search_Search.searchPanelResult(page.get_index(),page.get_label(),page.get_thumb(),html)); } _gthis.results.innerHTML = __tmp.join(""); var _this = _gthis.results.classList; var force = false; if(force == null) { force = !_this.contains("nodisplay"); } if(force) { _this.add("nodisplay"); } else { _this.remove("nodisplay"); } var _this1 = _gthis.foundresultsTxt.classList; var force1 = false; if(force1 == null) { force1 = !_this1.contains("nodisplay"); } if(force1) { _this1.add("nodisplay"); } else { _this1.remove("nodisplay"); } var _this2 = _gthis.noresultsTxt.classList; var force2 = true; if(force2 == null) { force2 = !_this2.contains("nodisplay"); } if(force2) { _this2.add("nodisplay"); } else { _this2.remove("nodisplay"); } } else { var _this3 = _gthis.results.classList; var force3 = true; if(force3 == null) { force3 = !_this3.contains("nodisplay"); } if(force3) { _this3.add("nodisplay"); } else { _this3.remove("nodisplay"); } var _this4 = _gthis.foundresultsTxt.classList; var force4 = true; if(force4 == null) { force4 = !_this4.contains("nodisplay"); } if(force4) { _this4.add("nodisplay"); } else { _this4.remove("nodisplay"); } var _this5 = _gthis.noresultsTxt.classList; var force5 = true; if(force5 == null) { force5 = !_this5.contains("nodisplay"); } if(force5) { _this5.add("nodisplay"); } else { _this5.remove("nodisplay"); } } var tmp = _gthis.book.get_position(); _gthis.updatePageHighlight(tink_state__$Observable_Observable_$Impl_$.get_value(tmp)); break; case 1: if(_gthis.searchMenuItem.hasAttribute("data-search-active")) { _gthis.searchMenuItem.removeAttribute("data-search-active"); } var _this6 = _gthis.results.classList; var force6 = true; if(force6 == null) { force6 = !_this6.contains("nodisplay"); } if(force6) { _this6.add("nodisplay"); } else { _this6.remove("nodisplay"); } var _this7 = _gthis.foundresultsTxt.classList; var force7 = true; if(force7 == null) { force7 = !_this7.contains("nodisplay"); } if(force7) { _this7.add("nodisplay"); } else { _this7.remove("nodisplay"); } if(_gthis.input.value.length >= 2) { var _this8 = _gthis.noresultsTxt.classList; var force8 = false; if(force8 == null) { force8 = !_this8.contains("nodisplay"); } if(force8) { _this8.add("nodisplay"); } else { _this8.remove("nodisplay"); } _gthis.updateTxtToInput(); } else { var _this9 = _gthis.noresultsTxt.classList; var force9 = true; if(force9 == null) { force9 = !_this9.contains("nodisplay"); } if(force9) { _this9.add("nodisplay"); } else { _this9.remove("nodisplay"); } } break; } if(isIE) { correctIEScrollContainerHeight(); } }); tink_state__$Observable_Observable_$Impl_$.bind(this.book.get_position(),null,function(pos) { var _g2 = pos.from; switch(_g2[1]) { case 0: var v1 = _g2[2]; var _g3 = 0; var _g11 = _gthis.book.getPages(v1.origin); while(_g3 < _g11.length) { var page1 = [_g11[_g3]]; ++_g3; var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay((function(page2) { return function() { page2[0].getSearchHighlightingLayer().textContent = ""; }; })(page1),500),$bind($_,$_.stop))); } _gthis.doTextHighlighting(); break; case 1: _gthis.updatePageHighlight(pos); break; } }); } ,updatePageHighlight: function(pos) { var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(this.results,".active-item"); while(_g < _g1.length) { var old = _g1[_g]; ++_g; old.classList.remove("active-item"); } var _g2 = 0; var _g11 = this.book.getPages(pos.cur); while(_g2 < _g11.length) { var page = _g11[_g2]; ++_g2; var result = _$Dom_QueryResult_$Impl_$.query(this.results,"[data-page-id=\"" + page.get_index() + "\"]")[0]; if(result != null) { result.classList.add("active-item"); } } } ,updateTxtToInput: function() { var _gthis = this; var words = this.input.value.split(" "); var filteredWords = Lambda.filter(words,function(word) { return word != ""; }); var wordElements = Lambda.map(filteredWords,function(word1) { return _gthis.wordElement(tink_template__$Html_Html_$Impl_$.escape(word1)); }); var _g = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g.setReserved("lv","UN"); } else { _g.h["lv"] = "UN"; } if(__map_reserved["tr"] != null) { _g.setReserved("tr","VE"); } else { _g.h["tr"] = "VE"; } if(__map_reserved["en"] != null) { _g.setReserved("en","AND"); } else { _g.h["en"] = "AND"; } if(__map_reserved["pl"] != null) { _g.setReserved("pl","I"); } else { _g.h["pl"] = "I"; } if(__map_reserved["fi"] != null) { _g.setReserved("fi","JA"); } else { _g.h["fi"] = "JA"; } if(__map_reserved["zh_Hans"] != null) { _g.setReserved("zh_Hans","AND"); } else { _g.h["zh_Hans"] = "AND"; } if(__map_reserved["ro"] != null) { _g.setReserved("ro","SI"); } else { _g.h["ro"] = "SI"; } if(__map_reserved["sk"] != null) { _g.setReserved("sk","A"); } else { _g.h["sk"] = "A"; } if(__map_reserved["ko"] != null) { _g.setReserved("ko","및"); } else { _g.h["ko"] = "및"; } if(__map_reserved["it"] != null) { _g.setReserved("it","E"); } else { _g.h["it"] = "E"; } if(__map_reserved["sq"] != null) { _g.setReserved("sq","DHE"); } else { _g.h["sq"] = "DHE"; } if(__map_reserved["ru"] != null) { _g.setReserved("ru","И"); } else { _g.h["ru"] = "И"; } if(__map_reserved["pt"] != null) { _g.setReserved("pt","E"); } else { _g.h["pt"] = "E"; } if(__map_reserved["da"] != null) { _g.setReserved("da","OG"); } else { _g.h["da"] = "OG"; } if(__map_reserved["el"] != null) { _g.setReserved("el","ΚΑΙ"); } else { _g.h["el"] = "ΚΑΙ"; } if(__map_reserved["nl"] != null) { _g.setReserved("nl","EN"); } else { _g.h["nl"] = "EN"; } if(__map_reserved["bg"] != null) { _g.setReserved("bg","И"); } else { _g.h["bg"] = "И"; } if(__map_reserved["fr"] != null) { _g.setReserved("fr","ET"); } else { _g.h["fr"] = "ET"; } if(__map_reserved["sr"] != null) { _g.setReserved("sr","И"); } else { _g.h["sr"] = "И"; } if(__map_reserved["hr"] != null) { _g.setReserved("hr","I"); } else { _g.h["hr"] = "I"; } if(__map_reserved["es"] != null) { _g.setReserved("es","Y"); } else { _g.h["es"] = "Y"; } if(__map_reserved["de"] != null) { _g.setReserved("de","UND"); } else { _g.h["de"] = "UND"; } if(__map_reserved["hu"] != null) { _g.setReserved("hu","ÉS"); } else { _g.h["hu"] = "ÉS"; } if(__map_reserved["sv"] != null) { _g.setReserved("sv","OCH"); } else { _g.h["sv"] = "OCH"; } if(__map_reserved["cs"] != null) { _g.setReserved("cs","A"); } else { _g.h["cs"] = "A"; } if(__map_reserved["ja"] != null) { _g.setReserved("ja","並びに"); } else { _g.h["ja"] = "並びに"; } if(__map_reserved["nb_NO"] != null) { _g.setReserved("nb_NO","OG"); } else { _g.h["nb_NO"] = "OG"; } var tmp = this.foundResults(wordElements.join(new epaper_i18n_Localizable("SEARCH_AND",_g).toHTML())); this.foundresultsTxt.innerHTML = tmp; var _g1 = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g1.setReserved("lv","UN"); } else { _g1.h["lv"] = "UN"; } if(__map_reserved["tr"] != null) { _g1.setReserved("tr","VE"); } else { _g1.h["tr"] = "VE"; } if(__map_reserved["en"] != null) { _g1.setReserved("en","AND"); } else { _g1.h["en"] = "AND"; } if(__map_reserved["pl"] != null) { _g1.setReserved("pl","I"); } else { _g1.h["pl"] = "I"; } if(__map_reserved["fi"] != null) { _g1.setReserved("fi","JA"); } else { _g1.h["fi"] = "JA"; } if(__map_reserved["zh_Hans"] != null) { _g1.setReserved("zh_Hans","AND"); } else { _g1.h["zh_Hans"] = "AND"; } if(__map_reserved["ro"] != null) { _g1.setReserved("ro","SI"); } else { _g1.h["ro"] = "SI"; } if(__map_reserved["sk"] != null) { _g1.setReserved("sk","A"); } else { _g1.h["sk"] = "A"; } if(__map_reserved["ko"] != null) { _g1.setReserved("ko","및"); } else { _g1.h["ko"] = "및"; } if(__map_reserved["it"] != null) { _g1.setReserved("it","E"); } else { _g1.h["it"] = "E"; } if(__map_reserved["sq"] != null) { _g1.setReserved("sq","DHE"); } else { _g1.h["sq"] = "DHE"; } if(__map_reserved["ru"] != null) { _g1.setReserved("ru","И"); } else { _g1.h["ru"] = "И"; } if(__map_reserved["pt"] != null) { _g1.setReserved("pt","E"); } else { _g1.h["pt"] = "E"; } if(__map_reserved["da"] != null) { _g1.setReserved("da","OG"); } else { _g1.h["da"] = "OG"; } if(__map_reserved["el"] != null) { _g1.setReserved("el","ΚΑΙ"); } else { _g1.h["el"] = "ΚΑΙ"; } if(__map_reserved["nl"] != null) { _g1.setReserved("nl","EN"); } else { _g1.h["nl"] = "EN"; } if(__map_reserved["bg"] != null) { _g1.setReserved("bg","И"); } else { _g1.h["bg"] = "И"; } if(__map_reserved["fr"] != null) { _g1.setReserved("fr","ET"); } else { _g1.h["fr"] = "ET"; } if(__map_reserved["sr"] != null) { _g1.setReserved("sr","И"); } else { _g1.h["sr"] = "И"; } if(__map_reserved["hr"] != null) { _g1.setReserved("hr","I"); } else { _g1.h["hr"] = "I"; } if(__map_reserved["es"] != null) { _g1.setReserved("es","Y"); } else { _g1.h["es"] = "Y"; } if(__map_reserved["de"] != null) { _g1.setReserved("de","UND"); } else { _g1.h["de"] = "UND"; } if(__map_reserved["hu"] != null) { _g1.setReserved("hu","ÉS"); } else { _g1.h["hu"] = "ÉS"; } if(__map_reserved["sv"] != null) { _g1.setReserved("sv","OCH"); } else { _g1.h["sv"] = "OCH"; } if(__map_reserved["cs"] != null) { _g1.setReserved("cs","A"); } else { _g1.h["cs"] = "A"; } if(__map_reserved["ja"] != null) { _g1.setReserved("ja","並びに"); } else { _g1.h["ja"] = "並びに"; } if(__map_reserved["nb_NO"] != null) { _g1.setReserved("nb_NO","OG"); } else { _g1.h["nb_NO"] = "OG"; } var tmp1 = this.noResults(wordElements.join(new epaper_i18n_Localizable("SEARCH_AND",_g1).toHTML())); this.noresultsTxt.innerHTML = tmp1; } ,focusInput: function() { this.input.focus(); } ,blurInput: function() { this.input.blur(); } ,openSearchWithTerm: function(urlSearchTerm) { var _gthis = this; this.searchMenuItem.setAttribute("data-pinned",""); this.focusInput(); this.input.value = urlSearchTerm; var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(_gthis.results,"li:first-child"); while(_g < _g1.length) { var item = _g1[_g]; ++_g; _$Dom_QueryResult_$Impl_$.query(item,"a")[0].click(); } },1000),$bind($_,$_.stop))); } ,doTextHighlighting: function(searchWord,force) { if(force == null) { force = false; } if(searchWord == null) { searchWord = this.input.value; } if(!force && searchWord.length < 2) { return; } var _g = 0; var _g1 = this.book.getPages(tink_state__$Observable_Observable_$Impl_$.get_value(this.book.get_position()).cur); while(_g < _g1.length) { var page = _g1[_g]; ++_g; if(page.get_textPositions() != null && page.get_textPositions().length != 0) { var highlighting = new epaper_search_Highlighting(page); highlighting.highlightSearchWord(searchWord); } } } ,updateSearch: function() { var _g = this.get_index().getQuickJump(this.input.value); switch(_g[1]) { case 0: var v = _g[2]; this.jumpTxt.classList.remove("nodisplay"); this.quickJump.classList.add("active"); var _g1 = this.jumpTxt.querySelector(".page-number"); if(_g1 != null) { var v1 = _g1; v1.innerHTML = this.input.value; } this.quickJump.setAttribute("data-page",v == null ? "null" : "" + v); break; case 1: this.quickJump.classList.remove("active"); this.jumpTxt.classList.add("nodisplay"); break; } this.doTextHighlighting(this.input.value,true); return this.get_index().search(this.input.value); } ,menuItem: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n
  • \n \n \n
  • \n"; ret.s += this12; var this13 = ret.s; return this13; } ,foundResults: function(words) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n "; ret.s += this1; var _g = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g.setReserved("lv","Lapas, kurās ir"); } else { _g.h["lv"] = "Lapas, kurās ir"; } if(__map_reserved["tr"] != null) { _g.setReserved("tr","Bulunan sayfalar:"); } else { _g.h["tr"] = "Bulunan sayfalar:"; } if(__map_reserved["en"] != null) { _g.setReserved("en","Pages containing"); } else { _g.h["en"] = "Pages containing"; } if(__map_reserved["pl"] != null) { _g.setReserved("pl","Strony z"); } else { _g.h["pl"] = "Strony z"; } if(__map_reserved["fi"] != null) { _g.setReserved("fi","Sivut, jotka sisältävät käsitteen"); } else { _g.h["fi"] = "Sivut, jotka sisältävät käsitteen"; } if(__map_reserved["zh_Hans"] != null) { _g.setReserved("zh_Hans","页面包含"); } else { _g.h["zh_Hans"] = "页面包含"; } if(__map_reserved["ro"] != null) { _g.setReserved("ro","Pagini care conțin"); } else { _g.h["ro"] = "Pagini care conțin"; } if(__map_reserved["sk"] != null) { _g.setReserved("sk","Stránky s"); } else { _g.h["sk"] = "Stránky s"; } if(__map_reserved["ko"] != null) { _g.setReserved("ko","페이지에 포함"); } else { _g.h["ko"] = "페이지에 포함"; } if(__map_reserved["it"] != null) { _g.setReserved("it","Pagine con"); } else { _g.h["it"] = "Pagine con"; } if(__map_reserved["sq"] != null) { _g.setReserved("sq","Faqe që përmbajnë"); } else { _g.h["sq"] = "Faqe që përmbajnë"; } if(__map_reserved["ru"] != null) { _g.setReserved("ru","Страницы с"); } else { _g.h["ru"] = "Страницы с"; } if(__map_reserved["pt"] != null) { _g.setReserved("pt","Páginas com"); } else { _g.h["pt"] = "Páginas com"; } if(__map_reserved["da"] != null) { _g.setReserved("da","Sider med"); } else { _g.h["da"] = "Sider med"; } if(__map_reserved["el"] != null) { _g.setReserved("el","Σελίδες με"); } else { _g.h["el"] = "Σελίδες με"; } if(__map_reserved["nl"] != null) { _g.setReserved("nl","Pagina's met"); } else { _g.h["nl"] = "Pagina's met"; } if(__map_reserved["bg"] != null) { _g.setReserved("bg","Страници с"); } else { _g.h["bg"] = "Страници с"; } if(__map_reserved["fr"] != null) { _g.setReserved("fr","Pages contenant"); } else { _g.h["fr"] = "Pages contenant"; } if(__map_reserved["sr"] != null) { _g.setReserved("sr","Страница са"); } else { _g.h["sr"] = "Страница са"; } if(__map_reserved["hr"] != null) { _g.setReserved("hr","Stranice sa"); } else { _g.h["hr"] = "Stranice sa"; } if(__map_reserved["es"] != null) { _g.setReserved("es","Páginas con"); } else { _g.h["es"] = "Páginas con"; } if(__map_reserved["de"] != null) { _g.setReserved("de","Seiten mit"); } else { _g.h["de"] = "Seiten mit"; } if(__map_reserved["hu"] != null) { _g.setReserved("hu","Az oldalak tartalmazzák:"); } else { _g.h["hu"] = "Az oldalak tartalmazzák:"; } if(__map_reserved["sv"] != null) { _g.setReserved("sv","Sidor med"); } else { _g.h["sv"] = "Sidor med"; } if(__map_reserved["cs"] != null) { _g.setReserved("cs","Stránky s"); } else { _g.h["cs"] = "Stránky s"; } if(__map_reserved["ja"] != null) { _g.setReserved("ja","次の検索語を含むページが見つかりました:"); } else { _g.h["ja"] = "次の検索語を含むページが見つかりました:"; } if(__map_reserved["nb_NO"] != null) { _g.setReserved("nb_NO","Sider med"); } else { _g.h["nb_NO"] = "Sider med"; } var b = new epaper_i18n_Localizable("SEARCH_RESULTSCONTAINING",_g).toHTML(); ret.s += b; var this2 = "\n "; ret.s += this2; ret.s += words; var this3 = "\n"; ret.s += this3; var this4 = ret.s; return this4; } ,noResults: function(words) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n "; ret.s += this1; var _g = new haxe_ds_StringMap(); if(__map_reserved["lv"] != null) { _g.setReserved("lv","Neviena lapa nesatur"); } else { _g.h["lv"] = "Neviena lapa nesatur"; } if(__map_reserved["tr"] != null) { _g.setReserved("tr","Hiçbir sayfada bulunamadı:"); } else { _g.h["tr"] = "Hiçbir sayfada bulunamadı:"; } if(__map_reserved["en"] != null) { _g.setReserved("en","No page contains"); } else { _g.h["en"] = "No page contains"; } if(__map_reserved["pl"] != null) { _g.setReserved("pl","Żadna strona nie zawiera"); } else { _g.h["pl"] = "Żadna strona nie zawiera"; } if(__map_reserved["fi"] != null) { _g.setReserved("fi","Mikään sivu ei sisällä käsitettä"); } else { _g.h["fi"] = "Mikään sivu ei sisällä käsitettä"; } if(__map_reserved["zh_Hans"] != null) { _g.setReserved("zh_Hans","未包含页面"); } else { _g.h["zh_Hans"] = "未包含页面"; } if(__map_reserved["ro"] != null) { _g.setReserved("ro","Nicio pagină nu conține cuvântul căutat"); } else { _g.h["ro"] = "Nicio pagină nu conține cuvântul căutat"; } if(__map_reserved["sk"] != null) { _g.setReserved("sk","Žiadna strana neobsahuje"); } else { _g.h["sk"] = "Žiadna strana neobsahuje"; } if(__map_reserved["ko"] != null) { _g.setReserved("ko","페이지 없음"); } else { _g.h["ko"] = "페이지 없음"; } if(__map_reserved["it"] != null) { _g.setReserved("it","Nessuna pagina contenente"); } else { _g.h["it"] = "Nessuna pagina contenente"; } if(__map_reserved["sq"] != null) { _g.setReserved("sq","Asnjë faqe nuk përmban"); } else { _g.h["sq"] = "Asnjë faqe nuk përmban"; } if(__map_reserved["ru"] != null) { _g.setReserved("ru","Никакая из страниц не содержит"); } else { _g.h["ru"] = "Никакая из страниц не содержит"; } if(__map_reserved["pt"] != null) { _g.setReserved("pt","Nenhuma página contém"); } else { _g.h["pt"] = "Nenhuma página contém"; } if(__map_reserved["da"] != null) { _g.setReserved("da","Ingen side indeholder"); } else { _g.h["da"] = "Ingen side indeholder"; } if(__map_reserved["el"] != null) { _g.setReserved("el","Καμία σελίδα δεν περιέχει"); } else { _g.h["el"] = "Καμία σελίδα δεν περιέχει"; } if(__map_reserved["nl"] != null) { _g.setReserved("nl","Geen enkele pagina bevat"); } else { _g.h["nl"] = "Geen enkele pagina bevat"; } if(__map_reserved["bg"] != null) { _g.setReserved("bg","Никоя страница не съдържа"); } else { _g.h["bg"] = "Никоя страница не съдържа"; } if(__map_reserved["fr"] != null) { _g.setReserved("fr","Aucune page ne contient"); } else { _g.h["fr"] = "Aucune page ne contient"; } if(__map_reserved["sr"] != null) { _g.setReserved("sr","Садржај не постоји"); } else { _g.h["sr"] = "Садржај не постоји"; } if(__map_reserved["hr"] != null) { _g.setReserved("hr","Nijedna stranica ne sadrži"); } else { _g.h["hr"] = "Nijedna stranica ne sadrži"; } if(__map_reserved["es"] != null) { _g.setReserved("es","Ninguna página contiene"); } else { _g.h["es"] = "Ninguna página contiene"; } if(__map_reserved["de"] != null) { _g.setReserved("de","Keine Seite enthält"); } else { _g.h["de"] = "Keine Seite enthält"; } if(__map_reserved["hu"] != null) { _g.setReserved("hu","Egyik oldal sem tartalmazza a kifejezést:"); } else { _g.h["hu"] = "Egyik oldal sem tartalmazza a kifejezést:"; } if(__map_reserved["sv"] != null) { _g.setReserved("sv","Ingen sida innehåller"); } else { _g.h["sv"] = "Ingen sida innehåller"; } if(__map_reserved["cs"] != null) { _g.setReserved("cs","Žádná stránka neobsahuje"); } else { _g.h["cs"] = "Žádná stránka neobsahuje"; } if(__map_reserved["ja"] != null) { _g.setReserved("ja","検索結果なし"); } else { _g.h["ja"] = "検索結果なし"; } if(__map_reserved["nb_NO"] != null) { _g.setReserved("nb_NO","Ingen side inneholder"); } else { _g.h["nb_NO"] = "Ingen side inneholder"; } var b = new epaper_i18n_Localizable("SEARCH_NORESULTSCONTAINING",_g).toHTML(); ret.s += b; var this2 = "\n "; ret.s += this2; ret.s += words; var this3 = "\n"; ret.s += this3; var this4 = ret.s; return this4; } ,wordElement: function(word) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n \""; ret.s += this1; ret.s += word; var this2 = "\"\n"; ret.s += this2; var this3 = ret.s; return this3; } ,get_state: function() { return this.lazy_state.get(); } ,get_index: function() { return this.lazy_index.get(); } ,__class__: epaper_search_Search }; var epaper_share_Share = function(settings,issueUrl,bookPos) { this.desc = ""; this.title = "ePaper"; this.enabled = true; this.settings = settings; this.issueUrl = issueUrl; this.bookPos = bookPos; this.enabled = settings.enabled; if(settings.previewHeadline.length > 0) { var s = settings.previewHeadline; this.title = encodeURIComponent(s); } if(settings.previewDesciption.length > 0) { var s1 = settings.previewDesciption; this.desc = encodeURIComponent(s1); } }; epaper_share_Share.__name__ = ["epaper","share","Share"]; epaper_share_Share.prototype = { renderTo: function(elt) { var _gthis = this; this.target = elt; if(!this.enabled) { return; } var menuItem = Dom.getElement(this.renderMenuItem()); var networks = menuItem.querySelectorAll(".targets>li"); if(networks.length == 0) { this.enabled = false; return; } this.target.appendChild(menuItem); tink_state__$Observable_Observable_$Impl_$.bind(this.bookPos,null,function(pos) { var _g = pos.from; switch(_g[1]) { case 0: break; case 1: _gthis.update(pos.cur); break; } }); this.update(tink_state__$Observable_Observable_$Impl_$.get_value(this.bookPos).cur); } ,update: function(pos) { var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(this.target,".targets li a"); while(_g < _g1.length) { var item = _g1[_g]; ++_g; var tmp = item.getAttribute("data-link"); var s = "" + this.issueUrl + "#" + pos; item.setAttribute("href",StringTools.replace(tmp,"{URL}",encodeURIComponent(s))); } } ,renderMenuItem: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\n
  • \n \n \n
  • \n"; ret.s += this33; var this34 = ret.s; return this34; } ,__class__: epaper_share_Share }; var epaper_tracking_CustomTracker = function(customDataFunc) { this.customDataFunction = customDataFunc == null ? function() { return null; } : customDataFunc; }; epaper_tracking_CustomTracker.__name__ = ["epaper","tracking","CustomTracker"]; epaper_tracking_CustomTracker.prototype = { trackEvent: function(eventAction,eventLabel,eventValue,additonalCustomData) { var eventData = { }; var defaultCustomData = this.customDataFunction(); if(defaultCustomData != null) { var key = defaultCustomData.keys(); while(key.hasNext()) { var key1 = key.next(); eventData[key1] = __map_reserved[key1] != null ? defaultCustomData.getReserved(key1) : defaultCustomData.h[key1]; } } if(additonalCustomData != null) { var key2 = additonalCustomData.keys(); while(key2.hasNext()) { var key3 = key2.next(); eventData[key3] = __map_reserved[key3] != null ? additonalCustomData.getReserved(key3) : additonalCustomData.h[key3]; } } if(window.document.location.protocol == "file:") { return; } if(window.document.location.hostname == "localhost") { return; } try { switch(eventAction) { case "Custom Link Click": window.trackCustomLinkClick(eventData,eventLabel); break; case "Directory Click": window.trackDirectoryClick(eventData,eventLabel); break; case "Media Click": window.trackMediaClick(eventData,eventLabel); break; case "PDF Download": window.trackPDFDownload(eventData,eventLabel); break; case "Page View": window.trackPageView(eventData,eventLabel); break; case "Search": window.trackSearch(eventData,eventLabel); break; case "Share Click": window.trackShareClick(eventData,eventLabel,eventValue); break; case "ePaper View": window.trackEpaperView(eventData,eventLabel); break; } } catch( msg ) { if (msg instanceof js__$Boot_HaxeError) msg = msg.val; if( js_Boot.__instanceof(msg,String) ) { console.log("CUSTOM TRACKING FUNCTION NOT FOUND FOR : " + eventAction + " " + Std.string(eventData)); } else throw(msg); } } ,__class__: epaper_tracking_CustomTracker }; var epaper_tracking_EpaperTracker = function() { }; epaper_tracking_EpaperTracker.__name__ = ["epaper","tracking","EpaperTracker"]; epaper_tracking_EpaperTracker.fixPageZero = function(page) { if(page == 0) { return 1; } else { return page; } }; epaper_tracking_EpaperTracker.initClientTracker = function(defaultEventCategory) { console.log("init clientTracker"); epaper_tracking_EpaperTracker.clientTracker = new epaper_tracking_GATracker(null,"clientGATracker",null,defaultEventCategory); }; epaper_tracking_EpaperTracker.initUXTracker = function(defaultEventCategory,customDataFunc) { console.log("init uxTracker"); epaper_tracking_EpaperTracker.uxTracker = new epaper_tracking_GATracker(null,"uxTracker",null,defaultEventCategory,customDataFunc); window.document.addEventListener("click",epaper_tracking_EpaperTracker.trackEventGUIClick); }; epaper_tracking_EpaperTracker.initCustomTracker = function(customDataFunc) { console.log("init custom tracker"); epaper_tracking_EpaperTracker.customTracker = new epaper_tracking_CustomTracker(customDataFunc); }; epaper_tracking_EpaperTracker.trackEventEpaperView = function(startPage) { var eventAction = "ePaper View"; var eventLabel = "Start Page: " + epaper_tracking_EpaperTracker.fixPageZero(startPage); if(epaper_tracking_EpaperTracker.clientTracker != null) { epaper_tracking_EpaperTracker.clientTracker.trackEvent(eventAction,eventLabel); epaper_tracking_EpaperTracker.clientTracker.trackPageView(window.document.location.pathname); } if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent(eventAction,eventLabel); } if(epaper_tracking_EpaperTracker.customTracker != null) { epaper_tracking_EpaperTracker.customTracker.trackEvent(eventAction,eventLabel); } }; epaper_tracking_EpaperTracker.trackEventPageView = function(page) { if(epaper_tracking_EpaperTracker.pageTimer != null) { epaper_tracking_EpaperTracker.pageTimer.stop(); } epaper_tracking_EpaperTracker.pageTimer = new haxe_Timer(3000); epaper_tracking_EpaperTracker.pageTimer.run = function() { epaper_tracking_EpaperTracker.pageTimer.stop(); var currentPage = page; if(epaper_tracking_EpaperTracker.previousPage != -9999 && epaper_tracking_EpaperTracker.previousPage == currentPage) { return; } var eventAction = "Page View"; var eventLabel = Std.string(epaper_tracking_EpaperTracker.fixPageZero(currentPage)); epaper_tracking_EpaperTracker.previousPage = currentPage; if(epaper_tracking_EpaperTracker.clientTracker != null) { epaper_tracking_EpaperTracker.clientTracker.trackEvent(eventAction,eventLabel); } if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent(eventAction,eventLabel); } if(epaper_tracking_EpaperTracker.customTracker != null) { epaper_tracking_EpaperTracker.customTracker.trackEvent(eventAction,eventLabel); } }; }; epaper_tracking_EpaperTracker.trackEventPDFDownload = function(pageString) { var eventAction = "PDF Download"; var eventLabel = pageString; if(epaper_tracking_EpaperTracker.clientTracker != null) { epaper_tracking_EpaperTracker.clientTracker.trackEvent(eventAction,eventLabel); } if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent(eventAction,eventLabel); } if(epaper_tracking_EpaperTracker.customTracker != null) { epaper_tracking_EpaperTracker.customTracker.trackEvent(eventAction,eventLabel); } }; epaper_tracking_EpaperTracker.trackEventSearch = function(searchTerm) { if(searchTerm == epaper_tracking_EpaperTracker.lastSearchTerm) { return; } if(epaper_tracking_EpaperTracker.searchTimer != null) { epaper_tracking_EpaperTracker.searchTimer.stop(); } if(searchTerm.length < 2) { return; } epaper_tracking_EpaperTracker.lastSearchTerm = searchTerm; epaper_tracking_EpaperTracker.searchTimer = new haxe_Timer(2000); epaper_tracking_EpaperTracker.searchTimer.run = function() { epaper_tracking_EpaperTracker.searchTimer.stop(); var eventAction = "Search"; var eventLabel = searchTerm; if(epaper_tracking_EpaperTracker.clientTracker != null) { epaper_tracking_EpaperTracker.clientTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,0,100)); } if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,0,100)); } if(epaper_tracking_EpaperTracker.customTracker != null) { epaper_tracking_EpaperTracker.customTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,0,100)); } }; }; epaper_tracking_EpaperTracker.trackEventDirectoryClick = function(page,itemCaption) { var eventAction = "Directory Click"; var eventLabel = "Page: " + (page == null ? "null" : "" + page) + " - " + itemCaption; if(epaper_tracking_EpaperTracker.clientTracker != null) { epaper_tracking_EpaperTracker.clientTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,0,100)); } if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,0,100)); } if(epaper_tracking_EpaperTracker.customTracker != null) { epaper_tracking_EpaperTracker.customTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,0,100)); } }; epaper_tracking_EpaperTracker.trackEventShareClick = function(shareTarget,page) { var eventAction = "Share Click"; var eventLabel = shareTarget; var eventValue = epaper_tracking_EpaperTracker.fixPageZero(page); if(epaper_tracking_EpaperTracker.clientTracker != null) { epaper_tracking_EpaperTracker.clientTracker.trackEvent(eventAction,eventLabel,_$UInt_UInt_$Impl_$.toFloat(eventValue)); } if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent(eventAction,eventLabel,_$UInt_UInt_$Impl_$.toFloat(eventValue)); } if(epaper_tracking_EpaperTracker.customTracker != null) { epaper_tracking_EpaperTracker.customTracker.trackEvent(eventAction,eventLabel,_$UInt_UInt_$Impl_$.toFloat(eventValue)); } }; epaper_tracking_EpaperTracker.trackEventCustomLinkClick = function(link) { var eventAction = "Custom Link Click"; var eventLabel = link; if(epaper_tracking_EpaperTracker.clientTracker != null) { epaper_tracking_EpaperTracker.clientTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,-100,null)); } if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,-100,null)); } if(epaper_tracking_EpaperTracker.customTracker != null) { epaper_tracking_EpaperTracker.customTracker.trackEvent(eventAction,HxOverrides.substr(eventLabel,0,100)); } }; epaper_tracking_EpaperTracker.trackEventMediaClick = function(onPage,mediaTitle) { var eventAction = "Media Click"; var eventLabel = "Page: " + Std.string(epaper_tracking_EpaperTracker.fixPageZero(onPage)) + " - " + mediaTitle; if(epaper_tracking_EpaperTracker.clientTracker != null) { epaper_tracking_EpaperTracker.clientTracker.trackEvent(eventAction,eventLabel); } if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent(eventAction,eventLabel); } if(epaper_tracking_EpaperTracker.customTracker != null) { epaper_tracking_EpaperTracker.customTracker.trackEvent(eventAction,eventLabel); } }; epaper_tracking_EpaperTracker.trackEventGUIClick = function(e) { var elt = e.target; var selector = []; while(elt != null && elt != window.document.body) { selector.push(epaper_tracking_EpaperTracker.selectorFor(elt)); elt = elt.parentElement; } selector.reverse(); var additionalCustomData = new haxe_ds_StringMap(); var v = epaper_tracking_EpaperTracker.previousHash; if(__map_reserved["dimension9"] != null) { additionalCustomData.setReserved("dimension9",v); } else { additionalCustomData.h["dimension9"] = v; } epaper_tracking_EpaperTracker.previousHash = window.document.location.hash; var v1 = HxOverrides.substr(selector.join(">"),-100,null); if(__map_reserved["dimension10"] != null) { additionalCustomData.setReserved("dimension10",v1); } else { additionalCustomData.h["dimension10"] = v1; } var v2 = epaper_tracking_EpaperTracker.previousSelector; if(__map_reserved["dimension11"] != null) { additionalCustomData.setReserved("dimension11",v2); } else { additionalCustomData.h["dimension11"] = v2; } epaper_tracking_EpaperTracker.previousSelector = __map_reserved["dimension10"] != null ? additionalCustomData.getReserved("dimension10") : additionalCustomData.h["dimension10"]; if(epaper_tracking_EpaperTracker.uxTracker != null) { epaper_tracking_EpaperTracker.uxTracker.trackEvent("GUI Click",HxOverrides.substr(selector.join(">"),-100,null),null,additionalCustomData); } }; epaper_tracking_EpaperTracker.selectorFor = function(elt) { var tmp = elt.tagName.toLowerCase(); var _g = elt.id; var tmp1; if(_g == null) { tmp1 = ""; } else if(_g == "") { tmp1 = ""; } else { var v = _g; tmp1 = "#" + v; } var _g1 = elt.className; var tmp2; if(_g1 == null) { tmp2 = ""; } else if(_g1 == "") { tmp2 = ""; } else { var v1 = _g1; tmp2 = "." + StringTools.replace(v1," ","."); } return tmp + tmp1 + tmp2; }; var epaper_tracking_GATracker = function(trackingId,trackerName,customCode,defaultEventCategory,customDataFunc) { if(trackingId != null) { var insertionPoint = window.document.querySelector("script"); var script = window.document.createElement("script"); script.innerHTML = epaper_tracking_GATracker.gaTrackingCode(trackingId,trackerName,customCode); insertionPoint.parentNode.appendChild(script); } this.trackerPrefix = trackerName == null ? null : "" + trackerName + "."; this.defaultEventCategory = defaultEventCategory; this.customDataFunction = customDataFunc == null ? function() { return null; } : customDataFunc; }; epaper_tracking_GATracker.__name__ = ["epaper","tracking","GATracker"]; epaper_tracking_GATracker.gaTrackingCode = function(trackingId,trackerName,customCode) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', '"; ret.s += this1; var b = tink_template__$Html_Html_$Impl_$.escape(trackingId); ret.s += b; var this2 = "', 'auto'"; ret.s += this2; if(trackerName != null) { var this3 = ", '"; ret.s += this3; var b1 = tink_template__$Html_Html_$Impl_$.escape(trackerName); ret.s += b1; var this4 = "' "; ret.s += this4; } var this5 = ");\n ga('set', 'anonymizeIp', true);\n "; ret.s += this5; if(customCode != null) { var this6 = "\n "; ret.s += this6; ret.s += customCode; var this7 = "\n "; ret.s += this7; } var this8 = ret.s; return this8; }; epaper_tracking_GATracker.prototype = { trackEvent: function(eventAction,eventLabel,eventValue,additonalCustomData) { var eventData = { hitType : "event", eventCategory : this.defaultEventCategory, eventAction : eventAction, eventLabel : eventLabel}; if(eventValue != null) { eventData.eventValue = eventValue; } eventData = Reflect.copy(eventData); var defaultCustomData = this.customDataFunction(); if(defaultCustomData != null) { var key = defaultCustomData.keys(); while(key.hasNext()) { var key1 = key.next(); eventData[key1] = __map_reserved[key1] != null ? defaultCustomData.getReserved(key1) : defaultCustomData.h[key1]; } } if(additonalCustomData != null) { var key2 = additonalCustomData.keys(); while(key2.hasNext()) { var key3 = key2.next(); eventData[key3] = __map_reserved[key3] != null ? additonalCustomData.getReserved(key3) : additonalCustomData.h[key3]; } } if(window.document.location.protocol == "file:") { return; } if(window.document.location.hostname == "localhost") { return; } ga("" + this.trackerPrefix + "send",eventData); } ,trackPageView: function(pageRef,additonalCustomData) { var pageViewData = { hitType : "pageview", page : pageRef}; pageViewData = Reflect.copy(pageViewData); var defaultCustomData = this.customDataFunction(); if(defaultCustomData != null) { var key = defaultCustomData.keys(); while(key.hasNext()) { var key1 = key.next(); pageViewData[key1] = __map_reserved[key1] != null ? defaultCustomData.getReserved(key1) : defaultCustomData.h[key1]; } } if(additonalCustomData != null) { var key2 = additonalCustomData.keys(); while(key2.hasNext()) { var key3 = key2.next(); pageViewData[key3] = __map_reserved[key3] != null ? additonalCustomData.getReserved(key3) : additonalCustomData.h[key3]; } } if(window.document.location.protocol == "file:") { return; } if(window.document.location.hostname == "localhost") { return; } ga("" + this.trackerPrefix + "send",pageViewData); } ,__class__: epaper_tracking_GATracker }; var epaper_viewer_Boot = function() { }; epaper_viewer_Boot.__name__ = ["epaper","viewer","Boot"]; epaper_viewer_Boot.main = function() { epaper_i18n_Localizable.currentLocale = haxe_ds_Option.Some(window.document.documentElement.getAttribute("lang")); var root = window.document.body.querySelector(".epaper-root"); var config; var _g = window.document.body.querySelector("script[type=\"text/json\"]"); if(_g == null) { config = { directory : { }, subDir : "", download : { enabled : false, link : ""}, pagesOverview : { enabled : true}, search : { enabled : true}, navigationBar : { enabled : true}, fullscreen : { enabled : true}, media : { allowIconsOnGeo : false}, share : { enabled : false}, zoom : { defaultZoomMultiplier : 5}, display : { pageMode : "auto"}, pageShadow : { enabled : true}, customerImprint : { content : "", maxWidth : 0, maxHeight : 0}, customerGDPR : { content : "", maxWidth : 0, maxHeight : 0}, cookieBanner : { content : "", buttonLabel : ""}, metadata : { appId : "", appType : "", epaperId : "", customerId : "", publishTarget : ""}, bg : { url : "", color : "", contrastColor : ""}}; } else { var v = _g; config = new tink_json_Parser2().parse(v.textContent); } var updateViewportSize = function() { var rect = root.getBoundingClientRect(); var vw = "xxl"; var vh = "xxl"; if(rect.width < 2000) { vw = "xl"; } if(rect.height < 1201) { vh = "xl"; } if(rect.width < 1500) { vw = "l"; } if(rect.height < 900) { vh = "l"; } if(rect.width < 1000) { vw = "m"; } if(rect.height < 650) { vh = "m"; } if(rect.width < 750) { vw = "s"; } if(rect.height < 500) { vh = "s"; } if(rect.width < 500) { vw = "xs"; } if(rect.height < 333) { vh = "xs"; } if(root.getAttribute("data-viewport-width") != vw) { root.setAttribute("data-viewport-width",vw); } if(root.getAttribute("data-viewport-height") != vh) { root.setAttribute("data-viewport-height",vh); } }; var updateScreenFit = function() { var rect1 = root.getBoundingClientRect(); var sw = root.getAttribute("data-debug-screen-width") != null ? parseFloat(root.getAttribute("data-debug-screen-width")) : window.screen.width; var sh = root.getAttribute("data-debug-screen-height") != null ? parseFloat(root.getAttribute("data-debug-screen-height")) : window.screen.height; var isTouch = root.getAttribute("data-input") == "touch"; var currentElt = window.document.activeElement; var currentEltName = ""; if(currentElt != null) { currentEltName = currentElt.tagName.toLowerCase(); } var touchKeyboardActive = isTouch && (currentEltName == "input" || currentEltName == "textarea"); var sFit = "near-max"; if(!touchKeyboardActive && rect1.width * rect1.height / (sw * sh) < .5) { sFit = "wasteful"; } if(root.getAttribute("data-screen-fit") != sFit) { root.setAttribute("data-screen-fit",sFit); } }; var updateXLayout = function() { var vw1 = root.getAttribute("data-viewport-width"); var vh1 = root.getAttribute("data-viewport-height"); var input = root.getAttribute("data-input"); var hOverlay = "apart"; var vOverlay = "apart"; if(input == "touch" || vw1 == "xs" || vw1 == "s" || vw1 == "m" || vh1 == "xs" || vh1 == "s" || vh1 == "m") { hOverlay = "overlaid"; vOverlay = "overlaid"; } if(root.getAttribute("data-horizontal-layout") != hOverlay) { root.setAttribute("data-horizontal-layout",hOverlay); } if(root.getAttribute("data-vertical-layout") != vOverlay) { root.setAttribute("data-vertical-layout",vOverlay); } }; var updateFlashcard = function() { var vw2 = root.getAttribute("data-viewport-width"); var vh2 = root.getAttribute("data-viewport-height"); var sFit1 = root.getAttribute("data-screen-fit"); var isTouch1 = root.getAttribute("data-input") == "touch"; var isIOS = root.getAttribute("data-platform") == "ios"; var flashcard = "off"; if(sFit1 == "wasteful") { if(vw2 == "xs" || vh2 == "xs") { flashcard = "on"; } if(isTouch1 && (vw2 == "s" || vh2 == "s")) { flashcard = "on"; } if(isIOS) { flashcard = "off"; } } if(root.getAttribute("data-flashcard") != flashcard) { root.setAttribute("data-flashcard",flashcard); } }; var handleWindowResize = function() { updateViewportSize(); var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { updateScreenFit(); },500),$bind($_,$_.stop))); }; var handleViewportSizeUpdate = function() { updateXLayout(); updateFlashcard(); }; var handleScreenFitUpdate = function() { updateFlashcard(); }; var handleDebugScreenSizeUpdate = function() { updateScreenFit(); }; var handleInputUpdate = function() { updateXLayout(); updateScreenFit(); }; var handleOrientationUpdate = function() { var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { updateScreenFit(); },500),$bind($_,$_.stop))); }; var handlePlatformUpdate = function() { updateFlashcard(); }; window.addEventListener("resize",handleWindowResize); var observer = new MutationObserver(function(changes,obs) { var _g1 = 0; while(_g1 < changes.length) { var i = changes[_g1]; ++_g1; var _g2 = i.attributeName; switch(_g2) { case "data-debug-screen-height": handleDebugScreenSizeUpdate(); break; case "data-debug-screen-width": handleDebugScreenSizeUpdate(); break; case "data-input": handleInputUpdate(); break; case "data-orientation": handleOrientationUpdate(); break; case "data-platform": handlePlatformUpdate(); break; case "data-screen-fit": handleScreenFitUpdate(); break; case "data-viewport-height": handleViewportSizeUpdate(); break; case "data-viewport-width": handleViewportSizeUpdate(); break; } } }); observer.observe(root,{ attributes : true}); handleWindowResize(); var paramsChanged = tink_core__$Signal_Signal_$Impl_$.trigger(); window.debugUI = epaper_debug_DebugUi; Dom.on(window.document,"keydown",function(e) { var _g11 = e.keyCode; if(_g11 == 68) { if(e.ctrlKey && e.altKey) { e.preventDefault(); e.stopImmediatePropagation(); paramsChanged = epaper_debug_DebugUi.init(root,true,config); } } }); var bookRoot = root.querySelector(".flipbook-root"); var bookViewPageMode; var _g12 = config.display.pageMode; switch(_g12) { case "Auto": bookViewPageMode = flipbook_PageMode.Auto; break; case "Double": bookViewPageMode = flipbook_PageMode.Double; break; case "Single": bookViewPageMode = flipbook_PageMode.Single; break; default: bookViewPageMode = flipbook_PageMode.Auto; } var engine = new epaper_flipbook_DomEngine(bookViewPageMode,config.pageShadow.enabled,config.zoom.defaultZoomMultiplier,bookRoot); paramsChanged.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { var this3 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { engine.view.updateViewport({ animated : true, boundsCheck : true}); },250),$bind($_,$_.stop))); })); var core = new epaper_viewer_Core(engine,root,config); var pages = core.book.allPages(); var numThumbsLoaded = 0; var lastThumbLoaded = function() { var startTime = window.config.startTime; var currTime = new Date().getTime(); var elapsedTime = currTime - startTime; var MIN_TIME = 1000; var remainingTime = elapsedTime > MIN_TIME ? 0 : (MIN_TIME - elapsedTime) / 1000; if(window.document.location.hostname == "localhost") { remainingTime = 0; } var this4 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { root.querySelector(".loading-screen").classList.add("fade-out"); },remainingTime * 1000 | 0),$bind($_,$_.stop))); }; var this5 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { var _g21 = 0; while(_g21 < pages.length) { var p = pages[_g21]; ++_g21; if(p.get_index() == 0) { continue; } var pageThumb = new Image(); pageThumb.onload = function() { numThumbsLoaded += 1; if(numThumbsLoaded == pages.length - 1) { lastThumbLoaded(); } }; pageThumb.src = p.get_thumb(); } },100),$bind($_,$_.stop))); var isFirefox = window.navigator.userAgent.toLowerCase().indexOf("firefox") > -1 && typeof(InstallTrigger) != "undefined"; if(isFirefox) { root.setAttribute("data-is-firefox",""); } }; var epaper_viewer_Core = function(book,root,config) { this.curMaxHeight = 0; this.curMaxWidth = 0; this.LOGO_BOTTOM_LEFT_MARGIN = 15; this.LOGO_TOP_RIGHT_MARGIN = 20; this.urlSearchTerm = null; this.openLinksInEMA = false; this.isApp = false; var _gthis = this; this.book = book; this.root = root; this.config = config; this.urlParams = new haxe_ds_StringMap(); var tmp = tink_state__$Observable_Observable_$Impl_$.map(book.get_position(),tink_state__$Observable_Transform_$Impl_$.plain(function(pos) { var __tmp = []; var _g = 0; var _g1 = book.getPages(pos.cur); while(_g < _g1.length) { var page = _g1[_g]; ++_g; var _g2 = pos.from; if(_g2[1] == 1) { __tmp.push(page.getMedia()); } else { __tmp.push([]); } } return __tmp; })); this.media = new epaper_media_MediaController(root,tmp); if(window.location.hash.length >= 2) { var hashParams = window.location.hash.split("&"); var fristParam = HxOverrides.substr(hashParams.shift(),1,null); var startPage = ""; if(fristParam.indexOf("=") == -1) { startPage = fristParam; } else { hashParams.push(fristParam); } var _g3 = 0; while(_g3 < hashParams.length) { var pS = hashParams[_g3]; ++_g3; var pA = pS.split("="); var v = pA[1]; var _this = this.urlParams; var key = pA[0]; if(__map_reserved[key] != null) { _this.setReserved(key,v); } else { _this.h[key] = v; } if(pA.length == 2) { switch(pA[0]) { case "isApp": if(pA[1] == "yes") { this.isApp = true; } break; case "openLinksInEMA": if(pA[1] == "true") { this.openLinksInEMA = true; } break; case "search": var term = pA[1]; this.urlSearchTerm = decodeURIComponent(term.split("+").join(" ")); break; default: } } } window.history.replaceState(null,null,window.location.origin + window.location.pathname + window.location.search + "#" + startPage); } var htmlElt = window.document.querySelector("head"); htmlElt.insertAdjacentHTML("afterbegin",""); root.setAttribute("data-is-app",this.isApp ? "yes" : "no"); var _g4 = window.orientation; var tmp1; switch(_g4) { case -90: tmp1 = "landscape"; break; case 0: tmp1 = "portrait"; break; case 90: tmp1 = "landscape"; break; case 180: tmp1 = "portrait"; break; default: tmp1 = "none"; } root.setAttribute("data-orientation",tmp1); root.setAttribute("data-ui-size","normal"); root.setAttribute("data-ui-visibilty","visible"); var _g11 = 0; var _g21 = [this.background(),this.mainControls(),this.logo(),this.flashcard()]; while(_g11 < _g21.length) { var html = _g21[_g11]; ++_g11; if(Dom.getElement(html) != null) { var tmp2 = Dom.getElement(html); root.appendChild(tmp2); } } this.setupMenu(); this.bindDataAttributes(); this.setupInputStates(); if(config.cookieBanner.content.length > 0) { var tmp3 = Dom.getElement(this.cookieBanner()); root.appendChild(tmp3); var cookieBanner = root.querySelector(".cookie-banner"); if(window.document.cookie.indexOf("accepted-cookies=") < 0) { cookieBanner.setAttribute("data-no-cookie-set",""); } _$Dom_QueryResult_$Impl_$.on(".cookie-banner button","click",null,tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { js_Cookie.set("accepted-cookies","true",315360000); cookieBanner.removeAttribute("data-no-cookie-set"); _gthis.initTracking(); })); } if(book.allPages().length <= 2) { root.querySelector("button.right").style.visibility = "hidden"; root.querySelector("button.next").style.visibility = "hidden"; } var autoPanThreshold = 1.5; this.on("click","button.left,button.prev",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { book.flipTo(epaper_flipbook_FlipDestination.Prev); if(tink_state__$Observable_Observable_$Impl_$.get_value(book.get_zoom().get_factor()) > autoPanThreshold) { var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { book.panTo({ x : flipbook_ZoomPosition.End, y : flipbook_ZoomPosition.End}); },500),$bind($_,$_.stop))); } })); this.on("click","button.right,button.next",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { book.flipTo(epaper_flipbook_FlipDestination.Next); if(tink_state__$Observable_Observable_$Impl_$.get_value(book.get_zoom().get_factor()) > autoPanThreshold) { var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { book.panTo({ x : flipbook_ZoomPosition.Start, y : flipbook_ZoomPosition.Start}); },500),$bind($_,$_.stop))); } })); new slider_Slider(root.querySelector(".zoom .slider"),null,null,null,null,tink_state__$Observable_Observable_$Impl_$.map(book.get_zoom().get_factor(),tink_state__$Observable_Transform_$Impl_$.plain(function(f) { return (f - 1) / (tink_state__$Observable_Observable_$Impl_$.get_value(book.get_zoom().get_maxFactor()) - 1); })),function(value) { var newFac = 1 + value * (tink_state__$Observable_Observable_$Impl_$.get_value(book.get_zoom().get_maxFactor()) - 1); book.get_zoom().scaleTo(newFac); }); tink_state__$Observable_Observable_$Impl_$.bind(book.get_zoom().get_factor(),null,function(f1) { var _g12 = 0; var _g22 = _$Dom_QueryResult_$Impl_$.query(root,"[data-zoom-factor]"); while(_g12 < _g22.length) { var view = _g22[_g12]; ++_g12; view.setAttribute("data-zoom-factor","" + (f1 * 10 | 0) / 10); } }); var tmp4 = root.querySelector(".main-controls .center-controls"); new epaper_navbar_NavBar(book,tmp4); if(!config.navigationBar.enabled || book.allPages().length < 6) { root.querySelector(".main-controls").setAttribute("data-navbar-disabled","true"); } _$Dom_QueryResult_$Impl_$.on("a[href^=\"#\"]:not([target])","click",null,function(on) { on.event.preventDefault(); var tmp5 = on.at.getAttribute("href"); _gthis.navigateTo(tmp5); }); var tmp6 = epaper_flipbook_FlipDestination.Page(Std.parseInt(window.location.href.split("#").pop()) | 0,true); book.flipTo(tmp6); var changingHash = false; tink_state__$Observable_Observable_$Impl_$.bind(book.get_position(),null,function(pos1) { if(pos1.from[1] == 1) { var pos2 = pos1.cur; changingHash = true; window.history.replaceState(null,null,window.location.origin + window.location.pathname + window.location.search + "#" + (pos2 == null ? "null" : "" + pos2)); window.location.hash = pos2 == null ? "null" : "" + pos2; changingHash = false; } }); Dom.on(window,"hashchange",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { if(!changingHash) { var tmp7 = epaper_flipbook_FlipDestination.Page(Std.parseInt(window.location.href.split("#").pop()) | 0); book.flipTo(tmp7); } })); var updateGridActiveItem = function() { var items = _$Dom_QueryResult_$Impl_$.query(root,".page-grid>ol")[0]; if(items == null) { return; } var _g13 = 0; var _g23 = _$Dom_QueryResult_$Impl_$.query(items,".active-page"); while(_g13 < _g23.length) { var old = _g23[_g13]; ++_g13; old.classList.remove("active-page"); } var _g14 = 0; var _g24 = book.get_position(); var _g25 = book.getPages(tink_state__$Observable_Observable_$Impl_$.get_value(_g24).cur); while(_g14 < _g25.length) { var page1 = _g25[_g14]; ++_g14; var result = _$Dom_QueryResult_$Impl_$.query(items,"[data-pos=\"" + page1.get_index() + "\"]")[0]; if(result != null) { result.parentElement.classList.add("active-page"); } } }; tink_state__$Observable_Observable_$Impl_$.bind(book.get_overview().get_isOpen(),null,tink_core__$Callback_Callback_$Impl_$.fromNiladic(updateGridActiveItem)); tink_state__$Observable_Observable_$Impl_$.bind(book.get_position(),null,tink_core__$Callback_Callback_$Impl_$.fromNiladic(updateGridActiveItem)); var toggleOverView = root.querySelector("li.overview"); if(toggleOverView != null) { var f2 = ($_=book.get_overview(),$bind($_,$_.toggle)); Dom.on(toggleOverView,"click",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { return f2(); })); var _e = toggleOverView; var f3 = function(property,on1) { return Dom.toggle(_e,property,on1); }; var tmp8 = function(on2) { return f3(".active",on2); }; tink_state__$Observable_Observable_$Impl_$.bind(book.get_overview().get_isOpen(),null,tmp8); } book.get_navigate().handle(function(nav) { _gthis.navigateTo(nav.url,nav.target); }); var customButton = root.querySelector(".main-controls .custom"); if(customButton != null) { var linkUrl = customButton.firstElementChild.getAttribute("data-link"); var aElt = Dom.tag("a",{ href : linkUrl, target : "_blank", style : "display:none"}); customButton.appendChild(aElt); Dom.on(customButton,"click",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { if(config.customLinkButton.inOverlay) { var clMaxWidth = config.customLinkButton.overlayWidth > 0 ? config.customLinkButton.overlayWidth + "px" : "100%"; var clMaxHeight = config.customLinkButton.overlayHeight > 0 ? config.customLinkButton.overlayHeight + "px" : "100%"; var tmp9 = epaper_media_MediaViewItem.IFrame(linkUrl,"max-width: " + clMaxWidth + "; max-height: " + clMaxHeight + ";"); epaper_media_MediaView.get_EXPANDED().setContent([tmp9]); } else { aElt.click(); } })); } var toggleFullScreen = function(value1) { Dom.toggleFullScreen(root,value1); }; var fullscreenBtn; if(config.fullscreen.enabled) { fullscreenBtn = root.querySelector(".main-controls .menu-buttons li.fullscreen"); Dom.on(fullscreenBtn,"click",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { toggleFullScreen(!Dom["is"](fullscreenBtn,".active")); })); var updateFullscreenBtn = function() { var isFullscreen = window.document.webkitIsFullScreen || window.document.mozFullScreen || window.document.msFullscreenElement != null; Dom.toggle(fullscreenBtn,".active",isFullscreen); Dom.toggleAria(fullscreenBtn.querySelector("button"),"aria-pressed",isFullscreen); }; window.document.addEventListener("webkitfullscreenchange",updateFullscreenBtn,false); window.document.addEventListener("mozfullscreenchange",updateFullscreenBtn,false); window.document.addEventListener("fullscreenchange",updateFullscreenBtn,false); window.document.addEventListener("MSFullscreenChange",updateFullscreenBtn,false); } _$Dom_QueryResult_$Impl_$.on(".flashcard-fullscreen-toggle","click",null,tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { toggleFullScreen(true); })); _$Dom_QueryResult_$Impl_$.on("li.imprint","click",null,tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { var imprintMaxWidth = config.customerImprint.maxWidth > 0 ? config.customerImprint.maxWidth + "px" : "100%"; var imprintMaxHeight = config.customerImprint.maxHeight > 0 ? config.customerImprint.maxHeight + "px" : "100%"; var tmp10 = epaper_media_MediaView.get_EXPANDED(); var this3 = StringTools.htmlUnescape(config.customerImprint.content); tmp10.setContent([epaper_media_MediaViewItem.HTMLContent(this3,"max-width: " + imprintMaxWidth + "; max-height: " + imprintMaxHeight + ";")]); })); _$Dom_QueryResult_$Impl_$.on("li.gdpr","click",null,tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { var gdprMaxWidth = config.customerGDPR.maxWidth > 0 ? config.customerGDPR.maxWidth + "px" : "100%"; var gdprMaxHeight = config.customerGDPR.maxHeight > 0 ? config.customerGDPR.maxHeight + "px" : "100%"; var tmp11 = epaper_media_MediaView.get_EXPANDED(); var this4 = StringTools.htmlUnescape(config.customerGDPR.content); tmp11.setContent([epaper_media_MediaViewItem.HTMLContent(this4,"max-width: " + gdprMaxWidth + "; max-height: " + gdprMaxHeight + ";")]); })); _$Dom_QueryResult_$Impl_$.on("a[href]","click",null,function(e) { if(Dom.nearest(e.at,".share") != null) { return; } var tmp12 = e.at.getAttribute("href"); var tmp13 = e.at.getAttribute("target"); _gthis.navigateTo(tmp12,tmp13,e); e.event.preventDefault(); }); Dom.on(window.document,"keydown",function(e1) { var EMAOverlayOpen = tink_state__$Observable_Observable_$Impl_$.get_value(epaper_media_MediaView.get_EXPANDED().isOpen); var _g15 = e1.keyCode; switch(_g15) { case 27: if(EMAOverlayOpen) { epaper_media_MediaView.get_EXPANDED().close(); } else { var _g16 = 0; var _g26 = _$Dom_QueryResult_$Impl_$.query(root,".menu-buttons>li.pinnable[data-pinned]"); while(_g16 < _g26.length) { var popouts = _g26[_g16]; ++_g16; Dom.toggle(popouts,"pinned",false); } } break; case 70: if(e1.ctrlKey) { e1.preventDefault(); e1.stopImmediatePropagation(); if(config.search.enabled && !EMAOverlayOpen) { root.querySelector(".main-controls .search").setAttribute("data-pinned",""); _gthis.search.focusInput(); } } break; } var _g27 = window.document.activeElement.tagName.toLowerCase(); switch(_g27) { case "input":case "textarea": return; default: } if(!EMAOverlayOpen) { var _g31 = e1.keyCode; switch(_g31) { case 13: break; case 32: book.get_zoom().toggle(); break; case 33: book.flipTo(epaper_flipbook_FlipDestination.Page(0)); break; case 34: var tmp14 = epaper_flipbook_FlipDestination.Page(book.allPages().length - 1); book.flipTo(tmp14); break; case 37: if(tink_state__$Observable_Observable_$Impl_$.get_value(book.get_zoom().get_factor()) > 1) { var tmp15 = book.get_zoom(); var this5; var this6 = new tink_core_MPair(50,0); this5 = this6; tmp15.moveBy(this5); } else { book.flipTo(epaper_flipbook_FlipDestination.Prev); } break; case 38: var tmp16 = book.get_zoom(); var this7; var this8 = new tink_core_MPair(0,50); this7 = this8; tmp16.moveBy(this7); break; case 39: if(tink_state__$Observable_Observable_$Impl_$.get_value(book.get_zoom().get_factor()) > 1) { var tmp17 = book.get_zoom(); var this9; var this10 = new tink_core_MPair(-50,0); this9 = this10; tmp17.moveBy(this9); } else { book.flipTo(epaper_flipbook_FlipDestination.Next); } break; case 40: var tmp18 = book.get_zoom(); var this11; var this12 = new tink_core_MPair(0,-50); this11 = this12; tmp18.moveBy(this11); break; } } if(EMAOverlayOpen) { var _g32 = e1.keyCode; switch(_g32) { case 37: epaper_media_MediaView.get_EXPANDED().prev(); break; case 39: epaper_media_MediaView.get_EXPANDED().next(); break; } } }); if(config.cookieBanner.content.length <= 0) { window.setTimeout($bind(this,this.initTracking),500); } else if(window.document.cookie.indexOf("accepted-cookies=") >= 0) { window.setTimeout($bind(this,this.initTracking),500); } }; epaper_viewer_Core.__name__ = ["epaper","viewer","Core"]; epaper_viewer_Core.prototype = { license: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = ""; ret.s += this1; var this2 = ret.s; return this2; } ,navigateTo: function(url,target,evtTarget) { if(url.charAt(0) == "#") { this.book.flipTo(epaper_flipbook_FlipDestination.Page(Std.parseInt(HxOverrides.substr(url,1,null)))); } else if(this.isApp) { if(url == "container:close") { window.open(url,"_self"); } else if(this.openLinksInEMA) { if(tink_state__$Observable_Observable_$Impl_$.get_value(epaper_media_MediaView.get_EXPANDED().isOpen)) { epaper_media_MediaView.get_EXPANDED().close(); } var tmp = epaper_media_MediaViewItem.IFrame(url,""); epaper_media_MediaView.get_EXPANDED().setContent([tmp]); } else if(evtTarget != null && Dom.nearest(evtTarget.at,".download") != null) { var loc = window.location; window.open("external:" + loc.protocol + "//" + loc.host + loc.pathname + "/../" + url,"_self"); } else { window.open("overlay:" + url,"_self"); } } else { window.setTimeout(function() { window.open(url,target); },10); } } ,setupMenu: function() { var _gthis = this; var menuButtons = this.root.querySelector(".main-controls .menu-buttons"); var more = Dom.getElement(this.moreButton()); var button = _$Dom_QueryResult_$Impl_$.query(more,"button")[0]; var positionMoreButton = function() { var baseWidth = Std.parseInt(window.getComputedStyle(button).minWidth); var visibleBtns = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(_gthis.root,".main-controls .menu-buttons > li:not(.more)")).filter(function(btn) { return btn.offsetParent != null; }); var required = visibleBtns.length * baseWidth; var available = menuButtons.clientWidth; menuButtons.removeChild(more); var positionMoreButton1 = required <= available ? menuButtons.firstChild : menuButtons.insertBefore(more,visibleBtns[(available / baseWidth | 0) - 1]); menuButtons.insertBefore(more,positionMoreButton1); }; this.book.get_resized().handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(positionMoreButton,10),$bind($_,$_.stop))); })); var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(positionMoreButton,100),$bind($_,$_.stop))); menuButtons.appendChild(more); _$Dom_QueryResult_$Impl_$.on(".more","click",menuButtons,function(e) { Dom.toggle(e.at,"active"); }); if(this.isApp) { var tmp = Dom.getElement(this.appBackButton("container:close",null,null)); menuButtons.appendChild(tmp); } var tmp1 = this.book.getDirectory(); var _g = this.root.getAttribute("data-viewport-height"); var _g1 = this.root.getAttribute("data-viewport-width"); var tmp2; switch(_g1) { case "s": tmp2 = false; break; case "xs": tmp2 = false; break; default: switch(_g) { case "s": tmp2 = false; break; case "xs": tmp2 = false; break; default: tmp2 = this.config.directory.visibleAtStart; } } this.directory = new epaper_directory_Directory(tmp1,tmp2,this.config.directory.hideAtItemClick,this.config.directory.descriptionAsTooltip,this.config.directory.showThumbnails,this.book); this.directory.renderTo(menuButtons); if(this.config.pagesOverview.enabled && this.book.allPages().length > 2) { var tmp3 = Dom.getElement(this.overviewButton()); menuButtons.appendChild(tmp3); } this.search = new epaper_search_Search(this.book); if(this.config.search.enabled) { this.search.renderTo(menuButtons); if(this.urlSearchTerm != null) { this.search.openSearchWithTerm(this.urlSearchTerm); } } if(!this.isApp) { new epaper_share_Share(this.config.share,window.location.href.split("#")[0],this.book.get_position()).renderTo(menuButtons); } new epaper_download_Downloads(this.config.download.enabled,this.config.download.link,tink_state__$Observable_Observable_$Impl_$.map(this.book.get_position(),tink_state__$Observable_Transform_$Impl_$.plain(function(pos) { return _gthis.book.getPages(pos.cur).map(function(v) { return v.get_downloadUrl(); }); }))).renderTo(menuButtons); if(this.config.customLinkButton != null) { var tmp4 = Dom.getElement(this.customLinkButton()); menuButtons.appendChild(tmp4); } if(this.config.customerImprint.content.length > 0) { var tmp5 = Dom.getElement(this.customerImprintButton()); menuButtons.appendChild(tmp5); } if(this.config.customerGDPR.content.length > 0) { var tmp6 = Dom.getElement(this.customerGDPRButton()); menuButtons.appendChild(tmp6); } var tmp7 = Dom.getElement(this.spacerButton()); menuButtons.appendChild(tmp7); var tmp8 = Dom.getElement(this.zoomButton()); menuButtons.appendChild(tmp8); if(this.config.fullscreen.enabled) { var tmp9 = Dom.getElement(this.fullscreenButton()); menuButtons.appendChild(tmp9); } var correctPopoutProperties = function(aside) { var r = aside.getBoundingClientRect(); var total = _gthis.root.getBoundingClientRect(); if(_gthis.root.getAttribute("data-debug-device") != null) { if(_gthis.root.getAttribute("data-viewport-height").indexOf("s") == -1) { aside.style.maxHeight = total.height * 0.7 + "px"; } else { aside.style.maxHeight = total.height - 75 + "px"; } aside.style.maxWidth = total.width - 75 + "px"; } var xOffset = 20; var mLeft = Std.parseInt(window.getComputedStyle(aside).marginLeft); if(r.left - mLeft < total.left + xOffset) { aside.style.marginLeft = "" + (total.left + xOffset - (r.left - mLeft)) + "px"; } else if(r.right - mLeft > total.right - xOffset) { aside.style.marginLeft = "" + (total.right - xOffset - (r.right - mLeft)) + "px"; } }; _$Dom_QueryResult_$Impl_$.on("li.pinnable:not([data-pinned])","click",menuButtons,function(e1) { var aside1 = _$Dom_QueryResult_$Impl_$.query(e1.at,"aside")[0]; if(aside1 == null) { return; } correctPopoutProperties(aside1); }); window.addEventListener("resize",function() { var menu = _gthis.root.querySelector(".menu-buttons"); var _g2 = 0; var _g3 = _$Dom_QueryResult_$Impl_$.query(menu,"li.pinnable[data-pinned] aside.popout"); while(_g2 < _g3.length) { var aside2 = _g3[_g2]; ++_g2; correctPopoutProperties(aside2); } }); this.logoElt = this.root.querySelector(".logo-container"); this.controlsElt = this.root.querySelector(".center-controls"); this.mediabarLeftElt = this.root.querySelector(".media-bar.left"); this.flipbookElt = this.root.querySelector(".flipbook-root"); this.pageGridElt = this.flipbookElt.querySelector(".page-grid"); this.bookElt = this.root.querySelector(".book"); if(this.logoElt != null) { this.logoImgElt = this.logoElt.querySelector("img"); window.requestAnimationFrame($bind(this,this.calculateLogoConstraints)); } } ,calculateLogoConstraints: function(timestamp) { var _gthis = this; var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { window.requestAnimationFrame($bind(_gthis,_gthis.calculateLogoConstraints)); },200),$bind($_,$_.stop))); if(this.logoElt.offsetParent == null) { return; } if(window.getComputedStyle(this.logoElt).opacity != "1") { return; } if(window.getComputedStyle(this.logoElt).visibility == "hidden") { return; } if(this.logoImgElt.naturalWidth <= 0) { return; } if(this.logoImgElt.naturalHeight <= 0) { return; } var newMaxWidth = 1337; var newMaxHeight = 1337; var rootBox = this.root.getBoundingClientRect(); var maxWidthFromControls; var controlsLeftMargin = this.controlsElt.getBoundingClientRect().left; maxWidthFromControls = controlsLeftMargin - (this.LOGO_BOTTOM_LEFT_MARGIN + this.LOGO_TOP_RIGHT_MARGIN); var maxHeightFromMediabar = 500; var containerElts = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(this.mediabarLeftElt,".scroll-container.active")); var highestContainerBottom = 0; var _g = 0; while(_g < containerElts.length) { var contElt = containerElts[_g]; ++_g; highestContainerBottom = Math.max(contElt.getBoundingClientRect().bottom,highestContainerBottom); } var ulElts = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(this.mediabarLeftElt,".scroll-container.active .scroll-content")); var highestUlBottom = 0; var _g1 = 0; while(_g1 < ulElts.length) { var ul = ulElts[_g1]; ++_g1; highestUlBottom = Math.max(ul.getBoundingClientRect().bottom,highestUlBottom); } var mediaBarBottom = Math.min(highestContainerBottom,highestUlBottom); if(ulElts.length != 0) { var leftMediaBarButtomMargin = rootBox.bottom - mediaBarBottom; maxHeightFromMediabar = leftMediaBarButtomMargin - (this.LOGO_BOTTOM_LEFT_MARGIN + this.LOGO_TOP_RIGHT_MARGIN); } if(!this.pageGridElt.classList.contains("hidden")) { var pageGridBottomMargin = rootBox.bottom - this.pageGridElt.getBoundingClientRect().bottom; var maxHeightFromPageGrid = pageGridBottomMargin - (this.LOGO_BOTTOM_LEFT_MARGIN + this.LOGO_TOP_RIGHT_MARGIN); this.setNewLogoConstraints(maxWidthFromControls,maxHeightFromPageGrid); return; } var bookLeftMargin; var bookBottomMargin; if(this.flipbookElt.classList.contains("center-page") || this.flipbookElt.classList.contains("single-sided")) { bookLeftMargin = this.bookElt.getBoundingClientRect().left; } else { bookLeftMargin = this.bookElt.getBoundingClientRect().left - this.bookElt.getBoundingClientRect().width / 2; } bookBottomMargin = this.root.getBoundingClientRect().bottom - this.bookElt.getBoundingClientRect().bottom; var maxWidthFromBook = bookLeftMargin - (this.LOGO_BOTTOM_LEFT_MARGIN + this.LOGO_TOP_RIGHT_MARGIN); var maxHeightFromBook = bookBottomMargin - (this.LOGO_BOTTOM_LEFT_MARGIN + this.LOGO_TOP_RIGHT_MARGIN); var tmpScaleX = maxWidthFromControls / this.logoImgElt.naturalWidth; if(tmpScaleX > 1) { tmpScaleX = 1; } var tmpScaleY = maxHeightFromMediabar / this.logoImgElt.naturalHeight; if(tmpScaleY > 1) { tmpScaleY = 1; } var tmpWidth; var tmpHeight; if(tmpScaleX < tmpScaleY) { tmpWidth = this.logoImgElt.naturalWidth * tmpScaleX; tmpHeight = this.logoImgElt.naturalHeight * tmpScaleX; } else { tmpWidth = this.logoImgElt.naturalWidth * tmpScaleY; tmpHeight = this.logoImgElt.naturalHeight * tmpScaleY; } var tmpOverlapsWithBook = tmpWidth > maxWidthFromBook && tmpHeight > maxHeightFromBook; if(tmpOverlapsWithBook) { tmpScaleX = maxWidthFromBook / this.logoImgElt.naturalWidth; tmpScaleY = maxHeightFromBook / this.logoImgElt.naturalHeight; if(tmpScaleX > tmpScaleY) { this.setNewLogoConstraints(maxWidthFromBook,tmpScaleX * this.logoImgElt.naturalHeight); } else { this.setNewLogoConstraints(tmpScaleY * this.logoImgElt.naturalWidth,maxHeightFromBook); } } else { this.setNewLogoConstraints(maxWidthFromControls,maxHeightFromMediabar); } } ,setNewLogoConstraints: function(newMaxWidth,newMaxHeight) { if(newMaxWidth < 80) { newMaxWidth = 80; } if(newMaxHeight < 50) { newMaxHeight = 50; } newMaxWidth = Math.floor(newMaxWidth); newMaxHeight = Math.floor(newMaxHeight); if(newMaxWidth != this.curMaxWidth) { this.logoElt.style.width = newMaxWidth + "px"; this.curMaxWidth = newMaxWidth; } if(newMaxHeight != this.curMaxHeight) { this.logoElt.style.height = newMaxHeight + "px"; this.curMaxHeight = newMaxHeight; } } ,bindProp: function(name,o) { var _gthis = this; tink_state__$Observable_Observable_$Impl_$.bind(o,null,function(v) { if(v != _gthis.root.getAttribute("data-" + name)) { _gthis.root.setAttribute("data-" + name,v); } }); } ,bindDataAttributes: function() { var _gthis = this; window.addEventListener("orientationchange",function() { var _g = Math.abs(window.orientation); _gthis.root.setAttribute("data-orientation",_g == 90 ? "landscape" : "portrait"); }); this.bindProp("view",tink_state__$Observable_Observable_$Impl_$.map(this.book.get_zoom().get_factor(),tink_state__$Observable_Transform_$Impl_$.plain(function(factor) { if(factor > 1) { return "zoom"; } else { return "view"; } }))); this.bindProp("page-mode",tink_state__$Observable_Observable_$Impl_$.map(this.book.get_pageMode(),tink_state__$Observable_Transform_$Impl_$.plain(function(mode) { if(mode == epaper_flipbook_PageMode.Single) { return "single"; } else { return "double"; } }))); this.bindProp("paging-position",tink_state__$Observable_Observable_$Impl_$.map(this.book.get_position(),tink_state__$Observable_Transform_$Impl_$.plain(function(pos) { if(pos.cur == pos.min) { return "first"; } else if(tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_pageMode()) == epaper_flipbook_PageMode.Double && tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_position()).max % 2 > 0 && pos.cur == pos.max - 1) { return "last"; } else if(pos.cur == pos.max) { return "last"; } else { return "inbetween"; } }))); var reXiPhone = new EReg("iPhone","i"); var reXiPod = new EReg("iPos","i"); var reXiPad = new EReg("iPad","i"); var isIOS = reXiPhone.match(window.navigator.userAgent) || reXiPod.match(window.navigator.userAgent) || reXiPad.match(window.navigator.userAgent); this.root.setAttribute("data-platform",isIOS ? "ios" : "other"); var reXAndroid = new EReg("android","i"); var isAndroid = reXAndroid.match(window.navigator.userAgent); this.root.setAttribute("data-native-uri-handler",isIOS || isAndroid ? "yes" : "no"); var touchUI = "ontouchstart" in document; this.root.setAttribute("data-input",touchUI ? "touch" : "mouse"); if(touchUI) { Dom.on(this.root,"mousemove",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { if(_gthis.root.getAttribute("data-input") != "mouse" && _gthis.root.getAttribute("data-native-uri-handler") == "no") { _gthis.root.setAttribute("data-input","mouse"); } })); } var panning = tink_state__$State_State_$Impl_$.ofConstant(false); var last = null; tink_state__$Observable_Observable_$Impl_$.bind(this.book.get_currentInteraction(),null,function(i) { if(last != null) { last.dissolve(); } switch(i[1]) { case 0: var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { panning.set(false); },250),$bind($_,$_.stop))); last = this1; break; case 1: var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { panning.set(true); },100),$bind($_,$_.stop))); last = this2; break; case 2: break; } }); var this3 = new tink_state__$State_StateObject(false,null); var uiMinimized = this3; var nextClick = null; _$Dom_QueryResult_$Impl_$.on(".pages .image-layers","click",null,function(e) { if(nextClick != null) { return; } if(_gthis.root.getAttribute("data-input") != "mouse" && _gthis.book.get_focus().get_current() == haxe_ds_Option.None) { var this4 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { if(nextClick != null) { nextClick.dissolve(); } tink_state__$State_State_$Impl_$.toggle(uiMinimized); nextClick = null; },300),$bind($_,$_.stop))); var toggleMinimalUI = this4; nextClick = Dom.once(window.document,"click",function(e1) { if(toggleMinimalUI != null) { toggleMinimalUI.dissolve(); } nextClick = null; }); } }); tink_state__$Observable_Observable_$Impl_$.bind(this.book.get_zoom().get_factor(),null,function(factor1) { if(factor1 > 1) { uiMinimized.set(true); } else { uiMinimized.set(false); } }); var this5 = { f : function() { if(tink_state__$State_State_$Impl_$.get_value(uiMinimized)) { return "minimal"; } else { return "normal"; } }}; this.bindProp("ui-size",tink_state__$Observable_Observable_$Impl_$.auto(this5)); this.bindProp("func-mode",tink_state__$Observable_Observable_$Impl_$.combine(this.book.get_overview().get_isOpen(),epaper_media_MediaView.get_EXPANDED().isOpen,function(__tink_tmp14,__tink_tmp15) { if(__tink_tmp15 == true) { return "overlaid"; } else if(__tink_tmp14 == true) { return "overview"; } else { return "default"; } })); } ,setupInputStates: function() { var _gthis = this; var tag = function(e,children) { var tag1 = [e.tagName.toLowerCase()]; var __tmp = []; var _g = 0; var _g1 = e.attributes; while(_g < _g1.length) { var a = _g1[_g]; ++_g; __tmp.push(a.name + "=\"" + a.value + "\""); } var tag2 = "<" + tag1.concat(__tmp).join(" ") + ">"; if(children != null) { tag2 = tag2 + children.outerHTML + ""; } return tag2; }; var mouseleaveNoPseudo = ".hoverable[data-hovered]:not([data-passive-hover]):not(:hover)"; var mouseleave = ".hoverable[data-hovered]:not([data-passive-hover])"; var mouseenter = ".hoverable:not([data-hovered]):hover"; var timeouts = new haxe_ds_StringMap(); var counter = 0; var setTimeout = function(e1,time,match,cb) { if(time > 0) { var id; var _g2 = e1.getAttribute("data-timeout"); if(_g2 == null) { counter += 1; var id1 = "" + (counter - 1); e1.setAttribute("data-timeout",id1); id = id1; } else { var v = _g2; var this1 = __map_reserved[v] != null ? timeouts.getReserved(v) : timeouts.h[v]; if(this1 != null) { this1.dissolve(); } id = v; } var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { if(match == null || e1.matches(match)) { cb(); e1.removeAttribute("data-timeout"); } },time * 1000 | 0),$bind($_,$_.stop))); var v1 = this2; if(__map_reserved[id] != null) { timeouts.setReserved(id,v1); } else { timeouts.h[id] = v1; } } else { var _g3 = e1.getAttribute("data-timeout"); if(_g3 != null) { var id2 = _g3; var this3 = __map_reserved[id2] != null ? timeouts.getReserved(id2) : timeouts.h[id2]; if(this3 != null) { this3.dissolve(); } timeouts.remove(id2); e1.removeAttribute("data-timeout"); } cb(); } }; var getDelay = function(e2,event,val) { var ret = parseFloat(e2.getAttribute("data-" + event + "-delay")); if(e2.classList.contains("pinnable") && isNaN(ret)) { return val; } else { return ret; } }; this.on("mouseover",mouseenter,function(e3) { var e4 = e3.at; var tmp = getDelay(e3.at,"mouseover",.05); setTimeout(e4,tmp,mouseenter,function() { Dom.toggle(e3.at,"hovered",true); }); var this4 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { var _g4 = 0; var _g11 = _$Dom_QueryResult_$Impl_$.query(_gthis.root,mouseleaveNoPseudo); while(_g4 < _g11.length) { var stale = _g11[_g4]; ++_g4; Dom.toggle(stale,"hovered",false); } },100),$bind($_,$_.stop))); }); this.on("mouseout",mouseleave,function(e5) { var e6 = e5.at; var tmp1 = getDelay(e5.at,"mouseout",.5); setTimeout(e6,tmp1,mouseleaveNoPseudo,function() { Dom.toggle(e5.at,"hovered",false); }); }); this.on("click",".pinnable .pinner",function(e7) { var target = Dom.nearest(e7.at,".pinnable"); if(Dom.toggle(target,"pinned")) { var _g5 = 0; var _g12 = _$Dom_QueryResult_$Impl_$.query(_gthis.root,".pinnable[data-pinned]"); while(_g5 < _g12.length) { var elt = _g12[_g5]; ++_g5; if(elt != target) { Dom.toggle(elt,"pinned",false); } } } }); this.on("click",".ui-size-toggle",function(e8) { var target1 = e8.event.target; if(target1.classList.contains("close-btn")) { return; } if(_gthis.root.getAttribute("data-input") == "touch") { if(_gthis.root.getAttribute("data-ui-size") == "normal") { _gthis.root.setAttribute("data-ui-size","minimal"); } else { _gthis.root.setAttribute("data-ui-size","normal"); } } }); } ,on: function(eventType,selector,handler) { return _$Dom_QueryResult_$Impl_$.on(selector,eventType,null,handler); } ,initTracking: function() { var _gthis = this; var bodyElt = window.document.querySelector("body"); var disabledScriptElts = bodyElt.querySelectorAll("disabledscript"); var _g = 0; while(_g < disabledScriptElts.length) { var elt = disabledScriptElts[_g]; ++_g; var oldTag = elt; var newTag = window.document.createElement("script"); newTag.innerHTML = oldTag.innerHTML; bodyElt.appendChild(newTag); bodyElt.removeChild(oldTag); } var startTime = new Date().getTime() / 1000; var getCustomData = function() { var _g1 = new haxe_ds_StringMap(); var value = _gthis.config.metadata.appId; if(__map_reserved["dimension1"] != null) { _g1.setReserved("dimension1",value); } else { _g1.h["dimension1"] = value; } var value1 = _gthis.config.metadata.customerId; if(__map_reserved["dimension2"] != null) { _g1.setReserved("dimension2",value1); } else { _g1.h["dimension2"] = value1; } var value2 = _gthis.config.metadata.epaperId; if(__map_reserved["dimension3"] != null) { _g1.setReserved("dimension3",value2); } else { _g1.h["dimension3"] = value2; } var value3 = _gthis.config.metadata.publishTarget; if(__map_reserved["dimension4"] != null) { _g1.setReserved("dimension4",value3); } else { _g1.h["dimension4"] = value3; } var value4 = window.document.location.host; if(__map_reserved["dimension5"] != null) { _g1.setReserved("dimension5",value4); } else { _g1.h["dimension5"] = value4; } var value5 = window.document.location.pathname; if(__map_reserved["dimension6"] != null) { _g1.setReserved("dimension6",value5); } else { _g1.h["dimension6"] = value5; } var value6 = Std.string(tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_position()).cur == 0 ? 1 : tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_position()).cur); if(__map_reserved["dimension7"] != null) { _g1.setReserved("dimension7",value6); } else { _g1.h["dimension7"] = value6; } var value7 = window.document.location.hash; if(__map_reserved["dimension8"] != null) { _g1.setReserved("dimension8",value7); } else { _g1.h["dimension8"] = value7; } var value8 = Std.string(new Date().getTime() / 1000 - startTime); if(__map_reserved["metric1"] != null) { _g1.setReserved("metric1",value8); } else { _g1.h["metric1"] = value8; } return _g1; }; if(window.document.body.outerHTML.indexOf("uxTracker") > -1 && window.document.location.protocol != "file:") { var uxDefaultEventCategory = this.config.metadata.appId + " - " + this.config.metadata.publishTarget; epaper_tracking_EpaperTracker.initUXTracker(uxDefaultEventCategory,getCustomData); } if(window.document.body.outerHTML.indexOf("clientGATracker") > -1 && window.document.location.protocol != "file:") { var clientDefaultEventCategory = window.document.location.pathname + " - [" + window.document.title + "]"; epaper_tracking_EpaperTracker.initClientTracker(clientDefaultEventCategory); } if(window.document.body.outerHTML.indexOf("customTrackingCode") > -1 && window.document.location.protocol != "file:") { epaper_tracking_EpaperTracker.initCustomTracker(getCustomData); } epaper_tracking_EpaperTracker.trackEventEpaperView(tink_state__$Observable_Observable_$Impl_$.get_value(this.book.get_position()).cur); epaper_tracking_EpaperTracker.trackEventPageView(tink_state__$Observable_Observable_$Impl_$.get_value(this.book.get_position()).cur); tink_state__$Observable_Observable_$Impl_$.bind(this.book.get_position(),null,function(pos) { var _g2 = pos.from; switch(_g2[1]) { case 0: break; case 1: epaper_tracking_EpaperTracker.trackEventPageView(pos.cur); break; } }); _$Dom_QueryResult_$Impl_$.on(".menu-buttons .download ul.download-options>li","click",null,function(e) { var dlClass = e.at.getAttribute("class"); var pageString = ""; if(dlClass.indexOf("all") > -1) { pageString = "all"; } if(dlClass.indexOf("left") > -1) { pageString = "Page: " + Std.string(tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_position()).cur); } if(dlClass.indexOf("right") > -1) { pageString = "Page: " + Std.string(tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_position()).cur + 1); } if(dlClass.indexOf("single") > -1) { pageString = "Page: " + Std.string(tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_position()).cur); } epaper_tracking_EpaperTracker.trackEventPDFDownload(pageString); }); _$Dom_QueryResult_$Impl_$.on(".menu-buttons .search input[name=\"search-query\"]","input",null,function(e1) { var elt1 = e1.at; epaper_tracking_EpaperTracker.trackEventSearch(elt1.value); }); _$Dom_QueryResult_$Impl_$.on(".menu-buttons .directory li[data-page-id]","click",null,function(e2) { var tmp = Std.parseInt(e2.at.getAttribute("data-page-id")); var _g3 = e2.at.querySelector("a h1"); var tmp1; if(_g3 == null) { tmp1 = " "; } else { var v = _g3; tmp1 = v.textContent; } epaper_tracking_EpaperTracker.trackEventDirectoryClick(tmp,tmp1); }); _$Dom_QueryResult_$Impl_$.on(".menu-buttons .share .targets>li","click",null,function(e3) { epaper_tracking_EpaperTracker.trackEventShareClick(e3.at.getAttribute("class"),tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_position()).cur); }); _$Dom_QueryResult_$Impl_$.on(".main-controls .custom","click",null,function(e4) { epaper_tracking_EpaperTracker.trackEventCustomLinkClick(e4.at.querySelector("[data-link]").getAttribute("data-link")); }); this.book.get_mediaOpened().handle(function(item) { epaper_tracking_EpaperTracker.trackEventMediaClick(tink_state__$Observable_Observable_$Impl_$.get_value(_gthis.book.get_position()).cur,item.get_details().title.length > 0 ? item.get_details().title : item.get_details().description); }); } ,background: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
    \r\n "; ret.s += this1; if(this.config.bg.url.length > 0) { var this2 = "
    "; ret.s += this3; } var this4 = "
    \r\n"; ret.s += this4; var this5 = ret.s; return this5; } ,mainControls: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
    \r\n
    \r\n \r\n
    \r\n
      \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n"; ret.s += this9; var this10 = ret.s; return this10; } ,moreButton: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n \r\n
  • \r\n"; ret.s += this5; var this6 = ret.s; return this6; } ,appBackButton: function(url,icon,label) { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n \r\n
  • \r\n"; ret.s += this11; var this12 = ret.s; return this12; } ,overviewButton: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n \r\n
  • \r\n"; ret.s += this4; var this5 = ret.s; return this5; } ,customLinkButton: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n \r\n
  • \r\n"; ret.s += this6; var this7 = ret.s; return this7; } ,customerImprintButton: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n \r\n
  • \r\n"; ret.s += this4; var this5 = ret.s; return this5; } ,customerGDPRButton: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n \r\n
  • \r\n"; ret.s += this4; var this5 = ret.s; return this5; } ,spacerButton: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n"; ret.s += this1; var this2 = ret.s; return this2; } ,zoomButton: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n \r\n \r\n
  • \r\n"; ret.s += this7; var this8 = ret.s; return this8; } ,fullscreenButton: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
  • \r\n \r\n
  • \r\n"; ret.s += this4; var this5 = ret.s; return this5; } ,logo: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n "; ret.s += this1; if(this.config.logo != null) { var this2 = "\r\n 0) { var this3 = " href=\""; ret.s += this3; var b = tink_template__$Html_Html_$Impl_$.escape(this.config.logo.targetLink); ret.s += b; var this4 = "\" target=\"_blank\""; ret.s += this4; } var this5 = ">\r\n \""; 0) { var b2 = tink_template__$Html_Html_$Impl_$.escape(this.config.logo.targetLink); ret.s += b2; } else { var this7 = "Logo"; ret.s += this7; } var this8 = "\" />\r\n \r\n "; ret.s += this8; } var this9 = ret.s; return this9; } ,flashcard: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n
    \r\n"; ret.s += this1; var this2 = ret.s; return this2; } ,cookieBanner: function() { var ret = tink_template__$Html_Html_$Impl_$.buffer(); var this1 = "\r\n "; ret.s += this1; if(this.config.cookieBanner.content.length > 0) { var this2 = "\r\n
    \r\n

    "; ret.s += this2; var b = StringTools.htmlUnescape(this.config.cookieBanner.content); ret.s += b; var this3 = "

    \r\n \r\n
    \r\n "; ret.s += this4; } var this5 = ret.s; return this5; } ,__class__: epaper_viewer_Core }; var flipbook_PageMode = { __ename__ : true, __constructs__ : ["Auto","Single","Double"] }; flipbook_PageMode.Auto = ["Auto",0]; flipbook_PageMode.Auto.toString = $estr; flipbook_PageMode.Auto.__enum__ = flipbook_PageMode; flipbook_PageMode.Single = ["Single",1]; flipbook_PageMode.Single.toString = $estr; flipbook_PageMode.Single.__enum__ = flipbook_PageMode; flipbook_PageMode.Double = ["Double",2]; flipbook_PageMode.Double.toString = $estr; flipbook_PageMode.Double.__enum__ = flipbook_PageMode; var flipbook_BookView = function(root,options) { var _gthis = this; if(options == null) { options = { }; } if(options.firstPage == null) { options.firstPage = 0; } if(options.pageMode == null) { options.pageMode = flipbook_PageMode.Auto; } if(options.autoSize == null) { options.autoSize = true; } this._viewportChanged = new tink_core_SignalTrigger(); this._modeChanged = new tink_core_SignalTrigger(); this.modeChanged = this._modeChanged; this.viewportChanged = this._viewportChanged; this.modes = new haxe_ds_StringMap(); this.root = root; this.viewport = _$Dom_QueryResult_$Impl_$.query(root,".viewport")[0]; this.pagination = new flipbook_Pagination(); this.zoom = new flipbook_Zoom(_$Dom_QueryResult_$Impl_$.query(root,".zoomable")[0],$bind(this,this.getStep)); this.grid = new flipbook_pagegrid_Grid(this); this.set_os(flipbook_BookView.OS); this.pageMode = options.pageMode; var tmp = this.get_isMobile() ? "slide" : "flip"; root.setAttribute("data-page-transition",tmp); var lastDoubleSided = null; this.pagination.get_pageChanged().handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { root.setAttribute("data-page",Std.string(_gthis.pagination.page)); var _this = root.classList; var force = _gthis.pagination.get_doubleSided() && _gthis.getStep() == 1; if(force == null) { force = !_this.contains("center-page"); } if(force) { _this.add("center-page"); } else { _this.remove("center-page"); } var tmp1 = _gthis.pagination.get_doubleSided(); if(lastDoubleSided != tmp1) { lastDoubleSided = _gthis.pagination.get_doubleSided(); var _this1 = root.classList; var force1 = _gthis.pagination.get_doubleSided(); if(force1 == null) { force1 = !_this1.contains("double-sided"); } if(force1) { _this1.add("double-sided"); } else { _this1.remove("double-sided"); } var _this2 = root.classList; var force2 = !_gthis.pagination.get_doubleSided(); if(force2 == null) { force2 = !_this2.contains("single-sided"); } if(force2) { _this2.add("single-sided"); } else { _this2.remove("single-sided"); } } _gthis.zoom.enforceBounds(true); })); var tmp2 = this.pagination; var options1 = options.firstPage; var __tmp = []; var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(root,".book .page"); while(_g < _g1.length) { var page = _g1[_g]; ++_g; __tmp.push(new flipbook_PageView(page)); } tmp2.setPages(options1,__tmp); Dom.on(root.ownerDocument,"webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { var fsElement = window.document.fullscreenElement || window.document.fullScreenElement; var _this3 = root.classList; var force3 = root.contains(fsElement); if(force3 == null) { force3 = !_this3.contains("fullscreen"); } if(force3) { _this3.add("fullscreen"); } else { _this3.remove("fullscreen"); } })); this.zoom.get_changed().handle(function(factor) { var _this4 = root.classList; var force4 = factor > 1; if(force4 == null) { force4 = !_this4.contains("zoomed"); } if(force4) { _this4.add("zoomed"); } else { _this4.remove("zoomed"); } }); if(options.autoSize) { this.updateViewport(); Dom.on(window,"resize",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { _gthis.updateViewport({ boundsCheck : true, animated : true}); })); } }; flipbook_BookView.__name__ = ["flipbook","BookView"]; flipbook_BookView.prototype = { getStep: function() { var _g = this.pagination.get_step(); switch(_g) { case 1: return 1; case 2: var sum = 0; var _g1 = 0; var _g11 = this.pagination.activePages(); while(_g1 < _g11.length) { var a = _g11[_g1]; ++_g1; if(!a.get_isEmpty()) { ++sum; } } return sum; default: var v = _g; throw new js__$Boot_HaxeError("assert"); } } ,updateViewport: function(args) { var _gthis = this; if(args == null) { args = { }; } if(args.animated == null) { args.animated = false; } if(args.boundsCheck == null) { args.boundsCheck = false; } var obj = this.viewport.getBoundingClientRect(); var rect = new flipbook_data__$Rect_RectData(obj.top,obj.right,obj.bottom,obj.left); var tmp; if((rect.right - rect.left) * (rect.bottom - rect.top) != 0) { var b = this.zoom.viewportRect; if(rect.right == b.right && rect.bottom == b.bottom && rect.left == b.left) { tmp = rect.top == b.top; } else { tmp = false; } } else { tmp = true; } if(tmp) { return; } var scale1 = Math.min((rect.right - rect.left) / this.get_bookSize().a,(rect.bottom - rect.top) / this.get_bookSize().b); var scale2 = Math.min((rect.right - rect.left) / (2 * this.get_bookSize().a),(rect.bottom - rect.top) / this.get_bookSize().b); var doubleSided; var _g = this.pageMode; switch(_g[1]) { case 0: doubleSided = scale2 * scale2 * 2 > scale1 * scale1; break; case 1: doubleSided = false; break; case 2: doubleSided = true; break; } var tmp1 = this.pagination.get_doubleSided(); if(doubleSided != tmp1) { Dom.abruptly(this.root,function() { _gthis.pagination.set_doubleSided(doubleSided); _gthis.pagination.jumpTo(_gthis.pagination.page,true); }); } this.zoom.setViewport(rect,args); this.grid.setState(tink_state__$Observable_Observable_$Impl_$.get_value(this.grid.get_state())); tink_core__$Callback_CallbackList_$Impl_$.invoke(this._viewportChanged.handlers,tink_core_Noise.Noise); } ,set_os: function(param) { this.root.setAttribute("data-os",param); var isMobile; var _g = flipbook_BookView.OS; switch(_g) { case "linux":case "mac":case "win": isMobile = false; break; default: isMobile = true; } if(isMobile) { this.root.setAttribute("data-mobile",""); } else { this.root.removeAttribute("data-mobile"); } return param; } ,get_isMobile: function() { return this.root.hasAttribute("data-mobile"); } ,get_viewportChanged: function() { return this.viewportChanged; } ,get_bookSize: function() { return this.zoom.bookSize; } ,get_viewportRect: function() { return this.zoom.viewportRect; } ,__class__: flipbook_BookView }; var flipbook_Mode = function() { }; flipbook_Mode.__name__ = ["flipbook","Mode"]; var flipbook_AnimationOf = function(target) { var _gthis = this; this._ended = new tink_core_SignalTrigger(); this._started = new tink_core_SignalTrigger(); this.target = target; this.started = this._started; this.ended = this._ended; Dom.on(target,"animationstart webkitAnimationStart msAnimationStart",function(a) { _gthis.name = a.animationName; tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._started.handlers,a.animationName); }); Dom.on(target,"animationend webkitAnimationEnd msAnimationEnd",function(a1) { _gthis.name = null; tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._ended.handlers,a1.animationName); }); }; flipbook_AnimationOf.__name__ = ["flipbook","AnimationOf"]; flipbook_AnimationOf.prototype = { get_started: function() { return this.started; } ,get_ended: function() { return this.ended; } ,__class__: flipbook_AnimationOf }; var flipbook_PageView = function(target) { this.lazy_originalSize = new tink_core__$Lazy_LazyFunc(function() { var style = window.getComputedStyle(target); var o_width; var o_height; o_width = parseFloat(style.width); o_height = parseFloat(style.height); var this1; var this2 = new tink_core_MPair(o_width,o_height); this1 = this2; return this1; }); this._stateChanged = new tink_core_SignalTrigger(); this.target = target; this.stateChanged = this._stateChanged; this.parent = target.parentElement; this.animation = new flipbook_AnimationOf(target); target.__view = this; }; flipbook_PageView.__name__ = ["flipbook","PageView"]; flipbook_PageView.prototype = { startAnimation: function(name,classes) { var _gthis = this; var applyClasses = function() { if(classes != null) { var __tink_tmp66 = classes; var iterator_name = HxOverrides.iter(Reflect.fields(__tink_tmp66)); while(iterator_name.hasNext()) { var name1 = iterator_name.next(); var flag = __tink_tmp66[name1]; var _this = _gthis.target.classList; var force = flag; if(force == null) { force = !_this.contains(name1); } if(force) { _this.add(name1); } else { _this.remove(name1); } } } }; if(name == null) { Dom.toggle(this.target,"data-animation",false); applyClasses(); return { done : new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_Noise.Noise)), cancel : function() { }}; } else { this.target.setAttribute("data-animation",name); var canceled = false; var done = this.target.childNodes.length == 0 ? new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_Noise.Noise)) : tink_core__$Future_Future_$Impl_$.async(function(cb) { var end = function() { var ended = function() { return _gthis.target.getAttribute("data-animation") == name; }; if(ended()) { cb(tink_core_Noise.Noise); } var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { if(ended()) { _gthis.target.removeAttribute("data-animation"); } },50),$bind($_,$_.stop))); }; var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(end,800),$bind($_,$_.stop))); var abort = this2; var this3 = abort; var done1 = function(_) { this3.dissolve(); }; tink_core__$Signal_Signal_$Impl_$.nextTime(_gthis.animation.get_started(),null).handle(done1); tink_core__$Signal_Signal_$Impl_$.nextTime(_gthis.animation.get_ended(),null).handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { if(!canceled) { var this4 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { end(); canceled = true; },25),$bind($_,$_.stop))); } })); }); done.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(applyClasses)); return { done : done, cancel : function() { canceled = true; }}; } } ,wakeup: function() { if(this.target.parentNode == null) { var _g = 0; var _g1 = this.parent.children; while(_g < _g1.length) { var e = _g1[_g]; ++_g; if(this.get_index() < e.__view.get_index()) { this.parent.insertBefore(this.target,e); break; } } if(this.target.parentNode == null) { this.parent.appendChild(this.target); } tink_core__$Callback_CallbackList_$Impl_$.invoke(this._stateChanged.handlers,tink_core_Noise.Noise); } } ,show: function(direction) { this.wakeup(); this.target.classList.remove("hidden"); return this.startAnimation("show-" + direction); } ,hide: function(direction) { this.wakeup(); this.target.classList.remove("hidden"); return this.startAnimation("hide-" + direction,{ hidden : true}); } ,getThumb: function() { var this1 = this.target.querySelector(".meta .page-thumb"); return this1; } ,dispose: function() { if(this.target.parentNode != null) { this.target.parentNode.removeChild(this.target); tink_core__$Callback_CallbackList_$Impl_$.invoke(this._stateChanged.handlers,tink_core_Noise.Noise); } } ,justShow: function() { this.wakeup(); this.startAnimation(null,{ hidden : false}); } ,justHide: function() { this.startAnimation(null,{ hidden : true}); this.dispose(); } ,get_isEmpty: function() { return this.target.classList.contains("empty"); } ,get_index: function() { return Std.parseInt(this.target.getAttribute("data-pos")); } ,get_title: function() { var _g = this.target.querySelector(".meta .page-thumb .page-title"); if(_g == null) { return Std.string(this.get_index()); } else { var v = _g; return v.innerHTML; } } ,__class__: flipbook_PageView }; var flipbook__$PageView_PageThumb_$Impl_$ = {}; flipbook__$PageView_PageThumb_$Impl_$.__name__ = ["flipbook","_PageView","PageThumb_Impl_"]; flipbook__$PageView_PageThumb_$Impl_$.getUrl = function(this1) { return this1.getAttribute("data-img"); }; flipbook__$PageView_PageThumb_$Impl_$.makeElement = function(this1) { return this1.cloneNode(true); }; var flipbook_Pagination = function() { this.doubleSided = false; this._flipDone = new tink_core_SignalTrigger(); this._pageChanged = new tink_core_SignalTrigger(); this.pageChanged = this._pageChanged; this.flipDone = this._flipDone; this.pages = []; }; flipbook_Pagination.__name__ = ["flipbook","Pagination"]; flipbook_Pagination.prototype = { firstPage: function() { return this.validatePage(0); } ,lastPage: function() { return this.validatePage(this.pages.length); } ,cleanupPages: function() { var parent = this.pages[0].target.parentElement; var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(parent,".page.hidden"); while(_g < _g1.length) { var p = _g1[_g]; ++_g; this.getView(p).dispose(); } } ,set_doubleSided: function(param) { this.doubleSided = param; this.jumpTo(this.page); return param; } ,getView: function(e) { var _g = Dom.nearest(e,".book .page"); if(_g == null) { return null; } else { var v = _g; return v.__view; } } ,setPages: function(start,pages) { if(start == null) { start = 0; } var _g = 0; var _g1 = this.pages; while(_g < _g1.length) { var p = _g1[_g]; ++_g; p.dispose(); } this.pages = pages; start = this.validatePage(start); this.jumpTo(start); } ,setPage: function(to,force,changed) { if(force == null) { force = false; } var from = this.page; to = this.validatePage(to); if(from == to && !force) { return false; } this.page = to; if(changed != null) { tink_core__$Callback_Callback_$Impl_$.invoke(changed,{ from : from, to : to}); } tink_core__$Callback_CallbackList_$Impl_$.invoke(this._pageChanged.handlers,tink_core_Noise.Noise); return true; } ,animatePages: function(__tink_tmp157) { if(__tink_tmp157 == null) { __tink_tmp157 = { }; } var from = __tink_tmp157.from == null ? 0 : __tink_tmp157.from; var to = __tink_tmp157.to == null ? 0 : __tink_tmp157.to; var oldPages = this.getPages(from); var newPages = this.getPages(to); var direction = to > from ? "forwards" : "backwards"; var _g = 0; while(_g < newPages.length) { var p = newPages[_g]; ++_g; p.wakeup(); } var __tmp = []; var _g1 = 0; while(_g1 < newPages.length) { var p1 = newPages[_g1]; ++_g1; __tmp.push(p1.target.clientTop); } var xs = __tmp; var __tmp1 = []; var _g2 = 0; while(_g2 < oldPages.length) { var p2 = oldPages[_g2]; ++_g2; __tmp1.push(p2.hide(direction)); } var animations = [].concat(__tmp1); var __tmp2 = []; var _g3 = 0; while(_g3 < newPages.length) { var p3 = newPages[_g3]; ++_g3; __tmp2.push(p3.show(direction)); } var animations1 = animations.concat(__tmp2); var __tmp3 = []; var _g4 = 0; while(_g4 < animations1.length) { var a = animations1[_g4]; ++_g4; __tmp3.push(a.done); } var ret = tink_core__$Future_Future_$Impl_$.ofMany(__tmp3).map(function(_) { return tink_core_Noise.Noise; }); return ret.gather(); } ,animateTo: function(values) { var _gthis = this; var this1 = this.reflow; if(this1 != null) { this1.dissolve(); } this.currentFlip = tink_core__$Future_Future_$Impl_$.or(this.animatePages(values),tink_core__$Future_Future_$Impl_$.async(function(cb) { var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { cb(tink_core_Noise.Noise); },1000),$bind($_,$_.stop))); })); this.currentFlip.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { if(_gthis.page != values.to) { var this3 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { _gthis.animateTo({ from : values.to, to : _gthis.page}); },250),$bind($_,$_.stop))); } else { _gthis.currentFlip = null; if(flipbook_Pagination.isMac) { var this4 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { if(_gthis.currentFlip == null) { var parent = _gthis.pages[0].target.parentElement; var _g = 0; var _g1 = _$Dom_QueryResult_$Impl_$.query(parent,"[data-cleanup]"); while(_g < _g1.length) { var dirty = _g1[_g]; ++_g; dirty.style.display = "none"; _gthis.fake = dirty.offsetHeight; dirty.style.removeProperty("display"); } } },0),$bind($_,$_.stop))); _gthis.reflow = this4; } var this5 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay($bind(_gthis,_gthis.cleanupPages),200),$bind($_,$_.stop))); var this6 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._flipDone.handlers,tink_core_Noise.Noise); },10),$bind($_,$_.stop))); } })); } ,flipTo: function(page) { var _gthis = this; if(this.currentFlip == null) { this.setPage(page,null,function(values) { _gthis.animateTo(values); }); var ___val = this.currentFlip; if(___val == null) { return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_Noise.Noise)); } else { return ___val; } } else { this.setPage(page); return this.currentFlip; } } ,validatePage: function(number) { if(number < 2 - this.get_step()) { number = 2 - this.get_step(); } else if(number > this.pages.length - 1) { number = this.pages.length - 1; } if(this.get_doubleSided()) { number -= number & 1; } return number; } ,jumpTo: function(page,force) { if(force == null) { force = false; } var _gthis = this; this.setPage(page,force,tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { var _g = 0; var _g1 = _gthis.pages; while(_g < _g1.length) { var p = _g1[_g]; ++_g; p.justHide(); } var _g2 = 0; var _g11 = _gthis.getPages(_gthis.actualPage = _gthis.page); while(_g2 < _g11.length) { var p1 = _g11[_g2]; ++_g2; p1.justShow(); } })); } ,getPages: function(base) { base = this.validatePage(base); var ret = []; if(this.pages.length > 0) { ret.push(this.pages[base]); var _g = this.pages[base + 1]; var _g1 = this.get_doubleSided(); if(_g1 != false) { if(_g != null) { var v = _g; ret.push(v); } } } return ret; } ,activePages: function() { return this.getPages(this.page); } ,prev: function() { if(this.currentFlip == null) { return this.flipTo(this.page - this.get_step()); } else { return flipbook_Pagination.never; } } ,next: function() { if(this.currentFlip == null) { return this.flipTo(this.page + this.get_step()); } else { return flipbook_Pagination.never; } } ,get_step: function() { if(this.get_doubleSided()) { return 2; } else { return 1; } } ,get_doubleSided: function() { return this.doubleSided; } ,get_pageChanged: function() { return this.pageChanged; } ,get_length: function() { return this.pages.length; } ,iterator: function() { return HxOverrides.iter(this.pages); } ,__class__: flipbook_Pagination }; var flipbook_Zoom = function(zoomable,getStep) { this.scheduledRefresh = null; this.delayLOD = null; this.lastLOD = .0; this._ready = new tink_core_SignalTrigger(); this._viewportChanged = new tink_core_SignalTrigger(); this._changed = new tink_core_SignalTrigger(); this.changed = this._changed; this.viewportChanged = this._viewportChanged; this.ready = this._ready; this.zoomable = zoomable; this.book = _$Dom_QueryResult_$Impl_$.query(zoomable,".book")[0]; this.transform = tink_geom2__$Matrix_Matrix_$Impl_$.IDENTITY; this.bookResolutions = this.book.getAttribute("data-resolutions").split(",").map(Std.parseFloat); this.getStep = getStep; var this1; var this2 = new tink_core_MPair(parseFloat(this.book.style.width),parseFloat(this.book.style.height)); this1 = this2; this.bookSize = this1; this.viewportRect = { }; this.lastSaved = tink_geom2__$Matrix_Matrix_$Impl_$.IDENTITY; }; flipbook_Zoom.__name__ = ["flipbook","Zoom"]; flipbook_Zoom.prototype = { updateLevelOfDetail: function() { var _gthis = this; var setLOD = function() { var requiredWidth = tink_geom2__$Matrix_Matrix_$Impl_$.scale(_gthis.transform,_gthis.get_correctionFactor()).a * _gthis.bookSize.a * flipbook_Zoom.DEVICE_PIXEL_RATIO; var i = 0; while(_gthis.bookResolutions[i] < requiredWidth && i < _gthis.bookResolutions.length - 1) ++i; var _g = _gthis.book.getAttribute("data-lod"); var _g1 = Std.string(i + 1); var b = _g; var a = _g1; if(a != b) { var nu = _g1; _gthis.book.setAttribute("data-lod",nu); } }; var update = function() { _gthis.delayLOD = null; _gthis.lastLOD = new Date().getTime(); Dom.transform(_gthis.book,"none"); setLOD(); tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._ready.handlers,tink_core_Noise.Noise); }; var this1 = this.delayLOD; if(this1 != null) { this1.dissolve(); } var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { update(); },500),$bind($_,$_.stop))); this.delayLOD = this2; } ,checkBounds: function(m) { var correctionX = 0.0; var correctionY = 0.0; var factor = this.get_correctionFactor() * m.a; var widthPages = this.bookSize.a * this.get_step() * factor; var heightPages = this.bookSize.b * factor; var this1 = this.viewportRect; var xCorrection = Math.max((widthPages - (this1.right - this1.left)) / 2,0); var this2 = this.viewportRect; var yCorrection = Math.max((heightPages - (this2.bottom - this2.top)) / 2,0); if(Math.abs(m.tx) > xCorrection) { if(m.tx > 0) { correctionX = xCorrection - m.tx; } else { correctionX = Math.abs(m.tx) - xCorrection; } } if(Math.abs(m.ty) > yCorrection) { if(m.ty > 0) { correctionY = yCorrection - m.ty; } else { correctionY = Math.abs(m.ty) - yCorrection; } } if(correctionX != 0 || correctionY != 0) { var this3; var this4 = new tink_core_MPair(correctionX,correctionY); this3 = this4; return tink_geom2__$Matrix_Matrix_$Impl_$.move(m,this3); } else { return m; } } ,applyTransform: function(m,__tink_tmp140,momentumScroll) { if(momentumScroll == null) { momentumScroll = false; } var _gthis = this; if(__tink_tmp140 == null) { __tink_tmp140 = { }; } var animated = __tink_tmp140.animated == null ? false : __tink_tmp140.animated; var boundsCheck = __tink_tmp140.boundsCheck == null ? true : __tink_tmp140.boundsCheck; if(boundsCheck) { m = this.checkBounds(m); } else { m = m; } var last = this.transform.a; if(m.a * m.d == 0) { m = tink_geom2__$Matrix_Matrix_$Impl_$.IDENTITY; } this.transform = m; var update = function() { _gthis.scheduledRefresh = null; var effective = tink_geom2__$Matrix_Matrix_$Impl_$.rscale(_gthis.get_correctionFactor(),_gthis.transform); var this1; var this2 = new tink_core_MPair(0,0); this1 = this2; var topLeft = tink_geom2__$Matrix_Matrix_$Impl_$.transformPoint(effective,this1); var this3; var this4 = new tink_core_MPair(_gthis.bookSize.a,_gthis.bookSize.b); this3 = this4; var bottomRight = tink_geom2__$Matrix_Matrix_$Impl_$.transformPoint(effective,this3); var this5; var this6 = new tink_core_MPair(bottomRight.a - topLeft.a,bottomRight.b - topLeft.b); this5 = this6; var size = this5; effective = tink_geom2__$Matrix_Matrix_$Impl_$.scale(effective,Math.floor(size.a) / size.a); var this7 = _gthis.viewportRect; var this8 = _gthis.viewportRect; var this9; var this10 = new tink_core_MPair(-(this7.right - this7.left) / 2,-(this8.bottom - this8.top) / 2); this9 = this10; var zero = tink_geom2__$Matrix_Matrix_$Impl_$.transformPoint(effective,this9); var this11; var this12 = new tink_core_MPair(Math.round(zero.a) - zero.a,Math.round(zero.b) - zero.b); this11 = this12; var fractions = this11; effective = tink_geom2__$Matrix_Matrix_$Impl_$.move(effective,fractions); var this13 = _gthis.viewportRect; var f = (this13.right - this13.left) / 2; var this14 = _gthis.viewportRect; var f1 = (this14.bottom - this14.top) / 2; var this15; var this16 = new tink_core_MPair(f - Math.floor(f),f1 - Math.floor(f1)); this15 = this16; var p = this15; var this17; var this18 = new tink_core_MPair(-p.a,-p.b); this17 = this18; effective = tink_geom2__$Matrix_Matrix_$Impl_$.move(effective,this17); var this19 = _gthis.viewportRect; var this20 = _gthis.viewportRect; var this21; var this22 = new tink_core_MPair(Math.round((this19.right - this19.left) / 2 * effective.a),Math.round((this20.bottom - this20.top) / 2)); this21 = this22; effective = tink_geom2__$Matrix_Matrix_$Impl_$.move(effective,this21); Dom.transform(_gthis.zoomable,tink_geom2__$Matrix_Matrix_$Impl_$.toString(effective)); if(last != _gthis.transform.a) { tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._changed.handlers,_gthis.transform.a); } _gthis.updateLevelOfDetail(); }; if(momentumScroll) { if(!this.zoomable.classList.contains("momentum-scroll")) { this.zoomable.classList.add("momentum-scroll"); Dom.once(this.zoomable,"transitionend",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { _gthis.zoomable.classList.remove("momentum-scroll"); })); } } else if(animated) { if(!this.zoomable.classList.contains("animated")) { this.zoomable.classList.add("animated"); Dom.once(this.zoomable,"transitionend",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { _gthis.zoomable.classList.remove("animated"); })); } } else { this.zoomable.classList.remove("animated"); this.zoomable.classList.remove("momentum-scroll"); } var _g = this.zoomable.style.transform; if(_g == null) { update(); } else if(_g == "") { update(); } else if(this.scheduledRefresh == null) { Dom.transform(this.book,"scaleZ(.01)"); var this23 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { update(); },25),$bind($_,$_.stop))); this.scheduledRefresh = this23; } } ,setViewport: function(nu,args) { var b = this.viewportRect; if(nu.right == b.right && nu.bottom == b.bottom && nu.left == b.left && nu.top == b.top) { return; } var oldCorrention = this.get_correctionFactor(); var oldRect = this.viewportRect; if(isNaN(oldCorrention) || this.get_factor() < 1.01) { this.viewportRect = nu; this.applyTransform(this.transform,args); return; } this.viewportRect = nu; var scale = oldCorrention / this.get_correctionFactor(); this.transform = tink_geom2__$Matrix_Matrix_$Impl_$.rscale(scale,this.transform); this.enforceBounds(); tink_core__$Callback_CallbackList_$Impl_$.invoke(this._viewportChanged.handlers,tink_core_Noise.Noise); } ,enforceBounds: function(animated) { if(animated == null) { animated = false; } this.applyTransform(this.transform,{ animated : animated}); } ,panTo: function(__tink_tmp141) { if(__tink_tmp141 == null) { __tink_tmp141 = { }; } var x = __tink_tmp141.x == null ? flipbook_ZoomPosition.Center : __tink_tmp141.x; var y = __tink_tmp141.y == null ? flipbook_ZoomPosition.Center : __tink_tmp141.y; var animated = __tink_tmp141.animated == null ? true : __tink_tmp141.animated; var toCoord = function(pos) { switch(pos[1]) { case 0: return 10000000; case 1: return 0; case 2: return -10000000; } }; var this1 = { a : this.get_factor(), b : 0, c : 0, d : this.get_factor(), tx : toCoord(x), ty : toCoord(y)}; this.applyTransform(this1,{ animated : animated}); } ,scaleBy: function(factor,options) { if(options == null) { options = { }; } if(options.animated == null) { options.animated = false; } if(options.boundsCheck == null) { options.boundsCheck = true; } if(options.center == null) { var this1; var this2 = new tink_core_MPair(0,0); this1 = this2; options.center = this1; } var oldZoom = this.transform.a; var newZoom = oldZoom * factor; if(newZoom > this.get_maxFactor()) { factor = this.get_maxFactor() / oldZoom; } else if(newZoom < 1) { factor = 1 / oldZoom; } if(factor == 1) { return; } var tmp = this.transform; var p = options.center; var this3; var this4 = new tink_core_MPair(-p.a,-p.b); this3 = this4; this.applyTransform(tink_geom2__$Matrix_Matrix_$Impl_$.move(tink_geom2__$Matrix_Matrix_$Impl_$.scale(tink_geom2__$Matrix_Matrix_$Impl_$.move(tmp,this3),factor),options.center),options); } ,scaleTo: function(factor,options) { this.scaleBy(factor / this.get_factor(),options); } ,calcDefaultFactor: function() { return Math.max(2,1 / this.get_correctionFactor()); } ,toggle: function(center) { if(this.get_factor() < 1.01) { if(center == null) { if(this.lastSaved.a < 1.01) { var factor = this.calcDefaultFactor(); var this1 = { a : factor, b : 0, c : 0, d : factor, tx : 0, ty : 0}; this.lastSaved = this1; } this.applyTransform(this.lastSaved,{ animated : true}); } else if(!(this.lastSaved.a < 1.01)) { this.scaleTo(this.lastSaved.a,{ animated : true, center : center}); } else { this.scaleTo(this.calcDefaultFactor(),{ animated : true, center : center}); } } else { this.lastSaved = this.transform; this.scaleTo(1,{ animated : true}); } } ,get_changed: function() { return this.changed; } ,get_viewportChanged: function() { return this.viewportChanged; } ,get_step: function() { return this.getStep(); } ,get_correctionFactor: function() { var this1 = this.viewportRect; var this2 = this.viewportRect; return Math.min((this1.bottom - this1.top) / this.bookSize.b,(this2.right - this2.left) / (this.get_step() * this.bookSize.a)); } ,get_factor: function() { return this.transform.a; } ,get_maxFactor: function() { return this.bookResolutions[this.bookResolutions.length - 1] / this.bookSize.a / this.get_correctionFactor(); } ,__class__: flipbook_Zoom }; var flipbook_ZoomPosition = { __ename__ : true, __constructs__ : ["Start","Center","End"] }; flipbook_ZoomPosition.Start = ["Start",0]; flipbook_ZoomPosition.Start.toString = $estr; flipbook_ZoomPosition.Start.__enum__ = flipbook_ZoomPosition; flipbook_ZoomPosition.Center = ["Center",1]; flipbook_ZoomPosition.Center.toString = $estr; flipbook_ZoomPosition.Center.__enum__ = flipbook_ZoomPosition; flipbook_ZoomPosition.End = ["End",2]; flipbook_ZoomPosition.End.toString = $estr; flipbook_ZoomPosition.End.__enum__ = flipbook_ZoomPosition; var flipbook_data__$Rect_RectData = function(top,right,bottom,left) { this.top = top; this.bottom = bottom; this.left = left; this.right = right; }; flipbook_data__$Rect_RectData.__name__ = ["flipbook","data","_Rect","RectData"]; flipbook_data__$Rect_RectData.prototype = { __class__: flipbook_data__$Rect_RectData }; var flipbook_pagegrid_GridState = { __ename__ : true, __constructs__ : ["SinglePage","All","Empty","Subset"] }; flipbook_pagegrid_GridState.SinglePage = ["SinglePage",0]; flipbook_pagegrid_GridState.SinglePage.toString = $estr; flipbook_pagegrid_GridState.SinglePage.__enum__ = flipbook_pagegrid_GridState; flipbook_pagegrid_GridState.All = ["All",1]; flipbook_pagegrid_GridState.All.toString = $estr; flipbook_pagegrid_GridState.All.__enum__ = flipbook_pagegrid_GridState; flipbook_pagegrid_GridState.Empty = ["Empty",2]; flipbook_pagegrid_GridState.Empty.toString = $estr; flipbook_pagegrid_GridState.Empty.__enum__ = flipbook_pagegrid_GridState; flipbook_pagegrid_GridState.Subset = function(subset) { var $x = ["Subset",3,subset]; $x.__enum__ = flipbook_pagegrid_GridState; $x.toString = $estr; return $x; }; var flipbook_pagegrid_Grid = function(book) { this.totalHeight = 600.0; this.totalWidth = 800.0; this.paddingBottom = 100; this.paddingTop = 100; this.hSpacing = 50; this.vSpacing = 50; this.h = 200; this.w = 150; var _gthis = this; this._clicked = new tink_core_SignalTrigger(); this.book = book; this.view = _$Dom_QueryResult_$Impl_$.query(book.root,".page-grid")[0]; this.list = window.document.createElement("ol"); var this1 = new tink_state__$State_StateObject(flipbook_pagegrid_GridState.SinglePage,null); this._state = this1; this.clicked = this._clicked; this.view.style.transformOrigin = "0 0"; this.view.classList.add("hidden"); var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { var __tmp = []; var p = book.pagination.iterator(); while(p.hasNext()) { var p1 = p.next(); var _g = p1.target.querySelector(".page-thumb"); if(_g != null) { var v = _g; __tmp.push(new flipbook_pagegrid_Item(v.cloneNode(true))); } } _gthis.pages = __tmp; var _g1 = 0; var _g11 = _gthis.pages; while(_g1 < _g11.length) { var p2 = _g11[_g1]; ++_g1; _gthis.list.appendChild(p2.view); } _gthis.view.appendChild(_gthis.list); _$Dom_QueryResult_$Impl_$.on(".grid-item>button","click",_gthis.view,$bind(_gthis,_gthis.handleItemClick)); var style = window.getComputedStyle(_gthis.pages[0].view); _gthis.w = Std.parseInt(style.width); _gthis.h = Std.parseInt(style.height); book.zoom.get_viewportChanged().handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { var f = _gthis.get_state(); _gthis.setState(tink_state__$Observable_Observable_$Impl_$.get_value(f)); })); },500),$bind($_,$_.stop))); }; flipbook_pagegrid_Grid.__name__ = ["flipbook","pagegrid","Grid"]; flipbook_pagegrid_Grid.prototype = { handleItemClick: function(e) { var _this = this._clicked; var event = Std.parseInt(_$Dom_QueryResult_$Impl_$.query(e.at,".page-thumb")[0].getAttribute("data-pos")); tink_core__$Callback_CallbackList_$Impl_$.invoke(_this.handlers,event); } ,setState: function(next) { var _gthis = this; this.updateTotal(); var targetPage; var _g = this.book.pagination.page - 1; if(_g == -1) { targetPage = 0; } else { var v = _g; targetPage = v; } var showNext = function(f) { var showNext1; switch(next[1]) { case 1: showNext1 = _gthis.all(); break; case 3: var subset = next[2]; showNext1 = _gthis.only(subset); break; default: throw new js__$Boot_HaxeError("unreachable"); } f(targetPage,showNext1); }; var last = tink_state__$Observable_Observable_$Impl_$.get_value(this.get_state()); this._state.set(next); switch(last[1]) { case 0: switch(next[1]) { case 0: break; case 2: showNext($bind(this,this.enter)); break; default: showNext($bind(this,this.enter)); } break; case 2: switch(next[1]) { case 0: this.leave(targetPage); break; case 2: break; default: showNext($bind(this,this.fromEmpty)); } break; default: switch(next[1]) { case 0: this.leave(targetPage); break; case 2: this.empty(); break; default: showNext($bind(this,this.switchTo)); } } var _this = this.view.classList; var force = next == flipbook_pagegrid_GridState.Empty; if(force == null) { force = !_this.contains("empty"); } if(force) { _this.add("empty"); } else { _this.remove("empty"); } } ,empty: function() { } ,fromEmpty: function(currentPage,transforms) { this.changeTransforms(currentPage,transforms,function(_) { return false; }); } ,showAll: function() { this.setState(flipbook_pagegrid_GridState.All); } ,openPage: function(page) { this.book.pagination.jumpTo(page); this.setState(flipbook_pagegrid_GridState.SinglePage); } ,updateHeight: function(transforms) { this.list.style.height = transforms[transforms.length - 1].pos.b + this.h + this.paddingBottom + "px"; } ,changeTransforms: function(currentPage,transforms,inRange) { var _gthis = this; this.updateHeight(transforms); var pos = transforms[currentPage].pos; var offset = pos.b - 0.5 * (this.totalHeight - this.h); var old = this.view.scrollTop; this.view.scrollTop = offset | 0; var this1; var this2 = new tink_core_MPair(0,this.view.scrollTop - old); this1 = this2; var delta = this1; var left = []; Dom.abruptly(this.view,function() { var iterator_p = HxOverrides.iter(_gthis.pages); var iterator_t = HxOverrides.iter(transforms); while(iterator_t.hasNext() && iterator_p.hasNext()) { var p = iterator_p.next(); var t = iterator_t.next(); var a = p.pos; var this3; var this4 = new tink_core_MPair(a.a + delta.a,a.b + delta.b); this3 = this4; var shifted = this3; if(inRange(shifted) || inRange(t.pos)) { var p1 = p.pos = shifted; var this5 = { a : 1, b : 0, c : 0, d : 1, tx : p1.a, ty : p1.b}; Dom.transform(p.view,tink_geom2__$Matrix_Matrix_$Impl_$.toString(this5)); left.push(t); } else { t.apply(); } } }); var _g = 0; while(_g < left.length) { var t1 = left[_g]; ++_g; t1.apply(); } } ,switchTo: function(currentPage,transforms) { var min = this.view.scrollTop - this.h; var max = this.view.scrollTop + this.totalHeight; this.changeTransforms(currentPage,transforms,function(p) { if(p.b >= min) { return p.b <= max; } else { return false; } }); } ,leave: function(currentPage) { var _gthis = this; this.view.classList.remove("active"); var pos = this.pages[currentPage].pos; var offset = pos.b - 0.5 * (this.totalHeight - this.h); var positions = [pos]; if(this.get_doubleSided() && currentPage > 0) { if(currentPage % 2 == 0) { var a = positions[0]; var this1; var this2 = new tink_core_MPair(-this.w,0); this1 = this2; var b = this1; var this3; var this4 = new tink_core_MPair(a.a + b.a,a.b + b.b); this3 = this4; positions.push(this3); } else { var a1 = positions[0]; var this5; var this6 = new tink_core_MPair(this.w,0); this5 = this6; var b1 = this5; var this7; var this8 = new tink_core_MPair(a1.a + b1.a,a1.b + b1.b); this7 = this8; positions.unshift(this7); } } var this9; var this10 = new tink_core_MPair(0,0); this9 = this10; var center = this9; var _g = 0; while(_g < positions.length) { var p = positions[_g]; ++_g; var this11; var this12 = new tink_core_MPair(center.a + p.a,center.b + p.b); this11 = this12; center = this11; } var f = 1 / positions.length; var this13; var this14 = new tink_core_MPair(center.a * f,center.b * f); this13 = this14; center = this13; if(currentPage > 0 || !this.get_doubleSided()) { var this15; var this16 = new tink_core_MPair(this.w / 2,this.h / 2); this15 = this16; var b2 = this15; var this17; var this18 = new tink_core_MPair(center.a + b2.a,center.b + b2.b); this17 = this18; center = this17; } else { var this19; var this20 = new tink_core_MPair(0,this.h / 2); this19 = this20; var b3 = this19; var this21; var this22 = new tink_core_MPair(center.a + b3.a,center.b + b3.b); this21 = this22; center = this21; } var transform = this.calcTransform(center); var current = []; var tohide = []; var iterator_p = HxOverrides.iter(this.pages); var iterator_i_step; var iterator_i_offset; var iterator_i_max; var iterator_i_cur; iterator_i_step = 1; iterator_i_offset = 0; iterator_i_cur = 0; iterator_i_max = Math.ceil(this.pages.length / 1); while(iterator_i_cur < iterator_i_max && iterator_p.hasNext()) { var p1 = [iterator_p.next()]; var i = [iterator_i_offset + iterator_i_cur++ * iterator_i_step]; var isCurrent = i[0] == currentPage || this.get_doubleSided() && i[0] == currentPage - 1 + 2 * (currentPage % 2); if(isCurrent) { current.push(p1[0]); var this23 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay((function(i1,p2) { return function() { p2[0].update({ opacity : 1, pos : null}); var tmp1 = tink_geom2__$Matrix_Matrix_$Impl_$.rmove(positions[i1[0] % positions.length],transform); if(tmp1.tx < 0.001) { var this24 = { a : tmp1.a, b : tmp1.b, c : tmp1.c, d : tmp1.d, tx : 0, ty : tmp1.ty}; tmp1 = this24; } if(tmp1.ty < 0.001) { var this25 = { a : tmp1.a, b : tmp1.b, c : tmp1.c, d : tmp1.d, tx : tmp1.tx, ty : 0}; tmp1 = this25; } var tmp2 = tink_geom2__$Matrix_Matrix_$Impl_$.toString(tmp1) + " scaleZ(0.01)"; Dom.transform(p2[0].view,tmp2); }; })(i,p1),1),$bind($_,$_.stop))); } else { tohide.push(p1[0]); } } Dom.abruptly(this.view,function() { var _g1 = 0; while(_g1 < tohide.length) { var p3 = tohide[_g1]; ++_g1; p3.update({ opacity : 0, pos : null}); } }); var this26 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { Dom.abruptly(_gthis.book.viewport,function() { _gthis.book.viewport.classList.remove("nodisplay"); }); var _g2 = 0; while(_g2 < current.length) { var p4 = current[_g2]; ++_g2; p4.update({ opacity : 0, pos : null}); } var this27 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { if(!_gthis.view.classList.contains("active")) { _gthis.view.classList.add("hidden"); } },300),$bind($_,$_.stop))); },350),$bind($_,$_.stop))); } ,currentCenter: function() { var this1; var this2 = new tink_core_MPair(this.totalWidth / 2,this.view.scrollTop + this.totalHeight / 2); this1 = this2; return this1; } ,calcTransform: function(center) { var this1 = this.book.get_viewportRect(); var scale = (this1.bottom - this1.top) / this.h; var this2 = this.book.get_viewportRect(); var scale1 = Math.min(scale,(this2.right - this2.left) / this.w / (this.get_doubleSided() ? 2 : 1)); var this3; var this4 = new tink_core_MPair(-center.a,-center.b); this3 = this4; var ret = tink_geom2__$Matrix_Matrix_$Impl_$.invert(this.book.zoom.transform); var factor = 1 / scale1; var this5 = { a : factor, b : 0, c : 0, d : factor, tx : 0, ty : 0}; var ret1 = tink_geom2__$Matrix_Matrix_$Impl_$.move(tink_geom2__$Matrix_Matrix_$Impl_$.rmove(this3,tink_geom2__$Matrix_Matrix_$Impl_$.concat(ret,this5)),center); ret1 = tink_geom2__$Matrix_Matrix_$Impl_$.invert(ret1); var a = this.currentCenter(); var this6; var this7 = new tink_core_MPair(a.a - center.a,a.b - center.b); this6 = this7; return tink_geom2__$Matrix_Matrix_$Impl_$.move(ret1,this6); } ,enter: function(currentPage,transforms) { var _gthis = this; this.updateHeight(transforms); if(currentPage >= transforms.length) { currentPage = transforms.length - 1; } var pos = transforms[currentPage].pos; var offset = pos.b - 0.5 * (this.totalHeight - this.h); this.view.scrollTop = offset | 0; var positions = [pos]; if(this.get_doubleSided() && currentPage > 0) { if(currentPage % 2 == 0) { var a = positions[0]; var this1; var this2 = new tink_core_MPair(-this.w,0); this1 = this2; var b = this1; var this3; var this4 = new tink_core_MPair(a.a + b.a,a.b + b.b); this3 = this4; positions.push(this3); } else { var a1 = positions[0]; var this5; var this6 = new tink_core_MPair(this.w,0); this5 = this6; var b1 = this5; var this7; var this8 = new tink_core_MPair(a1.a + b1.a,a1.b + b1.b); this7 = this8; positions.unshift(this7); } } var this9; var this10 = new tink_core_MPair(0,0); this9 = this10; var center = this9; var _g = 0; while(_g < positions.length) { var p = positions[_g]; ++_g; var this11; var this12 = new tink_core_MPair(center.a + p.a,center.b + p.b); this11 = this12; center = this11; } var f = 1 / positions.length; var this13; var this14 = new tink_core_MPair(center.a * f,center.b * f); this13 = this14; center = this13; if(currentPage > 0 || !this.get_doubleSided()) { var this15; var this16 = new tink_core_MPair(this.w / 2,this.h / 2); this15 = this16; var b2 = this15; var this17; var this18 = new tink_core_MPair(center.a + b2.a,center.b + b2.b); this17 = this18; center = this17; } else { var this19; var this20 = new tink_core_MPair(0,this.h / 2); this19 = this20; var b3 = this19; var this21; var this22 = new tink_core_MPair(center.a + b3.a,center.b + b3.b); this21 = this22; center = this21; } var transform = this.calcTransform(center); var min = this.view.scrollTop - this.h; var max = this.view.scrollTop + this.totalHeight; var current = []; var voisinage = []; Dom.abruptly(this.view,function() { _gthis.view.classList.remove("hidden"); var iterator_p = HxOverrides.iter(_gthis.pages); var iterator_i_step; var iterator_i_offset; var iterator_i_max; var iterator_i_cur; iterator_i_step = 1; iterator_i_offset = 0; iterator_i_cur = 0; iterator_i_max = Math.ceil(_gthis.pages.length / 1); var iterator_t = HxOverrides.iter(transforms); while(iterator_t.hasNext() && (iterator_i_cur < iterator_i_max && iterator_p.hasNext())) { var p1 = iterator_p.next(); var i = iterator_i_offset + iterator_i_cur++ * iterator_i_step; var t = iterator_t.next(); if(t.pos.b < min || t.pos.b > max) { t.apply(); } else { Dom.transform(p1.view,tink_geom2__$Matrix_Matrix_$Impl_$.toString(tink_geom2__$Matrix_Matrix_$Impl_$.rmove(positions[i % positions.length],transform)) + " scaleZ(0.01)"); var isCurrent = i == currentPage || _gthis.get_doubleSided() && i == currentPage - 1 + 2 * (currentPage % 2); p1.view.style.opacity = isCurrent ? "1.0" : "0.0"; (isCurrent ? current : voisinage).push(t); } } }); this.view.classList.add("active"); Dom.abruptly(this.book.viewport,function() { _gthis.book.viewport.classList.add("nodisplay"); }); var _g1 = 0; while(_g1 < current.length) { var t1 = current[_g1]; ++_g1; t1.apply(); } if(current.length == 0) { var _g11 = 0; var _g2 = this.book.pagination.get_step(); while(_g11 < _g2) { var i1 = _g11++; var tmp = voisinage.pop(); current.push(tmp); } } var iterator_t1 = HxOverrides.iter(voisinage); var iterator_i_step1; var iterator_i_offset1; var iterator_i_max1; var iterator_i_cur1; iterator_i_step1 = 1; iterator_i_offset1 = 0; iterator_i_cur1 = 0; iterator_i_max1 = Math.ceil(voisinage.length / 1); while(iterator_i_cur1 < iterator_i_max1 && iterator_t1.hasNext()) { var t2 = [iterator_t1.next()]; var i2 = iterator_i_offset1 + iterator_i_cur1++ * iterator_i_step1; t2[0].target.update({ opacity : 0.0, pos : current[i2 % current.length].pos}); var this23 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay((function(t3) { return function() { t3[0].apply(); }; })(t2),(.15 + .25 * i2 / voisinage.length) * 1000 | 0),$bind($_,$_.stop))); } } ,only: function(subset) { var _gthis = this; var y = this.paddingTop; var x = this.get_doubleSided() ? this.totalWidth / 2 : this.totalWidth / 4; var __tmp = []; var iterator_p = HxOverrides.iter(this.pages); var iterator_i_step; var iterator_i_offset; var iterator_i_max; var iterator_i_cur; iterator_i_step = 1; iterator_i_offset = 0; iterator_i_cur = 0; iterator_i_max = Math.ceil(this.pages.length / 1); while(iterator_i_cur < iterator_i_max && iterator_p.hasNext()) { var p = iterator_p.next(); var i = iterator_i_offset + iterator_i_cur++ * iterator_i_step; var _g = subset.h[i]; if(_g == null) { var this1; var this2 = new tink_core_MPair(x,y - (this.h + this.vSpacing)); this1 = this2; __tmp.push(new flipbook_pagegrid_Transform(p,this1,.0)); } else { var v = _g; if(this.get_doubleSided()) { var this3; var this4 = new tink_core_MPair(x - i % 2 * this.w,y); this3 = this4; var t = new flipbook_pagegrid_Transform(p,this3,null,v); if(i % 2 == 0 || !subset.h.hasOwnProperty(i + 1)) { y += _gthis.h + _gthis.vSpacing; } __tmp.push(t); } else { var this5; var this6 = new tink_core_MPair(x,y); this5 = this6; var t1 = new flipbook_pagegrid_Transform(p,this5,null,v); y += _gthis.h + _gthis.vSpacing; __tmp.push(t1); } } } return __tmp; } ,updateTotal: function() { var rect = this.view.getBoundingClientRect(); this.totalWidth = rect.width; this.totalHeight = rect.height; } ,all: function() { var _gthis = this; var chunkWidth = this.hSpacing + (this.get_doubleSided() ? 2 * this.w : this.w); var offset = (this.totalWidth % chunkWidth + this.hSpacing) / 2; var x = offset; var y = this.paddingTop; if(this.get_doubleSided()) { var __tmp = []; var iterator_p = HxOverrides.iter(this.pages); var iterator_i_step; var iterator_i_offset; var iterator_i_max; var iterator_i_cur; iterator_i_step = 1; iterator_i_offset = 0; iterator_i_cur = 0; iterator_i_max = Math.ceil(this.pages.length / 1); while(iterator_i_cur < iterator_i_max && iterator_p.hasNext()) { var p = iterator_p.next(); var i = iterator_i_offset + iterator_i_cur++ * iterator_i_step; if(i % 2 == 1) { var this1; var this2 = new tink_core_MPair(x,y); this1 = this2; __tmp.push(new flipbook_pagegrid_Transform(p,this1)); } else { var this3; var this4 = new tink_core_MPair(x + this.w,y); this3 = this4; var t = new flipbook_pagegrid_Transform(p,this3); x += chunkWidth; if(x + chunkWidth > _gthis.totalWidth + _gthis.hSpacing) { x = offset; y += _gthis.h + _gthis.vSpacing; } __tmp.push(t); } } return __tmp; } else { var __tmp1 = []; var _g = 0; var _g1 = this.pages; while(_g < _g1.length) { var p1 = _g1[_g]; ++_g; var this5; var this6 = new tink_core_MPair(x,y); this5 = this6; var t1 = new flipbook_pagegrid_Transform(p1,this5); x += chunkWidth; if(x + chunkWidth > _gthis.totalWidth + _gthis.hSpacing) { x = offset; y += _gthis.h + _gthis.vSpacing; } __tmp1.push(t1); } return __tmp1; } } ,get_state: function() { return this._state; } ,get_clicked: function() { return this.clicked; } ,get_doubleSided: function() { return this.book.pagination.get_doubleSided(); } ,__class__: flipbook_pagegrid_Grid }; var flipbook_pagegrid_Item = function(thumb) { this.view = window.document.createElement("li"); var this1; var this2 = new tink_core_MPair(0,0); this1 = this2; this.pos = this1; var div = window.document.createElement("div"); div.className = "details"; this.detailsView = div; this.view.className = "grid-item"; var button = window.document.createElement("button"); button.className = "grid-item__button button-resetted"; button.appendChild(thumb); this.view.appendChild(button); }; flipbook_pagegrid_Item.__name__ = ["flipbook","pagegrid","Item"]; flipbook_pagegrid_Item.prototype = { update: function(__tink_tmp145) { var pos = __tink_tmp145.pos; var details = __tink_tmp145.details == null ? tink_template__$Html_Html_$Impl_$.escape("") : __tink_tmp145.details; var opacity = __tink_tmp145.opacity == null ? 1.0 : __tink_tmp145.opacity; if(pos != null) { var p = this.pos = pos; var this1 = { a : 1, b : 0, c : 0, d : 1, tx : p.a, ty : p.b}; this.view.style.transform = tink_geom2__$Matrix_Matrix_$Impl_$.toString(this1); } if(this.view.style.opacity != (opacity == null ? "null" : "" + opacity)) { this.view.style.opacity = opacity == null ? "null" : "" + opacity; } var zIndex = opacity == 0 ? "0" : "1"; if(zIndex != this.view.style.zIndex) { if(zIndex == null) { this.view.style.removeProperty("z-index"); } else { this.view.style.setProperty("z-index",zIndex); } } var _g = this.details = details; if(_g == "") { this.detailsView.classList.remove("active"); } else { this.detailsView.innerHTML = details; this.detailsView.classList.add("active"); } } ,__class__: flipbook_pagegrid_Item }; var flipbook_pagegrid_Transform = function(target,pos,opacity,details) { if(opacity == null) { opacity = 1.0; } this.target = target; this.pos = pos; this.opacity = opacity; this.details = details; }; flipbook_pagegrid_Transform.__name__ = ["flipbook","pagegrid","Transform"]; flipbook_pagegrid_Transform.prototype = { apply: function(target) { if(target == null) { target = this.target; } target.update(this); } ,__class__: flipbook_pagegrid_Transform }; var haxe_StackItem = { __ename__ : true, __constructs__ : ["CFunction","Module","FilePos","Method","LocalFunction"] }; haxe_StackItem.CFunction = ["CFunction",0]; haxe_StackItem.CFunction.toString = $estr; haxe_StackItem.CFunction.__enum__ = haxe_StackItem; haxe_StackItem.Module = function(m) { var $x = ["Module",1,m]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; }; haxe_StackItem.FilePos = function(s,file,line) { var $x = ["FilePos",2,s,file,line]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; }; haxe_StackItem.Method = function(classname,method) { var $x = ["Method",3,classname,method]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; }; haxe_StackItem.LocalFunction = function(v) { var $x = ["LocalFunction",4,v]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; }; var haxe_IMap = function() { }; haxe_IMap.__name__ = ["haxe","IMap"]; haxe_IMap.prototype = { __class__: haxe_IMap }; var haxe_Timer = function(time_ms) { var me = this; this.id = setInterval(function() { me.run(); },time_ms); }; haxe_Timer.__name__ = ["haxe","Timer"]; haxe_Timer.delay = function(f,time_ms) { var t = new haxe_Timer(time_ms); t.run = function() { t.stop(); f(); }; return t; }; haxe_Timer.prototype = { stop: function() { if(this.id == null) { return; } clearInterval(this.id); this.id = null; } ,run: function() { } ,__class__: haxe_Timer }; var haxe_ds_IntMap = function() { this.h = { }; }; haxe_ds_IntMap.__name__ = ["haxe","ds","IntMap"]; haxe_ds_IntMap.__interfaces__ = [haxe_IMap]; haxe_ds_IntMap.prototype = { set: function(key,value) { this.h[key] = value; } ,get: function(key) { return this.h[key]; } ,remove: function(key) { if(!this.h.hasOwnProperty(key)) { return false; } delete(this.h[key]); return true; } ,keys: function() { var a = []; for( var key in this.h ) if(this.h.hasOwnProperty(key)) { a.push(key | 0); } return HxOverrides.iter(a); } ,iterator: function() { return { ref : this.h, it : this.keys(), hasNext : function() { return this.it.hasNext(); }, next : function() { var i = this.it.next(); return this.ref[i]; }}; } ,__class__: haxe_ds_IntMap }; var haxe_ds_ObjectMap = function() { this.h = { __keys__ : { }}; }; haxe_ds_ObjectMap.__name__ = ["haxe","ds","ObjectMap"]; haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap]; haxe_ds_ObjectMap.prototype = { set: function(key,value) { var id = key.__id__ || (key.__id__ = ++haxe_ds_ObjectMap.count); this.h[id] = value; this.h.__keys__[id] = key; } ,get: function(key) { return this.h[key.__id__]; } ,keys: function() { var a = []; for( var key in this.h.__keys__ ) { if(this.h.hasOwnProperty(key)) { a.push(this.h.__keys__[key]); } } return HxOverrides.iter(a); } ,iterator: function() { return { ref : this.h, it : this.keys(), hasNext : function() { return this.it.hasNext(); }, next : function() { var i = this.it.next(); return this.ref[i.__id__]; }}; } ,__class__: haxe_ds_ObjectMap }; var haxe_ds__$StringMap_StringMapIterator = function(map,keys) { this.map = map; this.keys = keys; this.index = 0; this.count = keys.length; }; haxe_ds__$StringMap_StringMapIterator.__name__ = ["haxe","ds","_StringMap","StringMapIterator"]; haxe_ds__$StringMap_StringMapIterator.prototype = { hasNext: function() { return this.index < this.count; } ,next: function() { var _this = this.map; var key = this.keys[this.index++]; if(__map_reserved[key] != null) { return _this.getReserved(key); } else { return _this.h[key]; } } ,__class__: haxe_ds__$StringMap_StringMapIterator }; var haxe_ds_StringMap = function() { this.h = { }; }; haxe_ds_StringMap.__name__ = ["haxe","ds","StringMap"]; haxe_ds_StringMap.__interfaces__ = [haxe_IMap]; haxe_ds_StringMap.prototype = { set: function(key,value) { if(__map_reserved[key] != null) { this.setReserved(key,value); } else { this.h[key] = value; } } ,get: function(key) { if(__map_reserved[key] != null) { return this.getReserved(key); } return this.h[key]; } ,setReserved: function(key,value) { if(this.rh == null) { this.rh = { }; } this.rh["$" + key] = value; } ,getReserved: function(key) { if(this.rh == null) { return null; } else { return this.rh["$" + key]; } } ,existsReserved: function(key) { if(this.rh == null) { return false; } return this.rh.hasOwnProperty("$" + key); } ,remove: function(key) { if(__map_reserved[key] != null) { key = "$" + key; if(this.rh == null || !this.rh.hasOwnProperty(key)) { return false; } delete(this.rh[key]); return true; } else { if(!this.h.hasOwnProperty(key)) { return false; } delete(this.h[key]); return true; } } ,keys: function() { return HxOverrides.iter(this.arrayKeys()); } ,arrayKeys: function() { var out = []; for( var key in this.h ) { if(this.h.hasOwnProperty(key)) { out.push(key); } } if(this.rh != null) { for( var key in this.rh ) { if(key.charCodeAt(0) == 36) { out.push(key.substr(1)); } } } return out; } ,__class__: haxe_ds_StringMap }; var haxe_io_Eof = function() { }; haxe_io_Eof.__name__ = ["haxe","io","Eof"]; haxe_io_Eof.prototype = { toString: function() { return "Eof"; } ,__class__: haxe_io_Eof }; var haxe_xml_XmlParserException = function(message,xml,position) { this.xml = xml; this.message = message; this.position = position; this.lineNumber = 1; this.positionAtLine = 0; var _g1 = 0; var _g = position; while(_g1 < _g) { var i = _g1++; var c = xml.charCodeAt(i); if(c == 10) { this.lineNumber++; this.positionAtLine = 0; } else if(c != 13) { this.positionAtLine++; } } }; haxe_xml_XmlParserException.__name__ = ["haxe","xml","XmlParserException"]; haxe_xml_XmlParserException.prototype = { toString: function() { return Type.getClassName(js_Boot.getClass(this)) + ": " + this.message + " at line " + this.lineNumber + " char " + this.positionAtLine; } ,__class__: haxe_xml_XmlParserException }; var haxe_xml_Parser = function() { }; haxe_xml_Parser.__name__ = ["haxe","xml","Parser"]; haxe_xml_Parser.parse = function(str,strict) { if(strict == null) { strict = false; } var doc = Xml.createDocument(); haxe_xml_Parser.doParse(str,strict,0,doc); return doc; }; haxe_xml_Parser.doParse = function(str,strict,p,parent) { if(p == null) { p = 0; } var xml = null; var state = 1; var next = 1; var aname = null; var start = 0; var nsubs = 0; var nbrackets = 0; var c = str.charCodeAt(p); var buf = new StringBuf(); var escapeNext = 1; var attrValQuote = -1; while(c == c) { switch(state) { case 0: switch(c) { case 9:case 10:case 13:case 32: break; default: state = next; continue; } break; case 1: if(c == 60) { state = 0; next = 2; } else { start = p; state = 13; continue; } break; case 2: switch(c) { case 33: if(str.charCodeAt(p + 1) == 91) { p += 2; if(HxOverrides.substr(str,p,6).toUpperCase() != "CDATA[") { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected = 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) { if(p == start) { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected node name",str,p)); } xml = Xml.createElement(HxOverrides.substr(str,start,p - start)); parent.addChild(xml); ++nsubs; state = 0; next = 4; continue; } break; case 4: switch(c) { case 47: state = 11; break; case 62: state = 9; break; default: state = 5; start = p; continue; } break; case 5: if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) { var tmp; if(start == p) { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected attribute name",str,p)); } tmp = HxOverrides.substr(str,start,p - start); aname = tmp; if(xml.exists(aname)) { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Duplicate attribute [" + aname + "]",str,p)); } state = 0; next = 6; continue; } break; case 6: if(c == 61) { state = 0; next = 7; } else { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected =",str,p)); } break; case 7: switch(c) { case 34:case 39: buf = new StringBuf(); state = 8; start = p + 1; attrValQuote = c; break; default: throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected \"",str,p)); } break; case 8: switch(c) { case 38: var len = p - start; buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len); state = 18; escapeNext = 8; start = p + 1; break; case 60:case 62: if(strict) { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Invalid unescaped " + String.fromCharCode(c) + " in attribute value",str,p)); } else if(c == attrValQuote) { var len1 = p - start; buf.b += len1 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len1); var val = buf.b; buf = new StringBuf(); xml.set(aname,val); state = 0; next = 4; } break; default: if(c == attrValQuote) { var len2 = p - start; buf.b += len2 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len2); var val1 = buf.b; buf = new StringBuf(); xml.set(aname,val1); state = 0; next = 4; } } break; case 9: p = haxe_xml_Parser.doParse(str,strict,p,xml); start = p; state = 1; break; case 10: if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) { if(start == p) { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected node name",str,p)); } var v = HxOverrides.substr(str,start,p - start); if(parent.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + parent.nodeType); } if(v != parent.nodeName) { if(parent.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + parent.nodeType); } throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected ",str,p)); } state = 0; next = 12; continue; } break; case 11: if(c == 62) { state = 1; } else { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected >",str,p)); } break; case 12: if(c == 62) { if(nsubs == 0) { parent.addChild(Xml.createPCData("")); } return p; } else { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected >",str,p)); } break; case 13: if(c == 60) { var len3 = p - start; buf.b += len3 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len3); var child = Xml.createPCData(buf.b); buf = new StringBuf(); parent.addChild(child); ++nsubs; state = 0; next = 2; } else if(c == 38) { var len4 = p - start; buf.b += len4 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len4); state = 18; escapeNext = 13; start = p + 1; } break; case 14: if(c == 63 && str.charCodeAt(p + 1) == 62) { ++p; var str1 = HxOverrides.substr(str,start + 1,p - start - 2); parent.addChild(Xml.createProcessingInstruction(str1)); ++nsubs; state = 1; } break; case 15: if(c == 45 && str.charCodeAt(p + 1) == 45 && str.charCodeAt(p + 2) == 62) { parent.addChild(Xml.createComment(HxOverrides.substr(str,start,p - start))); ++nsubs; p += 2; state = 1; } break; case 16: if(c == 91) { ++nbrackets; } else if(c == 93) { --nbrackets; } else if(c == 62 && nbrackets == 0) { parent.addChild(Xml.createDocType(HxOverrides.substr(str,start,p - start))); ++nsubs; state = 1; } break; case 17: if(c == 93 && str.charCodeAt(p + 1) == 93 && str.charCodeAt(p + 2) == 62) { var child1 = Xml.createCData(HxOverrides.substr(str,start,p - start)); parent.addChild(child1); ++nsubs; p += 2; state = 1; } break; case 18: if(c == 59) { var s = HxOverrides.substr(str,start,p - start); if(s.charCodeAt(0) == 35) { var c1 = s.charCodeAt(1) == 120 ? Std.parseInt("0" + HxOverrides.substr(s,1,s.length - 1)) : Std.parseInt(HxOverrides.substr(s,1,s.length - 1)); buf.b += String.fromCharCode(c1); } else { var _this = haxe_xml_Parser.escapes; if(!(__map_reserved[s] != null ? _this.existsReserved(s) : _this.h.hasOwnProperty(s))) { if(strict) { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Undefined entity: " + s,str,p)); } buf.b += Std.string("&" + s + ";"); } else { var _this1 = haxe_xml_Parser.escapes; var x = __map_reserved[s] != null ? _this1.getReserved(s) : _this1.h[s]; buf.b += Std.string(x); } } start = p + 1; state = escapeNext; } else if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45) && c != 35) { if(strict) { throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Invalid character in entity: " + String.fromCharCode(c),str,p)); } buf.b += "&"; var len5 = p - start; buf.b += len5 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len5); start = p--; state = escapeNext; } break; } c = str.charCodeAt(++p); } if(state == 1) { start = p; state = 13; } if(state == 13) { if(p != start || nsubs == 0) { var len6 = p - start; buf.b += len6 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len6); parent.addChild(Xml.createPCData(buf.b)); ++nsubs; } return p; } if(!strict && state == 18 && escapeNext == 13) { buf.b += "&"; var len7 = p - start; buf.b += len7 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len7); parent.addChild(Xml.createPCData(buf.b)); ++nsubs; return p; } throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Unexpected end",str,p)); }; var haxe_xml_Printer = function(pretty) { this.output = new StringBuf(); this.pretty = pretty; }; haxe_xml_Printer.__name__ = ["haxe","xml","Printer"]; haxe_xml_Printer.print = function(xml,pretty) { if(pretty == null) { pretty = false; } var printer = new haxe_xml_Printer(pretty); printer.writeNode(xml,""); return printer.output.b; }; haxe_xml_Printer.prototype = { writeNode: function(value,tabs) { var _g = value.nodeType; switch(_g) { case 0: this.output.b += Std.string(tabs + "<"); if(value.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + value.nodeType); } this.output.b += Std.string(value.nodeName); var attribute = value.attributes(); while(attribute.hasNext()) { var attribute1 = attribute.next(); this.output.b += Std.string(" " + attribute1 + "=\""); var input = StringTools.htmlEscape(value.get(attribute1),true); this.output.b += Std.string(input); this.output.b += "\""; } if(this.hasChildren(value)) { this.output.b += ">"; if(this.pretty) { this.output.b += "\n"; } if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + value.nodeType); } var child = HxOverrides.iter(value.children); while(child.hasNext()) { var child1 = child.next(); this.writeNode(child1,this.pretty ? tabs + "\t" : tabs); } this.output.b += Std.string(tabs + ""; if(this.pretty) { this.output.b += "\n"; } } else { this.output.b += "/>"; if(this.pretty) { this.output.b += "\n"; } } break; case 1: if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + value.nodeType); } var nodeValue = value.nodeValue; if(nodeValue.length != 0) { var input1 = tabs + StringTools.htmlEscape(nodeValue); this.output.b += Std.string(input1); if(this.pretty) { this.output.b += "\n"; } } break; case 2: this.output.b += Std.string(tabs + ""; if(this.pretty) { this.output.b += "\n"; } break; case 3: if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + value.nodeType); } var commentContent = value.nodeValue; var _this_r = new RegExp("[\n\r\t]+","g".split("u").join("")); commentContent = commentContent.replace(_this_r,""); commentContent = ""; this.output.b += tabs == null ? "null" : "" + tabs; var input3 = StringTools.trim(commentContent); this.output.b += Std.string(input3); if(this.pretty) { this.output.b += "\n"; } break; case 4: if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + value.nodeType); } this.output.b += Std.string(""); if(this.pretty) { this.output.b += "\n"; } break; case 5: if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + value.nodeType); } this.output.b += Std.string(""); if(this.pretty) { this.output.b += "\n"; } break; case 6: if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + value.nodeType); } var child2 = HxOverrides.iter(value.children); while(child2.hasNext()) { var child3 = child2.next(); this.writeNode(child3,tabs); } break; } } ,hasChildren: function(value) { if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + value.nodeType); } var child = HxOverrides.iter(value.children); while(child.hasNext()) { var child1 = child.next(); var _g = child1.nodeType; switch(_g) { case 0:case 1: return true; case 2:case 3: if(child1.nodeType == Xml.Document || child1.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + child1.nodeType); } if(StringTools.ltrim(child1.nodeValue).length != 0) { return true; } break; default: } } return false; } ,__class__: haxe_xml_Printer }; var js__$Boot_HaxeError = function(val) { Error.call(this); this.val = val; this.message = String(val); if(Error.captureStackTrace) { Error.captureStackTrace(this,js__$Boot_HaxeError); } }; js__$Boot_HaxeError.__name__ = ["js","_Boot","HaxeError"]; js__$Boot_HaxeError.wrap = function(val) { if((val instanceof Error)) { return val; } else { return new js__$Boot_HaxeError(val); } }; js__$Boot_HaxeError.__super__ = Error; js__$Boot_HaxeError.prototype = $extend(Error.prototype,{ __class__: js__$Boot_HaxeError }); var js_Boot = function() { }; js_Boot.__name__ = ["js","Boot"]; js_Boot.getClass = function(o) { if((o instanceof Array) && o.__enum__ == null) { return Array; } else { var cl = o.__class__; if(cl != null) { return cl; } var name = js_Boot.__nativeClassName(o); if(name != null) { return js_Boot.__resolveNativeClass(name); } return null; } }; js_Boot.__string_rec = function(o,s) { if(o == null) { return "null"; } if(s.length >= 5) { return "<...>"; } var t = typeof(o); if(t == "function" && (o.__name__ || o.__ename__)) { t = "object"; } switch(t) { case "function": return ""; case "object": if(o instanceof Array) { if(o.__enum__) { if(o.length == 2) { return o[0]; } var str = o[0] + "("; s += "\t"; var _g1 = 2; var _g = o.length; while(_g1 < _g) { var i = _g1++; if(i != 2) { str += "," + js_Boot.__string_rec(o[i],s); } else { str += js_Boot.__string_rec(o[i],s); } } return str + ")"; } var l = o.length; var i1; var str1 = "["; s += "\t"; var _g11 = 0; var _g2 = l; while(_g11 < _g2) { var i2 = _g11++; str1 += (i2 > 0 ? "," : "") + js_Boot.__string_rec(o[i2],s); } str1 += "]"; return str1; } var tostr; try { tostr = o.toString; } catch( e ) { return "???"; } if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") { var s2 = o.toString(); if(s2 != "[object Object]") { return s2; } } var k = null; var str2 = "{\n"; s += "\t"; var hasp = o.hasOwnProperty != null; for( var k in o ) { if(hasp && !o.hasOwnProperty(k)) { continue; } if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") { continue; } if(str2.length != 2) { str2 += ", \n"; } str2 += s + k + " : " + js_Boot.__string_rec(o[k],s); } s = s.substring(1); str2 += "\n" + s + "}"; return str2; case "string": return o; default: return String(o); } }; js_Boot.__interfLoop = function(cc,cl) { if(cc == null) { return false; } if(cc == cl) { return true; } var intf = cc.__interfaces__; if(intf != null) { var _g1 = 0; var _g = intf.length; while(_g1 < _g) { var i = _g1++; var i1 = intf[i]; if(i1 == cl || js_Boot.__interfLoop(i1,cl)) { return true; } } } return js_Boot.__interfLoop(cc.__super__,cl); }; js_Boot.__instanceof = function(o,cl) { if(cl == null) { return false; } switch(cl) { case Array: if((o instanceof Array)) { return o.__enum__ == null; } else { return false; } break; case Bool: return typeof(o) == "boolean"; case Dynamic: return true; case Float: return typeof(o) == "number"; case Int: if(typeof(o) == "number") { return (o|0) === o; } else { return false; } break; case String: return typeof(o) == "string"; default: if(o != null) { if(typeof(cl) == "function") { if(o instanceof cl) { return true; } if(js_Boot.__interfLoop(js_Boot.getClass(o),cl)) { return true; } } else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) { if(o instanceof cl) { return true; } } } else { return false; } if(cl == Class ? o.__name__ != null : false) { return true; } if(cl == Enum ? o.__ename__ != null : false) { return true; } return o.__enum__ == cl; } }; js_Boot.__cast = function(o,t) { if(js_Boot.__instanceof(o,t)) { return o; } else { throw new js__$Boot_HaxeError("Cannot cast " + Std.string(o) + " to " + Std.string(t)); } }; js_Boot.__nativeClassName = function(o) { var name = js_Boot.__toStr.call(o).slice(8,-1); if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") { return null; } return name; }; js_Boot.__isNativeObj = function(o) { return js_Boot.__nativeClassName(o) != null; }; js_Boot.__resolveNativeClass = function(name) { return $global[name]; }; var js_Cookie = function() { }; js_Cookie.__name__ = ["js","Cookie"]; js_Cookie.set = function(name,value,expireDelay,path,domain) { var s = name + "=" + encodeURIComponent(value); if(expireDelay != null) { var t = new Date().getTime() + expireDelay * 1000; var d = new Date(t); s += ";expires=" + d.toGMTString(); } if(path != null) { s += ";path=" + path; } if(domain != null) { s += ";domain=" + domain; } window.document.cookie = s; }; var scroller_Scroller = function(target) { this.target = target; this.scrollContainer = target.querySelector(".scroll-container"); this.scrollBox = target.querySelector(".scroll-box"); this.scrollContent = target.querySelector(".scroll-content"); this.virtualScrollBar = target.querySelector(".virtual-scollbar"); window.requestAnimationFrame($bind(this,this.evaluateScrolling)); }; scroller_Scroller.__name__ = ["scroller","Scroller"]; scroller_Scroller.prototype = { evaluateScrolling: function(timestamp) { var _gthis = this; if(!window.document.body.contains(this.scrollContainer)) { return; } this.containerStyle = window.getComputedStyle(this.scrollContainer); this.containerInvisible = this.scrollContainer.offsetParent == null || this.containerStyle.opacity == "0" || this.containerStyle.visibility == "hidden"; if(this.containerInvisible) { var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { window.requestAnimationFrame($bind(_gthis,_gthis.evaluateScrolling)); return; },200),$bind($_,$_.stop))); } else { var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { window.requestAnimationFrame($bind(_gthis,_gthis.evaluateScrolling)); },10),$bind($_,$_.stop))); } this.scrollBoxWidth = this.scrollBox.getBoundingClientRect().width; this.scrollContentWidth = this.scrollContent.getBoundingClientRect().width; this.scrollContainerWidth = this.scrollContainer.getBoundingClientRect().width; this.scrollContainerHeight = this.scrollContainer.getBoundingClientRect().height; this.scrollContentHeight = this.scrollContent.getBoundingClientRect().height; this.scrollBarWidth = this.scrollBoxWidth - this.scrollContentWidth; if(this.scrollBarWidth > 0) { if(this.scrollContentWidth < this.scrollContainerWidth) { this.scrollBox.setAttribute("style","width: calc(100% + " + this.scrollBarWidth + "px);"); } } else if(this.scrollBox.hasAttribute("style")) { this.scrollBox.removeAttribute("style"); } this.handleRatio = this.scrollContainerHeight / this.scrollContentHeight; if(this.handleRatio > 1) { this.handleRatio = 1; } if(this.handleRatio < 1) { if(!this.scrollContainer.hasAttribute("data-scrollable")) { this.scrollContainer.setAttribute("data-scrollable",""); } } else if(this.scrollContainer.hasAttribute("data-scrollable")) { this.scrollContainer.removeAttribute("data-scrollable"); } this.handleOffsetY = this.scrollBox.scrollTop / this.scrollBox.scrollHeight * this.scrollContainerHeight / this.handleRatio; this.virtualScrollBar.style.transform = "scaleY(" + this.handleRatio + ") translateY(" + this.handleOffsetY + "px)"; } ,__class__: scroller_Scroller }; var slider_Slider = function(target,thumb,past,future,track,data,edit) { var _gthis = this; if(thumb == null) { thumb = slider_Slider.grab(target,"thumb"); } if(past == null) { past = slider_Slider.grab(target,"past"); } if(future == null) { future = slider_Slider.grab(target,"future"); } if(track == null) { track = slider_Slider.grab(target,"track"); } this.target = target; this.thumb = thumb; this.past = past; this.future = future; this.track = track; this.data = data; this.edit = edit; this.lastValue = NaN; tink_state__$Observable_Observable_$Impl_$.bind(data,null,$bind(this,this.updateView)); this.setUpInput({ start : "mousedown", change : "mousemove", end : "mouseup", getPos : function(e) { if(_gthis.get_vertical()) { return e.clientY; } else { return e.clientX; } }}); this.setUpInput({ start : "touchstart", change : "touchmove", end : "touchend", getPos : function(e1) { if(_gthis.get_vertical()) { return e1.touches[0].clientY; } else { return e1.touches[0].clientX; } }}); }; slider_Slider.__name__ = ["slider","Slider"]; slider_Slider.grab = function(within,className,tag) { if(tag == null) { tag = "div"; } var _g = within.getElementsByClassName(className)[0]; var tmp; if(_g == null) { var ret = window.document.createElement(tag); ret.className = className; within.appendChild(ret); tmp = ret; } else { var v = _g; tmp = v; } return tmp; }; slider_Slider.prototype = { setUpInput: function(input) { var _gthis = this; Dom.on(this.target,input.start,function(event) { _gthis.target.classList.add("active"); var bounds = _gthis.track.getBoundingClientRect(); var min = _gthis.get_vertical() ? bounds.top : bounds.left; var max = _gthis.get_vertical() ? bounds.bottom : bounds.right; var update = function(event1) { var _gthis1 = _gthis.edit; var update1 = input.getPos(event1) - min; _gthis1(_gthis.clamp(update1 / (max - min))); }; var cancel = Dom.on(_gthis.target.ownerDocument,input.change,update); update(event); Dom.on(_gthis.target.ownerDocument,input.end,tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() { if(cancel != null) { cancel.dissolve(); } var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() { _gthis.target.classList.remove("active"); },250),$bind($_,$_.stop))); _gthis.target.blur(); })); }); } ,clamp: function(value) { if(value > 1) { return 1; } else if(value < 0) { return 0; } else { return value; } } ,updateView: function(val) { var nextValue = this.clamp(val); if(this.lastValue == nextValue) { return; } this.lastValue = nextValue; var percent = nextValue * 100 + "%"; if(this.get_vertical()) { this.thumb.style.top = percent; } else { this.thumb.style.left = percent; } this.past.style.flexGrow = Std.string(this.lastValue); this.future.style.flexGrow = Std.string(1 - this.lastValue); } ,get_vertical: function() { return this.target.classList.contains("vertical"); } ,__class__: slider_Slider }; var tink_core_Annex = function(target) { this.target = target; this.registry = new haxe_ds_ObjectMap(); }; tink_core_Annex.__name__ = ["tink","core","Annex"]; tink_core_Annex.prototype = { __class__: tink_core_Annex }; var tink_core__$Callback_Callback_$Impl_$ = {}; tink_core__$Callback_Callback_$Impl_$.__name__ = ["tink","core","_Callback","Callback_Impl_"]; tink_core__$Callback_Callback_$Impl_$.invoke = function(this1,data) { if(tink_core__$Callback_Callback_$Impl_$.depth < 1000) { tink_core__$Callback_Callback_$Impl_$.depth++; this1(data); tink_core__$Callback_Callback_$Impl_$.depth--; } else { var _e = this1; var f = function(data1) { tink_core__$Callback_Callback_$Impl_$.invoke(_e,data1); }; var a1 = data; tink_core__$Callback_Callback_$Impl_$.defer(function() { f(a1); }); } }; tink_core__$Callback_Callback_$Impl_$.fromNiladic = function(f) { var this1 = function(r) { f(); }; return this1; }; tink_core__$Callback_Callback_$Impl_$.defer = function(f) { haxe_Timer.delay(f,0); }; var tink_core__$Callback_LinkObject = function() { }; tink_core__$Callback_LinkObject.__name__ = ["tink","core","_Callback","LinkObject"]; tink_core__$Callback_LinkObject.prototype = { __class__: tink_core__$Callback_LinkObject }; var tink_core__$Callback_SimpleLink = function(f) { this.f = f; }; tink_core__$Callback_SimpleLink.__name__ = ["tink","core","_Callback","SimpleLink"]; tink_core__$Callback_SimpleLink.__interfaces__ = [tink_core__$Callback_LinkObject]; tink_core__$Callback_SimpleLink.prototype = { dissolve: function() { if(this.f != null) { this.f(); } } ,__class__: tink_core__$Callback_SimpleLink }; var tink_core__$Callback_LinkPair = function(a,b) { this.dissolved = false; this.a = a; this.b = b; }; tink_core__$Callback_LinkPair.__name__ = ["tink","core","_Callback","LinkPair"]; tink_core__$Callback_LinkPair.__interfaces__ = [tink_core__$Callback_LinkObject]; tink_core__$Callback_LinkPair.prototype = { dissolve: function() { if(!this.dissolved) { this.dissolved = true; var this1 = this.a; if(this1 != null) { this1.dissolve(); } var this2 = this.b; if(this2 != null) { this2.dissolve(); } } } ,__class__: tink_core__$Callback_LinkPair }; var tink_core__$Callback_ListCell = function(cb,list) { if(cb == null) { throw new js__$Boot_HaxeError("callback expected but null received"); } this.cb = cb; this.list = list; }; tink_core__$Callback_ListCell.__name__ = ["tink","core","_Callback","ListCell"]; tink_core__$Callback_ListCell.__interfaces__ = [tink_core__$Callback_LinkObject]; tink_core__$Callback_ListCell.prototype = { clear: function() { this.list = null; this.cb = null; } ,dissolve: function() { var _g = this.list; if(_g != null) { var v = _g; this.clear(); HxOverrides.remove(v,this); } } ,__class__: tink_core__$Callback_ListCell }; var tink_core__$Callback_CallbackList_$Impl_$ = {}; tink_core__$Callback_CallbackList_$Impl_$.__name__ = ["tink","core","_Callback","CallbackList_Impl_"]; tink_core__$Callback_CallbackList_$Impl_$.add = function(this1,cb) { var node = new tink_core__$Callback_ListCell(cb,this1); this1.push(node); return node; }; tink_core__$Callback_CallbackList_$Impl_$.invoke = function(this1,data) { var _g = 0; var _g1 = this1.slice(); while(_g < _g1.length) { var cell = _g1[_g]; ++_g; if(cell.cb != null) { tink_core__$Callback_Callback_$Impl_$.invoke(cell.cb,data); } } }; tink_core__$Callback_CallbackList_$Impl_$.clear = function(this1) { var _g = 0; var _g1 = this1.splice(0,this1.length); while(_g < _g1.length) { var cell = _g1[_g]; ++_g; cell.clear(); } }; var tink_core_TypedError = function(code,message,pos) { if(code == null) { code = 500; } this.isTinkError = true; this.code = code; this.message = message; this.pos = pos; this.exceptionStack = []; this.callStack = []; }; tink_core_TypedError.__name__ = ["tink","core","TypedError"]; tink_core_TypedError.withData = function(code,message,data,pos) { return tink_core_TypedError.typed(code,message,data,pos); }; tink_core_TypedError.typed = function(code,message,data,pos) { var ret = new tink_core_TypedError(code,message,pos); ret.data = data; return ret; }; tink_core_TypedError.asError = function(v) { if(v != null && v.isTinkError) { return v; } else { return null; } }; tink_core_TypedError.prototype = { printPos: function() { return this.pos.className + "." + this.pos.methodName + ":" + this.pos.lineNumber; } ,toString: function() { var ret = "Error#" + this.code + ": " + this.message; if(this.pos != null) { ret += " @ " + this.printPos(); } return ret; } ,throwSelf: function() { throw new js__$Boot_HaxeError(this); } ,__class__: tink_core_TypedError }; var tink_core_Noise = { __ename__ : true, __constructs__ : ["Noise"] }; tink_core_Noise.Noise = ["Noise",0]; tink_core_Noise.Noise.toString = $estr; tink_core_Noise.Noise.__enum__ = tink_core_Noise; var tink_core__$Lazy_LazyObject = function() { }; tink_core__$Lazy_LazyObject.__name__ = ["tink","core","_Lazy","LazyObject"]; tink_core__$Lazy_LazyObject.prototype = { __class__: tink_core__$Lazy_LazyObject }; var tink_core__$Lazy_LazyConst = function(value) { this.value = value; }; tink_core__$Lazy_LazyConst.__name__ = ["tink","core","_Lazy","LazyConst"]; tink_core__$Lazy_LazyConst.__interfaces__ = [tink_core__$Lazy_LazyObject]; tink_core__$Lazy_LazyConst.prototype = { get: function() { return this.value; } ,map: function(f) { return new tink_core__$Lazy_LazyConst(f(this.value)); } ,__class__: tink_core__$Lazy_LazyConst }; var tink_core__$Future_SyncFuture = function(value) { this.value = value; }; tink_core__$Future_SyncFuture.__name__ = ["tink","core","_Future","SyncFuture"]; tink_core__$Future_SyncFuture.__interfaces__ = [tink_core__$Future_FutureObject]; tink_core__$Future_SyncFuture.prototype = { map: function(f) { return new tink_core__$Future_SyncFuture(this.value.map(f)); } ,flatMap: function(f) { var l = this.value.map(f); return new tink_core__$Future_SimpleFuture(function(cb) { return l.get().handle(cb); }); } ,handle: function(cb) { tink_core__$Callback_Callback_$Impl_$.invoke(cb,this.value.get()); return null; } ,gather: function() { return this; } ,__class__: tink_core__$Future_SyncFuture }; var tink_core__$Future_Future_$Impl_$ = {}; tink_core__$Future_Future_$Impl_$.__name__ = ["tink","core","_Future","Future_Impl_"]; tink_core__$Future_Future_$Impl_$.first = function(this1,other) { var ret = new tink_core_FutureTrigger(); var l1 = this1.handle($bind(ret,ret.trigger)); var l2 = other.handle($bind(ret,ret.trigger)); var ret1 = ret; if(l1 != null) { var this2 = l1; ret1.handle(function(_) { this2.dissolve(); }); } if(l2 != null) { var this3 = l2; ret1.handle(function(_1) { this3.dissolve(); }); } return ret1; }; tink_core__$Future_Future_$Impl_$.flatten = function(f) { return new tink_core__$Future_NestedFuture(f); }; tink_core__$Future_Future_$Impl_$.ofMany = function(futures,gather) { if(gather == null) { gather = true; } var ret = new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst([])); var _g = 0; while(_g < futures.length) { var f = [futures[_g]]; ++_g; var ret1 = ret.flatMap((function(f1) { return function(results) { var ret2 = (function() { return function(result) { return results.concat([result]); }; })(); var ret3 = f1[0].map(ret2); return ret3; }; })(f)); ret = ret1; } if(gather) { return ret.gather(); } else { return ret; } }; tink_core__$Future_Future_$Impl_$.async = function(f,lazy) { if(lazy == null) { lazy = false; } if(lazy) { return new tink_core__$Future_LazyTrigger(f); } else { var op = new tink_core_FutureTrigger(); var wrapped = f; tink_core__$Callback_Callback_$Impl_$.invoke(wrapped,$bind(op,op.trigger)); return op; } }; tink_core__$Future_Future_$Impl_$.or = function(a,b) { return tink_core__$Future_Future_$Impl_$.first(a,b); }; var tink_core__$Future_NestedFuture = function(outer) { this.outer = outer; }; tink_core__$Future_NestedFuture.__name__ = ["tink","core","_Future","NestedFuture"]; tink_core__$Future_NestedFuture.__interfaces__ = [tink_core__$Future_FutureObject]; tink_core__$Future_NestedFuture.prototype = { map: function(f) { var ret = this.outer.flatMap(function(inner) { var ret1 = inner.map(f); return ret1.gather(); }); return ret.gather(); } ,flatMap: function(f) { var ret = this.outer.flatMap(function(inner) { var ret1 = inner.flatMap(f); return ret1.gather(); }); return ret.gather(); } ,gather: function() { return tink_core_FutureTrigger.gatherFuture(this); } ,handle: function(cb) { var ret = null; ret = this.outer.handle(function(inner) { ret = inner.handle(function(result) { tink_core__$Callback_Callback_$Impl_$.invoke(cb,result); }); }); return ret; } ,__class__: tink_core__$Future_NestedFuture }; var tink_core_FutureTrigger = function() { var this1 = []; this.list = this1; }; tink_core_FutureTrigger.__name__ = ["tink","core","FutureTrigger"]; tink_core_FutureTrigger.__interfaces__ = [tink_core__$Future_FutureObject]; tink_core_FutureTrigger.gatherFuture = function(f) { var op = null; var this1 = new tink_core__$Future_SimpleFuture(function(cb) { if(op == null) { op = new tink_core_FutureTrigger(); f.handle($bind(op,op.trigger)); f = null; } return op.handle(cb); }); return this1; }; tink_core_FutureTrigger.prototype = { handle: function(callback) { var _g = this.list; if(_g == null) { tink_core__$Callback_Callback_$Impl_$.invoke(callback,this.result); return null; } else { var v = _g; return tink_core__$Callback_CallbackList_$Impl_$.add(v,callback); } } ,map: function(f) { var _g = this.list; if(_g == null) { return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(f(this.result))); } else { var v = _g; var ret = new tink_core_FutureTrigger(); tink_core__$Callback_CallbackList_$Impl_$.add(this.list,function(v1) { var tmp = f(v1); ret.trigger(tmp); }); return ret; } } ,flatMap: function(f) { var _g = this.list; if(_g == null) { return f(this.result); } else { var v = _g; var ret = new tink_core_FutureTrigger(); tink_core__$Callback_CallbackList_$Impl_$.add(this.list,function(v1) { f(v1).handle($bind(ret,ret.trigger)); }); return ret; } } ,gather: function() { return this; } ,trigger: function(result) { if(this.list == null) { return false; } else { var list = this.list; this.list = null; this.result = result; tink_core__$Callback_CallbackList_$Impl_$.invoke(list,result); tink_core__$Callback_CallbackList_$Impl_$.clear(list); return true; } } ,__class__: tink_core_FutureTrigger }; var tink_core__$Future_LazyTrigger = function(op) { this.op = op; tink_core_FutureTrigger.call(this); }; tink_core__$Future_LazyTrigger.__name__ = ["tink","core","_Future","LazyTrigger"]; tink_core__$Future_LazyTrigger.__super__ = tink_core_FutureTrigger; tink_core__$Future_LazyTrigger.prototype = $extend(tink_core_FutureTrigger.prototype,{ eager: function() { if(this.op != null) { var op = this.op; this.op = null; tink_core__$Callback_Callback_$Impl_$.invoke(op,$bind(this,this.trigger)); } return this; } ,map: function(f) { var _gthis = this; if(this.op == null) { return tink_core_FutureTrigger.prototype.map.call(this,f); } else { return tink_core__$Future_Future_$Impl_$.async(function(cb) { _gthis.handle(function(v) { var tmp = f(v); cb(tmp); }); },true); } } ,flatMap: function(f) { var _gthis = this; if(this.op == null) { return tink_core_FutureTrigger.prototype.flatMap.call(this,f); } else { return tink_core__$Future_Future_$Impl_$.async(function(cb) { _gthis.handle(function(v) { f(v).handle(cb); }); },true); } } ,handle: function(cb) { this.eager(); return tink_core_FutureTrigger.prototype.handle.call(this,cb); } ,__class__: tink_core__$Future_LazyTrigger }); var tink_core__$Lazy_LazyFunc = function(f) { this.f = f; }; tink_core__$Lazy_LazyFunc.__name__ = ["tink","core","_Lazy","LazyFunc"]; tink_core__$Lazy_LazyFunc.__interfaces__ = [tink_core__$Lazy_LazyObject]; tink_core__$Lazy_LazyFunc.prototype = { get: function() { if(this.f != null) { this.result = this.f(); this.f = null; } return this.result; } ,map: function(f) { var _gthis = this; return new tink_core__$Lazy_LazyFunc(function() { var tmp = _gthis.get(); return f(tmp); }); } ,__class__: tink_core__$Lazy_LazyFunc }; var tink_core_NamedWith = function(name,value) { this.name = name; this.value = value; }; tink_core_NamedWith.__name__ = ["tink","core","NamedWith"]; tink_core_NamedWith.prototype = { __class__: tink_core_NamedWith }; var tink_core_Outcome = { __ename__ : true, __constructs__ : ["Success","Failure"] }; tink_core_Outcome.Success = function(data) { var $x = ["Success",0,data]; $x.__enum__ = tink_core_Outcome; $x.toString = $estr; return $x; }; tink_core_Outcome.Failure = function(failure) { var $x = ["Failure",1,failure]; $x.__enum__ = tink_core_Outcome; $x.toString = $estr; return $x; }; var tink_core_OutcomeTools = function() { }; tink_core_OutcomeTools.__name__ = ["tink","core","OutcomeTools"]; tink_core_OutcomeTools.sure = function(outcome) { switch(outcome[1]) { case 0: var data = outcome[2]; return data; case 1: var failure = outcome[2]; var _g = tink_core_TypedError.asError(failure); if(_g == null) { throw new js__$Boot_HaxeError(failure); } else { var e = _g; return e.throwSelf(); } break; } }; var tink_core__$Promise_Promise_$Impl_$ = {}; tink_core__$Promise_Promise_$Impl_$.__name__ = ["tink","core","_Promise","Promise_Impl_"]; tink_core__$Promise_Promise_$Impl_$.ofOutcome = function(o) { return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(o)); }; var tink_core__$Signal_Signal_$Impl_$ = {}; tink_core__$Signal_Signal_$Impl_$.__name__ = ["tink","core","_Signal","Signal_Impl_"]; tink_core__$Signal_Signal_$Impl_$.map = function(this1,f,gather) { if(gather == null) { gather = true; } var this2 = new tink_core__$Signal_SimpleSignal(function(cb) { return this1.handle(function(result) { var this3 = f(result); tink_core__$Callback_Callback_$Impl_$.invoke(cb,this3); }); }); var ret = this2; if(gather) { return tink_core__$Signal_Signal_$Impl_$.gather(ret); } else { return ret; } }; tink_core__$Signal_Signal_$Impl_$.filter = function(this1,f,gather) { if(gather == null) { gather = true; } var this2 = new tink_core__$Signal_SimpleSignal(function(cb) { return this1.handle(function(result) { if(f(result)) { tink_core__$Callback_Callback_$Impl_$.invoke(cb,result); } }); }); var ret = this2; if(gather) { return tink_core__$Signal_Signal_$Impl_$.gather(ret); } else { return ret; } }; tink_core__$Signal_Signal_$Impl_$.join = function(this1,other,gather) { if(gather == null) { gather = true; } var this2 = new tink_core__$Signal_SimpleSignal(function(cb) { return new tink_core__$Callback_LinkPair(this1.handle(cb),other.handle(cb)); }); var ret = this2; if(gather) { return tink_core__$Signal_Signal_$Impl_$.gather(ret); } else { return ret; } }; tink_core__$Signal_Signal_$Impl_$.nextTime = function(this1,condition) { var ret = new tink_core_FutureTrigger(); var link = null; var immediate = false; link = this1.handle(function(v) { if(condition == null || condition(v)) { ret.trigger(v); if(link == null) { immediate = true; } else if(link != null) { link.dissolve(); } } }); if(immediate) { if(link != null) { link.dissolve(); } } return ret; }; tink_core__$Signal_Signal_$Impl_$.noise = function(this1) { return tink_core__$Signal_Signal_$Impl_$.map(this1,function(_) { return tink_core_Noise.Noise; }); }; tink_core__$Signal_Signal_$Impl_$.gather = function(this1) { var ret = tink_core__$Signal_Signal_$Impl_$.trigger(); this1.handle(function(x) { tink_core__$Callback_CallbackList_$Impl_$.invoke(ret.handlers,x); }); return ret; }; tink_core__$Signal_Signal_$Impl_$.trigger = function() { return new tink_core_SignalTrigger(); }; tink_core__$Signal_Signal_$Impl_$.ofClassical = function(add,remove,gather) { if(gather == null) { gather = true; } var this1 = new tink_core__$Signal_SimpleSignal(function(cb) { var f = function(a) { tink_core__$Callback_Callback_$Impl_$.invoke(cb,a); }; add(f); var this2; var f1 = remove; var a1 = f; this2 = new tink_core__$Callback_SimpleLink(function() { f1(a1); }); return this2; }); var ret = this1; if(gather) { return tink_core__$Signal_Signal_$Impl_$.gather(ret); } else { return ret; } }; var tink_core_SignalObject = function() { }; tink_core_SignalObject.__name__ = ["tink","core","SignalObject"]; tink_core_SignalObject.prototype = { __class__: tink_core_SignalObject }; var tink_core__$Signal_SimpleSignal = function(f) { this.f = f; }; tink_core__$Signal_SimpleSignal.__name__ = ["tink","core","_Signal","SimpleSignal"]; tink_core__$Signal_SimpleSignal.__interfaces__ = [tink_core_SignalObject]; tink_core__$Signal_SimpleSignal.prototype = { handle: function(cb) { return this.f(cb); } ,__class__: tink_core__$Signal_SimpleSignal }; var tink_core_SignalTrigger = function() { var this1 = []; this.handlers = this1; }; tink_core_SignalTrigger.__name__ = ["tink","core","SignalTrigger"]; tink_core_SignalTrigger.__interfaces__ = [tink_core_SignalObject]; tink_core_SignalTrigger.prototype = { trigger: function(event) { tink_core__$Callback_CallbackList_$Impl_$.invoke(this.handlers,event); } ,handle: function(cb) { return tink_core__$Callback_CallbackList_$Impl_$.add(this.handlers,cb); } ,__class__: tink_core_SignalTrigger }; var tink_geom2__$Matrix_Matrix_$Impl_$ = {}; tink_geom2__$Matrix_Matrix_$Impl_$.__name__ = ["tink","geom2","_Matrix","Matrix_Impl_"]; tink_geom2__$Matrix_Matrix_$Impl_$.invert = function(m) { var det = m.a * m.d - m.c * m.b; var a = m.d / det; var b = -m.b / det; var c = -m.c / det; var d = m.a / det; var this1 = { a : a, b : b, c : c, d : d, tx : -(a * m.tx + c * m.ty), ty : -(b * m.tx + d * m.ty)}; return this1; }; tink_geom2__$Matrix_Matrix_$Impl_$.transformPoint = function(m,p) { var this1; var this2 = new tink_core_MPair(m.a * p.a + m.c * p.b + m.tx,m.b * p.a + m.d * p.b + m.ty); this1 = this2; return this1; }; tink_geom2__$Matrix_Matrix_$Impl_$.concat = function(m,n) { var this1 = { a : n.a * m.a + n.c * m.b, b : n.b * m.a + n.d * m.b, c : n.a * m.c + n.c * m.d, d : n.b * m.c + n.d * m.d, tx : n.a * m.tx + n.c * m.ty + n.tx, ty : n.b * m.tx + n.d * m.ty + n.ty}; return this1; }; tink_geom2__$Matrix_Matrix_$Impl_$.scale = function(m,f) { var this1 = { a : f, b : 0, c : 0, d : f, tx : 0, ty : 0}; return tink_geom2__$Matrix_Matrix_$Impl_$.concat(m,this1); }; tink_geom2__$Matrix_Matrix_$Impl_$.rscale = function(f,m) { var this1 = { a : f, b : 0, c : 0, d : f, tx : 0, ty : 0}; return tink_geom2__$Matrix_Matrix_$Impl_$.concat(this1,m); }; tink_geom2__$Matrix_Matrix_$Impl_$.move = function(m,p) { var this1 = { a : 1, b : 0, c : 0, d : 1, tx : p.a, ty : p.b}; return tink_geom2__$Matrix_Matrix_$Impl_$.concat(m,this1); }; tink_geom2__$Matrix_Matrix_$Impl_$.rmove = function(p,m) { var this1 = { a : 1, b : 0, c : 0, d : 1, tx : p.a, ty : p.b}; return tink_geom2__$Matrix_Matrix_$Impl_$.concat(this1,m); }; tink_geom2__$Matrix_Matrix_$Impl_$.toString = function(this1) { return "matrix(" + this1.a + ", " + this1.b + ", " + this1.c + ", " + this1.d + ", " + this1.tx + ", " + this1.ty + ")"; }; var tink_json__$Parser_SliceData = function(source,min,max) { this.source = source; this.min = min; this.max = max; }; tink_json__$Parser_SliceData.__name__ = ["tink","json","_Parser","SliceData"]; tink_json__$Parser_SliceData.prototype = { __class__: tink_json__$Parser_SliceData }; var tink_json__$Parser_JsonString_$Impl_$ = {}; tink_json__$Parser_JsonString_$Impl_$.__name__ = ["tink","json","_Parser","JsonString_Impl_"]; tink_json__$Parser_JsonString_$Impl_$.contains = function(this1,s) { var _g = this1.source.indexOf(s,this1.min); if(_g == -1) { return false; } else { var outside = _g; if(outside > this1.max) { return false; } else { var v = _g; return true; } } }; tink_json__$Parser_JsonString_$Impl_$.toString = function(this1) { if(tink_json__$Parser_JsonString_$Impl_$.contains(this1,"\\")) { return JSON.parse(this1.source.substring(this1.min - 1,this1.max + 1)); } else { return this1.source.substring(this1.min,this1.max); } }; var tink_json_BasicParser = function() { this.plugins = new tink_core_Annex(this); }; tink_json_BasicParser.__name__ = ["tink","json","BasicParser"]; tink_json_BasicParser.prototype = { init: function(source) { this.source = source; this.pos = 0; this.max = source.length; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; } ,parseString: function() { var e; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var e1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 34) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; e1 = true; } else { e1 = false; } if(!e1) { e = this.die("Expected string"); } else { e = null; } return this.parseRestOfString(); } ,parseRestOfString: function() { return this.slice(this.skipString(),this.pos - 1); } ,skipString: function() { var start = this.pos; while(true) { var _g = this.source.indexOf("\"",this.pos); if(_g == -1) { this.die("unterminated string",start); } else { var v = _g; this.pos = v + 1; var p = this.pos - 2; while(this.source.charCodeAt(p) == 92) --p; if((p - this.pos & 1) == 0) { break; } } } return start; } ,parseNumber: function() { var $char = this.source.charCodeAt(this.pos); if($char == 46 || $char < 58 && $char > 47) { return this.doParseNumber(); } else { return this.die("number expected"); } } ,doParseNumber: function() { return this.slice(this.skipNumber(this.source.charCodeAt(this.pos++)),this.pos); } ,invalidNumber: function(start) { return this.die("Invalid number " + this.source.substring(start,this.pos),start); } ,skipNumber: function(c) { var start = this.pos - 1; var minus = c == 45; var digit = !minus; var zero = c == 48; var point = false; var e = false; var pm = false; var end = false; while(true) { c = this.source.charCodeAt(this.pos++); switch(c) { case 43:case 45: if(!e || pm) { this.invalidNumber(start); } digit = false; pm = true; break; case 46: if(minus || point) { this.invalidNumber(start); } digit = false; point = true; break; case 48: if(zero && !point) { this.invalidNumber(start); } if(minus) { minus = false; zero = true; } digit = true; break; case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57: if(zero && !point) { this.invalidNumber(start); } if(minus) { minus = false; } digit = true; zero = false; break; case 69:case 101: if(minus || zero || e) { this.invalidNumber(start); } digit = false; e = true; break; default: if(!digit) { this.invalidNumber(start); } this.pos--; end = true; } if(end) { break; } } return start; } ,slice: function(from,to) { return new tink_json__$Parser_SliceData(this.source,from,to); } ,skipValue: function() { var _gthis = this; var _g = this.source.charCodeAt(this.pos++); switch(_g) { case 34: this.skipString(); break; case 91: while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(tmp) { return; } while(true) { this.skipValue(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) { this.pos += 1; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected ]"); } break; case 102: var tmp3; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 97 && this.source.charCodeAt(this.pos + 1) == 108 && this.source.charCodeAt(this.pos + 2) == 115 && this.source.charCodeAt(this.pos + 3) == 101) { this.pos += 4; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { this.die("Expected alse"); } break; case 110: var tmp4; if(this.max > this.pos + 2 && this.source.charCodeAt(this.pos) == 117 && this.source.charCodeAt(this.pos + 1) == 108 && this.source.charCodeAt(this.pos + 2) == 108) { this.pos += 3; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected ull"); } break; case 116: var tmp5; if(this.max > this.pos + 2 && this.source.charCodeAt(this.pos) == 114 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 101) { this.pos += 3; tmp5 = true; } else { tmp5 = false; } if(!tmp5) { this.die("Expected rue"); } break; case 123: while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp6; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp6 = true; } else { tmp6 = false; } if(tmp6) { return; } while(true) { if(_gthis.source.charCodeAt(_gthis.pos++) != 34) { _gthis.die("expected string",_gthis.pos - 1); } _gthis.skipString(); while(_gthis.pos < _gthis.max && _gthis.source.charCodeAt(_gthis.pos) < 33) _gthis.pos++; var tmp7; if(_gthis.max > _gthis.pos && _gthis.source.charCodeAt(_gthis.pos) == 58) { _gthis.pos += 1; while(_gthis.pos < _gthis.max && _gthis.source.charCodeAt(_gthis.pos) < 33) _gthis.pos++; tmp7 = true; } else { tmp7 = false; } if(!tmp7) { _gthis.die("Expected :"); } _gthis.skipValue(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp8; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp8 = true; } else { tmp8 = false; } if(!tmp8) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp9; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; tmp9 = true; } else { tmp9 = false; } if(!tmp9) { this.die("Expected }"); } break; default: var $char = _g; if($char == 46 || $char < 58 && $char > 47) { this.skipNumber($char); } else { this.invalidChar($char); } } } ,invalidChar: function(c) { return this.die("invalid char " + StringTools.hex(c,2),this.pos - 1); } ,die: function(s,pos,end) { if(pos == null) { pos = this.pos; end = pos; } else if(end == null) { end = this.pos; } if(end <= pos) { end = pos + 1; } var range = end > pos + 1 ? "characters " + pos + " - " + end : "character " + pos; var clip = function(s1,maxLength,left) { if(s1.length > maxLength) { if(left) { return "... " + HxOverrides.substr(s1,s1.length - maxLength,null); } else { return HxOverrides.substr(s1,0,maxLength) + " ..."; } } else { return s1; } }; var center = pos + end >> 1; var context = clip(this.source.substring(0,pos),20,true) + " ----> " + clip(this.source.substring(pos,center),20,false) + clip(this.source.substring(center,end),20,true) + " <---- " + clip(this.source.substring(end),20,false); return tink_core_TypedError.withData(422,s + (" at " + range + " in " + context),{ source : this.source, start : pos, end : end},{ fileName : "Parser.hx", lineNumber : 327, className : "tink.json.BasicParser", methodName : "die"}).throwSelf(); } ,parseBool: function() { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 116 && this.source.charCodeAt(this.pos + 1) == 114 && this.source.charCodeAt(this.pos + 2) == 117 && this.source.charCodeAt(this.pos + 3) == 101) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(tmp) { return true; } else { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos + 4 && this.source.charCodeAt(this.pos) == 102 && this.source.charCodeAt(this.pos + 1) == 97 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 115 && this.source.charCodeAt(this.pos + 4) == 101) { this.pos += 5; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(tmp1) { return false; } else { return this.die("expected boolean value"); } } } ,__class__: tink_json_BasicParser }; var tink_json_Parser0 = function() { tink_json_BasicParser.call(this); }; tink_json_Parser0.__name__ = ["tink","json","Parser0"]; tink_json_Parser0.__super__ = tink_json_BasicParser; tink_json_Parser0.prototype = $extend(tink_json_BasicParser.prototype,{ parse0: function() { var _gthis = this; var v_bubbleContains = null; var v_bubbleUsedWith = null; var v_displayLongTextAsTooltip = null; var v_embedded = null; var v_frameOnly = null; var v_geo = null; var v_iconId = null; var v_iconOnGeo = null; var v_long = null; var v_mediabarContains = null; var v_short = null; var v_thumb = null; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("thumb".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "thumb") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_thumb1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_thumb1 = true; } else { v_thumb1 = false; } if(v_thumb1) { v_thumb = null; } else { v_thumb = this.parse2(); } } else if("short".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "short") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_short1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_short1 = true; } else { v_short1 = false; } if(v_short1) { v_short = null; } else { v_short = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else if("mediabarContains".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "mediabarContains") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_mediabarContains1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_mediabarContains1 = true; } else { v_mediabarContains1 = false; } if(v_mediabarContains1) { v_mediabarContains = null; } else { v_mediabarContains = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else if("long".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "long") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_long1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_long1 = true; } else { v_long1 = false; } if(v_long1) { v_long = null; } else { v_long = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else if("iconOnGeo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "iconOnGeo") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_iconOnGeo1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_iconOnGeo1 = true; } else { v_iconOnGeo1 = false; } if(v_iconOnGeo1) { v_iconOnGeo = null; } else { v_iconOnGeo = this.parseBool(); } } else if("iconId".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "iconId") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_iconId1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_iconId1 = true; } else { v_iconId1 = false; } if(v_iconId1) { v_iconId = null; } else { v_iconId = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else if("geo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "geo") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_geo1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_geo1 = true; } else { v_geo1 = false; } if(v_geo1) { v_geo = null; } else { v_geo = this.parse1(); } } else if("frameOnly".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "frameOnly") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_frameOnly1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_frameOnly1 = true; } else { v_frameOnly1 = false; } if(v_frameOnly1) { v_frameOnly = null; } else { v_frameOnly = this.parseBool(); } } else if("embedded".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "embedded") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_embedded1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_embedded1 = true; } else { v_embedded1 = false; } if(v_embedded1) { v_embedded = null; } else { v_embedded = this.parseBool(); } } else if("displayLongTextAsTooltip".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "displayLongTextAsTooltip") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_displayLongTextAsTooltip1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_displayLongTextAsTooltip1 = true; } else { v_displayLongTextAsTooltip1 = false; } if(v_displayLongTextAsTooltip1) { v_displayLongTextAsTooltip = null; } else { v_displayLongTextAsTooltip = this.parseBool(); } } else if("bubbleUsedWith".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bubbleUsedWith") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_bubbleUsedWith1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_bubbleUsedWith1 = true; } else { v_bubbleUsedWith1 = false; } if(v_bubbleUsedWith1) { v_bubbleUsedWith = null; } else { v_bubbleUsedWith = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else if("bubbleContains".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bubbleContains") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_bubbleContains1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_bubbleContains1 = true; } else { v_bubbleContains1 = false; } if(v_bubbleContains1) { v_bubbleContains = null; } else { v_bubbleContains = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { bubbleContains : v_bubbleContains, bubbleUsedWith : v_bubbleUsedWith, displayLongTextAsTooltip : v_displayLongTextAsTooltip, embedded : v_embedded, frameOnly : v_frameOnly, geo : v_geo, iconId : v_iconId, iconOnGeo : v_iconOnGeo, 'long' : v_long, mediabarContains : v_mediabarContains, 'short' : v_short, thumb : v_thumb}; } ,parse1: function() { var _gthis = this; var v_alpha = null; var v_color = null; var v_hoverAlpha = null; var v_hoverColor = null; var v_x1 = .0; var hasv_x1 = false; var v_x2 = .0; var hasv_x2 = false; var v_y1 = .0; var hasv_y1 = false; var v_y2 = .0; var hasv_y2 = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("y2".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "y2") { var this1 = this.parseNumber(); v_y2 = parseFloat(this1.source.substring(this1.min,this1.max)); hasv_y2 = true; } else if("y1".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "y1") { var this2 = this.parseNumber(); v_y1 = parseFloat(this2.source.substring(this2.min,this2.max)); hasv_y1 = true; } else if("x2".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "x2") { var this3 = this.parseNumber(); v_x2 = parseFloat(this3.source.substring(this3.min,this3.max)); hasv_x2 = true; } else if("x1".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "x1") { var this4 = this.parseNumber(); v_x1 = parseFloat(this4.source.substring(this4.min,this4.max)); hasv_x1 = true; } else if("hoverColor".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "hoverColor") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_hoverColor1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_hoverColor1 = true; } else { v_hoverColor1 = false; } if(v_hoverColor1) { v_hoverColor = null; } else { var this5 = this.parseNumber(); v_hoverColor = Std.parseInt(this5.source.substring(this5.min,this5.max)); } } else if("hoverAlpha".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "hoverAlpha") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_hoverAlpha1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_hoverAlpha1 = true; } else { v_hoverAlpha1 = false; } if(v_hoverAlpha1) { v_hoverAlpha = null; } else { var this6 = this.parseNumber(); v_hoverAlpha = parseFloat(this6.source.substring(this6.min,this6.max)); } } else if("color".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "color") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_color1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_color1 = true; } else { v_color1 = false; } if(v_color1) { v_color = null; } else { var this7 = this.parseNumber(); v_color = Std.parseInt(this7.source.substring(this7.min,this7.max)); } } else if("alpha".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "alpha") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_alpha1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_alpha1 = true; } else { v_alpha1 = false; } if(v_alpha1) { v_alpha = null; } else { var this8 = this.parseNumber(); v_alpha = parseFloat(this8.source.substring(this8.min,this8.max)); } } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { alpha : v_alpha, color : v_color, hoverAlpha : v_hoverAlpha, hoverColor : v_hoverColor, x1 : hasv_x1 ? v_x1 : __missing__("x1"), x2 : hasv_x2 ? v_x2 : __missing__("x2"), y1 : hasv_y1 ? v_y1 : __missing__("y1"), y2 : hasv_y2 ? v_y2 : __missing__("y2")}; } ,parse2: function() { var _gthis = this; var v_height = null; var v_src = null; var hasv_src = false; var v_width = null; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("width".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "width") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_width1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_width1 = true; } else { v_width1 = false; } if(v_width1) { v_width = null; } else { var this1 = this.parseNumber(); v_width = Std.parseInt(this1.source.substring(this1.min,this1.max)); } } else if("src".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "src") { v_src = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_src = true; } else if("height".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "height") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_height1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_height1 = true; } else { v_height1 = false; } if(v_height1) { v_height = null; } else { var this2 = this.parseNumber(); v_height = Std.parseInt(this2.source.substring(this2.min,this2.max)); } } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { height : v_height, src : hasv_src ? v_src : __missing__("src"), width : v_width}; } ,parse: function(source) { this.init(source); return this.parse0(); } ,__class__: tink_json_Parser0 }); var tink_json_Parser1 = function() { tink_json_BasicParser.call(this); }; tink_json_Parser1.__name__ = ["tink","json","Parser1"]; tink_json_Parser1.__super__ = tink_json_BasicParser; tink_json_Parser1.prototype = $extend(tink_json_BasicParser.prototype,{ parse0: function() { var _gthis = this; var v_page = null; var hasv_page = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("page".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "page") { v_page = this.parse1(); hasv_page = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { page : hasv_page ? v_page : __missing__("page")}; } ,parse1: function() { var _gthis = this; var v_bbox = null; var hasv_bbox = false; var v_id = 0; var hasv_id = false; var v_rotate = null; var v_textbox = null; var hasv_textbox = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("textbox".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "textbox") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_textbox1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 91) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_textbox1 = true; } else { v_textbox1 = false; } if(!v_textbox1) { this.die("Expected ["); } var __ret = []; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_textbox2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_textbox2 = true; } else { v_textbox2 = false; } if(!v_textbox2) { while(true) { __ret.push(this.parse2()); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_textbox3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_textbox3 = true; } else { v_textbox3 = false; } if(!v_textbox3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_textbox4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_textbox4 = true; } else { v_textbox4 = false; } if(!v_textbox4) { this.die("Expected ]"); } } v_textbox = __ret; hasv_textbox = true; } else if("rotate".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "rotate") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_rotate1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_rotate1 = true; } else { v_rotate1 = false; } if(v_rotate1) { v_rotate = null; } else { v_rotate = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else if("id".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "id") { var this1 = this.parseNumber(); v_id = Std.parseInt(this1.source.substring(this1.min,this1.max)); hasv_id = true; } else if("bbox".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bbox") { v_bbox = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_bbox = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { bbox : hasv_bbox ? v_bbox : __missing__("bbox"), id : hasv_id ? v_id : __missing__("id"), rotate : v_rotate, textbox : hasv_textbox ? v_textbox : __missing__("textbox")}; } ,parse2: function() { var _gthis = this; var v_bbox = null; var hasv_bbox = false; var v_id = 0; var hasv_id = false; var v_textline = null; var hasv_textline = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("textline".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "textline") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_textline1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 91) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_textline1 = true; } else { v_textline1 = false; } if(!v_textline1) { this.die("Expected ["); } var __ret = []; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_textline2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_textline2 = true; } else { v_textline2 = false; } if(!v_textline2) { while(true) { __ret.push(this.parse3()); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_textline3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_textline3 = true; } else { v_textline3 = false; } if(!v_textline3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_textline4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_textline4 = true; } else { v_textline4 = false; } if(!v_textline4) { this.die("Expected ]"); } } v_textline = __ret; hasv_textline = true; } else if("id".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "id") { var this1 = this.parseNumber(); v_id = Std.parseInt(this1.source.substring(this1.min,this1.max)); hasv_id = true; } else if("bbox".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bbox") { v_bbox = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_bbox = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { bbox : hasv_bbox ? v_bbox : __missing__("bbox"), id : hasv_id ? v_id : __missing__("id"), textline : hasv_textline ? v_textline : __missing__("textline")}; } ,parse3: function() { var _gthis = this; var v_text = null; var hasv_text = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("text".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "text") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_text1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 91) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_text1 = true; } else { v_text1 = false; } if(!v_text1) { this.die("Expected ["); } var __ret = []; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_text2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_text2 = true; } else { v_text2 = false; } if(!v_text2) { while(true) { __ret.push(this.parse4()); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_text3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_text3 = true; } else { v_text3 = false; } if(!v_text3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_text4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_text4 = true; } else { v_text4 = false; } if(!v_text4) { this.die("Expected ]"); } } v_text = __ret; hasv_text = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { text : hasv_text ? v_text : __missing__("text")}; } ,parse4: function() { var _gthis = this; var v_bbox = null; var v_character = null; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("character".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "character") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_character1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_character1 = true; } else { v_character1 = false; } if(v_character1) { v_character = null; } else { v_character = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else if("bbox".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bbox") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_bbox1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_bbox1 = true; } else { v_bbox1 = false; } if(v_bbox1) { v_bbox = null; } else { v_bbox = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); } } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { bbox : v_bbox, character : v_character}; } ,parse: function(source) { this.init(source); return this.parse0(); } ,__class__: tink_json_Parser1 }); var tink_json_Parser2 = function() { tink_json_BasicParser.call(this); }; tink_json_Parser2.__name__ = ["tink","json","Parser2"]; tink_json_Parser2.__super__ = tink_json_BasicParser; tink_json_Parser2.prototype = $extend(tink_json_BasicParser.prototype,{ parse0: function() { var _gthis = this; var v_bg = null; var hasv_bg = false; var v_cookieBanner = null; var hasv_cookieBanner = false; var v_customLinkButton = null; var v_customerGDPR = null; var hasv_customerGDPR = false; var v_customerImprint = null; var hasv_customerImprint = false; var v_directory = null; var hasv_directory = false; var v_display = null; var hasv_display = false; var v_download = null; var hasv_download = false; var v_fullscreen = null; var hasv_fullscreen = false; var v_logo = null; var v_media = null; var hasv_media = false; var v_metadata = null; var hasv_metadata = false; var v_navigationBar = null; var hasv_navigationBar = false; var v_pageShadow = null; var hasv_pageShadow = false; var v_pagesOverview = null; var hasv_pagesOverview = false; var v_search = null; var hasv_search = false; var v_share = null; var hasv_share = false; var v_subDir = null; var hasv_subDir = false; var v_zoom = null; var hasv_zoom = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("zoom".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "zoom") { v_zoom = this.parse13(); hasv_zoom = true; } else if("subDir".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "subDir") { v_subDir = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_subDir = true; } else if("share".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "share") { v_share = this.parse12(); hasv_share = true; } else if("search".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "search") { v_search = this.parse8(); hasv_search = true; } else if("pagesOverview".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "pagesOverview") { v_pagesOverview = this.parse8(); hasv_pagesOverview = true; } else if("pageShadow".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "pageShadow") { v_pageShadow = this.parse8(); hasv_pageShadow = true; } else if("navigationBar".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "navigationBar") { v_navigationBar = this.parse8(); hasv_navigationBar = true; } else if("metadata".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "metadata") { v_metadata = this.parse11(); hasv_metadata = true; } else if("media".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "media") { v_media = this.parse10(); hasv_media = true; } else if("logo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logo") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_logo1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_logo1 = true; } else { v_logo1 = false; } if(v_logo1) { v_logo = null; } else { v_logo = this.parse9(); } } else if("fullscreen".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "fullscreen") { v_fullscreen = this.parse8(); hasv_fullscreen = true; } else if("download".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "download") { v_download = this.parse7(); hasv_download = true; } else if("display".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "display") { v_display = this.parse6(); hasv_display = true; } else if("directory".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "directory") { v_directory = this.parse5(); hasv_directory = true; } else if("customerImprint".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "customerImprint") { v_customerImprint = this.parse4(); hasv_customerImprint = true; } else if("customerGDPR".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "customerGDPR") { v_customerGDPR = this.parse4(); hasv_customerGDPR = true; } else if("customLinkButton".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "customLinkButton") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_customLinkButton1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_customLinkButton1 = true; } else { v_customLinkButton1 = false; } if(v_customLinkButton1) { v_customLinkButton = null; } else { v_customLinkButton = this.parse3(); } } else if("cookieBanner".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "cookieBanner") { v_cookieBanner = this.parse2(); hasv_cookieBanner = true; } else if("bg".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bg") { v_bg = this.parse1(); hasv_bg = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { bg : hasv_bg ? v_bg : __missing__("bg"), cookieBanner : hasv_cookieBanner ? v_cookieBanner : __missing__("cookieBanner"), customLinkButton : v_customLinkButton, customerGDPR : hasv_customerGDPR ? v_customerGDPR : __missing__("customerGDPR"), customerImprint : hasv_customerImprint ? v_customerImprint : __missing__("customerImprint"), directory : hasv_directory ? v_directory : __missing__("directory"), display : hasv_display ? v_display : __missing__("display"), download : hasv_download ? v_download : __missing__("download"), fullscreen : hasv_fullscreen ? v_fullscreen : __missing__("fullscreen"), logo : v_logo, media : hasv_media ? v_media : __missing__("media"), metadata : hasv_metadata ? v_metadata : __missing__("metadata"), navigationBar : hasv_navigationBar ? v_navigationBar : __missing__("navigationBar"), pageShadow : hasv_pageShadow ? v_pageShadow : __missing__("pageShadow"), pagesOverview : hasv_pagesOverview ? v_pagesOverview : __missing__("pagesOverview"), search : hasv_search ? v_search : __missing__("search"), share : hasv_share ? v_share : __missing__("share"), subDir : hasv_subDir ? v_subDir : __missing__("subDir"), zoom : hasv_zoom ? v_zoom : __missing__("zoom")}; } ,parse1: function() { var _gthis = this; var v_color = null; var hasv_color = false; var v_contrastColor = null; var hasv_contrastColor = false; var v_url = null; var hasv_url = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("url".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "url") { v_url = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_url = true; } else if("contrastColor".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "contrastColor") { v_contrastColor = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_contrastColor = true; } else if("color".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "color") { v_color = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_color = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { color : hasv_color ? v_color : __missing__("color"), contrastColor : hasv_contrastColor ? v_contrastColor : __missing__("contrastColor"), url : hasv_url ? v_url : __missing__("url")}; } ,parse2: function() { var _gthis = this; var v_buttonLabel = null; var hasv_buttonLabel = false; var v_content = null; var hasv_content = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("content".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "content") { v_content = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_content = true; } else if("buttonLabel".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "buttonLabel") { v_buttonLabel = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_buttonLabel = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { buttonLabel : hasv_buttonLabel ? v_buttonLabel : __missing__("buttonLabel"), content : hasv_content ? v_content : __missing__("content")}; } ,parse3: function() { var _gthis = this; var v_description = null; var hasv_description = false; var v_icon = null; var hasv_icon = false; var v_inOverlay = false; var hasv_inOverlay = false; var v_label = null; var hasv_label = false; var v_link = null; var hasv_link = false; var v_overlayHeight = 0; var hasv_overlayHeight = false; var v_overlayWidth = 0; var hasv_overlayWidth = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("overlayWidth".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "overlayWidth") { var this1 = this.parseNumber(); v_overlayWidth = Std.parseInt(this1.source.substring(this1.min,this1.max)); hasv_overlayWidth = true; } else if("overlayHeight".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "overlayHeight") { var this2 = this.parseNumber(); v_overlayHeight = Std.parseInt(this2.source.substring(this2.min,this2.max)); hasv_overlayHeight = true; } else if("link".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "link") { v_link = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_link = true; } else if("label".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "label") { v_label = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_label = true; } else if("inOverlay".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "inOverlay") { v_inOverlay = this.parseBool(); hasv_inOverlay = true; } else if("icon".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "icon") { v_icon = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_icon = true; } else if("description".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "description") { v_description = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_description = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { description : hasv_description ? v_description : __missing__("description"), icon : hasv_icon ? v_icon : __missing__("icon"), inOverlay : hasv_inOverlay ? v_inOverlay : __missing__("inOverlay"), label : hasv_label ? v_label : __missing__("label"), link : hasv_link ? v_link : __missing__("link"), overlayHeight : hasv_overlayHeight ? v_overlayHeight : __missing__("overlayHeight"), overlayWidth : hasv_overlayWidth ? v_overlayWidth : __missing__("overlayWidth")}; } ,parse4: function() { var _gthis = this; var v_content = null; var hasv_content = false; var v_maxHeight = 0; var hasv_maxHeight = false; var v_maxWidth = 0; var hasv_maxWidth = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("maxWidth".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "maxWidth") { var this1 = this.parseNumber(); v_maxWidth = Std.parseInt(this1.source.substring(this1.min,this1.max)); hasv_maxWidth = true; } else if("maxHeight".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "maxHeight") { var this2 = this.parseNumber(); v_maxHeight = Std.parseInt(this2.source.substring(this2.min,this2.max)); hasv_maxHeight = true; } else if("content".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "content") { v_content = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_content = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { content : hasv_content ? v_content : __missing__("content"), maxHeight : hasv_maxHeight ? v_maxHeight : __missing__("maxHeight"), maxWidth : hasv_maxWidth ? v_maxWidth : __missing__("maxWidth")}; } ,parse5: function() { var _gthis = this; var v_descriptionAsTooltip = null; var v_hideAtItemClick = null; var v_showThumbnails = null; var v_visibleAtStart = null; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("visibleAtStart".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "visibleAtStart") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_visibleAtStart1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_visibleAtStart1 = true; } else { v_visibleAtStart1 = false; } if(v_visibleAtStart1) { v_visibleAtStart = null; } else { v_visibleAtStart = this.parseBool(); } } else if("showThumbnails".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "showThumbnails") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_showThumbnails1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_showThumbnails1 = true; } else { v_showThumbnails1 = false; } if(v_showThumbnails1) { v_showThumbnails = null; } else { v_showThumbnails = this.parseBool(); } } else if("hideAtItemClick".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "hideAtItemClick") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_hideAtItemClick1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_hideAtItemClick1 = true; } else { v_hideAtItemClick1 = false; } if(v_hideAtItemClick1) { v_hideAtItemClick = null; } else { v_hideAtItemClick = this.parseBool(); } } else if("descriptionAsTooltip".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "descriptionAsTooltip") { while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var v_descriptionAsTooltip1; if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) { this.pos += 4; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; v_descriptionAsTooltip1 = true; } else { v_descriptionAsTooltip1 = false; } if(v_descriptionAsTooltip1) { v_descriptionAsTooltip = null; } else { v_descriptionAsTooltip = this.parseBool(); } } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { descriptionAsTooltip : v_descriptionAsTooltip, hideAtItemClick : v_hideAtItemClick, showThumbnails : v_showThumbnails, visibleAtStart : v_visibleAtStart}; } ,parse6: function() { var _gthis = this; var v_pageMode = null; var hasv_pageMode = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("pageMode".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "pageMode") { v_pageMode = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_pageMode = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { pageMode : hasv_pageMode ? v_pageMode : __missing__("pageMode")}; } ,parse7: function() { var _gthis = this; var v_enabled = false; var hasv_enabled = false; var v_link = null; var hasv_link = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("link".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "link") { v_link = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_link = true; } else if("enabled".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "enabled") { v_enabled = this.parseBool(); hasv_enabled = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { enabled : hasv_enabled ? v_enabled : __missing__("enabled"), link : hasv_link ? v_link : __missing__("link")}; } ,parse8: function() { var _gthis = this; var v_enabled = false; var hasv_enabled = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("enabled".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "enabled") { v_enabled = this.parseBool(); hasv_enabled = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { enabled : hasv_enabled ? v_enabled : __missing__("enabled")}; } ,parse9: function() { var _gthis = this; var v_logoBig = null; var hasv_logoBig = false; var v_logoMedium = null; var hasv_logoMedium = false; var v_logoOriginal = null; var hasv_logoOriginal = false; var v_logoSmall = null; var hasv_logoSmall = false; var v_targetLink = null; var hasv_targetLink = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("targetLink".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "targetLink") { v_targetLink = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_targetLink = true; } else if("logoSmall".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logoSmall") { v_logoSmall = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_logoSmall = true; } else if("logoOriginal".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logoOriginal") { v_logoOriginal = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_logoOriginal = true; } else if("logoMedium".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logoMedium") { v_logoMedium = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_logoMedium = true; } else if("logoBig".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logoBig") { v_logoBig = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_logoBig = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { logoBig : hasv_logoBig ? v_logoBig : __missing__("logoBig"), logoMedium : hasv_logoMedium ? v_logoMedium : __missing__("logoMedium"), logoOriginal : hasv_logoOriginal ? v_logoOriginal : __missing__("logoOriginal"), logoSmall : hasv_logoSmall ? v_logoSmall : __missing__("logoSmall"), targetLink : hasv_targetLink ? v_targetLink : __missing__("targetLink")}; } ,parse10: function() { var _gthis = this; var v_allowIconsOnGeo = false; var hasv_allowIconsOnGeo = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("allowIconsOnGeo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "allowIconsOnGeo") { v_allowIconsOnGeo = this.parseBool(); hasv_allowIconsOnGeo = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { allowIconsOnGeo : hasv_allowIconsOnGeo ? v_allowIconsOnGeo : __missing__("allowIconsOnGeo")}; } ,parse11: function() { var _gthis = this; var v_appId = null; var hasv_appId = false; var v_appType = null; var hasv_appType = false; var v_customerId = null; var hasv_customerId = false; var v_epaperId = null; var hasv_epaperId = false; var v_publishTarget = null; var hasv_publishTarget = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("publishTarget".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "publishTarget") { v_publishTarget = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_publishTarget = true; } else if("epaperId".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "epaperId") { v_epaperId = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_epaperId = true; } else if("customerId".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "customerId") { v_customerId = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_customerId = true; } else if("appType".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "appType") { v_appType = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_appType = true; } else if("appId".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "appId") { v_appId = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_appId = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { appId : hasv_appId ? v_appId : __missing__("appId"), appType : hasv_appType ? v_appType : __missing__("appType"), customerId : hasv_customerId ? v_customerId : __missing__("customerId"), epaperId : hasv_epaperId ? v_epaperId : __missing__("epaperId"), publishTarget : hasv_publishTarget ? v_publishTarget : __missing__("publishTarget")}; } ,parse12: function() { var _gthis = this; var v_enabled = false; var hasv_enabled = false; var v_previewDesciption = null; var hasv_previewDesciption = false; var v_previewHeadline = null; var hasv_previewHeadline = false; var v_previewImage = null; var hasv_previewImage = false; var v_withEmail = false; var hasv_withEmail = false; var v_withEmbed = false; var hasv_withEmbed = false; var v_withFacebook = false; var hasv_withFacebook = false; var v_withGplus = false; var hasv_withGplus = false; var v_withLine = false; var hasv_withLine = false; var v_withLinkedIn = false; var hasv_withLinkedIn = false; var v_withPocket = false; var hasv_withPocket = false; var v_withReddit = false; var hasv_withReddit = false; var v_withRenren = false; var hasv_withRenren = false; var v_withSinaweibo = false; var hasv_withSinaweibo = false; var v_withTelegram = false; var hasv_withTelegram = false; var v_withTumblr = false; var hasv_withTumblr = false; var v_withTwitter = false; var hasv_withTwitter = false; var v_withVk = false; var hasv_withVk = false; var v_withWhatsapp = false; var hasv_withWhatsapp = false; var v_withXing = false; var hasv_withXing = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("withXing".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withXing") { v_withXing = this.parseBool(); hasv_withXing = true; } else if("withWhatsapp".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withWhatsapp") { v_withWhatsapp = this.parseBool(); hasv_withWhatsapp = true; } else if("withVk".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withVk") { v_withVk = this.parseBool(); hasv_withVk = true; } else if("withTwitter".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withTwitter") { v_withTwitter = this.parseBool(); hasv_withTwitter = true; } else if("withTumblr".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withTumblr") { v_withTumblr = this.parseBool(); hasv_withTumblr = true; } else if("withTelegram".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withTelegram") { v_withTelegram = this.parseBool(); hasv_withTelegram = true; } else if("withSinaweibo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withSinaweibo") { v_withSinaweibo = this.parseBool(); hasv_withSinaweibo = true; } else if("withRenren".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withRenren") { v_withRenren = this.parseBool(); hasv_withRenren = true; } else if("withReddit".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withReddit") { v_withReddit = this.parseBool(); hasv_withReddit = true; } else if("withPocket".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withPocket") { v_withPocket = this.parseBool(); hasv_withPocket = true; } else if("withLinkedIn".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withLinkedIn") { v_withLinkedIn = this.parseBool(); hasv_withLinkedIn = true; } else if("withLine".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withLine") { v_withLine = this.parseBool(); hasv_withLine = true; } else if("withGplus".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withGplus") { v_withGplus = this.parseBool(); hasv_withGplus = true; } else if("withFacebook".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withFacebook") { v_withFacebook = this.parseBool(); hasv_withFacebook = true; } else if("withEmbed".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withEmbed") { v_withEmbed = this.parseBool(); hasv_withEmbed = true; } else if("withEmail".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withEmail") { v_withEmail = this.parseBool(); hasv_withEmail = true; } else if("previewImage".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "previewImage") { v_previewImage = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_previewImage = true; } else if("previewHeadline".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "previewHeadline") { v_previewHeadline = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_previewHeadline = true; } else if("previewDesciption".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "previewDesciption") { v_previewDesciption = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString()); hasv_previewDesciption = true; } else if("enabled".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "enabled") { v_enabled = this.parseBool(); hasv_enabled = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { enabled : hasv_enabled ? v_enabled : __missing__("enabled"), previewDesciption : hasv_previewDesciption ? v_previewDesciption : __missing__("previewDesciption"), previewHeadline : hasv_previewHeadline ? v_previewHeadline : __missing__("previewHeadline"), previewImage : hasv_previewImage ? v_previewImage : __missing__("previewImage"), withEmail : hasv_withEmail ? v_withEmail : __missing__("withEmail"), withEmbed : hasv_withEmbed ? v_withEmbed : __missing__("withEmbed"), withFacebook : hasv_withFacebook ? v_withFacebook : __missing__("withFacebook"), withGplus : hasv_withGplus ? v_withGplus : __missing__("withGplus"), withLine : hasv_withLine ? v_withLine : __missing__("withLine"), withLinkedIn : hasv_withLinkedIn ? v_withLinkedIn : __missing__("withLinkedIn"), withPocket : hasv_withPocket ? v_withPocket : __missing__("withPocket"), withReddit : hasv_withReddit ? v_withReddit : __missing__("withReddit"), withRenren : hasv_withRenren ? v_withRenren : __missing__("withRenren"), withSinaweibo : hasv_withSinaweibo ? v_withSinaweibo : __missing__("withSinaweibo"), withTelegram : hasv_withTelegram ? v_withTelegram : __missing__("withTelegram"), withTumblr : hasv_withTumblr ? v_withTumblr : __missing__("withTumblr"), withTwitter : hasv_withTwitter ? v_withTwitter : __missing__("withTwitter"), withVk : hasv_withVk ? v_withVk : __missing__("withVk"), withWhatsapp : hasv_withWhatsapp ? v_withWhatsapp : __missing__("withWhatsapp"), withXing : hasv_withXing ? v_withXing : __missing__("withXing")}; } ,parse13: function() { var _gthis = this; var v_defaultZoomMultiplier = 0; var hasv_defaultZoomMultiplier = false; var __start__ = this.pos; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp = true; } else { tmp = false; } if(!tmp) { this.die("Expected {"); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp1; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp1 = true; } else { tmp1 = false; } if(!tmp1) { while(true) { var __name__ = this.parseString(); while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp2; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp2 = true; } else { tmp2 = false; } if(!tmp2) { this.die("Expected :"); } if("defaultZoomMultiplier".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "defaultZoomMultiplier") { var this1 = this.parseNumber(); v_defaultZoomMultiplier = Std.parseInt(this1.source.substring(this1.min,this1.max)); hasv_defaultZoomMultiplier = true; } else { this.skipValue(); } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp3; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp3 = true; } else { tmp3 = false; } if(!tmp3) { break; } } while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; var tmp4; if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) { this.pos += 1; while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++; tmp4 = true; } else { tmp4 = false; } if(!tmp4) { this.die("Expected }"); } } var __missing__ = function(field) { return _gthis.die("missing field \"" + field + "\"",__start__); }; return { defaultZoomMultiplier : hasv_defaultZoomMultiplier ? v_defaultZoomMultiplier : __missing__("defaultZoomMultiplier")}; } ,parse: function(source) { this.init(source); return this.parse0(); } ,__class__: tink_json_Parser2 }); var tink_json_Value = { __ename__ : true, __constructs__ : ["VNumber","VString","VNull","VBool","VArray","VObject"] }; tink_json_Value.VNumber = function(f) { var $x = ["VNumber",0,f]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; }; tink_json_Value.VString = function(s) { var $x = ["VString",1,s]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; }; tink_json_Value.VNull = ["VNull",2]; tink_json_Value.VNull.toString = $estr; tink_json_Value.VNull.__enum__ = tink_json_Value; tink_json_Value.VBool = function(b) { var $x = ["VBool",3,b]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; }; tink_json_Value.VArray = function(a) { var $x = ["VArray",4,a]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; }; tink_json_Value.VObject = function(a) { var $x = ["VObject",5,a]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; }; var tink_json_BasicWriter = function() { this.plugins = new tink_core_Annex(this); }; tink_json_BasicWriter.__name__ = ["tink","json","BasicWriter"]; tink_json_BasicWriter.prototype = { init: function() { var this1 = ""; this.buf = this1; } ,__class__: tink_json_BasicWriter }; var tink_json_Writer0 = function() { tink_json_BasicWriter.call(this); }; tink_json_Writer0.__name__ = ["tink","json","Writer0"]; tink_json_Writer0.__super__ = tink_json_BasicWriter; tink_json_Writer0.prototype = $extend(tink_json_BasicWriter.prototype,{ parse0: function(value) { this.buf += "{\"page\":"; var value1 = value.page; this.parse1(value1); this.buf += "}"; } ,parse1: function(value) { this.buf += "{\"bbox\":"; var value1 = value.bbox; var s = JSON.stringify(value1); this.buf += s; this.buf += ",\"id\":"; var value2 = value.id; this.buf += value2 == null ? "null" : "" + value2; this.buf += ",\"rotate\":"; var value3 = value.rotate; if(value3 == null) { this.buf += "null"; } else { var s1 = JSON.stringify(value3); this.buf += s1; } this.buf += ",\"textbox\":"; var value4 = value.textbox; this.buf += "["; var first = true; var _g = 0; while(_g < value4.length) { var value5 = value4[_g]; ++_g; if(first) { first = false; } else { this.buf += ","; } this.parse2(value5); } this.buf += "]"; this.buf += "}"; } ,parse2: function(value) { this.buf += "{\"bbox\":"; var value1 = value.bbox; var s = JSON.stringify(value1); this.buf += s; this.buf += ",\"id\":"; var value2 = value.id; this.buf += value2 == null ? "null" : "" + value2; this.buf += ",\"textline\":"; var value3 = value.textline; this.buf += "["; var first = true; var _g = 0; while(_g < value3.length) { var value4 = value3[_g]; ++_g; if(first) { first = false; } else { this.buf += ","; } this.parse3(value4); } this.buf += "]"; this.buf += "}"; } ,parse3: function(value) { this.buf += "{\"text\":"; var value1 = value.text; this.buf += "["; var first = true; var _g = 0; while(_g < value1.length) { var value2 = value1[_g]; ++_g; if(first) { first = false; } else { this.buf += ","; } this.parse4(value2); } this.buf += "]"; this.buf += "}"; } ,parse4: function(value) { this.buf += "{\"bbox\":"; var value1 = value.bbox; if(value1 == null) { this.buf += "null"; } else { var s = JSON.stringify(value1); this.buf += s; } this.buf += ",\"character\":"; var value2 = value.character; if(value2 == null) { this.buf += "null"; } else { var s1 = JSON.stringify(value2); this.buf += s1; } this.buf += "}"; } ,write: function(value) { this.init(); this.parse0(value); return this.buf.toString(); } ,__class__: tink_json_Writer0 }); var tink_pure__$List_List_$Impl_$ = {}; tink_pure__$List_List_$Impl_$.__name__ = ["tink","pure","_List","List_Impl_"]; tink_pure__$List_List_$Impl_$.fromArray = function(i) { var ret = null; var len = 0; var pos = i.length; while(pos-- > 0) ret = new tink_pure__$List_Node(++len,i[pos],ret == null ? tink_pure__$List_Node.EMPTY : [ret]); return ret; }; var tink_pure__$List_Node = function(length,value,tails) { this.value = value; this.length = length; this.tails = tails == null ? tink_pure__$List_Node.EMPTY : tails; }; tink_pure__$List_Node.__name__ = ["tink","pure","_List","Node"]; tink_pure__$List_Node.prototype = { __class__: tink_pure__$List_Node }; var tink_pure_NodeIterator = function(node) { this.list = []; if(node != null) { this.list.push(node); } }; tink_pure_NodeIterator.__name__ = ["tink","pure","NodeIterator"]; tink_pure_NodeIterator.prototype = { hasNext: function() { return this.list.length > 0; } ,next: function() { var _g = this.list.pop(); if(_g == null) { return null; } else { var next = _g; var _g1 = -next.tails.length; while(_g1 < 0) { var i = _g1++; this.list.push(next.tails[-i - 1]); } return next.value; } } ,__class__: tink_pure_NodeIterator }; var tink_state__$Observable_Observable_$Impl_$ = {}; tink_state__$Observable_Observable_$Impl_$.__name__ = ["tink","state","_Observable","Observable_Impl_"]; tink_state__$Observable_Observable_$Impl_$.get_value = function(this1) { return tink_state__$Observable_Observable_$Impl_$.measure(this1).a; }; tink_state__$Observable_Observable_$Impl_$.combine = function(this1,that,f) { return new tink_state__$Observable_SimpleObservable(function() { var p = tink_state__$Observable_Observable_$Impl_$.measure(this1); var q = tink_state__$Observable_Observable_$Impl_$.measure(that); var this2; var this3 = new tink_core_MPair(f(p.a,q.a),tink_core__$Future_Future_$Impl_$.first(p.b,q.b)); this2 = this3; return this2; }); }; tink_state__$Observable_Observable_$Impl_$.nextTime = function(this1,options,check) { return tink_state__$Observable_Observable_$Impl_$.getNext(this1,options,function(v) { if(check(v)) { return haxe_ds_Option.Some(v); } else { return haxe_ds_Option.None; } }); }; tink_state__$Observable_Observable_$Impl_$.getNext = function(this1,options,select) { var ret = new tink_core_FutureTrigger(); var waiting = options != null && options.butNotNow; var link = tink_state__$Observable_Observable_$Impl_$.bind(this1,{ direct : options != null && options.hires},function(value) { var out = select(value); if(waiting) { waiting = out != haxe_ds_Option.None; } else { switch(out[1]) { case 0: var value1 = out[2]; ret.trigger(value1); break; case 1: break; } } }); var _e = link; var tmp = function() { if(_e != null) { _e.dissolve(); } }; ret.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(tmp)); return ret; }; tink_state__$Observable_Observable_$Impl_$.map = function(this1,f) { return tink_state__$Observable_Observable_$Impl_$.create(function() { var m = tink_state__$Observable_Observable_$Impl_$.measure(this1); var this2; var this3 = new tink_core_MPair(f(m.a),m.b); this2 = this3; return this2; }); }; tink_state__$Observable_Observable_$Impl_$.measure = function(this1) { var before = tink_state__$Observable_Observable_$Impl_$.stack.first(); tink_state__$Observable_Observable_$Impl_$.stack.push(this1); var p = this1.poll(); var _g = (before instanceof tink_state__$Observable_AutoObservable) ? before : null; if(_g != null) { var v = _g; p.b.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic($bind(v,v.invalidate))); } tink_state__$Observable_Observable_$Impl_$.stack.pop(); return p; }; tink_state__$Observable_Observable_$Impl_$.bind = function(this1,options,cb) { if(options == null) { var scheduled = false; var active = true; var updated = null; var link = null; var update = function() { if(active) { var next = tink_state__$Observable_Observable_$Impl_$.measure(this1); tink_core__$Callback_Callback_$Impl_$.invoke(cb,next.a); scheduled = false; link = next.b.handle(updated); } }; var doSchedule = function() { if(scheduled) { return; } scheduled = true; tink_state__$Observable_Observable_$Impl_$.schedule(update); }; updated = tink_core__$Callback_Callback_$Impl_$.fromNiladic(doSchedule); doSchedule(); var this2 = new tink_core__$Callback_SimpleLink(function() { if(active) { active = false; if(link != null) { link.dissolve(); } } }); return this2; } else if(options.direct == null) { var scheduled1 = false; var active1 = true; var updated1 = null; var link1 = null; var update1 = function() { if(active1) { var next1 = tink_state__$Observable_Observable_$Impl_$.measure(this1); tink_core__$Callback_Callback_$Impl_$.invoke(cb,next1.a); scheduled1 = false; link1 = next1.b.handle(updated1); } }; var doSchedule1 = function() { if(scheduled1) { return; } scheduled1 = true; tink_state__$Observable_Observable_$Impl_$.schedule(update1); }; updated1 = tink_core__$Callback_Callback_$Impl_$.fromNiladic(doSchedule1); doSchedule1(); var this3 = new tink_core__$Callback_SimpleLink(function() { if(active1) { active1 = false; if(link1 != null) { link1.dissolve(); } } }); return this3; } else if(options.direct == false) { var scheduled2 = false; var active2 = true; var updated2 = null; var link2 = null; var update2 = function() { if(active2) { var next2 = tink_state__$Observable_Observable_$Impl_$.measure(this1); tink_core__$Callback_Callback_$Impl_$.invoke(cb,next2.a); scheduled2 = false; link2 = next2.b.handle(updated2); } }; var doSchedule2 = function() { if(scheduled2) { return; } scheduled2 = true; tink_state__$Observable_Observable_$Impl_$.schedule(update2); }; updated2 = tink_core__$Callback_Callback_$Impl_$.fromNiladic(doSchedule2); doSchedule2(); var this4 = new tink_core__$Callback_SimpleLink(function() { if(active2) { active2 = false; if(link2 != null) { link2.dissolve(); } } }); return this4; } else { var link3 = null; var update3 = null; update3 = function(_) { var next3 = tink_state__$Observable_Observable_$Impl_$.measure(this1); tink_core__$Callback_Callback_$Impl_$.invoke(cb,next3.a); link3 = next3.b.handle(update3); }; var update4 = update3; update4(tink_core_Noise.Noise); var this5 = new tink_core__$Callback_SimpleLink(function() { if(link3 != null) { link3.dissolve(); } }); return this5; } }; tink_state__$Observable_Observable_$Impl_$.schedule = function(f) { var _g = tink_state__$Observable_Observable_$Impl_$.scheduled; if(_g == null) { f(); } else { var v = _g; v.push(f); tink_state__$Observable_Observable_$Impl_$.scheduleUpdate(); } }; tink_state__$Observable_Observable_$Impl_$.scheduleUpdate = function() { if(!tink_state__$Observable_Observable_$Impl_$.isScheduled) { tink_state__$Observable_Observable_$Impl_$.isScheduled = true; if(tink_state__$Observable_Observable_$Impl_$.hasRAF) { window.requestAnimationFrame(function(_) { tink_state__$Observable_Observable_$Impl_$.scheduledRun(); }); } else { tink_core__$Callback_Callback_$Impl_$.defer(tink_state__$Observable_Observable_$Impl_$.scheduledRun); } } }; tink_state__$Observable_Observable_$Impl_$.scheduledRun = function() { tink_state__$Observable_Observable_$Impl_$.isScheduled = false; tink_state__$Observable_Observable_$Impl_$.updatePending(); }; tink_state__$Observable_Observable_$Impl_$.updatePending = function(maxSeconds) { if(maxSeconds == null) { maxSeconds = .01; } var end = new Date().getTime() / 1000 + maxSeconds; while(true) { var old = tink_state__$Observable_Observable_$Impl_$.scheduled; tink_state__$Observable_Observable_$Impl_$.scheduled = []; var _g = 0; while(_g < old.length) { var o = old[_g]; ++_g; o(); } if(!(tink_state__$Observable_Observable_$Impl_$.scheduled.length > 0 && new Date().getTime() / 1000 < end)) { break; } } if(tink_state__$Observable_Observable_$Impl_$.scheduled.length > 0) { tink_state__$Observable_Observable_$Impl_$.scheduleUpdate(); return true; } else { return false; } }; tink_state__$Observable_Observable_$Impl_$.create = function(f) { return new tink_state__$Observable_SimpleObservable(f); }; tink_state__$Observable_Observable_$Impl_$.auto = function(f) { return new tink_state__$Observable_AutoObservable(f); }; tink_state__$Observable_Observable_$Impl_$["const"] = function(value) { return new tink_state_ConstObservable(value); }; var tink_state_ObservableObject = function() { }; tink_state_ObservableObject.__name__ = ["tink","state","ObservableObject"]; tink_state_ObservableObject.prototype = { __class__: tink_state_ObservableObject }; var tink_state__$Observable_SimpleObservable = function(f) { this._poll = f; }; tink_state__$Observable_SimpleObservable.__name__ = ["tink","state","_Observable","SimpleObservable"]; tink_state__$Observable_SimpleObservable.__interfaces__ = [tink_state_ObservableObject]; tink_state__$Observable_SimpleObservable.prototype = { resetCache: function(_) { this.cache = null; } ,poll: function() { var count = 0; var last = null; while(this.cache == null) { var cache = this.cache = this._poll(); if(last == cache) { throw new js__$Boot_HaxeError("Polling loops on the same value"); } last = cache; cache.b.handle($bind(this,this.resetCache)); if(count++ >= 100) { throw new js__$Boot_HaxeError("Polling not concluded after 100 iterations"); } } return this.cache; } ,__class__: tink_state__$Observable_SimpleObservable }; var tink_state__$Observable_Transform_$Impl_$ = {}; tink_state__$Observable_Transform_$Impl_$.__name__ = ["tink","state","_Observable","Transform_Impl_"]; tink_state__$Observable_Transform_$Impl_$.plain = function(f) { var this1 = f; return this1; }; var tink_state_ConstObservable = function(value) { var this1; var this2 = new tink_core_MPair(value,tink_state_ConstObservable.NEVER); this1 = this2; this.m = this1; }; tink_state_ConstObservable.__name__ = ["tink","state","ConstObservable"]; tink_state_ConstObservable.__interfaces__ = [tink_state_ObservableObject]; tink_state_ConstObservable.prototype = { poll: function() { return this.m; } ,__class__: tink_state_ConstObservable }; var tink_state__$Observable_AutoObservable = function(comp) { var _gthis = this; tink_state__$Observable_SimpleObservable.call(this,function() { _gthis.trigger = new tink_core_FutureTrigger(); var this1; var this2 = new tink_core_MPair(comp.f(),_gthis.trigger); this1 = this2; return this1; }); }; tink_state__$Observable_AutoObservable.__name__ = ["tink","state","_Observable","AutoObservable"]; tink_state__$Observable_AutoObservable.__super__ = tink_state__$Observable_SimpleObservable; tink_state__$Observable_AutoObservable.prototype = $extend(tink_state__$Observable_SimpleObservable.prototype,{ invalidate: function() { this.trigger.trigger(tink_core_Noise.Noise); } ,__class__: tink_state__$Observable_AutoObservable }); var tink_state__$State_State_$Impl_$ = {}; tink_state__$State_State_$Impl_$.__name__ = ["tink","state","_State","State_Impl_"]; tink_state__$State_State_$Impl_$.get_value = function(this1) { return tink_state__$Observable_Observable_$Impl_$.get_value(this1); }; tink_state__$State_State_$Impl_$.toggle = function(s) { s.set(!s.value); }; tink_state__$State_State_$Impl_$.ofConstant = function(value) { var this1 = new tink_state__$State_StateObject(value,null); return this1; }; var tink_state__$State_StateObject = function(value,isEqual) { this.value = value; var tmp; if(isEqual == null) { tmp = function(a,b) { return a == b; }; } else { var v = isEqual; tmp = v; } this.isEqual = tmp; this.arm(); }; tink_state__$State_StateObject.__name__ = ["tink","state","_State","StateObject"]; tink_state__$State_StateObject.__interfaces__ = [tink_state_ObservableObject]; tink_state__$State_StateObject.prototype = { poll: function() { return this.next; } ,arm: function() { this.trigger = new tink_core_FutureTrigger(); var this1; var this2 = new tink_core_MPair(this.value,this.trigger); this1 = this2; this.next = this1; } ,set: function(value) { if(!this.isEqual(value,this.value)) { this.value = value; var last = this.trigger; this.arm(); last.trigger(tink_core_Noise.Noise); } } ,__class__: tink_state__$State_StateObject }; var tink_template__$Html_Html_$Impl_$ = {}; tink_template__$Html_Html_$Impl_$.__name__ = ["tink","template","_Html","Html_Impl_"]; tink_template__$Html_Html_$Impl_$.escape = function(s) { if(s == null) { return null; } if(s == null) { s = "null"; } else { s = "" + s; } var start = 0; var pos = 0; var max = s.length; var ret = ""; while(pos < max) { var _g = s.charAt(pos++); switch(_g) { case "\"": var start1 = start; start = pos; ret += s.substring(start1,start - 1) + """; break; case "&": var start2 = start; start = pos; ret += s.substring(start2,start - 1) + "&"; break; case "<": var start3 = start; start = pos; ret += s.substring(start3,start - 1) + "<"; break; case ">": var start4 = start; start = pos; ret += s.substring(start4,start - 1) + ">"; break; } } var this1 = ret += HxOverrides.substr(s,start,null); return this1; }; tink_template__$Html_Html_$Impl_$.of = function(a) { return tink_template__$Html_Html_$Impl_$.escape(Std.string(a)); }; tink_template__$Html_Html_$Impl_$.buffer = function() { var this1 = { s : ""}; return this1; }; var tink_url__$Portion_Portion_$Impl_$ = {}; tink_url__$Portion_Portion_$Impl_$.__name__ = ["tink","url","_Portion","Portion_Impl_"]; tink_url__$Portion_Portion_$Impl_$.stringly = function(this1) { return tink_url__$Portion_Portion_$Impl_$.toString(this1); }; tink_url__$Portion_Portion_$Impl_$.toString = function(this1) { if(this1 == null) { return null; } else { return decodeURIComponent(this1.split("+").join(" ")); } }; tink_url__$Portion_Portion_$Impl_$.ofString = function(s) { var this1 = s == null ? "" : encodeURIComponent(s); return this1; }; var tink_url__$Query_QueryStringParser = function(s,sep,set,pos) { this.s = s == null ? "" : s; this.sep = sep; this.set = set; this.pos = pos; }; tink_url__$Query_QueryStringParser.__name__ = ["tink","url","_Query","QueryStringParser"]; tink_url__$Query_QueryStringParser.trimmedSub = function(s,start,end) { if(start >= s.length) { var this1 = ""; return this1; } while(s.charCodeAt(start) < 33) ++start; if(end < s.length - 1) { while(s.charCodeAt(end - 1) < 33) --end; } var this2 = s.substring(start,end); return this2; }; tink_url__$Query_QueryStringParser.prototype = { hasNext: function() { return this.pos < this.s.length; } ,next: function() { var next = this.s.indexOf(this.sep,this.pos); if(next == -1) { next = this.s.length; } var split = this.s.indexOf(this.set,this.pos); var start = this.pos; this.pos = next + this.sep.length; if(split == -1 || split > next) { return new tink_core_NamedWith(tink_url__$Portion_Portion_$Impl_$.stringly(tink_url__$Query_QueryStringParser.trimmedSub(this.s,start,next)),tink_url__$Portion_Portion_$Impl_$.ofString("")); } else { return new tink_core_NamedWith(tink_url__$Portion_Portion_$Impl_$.stringly(tink_url__$Query_QueryStringParser.trimmedSub(this.s,start,split)),tink_url__$Query_QueryStringParser.trimmedSub(this.s,split + this.set.length,next)); } } ,__class__: tink_url__$Query_QueryStringParser }; var tink_xml_Reader = function() { }; tink_xml_Reader.__name__ = ["tink","xml","Reader"]; tink_xml_Reader.prototype = { doRead: function(x) { throw new js__$Boot_HaxeError("abstract"); } ,read: function(x) { try { return tink_core_Outcome.Success(this.doRead(x)); } catch( $e0 ) { if ($e0 instanceof js__$Boot_HaxeError) $e0 = $e0.val; if( js_Boot.__instanceof($e0,tink_xml_ReaderError) ) { var e = $e0; return tink_core_Outcome.Failure(e); } else { var e1 = $e0; return tink_core_Outcome.Failure(new tink_xml_ReaderError("error \"" + Std.string(e1) + "\"",x,{ fileName : "Reader.hx", lineNumber : 21, className : "tink.xml.Reader", methodName : "read"})); } } } ,__class__: tink_xml_Reader }; var tink_xml_Parser_$0 = function() { tink_xml_Reader.call(this); }; tink_xml_Parser_$0.__name__ = ["tink","xml","Parser_0"]; tink_xml_Parser_$0.__super__ = tink_xml_Reader; tink_xml_Parser_$0.prototype = $extend(tink_xml_Reader.prototype,{ doRead: function(x) { var page = false; var ret = { page : null}; var i = 0; var x1 = x.elements(); while(x1.hasNext()) { var x2 = x1.next(); var n = ++i; var a = x2.get_name(); var this1 = "page".toUpperCase(); if(a == this1) { if(!page) { page = true; ret.page = tink_xml_Parser_$1.inst.doRead(x2); } else { throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Duplicate element \"page\"",x2,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_0", methodName : "doRead"})); } continue; } } if(!page) { throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing element \"page\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_0", methodName : "doRead"})); } return ret; } ,__class__: tink_xml_Parser_$0 }); var tink_xml_Parser_$1 = function() { tink_xml_Reader.call(this); }; tink_xml_Parser_$1.__name__ = ["tink","xml","Parser_1"]; tink_xml_Parser_$1.__super__ = tink_xml_Reader; tink_xml_Parser_$1.prototype = $extend(tink_xml_Reader.prototype,{ doRead: function(x) { var ret = { bbox : null, id : null, textbox : []}; var i = 0; var x1 = x.elements(); while(x1.hasNext()) { var x2 = x1.next(); var n = ++i; var a = x2.get_name(); var this1 = "textbox".toUpperCase(); if(a == this1) { ret.textbox.push(tink_xml_Parser_$2.inst.doRead(x2)); continue; } } var _g = x.getAttribute("bbox"); if(_g == null) { throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing attribute \"bbox\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_1", methodName : "doRead"})); } else { var v = _g; ret.bbox = v; } var _g1 = x.getAttribute("id"); if(_g1 == null) { throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing attribute \"id\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_1", methodName : "doRead"})); } else { var v1 = _g1; ret.id = v1 == null ? 0 : Std.parseInt(StringTools.trim(v1)); } var _g2 = x.getAttribute("rotate"); if(_g2 != null) { var v2 = _g2; ret.rotate = v2; } return ret; } ,__class__: tink_xml_Parser_$1 }); var tink_xml_Parser_$2 = function() { tink_xml_Reader.call(this); }; tink_xml_Parser_$2.__name__ = ["tink","xml","Parser_2"]; tink_xml_Parser_$2.__super__ = tink_xml_Reader; tink_xml_Parser_$2.prototype = $extend(tink_xml_Reader.prototype,{ doRead: function(x) { var ret = { bbox : null, id : null, textline : []}; var i = 0; var x1 = x.elements(); while(x1.hasNext()) { var x2 = x1.next(); var n = ++i; var a = x2.get_name(); var this1 = "textline".toUpperCase(); if(a == this1) { ret.textline.push(tink_xml_Parser_$3.inst.doRead(x2)); continue; } } var _g = x.getAttribute("bbox"); if(_g == null) { throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing attribute \"bbox\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_2", methodName : "doRead"})); } else { var v = _g; ret.bbox = v; } var _g1 = x.getAttribute("id"); if(_g1 == null) { throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing attribute \"id\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_2", methodName : "doRead"})); } else { var v1 = _g1; ret.id = v1 == null ? 0 : Std.parseInt(StringTools.trim(v1)); } return ret; } ,__class__: tink_xml_Parser_$2 }); var tink_xml_Parser_$3 = function() { tink_xml_Reader.call(this); }; tink_xml_Parser_$3.__name__ = ["tink","xml","Parser_3"]; tink_xml_Parser_$3.__super__ = tink_xml_Reader; tink_xml_Parser_$3.prototype = $extend(tink_xml_Reader.prototype,{ doRead: function(x) { var ret = { text : []}; var i = 0; var x1 = x.elements(); while(x1.hasNext()) { var x2 = x1.next(); var n = ++i; var a = x2.get_name(); var this1 = "text".toUpperCase(); if(a == this1) { ret.text.push(tink_xml_Parser_$4.inst.doRead(x2)); continue; } } return ret; } ,__class__: tink_xml_Parser_$3 }); var tink_xml_Parser_$4 = function() { tink_xml_Reader.call(this); }; tink_xml_Parser_$4.__name__ = ["tink","xml","Parser_4"]; tink_xml_Parser_$4.__super__ = tink_xml_Reader; tink_xml_Parser_$4.prototype = $extend(tink_xml_Reader.prototype,{ doRead: function(x) { var ret = { character : x.getText()}; var i = 0; var x1 = x.elements(); while(x1.hasNext()) { var x2 = x1.next(); var n = ++i; } var _g = x.getAttribute("bbox"); if(_g != null) { var v = _g; ret.bbox = v; } return ret; } ,__class__: tink_xml_Parser_$4 }); var tink_xml_ReaderError = function(msg,data,pos) { tink_core_TypedError.call(this,422,msg,pos); this.data = data; }; tink_xml_ReaderError.__name__ = ["tink","xml","ReaderError"]; tink_xml_ReaderError.__super__ = tink_core_TypedError; tink_xml_ReaderError.prototype = $extend(tink_core_TypedError.prototype,{ toString: function() { return "" + this.message + " at element:" + this.data.toString(); } ,__class__: tink_xml_ReaderError }); var tink_xml__$Source_Source_$Impl_$ = {}; tink_xml__$Source_Source_$Impl_$.__name__ = ["tink","xml","_Source","Source_Impl_"]; tink_xml__$Source_Source_$Impl_$.fromString = function(s) { try { return tink_xml__$Source_Source_$Impl_$.fromXml(Xml.parse(s)); } catch( e ) { if (e instanceof js__$Boot_HaxeError) e = e.val; return new tink_xml__$Source_InvalidSource(s,e); } }; tink_xml__$Source_Source_$Impl_$.fromXml = function(x) { var _g = x.nodeType; return new tink_xml__$Source_XmlSource(_g == 6 ? x.firstElement() : x); }; var tink_xml_ISource = function() { }; tink_xml_ISource.__name__ = ["tink","xml","ISource"]; tink_xml_ISource.prototype = { __class__: tink_xml_ISource }; var tink_xml__$Source_InvalidSource = function(source,error) { this.source = source; this.error = new tink_xml_ReaderError("Failed to parse Xml because " + Std.string(error),this,{ fileName : "Source.hx", lineNumber : 75, className : "tink.xml._Source.InvalidSource", methodName : "new"}); }; tink_xml__$Source_InvalidSource.__name__ = ["tink","xml","_Source","InvalidSource"]; tink_xml__$Source_InvalidSource.__interfaces__ = [tink_xml_ISource]; tink_xml__$Source_InvalidSource.prototype = { get_name: function() { throw new js__$Boot_HaxeError(this.error); } ,getText: function() { throw new js__$Boot_HaxeError(this.error); } ,getAttribute: function(name) { throw new js__$Boot_HaxeError(this.error); } ,elements: function() { throw new js__$Boot_HaxeError(this.error); } ,toString: function() { return this.source; } ,__class__: tink_xml__$Source_InvalidSource }; var tink_xml__$Source_XmlSource = function(x) { this.x = x; }; tink_xml__$Source_XmlSource.__name__ = ["tink","xml","_Source","XmlSource"]; tink_xml__$Source_XmlSource.__interfaces__ = [tink_xml_ISource]; tink_xml__$Source_XmlSource.prototype = { get_name: function() { var _this = this.x; if(_this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + _this.nodeType); } var this1 = _this.nodeName.toUpperCase(); return this1; } ,getText: function() { var _g = []; var _this = this.x; if(_this.nodeType != Xml.Document && _this.nodeType != Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + _this.nodeType); } var c = HxOverrides.iter(_this.children); while(c.hasNext()) { var c1 = c.next(); if(c1.nodeType != Xml.Comment) { var tmp; try { if(c1.nodeType == Xml.Document || c1.nodeType == Xml.Element) { throw new js__$Boot_HaxeError("Bad node type, unexpected " + c1.nodeType); } tmp = c1.nodeValue; } catch( e ) { tmp = haxe_xml_Printer.print(c1); } _g.push(tmp); } } return _g.join(""); } ,getAttribute: function(name) { return this.x.get(name); } ,elements: function() { var ret = this.x.elements(); return { hasNext : function() { return ret.hasNext(); }, next : function() { return new tink_xml__$Source_XmlSource(ret.next()); }}; } ,toString: function() { return haxe_xml_Printer.print(this.x); } ,__class__: tink_xml__$Source_XmlSource }; var util_touch_TouchHandler = function() { this._tap = new tink_core_SignalTrigger(); this._move = new tink_core_SignalTrigger(); this._jet = new tink_core_SignalTrigger(); this._pinch = new tink_core_SignalTrigger(); this.pinch = this._pinch; this.jet = this._jet; this.move = this._move; this.tap = this._tap; this.trails = new haxe_ds_IntMap(); var root = window.document.body.querySelector(".epaper-root"); root.addEventListener("touchstart",$bind(this,this.touchstart),true); root.addEventListener("touchmove",$bind(this,this.touchmove),true); root.addEventListener("touchend",$bind(this,this.touchend),true); }; util_touch_TouchHandler.__name__ = ["util","touch","TouchHandler"]; util_touch_TouchHandler.prototype = { array: function(t) { var __tmp = []; var _g = 0; while(_g < t.length) { var t1 = t[_g]; ++_g; __tmp.push(t1); } return __tmp; } ,target: function(t) { return t.target; } ,touchstart: function(t) { var _g = 0; var _g1 = t.changedTouches; while(_g < _g1.length) { var t1 = _g1[_g]; ++_g; var this1 = this.trails; var k = t1.identifier; var v = new util_touch_TouchTrail(t1); this1.h[k] = v; } if(Lambda.count(this.trails) > 1) { var t2 = this.trails.iterator(); while(t2.hasNext()) { var t3 = t2.next(); t3.dirty = true; } } var _g2 = this.array(t.touches); if(_g2.length == 1) { var v1 = _g2[0]; var cur = this.target(t); while(cur != null) { var style = window.getComputedStyle(cur); var _g3 = style.overflowY; var _g11 = style.overflowX; switch(_g11) { case "auto":case "scroll": return; default: switch(_g3) { case "auto":case "scroll": return; default: cur = cur.parentElement; } } } if(!util_touch_TouchHandler.isAnroid) { t.preventDefault(); } } else { var v2 = _g2; if(!util_touch_TouchHandler.isAnroid) { t.preventDefault(); } } } ,touchmove: function(t) { var _gthis = this; var _g = 0; var _g1 = t.changedTouches; while(_g < _g1.length) { var t1 = _g1[_g]; ++_g; this.trails.h[t1.identifier].add(t1); } var _g2 = this.array(t.touches).map(function(t2) { return _gthis.trails.get(t2.identifier); }); switch(_g2.length) { case 1: var t3 = _g2[0]; var _this = this._move; var a = t3.get(-1).point; var b = t3.get(-2).point; var this1; var this2 = new tink_core_MPair(a.a - b.a,a.b - b.b); this1 = this2; var event = { delta : this1, pos : t3.get(-1).point, target : t3.target}; tink_core__$Callback_CallbackList_$Impl_$.invoke(_this.handlers,event); break; case 2: var t21 = _g2[1]; var t11 = _g2[0]; var a1 = t11.get_last().point; var b1 = t21.get_last().point; var this3; var this4 = new tink_core_MPair(a1.a - b1.a,a1.b - b1.b); this3 = this4; var this5 = this3; var nuDist = Math.sqrt(this5.a * this5.a + this5.b * this5.b); var a2 = t11.get(-2).point; var b2 = t21.get(-2).point; var this6; var this7 = new tink_core_MPair(a2.a - b2.a,a2.b - b2.b); this6 = this7; var this8 = this6; var oldDist = Math.sqrt(this8.a * this8.a + this8.b * this8.b); var a3 = t11.get_last().point; var b3 = t21.get_last().point; var this9; var this10 = new tink_core_MPair(a3.a + b3.a,a3.b + b3.b); this9 = this10; var p = this9; var this11; var this12 = new tink_core_MPair(p.a * .5,p.b * .5); this11 = this12; var center = this11; var scale = nuDist / oldDist; tink_core__$Callback_CallbackList_$Impl_$.invoke(this._pinch.handlers,{ scale : scale, center : center, target : t11.target}); t.preventDefault(); break; default: } } ,touchend: function(t) { if(t.touches.length == 0) { var _g = this.trails.get(t.changedTouches[0].identifier); var v = _g; if(!v.dirty) { var a = v.get(0).point; var b = v.get(-1).point; var this1; var this2 = new tink_core_MPair(a.a - b.a,a.b - b.b); this1 = this2; var this3 = this1; if(Math.sqrt(this3.a * this3.a + this3.b * this3.b) < 10) { if(!util_touch_TouchHandler.isAnroid) { var target = this.target(t); if(target.nodeName != "INPUT") { t.preventDefault(); } util_touch_TouchHandler.isFakeClick = true; try { target.focus(); var lT = t.changedTouches[0]; var evt1 = window.document.createEvent("MouseEvents"); evt1.initMouseEvent("click",true,true,window,1,lT.screenX,lT.screenY,lT.clientX,lT.clientX,false,false,false,false,0,null); target.dispatchEvent(evt1); util_touch_TouchHandler.isFakeClick = false; } catch( e ) { var $hx_rethrow = e; util_touch_TouchHandler.isFakeClick = false; throw $hx_rethrow; } } } else { var _this = this._jet; var event = { v : v.get_lastVelocity(), pos : v.get_last().point, target : v.target}; tink_core__$Callback_CallbackList_$Impl_$.invoke(_this.handlers,event); } } } var _g1 = 0; var _g11 = t.changedTouches; while(_g1 < _g11.length) { var t1 = _g11[_g1]; ++_g1; this.trails.remove(t1.identifier); } } ,get_pinch: function() { return this.pinch; } ,get_jet: function() { return this.jet; } ,get_move: function() { return this.move; } ,__class__: util_touch_TouchHandler }; var util_touch_TouchTrail = function(touch) { this.dirty = false; this.touch = touch; this.target = touch.target; this.steps = [new util_touch_TouchStep(touch)]; }; util_touch_TouchTrail.__name__ = ["util","touch","TouchTrail"]; util_touch_TouchTrail.prototype = { get: function(i) { while(i < 0) i += this.steps.length; return this.steps[i]; } ,add: function(touch) { this.steps.push(new util_touch_TouchStep(touch)); } ,get_last: function() { return this.get(-1); } ,get_lastTimeDelta: function() { return this.get(-1).stamp - this.get(-2).stamp; } ,get_lastMovement: function() { var a = this.get(-1).point; var b = this.get(-2).point; var this1; var this2 = new tink_core_MPair(a.a - b.a,a.b - b.b); this1 = this2; return this1; } ,get_lastVelocity: function() { var p = this.get_lastMovement(); var f = 1 / this.get_lastTimeDelta(); var this1; var this2 = new tink_core_MPair(p.a * f,p.b * f); this1 = this2; return this1; } ,__class__: util_touch_TouchTrail }; var util_touch_TouchStep = function(t) { this.stamp = new Date().getTime() / 1000; var this1; var this2 = new tink_core_MPair(t.clientX,t.clientY); this1 = this2; this.point = this1; }; util_touch_TouchStep.__name__ = ["util","touch","TouchStep"]; util_touch_TouchStep.prototype = { __class__: util_touch_TouchStep }; var vdom__$Attr_ClassName_$Impl_$ = {}; vdom__$Attr_ClassName_$Impl_$.__name__ = ["vdom","_Attr","ClassName_Impl_"]; vdom__$Attr_ClassName_$Impl_$.ofMap = function(parts) { var _g = []; var c = parts.keys(); while(c.hasNext()) { var c1 = c.next(); if(__map_reserved[c1] != null ? parts.getReserved(c1) : parts.h[c1]) { _g.push(vdom__$Attr_ClassName_$Impl_$.ofString(c1)); } } var this1 = vdom__$Attr_ClassName_$Impl_$.ofArray(_g); return this1; }; vdom__$Attr_ClassName_$Impl_$.ofArray = function(parts) { var this1 = parts.map(vdom__$Attr_ClassName_$Impl_$.ofString).join(" "); return this1; }; vdom__$Attr_ClassName_$Impl_$.ofString = function(s) { var this1 = StringTools.trim(s); return this1; }; var vdom__$Attr_Key_$Impl_$ = {}; vdom__$Attr_Key_$Impl_$.__name__ = ["vdom","_Attr","Key_Impl_"]; vdom__$Attr_Key_$Impl_$.ofObj = function(v) { if(v == null) { return null; } var o = v; if(o.__vdomKey__ == null) { o.__vdomKey__ = vdom__$Attr_Key_$Impl_$.keygen++; } return o.__vdomKey__; }; var vdom_Foreign = function(e) { vdom_Widget.call(this); this.element = e; }; vdom_Foreign.__name__ = ["vdom","Foreign"]; vdom_Foreign.__super__ = vdom_Widget; vdom_Foreign.prototype = $extend(vdom_Widget.prototype,{ init: function() { return this.element; } ,update: function(_,_1) { return this.element; } ,__class__: vdom_Foreign }); var vdom_HtmlFragment = function(content,tag,className) { if(tag == null) { tag = "span"; } vdom_Widget.call(this); this.content = content; this.tag = tag; this.className = className; }; vdom_HtmlFragment.__name__ = ["vdom","HtmlFragment"]; vdom_HtmlFragment.create = function(attr) { if(attr.content == "" && attr.force != true) { return null; } else { return new vdom_HtmlFragment(attr.content,attr.tag,attr.className); } }; vdom_HtmlFragment.__super__ = vdom_Widget; vdom_HtmlFragment.prototype = $extend(vdom_Widget.prototype,{ init: function() { if(this.element == null) { this.element = window.document.createElement(this.tag); this.element.innerHTML = this.content; if(this.className != null) { this.element.className = this.className; } } return this.element; } ,update: function(old,e) { var _g = (old instanceof vdom_HtmlFragment) ? old : null; if(_g == null) { return this.init(); } else { var v = _g; if(v.tag == this.tag) { this.element = e; if(this.className != v.className) { this.element.className = this.className; } if(this.content != v.content) { this.element.innerHTML = this.content; } return e; } else { return this.init(); } } } ,__class__: vdom_HtmlFragment }); var vdom__$Style_Style_$Impl_$ = {}; vdom__$Style_Style_$Impl_$.__name__ = ["vdom","_Style","Style_Impl_"]; vdom__$Style_Style_$Impl_$.ofString = function(s) { vdom__$Style_Style_$Impl_$.style.cssText = s; var ret = { }; var ret1 = ret; var _g = 0; var _g1 = vdom__$Style_Style_$Impl_$.style; while(_g < _g1.length) { var name = _g1[_g]; ++_g; ret1[name] = vdom__$Style_Style_$Impl_$.style.getPropertyValue(name); } return ret; }; var vdom__$VNode_VNode_$Impl_$ = {}; vdom__$VNode_VNode_$Impl_$.__name__ = ["vdom","_VNode","VNode_Impl_"]; vdom__$VNode_VNode_$Impl_$.flatten = function(c) { return c; }; function $iterator(o) { if( o instanceof Array ) return function() { return HxOverrides.iter(o); }; return typeof(o.iterator) == 'function' ? $bind(o,o.iterator) : o.iterator; } var $_, $fid = 0; function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $fid++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; o.hx__closures__[m.__id__] = f; } return f; } var prefixes = ["moz","webkit","ms"]; var obj = Object; var fields = function(o) { var ret = []; for (var name in o) ret.push(name); return ret; }; var copy = function(source,target) { var _g = 0; var _g1 = fields(source); while(_g < _g1.length) { var f = _g1[_g]; ++_g; var _g2 = 0; while(_g2 < prefixes.length) { var p = prefixes[_g2]; ++_g2; if(StringTools.startsWith(f,p)) { var name = HxOverrides.substr(f,p.length,1).toLowerCase() + HxOverrides.substr(f,p.length + 1,null); if(obj.getOwnPropertyDescriptor(target,name) == null) { obj.defineProperty(target,name,{ get : eval("(function () { return this." + f + "; })"), set : eval("(function (param) { this." + f + " = param; })")}); } } } } }; var dummy = window.document.createElement("div"); copy(dummy,HTMLElement.prototype); copy(dummy.style,CSSStyleDeclaration.prototype); copy(window.document,window.document); if(HTMLElement.prototype.matches == null) { HTMLElement.prototype.matches = HTMLElement.prototype.matchesSelector; } if(window.document.mozCancelFullScreen) { window.document.exitFullscreen = window.document.mozCancelFullScreen; } if(HTMLElement.prototype.requestFullScreen) { HTMLElement.prototype.requestFullscreen = HTMLElement.prototype.requestFullScreen; } String.prototype.__class__ = String; String.__name__ = ["String"]; Array.__name__ = ["Array"]; Date.prototype.__class__ = Date; Date.__name__ = ["Date"]; var Int = { __name__ : ["Int"]}; var Dynamic = { __name__ : ["Dynamic"]}; var Float = Number; Float.__name__ = ["Float"]; var Bool = Boolean; Bool.__ename__ = ["Bool"]; var Class = { __name__ : ["Class"]}; var Enum = { }; var __map_reserved = {} var vdom_VDom = function(e){return e()}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o * Available under the MIT License * ECMAScript compliant, uniform cross-browser split method */ /** * Splits a string into an array of strings using a regex or string separator. Matches of the * separator are not included in the result array. However, if `separator` is a regex that contains * capturing groups, backreferences are spliced into the result each time `separator` is matched. * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably * cross-browser. * @param {String} str String to split. * @param {RegExp|String} separator Regex or string to use for separating the string. * @param {Number} [limit] Maximum number of items to include in the result array. * @returns {Array} Array of substrings. * @example * * // Basic use * split('a b c d', ' '); * // -> ['a', 'b', 'c', 'd'] * * // With limit * split('a b c d', ' ', 2); * // -> ['a', 'b'] * * // Backreferences in result array * split('..word1 word2..', /([a-z]+)(\d+)/i); * // -> ['..', 'word', '1', ' ', 'word', '2', '..'] */ module.exports = (function split(undef) { var nativeSplit = String.prototype.split, compliantExecNpcg = /()??/.exec("")[1] === undef, // NPCG: nonparticipating capturing group self; self = function(str, separator, limit) { // If `separator` is not a regex, use `nativeSplit` if (Object.prototype.toString.call(separator) !== "[object RegExp]") { return nativeSplit.call(str, separator, limit); } var output = [], flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6 (separator.sticky ? "y" : ""), // Firefox 3+ lastLastIndex = 0, // Make `global` and avoid `lastIndex` issues by working with a copy separator = new RegExp(separator.source, flags + "g"), separator2, match, lastIndex, lastLength; str += ""; // Type-convert if (!compliantExecNpcg) { // Doesn't need flags gy, but they don't hurt separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags); } /* Values for `limit`, per the spec: * If undefined: 4294967295 // Math.pow(2, 32) - 1 * If 0, Infinity, or NaN: 0 * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296; * If negative number: 4294967296 - Math.floor(Math.abs(limit)) * If other: Type-convert, then use the above rules */ limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1 limit >>> 0; // ToUint32(limit) while (match = separator.exec(str)) { // `separator.lastIndex` is not reliable cross-browser lastIndex = match.index + match[0].length; if (lastIndex > lastLastIndex) { output.push(str.slice(lastLastIndex, match.index)); // Fix browsers whose `exec` methods don't consistently return `undefined` for // nonparticipating capturing groups if (!compliantExecNpcg && match.length > 1) { match[0].replace(separator2, function() { for (var i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undef) { match[i] = undef; } } }); } if (match.length > 1 && match.index < str.length) { Array.prototype.push.apply(output, match.slice(1)); } lastLength = match[0].length; lastLastIndex = lastIndex; if (output.length >= limit) { break; } } if (separator.lastIndex === match.index) { separator.lastIndex++; // Avoid an infinite loop } } if (lastLastIndex === str.length) { if (lastLength || !separator.test("")) { output.push(""); } } else { output.push(str.slice(lastLastIndex)); } return output.length > limit ? output.slice(0, limit) : output; }; return self; })(); },{}],6:[function(require,module,exports){ },{}],7:[function(require,module,exports){ 'use strict'; var OneVersionConstraint = require('individual/one-version'); var MY_VERSION = '7'; OneVersionConstraint('ev-store', MY_VERSION); var hashKey = '__EV_STORE_KEY@' + MY_VERSION; module.exports = EvStore; function EvStore(elem) { var hash = elem[hashKey]; if (!hash) { hash = elem[hashKey] = {}; } return hash; } },{"individual/one-version":9}],8:[function(require,module,exports){ (function (global){ 'use strict'; /*global window, global*/ var root = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}; module.exports = Individual; function Individual(key, value) { if (key in root) { return root[key]; } root[key] = value; return value; } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],9:[function(require,module,exports){ 'use strict'; var Individual = require('./index.js'); module.exports = OneVersion; function OneVersion(moduleName, version, defaultValue) { var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName; var enforceKey = key + '_ENFORCE_SINGLETON'; var versionValue = Individual(enforceKey, version); if (versionValue !== version) { throw new Error('Can only have one copy of ' + moduleName + '.\n' + 'You already have version ' + versionValue + ' installed.\n' + 'This means you cannot install version ' + version); } return Individual(key, defaultValue); } },{"./index.js":8}],10:[function(require,module,exports){ (function (global){ var topLevel = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {} var minDoc = require('min-document'); if (typeof document !== 'undefined') { module.exports = document; } else { var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; if (!doccy) { doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; } module.exports = doccy; } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"min-document":6}],11:[function(require,module,exports){ "use strict"; module.exports = function isObject(x) { return typeof x === "object" && x !== null; }; },{}],12:[function(require,module,exports){ var nativeIsArray = Array.isArray var toString = Object.prototype.toString module.exports = nativeIsArray || isArray function isArray(obj) { return toString.call(obj) === "[object Array]" } },{}],13:[function(require,module,exports){ var patch = require("./vdom/patch.js") module.exports = patch },{"./vdom/patch.js":18}],14:[function(require,module,exports){ var isObject = require("is-object") var isHook = require("../vnode/is-vhook.js") module.exports = applyProperties function applyProperties(node, props, previous) { for (var propName in props) { var propValue = props[propName] if (propValue === undefined) { removeProperty(node, propName, propValue, previous); } else if (isHook(propValue)) { removeProperty(node, propName, propValue, previous) if (propValue.hook) { propValue.hook(node, propName, previous ? previous[propName] : undefined) } } else { if (isObject(propValue)) { patchObject(node, props, previous, propName, propValue); } else { node[propName] = propValue } } } } function removeProperty(node, propName, propValue, previous) { if (previous) { var previousValue = previous[propName] if (!isHook(previousValue)) { if (propName === "attributes") { for (var attrName in previousValue) { node.removeAttribute(attrName) } } else if (propName === "style") { for (var i in previousValue) { node.style[i] = "" } } else if (typeof previousValue === "string") { node[propName] = "" } else { node[propName] = null } } else if (previousValue.unhook) { previousValue.unhook(node, propName, propValue) } } } function patchObject(node, props, previous, propName, propValue) { var previousValue = previous ? previous[propName] : undefined // Set attributes if (propName === "attributes") { for (var attrName in propValue) { var attrValue = propValue[attrName] if (attrValue === undefined) { node.removeAttribute(attrName) } else { node.setAttribute(attrName, attrValue) } } return } if(previousValue && isObject(previousValue) && getPrototype(previousValue) !== getPrototype(propValue)) { node[propName] = propValue return } if (!isObject(node[propName])) { node[propName] = {} } var replacer = propName === "style" ? "" : undefined for (var k in propValue) { var value = propValue[k] node[propName][k] = (value === undefined) ? replacer : value } } function getPrototype(value) { if (Object.getPrototypeOf) { return Object.getPrototypeOf(value) } else if (value.__proto__) { return value.__proto__ } else if (value.constructor) { return value.constructor.prototype } } },{"../vnode/is-vhook.js":26,"is-object":11}],15:[function(require,module,exports){ var document = require("global/document") var applyProperties = require("./apply-properties") var isVNode = require("../vnode/is-vnode.js") var isVText = require("../vnode/is-vtext.js") var isWidget = require("../vnode/is-widget.js") var handleThunk = require("../vnode/handle-thunk.js") module.exports = createElement function createElement(vnode, opts) { var doc = opts ? opts.document || document : document var warn = opts ? opts.warn : null vnode = handleThunk(vnode).a if (isWidget(vnode)) { return vnode.init() } else if (isVText(vnode)) { return doc.createTextNode(vnode.text) } else if (!isVNode(vnode)) { if (warn) { warn("Item is not a valid virtual dom node", vnode) } return null } var node = (vnode.namespace === null) ? doc.createElement(vnode.tagName) : doc.createElementNS(vnode.namespace, vnode.tagName) var props = vnode.properties applyProperties(node, props) var children = vnode.children for (var i = 0; i < children.length; i++) { var childNode = createElement(children[i], opts) if (childNode) { node.appendChild(childNode) } } return node } },{"../vnode/handle-thunk.js":24,"../vnode/is-vnode.js":27,"../vnode/is-vtext.js":28,"../vnode/is-widget.js":29,"./apply-properties":14,"global/document":10}],16:[function(require,module,exports){ // Maps a virtual DOM tree onto a real DOM tree in an efficient manner. // We don't want to read all of the DOM nodes in the tree so we use // the in-order tree indexing to eliminate recursion down certain branches. // We only recurse into a DOM node if we know that it contains a child of // interest. var noChild = {} module.exports = domIndex function domIndex(rootNode, tree, indices, nodes) { if (!indices || indices.length === 0) { return {} } else { indices.sort(ascending) return recurse(rootNode, tree, indices, nodes, 0) } } function recurse(rootNode, tree, indices, nodes, rootIndex) { nodes = nodes || {} if (rootNode) { if (indexInRange(indices, rootIndex, rootIndex)) { nodes[rootIndex] = rootNode } var vChildren = tree.children if (vChildren) { var childNodes = rootNode.childNodes for (var i = 0; i < tree.children.length; i++) { rootIndex += 1 var vChild = vChildren[i] || noChild var nextIndex = rootIndex + (vChild.count || 0) // skip recursion down the tree if there are no nodes down here if (indexInRange(indices, rootIndex, nextIndex)) { recurse(childNodes[i], vChild, indices, nodes, rootIndex) } rootIndex = nextIndex } } } return nodes } // Binary search for an index in the interval [left, right] function indexInRange(indices, left, right) { if (indices.length === 0) { return false } var minIndex = 0 var maxIndex = indices.length - 1 var currentIndex var currentItem while (minIndex <= maxIndex) { currentIndex = ((maxIndex + minIndex) / 2) >> 0 currentItem = indices[currentIndex] if (minIndex === maxIndex) { return currentItem >= left && currentItem <= right } else if (currentItem < left) { minIndex = currentIndex + 1 } else if (currentItem > right) { maxIndex = currentIndex - 1 } else { return true } } return false; } function ascending(a, b) { return a > b ? 1 : -1 } },{}],17:[function(require,module,exports){ var applyProperties = require("./apply-properties") var isWidget = require("../vnode/is-widget.js") var VPatch = require("../vnode/vpatch.js") var updateWidget = require("./update-widget") module.exports = applyPatch function applyPatch(vpatch, domNode, renderOptions) { var type = vpatch.type var vNode = vpatch.vNode var patch = vpatch.patch switch (type) { case VPatch.REMOVE: return removeNode(domNode, vNode) case VPatch.INSERT: return insertNode(domNode, patch, renderOptions) case VPatch.VTEXT: return stringPatch(domNode, vNode, patch, renderOptions) case VPatch.WIDGET: return widgetPatch(domNode, vNode, patch, renderOptions) case VPatch.VNODE: return vNodePatch(domNode, vNode, patch, renderOptions) case VPatch.ORDER: reorderChildren(domNode, patch) return domNode case VPatch.PROPS: applyProperties(domNode, patch, vNode.properties) return domNode case VPatch.THUNK: return replaceRoot(domNode, renderOptions.patch(domNode, patch, renderOptions)) default: return domNode } } function removeNode(domNode, vNode) { var parentNode = domNode.parentNode if (parentNode) { parentNode.removeChild(domNode) } destroyWidget(domNode, vNode); return null } function insertNode(parentNode, vNode, renderOptions) { var newNode = renderOptions.render(vNode, renderOptions) if (parentNode) { parentNode.appendChild(newNode) } return parentNode } function stringPatch(domNode, leftVNode, vText, renderOptions) { var newNode if (domNode.nodeType === 3) { domNode.replaceData(0, domNode.length, vText.text) newNode = domNode } else { var parentNode = domNode.parentNode newNode = renderOptions.render(vText, renderOptions) if (parentNode && newNode !== domNode) { parentNode.replaceChild(newNode, domNode) } } return newNode } function widgetPatch(domNode, leftVNode, widget, renderOptions) { var updating = updateWidget(leftVNode, widget) var newNode if (updating) { newNode = widget.update(leftVNode, domNode) || domNode } else { newNode = renderOptions.render(widget, renderOptions) } var parentNode = domNode.parentNode if (parentNode && newNode !== domNode) { parentNode.replaceChild(newNode, domNode) } if (!updating) { destroyWidget(domNode, leftVNode) } return newNode } function vNodePatch(domNode, leftVNode, vNode, renderOptions) { var parentNode = domNode.parentNode var newNode = renderOptions.render(vNode, renderOptions) if (parentNode && newNode !== domNode) { parentNode.replaceChild(newNode, domNode) } return newNode } function destroyWidget(domNode, w) { if (typeof w.destroy === "function" && isWidget(w)) { w.destroy(domNode) } } function reorderChildren(domNode, moves) { var childNodes = domNode.childNodes var keyMap = {} var node var remove var insert for (var i = 0; i < moves.removes.length; i++) { remove = moves.removes[i] node = childNodes[remove.from] if (remove.key) { keyMap[remove.key] = node } domNode.removeChild(node) } var length = childNodes.length for (var j = 0; j < moves.inserts.length; j++) { insert = moves.inserts[j] node = keyMap[insert.key] // this is the weirdest bug i've ever seen in webkit domNode.insertBefore(node, insert.to >= length++ ? null : childNodes[insert.to]) } } function replaceRoot(oldRoot, newRoot) { if (oldRoot && newRoot && oldRoot !== newRoot && oldRoot.parentNode) { oldRoot.parentNode.replaceChild(newRoot, oldRoot) } return newRoot; } },{"../vnode/is-widget.js":29,"../vnode/vpatch.js":32,"./apply-properties":14,"./update-widget":19}],18:[function(require,module,exports){ var document = require("global/document") var isArray = require("x-is-array") var render = require("./create-element") var domIndex = require("./dom-index") var patchOp = require("./patch-op") module.exports = patch function patch(rootNode, patches, renderOptions) { renderOptions = renderOptions || {} renderOptions.patch = renderOptions.patch && renderOptions.patch !== patch ? renderOptions.patch : patchRecursive renderOptions.render = renderOptions.render || render return renderOptions.patch(rootNode, patches, renderOptions) } function patchRecursive(rootNode, patches, renderOptions) { var indices = patchIndices(patches) if (indices.length === 0) { return rootNode } var index = domIndex(rootNode, patches.a, indices) var ownerDocument = rootNode.ownerDocument if (!renderOptions.document && ownerDocument !== document) { renderOptions.document = ownerDocument } for (var i = 0; i < indices.length; i++) { var nodeIndex = indices[i] rootNode = applyPatch(rootNode, index[nodeIndex], patches[nodeIndex], renderOptions) } return rootNode } function applyPatch(rootNode, domNode, patchList, renderOptions) { if (!domNode) { return rootNode } var newNode if (isArray(patchList)) { for (var i = 0; i < patchList.length; i++) { newNode = patchOp(patchList[i], domNode, renderOptions) if (domNode === rootNode) { rootNode = newNode } } } else { newNode = patchOp(patchList, domNode, renderOptions) if (domNode === rootNode) { rootNode = newNode } } return rootNode } function patchIndices(patches) { var indices = [] for (var key in patches) { if (key !== "a") { indices.push(Number(key)) } } return indices } },{"./create-element":15,"./dom-index":16,"./patch-op":17,"global/document":10,"x-is-array":12}],19:[function(require,module,exports){ var isWidget = require("../vnode/is-widget.js") module.exports = updateWidget function updateWidget(a, b) { if (isWidget(a) && isWidget(b)) { if ("name" in a && "name" in b) { return a.id === b.id } else { return a.init === b.init } } return false } },{"../vnode/is-widget.js":29}],20:[function(require,module,exports){ 'use strict'; var EvStore = require('ev-store'); module.exports = EvHook; function EvHook(value) { if (!(this instanceof EvHook)) { return new EvHook(value); } this.value = value; } EvHook.prototype.hook = function (node, propertyName) { var es = EvStore(node); var propName = propertyName.substr(3); es[propName] = this.value; }; EvHook.prototype.unhook = function(node, propertyName) { var es = EvStore(node); var propName = propertyName.substr(3); es[propName] = undefined; }; },{"ev-store":7}],21:[function(require,module,exports){ 'use strict'; module.exports = SoftSetHook; function SoftSetHook(value) { if (!(this instanceof SoftSetHook)) { return new SoftSetHook(value); } this.value = value; } SoftSetHook.prototype.hook = function (node, propertyName) { if (node[propertyName] !== this.value) { node[propertyName] = this.value; } }; },{}],22:[function(require,module,exports){ 'use strict'; var isArray = require('x-is-array'); var VNode = require('../vnode/vnode.js'); var VText = require('../vnode/vtext.js'); var isVNode = require('../vnode/is-vnode'); var isVText = require('../vnode/is-vtext'); var isWidget = require('../vnode/is-widget'); var isHook = require('../vnode/is-vhook'); var isVThunk = require('../vnode/is-thunk'); var parseTag = require('./parse-tag.js'); var softSetHook = require('./hooks/soft-set-hook.js'); var evHook = require('./hooks/ev-hook.js'); module.exports = h; function h(tagName, properties, children) { var childNodes = []; var tag, props, key, namespace; if (!children && isChildren(properties)) { children = properties; props = {}; } props = props || properties || {}; tag = parseTag(tagName, props); // support keys if (props.hasOwnProperty('key')) { key = props.key; props.key = undefined; } // support namespace if (props.hasOwnProperty('namespace')) { namespace = props.namespace; props.namespace = undefined; } // fix cursor bug if (tag === 'INPUT' && !namespace && props.hasOwnProperty('value') && props.value !== undefined && !isHook(props.value) ) { props.value = softSetHook(props.value); } transformProperties(props); if (children !== undefined && children !== null) { addChild(children, childNodes, tag, props); } return new VNode(tag, props, childNodes, key, namespace); } function addChild(c, childNodes, tag, props) { if (typeof c === 'string') { childNodes.push(new VText(c)); } else if (typeof c === 'number') { childNodes.push(new VText(String(c))); } else if (isChild(c)) { childNodes.push(c); } else if (isArray(c)) { for (var i = 0; i < c.length; i++) { addChild(c[i], childNodes, tag, props); } } else if (c === null || c === undefined) { return; } else { throw UnexpectedVirtualElement({ foreignObject: c, parentVnode: { tagName: tag, properties: props } }); } } function transformProperties(props) { for (var propName in props) { if (props.hasOwnProperty(propName)) { var value = props[propName]; if (isHook(value)) { continue; } if (propName.substr(0, 3) === 'ev-') { // add ev-foo support props[propName] = evHook(value); } } } } function isChild(x) { return isVNode(x) || isVText(x) || isWidget(x) || isVThunk(x); } function isChildren(x) { return typeof x === 'string' || isArray(x) || isChild(x); } function UnexpectedVirtualElement(data) { var err = new Error(); err.type = 'virtual-hyperscript.unexpected.virtual-element'; err.message = 'Unexpected virtual child passed to h().\n' + 'Expected a VNode / Vthunk / VWidget / string but:\n' + 'got:\n' + errorString(data.foreignObject) + '.\n' + 'The parent vnode is:\n' + errorString(data.parentVnode) '\n' + 'Suggested fix: change your `h(..., [ ... ])` callsite.'; err.foreignObject = data.foreignObject; err.parentVnode = data.parentVnode; return err; } function errorString(obj) { try { return JSON.stringify(obj, null, ' '); } catch (e) { return String(obj); } } },{"../vnode/is-thunk":25,"../vnode/is-vhook":26,"../vnode/is-vnode":27,"../vnode/is-vtext":28,"../vnode/is-widget":29,"../vnode/vnode.js":31,"../vnode/vtext.js":33,"./hooks/ev-hook.js":20,"./hooks/soft-set-hook.js":21,"./parse-tag.js":23,"x-is-array":12}],23:[function(require,module,exports){ 'use strict'; var split = require('browser-split'); var classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/; var notClassId = /^\.|#/; module.exports = parseTag; function parseTag(tag, props) { if (!tag) { return 'DIV'; } var noId = !(props.hasOwnProperty('id')); var tagParts = split(tag, classIdSplit); var tagName = null; if (notClassId.test(tagParts[1])) { tagName = 'DIV'; } var classes, part, type, i; for (i = 0; i < tagParts.length; i++) { part = tagParts[i]; if (!part) { continue; } type = part.charAt(0); if (!tagName) { tagName = part; } else if (type === '.') { classes = classes || []; classes.push(part.substring(1, part.length)); } else if (type === '#' && noId) { props.id = part.substring(1, part.length); } } if (classes) { if (props.className) { classes.push(props.className); } props.className = classes.join(' '); } return props.namespace ? tagName : tagName.toUpperCase(); } },{"browser-split":5}],24:[function(require,module,exports){ var isVNode = require("./is-vnode") var isVText = require("./is-vtext") var isWidget = require("./is-widget") var isThunk = require("./is-thunk") module.exports = handleThunk function handleThunk(a, b) { var renderedA = a var renderedB = b if (isThunk(b)) { renderedB = renderThunk(b, a) } if (isThunk(a)) { renderedA = renderThunk(a, null) } return { a: renderedA, b: renderedB } } function renderThunk(thunk, previous) { var renderedThunk = thunk.vnode if (!renderedThunk) { renderedThunk = thunk.vnode = thunk.render(previous) } if (!(isVNode(renderedThunk) || isVText(renderedThunk) || isWidget(renderedThunk))) { throw new Error("thunk did not return a valid node"); } return renderedThunk } },{"./is-thunk":25,"./is-vnode":27,"./is-vtext":28,"./is-widget":29}],25:[function(require,module,exports){ module.exports = isThunk function isThunk(t) { return t && t.type === "Thunk" } },{}],26:[function(require,module,exports){ module.exports = isHook function isHook(hook) { return hook && (typeof hook.hook === "function" && !hook.hasOwnProperty("hook") || typeof hook.unhook === "function" && !hook.hasOwnProperty("unhook")) } },{}],27:[function(require,module,exports){ var version = require("./version") module.exports = isVirtualNode function isVirtualNode(x) { return x && x.type === "VirtualNode" && x.version === version } },{"./version":30}],28:[function(require,module,exports){ var version = require("./version") module.exports = isVirtualText function isVirtualText(x) { return x && x.type === "VirtualText" && x.version === version } },{"./version":30}],29:[function(require,module,exports){ module.exports = isWidget function isWidget(w) { return w && w.type === "Widget" } },{}],30:[function(require,module,exports){ module.exports = "2" },{}],31:[function(require,module,exports){ var version = require("./version") var isVNode = require("./is-vnode") var isWidget = require("./is-widget") var isThunk = require("./is-thunk") var isVHook = require("./is-vhook") module.exports = VirtualNode var noProperties = {} var noChildren = [] function VirtualNode(tagName, properties, children, key, namespace) { this.tagName = tagName this.properties = properties || noProperties this.children = children || noChildren this.key = key != null ? String(key) : undefined this.namespace = (typeof namespace === "string") ? namespace : null var count = (children && children.length) || 0 var descendants = 0 var hasWidgets = false var hasThunks = false var descendantHooks = false var hooks for (var propName in properties) { if (properties.hasOwnProperty(propName)) { var property = properties[propName] if (isVHook(property) && property.unhook) { if (!hooks) { hooks = {} } hooks[propName] = property } } } for (var i = 0; i < count; i++) { var child = children[i] if (isVNode(child)) { descendants += child.count || 0 if (!hasWidgets && child.hasWidgets) { hasWidgets = true } if (!hasThunks && child.hasThunks) { hasThunks = true } if (!descendantHooks && (child.hooks || child.descendantHooks)) { descendantHooks = true } } else if (!hasWidgets && isWidget(child)) { if (typeof child.destroy === "function") { hasWidgets = true } } else if (!hasThunks && isThunk(child)) { hasThunks = true; } } this.count = count + descendants this.hasWidgets = hasWidgets this.hasThunks = hasThunks this.hooks = hooks this.descendantHooks = descendantHooks } VirtualNode.prototype.version = version VirtualNode.prototype.type = "VirtualNode" },{"./is-thunk":25,"./is-vhook":26,"./is-vnode":27,"./is-widget":29,"./version":30}],32:[function(require,module,exports){ var version = require("./version") VirtualPatch.NONE = 0 VirtualPatch.VTEXT = 1 VirtualPatch.VNODE = 2 VirtualPatch.WIDGET = 3 VirtualPatch.PROPS = 4 VirtualPatch.ORDER = 5 VirtualPatch.INSERT = 6 VirtualPatch.REMOVE = 7 VirtualPatch.THUNK = 8 module.exports = VirtualPatch function VirtualPatch(type, vNode, patch) { this.type = Number(type) this.vNode = vNode this.patch = patch } VirtualPatch.prototype.version = version VirtualPatch.prototype.type = "VirtualPatch" },{"./version":30}],33:[function(require,module,exports){ var version = require("./version") module.exports = VirtualText function VirtualText(text) { this.text = String(text) } VirtualText.prototype.version = version VirtualText.prototype.type = "VirtualText" },{"./version":30}],34:[function(require,module,exports){ var isObject = require("is-object") var isHook = require("../vnode/is-vhook") module.exports = diffProps function diffProps(a, b) { var diff for (var aKey in a) { if (!(aKey in b)) { diff = diff || {} diff[aKey] = undefined } var aValue = a[aKey] var bValue = b[aKey] if (aValue === bValue) { continue } else if (isObject(aValue) && isObject(bValue)) { if (getPrototype(bValue) !== getPrototype(aValue)) { diff = diff || {} diff[aKey] = bValue } else if (isHook(bValue)) { diff = diff || {} diff[aKey] = bValue } else { var objectDiff = diffProps(aValue, bValue) if (objectDiff) { diff = diff || {} diff[aKey] = objectDiff } } } else { diff = diff || {} diff[aKey] = bValue } } for (var bKey in b) { if (!(bKey in a)) { diff = diff || {} diff[bKey] = b[bKey] } } return diff } function getPrototype(value) { if (Object.getPrototypeOf) { return Object.getPrototypeOf(value) } else if (value.__proto__) { return value.__proto__ } else if (value.constructor) { return value.constructor.prototype } } },{"../vnode/is-vhook":26,"is-object":11}],35:[function(require,module,exports){ var isArray = require("x-is-array") var VPatch = require("../vnode/vpatch") var isVNode = require("../vnode/is-vnode") var isVText = require("../vnode/is-vtext") var isWidget = require("../vnode/is-widget") var isThunk = require("../vnode/is-thunk") var handleThunk = require("../vnode/handle-thunk") var diffProps = require("./diff-props") module.exports = diff function diff(a, b) { var patch = { a: a } walk(a, b, patch, 0) return patch } function walk(a, b, patch, index) { if (a === b) { return } var apply = patch[index] var applyClear = false if (isThunk(a) || isThunk(b)) { thunks(a, b, patch, index) } else if (b == null) { // If a is a widget we will add a remove patch for it // Otherwise any child widgets/hooks must be destroyed. // This prevents adding two remove patches for a widget. if (!isWidget(a)) { clearState(a, patch, index) apply = patch[index] } apply = appendPatch(apply, new VPatch(VPatch.REMOVE, a, b)) } else if (isVNode(b)) { if (isVNode(a)) { if (a.tagName === b.tagName && a.namespace === b.namespace && a.key === b.key) { var propsPatch = diffProps(a.properties, b.properties) if (propsPatch) { apply = appendPatch(apply, new VPatch(VPatch.PROPS, a, propsPatch)) } apply = diffChildren(a, b, patch, apply, index) } else { apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b)) applyClear = true } } else { apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b)) applyClear = true } } else if (isVText(b)) { if (!isVText(a)) { apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b)) applyClear = true } else if (a.text !== b.text) { apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b)) } } else if (isWidget(b)) { if (!isWidget(a)) { applyClear = true } apply = appendPatch(apply, new VPatch(VPatch.WIDGET, a, b)) } if (apply) { patch[index] = apply } if (applyClear) { clearState(a, patch, index) } } function diffChildren(a, b, patch, apply, index) { var aChildren = a.children var orderedSet = reorder(aChildren, b.children) var bChildren = orderedSet.children var aLen = aChildren.length var bLen = bChildren.length var len = aLen > bLen ? aLen : bLen for (var i = 0; i < len; i++) { var leftNode = aChildren[i] var rightNode = bChildren[i] index += 1 if (!leftNode) { if (rightNode) { // Excess nodes in b need to be added apply = appendPatch(apply, new VPatch(VPatch.INSERT, null, rightNode)) } } else { walk(leftNode, rightNode, patch, index) } if (isVNode(leftNode) && leftNode.count) { index += leftNode.count } } if (orderedSet.moves) { // Reorder nodes last apply = appendPatch(apply, new VPatch( VPatch.ORDER, a, orderedSet.moves )) } return apply } function clearState(vNode, patch, index) { // TODO: Make this a single walk, not two unhook(vNode, patch, index) destroyWidgets(vNode, patch, index) } // Patch records for all destroyed widgets must be added because we need // a DOM node reference for the destroy function function destroyWidgets(vNode, patch, index) { if (isWidget(vNode)) { if (typeof vNode.destroy === "function") { patch[index] = appendPatch( patch[index], new VPatch(VPatch.REMOVE, vNode, null) ) } } else if (isVNode(vNode) && (vNode.hasWidgets || vNode.hasThunks)) { var children = vNode.children var len = children.length for (var i = 0; i < len; i++) { var child = children[i] index += 1 destroyWidgets(child, patch, index) if (isVNode(child) && child.count) { index += child.count } } } else if (isThunk(vNode)) { thunks(vNode, null, patch, index) } } // Create a sub-patch for thunks function thunks(a, b, patch, index) { var nodes = handleThunk(a, b) var thunkPatch = diff(nodes.a, nodes.b) if (hasPatches(thunkPatch)) { patch[index] = new VPatch(VPatch.THUNK, null, thunkPatch) } } function hasPatches(patch) { for (var index in patch) { if (index !== "a") { return true } } return false } // Execute hooks when two nodes are identical function unhook(vNode, patch, index) { if (isVNode(vNode)) { if (vNode.hooks) { patch[index] = appendPatch( patch[index], new VPatch( VPatch.PROPS, vNode, undefinedKeys(vNode.hooks) ) ) } if (vNode.descendantHooks || vNode.hasThunks) { var children = vNode.children var len = children.length for (var i = 0; i < len; i++) { var child = children[i] index += 1 unhook(child, patch, index) if (isVNode(child) && child.count) { index += child.count } } } } else if (isThunk(vNode)) { thunks(vNode, null, patch, index) } } function undefinedKeys(obj) { var result = {} for (var key in obj) { result[key] = undefined } return result } // List diff, naive left to right reordering function reorder(aChildren, bChildren) { // O(M) time, O(M) memory var bChildIndex = keyIndex(bChildren) var bKeys = bChildIndex.keys var bFree = bChildIndex.free if (bFree.length === bChildren.length) { return { children: bChildren, moves: null } } // O(N) time, O(N) memory var aChildIndex = keyIndex(aChildren) var aKeys = aChildIndex.keys var aFree = aChildIndex.free if (aFree.length === aChildren.length) { return { children: bChildren, moves: null } } // O(MAX(N, M)) memory var newChildren = [] var freeIndex = 0 var freeCount = bFree.length var deletedItems = 0 // Iterate through a and match a node in b // O(N) time, for (var i = 0 ; i < aChildren.length; i++) { var aItem = aChildren[i] var itemIndex if (aItem.key) { if (bKeys.hasOwnProperty(aItem.key)) { // Match up the old keys itemIndex = bKeys[aItem.key] newChildren.push(bChildren[itemIndex]) } else { // Remove old keyed items itemIndex = i - deletedItems++ newChildren.push(null) } } else { // Match the item in a with the next free item in b if (freeIndex < freeCount) { itemIndex = bFree[freeIndex++] newChildren.push(bChildren[itemIndex]) } else { // There are no free items in b to match with // the free items in a, so the extra free nodes // are deleted. itemIndex = i - deletedItems++ newChildren.push(null) } } } var lastFreeIndex = freeIndex >= bFree.length ? bChildren.length : bFree[freeIndex] // Iterate through b and append any new keys // O(M) time for (var j = 0; j < bChildren.length; j++) { var newItem = bChildren[j] if (newItem.key) { if (!aKeys.hasOwnProperty(newItem.key)) { // Add any new keyed items // We are adding new items to the end and then sorting them // in place. In future we should insert new items in place. newChildren.push(newItem) } } else if (j >= lastFreeIndex) { // Add any leftover non-keyed items newChildren.push(newItem) } } var simulate = newChildren.slice() var simulateIndex = 0 var removes = [] var inserts = [] var simulateItem for (var k = 0; k < bChildren.length;) { var wantedItem = bChildren[k] simulateItem = simulate[simulateIndex] // remove items while (simulateItem === null && simulate.length) { removes.push(remove(simulate, simulateIndex, null)) simulateItem = simulate[simulateIndex] } if (!simulateItem || simulateItem.key !== wantedItem.key) { // if we need a key in this position... if (wantedItem.key) { if (simulateItem && simulateItem.key) { // if an insert doesn't put this key in place, it needs to move if (bKeys[simulateItem.key] !== k + 1) { removes.push(remove(simulate, simulateIndex, simulateItem.key)) simulateItem = simulate[simulateIndex] // if the remove didn't put the wanted item in place, we need to insert it if (!simulateItem || simulateItem.key !== wantedItem.key) { inserts.push({key: wantedItem.key, to: k}) } // items are matching, so skip ahead else { simulateIndex++ } } else { inserts.push({key: wantedItem.key, to: k}) } } else { inserts.push({key: wantedItem.key, to: k}) } k++ } // a key in simulate has no matching wanted key, remove it else if (simulateItem && simulateItem.key) { removes.push(remove(simulate, simulateIndex, simulateItem.key)) } } else { simulateIndex++ k++ } } // remove all the remaining nodes from simulate while(simulateIndex < simulate.length) { simulateItem = simulate[simulateIndex] removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key)) } // If the only moves we have are deletes then we can just // let the delete patch remove these items. if (removes.length === deletedItems && !inserts.length) { return { children: newChildren, moves: null } } return { children: newChildren, moves: { removes: removes, inserts: inserts } } } function remove(arr, index, key) { arr.splice(index, 1) return { from: index, key: key } } function keyIndex(children) { var keys = {} var free = [] var length = children.length for (var i = 0; i < length; i++) { var child = children[i] if (child.key) { keys[child.key] = i } else { free.push(i) } } return { keys: keys, // A hash of key name to index free: free // An array of unkeyed item indices } } function appendPatch(apply, patch) { if (apply) { if (isArray(apply)) { apply.push(patch) } else { apply = [apply, patch] } return apply } else { return patch } } },{"../vnode/handle-thunk":24,"../vnode/is-thunk":25,"../vnode/is-vnode":27,"../vnode/is-vtext":28,"../vnode/is-widget":29,"../vnode/vpatch":32,"./diff-props":34,"x-is-array":12}]},{},[4])(4) }); Dom.cache = new haxe_ds_StringMap(); Dom.counter = 0; Dom.hasScope = (function($this) { var $r; try { $r = (function($this) { var $r; window.document.body.querySelectorAll(":scope>*"); $r = true; return $r; }($this)); } catch( e ) { $r = false; } return $r; }(this)); Xml.Element = 0; Xml.PCData = 1; Xml.CData = 2; Xml.Comment = 3; Xml.DocType = 4; Xml.ProcessingInstruction = 5; Xml.Document = 6; coconut_ui_tools_ViewCache.stack = []; epaper_debug_DebugUi.initialized = false; epaper_i18n_Localizable.currentLocale = haxe_ds_Option.None; tink_geom2__$FitRect_FitRect_$Impl_$.ALL = ["above","below","lefthand","righthand"]; epaper_media_MediaBubble.centered = tink_geom2__$FitRect_FitRect_$Impl_$.allSides(["above","below"]); epaper_media_MediaBubble.sideways = tink_geom2__$FitRect_FitRect_$Impl_$.compound([tink_geom2__$FitRect_FitRect_$Impl_$.ofConstraint({ side : "lefthand", align : .0}),tink_geom2__$FitRect_FitRect_$Impl_$.ofConstraint({ side : "righthand", align : .0})]); epaper_media_MediaController.MAIN_CONTROLS_HEIGHT = 70; epaper_media_MediaController.BAR_TOP_OFFSET = 20; epaper_media_MediaController.BAR_BOTTOM_OFFSET = epaper_media_MediaController.BAR_TOP_OFFSET + 20; epaper_tracking_EpaperTracker.previousPage = -9999; epaper_tracking_EpaperTracker.previousSelector = "none"; epaper_tracking_EpaperTracker.previousHash = "none"; flipbook_BookView.OS = (function($this) { var $r; var platforms = "win,ipad,iphone,ipod,mac,android,linux".split(","); var platform = platforms.pop(); var found = window.navigator.userAgent.toLowerCase(); { var _g = 0; while(_g < platforms.length) { var p = platforms[_g]; ++_g; if(found.indexOf(p) != -1) { platform = p; break; } } } $r = platform; return $r; }(this)); flipbook_Pagination.isMac = StringTools.startsWith(window.navigator.platform,"Mac"); flipbook_Pagination.never = (function($this) { var $r; var this1 = new tink_core__$Future_SimpleFuture(function(_) { return null; }); $r = this1; return $r; }(this)); flipbook_Zoom.DEVICE_PIXEL_RATIO = window.devicePixelRatio > 0 ? window.devicePixelRatio : 1.0; haxe_ds_ObjectMap.count = 0; haxe_xml_Parser.escapes = (function($this) { var $r; var h = new haxe_ds_StringMap(); if(__map_reserved["lt"] != null) { h.setReserved("lt","<"); } else { h.h["lt"] = "<"; } if(__map_reserved["gt"] != null) { h.setReserved("gt",">"); } else { h.h["gt"] = ">"; } if(__map_reserved["amp"] != null) { h.setReserved("amp","&"); } else { h.h["amp"] = "&"; } if(__map_reserved["quot"] != null) { h.setReserved("quot","\""); } else { h.h["quot"] = "\""; } if(__map_reserved["apos"] != null) { h.setReserved("apos","'"); } else { h.h["apos"] = "'"; } $r = h; return $r; }(this)); js_Boot.__toStr = ({ }).toString; tink_core__$Callback_Callback_$Impl_$.depth = 0; tink_geom2__$Matrix_Matrix_$Impl_$.IDENTITY = (function($this) { var $r; var this1 = { a : 1, b : 0, c : 0, d : 1, tx : 0, ty : 0}; $r = this1; return $r; }(this)); tink_pure__$List_Node.EMPTY = []; tink_state__$Observable_Observable_$Impl_$.stack = new List(); tink_state__$Observable_Observable_$Impl_$.scheduled = []; tink_state__$Observable_Observable_$Impl_$.hasRAF = typeof window != 'undefined' && 'requestAnimationFrame' in window; tink_state__$Observable_Observable_$Impl_$.isScheduled = false; tink_state_ConstObservable.NEVER = (function($this) { var $r; var this1 = new tink_core__$Future_SimpleFuture(function(_) { return null; }); $r = this1; return $r; }(this)); tink_xml_Parser_$1.inst = new tink_xml_Parser_$1(); tink_xml_Parser_$2.inst = new tink_xml_Parser_$2(); tink_xml_Parser_$3.inst = new tink_xml_Parser_$3(); tink_xml_Parser_$4.inst = new tink_xml_Parser_$4(); util_touch_TouchHandler.isAnroid = (function($this) { var $r; try { $r = (function($this) { var $r; window.document.body.click(); $r = false; return $r; }($this)); } catch( e ) { $r = true; } return $r; }(this)); util_touch_TouchHandler.isFakeClick = false; vdom__$Attr_Key_$Impl_$.keygen = 0; vdom__$Style_Style_$Impl_$.style = window.document.createElement("div").style; epaper_viewer_Boot.main(); })(typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);