9 lines
226 KiB
JavaScript
9 lines
226 KiB
JavaScript
|
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e[f]=d(a[f]);b.apply(null,e)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("u",Array),h("v",Error),g("6",["u","v"],function(a,b){var c=function(){},d=function(a){return function(){return a()}},e=function(a,b){return function(){return a(b.apply(null,arguments))}},f=function(a){return function(){return a}},g=function(a){return a},h=function(a,b){return a===b},i=function(b){for(var c=new a(arguments.length-1),d=1;d<arguments.length;d++)c[d-1]=arguments[d];return function(){for(var d=new a(arguments.length),e=0;e<d.length;e++)d[e]=arguments[e];var f=c.concat(d);return b.apply(null,f)}},j=function(a){return function(){return!a.apply(null,arguments)}},k=function(a){return function(){throw new b(a)}},l=function(a){return a()},m=function(a){a()},n=f(!1),o=f(!0);return{noop:c,noarg:d,compose:e,constant:f,identity:g,tripleEquals:h,curry:i,not:j,die:k,apply:l,call:m,never:n,always:o}}),h("2n",Object),g("z",["6","2n"],function(a,b){var c=a.never,d=a.always,e=function(){return f},f=function(){var f=function(a){return a.isNone()},g=function(a){return a()},h=function(a){return a},i=function(){},j={fold:function(a,b){return a()},is:c,isSome:c,isNone:d,getOr:h,getOrThunk:g,getOrDie:function(a){throw new Error(a||"error: getOrDie called on none.")},or:h,orThunk:g,map:e,ap:e,each:i,bind:e,flatten:e,exists:c,forall:d,filter:e,equals:f,equals_:f,toArray:function(){return[]},toString:a.constant("none()")};return b.freeze&&b.freeze(j),j}(),g=function(a){var b=function(){return a},h=function(){return k},i=function(b){return g(b(a))},j=function(b){return b(a)},k={fold:function(b,c){return c(a)},is:function(b){return a===b},isSome:d,isNone:c,getOr:b,getOrThunk:b,getOrDie:b,or:h,orThunk:h,map:i,ap:function(b){return b.fold(e,function(b){return g(b(a))})},each:function(b){b(a)},bind:j,flatten:b,exists:j,forall:j,filter:function(b){return b(a)?k:f},equals:function(b){return b.is(a)},equals_:function(b,d){return b.fold(c,function(b){return d(a,b)})},toArray:function(){return[a]},toString:function(){return"some("+a+")"}};return k},h=function(a){return null===a||void 0===a?f:g(a)};return{some:g,none:e,from:h}}),h("2m",String),g("y",["z","u","v","2m"],function(a,b,c,d){var e=function(){var a=b.prototype.indexOf,c=function(b,c){return a.call(b,c)},d=function(a,b){return u(a,b)};return void 0===a?d:c}(),f=function(b,c){var d=e(b,c);return d===-1?a.none():a.some(d)},g=function(a,b){return e(a,b)>-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d<a;d++)c.push(b(d));return c},j=function(a,b){for(var c=[],d=0;d<a.length;d+=b){var e=a.slice(d,d+b);c.push(e)}return c},k=function(a,c){for(var d=a.length,e=new b(d),f=0;f<d;f++){var g=a[f];e[f]=c(g,f,a)}return e},l=function(a,b){for(var c=0,d=a.length;c<d;c++){var e=a[c];b(e,c,a)}},m=function(a,b){for(var c=a.length-1;c>=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e<f;e++){var g=a[e],h=b(g,e,a)?c:d;h.push(g)}return{pass:c,fail:d}},o=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++){var f=a[d];b(f,d,a)&&c.push(f)}return c},p=function(a,b){if(0===a.length)return[];for(var c=b(a[0]),d=[],e=[],f=0,g=a.length;f<g;f++){var h=a[f],i=b(h);i!==c&&(d.push(e),e=[]),c=i,e.push(h)}return 0!==e.length&&d.push(e),d},q=function(a,b,c){return m(a,function(a){c=b(c,a)}),c},r=function(a,b,c){return l(a,function(a){c=b(c,a)}),c},s=function(b,c){for(var d=0,e=b.length;d<e;d++){var f=b[d];if(c(f,d,b))return a.some(f)}r
|
||
|
return function(){var c=h.prototype.slice.call(arguments,0);return e.foldl(a,function(a,d){return a||b(d).apply(void 0,c)},!1)}},m=function(a){return d.isFunction(a)?{can:g.constant(!0),abort:g.constant(!1),run:a}:a},n=function(a){var b=k(a,function(a){return a.can}),c=l(a,function(a){return a.abort}),d=function(){var b=h.prototype.slice.call(arguments,0);e.each(a,function(a){a.run.apply(void 0,b)})};return j({can:b,abort:c,run:d})};return{read:m,fuse:n,nu:j}}),g("3d",["43","2","t","47","14"],function(a,b,c,d,e){var f=e.wrapAll,g=function(a,b){return{key:a,value:d.nu({abort:b})}},h=function(a,b){return{key:a,value:d.nu({can:b})}},i=function(a){return{key:a,value:d.nu({run:function(a,b){b.event().prevent()}})}},j=function(a,b){return{key:a,value:d.nu({run:b})}},k=function(a,b,c){return{key:a,value:d.nu({run:function(a){b.apply(void 0,[a].concat(c))}})}},l=function(a){return function(b){return j(a,b)}},m=function(b){return function(c){return{key:b,value:d.nu({run:function(b,d){a.isSource(b,d)&&c(b,d)}})}}},n=function(a,c){return j(a,function(d,e){d.getSystem().getByUid(c).each(function(c){b.dispatchEvent(c,c.element(),a,e)})})},o=function(a,b,c){var d=b.partUids()[c];return n(a,d)},p=function(a,b){return j(a,function(a,c){a.getSystem().getByDom(c.event().target()).each(function(d){b(a,d,c)})})},q=function(a){return j(a,function(a,b){b.cut()})},r=function(a){return j(a,function(a,b){b.stop()})};return{derive:f,run:j,preventDefault:i,runActionExtra:k,runOnAttached:m(c.attachedToDom()),runOnDetached:m(c.detachedFromDom()),runOnInit:m(c.systemInit()),runOnExecute:l(c.execute()),redirectToUid:n,redirectToPart:o,runWithTarget:p,abort:g,can:h,cutter:q,stopper:r}}),g("4a",["z"],function(a){var b=function(a,b,c){return a},c=function(a,b){return a},d=function(a,b){return a},e=a.none;return{markAsBehaviourApi:b,markAsExtraApi:c,markAsSketchApi:d,getAnnotation:e}}),g("4k",["y","6","u","v"],function(a,b,c,d){return function(){var e=arguments;return function(){for(var f=new c(arguments.length),g=0;g<f.length;g++)f[g]=arguments[g];if(e.length!==f.length)throw new d('Wrong number of arguments to struct. Expected "['+e.length+']", got '+f.length+" arguments");var h={};return a.each(e,function(a,c){h[a]=b.constant(f[c])}),h}}}),g("6p",["y","1i","v"],function(a,b,c){var d=function(a){return a.slice(0).sort()},e=function(a,b){throw new c("All required keys ("+d(a).join(", ")+") were not specified. Specified keys were: "+d(b).join(", ")+".")},f=function(a){throw new c("Unsupported keys for object: "+d(a).join(", "))},g=function(d,e){if(!b.isArray(e))throw new c("The "+d+" fields must be an array. Was: "+e+".");a.each(e,function(a){if(!b.isString(a))throw new c("The value "+a+" in the "+d+" fields was not a string.")})},h=function(a,b){throw new c("All values need to be of type: "+b+". Keys ("+d(a).join(", ")+") were not.")},i=function(b){var e=d(b),f=a.find(e,function(a,b){return b<e.length-1&&a===e[b+1]});f.each(function(a){throw new c("The field: "+a+" occurs more than once in the combined fields: ["+e.join(", ")+"].")})};return{sort:d,reqMessage:e,unsuppMessage:f,validateStrArr:g,invalidTypeMessage:h,checkDupes:i}}),g("4l",["y","6","x","z","6p","v","2n"],function(a,b,c,d,e,f,g){return function(h,i){var j=h.concat(i);if(0===j.length)throw new f("You must specify at least one required or optional field.");return e.validateStrArr("required",h),e.validateStrArr("optional",i),e.checkDupes(j),function(f){var k=c.keys(f),l=a.forall(h,function(b){return a.contains(k,b)});l||e.reqMessage(h,k);var m=a.filter(k,function(b){return!a.contains(j,b)});m.length>0&&e.unsuppMessage(m);var n={};return a.each(h,function(a){n[a]=b.constant(f[a])}),a.each(i,function(a){n[a]=b.constant(g.prototype.hasOwnProperty.call(f,a)?d.some(f[a]):d.none())}),n}}}),g("2o",["4k","4l"],function(a,b){return{immutable:a,immutableBag:b}}),g("6o",["6n","2o","2m"],function(a,b,c){var d=b.immutableBag(["tag"],["classes","attributes","styles","value","innerHtml","domChildren","defChildren"]),e=function(b){var c=f(b);return a.stringify(c,null,2)},f=function(a){return{tag:a.tag(),class
|
||
|
ESCAPE:a.constant([27]),SPACE:a.constant([32]),PAGEUP:a.constant([33]),PAGEDOWN:a.constant([34]),END:a.constant([35]),HOME:a.constant([36]),LEFT:a.constant([37]),UP:a.constant([38]),RIGHT:a.constant([39]),DOWN:a.constant([40]),INSERT:a.constant([45]),DEL:a.constant([46]),META:a.constant([91,93,224]),F10:a.constant([121])}}),g("94",[],function(){var a=function(a,b,c,d){var e=a+b;return e>d?c:e<c?d:e},b=function(a,b,c){return a<=b?b:a>=c?c:a};return{cycleBy:a,cap:b}}),g("7o",["y","12","10"],function(a,b,c){var d=function(a){return h(b.body(),a)},e=function(b,d,e){return a.filter(c.parents(b,e),d)},f=function(b,d){return a.filter(c.siblings(b),d)},g=function(b,d){return a.filter(c.children(b),d)},h=function(b,d){var e=[];return a.each(c.children(b),function(a){d(a)&&(e=e.concat([a])),e=e.concat(h(a,d))}),e};return{all:d,ancestors:e,siblings:f,children:g,descendants:h}}),g("5l",["7o","2r"],function(a,b){var c=function(a){return b.all(a)},d=function(c,d,e){return a.ancestors(c,function(a){return b.is(a,d)},e)},e=function(c,d){return a.siblings(c,function(a){return b.is(a,d)})},f=function(c,d){return a.children(c,function(a){return b.is(a,d)})},g=function(a,c){return b.all(c,a)};return{all:c,ancestors:d,siblings:e,children:f,descendants:g}}),g("7m",["94","y","z","48","2f","5l","4u","v"],function(a,b,c,d,e,f,g,h){var i=function(a,c,d){var g=f.descendants(a.element(),"."+c.highlightClass());b.each(g,function(b){e.remove(b,c.highlightClass()),a.getSystem().getByDom(b).each(function(b){c.onDehighlight()(a,b)})})},j=function(a,b,c,d){var f=o(a,b,c,d);e.remove(d.element(),b.highlightClass()),f&&b.onDehighlight()(a,d)},k=function(a,b,c,d){var f=o(a,b,c,d);i(a,b,c),e.add(d.element(),b.highlightClass()),f||b.onHighlight()(a,d)},l=function(a,b,c){r(a,b,c).each(function(d){k(a,b,c,d)})},m=function(a,b,c){s(a,b,c).each(function(d){k(a,b,c,d)})},n=function(a,b,c,d){q(a,b,c,d).fold(function(a){throw new h(a)},function(d){k(a,b,c,d)})},o=function(a,b,c,d){return e.has(d.element(),b.highlightClass())},p=function(a,b,c){return g.descendant(a.element(),"."+b.highlightClass()).bind(a.getSystem().getByDom)},q=function(a,b,e,g){var h=f.descendants(a.element(),"."+b.itemClass());return c.from(h[g]).fold(function(){return d.error("No element found with index "+g)},a.getSystem().getByDom)},r=function(a,b,c){return g.descendant(a.element(),"."+b.itemClass()).bind(a.getSystem().getByDom)},s=function(a,b,d){var e=f.descendants(a.element(),"."+b.itemClass()),g=e.length>0?c.some(e[e.length-1]):c.none();return g.bind(a.getSystem().getByDom)},t=function(c,d,g,h){var i=f.descendants(c.element(),"."+d.itemClass()),j=b.findIndex(i,function(a){return e.has(a,d.highlightClass())});return j.bind(function(b){var d=a.cycleBy(b,h,0,i.length-1);return c.getSystem().getByDom(i[d])})},u=function(a,b,c){return t(a,b,c,-1)},v=function(a,b,c){return t(a,b,c,1)};return{dehighlightAll:i,dehighlight:j,highlight:k,highlightFirst:l,highlightLast:m,highlightAt:n,isHighlighted:o,getHighlighted:p,getFirst:r,getLast:s,getPrevious:u,getNext:v}}),g("7n",["4q","29"],function(a,b){return[b.strict("highlightClass"),b.strict("itemClass"),a.onHandler("onHighlight"),a.onHandler("onDehighlight")]}),g("5j",["q","7m","7n","u"],function(a,b,c,d){return a.create({fields:c,name:"highlighting",apis:b})}),g("97",["5j","6","8"],function(a,b,c){var d=function(){var a=function(a){return c.search(a.element())},b=function(a,b){a.getSystem().triggerFocus(b,a.element())};return{get:a,set:b}},e=function(){var c=function(b){return a.getHighlighted(b).map(function(a){return a.element()})},d=function(c,d){c.getSystem().getByDom(d).fold(b.noop,function(b){a.highlight(c,b)})};return{get:c,set:d}};return{dom:d,highlights:e}}),g("8t",["y","6"],function(a,b){var c=function(b){return function(c){return a.contains(b,c.raw().which)}},d=function(b){return function(c){return a.forall(b,function(a){return a(c)})}},e=function(a){return function(b){return b.raw().which===a}},f=function(a){return a.raw().shiftKey===!0};return{inSet:c,and:d,is:e,isShift:f,isNotShift:b.not(f)}}),g("8u",["8t","y"],function(a,b){var c=funct
|
||
|
var b=d(a);return{dom:b}};return{dom:d,spec:e}}),g("l",["q","1g","1m","1n","w","1l","i","1o"],function(a,b,c,d,e,f,g,h){var i=function(a,b){return m(b,function(){a.execCommand(b)},{})},j=function(c){return a.derive([b.config({toggleClass:g.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),f.format(c,function(a,c){var d=c?b.on:b.off;d(a)})])},k=function(a,b){var c=j(b);return m(b,function(){a.execCommand(b)},c)},l=function(a,b,c,d){var e=j(c);return m(b,d,e)},m=function(b,f,g){return d.sketch({dom:h.dom('<span class="${prefix}-toolbar-button ${prefix}-icon-'+b+' ${prefix}-icon"></span>'),action:f,buttonBehaviours:e.deepMerge(a.derive([c.config({})]),g)})};return{forToolbar:m,forToolbarCommand:i,forToolbarStateAction:l,forToolbarStateCommand:k}}),g("92",["1w"],function(a){var b=function(b,c,d,e){return b<c?b:b>d?d:b===c?c-1:a.max(c,b-e)},c=function(b,c,d,e){return b>d?b:b<c?c:b===d?d+1:a.min(d,b+e)},d=function(b,c,d){return a.max(c,a.min(d,b))},e=function(b,c,e,f,g,h){return h.fold(function(){var b=c-e,h=a.round(b/g)*g;return d(e+h,e-1,f+1)},function(b){var d=(c-b)%g,e=a.round(d/g),h=a.floor((c-b)/g),i=a.floor((f-b)/g),j=a.min(i,h+e),k=b+j*g;return a.max(b,k)})},f=function(b,c,f,g,h,i,j){var k=f-c;if(g<b.left)return c-1;if(g>b.right)return f+1;var l=a.min(b.right,a.max(g,b.left))-b.left,m=d(l/b.width*k+c,c-1,f+1),n=a.round(m);return i&&m>=c&&m<=f?e(b,m,c,f,h,j):n};return{reduceBy:b,increaseBy:c,findValueOfX:f}}),g("74",["2","92","6","z","7","1w"],function(a,b,c,d,e,f){var g="slider.change.value",h=e.detect().deviceType.isTouch(),i=function(a){var b=a.event().raw();return h&&void 0!==b.touches&&1===b.touches.length?d.some(b.touches[0]):h&&void 0!==b.touches?d.none():h||void 0===b.clientX?d.none():d.some(b)},j=function(a){var b=i(a);return b.map(function(a){return a.clientX})},k=function(b,c){a.emitWith(b,g,{value:c})},l=function(a,b){k(a,b.min(),d.none())},m=function(a,b){k(a,b.max(),d.none())},n=function(a,b){k(a,b.max()+1,d.none())},o=function(a,b){k(a,b.min()-1,d.none())},p=function(a,c,d,e){var f=b.findValueOfX(c,d.min(),d.max(),e,d.stepSize(),d.snapToGrid(),d.snapStart());k(a,f)},q=function(a,b,c,d){return j(d).map(function(d){return p(a,c,b,d),d})},r=function(a,c){var e=b.reduceBy(c.value().get(),c.min(),c.max(),c.stepSize());k(a,e,d.none())},s=function(a,c){var e=b.increaseBy(c.value().get(),c.min(),c.max(),c.stepSize());k(a,e,d.none())};return{setXFromEvent:q,setToLedge:o,setToRedge:n,moveLeftFromRedge:m,moveRightFromLedge:l,moveLeft:r,moveRight:s,changeEvent:c.constant(g)}}),g("54",["q","32","33","3d","2g","53","74","29","5","6","z","7"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=l.detect(),n=m.deviceType.isTouch(),o=function(a,b){return f.optional({name:""+a+"-edge",overrides:function(a){var c=d.derive([d.runActionExtra(e.touchstart(),b,[a])]),f=d.derive([d.runActionExtra(e.mousedown(),b,[a]),d.runActionExtra(e.mousemove(),function(a,c){c.mouseIsDown().get()&&b(a,c)},[a])]);return{events:n?c:f}}})},p=o("left",g.setToLedge),q=o("right",g.setToRedge),r=f.required({name:"thumb",defaults:j.constant({dom:{styles:{position:"absolute"}}}),overrides:function(a){return{events:d.derive([d.redirectToPart(e.touchstart(),a,"spectrum"),d.redirectToPart(e.touchmove(),a,"spectrum"),d.redirectToPart(e.touchend(),a,"spectrum")])}}}),s=f.required({schema:[h.state("mouseIsDown",function(){return i(!1)})],name:"spectrum",overrides:function(f){var h=function(a,b){var c=a.element().dom().getBoundingClientRect();g.setXFromEvent(a,f,c,b)},i=d.derive([d.run(e.touchstart(),h),d.run(e.touchmove(),h)]),j=d.derive([d.run(e.mousedown(),h),d.run(e.mousemove(),function(a,b){f.mouseIsDown().get()&&h(a,b)})]);return{behaviours:a.derive(n?[]:[c.config({mode:"special",onLeft:function(a){return g.moveLeft(a,f),k.some(!0)},onRight:function(a){return g.moveRight(a,f),k.some(!0)}}),b.config({})]),events:n?i:j}}});return[p,q,r,s]}),g("55",["29","5","6","7"],function(a,b,c,d){var e=d.detect().deviceType.isTouch();return[a.strict("min"),a.strict("max"),a.defaulted("stepSize",1),a.defaulted("onChange",c.noop),a.defaulted("onInit",c.
|
||
|
u.set(a,"left",e-b*f+"px")}),G.state.currentScreen.set(G.state.currentScreen.get()+b))})},K=function(a){var b=v.descendants(a.element(),"input"),c=s.from(b[G.state.currentScreen.get()]);c.each(function(b){a.getSystem().getByDom(b).each(function(b){j.dispatchFocus(a,b.element())})});var e=N.get(a);d.highlightAt(e,G.state.currentScreen.get())},L=function(){G.state.currentScreen.set(0),G.state.dialogSwipeState.clear()},M=h.record(n.sketch(function(c){return{dom:B.dom('<div class="${prefix}-serialised-dialog"></div>'),components:[m.sketch({dom:B.dom('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:q.map(G.fields,function(a,b){return b<=G.maxFieldIndex?m.sketch({dom:B.dom('<div class="${prefix}-serialised-dialog-screen"></div>'),components:q.flatten([[H(-1,"previous",b>0)],[c.field(a.name,a.spec)],[H(1,"next",b<G.maxFieldIndex)]])}):c.field(a.name,a.spec)})})],formBehaviours:b.derive([y.orientation(function(a,b){I(a,b)}),e.config({mode:"special",focusIn:function(a){K(a)},onTab:function(a){return J(a,1),s.some(!0)},onShiftTab:function(a){return J(a,-1),s.some(!0)}}),a.config(E,[i.runOnAttached(function(a,b){L();var c=N.get(a);d.highlightFirst(c),G.getInitialValue(a).each(function(b){g.setValue(a,b)})}),i.runOnExecute(G.onExecute),i.run(k.transitionend(),function(a,b){"left"===b.event().raw().propertyName&&K(a)}),i.run(C,function(a,b){var c=b.event().direction();J(a,c)})])])}})),N=h.record({dom:B.dom('<div class="${prefix}-dot-container"></div>'),behaviours:b.derive([d.config({highlightClass:A.resolve("dot-active"),itemClass:A.resolve("dot-item")})]),components:q.bind(G.fields,function(a,b){return b<=G.maxFieldIndex?[B.spec('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:B.dom('<div class="${prefix}-serializer-wrapper"></div>'),components:[M.asSpec(),N.asSpec()],behaviours:b.derive([e.config({mode:"special",focusIn:function(a){var b=M.get(a);e.focusIn(b)}}),a.config(D,[i.run(k.touchstart(),function(a,b){G.state.dialogSwipeState.set(z.init(b.event().raw().touches[0].clientX))}),i.run(k.touchmove(),function(a,b){G.state.dialogSwipeState.on(function(a){b.event().prevent(),G.state.dialogSwipeState.set(z.move(a,b.event().raw().touches[0].clientX))})}),i.run(k.touchend(),function(a){G.state.dialogSwipeState.on(function(b){var c=M.get(a),d=-1*z.complete(b);J(c,d)})})])])}};return{sketch:C}}),g("3k",["6","7"],function(a,b){var c=b.detect(),d=function(a,b){var c=b.selection.getRng();a(),b.selection.setRng(c)},e=function(b,e){var f=c.os.isAndroid()?d:a.apply;f(e,b)};return{forAndroid:e}}),g("1s",["3g","z","17","3h","l","3i","3j","3k"],function(a,b,c,d,e,f,g,h){var i=c.cached(function(c,e){return[{label:"the link group",items:[g.sketch({fields:[f.field("url","Type or paste URL"),f.field("text","Link text"),f.field("title","Link title"),f.field("target","Link target"),f.hidden("link")],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return b.some(d.getInfo(e))},onExecute:function(b){var f=a.getValue(b);d.applyInfo(e,f),c.restoreToolbar(),e.focus()}})]}]}),j=function(a,b){return e.forToolbarStateAction(b,"link","link",function(){var c=i(a,b);a.setContextToolbar(c),h.forAndroid(b,function(){a.focusToolbar()}),d.query(b).each(function(a){b.selection.select(a.dom())})})};return{sketch:j}}),g("3l",[],function(){return[{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:"
|
||
|
return x(v(b),b.title,void 0!==b.isSelected&&b.isSelected(),void 0!==b.getPreview?b.getPreview():"",l.hasKey(a.expansions,v(b)))});return y(d,e,b,!0)}),e=n.deepMerge(d,l.wrap("styles",c)),f=k.tieredData("styles",e,a.expansions);return{tmenu:f}},x=function(a,c,e,f,g){return{data:{value:a,text:c},type:"item",dom:{tag:"div",classes:g?[t.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:t.resolve("format-matches"),selected:e},itemBehaviours:b.derive(g?[]:[s.format(a,function(a,b){var c=b?d.on:d.off;c(a)})]),components:[{dom:{tag:"div",attributes:{style:f},innerHtml:c}}]}},y=function(c,d,g,l){return{value:c,dom:{tag:"div"},components:[i.sketch({dom:{tag:"div",classes:[t.resolve("styles-collapser")]},components:l?[{dom:{tag:"span",classes:[t.resolve("styles-collapse-icon")]}},f.text(c)]:[f.text(c)],action:function(a){if(l){var b=g().get(a);k.collapseMenu(b)}}}),{dom:{tag:"div",classes:[t.resolve("styles-menu-items-container")]},components:[j.parts().items({})],behaviours:b.derive([a.config("adhoc-scrollable-menu",[h.runOnAttached(function(a,b){p.set(a.element(),"overflow-y","auto"),p.set(a.element(),"-webkit-overflow-scrolling","touch"),u.register(a.element())}),h.runOnDetached(function(a){p.remove(a.element(),"overflow-y"),p.remove(a.element(),"-webkit-overflow-scrolling"),u.deregister(a.element())})])])}],items:d,menuBehaviours:b.derive([e.config({initialState:"after",routes:e.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},z=function(a){var b=w(a.formats,function(){return d}),d=g.record(k.sketch({dom:{tag:"div",classes:[t.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(b,d){var e=c.getValue(d);a.handle(d,e.value)},onEscape:function(){},onOpenMenu:function(a,b){var c=r.get(a.element());r.set(b.element(),c),e.jumpTo(b,"current")},onOpenSubmenu:function(a,b,c){var d=r.get(a.element()),f=q.ancestor(b.element(),'[role="menu"]').getOrDie("hacky"),g=a.getSystem().getByDom(f).getOrDie();r.set(c.element(),d),e.progressTo(g,"before"),e.jumpTo(c,"after"),e.progressTo(c,"current")},onCollapseMenu:function(a,b,c){var d=q.ancestor(b.element(),'[role="menu"]').getOrDie("hacky"),f=a.getSystem().getByDom(d).getOrDie();e.progressTo(f,"after"),e.progressTo(c,"current")},navigateOnHover:!1,openImmediately:!0,data:b.tmenu,markers:{backgroundMenu:t.resolve("styles-background-menu"),menu:t.resolve("styles-menu"),selectedMenu:t.resolve("styles-selected-menu"),item:t.resolve("styles-item"),selectedItem:t.resolve("styles-selected-item")}}));return d.asSpec()};return{sketch:z}}),g("3n",["14","y","w"],function(a,b,c){var d=function(b){var d=c.deepMerge(a.exclude(b,["items"]),{menu:!0}),e=f(b.items,b.title),g=c.deepMerge(e.menus,a.wrap(b.title,e.items)),h=c.deepMerge(e.expansions,a.wrap(b.title,b.title));return{item:d,menus:g,expansions:h}},e=function(b){return a.hasKey(b,"items")?d(b):{item:b,menus:{},expansions:{}}},f=function(a){return b.foldr(a,function(a,b){var d=e(b);return{menus:c.deepMerge(a.menus,d.menus),items:[d.item].concat(a.items),expansions:c.deepMerge(a.expansions,d.expansions)}},{menus:{},expansions:{},items:[]})};return{expand:f}}),g("1t",["1g","14","y","6","3f","w","3l","3m","3n"],function(a,b,c,d,e,f,g,h,i){var j=function(a,h){var i=function(b){return function(){return a.formatter.match(b)}},j=function(b){return function(){var c=a.formatter.getCssText(b);return c}},k=function(a){return f.deepMerge(a,{isSelected:i(a.format),getPreview:j(a.format)})},l=function(a){return f.deepMerge(a,{isSelected:d.constant(!1),getPreview:d.constant("")})},m=function(b){var c=e.generate(b.title),d=f.deepMerge(b,{format:c,isSelected:i(c),getPreview:j(c)});return a.formatter.register(c,d),d},n=b.readOptFrom(h,"style_formats").getOr(g),o=function(a){return c.map(a,function(a){if(b.hasKey(a,"items")){var c=o(a.items);return f.deepMerge(l(a),{items:c})}return b.hasKey(a,"format")?k(a):m(a)})};return o(n)},k=function(a,d){var e=function(d){return c.bind(d,function(c){if(void 0!==c.items){var d=e(c.items);return d.length>0?[c]:
|
||
|
components:[d.sketch({dom:i.dom('<div class="${prefix}-content-tap-section"></div>'),components:[k.asSpec()],action:function(a){l.throttle()},buttonBehaviours:a.derive([b.config({toggleClass:h.resolve("mask-tap-icon-selected")})])})]})]})};return{sketch:j}}),g("20",["3q","2e","6","9","39","3r","3s","3t"],function(a,b,c,d,e,f,g,h){var i=function(i){var j=b.asRawOrDie("Getting AndroidWebapp schema",g,i);e.set(j.toolstrip,"width","100%");var k=function(){j.setReadOnly(!0),n.enter()},l=a.build(h.sketch(k,j.translate));j.alloy.add(l);var m={show:function(){j.alloy.add(l)},hide:function(){j.alloy.remove(l)}};d.append(j.container,l.element());var n=f.create(j,m);return{setReadOnly:j.setReadOnly,refreshStructure:c.noop,enter:n.enter,exit:n.exit,destroy:c.noop}};return{produce:i}}),g("63",["q","1y","4q","53","29","6"],function(a,b,c,d,e,f){var g=[e.defaulted("shell",!0),e.defaulted("toolbarBehaviours",{})],h=function(c){return{behaviours:a.derive([b.config({})])}},i=[d.optional({name:"groups",overrides:h})];return{name:f.constant("Toolbar"),schema:f.constant(g),parts:f.constant(i)}}),g("3w",["q","1y","34","52","63","w","z","16","v"],function(a,b,c,d,e,f,g,h,i){var j=function(c,e,j,k){var l=function(a,c){m(a).fold(function(){throw h.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new i("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(a){b.set(a,c)})},m=function(a){return c.shell()?g.some(a):d.getPart(a,c,"groups")},n=c.shell()?{behaviours:[b.config({})],components:[]}:{behaviours:[],components:e};return{uid:c.uid(),dom:c.dom(),components:n.components,behaviours:f.deepMerge(a.derive(n.behaviours),c.toolbarBehaviours()),apis:{setGroups:l},domModification:{attributes:{role:"group"}}}};return c.composite({name:"Toolbar",configFields:e.schema(),partFields:e.parts(),factory:j,apis:{setGroups:function(a,b,c){a.setGroups(b,c)}}})}),g("65",["4q","53","29","6"],function(a,b,c,d){var e=[c.strict("items"),a.markers(["itemClass"]),c.defaulted("hasTabstop",!0),c.defaulted("tgroupBehaviours",{})],f=[b.group({name:"items",unit:"item",overrides:function(a){return{domModification:{classes:[a.markers().itemClass()]}}}})];return{name:d.constant("ToolbarGroup"),schema:d.constant(e),parts:d.constant(f)}}),g("3x",["q","33","64","34","65","w","v"],function(a,b,c,d,e,f,g){var h=function(d,e,g,h){return f.deepMerge({dom:{attributes:{role:"toolbar"}}},{uid:d.uid(),dom:d.dom(),components:e,behaviours:f.deepMerge(a.derive([b.config({mode:"flow",selector:"."+d.markers().itemClass()}),d.hasTabstop()?c.config({}):c.revoke()]),d.tgroupBehaviours()),"debug.sketcher":g["debug.sketcher"]})};return d.composite({name:"ToolbarGroup",configFields:e.schema(),partFields:e.parts(),factory:h})}),g("3y",["6","1u","4i","4u","i"],function(a,b,c,d,e){var f="data-"+e.resolve("horizontal-scroll"),g=function(a){a.dom().scrollTop=1;var b=0!==a.dom().scrollTop;return a.dom().scrollTop=0,b},h=function(a){a.dom().scrollLeft=1;var b=0!==a.dom().scrollLeft;return a.dom().scrollLeft=0,b},i=function(a){return a.dom().scrollTop>0||g(a)},j=function(a){return a.dom().scrollLeft>0||h(a)},k=function(a){c.set(a,f,"true")},l=function(a){return"true"===c.get(a,f)?j:i},m=function(c,e){return b.bind(c,"touchmove",function(b){d.closest(b.target(),e).filter(l).fold(function(){b.raw().preventDefault()},a.noop)})};return{exclusive:m,markAsHorizontal:k}}),g("21",["3u","q","33","1g","3q","3d","3v","3w","3x","y","5","6","39","3y","i","3z","1o"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){return function(){var r=function(c){var d=c.scrollable===!0?"${prefix}-toolbar-scrollable-group":"";return{dom:q.dom('<div aria-label="'+c.label+'" class="${prefix}-toolbar-group '+d+'"></div>'),tgroupBehaviours:b.derive([a.config("adhoc-scrollable-toolbar",c.scrollable===!0?[f.runOnInit(function(a,b){m.set(a.element(),"overflow-x","auto"),n.markAsHorizontal(a.element()),p.register(a.element())})]:[])]),components:[g.sketch({components:[i.parts().items({})]})],markers:{itemClass:o.resolve("toolbar-group-item")},item
|
||
|
var i=function(b,e,i,j){var k=function(){g.resume(e,j)},l=function(){h.input(b,c.blur)},m=d.bind(i,"keydown",function(b){a.contains(["input","textarea"],f.name(b.target()))||k()}),n=function(){},o=function(){m.unbind()};return{toReading:l,toEditing:k,onToolbarTouch:n,destroy:o}},j=function(a,d,e,f){var h=function(){c.blur(f)},i=function(){h()},j=function(){h()},k=function(){g.resume(d,f)};return{toReading:j,toEditing:k,onToolbarTouch:i,destroy:b.noop}};return{stubborn:i,timid:j}}),g("42",["6","1z","2o","8","a","2f","39","1b","6f","6g","5z","3y","6h","60","i","3z","61"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r=function(r,s){var t=q.tag(),u=b.value(),v=b.value(),w=b.api(),x=b.api(),y=function(){s.hide();var b=e.fromDom(h);k.getActiveApi(r.editor).each(function(e){u.set({socketHeight:g.getRaw(r.socket,"height"),iframeHeight:g.getRaw(e.frame(),"height"),outerScroll:h.body.scrollTop}),v.set({exclusives:l.exclusive(b,"."+p.scrollable())}),f.add(r.container,o.resolve("fullscreen-maximized")),n.clobberStyles(r.container,e.body()),t.maximize(),g.set(r.socket,"overflow","scroll"),g.set(r.socket,"-webkit-overflow-scrolling","touch"),d.focus(e.body());var k=c.immutableBag(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);w.set(j.setup(k({cWin:e.win(),ceBody:e.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:e.frame(),cursor:a.noop,outerBody:r.body,outerWindow:r.win,keyboardType:m.stubborn,isScrolling:function(){return v.get().exists(function(a){return a.socket.isScrolling()})}}))),w.run(function(a){a.syncHeight()}),x.set(i.initEvents(e,w,r.toolstrip,r.socket,r.dropup))})},z=function(){t.restore(),x.clear(),w.clear(),s.show(),u.on(function(a){a.socketHeight.each(function(a){g.set(r.socket,"height",a)}),a.iframeHeight.each(function(a){g.set(r.editor.getFrame(),"height",a)}),h.body.scrollTop=a.scrollTop}),u.clear(),v.on(function(a){a.exclusives.unbind()}),v.clear(),f.remove(r.container,o.resolve("fullscreen-maximized")),n.restoreStyles(),p.deregister(r.toolbar),g.remove(r.socket,"overflow"),g.remove(r.socket,"-webkit-overflow-scrolling"),d.blur(r.editor.getFrame()),k.getActiveApi(r.editor).each(function(a){a.clearSelection()})},A=function(){w.run(function(a){a.refreshStructure()})};return{enter:y,refreshStructure:A,exit:z}};return{create:r}}),g("25",["3q","2e","6","39","3s","42","3t"],function(a,b,c,d,e,f,g){var h=function(h){var i=b.asRawOrDie("Getting IosWebapp schema",e,h);d.set(i.toolstrip,"width","100%"),d.set(i.container,"position","relative");var j=function(){i.setReadOnly(!0),m.enter()},k=a.build(g.sketch(j,i.translate));i.alloy.add(k);var l={show:function(){i.alloy.add(k)},hide:function(){i.alloy.remove(k)}},m=f.create(i,l);return{setReadOnly:i.setReadOnly,refreshStructure:m.refreshStructure,enter:m.enter,exit:m.exit,destroy:c.noop}};return{produce:h}}),g("m",["1y","6","1z","25","i","21","22","23","24"],function(a,b,c,d,e,f,g,h,i){return function(j){var k=i({classes:[e.resolve("ios-container")]}),l=f(),m=c.api(),n=g.makeEditSwitch(m),o=g.makeSocket(),p=h.build(function(){m.run(function(a){a.refreshStructure()})},j);k.add(l.wrapper()),k.add(o),k.add(p.component());var q=function(a){var b=l.createGroups(a);l.setGroups(b)},r=function(a){var b=l.createGroups(a);l.setContextToolbar(b)},s=function(){l.focus()},t=function(){l.restoreToolbar()},u=function(a){m.set(d.produce(a))},v=function(){m.run(function(b){a.remove(o,n),b.exit()})},w=function(a){g.updateMode(o,n,a,k.root())};return{system:b.constant(k),element:k.element,init:u,exit:v,setToolbarGroups:q,setContextToolbar:r,focusToolbar:s,restoreToolbar:t,updateMode:w,socket:b.constant(o),dropup:b.constant(p)}}}),g("26",["1e"],function(a){return a("tinymce.EditorManager")}),g("n",["14","26"],function(a,b){var c=function(c){var d=a.readOptFrom(c.settings,"skin_url").fold(function(){return b.baseURL+"/skins/lightgray"},function(a){return a});return{content:d+"/content.mobile.min.css",ui:d+"/skin.mobile.min.css"}};return{derive:c}}
|