!function(){"use strict";var I=function(){for(var n=[],e=0;e "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return Ot.objOf(bn(a,function(n){return n.fold(function(n,e,t,r){return kt.field(n,t,r)},function(n,e){return kt.state(n)})}))}}},Ht=function(t,i){var e=function(n,e){return(o=Ft(t),{extract:function(t,r,n){var e=bn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return lt(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return Ot.arrOf(o)}}).extract(n,h,e);var o};return{extract:function(t,r,o){var n=N(o);return e(t,n).bind(function(n){var e=bn(n,function(n){return At.field(n,n,ot(),i)});return Vt(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return Ot.setOf(t,i)}}},zt=A(Ft(nt.value)),jt=At.state,Lt=At.field,Ut=function(t,e,r,o,i){return yt(o,i).fold(function(){return n=o,e=i,It(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Dt(n)});var n,e},function(n){return Vt(n).extract(t.concat(["branch: "+i]),e,r)})},Pt=function(o,i){return{extract:function(e,t,r){return yt(r,o).fold(function(){return n=o,It(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Ut(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+N(i)},toDsl:function(){return Ot.choiceOf(o,i)}}},$t=Ft(nt.value),Wt=function(n,e,t,r){return e.extract([n],t,r).fold(function(n){return nt.error({input:r,errors:n})},nt.value)},Gt=function(n,e,t){return Wt(n,e,A,t)},_t=function(n){return n.fold(function(n){throw new Error(Kt(n))},h)},qt=function(n,e,t){return _t(Wt(n,e,h,t))},Yt=function(n,e,t){return _t(Gt(n,e,t))},Kt=function(n){return"Errors: \n"+(e=n.errors,t=10 ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Dt(n.input);var e,t},Xt=function(n,e){return Pt(n,e)},Jt=A($t),Qt=(i=w,u="function",Ft(function(n){var e=typeof n;return i(n)?nt.value(n):nt.error("Expected type: "+u+" but got: "+e)})),Zt=function(n){return Lt(n,n,ot(),zt())},nr=function(n,e){return Lt(n,n,ot(),e)},er=function(n){return nr(n,Qt)},tr=function(n,e){return Lt(n,n,ot(),Vt(e))},rr=function(n){return Lt(n,n,it(),zt())},or=function(n,e){return Lt(n,n,it(),Vt(e))},ir=function(n,e){return Lt(n,n,it(),Nt(e))},ur=function(n,e){return Lt(n,n,rt(e),zt())},ar=function(n,e,t){return Lt(n,n,rt(e),t)},cr=function(n,e){return jt(n,e)},sr=function(n){if(!Tt(n,"can")&&!Tt(n,"abort")&&!Tt(n,"run"))throw new Error("EventHandler defined by: "+Et(n,null,2)+" does not have can, abort, or run!");return qt("Extracting event.handler",Nt([ur("can",A(!0)),ur("abort",A(!1)),ur("run",I)]),n)},fr=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n"),innerHtml:n.innerHtml().getOr(""),defChildren:n.defChildren().fold(function(){return""},function(n){return Et(n,null,2)}),domChildren:n.domChildren().fold(function(){return""},function(n){return 0===n.length?"0 children, but still specified":String(n.length)})}},Cr=Ce([],["classes","attributes","styles","value","innerHtml","defChildren","domChildren"]),Er=function(e,n,t){return n.fold(function(){return t.fold(function(){return{}},function(n){return wt(e,n)})},function(n){return t.fold(function(){return wt(e,n)},function(n){return wt(e,n)})})},Dr=function(t,r,o){return wr(function(n,e){o(n,t,r)})},Ir=function(n,e,t,r,o,i){var u,a,c=n,s=or(e,[(u="config",a=n,Lt(u,u,it(),a))]);return Br(c,s,e,t,r,o,i)},Ar=function(o,i,u){var n,e,t,r,a,c;return n=function(t){for(var n=[],e=1;e"}),Jt()),rc=ur("defaults",A({})),oc=ur("overrides",A({})),ic=Vt([Za,nc,ec,tc,rc,oc]),uc=Vt([Za,nc,ec,tc,rc,oc]),ac=Vt([Za,nc,ec,Zt("unit"),tc,rc,oc]),cc=function(n){var e=function(n){return n.name()};return n.fold(e,e,e,e)},sc=function(t,r){return function(n){var e=Yt("Converting part type",r,n);return t(e)}},fc=sc(Qa.required,ic),lc=sc(Qa.optional,uc),dc=sc(Qa.group,ac),mc=A("entirety"),gc=function(n,e,t,r){var o=t;return k(e.defaults()(n,t,r),t,{uid:n.partUids()[e.name()]},e.overrides()(n,t,r),{"debug.sketcher":wt("part-"+e.name(),o)})},vc=function(o,n){var i={};return yn(n,function(n){var e;(e=n,e.fold(F.some,F.none,F.some,F.some)).each(function(t){var r=pc(o,t.pname());i[t.name()]=function(n){var e=qt("Part: "+t.name()+" in "+o,Vt(t.schema()),n);return k(r,{config:n,validated:e})}})}),i},pc=function(n,e){return{uiType:Ka(),owner:n,name:e}},hc=function(n,e,t){return r=e,i={},o={},yn(t,function(n){n.fold(function(r){i[r.pname()]=qa(!0,function(n,e,t){return r.factory().sketch(gc(n,r,e,t))})},function(n){var e=r.parts()[n.name()]();o[n.name()]=A(gc(r,n,e[mc()]()))},function(r){i[r.pname()]=qa(!1,function(n,e,t){return r.factory().sketch(gc(n,r,e,t))})},function(o){i[o.pname()]=Ya(!0,function(e,n,t){var r=e[o.name()]();return bn(r,function(n){return o.factory().sketch(k(o.defaults()(e,n),n,o.overrides()(e,n)))})})})}),{internals:A(i),externals:A(o)};var r,i,o},bc=function(n,e,t){return _a(F.some(n),e,e.components(),t)},yc=function(n,e,t){var r=e.partUids()[t];return n.getSystem().getByUid(r).toOption()},wc=function(n,e,t){return yc(n,e,t).getOrDie("Could not find part: "+t)},xc=function(e,n){var t=bn(n,cc);return xt(bn(t,function(n){return{key:n,value:e+"-"+n}}))},Sc=function(e){return Lt("partUids","partUids",at(function(n){return xc(n.uid,e)}),Jt())},Tc=Ja("alloy-premade"),Oc=Ja("api"),kc=function(n){return wt(Tc,n)},Cc=function(o){return n=function(n){for(var e=[],t=1;t'),action:e,buttonBehaviours:k(Lr([Pc.config({})]),t)})},Yc={forToolbar:qc,forToolbarCommand:function(n,e){return qc(e,function(){n.execCommand(e)},{})},forToolbarStateAction:function(n,e,t,r){var o=_c(t);return qc(e,r,o)},forToolbarStateCommand:function(n,e){var t=_c(e);return qc(e,function(){n.execCommand(e)},t)}},Kc=function(t,r){return{left:A(t),top:A(r),translate:function(n,e){return Kc(t+n,r+e)}}},Xc=Kc,Jc=function(n,e,t){return Math.max(e,Math.min(t,n))},Qc=function(n,e,t,r,o,i,u){var a=t-e;if(rn.right)return t+1;var c,s,f,l,d=Math.min(n.right,Math.max(r,n.left))-n.left,m=Jc(d/n.width*a+e,e-1,t+1),g=Math.round(m);return i&&e<=m&&m<=t?(c=m,s=e,f=t,l=o,u.fold(function(){var n=c-s,e=Math.round(n/l)*l;return Jc(s+e,s-1,f+1)},function(n){var e=(c-n)%l,t=Math.round(e/l),r=Math.floor((c-n)/l),o=Math.floor((f-n)/l),i=n+Math.min(o,r+t)*l;return Math.max(n,i)})):g},Zc="slider.change.value",ns=$n.detect().deviceType.isTouch(),es=function(n){return function(n){var e=n.event().raw();if(ns){var t=e;return t.touches!==undefined&&1===t.touches.length?F.some(t.touches[0]).map(function(n){return Xc(n.clientX,n.clientY)}):F.none()}var r=e;return r.clientX!==undefined?F.some(r).map(function(n){return Xc(n.clientX,n.clientY)}):F.none()}(n).map(function(n){return n.left()})},ts=function(n,e){oe(n,Zc,{value:e})},rs=function(i,u,a,n){return es(n).map(function(n){var e,t,r,o;return e=i,r=n,o=Qc(a,(t=u).min(),t.max(),r,t.stepSize(),t.snapToGrid(),t.snapStart()),ts(e,o),n})},os=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),tr.max()?yc(e,r,"right-edge").fold(function(){return t.width},function(n){return f(n)-t.left}):(r.value().get()-r.min())/s*t.width);return i.left-u.left+a},u=function(n){var e=i(n),t=o(n),r=Cs(t.element())/2;xi(t.element(),"left",e-r+"px")},r=function(n,e){var t=c.value().get(),r=o(n);return t!==e||ki(r.element(),"left").isNone()?(c.value().set(e),u(n),c.onChange()(n,r,e),F.some(!0)):F.none()},a=Es?[mr(L(),function(n,e){c.onDragStart()(n,o(n))}),mr(P(),function(n,e){c.onDragEnd()(n,o(n))})]:[mr($(),function(n,e){e.stop(),c.onDragStart()(n,o(n)),c.mouseIsDown().set(!0)}),mr(G(),function(n,e){c.onDragEnd()(n,o(n)),c.mouseIsDown().set(!1)})];return{uid:c.uid(),dom:c.dom(),components:n,behaviours:k(Lr(En([Es?[]:[ja.config({mode:"special",focusIn:function(n){return yc(n,c,"spectrum").map(ja.focusIn).map(A(!0))}})],[xs.config({store:{mode:"manual",getValue:function(n){return c.value().get()}}})]])),Ua(c.sliderBehaviours())),events:lr([mr(Zc,function(n,e){r(n,e.event().value())}),br(function(n,e){c.value().set(c.getInitialValue()());var t=o(n);u(n),c.onInit()(n,t,c.value().get())})].concat(a)),apis:{resetToMin:function(n){r(n,c.min())},resetToMax:function(n){r(n,c.max())},refresh:u},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Is=function(e,t,r){return Yc.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{})},As=function(n){return[(o=n,i=function(n){return n<0?"black":360'),components:[Ds.parts()["left-edge"](Gc('
')),Ds.parts().spectrum({dom:Wc('
'),components:[Gc('
')],behaviours:Lr([ci.config({toggleClass:mi.resolve("thumb-active")})])}),Ds.parts()["right-edge"](Gc('
')),Ds.parts().thumb({dom:Wc('
'),behaviours:Lr([ci.config({toggleClass:mi.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t);xi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){ci.on(e)},onDragEnd:function(n,e){ci.off(e)},onInit:function(n,e,t){var r=i(t);xi(e.element(),"background-color",r)},stepSize:10,min:0,max:360,getInitialValue:o.getInitialValue,sliderBehaviours:Lr([fi(Ds.refresh)])}))];var o,i},Ms=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return Is(n,"color",function(){return As(e)})},Bs=Nt([Zt("getInitialValue"),Zt("onChange"),Zt("category"),Zt("sizes")]),Rs=function(n){var o=qt("SizeSlider",Bs,n);return Ds.sketch({dom:{tag:"div",classes:[mi.resolve("slider-"+o.category+"-size-container"),mi.resolve("slider"),mi.resolve("slider-size-container")]},onChange:function(n,e,t){var r;0<=(r=t)&&r'),components:[Gc('
')]}),Ds.parts().thumb({dom:Wc('
'),behaviours:Lr([ci.config({toggleClass:mi.resolve("thumb-active")})])})]})},Fs=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Ns=function(n){var e,t,r=n.selection.getStart(),o=se.fromDom(r),i=se.fromDom(n.getBody()),u=(e=function(n){return Ve(i,n)},(ve(t=o)?F.some(t):ze(t)).map(function(n){return go(n,function(n){return ki(n,"font-size").isSome()},e).bind(function(n){return ki(n,"font-size")}).getOrThunk(function(){return Ti(n,"font-size")})}).getOr(""));return Tn(Fs,function(n){return u===n}).getOr("medium")},Vs={candidates:A(Fs),get:function(n){var e,t=Ns(n);return(e=t,On(Fs,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,F.from(Fs[e])).each(function(n){var e,t;t=n,Ns(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},Hs=Vs.candidates(),zs=function(n){return[Gc(''),(e=n,Rs({onChange:e.onChange,sizes:Hs,category:"font",getInitialValue:e.getInitialValue})),Gc('')];var e},js=function(n){var e=n.uid!==undefined&&Tt(n,"uid")?n.uid:Rc("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(F.none,F.some)},asSpec:function(){return k(n,{uid:e})}}};function Ls(n,e){return Ps(document.createElement("canvas"),n,e)}function Us(n){return n.getContext("2d")}function Ps(n,e,t){return n.width=e,n.height=t,n}var $s={create:Ls,clone:function(n){var e;return Us(e=Ls(n.width,n.height)).drawImage(n,0,0),e},resize:Ps,get2dContext:Us,get3dContext:function(n){var e=null;try{e=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(t){}return e||(e=null),e}},Ws={getWidth:function(n){return n.naturalWidth||n.width},getHeight:function(n){return n.naturalHeight||n.height}},Gs=window.Promise?window.Promise:function(){var n=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(n,r(o,this),r(u,this))},e=n.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){setTimeout(n,1)};function r(n,e){return function(){n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function i(r){var o=this;null!==this._state?e(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void s(r(e,n),r(o,this),r(u,this))}this._state=!0,this._value=n,a.call(this)}catch(t){u.call(this,t)}}function u(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds.length;n'),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},lf=function(n){return n.dom().textContent},df=function(n){return 0'),action:function(n){var e=t.get(n);xs.setValue(e,"")}}));return{name:n,spec:Of.sketch({dom:Wc('
'),components:[t.asSpec(),r.asSpec()],containerBehaviours:Lr([ci.config({toggleClass:mi.resolve("input-container-empty")}),Tf.config({find:function(n){return F.some(t.get(n))}}),wf("input-clearing",[mr(Y(),function(n){var e=t.get(n);(0"},Xf=function(o,n,e){return k({"debug.sketcher":{Form:e},uid:o.uid(),dom:o.dom(),components:n,behaviours:k(Lr([xs.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),H(e.partUids(),function(n,e){return A(t.getByUid(n))}));return H(r,function(n,e){return n().bind(Tf.getCurrent).map(xs.getValue)})},setValue:function(t,n){V(n,function(e,n){yc(t,o,n).each(function(n){Tf.getCurrent(n).each(function(n){xs.setValue(n,e)})})})}}})]),Ua(o.formBehaviours())),apis:{getField:function(n,e){return yc(n,o,e).bind(Tf.getCurrent)}}})},Jf=(Cc(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Kf(n),o=e,{uiType:Ka(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=bn(r,function(n){return fc({name:n,pname:Kf(n)})});return Nc("form",Yf,o,Xf,t)}),Qf=function(){var e=fo(F.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(F.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(F.some(n))},run:function(n){e.get().each(n)}}},Zf=function(){var e=fo(F.none());return{clear:function(){e.set(F.none())},set:function(n){e.set(F.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},nl=function(n){return{xValue:n,points:[]}},el=function(n,e){if(e===n.xValue)return n;var t=0'),action:function(n){oe(n,r,{direction:e})},buttonBehaviours:Lr([qf.config({disableClass:mi.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=Ni(n.element(),"."+mi.resolve("serialised-dialog-screen"));zi(n.element(),"."+mi.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o'),components:[Of.sketch({dom:Wc('
'),components:bn(u.fields,function(n,e){return e<=u.maxFieldIndex?Of.sketch({dom:Wc('
'),components:En([[o(-1,"previous",0'),behaviours:Lr([au.config({highlightClass:mi.resolve("dot-active"),itemClass:mi.resolve("dot-item")})]),components:Dn(u.fields,function(n,e){return e<=u.maxFieldIndex?[Gc('
')]:[]})});return{dom:Wc('
'),components:[c.asSpec(),s.asSpec()],behaviours:Lr([ja.config({mode:"special",focusIn:function(n){var e=c.get(n);ja.focusIn(e)}}),wf("serializer-wrapper-events",[mr(L(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(nl(t.touches[0].clientX))}),mr(U(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(el(n,t.raw().touches[0].clientX))})}),mr(P(),function(r){u.state.dialogSwipeState.on(function(n){var e=c.get(r),t=-1*tl(n);i(e,t)})})])])}},ol=Z(function(t,r){return[{label:"the link group",items:[rl({fields:[Ff("url","Type or paste URL"),Ff("text","Link text"),Ff("title","Link title"),Ff("target","Link target"),(n="link",{name:n,spec:kf.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return F.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return F.some(pf.getInfo(r))},onExecute:function(n){var e=xs.getValue(n);pf.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),il=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],ul=lr([(Zs=Gn(),nf=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(Ve(t=o,n.element())&&!Ve(t,r)&&(console.warn(Gn()+" did not get interpreted by the desired target. \nOriginator: "+Do(o)+"\nTarget: "+Do(i)+"\nCheck the "+Gn()+" event handlers"),1))},{key:Zs,value:sr({can:nf})})]),al=Object.freeze({events:ul}),cl=h,sl=Hr(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn","isConnected"]),fl=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+Do(e().element())+" is not in context.")}};return sl({debugInfo:A("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),isConnected:A(!1)})},ll=function(n,o){var i={};return V(n,function(n,r){V(n,function(n,e){var t=bt(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},dl=function(n,e){return 1 "):r[0].name();return wt(o,{handler:e,purpose:A(t)})})});return St(e,{})},Sl=function(n){return Gt("custom.definition",Nt([Lt("dom","dom",ot(),Nt([Zt("tag"),ur("styles",{}),ur("classes",[]),ur("attributes",{}),rr("value"),rr("innerHtml")])),Zt("components"),Zt("uid"),ur("events",{}),ur("apis",A({})),Lt("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"]},tt.mergeWithThunk(A(e))),Jt()),rr("domModification"),Yo("originalSpec"),ur("debug.sketcher","unknown")]),n);var e},Tl=function(n){var e,t={tag:n.dom().tag(),classes:n.dom().classes(),attributes:k((e=n,wt(Ic(),e.uid())),n.dom().attributes()),styles:n.dom().styles(),domChildren:bn(n.components(),function(n){return n.element()})};return Or(k(t,n.dom().innerHtml().map(function(n){return wt("innerHtml",n)}).getOr({}),n.dom().value().map(function(n){return wt("value",n)}).getOr({})))},Ol=function(e,n){yn(n,function(n){to(e,n)})},kl=function(e,n){yn(n,function(n){ro(e,n)})},Cl=function(e){if(e.domChildren().isSome()&&e.defChildren().isSome())throw new Error("Cannot specify children and child specs! Must be one or the other.\nDef: "+(n=kr(e),Et(n,null,2)));return e.domChildren().fold(function(){var n=e.defChildren().getOr([]);return bn(n,Dl)},function(n){return n});var n},El=function(n){var e=se.fromTag(n.tag());qr(e,n.attributes().getOr({})),Ol(e,n.classes().getOr([])),Si(e,n.styles().getOr({})),ko(e,n.innerHtml().getOr(""));var t=Cl(n);return $e(e,t),n.value().each(function(n){Ef(e,n)}),e},Dl=function(n){var e=Or(n);return El(e)},Il=function(n,e){return t=n,o=bn(r=e,function(n){return or(n.name(),[Zt("config"),ur("state",zr)])}),i=Gt("component.behaviours",Vt(o),t.behaviours).fold(function(n){throw new Error(Kt(n)+"\nComplete spec:\n"+Et(t,null,2))},function(n){return n}),{list:r,data:H(i,function(n){var e=n().map(function(n){return{config:n.config(),state:n.state().init(n.config())}});return function(){return e}})};var t,r,o,i},Al=function(n){var e,t,r=(e=yt(n,"behaviours").getOr({}),t=wn(N(e),function(n){return e[n]!==undefined}),bn(t,function(n){return e[n].me}));return Il(n,r)},Ml=Hr(["getSystem","config","hasConfigured","spec","connect","disconnect","element","syncComponents","readState","components","events"]),Bl=function(n,e,t){var r,o,i,u,a=Tl(n),c=function(e,n,t,r){var o=k({},n);yn(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=ll(o,function(n,e){return{name:function(){return n},modification:e}}),u=H(i,function(n,e){return Dn(n,function(e){return e.modification().fold(function(){return[]},function(n){return[e]})})}),a=j(u,function(e,t){return yt(gl,t).fold(function(){return nt.error("Unknown field type: "+t)},function(n){return n(e,t)})});return St(a,{}).map(Cr)}(t,{"alloy.base.modification":(r=n,r.domModification().fold(function(){return Cr({})},Cr))},e,a).getOrDie();return i=c,u=k({tag:(o=a).tag(),classes:i.classes().getOr([]).concat(o.classes().getOr([])),attributes:C(o.attributes().getOr({}),i.attributes().getOr({})),styles:C(o.styles().getOr({}),i.styles().getOr({}))},i.innerHtml().or(o.innerHtml()).map(function(n){return wt("innerHtml",n)}).getOr({}),Er("domChildren",i.domChildren(),o.domChildren()),Er("defChildren",i.defChildren(),o.defChildren()),i.value().or(o.value()).map(function(n){return wt("value",n)}).getOr({})),Or(u)},Rl=function(n,e,t){var r,o,i,u,a,c,s={"alloy.base.behaviour":(r=n,r.events())};return(o=t,i=n.eventOrder(),u=e,a=s,c=bl(o,u,a),xl(c,i)).getOrDie()},Fl=function(n){var e,t,r,o,i,u,a,c,s,f,l,d,m,g,v=cl(n),p=(e=v,t=bt("components",[])(e),bn(t,Hl)),h=k(al,v,wt("components",p));return nt.value((r=h,i=fo(fl(o=function(){return g})),u=_t(Sl(k(r,{behaviours:undefined}))),a=Al(r),c=a.list,s=a.data,f=Bl(u,c,s),l=El(f),d=Rl(u,c,s),m=fo(u.components()),g=Ml({getSystem:i.get,config:function(n){if(n===Ec())return u.apis();if(b(n))throw new Error("Invalid input: only API constant is allowed");var e=s;return(w(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+Et(r,null,2))})()},hasConfigured:function(n){return w(s[n.name()])},spec:A(r),readState:function(n){return s[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},connect:function(n){i.set(n)},disconnect:function(){i.set(fl(o))},element:A(l),syncComponents:function(){var n=je(l),e=Dn(n,function(n){return i.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});m.set(e)},components:m.get,events:A(d)})))},Nl=function(n){var e=se.fromText(n);return Vl({element:e})},Vl=function(n){var t=Yt("external.component",Nt([Zt("element"),rr("uid")]),n),e=fo(fl());t.uid().each(function(n){var e;e=t.element(),_r(e,Mc,n)});var r=Ml({getSystem:e.get,config:F.none,hasConfigured:A(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(fl(function(){return r}))},element:A(t.element()),spec:A(n),readState:A("No state"),syncComponents:I,components:A([]),events:A({})});return kc(r)},Hl=function(e){return(n=e,yt(n,Tc)).fold(function(){var n=k({uid:Rc("")},e);return Fl(n).getOrDie()},function(n){return n});var n},zl=kc,jl="alloy.item-hover",Ll="alloy.item-focus",Ul=function(n){(yo(n.element()).isNone()||bi.isFocused(n))&&(bi.isFocused(n)||bi.focus(n),oe(n,jl,{item:n}))},Pl=function(n){oe(n,Ll,{item:n})},$l=A(jl),Wl=A(Ll),Gl=[Zt("data"),Zt("components"),Zt("dom"),rr("toggling"),ur("itemBehaviours",{}),ur("ignoreFocus",!1),ur("domModification",{}),qo("builder",function(n){return{dom:k(n.dom(),{attributes:{role:n.toggling().isSome()?"menuitemcheckbox":"menuitem"}}),behaviours:k(Lr([n.toggling().fold(ci.revoke,function(n){return ci.config(k({aria:{mode:"checked"}},n))}),bi.config({ignore:n.ignoreFocus(),onFocus:function(n){Pl(n)}}),ja.config({mode:"execution"}),xs.config({store:{mode:"memory",initialValue:n.data()}})]),n.itemBehaviours()),events:lr([(e=Jn(),r=ie,mr(e,function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){r(e,n,t)})})),hr($()),mr(_(),Ul),mr(Kn(),bi.focus)]),components:n.components(),domModification:n.domModification(),eventOrder:n.eventOrder()};var e,r}),ur("eventOrder",{})],_l=[Zt("dom"),Zt("components"),qo("builder",function(n){return{dom:n.dom(),components:n.components(),events:lr([(e=Kn(),mr(e,function(n,e){e.stop()}))])};var e})],ql=A([fc({name:"widget",overrides:function(e){return{behaviours:Lr([xs.config({store:{mode:"manual",getValue:function(n){return e.data()},setValue:function(){}}})])}}})]),Yl=[Zt("uid"),Zt("data"),Zt("components"),Zt("dom"),ur("autofocus",!1),ur("domModification",{}),Sc(ql()),qo("builder",function(t){var n=hc(0,t,ql()),e=bc("item-widget",t,n.internals()),r=function(n){return yc(n,t,"widget").map(function(n){return ja.focusIn(n),n})},o=function(n,e){return mu(e.event().target())||t.autofocus()&&e.setSource(n.element()),F.none()};return k({dom:t.dom(),components:e,domModification:t.domModification(),events:lr([xr(function(n,e){r(n).each(function(n){e.stop()})}),mr(_(),Ul),mr(Kn(),function(n,e){t.autofocus()?r(n):bi.focus(n)})]),behaviours:Lr([xs.config({store:{mode:"memory",initialValue:t.data()}}),bi.config({onFocus:function(n){Pl(n)}}),ja.config({mode:"special",focusIn:t.autofocus()?function(n){r(n)}:Wr(),onLeft:o,onRight:o,onEscape:function(n,e){return bi.isFocused(n)||t.autofocus()?(t.autofocus()&&e.setSource(n.element()),F.none()):(bi.focus(n),F.some(!0))}})])})})],Kl=Xt("type",{widget:Yl,item:Gl,separator:_l}),Xl=A([dc({factory:{sketch:function(n){var e=Yt("menu.spec item",Kl,n);return e.builder()(e)}},name:"items",unit:"item",defaults:function(n,e){var t=Rc("");return k({uid:t},e)},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus(),domModification:{classes:[n.markers().item()]}}}})]),Jl=A([Zt("value"),Zt("items"),Zt("dom"),Zt("components"),ur("eventOrder",{}),La("menuBehaviours",[au,xs,Tf,ja]),ar("movement",{mode:"menu",moveOnTab:!0},Xt("mode",{grid:[Ko(),qo("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers().item(),initSize:{numColumns:e.initSize().numColumns(),numRows:e.initSize().numRows()},focusManager:n.focusManager()}})],menu:[ur("moveOnTab",!0),qo("config",function(n,e){return{mode:"menu",selector:"."+n.markers().item(),moveOnTab:e.moveOnTab(),focusManager:n.focusManager()}})]})),nr("markers",Lo()),ur("fakeFocus",!1),ur("focusManager",cu()),$o("onHighlight")]),Ql=A("alloy.menu-focus"),Zl=Lc({name:"Menu",configFields:Jl(),partFields:Xl(),factory:function(n,e,t,r){return k({dom:k(n.dom(),{attributes:{role:"menu"}}),uid:n.uid(),behaviours:k(Lr([au.config({highlightClass:n.markers().selectedItem(),itemClass:n.markers().item(),onHighlight:n.onHighlight()}),xs.config({store:{mode:"memory",initialValue:n.value()}}),Tf.config({find:F.some}),ja.config(n.movement().config()(n,n.movement()))]),Ua(n.menuBehaviours())),events:lr([mr(Wl(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){au.highlight(e,n),t.stop(),oe(e,Ql(),{menu:e,item:n})})}),mr($l(),function(n,e){var t=e.event().item();au.highlight(n,t)})]),components:e,eventOrder:n.eventOrder()})}}),nd=function(n,e,t,r){var o=n.getSystem().build(r);Ke(n,o,t)},ed=function(n,e){return n.components()},td=Pr({fields:[],name:"replacing",apis:Object.freeze({append:function(n,e,t,r){nd(n,0,Pe,r)},prepend:function(n,e,t,r){nd(n,0,Ue,r)},remove:function(n,e,t,r){var o=ed(n,e);Tn(o,function(n){return Ve(r.element(),n.element())}).each(Je)},set:function(e,n,t,r){var o,i,u,a,c,s;i=(o=e).components(),yn(i,Xe),We(o.element()),o.syncComponents(),u=function(){var n=bn(r,e.getSystem().build);yn(n,function(n){Ye(e,n)})},a=e.element(),c=He(a),s=bo(c).bind(function(e){var n=function(n){return Ve(e,n)};return n(a)?F.some(a):vo(a,n)}),u(a),s.each(function(e){bo(c).filter(function(n){return Ve(n,e)}).fold(function(){po(e)},I)})},contents:ed})}),rd=function(t,r,o,n){return yt(o,n).bind(function(n){return yt(t,n).bind(function(n){var e=rd(t,r,o,n);return F.some([n].concat(e))})}).getOr([])},od=function(n,e){var t={};V(n,function(n,e){yn(n,function(n){t[n]=e})});var r=e,o=z(e,function(n,e){return{k:n,v:e}}),i=H(o,function(n,e){return[e].concat(rd(t,r,o,e))});return H(t,function(n){return yt(i,n).getOr([n])})},id=function(){var i=fo({}),u=fo({}),a=fo({}),c=fo(F.none()),s=fo({}),n=function(n){return yt(u.get(),n)};return{setContents:function(n,e,t,r){c.set(F.some(n)),i.set(t),u.set(e),s.set(r);var o=od(r,t);a.set(o)},expand:function(t){return yt(i.get(),t).map(function(n){var e=yt(a.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return yt(a.get(),n)},collapse:function(n){return yt(a.get(),n).bind(function(n){return 1");r[t[0]]=wt(t[1],n),r[t[1]]=wt(t[0],n)}),r},createBistate:function(n,e,t){return xt([{key:n,value:wt(e,t)},{key:e,value:wt(n,t)}])},createTristate:function(n,e,t,r){return xt([{key:n,value:xt([{key:e,value:r},{key:t,value:r}])},{key:e,value:xt([{key:n,value:r},{key:t,value:r}])},{key:t,value:xt([{key:n,value:r},{key:e,value:r}])}])}}}),hd=mi.resolve("scrollable"),bd={register:function(n){to(n,hd)},deregister:function(n){ro(n,hd)},scrollable:A(hd)},yd=function(n){return yt(n,"format").getOr(n.title)},wd=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[mi.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:mi.resolve("format-matches"),selected:t},itemBehaviours:Lr(o?[]:[si(n,function(n,e){(e?ci.on:ci.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},xd=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Uc.sketch({dom:{tag:"div",classes:[mi.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[mi.resolve("styles-collapse-icon")]}},Nl(n)]:[Nl(n)],action:function(n){if(r){var e=t().get(n);ad.collapseMenu(e)}}}),{dom:{tag:"div",classes:[mi.resolve("styles-menu-items-container")]},components:[Zl.parts().items({})],behaviours:Lr([wf("adhoc-scrollable-menu",[br(function(n,e){xi(n.element(),"overflow-y","auto"),xi(n.element(),"-webkit-overflow-scrolling","touch"),bd.register(n.element())}),yr(function(n){Ci(n.element(),"overflow-y"),Ci(n.element(),"-webkit-overflow-scrolling"),bd.deregister(n.element())})])])}],items:e,menuBehaviours:Lr([pd.config({initialState:"after",routes:pd.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},Sd=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return a},n=xd("Styles",[].concat(bn(o.items,function(n){return wd(yd(n),n.title,n.isSelected(),n.getPreview(),Tt(o.expansions,yd(n)))})),i,!1),e=H(o.menus,function(n,e){var t=bn(n,function(n){return wd(yd(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",Tt(o.expansions,yd(n)))});return xd(e,t,i,!0)}),t=k(e,wt("styles",n)),{tmenu:ad.tieredData("styles",t,o.expansions)}),a=js(ad.sketch({dom:{tag:"div",classes:[mi.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=xs.getValue(e);return r.handle(e,t.value),F.none()},onEscape:function(){return F.none()},onOpenMenu:function(n,e){var t=Cs(n.element());ks(e.element(),t),pd.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=Cs(n.element()),o=Hi(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();ks(t.element(),r),pd.progressTo(i,"before"),pd.jumpTo(t,"after"),pd.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Hi(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();pd.progressTo(o,"after"),pd.progressTo(t,"current")},navigateOnHover:!1,openImmediately:!0,data:u.tmenu,markers:{backgroundMenu:mi.resolve("styles-background-menu"),menu:mi.resolve("styles-menu"),selectedMenu:mi.resolve("styles-selected-menu"),item:mi.resolve("styles-item"),selectedItem:mi.resolve("styles-selected-item")}}));return a.asSpec()},Td=function(n){return Tt(n,"items")?(t=k(pt(e=n,["items"]),{menu:!0}),r=Od(e.items),{item:t,menus:k(r.menus,wt(e.title,r.items)),expansions:k(r.expansions,wt(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},Od=function(n){return xn(n,function(n,e){var t=Td(e);return{menus:k(n.menus,t.menus),items:[t.item].concat(n.items),expansions:k(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},kd={expand:Od},Cd=function(u,n){var a=function(n){return function(){return u.formatter.match(n)}},c=function(n){return function(){return u.formatter.getCssText(n)}},e=yt(n,"style_formats").getOr(il),s=function(n){return bn(n,function(n){if(Tt(n,"items")){var e=s(n.items);return k(k(n,{isSelected:A(!1),getPreview:A("")}),{items:e})}return Tt(n,"format")?k(i=n,{isSelected:a(i.format),getPreview:c(i.format)}):(r=Ja((t=n).title),o=k(t,{format:r,isSelected:a(r),getPreview:c(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return s(e)},Ed=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Dn(n,function(n){return n.items!==undefined?0e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===qd?[]:[zd(se.fromDom(r.win()),"blur",function(){t.getByDom(e).each(ci.off)}),zd(i,"select",n),zd(r.doc(),"selectionchange",n)]);return{destroy:function(){yn(a,function(n){n.unbind()})}}},Kd=function(n,e){var t=parseInt(Yr(n,e),10);return isNaN(t)?0:t},Xd=(ef=pe,tf="text",rf=function(n){return ef(n)?F.from(n.dom().nodeValue):F.none()},of=$n.detect().browser,{get:function(n){if(!ef(n))throw new Error("Can only get "+tf+" value of a "+tf+" node");return uf(n).getOr("")},getOption:uf=of.isIE()&&10===of.version.major?function(n){try{return rf(n)}catch(e){return F.none()}}:rf,set:function(n,e){if(!ef(n))throw new Error("Can only set raw "+tf+" value of a "+tf+" node");n.dom().nodeValue=e}}),Jd=function(n){return Xd.getOption(n)},Qd=et([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Zd={before:Qd.before,on:Qd.on,after:Qd.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(h,h,h)}},nm=et([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),em=we("start","soffset","finish","foffset"),tm=nm.relative,rm=nm.exact,om=function(n,e,t,r){var o,i,u,a,c,s=(i=e,u=t,a=r,(c=He(o=n).dom().createRange()).setStart(o.dom(),i),c.setEnd(u.dom(),a),c),f=Ve(n,t)&&e===r;return s.collapsed&&!f},im=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},um=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},am=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},cm=et([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),sm=function(n,e,t){return e(se.fromDom(t.startContainer),t.startOffset,se.fromDom(t.endContainer),t.endOffset)},fm=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:A(n),rtl:F.none}},relative:function(n,e){return{ltr:Z(function(){return im(o,n,e)}),rtl:Z(function(){return F.some(im(o,e,n))})}},exact:function(n,e,t,r){return{ltr:Z(function(){return um(o,n,e,t,r)}),rtl:Z(function(){return F.some(um(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return cm.rtl(se.fromDom(n.endContainer),n.endOffset,se.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return sm(0,cm.ltr,r)}):sm(0,cm.ltr,r)},lm=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n,e){var t=me(n);return"input"===t?Zd.after(n):hn(["br","img"],t)?0===e?Zd.before(n):Zd.after(n):Zd.on(n,e)}),dm=function(n,e,t,r,o){var i,u,a=um(n,e,t,r,o);i=n,u=a,F.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},mm=function(n,e,t,r,o){var i,u,a,c,l,s=(i=r,u=o,a=lm(e,t),c=lm(i,u),tm(a,c));fm(l=n,s).match({ltr:function(n,e,t,r){dm(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,a,c,s=l.getSelection();if(s.setBaseAndExtent)s.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(s.extend)try{i=n,u=e,a=t,c=r,(o=s).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(f){dm(l,t,r,n,e)}else dm(l,t,r,n,e)}})},gm=function(n){var e=se.fromDom(n.anchorNode),t=se.fromDom(n.focusNode);return om(e,n.anchorOffset,t,n.focusOffset)?F.some(em(se.fromDom(n.anchorNode),n.anchorOffset,se.fromDom(n.focusNode),n.focusOffset)):function(n){if(0e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),Tm(e,n.innerHeight)});return Tm(e,n.innerHeight),{toEditing:function(){xm(u)},destroy:function(){t.unbind()}}},Em=function(n){return F.some(se.fromDom(n.dom().contentWindow.document.body))},Dm=function(n){return F.some(se.fromDom(n.dom().contentWindow.document))},Im=function(n){return F.from(n.dom().contentWindow)},Am=function(n){return Im(n).bind(vm)},Mm=function(n){return n.getFrame()},Bm=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=Mm(e);return function(){return t(n)}})()}},Rm=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return zd(e,r,n)}})},Fm=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},Nm={getBody:Bm("getBody",Em),getDoc:Bm("getDoc",Dm),getWin:Bm("getWin",Im),getSelection:Bm("getSelection",Am),getFrame:Mm,getActiveApi:function(a){var c=Mm(a);return Em(c).bind(function(u){return Dm(c).bind(function(i){return Im(c).map(function(o){var n=se.fromDom(i.dom().documentElement),e=a.getCursorBox.getOrThunk(function(){return function(){return(n=o,vm(n).map(function(n){return rm(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return pm(o,n).orThunk(function(){return vm(o).filter(function(n){return Ve(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0