Index: /CKEditor/branches/features/bespin/_source/plugins/bespin/assets/bespin_embedded.css
===================================================================
--- /CKEditor/branches/features/bespin/_source/plugins/bespin/assets/bespin_embedded.css	(revision 5393)
+++ /CKEditor/branches/features/bespin/_source/plugins/bespin/assets/bespin_embedded.css	(revision 5394)
@@ -1,381 +1,1 @@
-.sc-button-view.sc-static-layout{margin:0 4px;}
-.sc-button-view{display:inline-block;vertical-align:middle;background-color:#d0d0d0;border:1px #666 solid;color:black;text-decoration:none;font-weight:bold;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;}
-.sc-button-view .sc-button-inner{position:relative;display:block;height:100%;text-align:center;}
-.sc-button-view label{position:relative;display:block;line-height:21px;text-align:center;}
-.sc-button-view img{vertical-align:middle;margin-right:2px;position:relative;top:-2px;left:-2px;}
-.sc-button-view.disabled,.sc-button-view.disabled.active{background-color:#e0e0e0;border:1px #a0a0a0 solid;color:#a0a0a0;}
-.sc-button-view.active,.sc-button-view.sel{background-color:#333;border:1px #333 solid;color:white;}
-.sc-view{font-family:"Lucida Sans","Lucida Grande",Verdana,Arial,sans-serif;font-size:12px;line-height:1.4;}
-// YUI reset .sc-view body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}
-.sc-view table{border-collapse:collapse;border-spacing:0;}
-.sc-view fieldset,.sc-view img{border:0;}
-.sc-view address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}
-.sc-view del,.sc-view ins{text-decoration:none;}
-.sc-view li{list-style:none;}
-.sc-view caption,th{text-align:left;}
-.sc-view h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
-.sc-view q:before,q:after{content:'';}
-.sc-view abbr,acronym{border:0;font-variant:normal;}
-.sc-view sup{vertical-align:baseline;}
-.sc-view sub{vertical-align:baseline;}
-.sc-view legend{color:#000;}
-.sc-view input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}
-.sc-view input,button,textarea,select{*font-size:100%;}
-.sc-benchmark-graph{z-index:100000;background-color:white;position:absolute;top:0;left:0;bottom:0;overflow:auto;right:0;}
-.sc-benchmark-title{font-size:12px;font-weight:bold;position:absolute;left:0;top:5px;}
-.sc-benchmark-emphasis{font-weight:bold;}
-.sc-benchmark-top{height:20px;left:0;top:25px;background-color:#ccc;opacity:.4;position:relative;border-top:1px solid #aaa;border-bottom:1px solid #aaa;}
-.sc-benchmark-tick{width:1px;height:2000px;position:absolute;top:25px;background-color:#ccc;}
-.sc-benchmark-tick-label{width:40px;position:absolute;top:27px;font-size:10px;margin-left:2px;white-space:nowrap;}
-.sc-benchmark-bar{height:16px;position:absolute;font-size:10px;white-space:nowrap;border:1px solid #C63;background-color:#FC3;-moz-border-radius:2px;-webkit-border-radius:2px;line-height:14px;}
-.sc-benchmark-row{position:absolute;left:0;height:30px;}
-.sc-benchmark-row.even{opacity:.4;background-color:#ddd;}
-.sc-label-view.sc-large-size{font-size:18px;line-height:24px;}
-.sc-label-view.sc-regular-size{font-size:12px;line-height:19px;}
-.sc-label-view.sc-small-size{font-size:11px;line-height:14px;}
-.sc-label-view.sc-tiny-size{font-size:9px;line-height:12px;}
-.sc-label-view.disabled{color:#999;}
-.sc-label-view img.icon{position:relative;vertical-align:middle;}
-.sc-static-layout,.sc-view.sc-static-layout{position:relative;}
-.sc-view .sc-text-field-view{overflow:visible;z-index:100;}
-.sc-view .sc-text-field-view .sc-text-field-accessory-view{z-index:2;}
-.sc-text-field-view input{position:absolute;top:-2px;left:-2px;width:100%;height:100%;padding:0;}
-.sc-text-field-view textarea{position:absolute;top:-2px;left:-2px;width:100%;height:100%;padding:0;overflow:auto;font-family:"Lucida Grande","Lucida Sans",Verdana,Arial,sans-serif;}
-.sc-text-field-view .sc-hint{z-index:1;position:absolute;top:0;left:0;right:0;bottom:0;padding:3px;color:#aaa;font-size:12px;}
-.sc-text-field-view.focus .sc-hint,.sc-text-field-view.not-empty .sc-hint{display:none;}
-.sc-view{cursor:default;overflow:hidden;position:absolute;-moz-user-select:none;-khtml-user-select:none;user-select:none;margin:0;}
-.sc-view.allow-select{-moz-user-select:text;-khtml-user-select:text;user-select:text;cursor:text;}
-.sc-view:focus,a.sc-view:focus,.sc-view:active,a.sc-view:active{outline:none;}
-.sc-view img{border:none;}
-.sc-view.hidden{display:none!important;}
-.sc-view.textAlignRight{text-align:right;}
-.sc-alert{background:url('') repeat;}
-.sc-pane.sc-panel.sc-alert>div>.sc-view{overflow:visible;}
-.sc-alert .info{position:relative;min-height:48px;padding:20px 12px 58px 74px;}
-.sc-alert .info.plain{padding:20px 12px 58px 16px;}
-.sc-alert .info img.icon{position:absolute;left:12px;top:14px;}
-.sc-alert .info h1{background-color:transparent;color:black;margin:0;padding:0;font-size:16px;margin-bottom:6px;font-family:inherit;}
-.sc-alert .info p.description{padding:0;margin:6px 0;font-size:12px;margin-right:20px;}
-.sc-alert .info p.caption{padding:0;margin:6px 0;font-size:11px;margin-right:20px;}
-.sc-alert .info .seperator{position:absolute;width:100%;height:2px;left:0;bottom:50px;background:#eaeaea;}
-.sc-button-view.sc-disclosure-view img.button{width:16px;height:16px;position:absolute;left:0;top:0;background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_222222.png');}
-.sc-button-view.sc-disclosure-view .sc-button-label{position:absolute;left:16px;top:0;bottom:0;right:0;}
-.sc-button-view.sc-disclosure-view.sel img.button{background-position:32px 16px;}
-.sc-button-view.sc-disclosure-view img.button{background-position:64px 16px;}
-.sc-button-view.sc-disclosure-view.sel.disabled img.button{background-position:32px 16px;}
-.sc-button-view.sc-disclosure-view.disabled img.button{background-position:64px 16px;}
-.sc-button-view.sc-disclosure-view.sel.active img.button{background-position:32px 16px;}
-.sc-theme .sc-button-view.sc-disclosure-view.active img.button{background-position:64px 16px;}
-.sc-view.sc-ghost-view{opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);z-index:10000;}
-.sc-icon-alert-48{width:48px;height:48px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') left top;}
-.sc-icon-info-48{width:48px;height:48px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') left -48px;}
-.sc-icon-error-48{width:48px;height:48px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') left -96px;}
-.sc-icon-tools-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -144px;}
-.sc-icon-bookmark-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -144px;}
-.sc-icon-info-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -168px;}
-.sc-icon-help-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -0px -192px;}
-.sc-icon-alert-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -192px;}
-.sc-icon-left-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -216px;}
-.sc-icon-right-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -216px;}
-.sc-icon-up-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -240px;}
-.sc-icon-down-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -240px;}
-.sc-icon-undo-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -264px;}
-.sc-icon-redo-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -264px;}
-.sc-icon-group-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -288px;}
-.sc-icon-user-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -288px;}
-.sc-icon-cancel-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -312px;}
-.sc-icon-options-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -312px;}
-.sc-icon-folder-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -336px;}
-.sc-icon-trash-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -336px;}
-.sc-icon-document-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') 0 -360px;}
-.sc-icon-favorite-24{width:24px;height:24px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -24px -360px;}
-.sc-icon-bookmark-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -16px -384px;}
-.sc-icon-info-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -32px -384px;}
-.sc-icon-help-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -16px -400px;}
-.sc-icon-alert-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -32px -400px;}
-.sc-icon-group-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -0px -448px;}
-.sc-icon-user-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -16px -448px;}
-.sc-icon-options-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -0px -464px;}
-.sc-icon-folder-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -16px -464px;}
-.sc-icon-trash-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -32px -464px;}
-.sc-icon-document-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -0px -480px;}
-.sc-icon-favorite-16{width:16px;height:16px;background:no-repeat url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/shared.png') -16px -480px;}
-.sc-mini-icon{width:16px;height:16px;background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_454545.png');border:none;}
-.active .sc-mini-icon,.sel .sc-mini-icon{background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_222222.png');}
-.active .sc-mini-icon.inverted,.sel .sc-mini-icon.inverted,.sc-mini-icon.inverted{background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_ffffff.png');}
-.disabled .sc-mini-icon,.active.disabled .sc-mini-icon,.sel.disabled .sc-mini-icon,.disabled .sc-mini-icon.inverted,.active.disabled .sc-mini-icon.inverted,.sel.disabled .sc-mini-icon.inverted{background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_888888.png');}
-.sc-mini-icon.carat-1-n{background-position:0 0;}
-.sc-mini-icon.carat-1-ne{background-position:-16px 0;}
-.sc-mini-icon.carat-1-e{background-position:-32px 0;}
-.sc-mini-icon.carat-1-se{background-position:-48px 0;}
-.sc-mini-icon.carat-1-s{background-position:-64px 0;}
-.sc-mini-icon.carat-1-sw{background-position:-80px 0;}
-.sc-mini-icon.carat-1-w{background-position:-96px 0;}
-.sc-mini-icon.carat-1-nw{background-position:-112px 0;}
-.sc-mini-icon.carat-2-n-s{background-position:-128px 0;}
-.sc-mini-icon.carat-2-e-w{background-position:-144px 0;}
-.sc-mini-icon.triangle-1-n{background-position:0 -16px;}
-.sc-mini-icon.triangle-1-ne{background-position:-16px -16px;}
-.sc-mini-icon.triangle-1-e{background-position:-32px -16px;}
-.sc-mini-icon.triangle-1-se{background-position:-48px -16px;}
-.sc-mini-icon.triangle-1-s{background-position:-64px -16px;}
-.sc-mini-icon.triangle-1-sw{background-position:-80px -16px;}
-.sc-mini-icon.triangle-1-w{background-position:-96px -16px;}
-.sc-mini-icon.triangle-1-nw{background-position:-112px -16px;}
-.sc-mini-icon.triangle-2-n-s{background-position:-128px -16px;}
-.sc-mini-icon.triangle-2-e-w{background-position:-144px -16px;}
-.sc-mini-icon.arrow-1-n{background-position:0 -32px;}
-.sc-mini-icon.arrow-1-ne{background-position:-16px -32px;}
-.sc-mini-icon.arrow-1-e{background-position:-32px -32px;}
-.sc-mini-icon.arrow-1-se{background-position:-48px -32px;}
-.sc-mini-icon.arrow-1-s{background-position:-64px -32px;}
-.sc-mini-icon.arrow-1-sw{background-position:-80px -32px;}
-.sc-mini-icon.arrow-1-w{background-position:-96px -32px;}
-.sc-mini-icon.arrow-1-nw{background-position:-112px -32px;}
-.sc-mini-icon.arrow-2-n-s{background-position:-128px -32px;}
-.sc-mini-icon.arrow-2-ne-sw{background-position:-144px -32px;}
-.sc-mini-icon.arrow-2-e-w{background-position:-160px -32px;}
-.sc-mini-icon.arrow-2-se-nw{background-position:-176px -32px;}
-.sc-mini-icon.arrowstop-1-n{background-position:-192px -32px;}
-.sc-mini-icon.arrowstop-1-e{background-position:-208px -32px;}
-.sc-mini-icon.arrowstop-1-s{background-position:-224px -32px;}
-.sc-mini-icon.arrowstop-1-w{background-position:-240px -32px;}
-.sc-mini-icon.arrowthick-1-n{background-position:0 -48px;}
-.sc-mini-icon.arrowthick-1-ne{background-position:-16px -48px;}
-.sc-mini-icon.arrowthick-1-e{background-position:-32px -48px;}
-.sc-mini-icon.arrowthick-1-se{background-position:-48px -48px;}
-.sc-mini-icon.arrowthick-1-s{background-position:-64px -48px;}
-.sc-mini-icon.arrowthick-1-sw{background-position:-80px -48px;}
-.sc-mini-icon.arrowthick-1-w{background-position:-96px -48px;}
-.sc-mini-icon.arrowthick-1-nw{background-position:-112px -48px;}
-.sc-mini-icon.arrowthick-2-n-s{background-position:-128px -48px;}
-.sc-mini-icon.arrowthick-2-ne-sw{background-position:-144px -48px;}
-.sc-mini-icon.arrowthick-2-e-w{background-position:-160px -48px;}
-.sc-mini-icon.arrowthick-2-se-nw{background-position:-176px -48px;}
-.sc-mini-icon.arrowthickstop-1-n{background-position:-192px -48px;}
-.sc-mini-icon.arrowthickstop-1-e{background-position:-208px -48px;}
-.sc-mini-icon.arrowthickstop-1-s{background-position:-224px -48px;}
-.sc-mini-icon.arrowthickstop-1-w{background-position:-240px -48px;}
-.sc-mini-icon.arrowreturnthick-1-w{background-position:0 -64px;}
-.sc-mini-icon.arrowreturnthick-1-n{background-position:-16px -64px;}
-.sc-mini-icon.arrowreturnthick-1-e{background-position:-32px -64px;}
-.sc-mini-icon.arrowreturnthick-1-s{background-position:-48px -64px;}
-.sc-mini-icon.arrowreturn-1-w{background-position:-64px -64px;}
-.sc-mini-icon.arrowreturn-1-n{background-position:-80px -64px;}
-.sc-mini-icon.arrowreturn-1-e{background-position:-96px -64px;}
-.sc-mini-icon.arrowreturn-1-s{background-position:-112px -64px;}
-.sc-mini-icon.arrowrefresh-1-w{background-position:-128px -64px;}
-.sc-mini-icon.arrowrefresh-1-n{background-position:-144px -64px;}
-.sc-mini-icon.arrowrefresh-1-e{background-position:-160px -64px;}
-.sc-mini-icon.arrowrefresh-1-s{background-position:-176px -64px;}
-.sc-mini-icon.arrow-4{background-position:0 -80px;}
-.sc-mini-icon.arrow-4-diag{background-position:-16px -80px;}
-.sc-mini-icon.extlink{background-position:-32px -80px;}
-.sc-mini-icon.newwin{background-position:-48px -80px;}
-.sc-mini-icon.refresh{background-position:-64px -80px;}
-.sc-mini-icon.shuffle{background-position:-80px -80px;}
-.sc-mini-icon.transfer-e-w{background-position:-96px -80px;}
-.sc-mini-icon.transferthick-e-w{background-position:-112px -80px;}
-.sc-mini-icon.folder-collapsed{background-position:0 -96px;}
-.sc-mini-icon.folder-open{background-position:-16px -96px;}
-.sc-mini-icon.document{background-position:-32px -96px;}
-.sc-mini-icon.document-b{background-position:-48px -96px;}
-.sc-mini-icon.note{background-position:-64px -96px;}
-.sc-mini-icon.mail-closed{background-position:-80px -96px;}
-.sc-mini-icon.mail-open{background-position:-96px -96px;}
-.sc-mini-icon.suitcase{background-position:-112px -96px;}
-.sc-mini-icon.comment{background-position:-128px -96px;}
-.sc-mini-icon.person{background-position:-144px -96px;}
-.sc-mini-icon.print{background-position:-160px -96px;}
-.sc-mini-icon.trash{background-position:-176px -96px;}
-.sc-mini-icon.locked{background-position:-192px -96px;}
-.sc-mini-icon.unlocked{background-position:-208px -96px;}
-.sc-mini-icon.bookmark{background-position:-224px -96px;}
-.sc-mini-icon.tag{background-position:-240px -96px;}
-.sc-mini-icon.home{background-position:0 -112px;}
-.sc-mini-icon.flag{background-position:-16px -112px;}
-.sc-mini-icon.calendar{background-position:-32px -112px;}
-.sc-mini-icon.cart{background-position:-48px -112px;}
-.sc-mini-icon.pencil{background-position:-64px -112px;}
-.sc-mini-icon.clock{background-position:-80px -112px;}
-.sc-mini-icon.disk{background-position:-96px -112px;}
-.sc-mini-icon.calculator{background-position:-112px -112px;}
-.sc-mini-icon.zoomin{background-position:-128px -112px;}
-.sc-mini-icon.zoomout{background-position:-144px -112px;}
-.sc-mini-icon.search{background-position:-160px -112px;}
-.sc-mini-icon.wrench{background-position:-176px -112px;}
-.sc-mini-icon.gear{background-position:-192px -112px;}
-.sc-mini-icon.heart{background-position:-208px -112px;}
-.sc-mini-icon.star{background-position:-224px -112px;}
-.sc-mini-icon.link{background-position:-240px -112px;}
-.sc-mini-icon.cancel{background-position:0 -128px;}
-.sc-mini-icon.plus{background-position:-16px -128px;}
-.sc-mini-icon.plusthick{background-position:-32px -128px;}
-.sc-mini-icon.minus{background-position:-48px -128px;}
-.sc-mini-icon.minusthick{background-position:-64px -128px;}
-.sc-mini-icon.close{background-position:-80px -128px;}
-.sc-mini-icon.closethick{background-position:-96px -128px;}
-.sc-mini-icon.key{background-position:-112px -128px;}
-.sc-mini-icon.lightbulb{background-position:-128px -128px;}
-.sc-mini-icon.scissors{background-position:-144px -128px;}
-.sc-mini-icon.clipboard{background-position:-160px -128px;}
-.sc-mini-icon.copy{background-position:-176px -128px;}
-.sc-mini-icon.contact{background-position:-192px -128px;}
-.sc-mini-icon.image{background-position:-208px -128px;}
-.sc-mini-icon.video{background-position:-224px -128px;}
-.sc-mini-icon.script{background-position:-240px -128px;}
-.sc-mini-icon.alert{background-position:0 -144px;}
-.sc-mini-icon.info{background-position:-16px -144px;}
-.sc-mini-icon.notice{background-position:-32px -144px;}
-.sc-mini-icon.help{background-position:-48px -144px;}
-.sc-mini-icon.check{background-position:-64px -144px;}
-.sc-mini-icon.bullet{background-position:-80px -144px;}
-.sc-mini-icon.radio-off{background-position:-96px -144px;}
-.sc-mini-icon.radio-on{background-position:-112px -144px;}
-.sc-mini-icon.pin-w{background-position:-128px -144px;}
-.sc-mini-icon.pin-s{background-position:-144px -144px;}
-.sc-mini-icon.play{background-position:0 -160px;}
-.sc-mini-icon.pause{background-position:-16px -160px;}
-.sc-mini-icon.seek-next{background-position:-32px -160px;}
-.sc-mini-icon.seek-prev{background-position:-48px -160px;}
-.sc-mini-icon.seek-end{background-position:-64px -160px;}
-.sc-mini-icon.seek-first{background-position:-80px -160px;}
-.sc-mini-icon.stop{background-position:-96px -160px;}
-.sc-mini-icon.eject{background-position:-112px -160px;}
-.sc-mini-icon.volume-off{background-position:-128px -160px;}
-.sc-mini-icon.volume-on{background-position:-144px -160px;}
-.sc-mini-icon.power{background-position:0 -176px;}
-.sc-mini-icon.signal-diag{background-position:-16px -176px;}
-.sc-mini-icon.signal{background-position:-32px -176px;}
-.sc-mini-icon.battery-0{background-position:-48px -176px;}
-.sc-mini-icon.battery-1{background-position:-64px -176px;}
-.sc-mini-icon.battery-2{background-position:-80px -176px;}
-.sc-mini-icon.battery-3{background-position:-96px -176px;}
-.sc-mini-icon.circle-plus{background-position:0 -192px;}
-.sc-mini-icon.circle-minus{background-position:-16px -192px;}
-.sc-mini-icon.circle-close{background-position:-32px -192px;}
-.sc-mini-icon.circle-triangle-e{background-position:-48px -192px;}
-.sc-mini-icon.circle-triangle-s{background-position:-64px -192px;}
-.sc-mini-icon.circle-triangle-w{background-position:-80px -192px;}
-.sc-mini-icon.circle-triangle-n{background-position:-96px -192px;}
-.sc-mini-icon.circle-arrow-e{background-position:-112px -192px;}
-.sc-mini-icon.circle-arrow-s{background-position:-128px -192px;}
-.sc-mini-icon.circle-arrow-w{background-position:-144px -192px;}
-.sc-mini-icon.circle-arrow-n{background-position:-160px -192px;}
-.sc-mini-icon.circle-zoomin{background-position:-176px -192px;}
-.sc-mini-icon.circle-zoomout{background-position:-192px -192px;}
-.sc-mini-icon.circle-check{background-position:-208px -192px;}
-.sc-mini-icon.circlesmall-plus{background-position:0 -208px;}
-.sc-mini-icon.circlesmall-minus{background-position:-16px -208px;}
-.sc-mini-icon.circlesmall-close{background-position:-32px -208px;}
-.sc-mini-icon.squaresmall-plus{background-position:-48px -208px;}
-.sc-mini-icon.squaresmall-minus{background-position:-64px -208px;}
-.sc-mini-icon.squaresmall-close{background-position:-80px -208px;}
-.sc-mini-icon.grip-dotted-vertical{background-position:0 -224px;}
-.sc-mini-icon.grip-dotted-horizontal{background-position:-16px -224px;}
-.sc-mini-icon.grip-solid-vertical{background-position:-32px -224px;}
-.sc-mini-icon.grip-solid-horizontal{background-position:-48px -224px;}
-.sc-mini-icon.gripsmall-diagonal-se{background-position:-64px -224px;}
-.sc-mini-icon.grip-diagonal-se{background-position:-80px -224px;}
-.sc-list-item-view.sc-regular-size{font-size:11px;}
-.sc-list-item-view.sel{background-color:#888;color:white;}
-.sc-list-item-view.active{background-color:#333;color:white;}
-.sc-list-item-view label{top:50%;height:18px;display:block;position:absolute;margin-top:-9px;line-height:18px;left:4px;right:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;}
-.sc-list-item-view .sc-outline{position:absolute;left:0;top:0;right:0;bottom:0;}
-.sc-list-item-view.has-icon label,.sc-list-item-view.has-checkbox label{left:24px;}
-.sc-list-item-view.has-checkbox.has-icon label{left:44px;}
-.sc-list-item-view img.disclosure{position:absolute;left:-11px;top:50%;margin-top:-6px;width:14px;height:14px;background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/sc-theme-sprite.png');background-position:-16px -1025px;}
-.sc-list-item-view img.disclosure.open{background-position:0 -1008px;}
-.sc-list-item-view img.disclosure.active{background-position:-0px -1041px;}
-.sc-list-item-view img.disclosure.open.active{background-position:-16px -1008px;}
-.sc-list-item-view.disabled img.disclosure,.sc-list-item-view.disabled img.disclosure.active{background-position:-16px -1041px;}
-.sc-list-item-view.disabled img.disclosure.open,.sc-list-item-view.disabled img.disclosure.open.active{background-position:0 -1024px;}
-.sc-list-item-view img.icon{position:absolute;left:5px;top:50%;margin-top:-9px;}
-.sc-list-item-view.has-checkbox img.icon{left:25px;}
-.sc-list-item-view .sc-checkbox-view{position:absolute;display:block;border:1px #888 solid;width:12px;height:12px;left:5px;top:50%;margin-top:-8px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background-color:#d0d0d0;}
-.sc-list-item-view.sel .sc-checkbox-view{border:1px #333 solid;}
-.sc-list-item-view .sc-checkbox-view.sel{background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_454545.png');background-position:-66px -147px;}
-.sc-list-item-view .sc-checkbox-view.active{background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_ffffff.png');background-color:#333;border-color:black;}
-.sc-list-item-view .count{position:absolute;display:block;right:4px;top:50%;margin-top:-7px;height:12px;background-color:#888;text-align:center;padding-left:7px;padding-right:8px;line-height:11px;color:white;font-weight:bold;border:1px #888 solid;letter-spacing:-1px;-webkit-border-radius:7px;-moz-border-radius:7px;}
-.sc-list-item-view.sel .count{background-color:#333;border:1px #333 solid;}
-.sc-list-item-view.active .count{background-color:#000;border:1px #000 solid;}
-.sc-list-item-view.has-branch .count{right:16px;}
-.sc-list-item-view .branch{position:absolute;width:16px;height:16px;display:block;right:1px;top:50%;margin-top:-8px;background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_454545.png');background-position:-32px 0;}
-.sc-list-item-view.sel .branch,.sc-list-item-view.active .branch{background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_ffffff.png');}
-.sc-button-view.sc-menu-item{position:relative;background-color:#fff none repeat scroll 0 0;border:none;display:block;font-size:12px;cursor:default;}
-.sc-menu-item a{display:block;top:0;line-height:22px;text-shadow:#b0b0b0 0 1px 0;text-decoration:none;text-align:left;color:black;outline:none;}
-.sc-menu-item.disabled a{color:#A0A0A0;}
-.sc-menu-item.disabled{background-color:#E0E0E0;border:none;color:#A0A0A0;}
-.sc-menu-item span.separator{display:block;height:1px;border-bottom:2px #ccc solid;}
-.sc-menu-item span.branch-visible{left:25px;}
-.sc-menu-item a img{left:25px;bottom:25%;vertical-align:middle;}
-.sc-menu-item a span.shortcut{position:absolute;right:5px;margin-right:15px;text-align:center;font-size:12px;}
-.sc-pane.sc-panel>.sc-view.sc-menu-item.focus,.sc-menu-item a:hover{background-color:#5A8EC6;}
-.sc-menu-item.disabled a:hover{background-color:#E0E0E0;}
-.sc-menu-item div.checkbox{background-image:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/icons/mini_454545.png');background-position:-66px -147px;position:absolute;display:block;width:12px;height:12px;left:6px;top:5px;-webkit-border-radius:2px;-moz-border-radius:2px;}
-.sc-menu-item.disabled div.checkbox,.sc-menu-item div.checkbox.inactive{background-image:url('/static/sproutcore/foundation/en/57886831642149f2bd1e1f15e10b1cfa2f27c2eb/blank.gif');}
-.sc-menu-item span.value{text-align:center;margin-left:30px;}
-.sc-menu-item span.hasBranch{position:absolute;text-align:center;right:5px;}
-.sc-pane.sc-modal{z-index:100;}
-.sc-pane.sc-panel{overflow:visible;z-index:100;}
-.sc-pane.sc-modal.for-sc-panel{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/standard_fade/000000.png') repeat;}
-.sc-pane.sc-panel>.sc-view{border:0 #444 solid;background-color:#eaeaea;}
-.sc-pane.sc-panel>.top-right-edge{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') no-repeat -40px -120px;position:absolute;width:40px;height:40px;top:-20px;right:-20px;z-index:-1;}
-.sc-pane.sc-panel>.top-left-edge{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') no-repeat 0 -120px;position:absolute;width:40px;height:40px;top:-20px;left:-20px;z-index:-1;}
-.sc-pane.sc-panel>.bottom-left-edge{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') no-repeat 0 -160px;position:absolute;width:40px;height:40px;bottom:-20px;left:-20px;z-index:-1;}
-.sc-pane.sc-panel>.bottom-right-edge{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') no-repeat -40px -160px;position:absolute;width:40px;height:40px;bottom:-20px;right:-20px;z-index:-1;}
-.sc-pane.sc-panel>.top-edge{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') repeat-x 0 -230px;position:absolute;height:20px;top:-20px;right:20px;left:20px;z-index:-1;}
-.sc-pane.sc-panel>.bottom-edge{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') repeat-x 0 -210px;position:absolute;height:20px;bottom:-20px;right:20px;left:20px;z-index:-1;}
-.sc-pane.sc-panel>.left-edge{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-y.png') repeat-y 0 0;position:absolute;width:20px;top:20px;bottom:20px;left:-20px;z-index:-1;}
-.sc-pane.sc-panel>.right-edge{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-y.png') repeat-y -20px 0;position:absolute;width:20px;top:20px;bottom:20px;right:-20px;z-index:-1;}
-.sc-pane.sc-panel.sc-picker .perfectRight{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') no-repeat 0 -30px;position:absolute;width:25px;height:51px;top:20px;left:-25px;}
-.sc-pane.sc-panel.sc-picker .perfectLeft{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') no-repeat -30px -30px;position:absolute;width:25px;height:51px;top:20px;right:-25px;}
-.sc-pane.sc-panel.sc-picker .perfectTop{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') no-repeat 0 -90px;position:absolute;width:51px;height:25px;bottom:-25px;left:50%;margin-left:-25px;}
-.sc-pane.sc-panel.sc-picker .perfectBottom{background:url('/static/sproutcore/desktop/en/fc0b3702ff1fb89ddd65311102a668ff7e27589e/images/panels/sprite-x.png') no-repeat 0 0;position:absolute;width:51px;height:25px;top:-25px;left:50%;margin-left:-25px;}
-.sc-progress-view{border:1px solid #555;background-color:#c8c8c8;-webkit-border-radius:2px;border-radius:2px;}
-.sc-progress-view.disabled{background-color:#e8e8e8;border:1px #9a9a9a solid;}
-.sc-progress-view .sc-inner{position:absolute;left:0;top:0;bottom:0;background:#555;border-right:1px solid #555;}
-.sc-progress-view.sc-indeterminate .sc-inner{background:#555;border:0;}
-.sc-progress-view.sc-empty .sc-inner{border:none;}
-.sc-radio-view.sc-layout-vertical .sc-radio-button{display:block;}
-.sc-radio-view.sc-layout-horizontal .sc-radio-button{display:inline-block;-moz-display:inline-block;}
-.sc-scroller-view .sc-inner{position:absolute;left:0;top:0;}
-.sc-scroller-view.sc-horizontal{overflow-x:scroll;overflow-y:hidden;}
-.sc-scroller-view.sc-horizontal .sc-inner{bottom:0;}
-.sc-scroller-view.sc-vertical{overflow-y:scroll;overflow-x:hidden;}
-.sc-scroller-view.sc-vertical .sc-inner{right:0;}
-.sc-segmented-view{display:block;}
-.sc-segmented-view a.sc-segment{text-decoration:none;color:black;text-align:center;}
-a.sc-segment:active,a.sc-segment:focus{outline:none;}
-a.sc-segment img.icon{position:relative;vertical-align:middle;top:-2px;margin-right:2px;height:16px;width:16px;}
-.sc-segmented-view a.sc-segment{display:block;top:0;height:22px;line-height:22px;border-right:1px #555 solid;text-shadow:#b0b0b0 0 1px 0;}
-.sc-segmented-view .sc-button-inner{display:block;min-width:20px;min-height:22px;}
-.sc-segmented-view a.sc-segment.sc-first-segment{padding-left:10px;}
-.sc-segmented-view a.sc-segment.sc-first-segment .sc-button-inner{padding-right:10px;}
-.sc-segmented-view a.sc-segment.sc-middle-segment .sc-button-inner{padding-left:10px;padding-right:10px;}
-.sc-segmented-view a.sc-segment.sc-last-segment .sc-button-inner{padding-left:10px;}
-.sc-segmented-view a.sc-segment.sc-last-segment{padding-right:10px;border:none;}
-.sc-segmented-view a.sc-segment .sc-button-inner{background:#DDD;}
-.sc-segmented-view a.sc-segment.sc-last-segment{background:#DDD;}
-.sc-segmented-view a.sc-segment.sc-first-segment{background:#DDD;}
-.sc-segmented-view a.sc-segment.active .sc-button-inner,.sc-segmented-view a.sc-segment.sel .sc-button-inner{background:#999;text-shadow:#909090 0 1px 0;}
-.sc-segmented-view a.sc-segment.sc-last-segment.sel,.sc-segmented-view a.sc-segment.sc-last-segment.active{background:#999;}
-.sc-segmented-view a.sc-segment.sc-first-segment.sel,.sc-segmented-view a.sc-segment.sc-first-segment.active{background:#999;}
-.sc-segmented-view a.sc-segment.disabled .sc-button-inner,.sc-segmented-view.disabled a.sc-segment .sc-button-inner{background:#FFF;color:#999;}
-.sc-segmented-view a.sc-segment.sc-last-segment.disabled,.sc-segmented-view.disabled a.sc-segment.sc-last-segment{background:#FFF;}
-.sc-segmented-view a.sc-segment.sc-first-segment.disabled,.sc-segmented-view.disabled a.sc-segment.sc-first-segment{background:#FFF;}
-.sc-segmented-view a.sc-segment.sel .sc-button-inner.disabled,.sc-segmented-view.disabled a.sc-segment.sel .sc-button-inner{background:#FFF;}
-.sc-segmented-view a.sc-segment.sc-last-segment.sel.disabled,.sc-segmented-view.disabled a.sc-segment.sc-last-segment.sel{background:#FFF;}
-.sc-segmented-view a.sc-segment.sc-first-segment.sel.disabled,.sc-segmented-view.disabled a.sc-segment.sc-first-segment.sel{background:#FFF;}
-.sc-separator-view.sc-layout-horizontal span{position:absolute;top:50%;height:1px;border-top:1px #ccc solid;background-color:#fefefe;left:0;right:0;}
-.sc-separator-view.sc-layout-vertical span{position:absolute;left:50%;width:1px;border-left:1px #ccc solid;background-color:#fefefe;top:0;bottom:0;}
-.sc-slider-view{height:21px;}
-.sc-slider-view .sc-inner{position:absolute;left:8px;right:8px;height:5px;top:6px;background:grey;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
-.sc-slider-view .sc-inner .sc-leftcap,.sc-slider-view .sc-inner .sc-righcap{display:none;}
-.blur .sc-slider-view .sc-inner,.focus .sc-slider-view.disabled .sc-inner{border:1px #ccc solid;}
-.focus .sc-slider-view .sc-inner{border:1px #999 solid;}
-.sc-slider-view .sc-handle{height:18px;width:18px;margin-left:-9px;top:-6px;position:absolute;background:black;}
-.sc-split-divider-view{background-color:#ddd;border-left:1px #999 solid;border-right:1px #999 solid;z-index:1;}
-.sc-tab-view>.sc-container-view{border:1px #888 solid;-webkit-border-radius:2px;border-radius:2px;overflow:visible;}
-.sc-tab-view>.sc-segmented-view{z-index:100;}
-.sc-toolbar-view{border-top:1px #999 solid;background-color:#ddd;}
+.sc-alert{background:white;}.sc-pane.sc-panel.sc-alert>div>.sc-view{overflow:visible;}.sc-alert .info{position:relative;min-height:48px;padding:20px 12px 58px 74px;}.sc-alert .info.plain{padding:20px 12px 58px 16px;}.sc-alert .info img.icon{position:absolute;left:12px;top:14px;}.sc-alert .info h1{background-color:transparent;color:black;margin:0;padding:0;font-size:16px;margin-bottom:6px;font-family:inherit;}.sc-alert .info p.description{padding:0;margin:6px 0;font-size:12px;margin-right:20px;}.sc-alert .info p.caption{padding:0;margin:6px 0;font-size:11px;margin-right:20px;}.sc-alert .info .separator{position:absolute;width:100%;height:2px;left:0;bottom:50px;background:#eaeaea;}.sc-button-view.sc-disclosure-view{background:transparent;}.sc-button-view.sc-disclosure-view .button{width:16px;height:16px;position:absolute;left:0;top:0;background-image:url('');}.sc-button-view.sc-disclosure-view .sc-button-label{position:absolute;left:16px;top:0;bottom:0;right:0;text-align:left;}.sc-button-view.sc-disclosure-view.sel .button{background-position:32px 16px;}.sc-button-view.sc-disclosure-view .button{background-position:64px 16px;}.sc-button-view.sc-disclosure-view.sel.disabled .button{background-position:32px 16px;}.sc-button-view.sc-disclosure-view.disabled .button{background-position:64px 16px;}.sc-button-view.sc-disclosure-view.sel.active .button{background-position:32px 16px;}.sc-theme .sc-button-view.sc-disclosure-view.active .button{background-position:64px 16px;}.sc-view.sc-ghost-view{opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";-moz-opacity:.5;z-index:10000;}.sc-icon-alert-48{width:48px;height:48px;background:no-repeat url("images/icons/shared.png") left top;}.sc-icon-info-48{width:48px;height:48px;background:no-repeat url("images/icons/shared.png") left -48px;}.sc-icon-error-48{width:48px;height:48px;background:no-repeat url("images/icons/shared.png") left -96px;}.sc-icon-tools-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -144px;}.sc-icon-bookmark-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -144px;}.sc-icon-info-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -168px;}.sc-icon-help-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -0px -192px;}.sc-icon-alert-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -192px;}.sc-icon-left-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -216px;}.sc-icon-right-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -216px;}.sc-icon-up-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -240px;}.sc-icon-down-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -240px;}.sc-icon-undo-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -264px;}.sc-icon-redo-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -264px;}.sc-icon-group-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -288px;}.sc-icon-user-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -288px;}.sc-icon-cancel-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -312px;}.sc-icon-options-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -312px;}.sc-icon-folder-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -336px;}.sc-icon-trash-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -336px;}.sc-icon-document-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") 0 -360px;}.sc-icon-favorite-24{width:24px;height:24px;background:no-repeat url("images/icons/shared.png") -24px -360px;}.sc-icon-bookmark-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -16px -384px;}.sc-icon-info-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -32px -384px;}.sc-icon-help-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -16px -400px;}.sc-icon-alert-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -32px -400px;}.sc-icon-group-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -0px -448px;}.sc-icon-user-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -16px -448px;}.sc-icon-options-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -0px -464px;}.sc-icon-folder-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -16px -464px;}.sc-icon-trash-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -32px -464px;}.sc-icon-document-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -0px -480px;}.sc-icon-favorite-16{width:16px;height:16px;background:no-repeat url("images/icons/shared.png") -16px -480px;}.sc-mini-icon{width:16px;height:16px;background-image:url('');border:none;}.active .sc-mini-icon,.sel .sc-mini-icon{background-image:url('');}.active .sc-mini-icon.inverted,.sel .sc-mini-icon.inverted,.sc-mini-icon.inverted{background-image:url('');}.disabled .sc-mini-icon,.active.disabled .sc-mini-icon,.sel.disabled .sc-mini-icon,.disabled .sc-mini-icon.inverted,.active.disabled .sc-mini-icon.inverted,.sel.disabled .sc-mini-icon.inverted{background-image:url('');}.sc-mini-icon.carat-1-n{background-position:0 0;}.sc-mini-icon.carat-1-ne{background-position:-16px 0;}.sc-mini-icon.carat-1-e{background-position:-32px 0;}.sc-mini-icon.carat-1-se{background-position:-48px 0;}.sc-mini-icon.carat-1-s{background-position:-64px 0;}.sc-mini-icon.carat-1-sw{background-position:-80px 0;}.sc-mini-icon.carat-1-w{background-position:-96px 0;}.sc-mini-icon.carat-1-nw{background-position:-112px 0;}.sc-mini-icon.carat-2-n-s{background-position:-128px 0;}.sc-mini-icon.carat-2-e-w{background-position:-144px 0;}.sc-mini-icon.triangle-1-n{background-position:0 -16px;}.sc-mini-icon.triangle-1-ne{background-position:-16px -16px;}.sc-mini-icon.triangle-1-e{background-position:-32px -16px;}.sc-mini-icon.triangle-1-se{background-position:-48px -16px;}.sc-mini-icon.triangle-1-s{background-position:-64px -16px;}.sc-mini-icon.triangle-1-sw{background-position:-80px -16px;}.sc-mini-icon.triangle-1-w{background-position:-96px -16px;}.sc-mini-icon.triangle-1-nw{background-position:-112px -16px;}.sc-mini-icon.triangle-2-n-s{background-position:-128px -16px;}.sc-mini-icon.triangle-2-e-w{background-position:-144px -16px;}.sc-mini-icon.arrow-1-n{background-position:0 -32px;}.sc-mini-icon.arrow-1-ne{background-position:-16px -32px;}.sc-mini-icon.arrow-1-e{background-position:-32px -32px;}.sc-mini-icon.arrow-1-se{background-position:-48px -32px;}.sc-mini-icon.arrow-1-s{background-position:-64px -32px;}.sc-mini-icon.arrow-1-sw{background-position:-80px -32px;}.sc-mini-icon.arrow-1-w{background-position:-96px -32px;}.sc-mini-icon.arrow-1-nw{background-position:-112px -32px;}.sc-mini-icon.arrow-2-n-s{background-position:-128px -32px;}.sc-mini-icon.arrow-2-ne-sw{background-position:-144px -32px;}.sc-mini-icon.arrow-2-e-w{background-position:-160px -32px;}.sc-mini-icon.arrow-2-se-nw{background-position:-176px -32px;}.sc-mini-icon.arrowstop-1-n{background-position:-192px -32px;}.sc-mini-icon.arrowstop-1-e{background-position:-208px -32px;}.sc-mini-icon.arrowstop-1-s{background-position:-224px -32px;}.sc-mini-icon.arrowstop-1-w{background-position:-240px -32px;}.sc-mini-icon.arrowthick-1-n{background-position:0 -48px;}.sc-mini-icon.arrowthick-1-ne{background-position:-16px -48px;}.sc-mini-icon.arrowthick-1-e{background-position:-32px -48px;}.sc-mini-icon.arrowthick-1-se{background-position:-48px -48px;}.sc-mini-icon.arrowthick-1-s{background-position:-64px -48px;}.sc-mini-icon.arrowthick-1-sw{background-position:-80px -48px;}.sc-mini-icon.arrowthick-1-w{background-position:-96px -48px;}.sc-mini-icon.arrowthick-1-nw{background-position:-112px -48px;}.sc-mini-icon.arrowthick-2-n-s{background-position:-128px -48px;}.sc-mini-icon.arrowthick-2-ne-sw{background-position:-144px -48px;}.sc-mini-icon.arrowthick-2-e-w{background-position:-160px -48px;}.sc-mini-icon.arrowthick-2-se-nw{background-position:-176px -48px;}.sc-mini-icon.arrowthickstop-1-n{background-position:-192px -48px;}.sc-mini-icon.arrowthickstop-1-e{background-position:-208px -48px;}.sc-mini-icon.arrowthickstop-1-s{background-position:-224px -48px;}.sc-mini-icon.arrowthickstop-1-w{background-position:-240px -48px;}.sc-mini-icon.arrowreturnthick-1-w{background-position:0 -64px;}.sc-mini-icon.arrowreturnthick-1-n{background-position:-16px -64px;}.sc-mini-icon.arrowreturnthick-1-e{background-position:-32px -64px;}.sc-mini-icon.arrowreturnthick-1-s{background-position:-48px -64px;}.sc-mini-icon.arrowreturn-1-w{background-position:-64px -64px;}.sc-mini-icon.arrowreturn-1-n{background-position:-80px -64px;}.sc-mini-icon.arrowreturn-1-e{background-position:-96px -64px;}.sc-mini-icon.arrowreturn-1-s{background-position:-112px -64px;}.sc-mini-icon.arrowrefresh-1-w{background-position:-128px -64px;}.sc-mini-icon.arrowrefresh-1-n{background-position:-144px -64px;}.sc-mini-icon.arrowrefresh-1-e{background-position:-160px -64px;}.sc-mini-icon.arrowrefresh-1-s{background-position:-176px -64px;}.sc-mini-icon.arrow-4{background-position:0 -80px;}.sc-mini-icon.arrow-4-diag{background-position:-16px -80px;}.sc-mini-icon.extlink{background-position:-32px -80px;}.sc-mini-icon.newwin{background-position:-48px -80px;}.sc-mini-icon.refresh{background-position:-64px -80px;}.sc-mini-icon.shuffle{background-position:-80px -80px;}.sc-mini-icon.transfer-e-w{background-position:-96px -80px;}.sc-mini-icon.transferthick-e-w{background-position:-112px -80px;}.sc-mini-icon.folder-collapsed{background-position:0 -96px;}.sc-mini-icon.folder-open{background-position:-16px -96px;}.sc-mini-icon.document{background-position:-32px -96px;}.sc-mini-icon.document-b{background-position:-48px -96px;}.sc-mini-icon.note{background-position:-64px -96px;}.sc-mini-icon.mail-closed{background-position:-80px -96px;}.sc-mini-icon.mail-open{background-position:-96px -96px;}.sc-mini-icon.suitcase{background-position:-112px -96px;}.sc-mini-icon.comment{background-position:-128px -96px;}.sc-mini-icon.person{background-position:-144px -96px;}.sc-mini-icon.print{background-position:-160px -96px;}.sc-mini-icon.trash{background-position:-176px -96px;}.sc-mini-icon.locked{background-position:-192px -96px;}.sc-mini-icon.unlocked{background-position:-208px -96px;}.sc-mini-icon.bookmark{background-position:-224px -96px;}.sc-mini-icon.tag{background-position:-240px -96px;}.sc-mini-icon.home{background-position:0 -112px;}.sc-mini-icon.flag{background-position:-16px -112px;}.sc-mini-icon.calendar{background-position:-32px -112px;}.sc-mini-icon.cart{background-position:-48px -112px;}.sc-mini-icon.pencil{background-position:-64px -112px;}.sc-mini-icon.clock{background-position:-80px -112px;}.sc-mini-icon.disk{background-position:-96px -112px;}.sc-mini-icon.calculator{background-position:-112px -112px;}.sc-mini-icon.zoomin{background-position:-128px -112px;}.sc-mini-icon.zoomout{background-position:-144px -112px;}.sc-mini-icon.search{background-position:-160px -112px;}.sc-mini-icon.wrench{background-position:-176px -112px;}.sc-mini-icon.gear{background-position:-192px -112px;}.sc-mini-icon.heart{background-position:-208px -112px;}.sc-mini-icon.star{background-position:-224px -112px;}.sc-mini-icon.link{background-position:-240px -112px;}.sc-mini-icon.cancel{background-position:0 -128px;}.sc-mini-icon.plus{background-position:-16px -128px;}.sc-mini-icon.plusthick{background-position:-32px -128px;}.sc-mini-icon.minus{background-position:-48px -128px;}.sc-mini-icon.minusthick{background-position:-64px -128px;}.sc-mini-icon.close{background-position:-80px -128px;}.sc-mini-icon.closethick{background-position:-96px -128px;}.sc-mini-icon.key{background-position:-112px -128px;}.sc-mini-icon.lightbulb{background-position:-128px -128px;}.sc-mini-icon.scissors{background-position:-144px -128px;}.sc-mini-icon.clipboard{background-position:-160px -128px;}.sc-mini-icon.copy{background-position:-176px -128px;}.sc-mini-icon.contact{background-position:-192px -128px;}.sc-mini-icon.image{background-position:-208px -128px;}.sc-mini-icon.video{background-position:-224px -128px;}.sc-mini-icon.script{background-position:-240px -128px;}.sc-mini-icon.alert{background-position:0 -144px;}.sc-mini-icon.info{background-position:-16px -144px;}.sc-mini-icon.notice{background-position:-32px -144px;}.sc-mini-icon.help{background-position:-48px -144px;}.sc-mini-icon.check{background-position:-64px -144px;}.sc-mini-icon.bullet{background-position:-80px -144px;}.sc-mini-icon.radio-off{background-position:-96px -144px;}.sc-mini-icon.radio-on{background-position:-112px -144px;}.sc-mini-icon.pin-w{background-position:-128px -144px;}.sc-mini-icon.pin-s{background-position:-144px -144px;}.sc-mini-icon.play{background-position:0 -160px;}.sc-mini-icon.pause{background-position:-16px -160px;}.sc-mini-icon.seek-next{background-position:-32px -160px;}.sc-mini-icon.seek-prev{background-position:-48px -160px;}.sc-mini-icon.seek-end{background-position:-64px -160px;}.sc-mini-icon.seek-first{background-position:-80px -160px;}.sc-mini-icon.stop{background-position:-96px -160px;}.sc-mini-icon.eject{background-position:-112px -160px;}.sc-mini-icon.volume-off{background-position:-128px -160px;}.sc-mini-icon.volume-on{background-position:-144px -160px;}.sc-mini-icon.power{background-position:0 -176px;}.sc-mini-icon.signal-diag{background-position:-16px -176px;}.sc-mini-icon.signal{background-position:-32px -176px;}.sc-mini-icon.battery-0{background-position:-48px -176px;}.sc-mini-icon.battery-1{background-position:-64px -176px;}.sc-mini-icon.battery-2{background-position:-80px -176px;}.sc-mini-icon.battery-3{background-position:-96px -176px;}.sc-mini-icon.circle-plus{background-position:0 -192px;}.sc-mini-icon.circle-minus{background-position:-16px -192px;}.sc-mini-icon.circle-close{background-position:-32px -192px;}.sc-mini-icon.circle-triangle-e{background-position:-48px -192px;}.sc-mini-icon.circle-triangle-s{background-position:-64px -192px;}.sc-mini-icon.circle-triangle-w{background-position:-80px -192px;}.sc-mini-icon.circle-triangle-n{background-position:-96px -192px;}.sc-mini-icon.circle-arrow-e{background-position:-112px -192px;}.sc-mini-icon.circle-arrow-s{background-position:-128px -192px;}.sc-mini-icon.circle-arrow-w{background-position:-144px -192px;}.sc-mini-icon.circle-arrow-n{background-position:-160px -192px;}.sc-mini-icon.circle-zoomin{background-position:-176px -192px;}.sc-mini-icon.circle-zoomout{background-position:-192px -192px;}.sc-mini-icon.circle-check{background-position:-208px -192px;}.sc-mini-icon.circlesmall-plus{background-position:0 -208px;}.sc-mini-icon.circlesmall-minus{background-position:-16px -208px;}.sc-mini-icon.circlesmall-close{background-position:-32px -208px;}.sc-mini-icon.squaresmall-plus{background-position:-48px -208px;}.sc-mini-icon.squaresmall-minus{background-position:-64px -208px;}.sc-mini-icon.squaresmall-close{background-position:-80px -208px;}.sc-mini-icon.grip-dotted-vertical{background-position:0 -224px;}.sc-mini-icon.grip-dotted-horizontal{background-position:-16px -224px;}.sc-mini-icon.grip-solid-vertical{background-position:-32px -224px;}.sc-mini-icon.grip-solid-horizontal{background-position:-48px -224px;}.sc-mini-icon.gripsmall-diagonal-se{background-position:-64px -224px;}.sc-mini-icon.grip-diagonal-se{background-position:-80px -224px;}.sc-list-item-view.sc-regular-size{font-size:11px;}.sc-list-item-view.sel{background-color:#888;color:white;}.sc-list-item-view.active{background-color:#333;color:white;}.sc-list-item-view label{top:50%;height:18px;display:block;position:absolute;margin-top:-9px;line-height:18px;left:4px;right:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;}.sc-list-item-view .sc-outline{position:absolute;left:0;top:0;right:0;bottom:0;}.sc-list-item-view.has-icon label,.sc-list-item-view.has-checkbox label{left:24px;}.sc-list-item-view.has-checkbox.has-icon label{left:44px;}.sc-list-item-view img.icon{position:absolute;left:5px;top:50%;margin-top:-9px;}.sc-list-item-view.has-checkbox img.icon{left:25px;}.sc-list-item-view .sc-checkbox-view{position:absolute;display:block;border:1px #888 solid;width:12px;height:12px;left:5px;top:50%;margin-top:-8px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background-color:#d0d0d0;}.sc-list-item-view.sel .sc-checkbox-view{border:1px #333 solid;}.sc-list-item-view .sc-checkbox-view.active{background-color:#333;border-color:black;}.sc-list-item-view .count{position:absolute;display:block;right:4px;top:50%;margin-top:-7px;height:12px;background-color:#888;text-align:center;padding-left:7px;padding-right:8px;line-height:11px;color:white;font-weight:bold;border:1px #888 solid;letter-spacing:-1px;-webkit-border-radius:7px;-moz-border-radius:7px;}.sc-list-item-view.sel .count{background-color:#333;border:1px #333 solid;}.sc-list-item-view.active .count{background-color:#000;border:1px #000 solid;}.sc-list-item-view.has-branch .count{right:16px;}.sc-list-item-view .branch{position:absolute;width:16px;height:16px;display:block;right:1px;top:50%;margin-top:-8px;}.sc-menu-scroller-view{background:#EAEAEA;}.sc-menu-scroll-view .sc-menu-scroller-view.sc-vertical{overflow-y:hidden;text-align:center;}.sc-button-view.sc-menu-item{background-color:#fff none repeat scroll 0 0;border:none;}.sc-button-view.sc-menu-item.sc-small-size a span{line-height:11px;font-size:11px;}.sc-menu-item.sc-small-size a{line-height:11px;}.sc-menu-item a{position:absolute;display:block;top:0;bottom:0;left:0;right:0;line-height:22px;text-decoration:none;text-align:left;color:black;outline:none;}.sc-menu-item.disabled a{color:#A0A0A0;}.sc-menu-item.disabled{border:none;color:#A0A0A0;}.sc-menu-item span.separator{display:block;height:1px;border-bottom:1px #ccc solid;}.sc-menu-item img{left:24px;top:3px;display:block;position:absolute;}.sc-menu-item a span.shortcut{position:absolute;right:5px;margin-right:15px;text-align:center;font-size:12px;}.sc-menu-item.disabled a:hover{background-color:transparent;color:#A0A0A0;}.sc-menu-item div.checkbox{position:absolute;display:block;width:12px;height:12px;left:6px;top:5px;-webkit-border-radius:2px;-moz-border-radius:2px;}.sc-menu-item.disabled.focus div.checkbox{background-image:url('');}.sc-menu-item.disabled div.checkbox,.sc-menu-item div.checkbox.inactive{background-image:url(data:image/gif;base64,R0lGODlhAQABAJAAAP///wAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw==) top left no-repeat;*background-image:url('/static/sproutcore/foundation/en/a04970954a917ede9918ca06897bc0e1406986d5/blank.gif') top left no-repeat;}.sc-menu-item span.value{position:absolute;top:0;bottom:0;left:0;right:5px;display:inline-block;text-align:left;margin-left:25px;}.sc-menu-item a.has-icon span.value{margin-left:44px;}.sc-menu-item a.shortcutkey span.value{right:55px;}.sc-pane.sc-modal{z-index:100;}.msie .sc-pane.sc-modal{background-image:url('.');}.sc-pane.sc-panel{overflow:visible;z-index:100;}.sc-pane.sc-modal.for-sc-panel{background:black;opacity:.3;-moz-opacity:.3;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=30);}.sc-pane.sc-panel>.top-right-edge{position:absolute;width:40px;height:40px;top:-20px;right:-20px;z-index:-1;}.sc-pane.sc-panel>.top-left-edge{position:absolute;width:40px;height:40px;top:-20px;left:-20px;z-index:-1;}.sc-pane.sc-panel>.bottom-left-edge{position:absolute;width:40px;height:40px;bottom:-20px;left:-20px;z-index:-1;}.sc-pane.sc-panel>.bottom-right-edge{position:absolute;width:40px;height:40px;bottom:-20px;right:-20px;z-index:-1;}.sc-pane.sc-panel>.top-edge{position:absolute;height:20px;top:-20px;right:20px;left:20px;z-index:-1;}.sc-pane.sc-panel>.bottom-edge{position:absolute;height:20px;bottom:-20px;right:20px;left:20px;z-index:-1;}.sc-pane.sc-panel>.left-edge{position:absolute;width:20px;top:20px;bottom:20px;left:-20px;z-index:-1;}.sc-pane.sc-panel>.right-edge{position:absolute;width:20px;top:20px;bottom:20px;right:-20px;z-index:-1;}.sc-pane.sc-panel.sc-picker .perfectRight{position:absolute;width:25px;height:51px;top:20px;left:-25px;}.sc-pane.sc-panel.sc-picker .perfectLeft{position:absolute;width:25px;height:51px;top:20px;right:-25px;}.sc-pane.sc-panel.sc-picker .perfectTop{position:absolute;width:51px;height:25px;bottom:-25px;left:50%;margin-left:-25px;}.sc-pane.sc-panel.sc-picker .perfectBottom{position:absolute;width:51px;height:25px;top:-25px;left:50%;margin-left:-25px;}.sc-progress-view{border:1px solid #555;background-color:#c8c8c8;-webkit-border-radius:2px;border-radius:2px;}.sc-progress-view.disabled{background-color:#e8e8e8;border:1px #9a9a9a solid;}.sc-progress-view .sc-inner{position:absolute;left:0;top:0;bottom:0;background:#555;border-right:1px solid #555;}.sc-progress-view.sc-indeterminate .sc-inner{background:#555;border:0;}.sc-progress-view.sc-empty .sc-inner{border:none;}.sc-radio-view.sc-layout-vertical .sc-radio-button{display:block;}.sc-radio-view.sc-layout-horizontal .sc-radio-button{display:inline-block;-moz-display:inline-block;}.sc-segmented-view{display:block;text-align:center;}.sc-segmented-view .sc-segment{text-decoration:none;color:black;text-align:center;}.sc-segment:active,.sc-segment:focus{outline:none;}.sc-segment img.icon{position:relative;vertical-align:middle;top:-2px;margin-right:2px;height:16px;width:16px;}.sc-segmented-view .sc-segment{display:block;top:0;height:22px;line-height:22px;border-right:1px #555 solid;text-shadow:#b0b0b0 0 1px 0;}.sc-segmented-view .sc-button-inner{display:block;min-width:20px;min-height:22px;}.sc-segmented-view .sc-segment.sc-first-segment{padding-left:10px;}.sc-segmented-view .sc-segment.sc-first-segment .sc-button-inner{padding-right:10px;}.sc-segmented-view .sc-segment.sc-middle-segment .sc-button-inner{padding-left:10px;padding-right:10px;}.sc-segmented-view .sc-segment.sc-last-segment .sc-button-inner{padding-left:10px;}.sc-segmented-view .sc-segment.sc-last-segment{padding-right:10px;border:none;}.sc-segmented-view .sc-segment .sc-button-inner{background:#DDD;}.sc-segmented-view .sc-segment.sc-last-segment{background:#DDD;}.sc-segmented-view .sc-segment.sc-first-segment{background:#DDD;}.sc-segmented-view .sc-segment.active .sc-button-inner,.sc-segmented-view .sc-segment.sel .sc-button-inner{background:#999;text-shadow:#909090 0 1px 0;}.sc-segmented-view .sc-segment.sc-last-segment.sel,.sc-segmented-view .sc-segment.sc-last-segment.active{background:#999;}.sc-segmented-view .sc-segment.sc-first-segment.sel,.sc-segmented-view .sc-segment.sc-first-segment.active{background:#999;}.sc-segmented-view .sc-segment.disabled .sc-button-inner,.sc-segmented-view.disabled .sc-segment .sc-button-inner{background:#FFF;color:#999;}.sc-segmented-view .sc-segment.sc-last-segment.disabled,.sc-segmented-view.disabled .sc-segment.sc-last-segment{background:#FFF;}.sc-segmented-view .sc-segment.sc-first-segment.disabled,.sc-segmented-view.disabled .sc-segment.sc-first-segment{background:#FFF;}.sc-segmented-view .sc-segment.sel .sc-button-inner.disabled,.sc-segmented-view.disabled .sc-segment.sel .sc-button-inner{background:#FFF;}.sc-segmented-view .sc-segment.sc-last-segment.sel.disabled,.sc-segmented-view.disabled .sc-segment.sc-last-segment.sel{background:#FFF;}.sc-segmented-view .sc-segment.sc-first-segment.sel.disabled,.sc-segmented-view.disabled .sc-segment.sc-first-segment.sel{background:#FFF;}.sc-separator-view.sc-layout-horizontal span{position:absolute;top:50%;height:1px;border-top:1px #ccc solid;background-color:#fefefe;left:0;right:0;}.sc-separator-view.sc-layout-vertical span{position:absolute;left:50%;width:1px;border-left:1px #ccc solid;background-color:#fefefe;top:0;bottom:0;}.sc-slider-view{height:21px;}.sc-slider-view .sc-inner{position:absolute;left:8px;right:8px;height:5px;top:6px;background:gray;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.sc-slider-view .sc-inner .sc-leftcap,.sc-slider-view .sc-inner .sc-righcap{display:none;}.blur .sc-slider-view .sc-inner,.focus .sc-slider-view.disabled .sc-inner{border:1px #ccc solid;}.focus .sc-slider-view .sc-inner{border:1px #999 solid;}.sc-slider-view .sc-handle{height:12px;width:12px;margin-left:-9px;top:-4px;position:absolute;background:black;border-radius:6px;-moz-border-radius:6px;}.sc-split-divider-view{background-color:#ddd;}.sc-tab-view>.sc-container-view{-webkit-border-radius:2px;border-radius:2px;overflow:visible;}.sc-toolbar-view{background-color:#ddd;}.sc-well-view .top-right-edge{position:absolute;width:7px;height:7px;top:0;right:0;}.sc-well-view .top-left-edge{position:absolute;width:7px;height:7px;top:0;left:0;}.sc-well-view .bottom-left-edge{position:absolute;width:7px;height:7px;bottom:0;left:0;}.sc-well-view .bottom-right-edge{position:absolute;width:7px;height:7px;bottom:0;right:0;}.sc-well-view .top-edge{position:absolute;height:5px;top:0;right:7px;left:7px;}.sc-well-view .bottom-edge{position:absolute;height:5px;bottom:0;right:7px;left:7px;}.sc-well-view .left-edge{position:absolute;width:7px;top:7px;bottom:7px;left:0;}.sc-well-view .right-edge{position:absolute;width:7px;top:7px;bottom:7px;right:0;}.sc-well-view .content-background{position:absolute;top:5px;bottom:5px;right:7px;left:7px;}.sc-button-view.sc-static-layout{margin:0 4px;}.sc-button-view{display:inline-block;vertical-align:middle;text-decoration:none;border:1px #555 solid;border-radius:3px;-moz-border-radius:3px;}.sc-button-view .sc-button-inner{position:relative;display:block;height:100%;text-align:center;}.sc-button-view label{position:relative;display:block;line-height:21px;text-align:center;}.sc-button-view img{vertical-align:middle;margin-right:2px;position:relative;top:-2px;left:-2px;}.sc-view{font-family:"Lucida Sans","Lucida Grande",Verdana,Arial,sans-serif;font-size:12px;line-height:1.4;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);}.sc-view .ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;}.sc-view body,.sc-view div,.sc-view dl,.sc-view dt,.sc-view dd,.sc-view ul,.sc-view ol,.sc-view li,.sc-view h1,.sc-view h2,.sc-view h3,.sc-view h4,.sc-view h5,.sc-view h6,.sc-view pre,.sc-view code,.sc-view form,.sc-view fieldset,.sc-view legend,.sc-view input,.sc-view button,.sc-view textarea,.sc-view p,.sc-view blockquote,.sc-view th,.sc-view td{margin:0;padding:0;}.sc-view table{border-collapse:collapse;border-spacing:0;}.sc-view fieldset,.sc-view img{border:0;}.sc-view address,.sc-view caption,.sc-view cite,.sc-view code,.sc-view dfn,.sc-view em,.sc-view strong,.sc-view th,.sc-view var,.sc-view optgroup{font-style:inherit;font-weight:inherit;}.sc-view del,.sc-view ins{text-decoration:none;}.sc-view li{list-style:none;}.sc-view caption,.sc-view th{text-align:left;}.sc-view h1,.sc-view h2,.sc-view h3,.sc-view h4,.sc-view h5,.sc-view h6{font-size:100%;font-weight:normal;}.sc-view q:before,.sc-view q:after{content:'';}.sc-view abbr,.sc-view acronym{border:0;font-variant:normal;}.sc-view sup{vertical-align:baseline;}.sc-view sub{vertical-align:baseline;}.sc-view legend{color:#000;}.sc-view input,.sc-view button,.sc-view textarea,.sc-view select,.sc-view optgroup,.sc-view option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}.sc-view input,.sc-view button,.sc-view textarea,.sc-view select{font-size:100%;}.sc-view body{font:13px/1.231 "Lucida Sans","Lucida Grande",Verdana,Arial,sans-serif;*font-size:small;*font:x-small;}.sc-view select,.sc-view input,.sc-view textarea,.sc-view button{font:99% "Lucida Sans","Lucida Grande",Verdana,Arial,sans-serif;}.sc-view table{font-size:inherit;font:100%;}.sc-view pre,.sc-view code,.sc-view kbd,.sc-view samp,.sc-view tt{font-family:monospace;*font-size:108%;line-height:100%;}.sc-view body{margin:10px;}.sc-view h1{font-size:138.5%;}.sc-view h2{font-size:123.1%;}.sc-view h3{font-size:108%;}.sc-view h1,.sc-view h2,.sc-view h3{margin:0;}.sc-view h1,.sc-view h2,.sc-view h3,.sc-view h4,.sc-view h5,.sc-view h6,.sc-view strong,.sc-view dt{font-weight:bold;}.sc-view optgroup{font-weight:normal;}.sc-view abbr,.sc-view acronym{border-bottom:1px dotted #000;cursor:help;}.sc-view em{font-style:italic;}.sc-view del{text-decoration:line-through;}.sc-view blockquote,.sc-view ul,.sc-view ol,.sc-view dl{margin:1em;}.sc-view ol,.sc-view ul,.sc-view dl{margin-left:2em;}.sc-view ol li{list-style:decimal outside;}.sc-view ul li{list-style:disc outside;}.sc-view dl dd{margin-left:1em;}.sc-view th,.sc-view td{border:1px solid #000;padding:.5em;}.sc-view th{font-weight:bold;text-align:center;}.sc-view caption{margin-bottom:.5em;text-align:center;}.sc-view sup{vertical-align:super;}.sc-view sub{vertical-align:sub;}.sc-view p,.sc-view fieldset,.sc-view table,.sc-view pre{margin-bottom:1em;}.sc-view button,.sc-view input[type="checkbox"],.sc-view input[type="radio"],.sc-view input[type="reset"],.sc-view input[type="submit"]{padding:1px;}.sc-benchmark-graph{z-index:100000;background-color:white;position:absolute;top:0;left:0;bottom:0;overflow:auto;right:0;}.sc-benchmark-title{font-size:12px;font-weight:bold;position:absolute;left:0;top:5px;}.sc-benchmark-emphasis{font-weight:bold;}.sc-benchmark-top{height:20px;left:0;top:25px;background-color:#ccc;opacity:.4;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";-moz-opacity:.4;position:relative;border-top:1px solid #aaa;border-bottom:1px solid #aaa;}.sc-benchmark-tick{width:1px;height:2000px;position:absolute;top:25px;background-color:#ccc;}.sc-benchmark-tick-label{width:40px;position:absolute;top:27px;font-size:10px;margin-left:2px;white-space:nowrap;}.sc-benchmark-bar{height:16px;position:absolute;font-size:10px;white-space:nowrap;border:1px solid #C63;background-color:#FC3;-moz-border-radius:2px;-webkit-border-radius:2px;line-height:14px;}.sc-benchmark-row{position:absolute;left:0;height:30px;}.sc-benchmark-row.even{opacity:.4;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";-moz-opacity:.4;background-color:#ddd;}.mozilla .sc-view .sc-text-field-view.inline-editor .border,.webkit .sc-view .sc-text-field-view.inline-editor .border,.msie .sc-view .sc-text-field-view.inline-editor .border,.sc-view .sc-text-field-view.inline-editor .border{-webkit-appearance:none;-moz-appearance:none;border:none;}.mozilla .sc-view .sc-text-field-view.inline-editor.focus{outline-offset:0;}.sc-label-view.sc-large-size{font-size:18px;line-height:24px;}.sc-label-view.sc-regular-size{font-size:12px;line-height:19px;}.sc-label-view.sc-small-size{font-size:11px;line-height:14px;}.sc-label-view.sc-tiny-size{font-size:9px;line-height:12px;}.sc-label-view.disabled{color:#999;color:rgba(50,50,50,0.5);}.sc-label-view img.icon{position:relative;vertical-align:middle;}.sc-label-view .sc-hint{position:absolute;top:3px;left:1px;right:1px;bottom:3px;padding:0;color:#aaa;font-size:12px;}.sc-static-layout,.sc-view.sc-static-layout{position:relative;}.sc-view{cursor:default;overflow:hidden;position:absolute;-moz-user-select:-moz-none;-khtml-user-select:none;user-select:none;margin:0;}.sc-view.allow-select{-moz-user-select:text;-khtml-user-select:text;user-select:text;cursor:text;}.sc-view:focus,a.sc-view:focus,.sc-view:active,a.sc-view:active{outline:none;}.sc-view img{border:none;}.sc-view.hidden{display:none!important;}.sc-view.text-align-right,.sc-view.textAlignRight{text-align:right;}
Index: /CKEditor/branches/features/bespin/_source/plugins/bespin/assets/bespin_embedded.js
===================================================================
--- /CKEditor/branches/features/bespin/_source/plugins/bespin/assets/bespin_embedded.js	(revision 5393)
+++ /CKEditor/branches/features/bespin/_source/plugins/bespin/assets/bespin_embedded.js	(revision 5394)
@@ -1,3946 +1,1331 @@
-
-var ENV = {"platform":"classic","mode":"production"};
-var SC=SC||{BUNDLE_INFO:{},LAZY_INSTANTIATION:{}};SC.json=JSON;SC.browser=(function(){var c=navigator.userAgent.toLowerCase();
-var a=(c.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];var b={version:a,safari:(/webkit/).test(c)?a:0,opera:(/opera/).test(c)?a:0,msie:(/msie/).test(c)&&!(/opera/).test(c)?a:0,mozilla:(/mozilla/).test(c)&&!(/(compatible|webkit)/).test(c)?a:0,mobileSafari:(/apple.*mobile.*safari/).test(c)?a:0,windows:!!(/(windows)/).test(c),mac:!!((/(macintosh)/).test(c)||(/(mac os x)/).test(c)),language:(navigator.language||navigator.browserLanguage).split("-",1)[0]};
-b.current=b.msie?"msie":b.mozilla?"mozilla":b.safari?"safari":b.opera?"opera":"unknown";
-return b})();SC.bundleDidLoad=function(a){var b=this.BUNDLE_INFO[a];if(!b){b=this.BUNDLE_INFO[a]={}
-}b.loaded=true};SC.bundleIsLoaded=function(a){var b=this.BUNDLE_INFO[a];return b?!!b.loaded:false
-};SC.loadBundle=function(){throw"SC.loadBundle(): SproutCore is not loaded."};SC.setupBodyClassNames=function(){var e=document.body;
-if(!e){return}var c,a,f,b,g,d;c=SC.browser.current;a=SC.browser.windows?"windows":SC.browser.mac?"mac":"other-platform";
-d=document.documentElement.style;f=(d.MozBoxShadow!==undefined)||(d.webkitBoxShadow!==undefined)||(d.oBoxShadow!==undefined)||(d.boxShadow!==undefined);
-b=(d.MozBorderRadius!==undefined)||(d.webkitBorderRadius!==undefined)||(d.oBorderRadius!==undefined)||(d.borderRadius!==undefined);
-g=e.className?e.className.split(" "):[];if(f){g.push("box-shadow")}if(b){g.push("border-rad")
-}g.push(c);g.push(a);if(SC.browser.mobileSafari){g.push("mobile-safari")}e.className=g.join(" ")
-};
-"use modules false";"use loader false";if("undefined"===typeof tiki){var tiki=function(){var b=[];
-var e={};var c={};function d(g,f){b.push({m:g,a:f})}var a={_modules:c,_factories:e,isBootstrap:true,queue:b,register:function(){d("register",arguments);
-return this},script:function(){d("script",arguments);return this},stylesheet:function(){d("stylesheet",arguments);
-return this},module:function(g,f){e[g]=f;d("module",arguments);return this},require:function(k){var j,h,l,f,g,i;
-j=c[k];if(!j){j=c[k]={};l={id:k};h=e[k];if(typeof h!=="function"){throw (k+" is not function")
-}h.call(j,a.require,j,l)}return j},destroy:function(){if(this.isDestroyed){return this
-}this.isDestroyed=true;c=e=b=this.queue=null;return this}};return a}()}tiki.register("tiki",{scripts:[{url:"/static/tiki/en/0bc0db20a15cb1574e0e5deef1b477c14c43c8a3/javascript.js",id:"tiki:en/0bc0db20a15cb1574e0e5deef1b477c14c43c8a3/javascript.js"}]});
-tiki.module("tiki:core",function(c,a,d){var b;"export setupDisplayNames";"use factory_format function";
-var e=[];b=function b(j,g){var f=e;f[0]=g;var i,h;for(i in j){if(!j.hasOwnProperty(i)){continue
-}h=j[i];if("function"===typeof h){f[1]=i;h.displayName=f.join(".")}}f.length=0;return j
-};a.setupDisplayNames=b});tiki.module("tiki:lib/loader",function(require,exports,module){var core=require("tiki:core");
-var promise=require("tiki:lib/promise");var sandbox=require("tiki:lib/sandbox");var Loader,create,setup;
-"import core as core";"import lib/promise as promise";"import lib/sandbox as sandbox";
-"export package Loader";"export create setup";"use factory_format function";var SCRIPTS="scripts",CATALOG="catalog",MODULES="modules",STYLESHEETS="stylesheets",LOADS="loads";
-var MODULE_WRAPPER=["(function(require, exports, module) {",null,"\n});\n//@ sourceURL=",null,"\n"];
-var TIKI_ARY=["tiki/",null];var STRING="string";var globals={};var PROMISE_NAME=[];
-function promiseName(type,key){PROMISE_NAME[0]=type;PROMISE_NAME[1]=key;return PROMISE_NAME.join("::")
-}var object_keys=Object.keys;if(!object_keys){object_keys=function(obj){var k,ret=[];
-for(k in obj){if(obj.hasOwnProperty(k)){ret.push(k)}}return ret}}var inTikiCache={};
-function inTiki(key){var ret=inTikiCache[key];if(ret){return ret}return(inTikiCache[key]="tiki/"+key)
-}Loader=function Loader(id,queue,env){this.id=id;this.scripts=[];this.packages=[];
-this.stylesheets=[];this.modules=[];this.sandbox=sandbox.create(id,this,env);this.register("default",{});
-this.register("tiki",{});var len=queue?queue.length:0,idx,action;for(idx=0;idx<len;
-idx++){action=queue[idx];this[action.m].apply(this,action.a)}this._queue=queue;return this
-};Loader.prototype={scripts:null,stylesheets:null,packages:null,sandbox:null,modules:null,destroy:function(){},resolve:function resolve(moduleId,baseId){var path,len,idx,packageId,part,parts;
-if(moduleId.match(/(^\.\.?\/)|(\/\.\.?\/)|(\/\.\.?\/?$)/)){if((idx=moduleId.indexOf(":"))>=0){packageId=moduleId.slice(0,idx);
-moduleId=moduleId.slice(idx+1);path=[]}else{if(moduleId.match(/^\.\.?\//)){if(!baseId){throw ("base required to resolve relative: "+moduleId)
-}idx=baseId.indexOf(":");packageId=baseId.slice(0,idx);baseId=baseId.slice(idx+1);
-path=baseId.split("/");path.pop()}else{path=[]}}parts=moduleId.split("/");len=parts.length;
-for(idx=0;idx<len;idx++){part=parts[idx];if(part===".."){if(path.length<1){throw"invalid path: "+moduleId
-}path.pop()}else{if(part!=="."){path.push(part)}}}moduleId=path.join("/");if(packageId){moduleId=packageId+":"+moduleId
-}}if(moduleId.indexOf(":")<0){if(baseId&&(idx=baseId.indexOf(":"))>0){packageId=baseId.slice(0,idx);
-moduleId=packageId+":"+moduleId}}return moduleId},canonical:function canonical(moduleId,baseId){var ret=this.resolve(moduleId,baseId),factories=this._factories,catalog=this._catalog,packageId,idx;
-if((idx=moduleId.indexOf(":"))<0){if(!catalog||(factories&&factories[ret])){return ret
-}if(catalog[moduleId]){return moduleId+":package"}else{if(catalog[inTiki(moduleId)]){return inTiki(moduleId)+":package"
-}}}else{packageId=moduleId.slice(0,idx);if(catalog&&!catalog[packageId]&&catalog[inTiki(packageId)]){ret=inTiki(moduleId)
-}}return ret},evaluate:function evaluate(moduleText,moduleId){var ret;MODULE_WRAPPER[1]=moduleText;
-MODULE_WRAPPER[3]=moduleId||"(unknown module)";ret=MODULE_WRAPPER.join("");ret=eval(ret);
-MODULE_WRAPPER[1]=MODULE_WRAPPER[3]=null;return ret},load:function load(moduleId,baseId){var factories=this._factories,factory,packagePart,idx,info,tmp;
-moduleId=this.canonical(moduleId,baseId);if(!this.ready(moduleId)){throw (moduleId+" is not ready")
-}factory=factories[moduleId];if(factory&&(STRING===typeof factory)){factory=this.evaluate(factory,moduleId);
-factories[moduleId]=factory}return factory},global:function(moduleId){var depends,info,len,idx,factories,moduleId,exports,key,packageId,ARY;
-moduleId=this.canonical(moduleId);if((idx=moduleId.indexOf(":"))<0){throw"package not found: "+moduleId
-}packageId=moduleId.slice(0,idx);ARY=moduleId.split(":");info=this._catalog[packageId];
-if(!info){throw (packageId+" is not registered")}depends=info.depends;len=depends?depends.length:0;
-if(len<=0){return this}factories=this._factories;if(!factories){return this}for(idx=0;
-idx<len;idx++){packageId=depends[idx];if(globals[packageId]){continue}globals[packageId]=true;
-if(!this.ready(packageId)){throw ("cannot make "+packageId+" global because it is not ready")
-}moduleId=this.canonical(packageId);if(!factories[moduleId]){continue}exports=this.require(moduleId);
-for(key in exports){if(!exports.hasOwnProperty(key)){continue}window[key]=exports[key]
-}}},register:function(name,desc){if(name.indexOf(":")>0){return this.module(name,desc)
-}var catalog=this._catalog,key;if(!catalog){catalog=this._catalog={}}catalog[name]=desc;
-var info=desc?desc.packages:null;if(info){for(key in info){if(!info.hasOwnProperty(key)||catalog[key]){continue
-}catalog[key]=info[key]}}if(!this._resolved(CATALOG,name)){this.packages.push(name)
-}this._promiseFor(CATALOG,name).resolve(name)},script:function script(id){if(!this._resolved(SCRIPTS,id)){this.scripts.push(id)
-}this._promiseFor(SCRIPTS,id).resolve(id);return this},stylesheet:function stylesheet(id){if(!this._resolved(STYLESHEETS,id)){this.stylesheets.push(id)
-}this._promiseFor(STYLESHEETS,id).resolve(id);return this},module:function module(moduleId,factory){var factories=this._factories;
-if(!factories){factories=this._factories={}}factories[moduleId]=factory;if(!this._resolved(MODULES,moduleId)){this.modules.push(moduleId)
-}this._promiseFor(MODULES,moduleId).resolve(moduleId)},async:function(packageId){return this._async(packageId,null)
-},_async:function(packageId,seen){var ret=this._promiseFor(LOADS,packageId);if(ret.status===promise.PENDING){if(this.ready(packageId)){ret.resolve()
-}else{var loader=this;ret.action(function(pr){loader._promiseFor(CATALOG,packageId).then(pr,function(){loader._loadPackage(packageId,pr,seen||{});
-pr.resolve()},function(reason){pr.cancel(reason)});loader._loadPackage(packageId,pr,seen||{})
-}).run()}}return ret},require:function require(moduleId,packageId){return this.sandbox.require(moduleId,packageId)
-},ready:function ready(moduleId){return this._ready(moduleId,null)},_ready:function(moduleId,seen){if(seen){if(seen[moduleId]){return true
-}else{seen[moduleId]=true}}var idx,packageId,info,items,loc,scriptId,styleId;idx=moduleId.indexOf(":");
-if(idx>=0){packageId=moduleId.slice(0,idx)}else{packageId=moduleId}if(!this._resolved(CATALOG,packageId)){return false
-}info=this._catalog[packageId];items=info.depends;loc=items?items.length:0;while(--loc>=0){if(!seen){seen={}
-}if(!this._ready(items[loc],seen)){return false}}items=info.stylesheets;loc=items?items.length:0;
-while(--loc>=0){styleId=items[loc];if(STRING!==typeof styleId){styleId=styleId.id
-}if(!this._resolved(STYLESHEETS,styleId)){return false}}items=info.scripts;loc=items?items.length:0;
-while(--loc>=0){scriptId=items[loc];if(STRING!==typeof scriptId){scriptId=scriptId.id
-}if(!this._resolved(SCRIPTS,scriptId)){return false}}if(moduleId!==packageId){if(!this._resolved(MODULES,moduleId)){return false
-}}return true},main:function(moduleId,method){var r=this.require("system").ready;
-if(!r){throw ("cannot register main because system.ready does not exist")}r.main(this,function(){this.async(moduleId).then(this,function(){this.require(moduleId)[method]()
-})});return this},_loadScript:function(scriptId){var id,url,pr;if(STRING!==typeof(scriptId)){id=scriptId.id;
-url=scriptId.url}else{id=url=scriptId}pr=this._promiseFor(SCRIPTS,id);if(pr.status===promise.PENDING){var loader=this;
-pr.action(function(pr){var body=document.body,el;if(!body){promise.cancel("no document to append script")
-}el=document.createElement("script");el.setAttribute("src",url);body.appendChild(el);
-body=el=null})}return pr},_loadStylesheet:function(styleId){var id,url,pr;if(STRING!==typeof(styleId)){id=styleId.id;
-url=styleId.url}else{id=url=styleId}pr=this._promiseFor(STYLESHEETS,id);if(pr.status===promise.PENDING){var loader=this;
-pr.action(function(pr){var body=document.body,el;if(!body){pr.cancel("no document to append stylesheet")
-}el=document.createElement("link");el.setAttribute("rel","stylesheet");el.setAttribute("href",url);
-body.appendChild(el);body=el=null;loader.stylesheet(id)})}return pr},_loadPackage:function(packageId,pr,seen){if(seen){if(seen[packageId]){console.warn("detected cyclical reference to "+packageId+" seen="+object_keys(seen).join(", "));
-return}else{seen[packageId]=true}}var info=this._catalog?this._catalog[packageId]:null,items,loc,item,ordered,next,prDepends;
-if(!info){return this}items=info.depends;loc=items?items.length:0;prDepends=promise.create(promiseName("load-package",packageId));
-while(--loc>=0){prDepends.depends(this._async(items[loc],seen))}pr.depends(prDepends);
-prDepends.resolve();items=info.scripts;loc=items?items.length:0;next=null;ordered=info.ordered!==false;
-while(--loc>=0){item=this._loadScript(items[loc]);pr.depends(item);if(ordered){if(next){item.then(next,next.run,next.cancel)
-}}else{item.run()}next=item}if(next&&ordered){prDepends.then(next,next.run,next.cancel)
-}items=info.stylesheets;loc=items?items.length:0;next=null;while(--loc>=0){item=this._loadStylesheet(items[loc]);
-pr.depends(item);if(next){item.then(next,next.run,next.cancel)}next=item}if(next){prDepends.then(next,next.run,next.cancel)
-}},_promiseFor:function(promiseType,name1,name2){var promises=this._promises,sub1,sub2,ret,Q;
-if(!promises){promises=this._promises={}}sub1=promises[promiseType];if(!sub1){sub1=promises[promiseType]={}
-}if(name2===undefined){sub2=sub1;name2=name1}else{sub2=sub1[name1];if(!sub2){sub2=sub1[name1]={}
-}}ret=sub2[name2];if(!ret){ret=sub2[name2]=promise.create(promiseName(promiseType,name1))
-}return ret},_discoveredStylesheets:false,discoverStylesheets:function(){this._discoveredStylesheets=true;
-if("undefined"===typeof document){return this}var links=document.getElementsByTagName("link"),loc=links?links.length:0,link;
-while(--loc>=0){link=links[loc];if(!link||(link.rel!=="stylesheet")){continue}link=link.getAttribute("loadid")||link.getAttribute("LOADID");
-if(link){this.stylesheet(link.toString())}link=link.href;if(link){this.stylesheet(link.toString())
-}}link=link=loc=null;return this},_resolved:function(promiseType,name1,name2){if((promiseType===STYLESHEETS)&&!this._discoveredStylesheets){this.discoverStylesheets()
-}var ret=this._promises;if(ret){ret=ret[promiseType]}if(ret){ret=ret[name1]}if(ret&&name2){ret=ret[name2]
-}return ret?(ret.status===promise.RESOLVED):false},_inspectLoader:function(){var lines=[],modules=this.modules,key,names,len,idx,emitted=false;
-lines.push("Loader<id="+this.id+">:");if(this.packages.length>0){lines.push("  packages: "+this.packages.join(","));
-lines.push("")}if(this.scripts.length>0){lines.push("  scripts:");len=this.scripts.length;
-for(idx=0;idx<len;idx++){lines.push("    "+this.scripts[idx])}lines.push("")}if(this.stylesheets.length>0){lines.push("  stylesheets:");
-len=this.scripts.length;for(idx=0;idx<len;idx++){lines.push("    "+this.scripts[idx])
-}lines.push("")}if(this.modules.length>0){lines.push("  modules: ");len=this.modules.length;
-for(idx=0;idx<len;idx++){lines.push("    "+this.modules[idx])}lines.push("")}return lines.join("\n")
-},_inspectModule:function(moduleId){var lines=[],packageId=moduleId.slice(0,moduleId.indexOf(":")),tmp;
-if(this._catalog&&!this._catalog[packageId]){tmp="tiki/"+packageId;if(this._catalog[tmp]){packageId=tmp;
-moduleId="tiki/"+moduleId}}lines.push(moduleId+" ("+(this.ready(moduleId)?"READY":"NOT READY")+"):");
-lines.push(this._inspectPackage(packageId));return lines.join("\n")},_inspectPackage:function(packageId){if(this._catalog&&!this._catalog[packageId]){var tmp="tiki/"+packageId;
-if(this._catalog[tmp]){packageId=tmp}}var lines=[],info=this._catalog?this._catalog[packageId]:null,idx,len,item,parts;
-lines.push(packageId+" ("+(this.ready(packageId)?"READY":"NOT READY")+"): "+(info?"":"Not in Catalog!"));
-if(!info){return lines.join("\n")}len=info.depends?info.depends.length:0;if(len>0){parts=[];
-for(idx=0;idx<len;idx++){item=info.depends[idx];parts.push(item+" ("+(this.ready(item)?"READY":"NOT READY")+")")
-}lines.push("  depends: "+parts.join(", "))}len=info.scripts?info.scripts.length:0;
-if(len>0){lines.push("\n  scripts:");for(idx=0;idx<len;idx++){item=info.scripts[idx];
-if(STRING!==typeof item){item=item.id}lines.push("    "+item+" ("+(this._resolved(SCRIPTS,item)?"READY":"NOT READY")+")")
-}}len=info.stylesheets?info.stylesheets.length:0;if(len>0){lines.push("\n  stylesheets:");
-for(idx=0;idx<len;idx++){item=info.stylesheets[idx];if(STRING!==typeof item){item=item.id
-}lines.push("    "+item+"("+(this._resolved(STYLESHEETS,item)?"READY":"NOT READY")+")")
-}}return lines.join("\n")},inspect:function(id){if(arguments.length===0){return this._inspectLoader()
-}else{if(id.indexOf(":")<0){return this._inspectPackage(id)}else{return this._inspectModule(id)
-}}},toString:function(){return"Loader<id="+this.id+">"}};core.setupDisplayNames(Loader.prototype,"Loader");
-setup=function setup(curLoader,env){if(curLoader&&!curLoader.isBootstrap){return curLoader
-}if(!env){env={}}if(!env.global&&("undefined"!==typeof window)){env.global=window
-}if(!env.document&&("undefined"!==typeof document)){env.document=document}var queue=curLoader?curLoader.queue:null,id=curLoader?curLoader.id:"default",ret=new Loader(id,queue,env);
-if(curLoader&&curLoader.destroy){curLoader.destroy()}return ret};create=function create(id){return new Loader(id)
-};exports.Loader=Loader;exports.create=create;exports.setup=setup});tiki.module("tiki:lib/promise",function(d,f,b){var e=d("tiki:core");
-var i,g,c,k,l,h,a;"import core as core";"export package Promise";"export create RESOLVED PENDING CANCELLED BUSY BLOCKED";
-"use factory_format function";var j=false;c="resolved";k="pending";l="cancelled";
-h="busy";a="blocked";var i=function(m){this.id=m;return this};i.prototype={status:k,outstandingDependencies:0,hasAction:false,resolve:function(n){if(j){console.log(this.id+".resolve() dep="+this.outstandingDependencies+" status="+this.status)
-}var m=this.status;if((m===c)||(m===l)){return this}this._value=n;if(this.outstandingDependencies>0){this.status=a
-}else{this.status=c;this.value=n;this._notify(c,n)}return this},cancel:function(n){var m=this.status;
-if((m===c)||(m===l)){return this}this.status=l;this.value=n;this._notify(l,n);return this
-},then:function(o,m,n){var p;if(arguments.length<3&&("function"===typeof o)){n=m;
-m=o;o=this}if(m){this._register(c,o,m)}if(n){this._register(l,o,n)}return this},run:function(){if(this.method&&this.status===k){this.status=h;
-this.method.call(this.target||this,this)}return this},reset:function(){var m=this.status;
-if((m!==h)||(m!==a)){this.status=k}this.value=null;return this},action:function(m,n){if(arguments.length===1){n=m;
-m=this}this.target=m;this.method=n;this.hasAction=true;return this},depends:function(m){this.outstandingDependencies++;
-if(j){console.log(this.id+".depends("+m.id+") dep="+this.outstandingDependencies+" status="+this.status)
-}m.then(this,this._resolveDepends,this._cancelDepends);return this},_resolveDepends:function(n,m){this.outstandingDependencies--;
-if(j){console.log("  "+this.id+"._resolveDepends("+m.id+") dep="+this.outstandingDependencies)
-}if(this.outstandingDependencies<=0&&(this.status===a)){this.resolve(this.value)}return this
-},_cancelDepends:function(m,n){if(j){console.log("  "+this.id+"._cancelDepends("+n.id+") dep="+this.outstandingDependencies)
-}this.cancel(m);return this},_notify:function(p,n){var o=this._actions,m,q;o=o?o[p]:null;
-m=o?o.length:0;this._actions=null;for(q=0;q<m;q++){this._invoke(o[q].target,o[q].method,n)
-}},_invoke:function(n,o,m){if(("string"===typeof o)&&n){o=n[o]}if(!n){n=this}o.call(n,m,this)
-},_register:function(m,o,r){var q=this.status,p,n;if((q===c)||(q===l)){if(q===m){this._invoke(o,r,this.value)
-}}else{p=this._actions;if(!p){p=this._actions={}}n=p[m];if(!n){n=p[m]=[]}n.push({target:o,method:r})
-}},toString:function(){return"Promise<id="+this.id+" status="+this.status+">"}};e.setupDisplayNames(i.prototype,"Promise");
-g=function g(m){return new i(m)};f.Promise=i;f.create=g;f.RESOLVED=c;f.PENDING=k;
-f.CANCELLED=l;f.BUSY=h;f.BLOCKED=a});tiki.module("tiki:lib/sandbox",function(b,a,d){var e,c;
-"export package Sandbox";"export create";"use factory_format function";e=function e(f,m,k){var h={},i=[],j={},n=this;
-this.id=f;this.modules=i;this.loader=m;function l(){var p=arguments.length,o;if(p>0){while(--p>0){o=arguments[p];
-if(o&&h[o]){delete h[o];i.splice(i.indexOf(o),1)}}}else{h={};i.length=0}}l.displayName="Sandbox.clear";
-function g(o,r,u){var v,s,p,t,w;if(r){w=o.indexOf(":");if(w>=0){o=o.slice(0,w)}o=r+":"+o
-}o=m.canonical(o,u);if(exp=h[o]){return exp}i.push(o);h[o]=s={};v=function(x,y){return g(x,y,o)
-};v.displayName="Sandbox.require";v.loader=m;v.clear=l;v.env=k||{};v.sandbox=this;
-p={id:o};var q=m.load(o);if(!q){throw"could not load function for "+o}q.call(s,v,s,p);
-return s}this.require=function(o,p){return g(o,p)};this.require.displayName="Sandbox.require"
-};e.prototype={};c=function c(h,f,g){return new e(h,f,g)};a.Sandbox=e;a.create=c});
-tiki.module("tiki:package",function(c,b,d){var a;a=c("tiki:lib/loader");b.Loader=a.Loader;
-a=c("tiki:lib/promise");b.Promise=a.Promise;a=c("tiki:lib/sandbox");b.Sandbox=a.Sandbox
-});"use modules false";"use loader false";tiki=tiki.require("tiki:lib/loader").setup(tiki,("undefined"===typeof ENV)?null:ENV);
-tiki.script("tiki:en/0bc0db20a15cb1574e0e5deef1b477c14c43c8a3/javascript.js");tiki.register("tiki/platform/classic",{depends:["tiki"],packages:{tiki:{}},scripts:[{url:"/static/tiki/platform/classic/en/9f6d82903c6accdda661e6d567f7d6f7fd335392/javascript.js",id:"tiki/platform/classic:en/9f6d82903c6accdda661e6d567f7d6f7fd335392/javascript.js"}]});
-tiki.module("tiki/platform/classic:lib/console",function(c,b,d){var a;"export package console";
-"use factory_format function";var e=c.env;a=(e&&e.global)?e.global.console:null;b.console=a
-});tiki.module("tiki/platform/classic:lib/event","var info = require('tiki/platform/classic:lib/info');var add,remove,event,ready,unload,NATIVE_EVENTS;// ==========================================================================\n// Project:   Tiki\n// Copyright: \u00a92006-2009 Sprout Systems, Inc. and contributors.\n//            Portions \u00a92008-2009 Apple Inc. All rights reserved.\n// License:   Licened under MIT license (see license.js)\n// ==========================================================================\n/*globals event exports add remove ready unload info NATIVE_EVENTS */\n\n\"import lib/info as info\";\n\"export add remove\";\n\"export package event ready unload NATIVE_EVENTS\";\n\n/**\n  @file\n  \n  Implements a low-level interface for registering interest in native events\n  delivered by the web browser.  If you are implementing this API for a non-\n  browser environment, add() and remove() may do nothing.\n  \n  ready() and unload() should still invoke the passed callback when the \n  JS environment is ready for the app to run and just before the app exits,\n  respectively.\n\n  ready() and unload() should both expect to be called exactly once (by the\n  system event module).  They may throw an error if called more than once.\n*/\n\n\nvar readyCalled  = false, \n    unloadCalled = false,\n    browser      = info.browser,\n    isReady      = false,\n    isUnloaded   = false,\n    ecache       = {};\n    \n\n// returns a handler function for the onready event depending on the browser.    \nfunction readyHandler(callback) {\n  var ret ;\n  \n  // opera - wait until all the stylesheets are made visible\n  if (browser.opera) {\n    ret = function() {\n      if (isReady) return;\n      \n      for (var i = 0; i < document.styleSheets.length; i++) {\n        if (document.styleSheets[i].disabled) {\n          setTimeout(ret, 0);\n          return;\n        }\n      }\n      \n      // and execute any waiting functions\n      isReady = true;\n      callback();\n    };\n    \n  // msie - wait until the doScroll event stops complaining..\n  } else if (browser.msie) {\n    ret = function() {\n      if (isReady) return;\n      try {\n        // If IE is used, use the trick by Diego Perini\n        // http://javascript.nwbox.com/IEContentLoaded/\n        document.documentElement.doScroll(\"left\");\n      } catch( error ) {\n        setTimeout(ret, 0);\n        return;\n      }\n\n      // and execute any waiting functions\n      isReady = true;\n      callback();\n    };\n    \n  // everyone else - just call\n  } else {\n    ret = function() {\n      console.log('ready!');\n      if (isReady) return ;\n      isReady = true;\n      callback();\n    };\n  }\n  \n  return ret ;\n  \n}\n\n/** \n  Invoke the  callback when the browser is ready to handle app code. \n  Throws an exception if it is called more than once.  Uses a built-in \n  listener.\n  \n  @param {Function} callback\n  @returns {void}\n*/\nready = function(callback) {\n  if (readyCalled) throw(\"Cannot call platform.ready() more than once\");\n  readyCalled = true;\n  \n  var handler = readyHandler(callback);\n  \n  // Mozilla, Opera (see further below for it) and webkit nightlies \n  // currently support this event.  Use the handy event callback\n  if (document.addEventListener) {\n    document.addEventListener( \"DOMContentLoaded\", handler, NO );\n  \n  // If IE is used and is not in a frame\n  // Continually check to see if the document is ready\n  } else if (browser.msie && (window === top)) handler();\n\n  // A fallback to window.onload, that will always work\n  add(window, 'load', handler);\n};\n\n\nfunction unloadHandler(callback) {\n  return function() {\n    if (isUnloaded) return ;\n    isUnloaded = true;\n    callback();\n  }; \n}\n\n/**\n  Invoke the callback just before the browser unloads the page.  Throws an \n  error if called more than once.\n  \n  @param {Function} callback\n  @returns {void}\n*/\nunload = function(callback) {\n  if (unloadCalled) throw(\"Cannot call platform.unload() more than once\");\n  unloadCalled = true;\n  add(window, 'unload', unloadHandler(callback));\n};\n\n// ..........................................................\n// EVENT LISTENERS\n// \n\n/**\n  Names of event types natively supported by this library.  Platforms without\n  native event support can return an empty hash.\n*/\nNATIVE_EVENTS = {};\n\n// TODO: make this correct per-browser\n// TODO: add touch events\nvar names = 'mousedown mouseup click dblclick mouseover mouseout selectstart keypress keydown keyup blur focus deactivate change select submit contextmenu dragstart error hashchange help load losecapture readystatechange resize scroll unload'.split(' '), loc = names.length;\nwhile(--loc>=0) NATIVE_EVENTS[names[loc]] = names[loc];\n\n\n// convert 'foo' => 'onfoo' using cache to avoid malloc\nfunction onStr(str) {\n    var ret = ecache[str];\n    if (!ret) ret = ecache[str] = ('on' + str); // avoid mallocs\n    return ret ;\n}\n\n/**\n  Adds a listener for the event.  No need to do any special buffering; just\n  add the listener in a platform-specific way.\n  \n  @param {Object} elem the target element if any.  otherwise use document\n  @param {String} eventType click, mousedown, etc\n  @param {Function} callback function to invoke\n  @returns {void}\n*/\nadd = function(elem, eventType, callback) {\n  if (!NATIVE_EVENTS[eventType]) return ; // ignore for native events\n  if (!elem) elem = require.env.document;\n  if (elem.addEventListener) elem.addEventListener(eventType, callback, NO);\n  else if (elem.attachEvent) elem.attachEvent(onStr(eventType), callback);      \n  else throw(\"cannot add listener to element: \" + elem);\n};\n\n/**\n  Removes a listener for the event.  No need to do any special buffering; just\n  remove the listener in a platform-specific way\n  \n  @param {Object} elem the target element if any. otherwise use document\n  @param {String} eventType click, mousedown, etc\n  @param {Function} func function to invoke\n  @returns {void}\n*/\nremove = function(elem, eventType, func) {\n  if (!NATIVE_EVENTS[eventType]) return ;\n  if (!elem) elem = require.env.document;\n  if (elem.removeEventListener) elem.removeEventListener(eventType, func, NO);\n  else if (elem.detachEvent) elem.detachEvent(onStr(eventType), func);\n  else throw(\"cannot remove listener from element: \" + elem);\n};\n\n// make this API visible as the events property on package\nevent = exports;\n;exports.add = add;\nexports.remove = remove;\nexports.event = event;\nexports.ready = ready;\nexports.unload = unload;\nexports.NATIVE_EVENTS = NATIVE_EVENTS;\n");
-tiki.module("tiki/platform/classic:lib/info","var browser,userAgent,info;// ==========================================================================\n// Project:   Tiki\n// Copyright: \u00a92009 Apple Inc.\n// ==========================================================================\n/*globals browser userAgent info exports */\n\n\"export browser userAgent\";\n\"export package info\";\n\n/**\n  @file\n\n  Export constants in this module that describe the capabilities of the target\n  platform.  The most important property you can define here is HTML\n*/\n\n\n// ..........................................................\n// BROWSER DESCRIPTION\n// \n\nuserAgent = navigator.userAgent.toLowerCase();\n\nvar version = (userAgent.match( /.+(?:rv|it|ra|ie)[\\/: ]([\\d.]+)/ ) || [])[1];\n\nbrowser = {\n  \n  /** The current browser version */\n  version: version,\n  \n  /** non-zero if webkit-based browser */\n  safari: (/webkit/).test( userAgent ) ? version : 0,\n  \n  /** non-zero if this is an opera-based browser */\n  opera: (/opera/).test( userAgent ) ? version : 0,\n  \n  /** non-zero if this is IE */\n  msie: (/msie/).test( userAgent ) && !(/opera/).test( userAgent ) ? version : 0,\n  \n  /** non-zero if this is a miozilla based browser */\n  mozilla: (/mozilla/).test( userAgent ) && !(/(compatible|webkit)/).test( userAgent ) ? version : 0,\n  \n  /** non-zero if this is mobile safari */\n  mobileSafari: (/apple.*mobile.*safari/).test(userAgent) ? version : 0,\n  \n  /** non-zero if we are on windows */\n  windows: !!(/(windows)/).test(userAgent),\n  \n  /** non-zero if we are on a mac */\n  mac: !!((/(macintosh)/).test(userAgent) || (/(mac os x)/).test(userAgent)),\n  \n  language: (navigator.language || navigator.browserLanguage).split('-', 1)[0]\n};\n\nbrowser.isOpera = !!browser.opera;\nbrowser.isIe = browser.msie;\nbrowser.isIE = browser.msie;\nbrowser.isSafari = browser.safari;\nbrowser.isMobileSafari = browser.mobileSafari;\nbrowser.isMozilla = browser.mozilla;\nbrowser.isWindows = browser.windows;\nbrowser.isMac = browser.mac;\n\n/**\n  The current browser name.  This is useful for switch statements. \n*/\nbrowser.current = \n  browser.msie ? 'msie' : \n  browser.mozilla ? 'mozilla' : \n  browser.safari ? 'safari' : \n  browser.opera ? 'opera' : 'unknown' ;\n\n\n// make this module visible as \"info\"\ninfo = exports ;\n;exports.browser = browser;\nexports.userAgent = userAgent;\nexports.info = info;\n");
-tiki.module("tiki/platform/classic:lib/timer",function(b,a,c){var f,e,d,g;"export schedule repeat cancel";
-"export package timer";"use factory_format function";f=function(k,l,j){var h,i;i=j?function(){l.call(j,h)
-}:l;h=setTimeout(k,i);l=null;return h};e=function(k,l,j){var h,i;i=j?function(){l.call(j,h)
-}:l;h=setInterval(k,i);l=null;return h};d=function(i,h){if(h===undefined){clearTimeout(i);
-clearInterval(i)}else{if(h){clearInterval(i)}else{clearTimeout(i)}}};g=a;a.schedule=f;
-a.repeat=e;a.cancel=d;a.timer=g});tiki.module("tiki/platform/classic:package",function(c,b,d){var a;
-a=c("tiki/platform/classic:lib/console");b.console=a.console;a=c("tiki/platform/classic:lib/event");
-b.event=a.event;b.ready=a.ready;b.unload=a.unload;b.NATIVE_EVENTS=a.NATIVE_EVENTS;
-a=c("tiki/platform/classic:lib/info");b.info=a.info;a=c("tiki/platform/classic:lib/timer");
-b.timer=a.timer});tiki.script("tiki/platform/classic:en/9f6d82903c6accdda661e6d567f7d6f7fd335392/javascript.js");
-tiki.register("tiki/system",{depends:["tiki","tiki/platform/classic"],packages:{"tiki/platform/classic":{},tiki:{}},scripts:[{url:"/static/tiki/system/en/2914de37845aac6a9ada3efb6531c59f9735086e/javascript.js",id:"tiki/system:en/2914de37845aac6a9ada3efb6531c59f9735086e/javascript.js"}]});
-tiki.module("tiki/system:core","var T_ERROR,T_OBJECT,T_NULL,T_CLASS,T_HASH,T_FUNCTION,T_UNDEFINED,T_NUMBER,T_BOOL,T_ARRAY,T_STRING,T_BOOLEAN,YES,NO,isArray,typeOf,A,generateGuid,guidFor,mixin,setupDisplayNames;// ==========================================================================\n// Project:   SproutCore System Package\n// Copyright: \u00a92009 Apple Inc.\n// ==========================================================================\n/*globals T_ERROR T_OBJECT T_NULL T_CLASS T_HASH T_FUNCTION T_NUMBER T_BOOL T_ARRAY T_UNDEFINED T_STRING YES NO isArray typeOf A generateGuid guidFor */\n\n\"export T_ERROR T_OBJECT T_NULL T_CLASS T_HASH T_FUNCTION T_UNDEFINED T_NUMBER T_BOOL T_ARRAY T_STRING T_BOOLEAN\";\n\"export YES NO isArray typeOf A generateGuid guidFor mixin setupDisplayNames\";\n\n// define standard type constants\nT_ERROR     = 'error';\nT_OBJECT    = 'object';\nT_NULL      = 'null';\nT_CLASS     = 'class';\nT_HASH      = 'hash';\nT_FUNCTION  = 'function';\nT_UNDEFINED = 'undefined';\nT_NUMBER    = 'number';\nT_BOOL      = 'boolean';\nT_ARRAY     = 'array';\nT_STRING    = 'string';\nT_BOOLEAN   = 'boolean';\n\nYES         = true;\nNO          = false; \n\n/**\n  Returns true if the passed item is an array.  Works regardless of source\n  of array.\n*/\nisArray = function(obj) {\n  if (obj && obj.isArray) return true; // fast path\n  if (!obj) return false;\n  if (T_UNDEFINED !== typeof obj.length) {\n    if ((typeof obj !== T_FUNCTION) && (typeof obj !== T_STRING) && (obj.constructor !== String)) return true;\n  }\n  // TODO: add proper check that works across windows...\n  return false ;  \n};\n\nArray.prototype.isArray = true ;\n  \n/**\n  Returns a consistant type for the passed item.\n\n  Use this instead of the built-in typeOf() to get the type of an item. \n  It will return the same result across all browsers and includes a bit \n  more detail.  Here is what will be returned:\n\n  | Return Value Constant | Meaning |\n  | SC.T_STRING | String primitive |\n  | SC.T_NUMBER | Number primitive |\n  | SC.T_BOOLEAN | Boolean primitive |\n  | SC.T_NULL | Null value |\n  | SC.T_UNDEFINED | Undefined value |\n  | SC.T_FUNCTION | A function |\n  | SC.T_ARRAY | An instance of Array |\n  | SC.T_CLASS | A SproutCore class (created using SC.Object.extend()) |\n  | SC.T_OBJECT | A SproutCore object instance |\n  | SC.T_HASH | A JavaScript object not inheriting from SC.Object |\n\n  @param item {Object} the item to check\n  @returns {String} the type\n*/  \ntypeOf = function typeOf(item) {\n  if (item === undefined) return T_UNDEFINED ;\n  if (item === null) return T_NULL ; \n  \n  var ret = typeof(item) ;\n  if (ret == \"object\") {\n    if (isArray(item)) ret = T_ARRAY ;\n    else if (item instanceof Function) {\n      ret = item.isClass ? T_CLASS : T_FUNCTION ;\n    } else if ((item instanceof Error) || item.isError) ret = T_ERROR;\n    else if (item.isObject) ret = T_OBJECT ;\n    else if (item.isClass) ret = T_CLASS;\n    else if (item.constructor === Object) ret = T_HASH;\n    else if (item.constructor === Number) ret = T_NUMBER;\n    else if (item.constructor === String) ret = T_STRING;\n    else ret = T_OBJECT;\n\n  } else if (ret === T_FUNCTION) ret = item.isClass ? T_CLASS : T_FUNCTION;\n  \n  return ret ;\n};\n  \n/**\n  Converts the passed object to an Array.  If the object appears to be \n  array-like, a new array will be cloned from it.  Otherwise, a new array\n  will be created with the item itself as the only item in the array.\n  \n  @param object {Object} any enumerable or array-like object.\n  @returns {Array} Array of items\n*/\nA = function A(obj) {\n  // null or undefined -- fast path\n  if ((obj === null) || (obj === undefined)) return [] ;\n  \n  // primitive -- fast path\n  if (obj.slice instanceof Function) {\n    // do we have a string?\n    if (typeof(obj) === 'string') return [obj] ;\n    else return obj.slice() ;\n  }\n  \n  // enumerable -- fast path\n  if (obj.toArray) return obj.toArray() ;\n  \n  // if not array-like, then just wrap in array.\n  if (!isArray(obj)) return [obj];\n  \n  // when all else fails, do a manual convert...\n  var ret = [], len = obj.length;\n  while(--len >= 0) ret[len] = obj[len];\n  return ret ;\n};\n  \nvar guidKey = \"_sc_guid_\" + new Date().getTime();\nvar _nextGUID = 0, _numberGuids = [], _stringGuids = [];\n\n/**\n  Generates a new guid, optionally saving the guid to the object that you\n  pass in.  You will rarely need to use this method.  Instead you should\n  call SC.guidFor(obj), which return an existing guid if available.\n\n  @param {Object} obj the object to assign the guid to\n  @returns {String} the guid\n*/\ngenerateGuid = function generateGuid(obj) { \n  var ret = (\"sc\" + (_nextGUID++)); \n  if (obj) obj[guidKey] = ret ;\n  return ret ;\n};\n\n/**\n  Returns a unique GUID for the object.  If the object does not yet have\n  a guid, one will be assigned to it.  You can call this on any object,\n  SC.Object-based or not, but be aware that it will add a _guid property.\n\n  You can also use this method on DOM Element objects.\n\n  @param obj {Object} any object, string, number, Element, or primitive\n  @returns {String} the unique guid for this instance.\n*/\nguidFor = function guidFor(obj) {\n  \n  // special cases where we don't want to add a key to object\n  if (obj === undefined) return \"(undefined)\" ;\n  if (obj === null) return '(null)' ;\n  if (obj === Object) return '(Object)';\n  if (obj === Array) return '(Array)';\n  \n  if (obj[guidKey]) return obj[guidKey] ;\n\n  switch(typeof obj) {\n    case T_NUMBER:\n      return (_numberGuids[obj] = _numberGuids[obj] || (\"nu\" + obj));\n    case T_STRING:\n      return (_stringGuids[obj] = _stringGuids[obj] || (\"st\" + obj));\n    case T_BOOL:\n      return obj ? \"(true)\" : \"(false)\" ;\n    default:\n      return generateGuid(obj);\n  }\n};\n\n/**\n  Mixin the passed properties onto the first parameter.  This is a convenient\n  way to add properties to an object.\n  \n  @param {Hash} t the target object to mixin to\n  @param {Hash..} one or more hashes to mix in\n  @returns {Hash} the first parameter\n*/\nmixin = function mixin(t) {\n  \n  // copy reference to target object\n  var len    = arguments.length,\n      target = arguments[0] || {},\n      idx, options, key, src, copy;\n\n  for (idx=1; idx < len; idx++ ) {\n    if (!(options = arguments[idx])) continue ;\n    for(key in options) {\n      if (!options.hasOwnProperty(key)) continue ;\n\n      src  = target[key];\n      copy = options[key] ;\n      if (target===copy) continue ; // prevent never-ending loop\n      if (copy !== undefined) target[key] = copy ;\n    }\n  }\n  \n  return target;\n};\n\nvar TMP_ARY = [];\n\n/**\n  Iterate over a property, setting display names on functions as needed. \n*/\nsetupDisplayNames = function setupDisplayNames(obj, root) {\n  var a = TMP_ARY;\n  a[0] = root;\n  \n  var k,v;\n  for(k in obj) {\n    if (!obj.hasOwnProperty(k)) continue ;\n    v = obj[k];\n    if ('function' === typeof v) {\n      a[1] = k;\n      v.displayName = a.join('.');\n    }\n  }\n  \n  a.length = 0;\n  return obj;\n};;exports.T_ERROR = T_ERROR;\nexports.T_OBJECT = T_OBJECT;\nexports.T_NULL = T_NULL;\nexports.T_CLASS = T_CLASS;\nexports.T_HASH = T_HASH;\nexports.T_FUNCTION = T_FUNCTION;\nexports.T_UNDEFINED = T_UNDEFINED;\nexports.T_NUMBER = T_NUMBER;\nexports.T_BOOL = T_BOOL;\nexports.T_ARRAY = T_ARRAY;\nexports.T_STRING = T_STRING;\nexports.T_BOOLEAN = T_BOOLEAN;\nexports.YES = YES;\nexports.NO = NO;\nexports.isArray = isArray;\nexports.typeOf = typeOf;\nexports.A = A;\nexports.generateGuid = generateGuid;\nexports.guidFor = guidFor;\nexports.mixin = mixin;\nexports.setupDisplayNames = setupDisplayNames;\n");
-tiki.module("tiki/system:lib/event",'var $m__ = require(\'tiki/system:core\'), T_ERROR=$m__.T_ERROR,T_OBJECT=$m__.T_OBJECT,T_NULL=$m__.T_NULL,T_CLASS=$m__.T_CLASS,T_HASH=$m__.T_HASH,T_FUNCTION=$m__.T_FUNCTION,T_UNDEFINED=$m__.T_UNDEFINED,T_NUMBER=$m__.T_NUMBER,T_BOOL=$m__.T_BOOL,T_ARRAY=$m__.T_ARRAY,T_STRING=$m__.T_STRING,T_BOOLEAN=$m__.T_BOOLEAN,YES=$m__.YES,NO=$m__.NO,isArray=$m__.isArray,typeOf=$m__.typeOf,A=$m__.A,generateGuid=$m__.generateGuid,guidFor=$m__.guidFor,mixin=$m__.mixin,setupDisplayNames=$m__.setupDisplayNames;var $m__ = require(\'tiki/system:lib/invocation\'), Invocation=$m__.Invocation;var $m__ = require(\'tiki/system:lib/platform\'), PLATFORM=$m__.PLATFORM,PLATFORM_PACKAGE=$m__.PLATFORM_PACKAGE,info=$m__.info,env=$m__.env;var ready,unload;// ==========================================================================\n// Project:   Tiki\n// Copyright: \u00a92009 Apple Inc.\n// ==========================================================================\n/*globals ready unload Invocation */\n\n"import core";\n"import lib/invocation";\n"import lib/platform";\n"export package ready unload";\n\nvar platform = require(PLATFORM_PACKAGE);\n\n// ..........................................................\n// READY HANDLER\n// \n\n// called when the document becomes ready.  work through the queue...\nfunction _ready() {\n  var queue = ready.queue, \n      mainQ = ready.mainQ,\n      len   = queue.length,\n      inv, idx;\n\n  ready.isReady = ready.scheduled = YES ;\n  ready.queue = []; // ok to alloc since it is usually only called once\n  ready.mainQ = [];\n  \n  for(idx=0;idx<len;idx++) {\n    inv = queue[idx];\n    inv.invoke();\n    inv.release(); // return to pool\n  }\n\n  // after calling ready handlers, invoke any main functions to start the app\n  len = mainQ.length;\n  for(idx=0;idx<len;idx++) {\n    inv = mainQ[idx];\n    inv.invoke();\n    inv.release(); // return to pool\n  }\n};\n\n/**\n  Call to register methods you want run when the system is ready for the app\n  to run.\n*/\nready = function(target, method, args) {\n  if (ready.isReady) {\n    Invocation.invoke(target, method, arguments, 2);\n    \n  } else {\n    if (!ready.scheduled && platform) platform.ready(_ready);\n    ready.scheduled = YES ;\n    ready.queue.push(Invocation.create(target, method, arguments, 2));\n  }\n  \n  return this ;\n};\n\nready.isReady = NO ;\nready.queue   = [] ;\nready.scheduled = NO ;\nready.mainQ   = [] ; // invocations for main. called after ready\n\nready.main = function(target, method, args) {\n  if (ready.isReady) {\n    Invocation.invoke(target, method, arguments, 2);\n    \n  } else {\n    if (!ready.scheduled && platform) platform.ready(_ready);\n    ready.scheduled = YES ;\n    ready.mainQ.push(Invocation.create(target, method, arguments, 2));\n  }\n  \n  return this ;\n};\n\n// ..........................................................\n// UNLOAD HANDLER\n// \n\nfunction _unload() {\n  var queue = unload.queue, \n      len   = queue.length,\n      inv, idx;\n\n  unload.isUnloaded = unload.scheduled = YES ;\n  unload.queue = [];\n  \n  for(idx=0;idx<len;idx++) {\n    inv = queue[idx];\n    inv.invoke();\n    inv.release(); // return to pool\n  }\n}\n\n/**\n  Call to register methods you want run when the system is about to unload.\n*/\nunload = function(target, method, args) {\n  if (unload.isUnloaded) {\n    Invocation.invoke(target, method, arguments, 2);\n    \n  } else {\n    if (!unload.scheduled && platform) platform.unload(_unload);\n    unload.scheduled = YES;\n    unload.queue.push(Invocation.create(target, method, arguments, 2));\n  }\n  \n  return this ;\n};\n\nunload.isUnloaded = NO;\nunload.queue      = [];\nunload.scheduled  = NO;\n;exports.ready = ready;\nexports.unload = unload;\n');
-tiki.module("tiki/system:lib/global",'var global,reset;// ==========================================================================\n// Project:   Tiki\n// Copyright: \u00a92009 Apple Inc.\n// ==========================================================================\n\n"export package global";\n"export reset";\n\n// exports a global object representing the current global.  you can reset \n// the global by importing this module directly.\n\n// if you have env.global, use that\nreset = function() {\n  global = require.env.global || {} ;\n};\n\nreset();\n;exports.global = global;\nexports.reset = reset;\n');
-tiki.module("tiki/system:lib/invocation",'var $m__ = require(\'tiki/system:core\'), T_ERROR=$m__.T_ERROR,T_OBJECT=$m__.T_OBJECT,T_NULL=$m__.T_NULL,T_CLASS=$m__.T_CLASS,T_HASH=$m__.T_HASH,T_FUNCTION=$m__.T_FUNCTION,T_UNDEFINED=$m__.T_UNDEFINED,T_NUMBER=$m__.T_NUMBER,T_BOOL=$m__.T_BOOL,T_ARRAY=$m__.T_ARRAY,T_STRING=$m__.T_STRING,T_BOOLEAN=$m__.T_BOOLEAN,YES=$m__.YES,NO=$m__.NO,isArray=$m__.isArray,typeOf=$m__.typeOf,A=$m__.A,generateGuid=$m__.generateGuid,guidFor=$m__.guidFor,mixin=$m__.mixin,setupDisplayNames=$m__.setupDisplayNames;var $m__ = require(\'tiki/system:mixins/retainable\'), Retainable=$m__.Retainable;var Invocation;// ==========================================================================\n// Project:   Tiki\n// Copyright: \u00a92009 Apple Inc.\n// ==========================================================================\n/*globals Invocation */\n\n"import core";\n"import mixins/retainable";\n"export package Invocation";\n\n/**\n  An Invocation captures a target, method and zero or more arguments to be \n  called at a later time.  Invocations are retainable so you can control when\n  they are destroyed.\n  \n  Note that if you pass a string to the method param, this string will not \n  be resolved to a function until you actually invoke it.  This means you can\n  potentially swap out the method between invocations.\n  \n  @since SproutCore 1.1\n*/\nInvocation = function Invocation(target, method, args) {\n  return this.init(target, method, args);\n};\n\nmixin(Invocation.prototype, Retainable, {\n  \n  constructor: Invocation,\n  \n  /**\n    Initializes the invocation.  This is called when you first create the \n    invocation.\n  */\n  init: function(target, method, args, ignore) {\n    if (args && (ignore !== undefined)) {\n      if (args.length>ignore) args = Array.prototype.slice.call(args, ignore);\n      else args = null; // nothing to curry\n    }\n    \n    this.inPool = NO; // for debug\n    this.target = target;\n    this.method = method;\n    this.args   = args;\n    return this ;\n  },\n  \n  /**\n    Destroys the invocation.  Called when the retain count hits zero.  This\n    will return the invocation to the pool.\n  */\n  destroy: function() {\n    // reset retainable\n    this.isDestroyed = NO;\n    this.retainCount = 1;\n    this.inPool      = YES;\n    this.target = this.method = this.args = null;\n    pool.push(this); // add back to pool\n    \n    return this ;\n  },\n  \n  /**\n    Invokes the method.  Any passed arguments will be curried onto existing\n    arguments.\n    \n    @returns {Object} return value of invoked method.\n  */\n  invoke: function() {\n    return Invocation.invoke(this.target, this.method, this.args, undefined, arguments);\n  }\n  \n});\n\nvar pool = [];\n\n/**\n  Creates a new invocation.  This method will use a memory pool if possible to\n  avoid allocing memory.\n  \n  @param {Object} target target to invoke\n  @param {Function|String} method function or name of method to invoke\n  @param {Array} args zero or more arguments.  optional\n  @param {Number} ignore if passed, ignores this many items from the args\n  @returns {Invocation} new instance\n*/\nInvocation.create = function(target, method, args, ignore) {\n  if (pool.length>0) return pool.pop().init(target,method,args,ignore);\n  else return new Invocation(target, method, args, ignore);\n};\n\n/**\n  Invokes the passed target, method, and arguments.  This is an optimized \n  version that may not actually create an invocation.\n*/\n/**\n  Invokes the invocation.  Return value of invocation is returned.  Any \n  additional arguments will be curried onto the end of any existing args.\n*/\nInvocation.invoke = function(target, method, args, ignore, extra) {\n\n  // normalize method\n  if (typeOf(method) === T_STRING) method = target[method];\n  if (!method) throw("Invocation: method " + this.method + " not defined");\n  \n  // normalize arguments - also curry any extra arguments\n  if ((ignore !== undefined) && args) {\n    if (args.length>ignore) args = Array.prototype.slice.call(args, ignore);\n    else args = null;\n  }\n  if (extra && extra.length>0) args = args ? args.concat(extra) : extra;\n  \n  // and finally invoke\n  return args ? method.apply(target, args) : method.call(target);\n};\n\n;exports.Invocation = Invocation;\n');
-tiki.module("tiki/system:lib/logger","var core = require('tiki/system:core');var $m__ = require('tiki/system:lib/platform'), PLATFORM=$m__.PLATFORM,PLATFORM_PACKAGE=$m__.PLATFORM_PACKAGE,info=$m__.info,env=$m__.env;var Logger,console;// ==========================================================================\n// Project:   Tiki\n// Copyright: \u00a92009 Apple Inc.\n// ==========================================================================\n/*globals Logger console core */\n\n\"import core as core\";\n\"import lib/platform\";\n\"export package Logger console\";\n\n/** \n  @file\n\n  Module defines generic functions that can be used to log output into a \n  string or file.\n  \n  The Logger class defined in this module implements the generic Logger API,\n  which includes warn(), info(), error(), debug() and log().  \n  \n  The console object logs this to a system-provided console (on browsers this\n  is equivalent to the system-provided console).\n\n  @since Tiki 1.0\n*/\n\n// get the platform console\nvar pconsole = require(PLATFORM_PACKAGE).console;\n\n/**\n  Logger class defines a standard logger.  If you attach a console, then the\n  logger will record its own results AND forward any output to the console \n  itself.  \n  \n  A default logger is usually created and exported as \"console\" that will \n  attach to the platform console.  You can create a new logger if you want as \n  well.\n\n  @since Tiki 1.0\n*/\nLogger = function Logger(id, console) {\n  this.id = id ;\n  this.console = console;\n  return this ;\n};\n\nvar COLON = ': ', NEWLINE = \"\\n\", TILDA = ' ~ ';\n\nLogger.prototype = {\n  \n  /**\n    Emits count number of lines (or 100 lines if not specified) as a single\n    string.\n    \n    @property {Number} count number of lines to display. optional\n    @returns {String} logged output\n  */\n  tail: function(count) {\n    var lines = this._lines,\n        len   = lines ? lines.length : 0,\n        idx, ret;\n\n    if (len===0) return '';\n\n    if (count === undefined) count = 100;\n    ret = [];\n    for(idx = Math.max(0, len - count); idx < len; idx++) {\n      \n      if (this.id) {\n        ret.push(this.id);\n        ret.push(TILDA);\n      }\n      if (lines[idx].kind) {\n        ret.push(lines[idx].kind);\n        ret.push(COLON);\n      }\n      ret.push(lines[idx].message);\n      ret.push(NEWLINE);      \n    }\n    \n    return ret.join(\"\");\n  },\n  \n  /**\n    Clears the log contents\n    \n    @returns {Logger} reciever\n  */\n  clear: function() {\n    this._lines = null;\n    return this ;\n  },\n  \n  /**\n    Adds a line to the log.  Pass the log type and message.\n    \n    @param {String} kind kind of log message.  should be WARN, DBEUG, or null\n    @param {String} message message to log\n    @returns {Logger} reciever\n  */\n  push: function(kind, message) {\n    var lines = this._lines;\n    if (!lines) lines = this._lines = [];\n    lines.push({ kind: kind, message: message });\n  },\n  \n  /**\n    Logs a debug statement.\n    \n    @param {String} msg one or more items to log\n    @returns {void} \n  */\n  debug: function(msg) {\n    this.push('DEBUG', core.A(arguments));\n    \n    var console = this.console;\n    if (console && console.debug) console.debug.apply(console, arguments);\n  },\n  \n  /**\n    Logs an info statement.\n    \n    @param {String} msg one or more items to log\n    @returns {void}\n  */\n  info: function(msg) {\n    this.push('INFO', core.A(arguments));\n    \n    var console = this.console;\n    if (console && console.info) console.info.apply(console, arguments);\n  },\n  \n  /**\n    Logs a warning\n    \n    @param {String} msg one or more items to log\n    @returns {void}\n  */\n  warn: function(msg) {\n    this.push('WARN', core.A(arguments));\n    \n    var console = this.console;\n    if (console && console.warn) console.warn.apply(console, arguments);\n  },\n  \n  /**\n    Logs an error.\n    \n    @param {String} msg one or mroe items to log\n    @returns {void}\n  */\n  error: function(msg) {\n    this.push('ERROR', core.A(arguments));\n    \n    var console = this.console;\n    if (console && console.error) console.error.apply(console, arguments);\n  },\n  \n  /**\n    Begins a group stack.\n  */\n  group: function(groupName) {\n    this.push('GROUP', groupName);\n    \n    var console = this.console;\n    if (console && console.group) console.group(groupName);\n  },\n  \n  /**\n    Ends a group stack\n  */\n  groupEnd: function(groupName) {\n    this.push('','');\n    \n    var console = this.console;\n    if (console && console.groupEnd) console.groupEnd(groupName);\n  },\n  \n  toString: function() {\n    var len = this._lines ? this._lines.length : 0;\n    return \"Logger<id=\" + this.id + \" size=\" + len + \">\";\n  }\n    \n};\nLogger.prototype.log = Logger.prototype.info;\n\nconsole = new Logger('console', pconsole);\n;exports.Logger = Logger;\nexports.console = console;\n");
-tiki.module("tiki/system:lib/platform",function(b,a,c){var f,g,e,d;"export package PLATFORM PLATFORM_PACKAGE info env";
-"use factory_format function";g=null;f=platform="unknown";d=b.env;if(d){platform=f=d.PLATFORM||d.platform;
-g=d.PLATFORM_PACKAGE||d.platformPackage;if(!g&&platform){g="platform/"+platform}}e=b(g).info;
-a.PLATFORM=f;a.PLATFORM_PACKAGE=g;a.info=e;a.env=d});tiki.module("tiki/system:mixins/retainable",'var Retainable;// ==========================================================================\n// Project:   Tiki\n// Copyright: \u00a92009 Apple Inc.\n// ==========================================================================\n/*globals Retainable */\n\n\n"export package Retainable";\n\n/**\n  Makes an object retainable.  Retainable objects have a retain count you can\n  increment and decrement.  When the retain count reaches zero, the object is\n  destroyed (by calling destroy).  \n  \n  Use this mixin for objects that need to have their memory carefully \n  controlled (such as events).  This also allows you to write objects that\n  are pooled.\n  \n  @since SproutCore 1.1\n*/\nRetainable = {\n  \n  /**\n    Number of objects retaining this object.  When this reaches zero, the\n    object will be destroyed.\n  */\n  retainCount: 1,\n  \n  /**\n    Becomes true when the object is destroyed.\n  */\n  isDestroyed: false,\n  \n  /**\n    Call to retain the object\n    \n    @returns {Object} receiver\n  */\n  retain: function() {\n    this.retainCount++;\n    return this ;\n  },\n  \n  /** \n    Call to release the object.  May cause it to be destroyed.\n    \n    @returns {Object} receiver\n  */\n  release: function() {\n    if (--this.retainCount <= 0) this.__destroy();\n    return this;\n  },\n  \n  __destroy: function() {\n    if (!this.isDestroyed) {\n      this.isDestroyed = true;\n      if (this.destroy) this.destroy();\n    }\n  }\n  \n};\n\n\n;exports.Retainable = Retainable;\n');
-tiki.module("tiki/system:package",function(c,b,d){var a;a=c("tiki/system:lib/event");
-b.ready=a.ready;b.unload=a.unload;a=c("tiki/system:lib/global");b.global=a.global;
-a=c("tiki/system:lib/invocation");b.Invocation=a.Invocation;a=c("tiki/system:lib/logger");
-b.Logger=a.Logger;b.console=a.console;a=c("tiki/system:lib/platform");b.PLATFORM=a.PLATFORM;
-b.PLATFORM_PACKAGE=a.PLATFORM_PACKAGE;b.info=a.info;b.env=a.env;a=c("tiki/system:mixins/retainable");
-b.Retainable=a.Retainable});tiki.script("tiki/system:en/2914de37845aac6a9ada3efb6531c59f9735086e/javascript.js");
-tiki.register("sproutcore/runtime",{depends:["tiki/system"],packages:{"tiki/system":{}},scripts:[{url:"/static/sproutcore/runtime/en/1a415d7e025bbaaf9462034aaa4d4e00db320bf1/javascript.js",id:"sproutcore/runtime:en/1a415d7e025bbaaf9462034aaa4d4e00db320bf1/javascript.js"}]});
-/* @license
-==========================================================================
-SproutCore Costello -- Property Observing Library
-Copyright �2006-2009, Sprout Systems, Inc. and contributors.
-Portions copyright �2008-2009 Apple Inc. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a 
-copy of this software and associated documentation files (the "Software"), 
-to deal in the Software without restriction, including without limitation 
-the rights to use, copy, modify, merge, publish, distribute, sublicense, 
-and/or sell copies of the Software, and to permit persons to whom the 
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in 
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
-DEALINGS IN THE SOFTWARE.
-
-For more information about SproutCore, visit http://www.sproutcore.com
-
-==========================================================================
-@license */
-"use modules false";
-tiki.module("sproutcore/runtime:core",function(d,e,b){var a=d("tiki/system:package");
-var c,i,h,f;"require license";"import tiki/system:package as system";"export package SC SproutCore YES NO";
-h=true;f=false;var g="undefined";if(g===typeof console){console=a.console}if(g===typeof sc_require){sc_require=function(){}
-}if(g===typeof sc_resource){sc_resource=function(){}}c=i={};c.global=function(j,k){a.global[j]=k;
-return c};c.global.remove=function(j){delete a.global[j];return c};c.global("SC",c);
-c.mixin=function(){var n=arguments[0]||{};var j=1;var m=arguments.length;var k;if(m===1){n=this||{};
-j=0}for(;j<m;j++){if(!(k=arguments[j])){continue}for(var l in k){if(!k.hasOwnProperty(l)){continue
-}var o=k[l];if(n===o){continue}if(o!==undefined){n[l]=o}}}return n};c.supplement=function(){var n=arguments[0]||{};
-var j=1;var m=arguments.length;var k;if(m===1){n=this||{};j=0}for(;j<m;j++){if(!(k=arguments[j])){continue
-}for(var l in k){if(!k.hasOwnProperty(l)){continue}var o=n[l];var p=k[l];if(n===p){continue
-}if(p!==undefined&&o===undefined){n[l]=p}}}return n};c.extend=c.mixin;c.mixin({T_ERROR:"error",T_OBJECT:"object",T_NULL:"null",T_CLASS:"class",T_HASH:"hash",T_FUNCTION:"function",T_UNDEFINED:"undefined",T_NUMBER:"number",T_BOOL:"boolean",T_ARRAY:"array",T_STRING:"string",typeOf:function(k){if(k===undefined){return c.T_UNDEFINED
-}if(k===null){return c.T_NULL}var j=typeof(k);if(j=="object"){if(k instanceof Array){j=c.T_ARRAY
-}else{if(k instanceof Function){j=k.isClass?c.T_CLASS:c.T_FUNCTION}else{if(c.Error&&(k instanceof c.Error)){j=c.T_ERROR
-}else{if(k.isObject===true){j=c.T_OBJECT}else{j=c.T_HASH}}}}}else{if(j===c.T_FUNCTION){j=(k.isClass)?c.T_CLASS:c.T_FUNCTION
-}}return j},none:function(j){return j===null||j===undefined},empty:function(j){return j===null||j===undefined||j===""
-},isArray:function(l){if(l&&l.objectAt){return h}var j=(l?l.length:null),k=c.typeOf(l);
-return !(c.none(j)||(k===c.T_FUNCTION)||(k===c.T_STRING)||l.setInterval)},makeArray:function(j){return c.isArray(j)?j:c.A(j)
-},A:function(l){if(c.none(l)){return[]}if(l.slice instanceof Function){if(typeof(l)==="string"){return[l]
-}else{return l.slice()}}if(l.toArray){return l.toArray()}if(!c.isArray(l)){return[l]
-}var k=[],j=l.length;while(--j>=0){k[j]=l[j]}return k},guidKey:"_sc_guid_"+new Date().getTime(),_nextGUID:0,_numberGuids:[],_stringGuids:{},_keyCache:{},guidFor:function(k){if(k===undefined){return"(undefined)"
-}if(k===null){return"(null)"}if(k===Object){return"(Object)"}if(k===Array){return"(Array)"
-}var j=this.guidKey;if(k[j]){return k[j]}switch(typeof k){case c.T_NUMBER:return(this._numberGuids[k]=this._numberGuids[k]||("nu"+k));
-case c.T_STRING:return(this._stringGuids[k]=this._stringGuids[k]||("st"+k));case c.T_BOOL:return(k)?"(true)":"(false)";
-default:return c.generateGuid(k)}},keyFor:function(m,l){var k,j=this._keyCache[m];
-if(!j){j=this._keyCache[m]={}}k=j[l];if(!k){k=j[l]=m+"_"+l}return k},generateGuid:function(k){var j=("sc"+(this._nextGUID++));
-if(k){k[this.guidKey]=j}return j},hashFor:function(j){return(j&&j.hash&&(typeof j.hash===c.T_FUNCTION))?j.hash():this.guidFor(j)
-},isEqual:function(k,j){if(k===null){return j===null}else{if(k===undefined){return j===undefined
-}else{return this.hashFor(k)===this.hashFor(j)}}},compare:function(s,q){var p=c.typeOf(s);
-var n=c.typeOf(q);var t=c.ORDER_DEFINITION.indexOf(p);var k=c.ORDER_DEFINITION.indexOf(n);
-if(t<k){return -1}if(t>k){return 1}switch(p){case c.T_BOOL:case c.T_NUMBER:if(s<q){return -1
-}if(s>q){return 1}return 0;case c.T_STRING:if(s.localeCompare(q)<0){return -1}if(s.localeCompare(q)>0){return 1
-}return 0;case c.T_ARRAY:var m=Math.min(s.length,q.length);var j=0;var o=0;while(j===0&&o<m){j=arguments.callee(s[o],q[o]);
-if(j!==0){return j}o++}if(s.length<q.length){return -1}if(s.length>q.length){return 1
-}return 0;case c.T_OBJECT:if(s.constructor.isComparable===h){return s.constructor.compare(s,q)
-}return 0;default:return 0}},K:function(){return this},EMPTY_ARRAY:[],EMPTY_HASH:{},EMPTY_RANGE:{start:0,length:0},beget:function(l){if(c.none(l)){return null
-}var j=c.K;j.prototype=l;var k=new j();j.prototype=null;if(c.typeOf(l.didBeget)===c.T_FUNCTION){k=l.didBeget(k)
-}return k},copy:function(k){var j=k;if(k&&k.isCopyable){return k.copy()}switch(c.typeOf(k)){case c.T_ARRAY:if(k.clone&&c.typeOf(k.clone)===c.T_FUNCTION){j=k.clone()
-}else{j=k.slice()}break;case c.T_HASH:case c.T_OBJECT:if(k.clone&&c.typeOf(k.clone)===c.T_FUNCTION){j=k.clone()
-}else{j={};for(var l in k){j[l]=k[l]}}}return j},merge:function(){var l={},k=arguments.length,j;
-for(j=0;j<k;j++){c.mixin(l,arguments[j])}return l},keys:function(l){var j=[];for(var k in l){j.push(k)
-}return j},inspect:function(m){var j,k=[];for(var l in m){j=m[l];if(j==="toString"){continue
-}if(c.typeOf(j)===c.T_FUNCTION){j="function() { ... }"}k.push(l+": "+j)}return"{"+k.join(" , ")+"}"
-},tupleForPropertyPath:function(n,j){if(c.typeOf(n)===c.T_ARRAY){return n}var l;var k=n.indexOf("*");
-if(k<0){k=n.lastIndexOf(".")}l=(k>=0)?n.slice(k+1):n;var m=this.objectForPropertyPath(n,j,k);
-return(m&&l)?[m,l]:null},objectForPropertyPath:function(o,l,m){var p,k,n,j;if(!l){l=a.global
-}if(c.typeOf(o)===c.T_STRING){if(m===undefined){m=o.length}p=0;while((l)&&(p<m)){k=o.indexOf(".",p);
-if((k<0)||(k>m)){k=m}n=o.slice(p,k);l=l.get?l.get(n):l[n];p=k+1}if(p<m){l=undefined
-}}else{p=0;j=o.length;n=null;while((p<j)&&l){n=o[p++];if(n){l=(l.get)?l.get(n):l[n]
-}}if(p<j){l=undefined}}return l},STRINGS:{},stringsFor:function(k,j){c.mixin(c.STRINGS,j);
-return this}});c.clone=c.copy;c.$A=c.A;c.didLoad=c.K;c.ORDER_DEFINITION=[c.T_ERROR,c.T_UNDEFINED,c.T_NULL,c.T_BOOL,c.T_NUMBER,c.T_STRING,c.T_ARRAY,c.T_HASH,c.T_OBJECT,c.T_FUNCTION,c.T_CLASS];
-c.mixin(Function.prototype,{property:function(){this.dependentKeys=c.$A(arguments);
-var j=c.guidFor(this);this.cacheKey="__cache__"+j;this.lastSetValueKey="__lastValue__"+j;
-this.isProperty=h;return this},cacheable:function(j){this.isProperty=h;if(!this.dependentKeys){this.dependentKeys=[]
-}this.isCacheable=(j===undefined)?h:j;return this},idempotent:function(j){this.isProperty=h;
-if(!this.dependentKeys){this.dependentKeys=[]}this.isVolatile=(j===undefined)?h:j;
-return this},observes:function(j){var n=arguments.length,k=null,m=null;while(--n>=0){var l=arguments[n];
-if((l.indexOf(".")<0)&&(l.indexOf("*")<0)){if(!k){k=this.localPropertyPaths=[]}k.push(l)
-}else{if(!m){m=this.propertyPaths=[]}m.push(l)}}return this}});String.prototype.fmt=function(){var k=arguments;
-var j=0;return this.replace(/%@([0-9]+)?/g,function(l,m){m=(m)?parseInt(m,0)-1:j++;
-l=k[m];return((l===null)?"(null)":(l===undefined)?"":l).toString()})};String.prototype.loc=function(){var j=c.STRINGS[this]||this;
-return j.fmt.apply(j,arguments)};String.prototype.w=function(){var l=[],m=this.split(" "),k=m.length;
-for(var j=0;j<k;++j){var n=m[j];if(n.length!==0){l.push(n)}}return l};e.SC=c;e.SproutCore=i;
-e.YES=h;e.NO=f});tiki.module("sproutcore/runtime:mixins/array",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:mixins/observable");c("sproutcore/runtime:mixins/enumerable");
-c("sproutcore/runtime:system/range_observer");"import core";"import mixins/observable";
-"import mixins/enumerable";"import system/range_observer";"export package";h.OUT_OF_RANGE_EXCEPTION="Index out of range";
-h.Array={isSCArray:e,replace:function(i,k,j){throw"replace() must be implemented to support SC.Array"
-},objectAt:function(i){if(i<0){return undefined}if(i>=this.get("length")){return undefined
-}return this.get(i)},"[]":function(i,j){if(j!==undefined){this.replace(0,this.get("length"),j)
-}return this}.property(),insertAt:function(i,j){if(i>this.get("length")){throw h.OUT_OF_RANGE_EXCEPTION
-}this.replace(i,0,[j]);return this},removeAt:function(l,i){var k=0,j=[];if(typeof l===h.T_NUMBER){if((l<0)||(l>=this.get("length"))){throw h.OUT_OF_RANGE_EXCEPTION
-}if(i===undefined){this.replace(l,1,j);return this}else{l=h.IndexSet.create(l,i)}}this.beginPropertyChanges();
-l.forEachRange(function(n,m){n-=k;k+=m;this.replace(n,m,j)},this);this.endPropertyChanges();
-return this},removeObject:function(j){var k=this.get("length")||0;while(--k>=0){var i=this.objectAt(k);
-if(i==j){this.removeAt(k)}}return this},removeObjects:function(i){this.beginPropertyChanges();
-i.forEach(function(j){this.removeObject(j)},this);this.endPropertyChanges();return this
-},pushObject:function(i){this.insertAt(this.get("length"),i);return i},pushObjects:function(i){this.beginPropertyChanges();
-i.forEach(function(j){this.pushObject(j)},this);this.endPropertyChanges();return this
-},popObject:function(){var i=this.get("length");if(i===0){return undefined}var j=this.objectAt(i-1);
-this.removeAt(i-1);return j},shiftObject:function(){if(this.get("length")===0){return undefined
-}var i=this.objectAt(0);this.removeAt(0);return i},unshiftObject:function(i){this.insertAt(0,i);
-return i},unshiftObjects:function(i){this.beginPropertyChanges();i.forEach(function(j){this.unshiftObject(j)
-},this);this.endPropertyChanges();return this},isEqual:function(i){if(!i){return false
-}if(i==this){return true}var j=i.get("length");if(j!=this.get("length")){return false
-}while(--j>=0){if(!h.isEqual(i.objectAt(j),this.objectAt(j))){return false}}return true
-},compact:function(){return this.without(null)},without:function(j){if(this.indexOf(j)<0){return this
-}var i=[];this.forEach(function(l){if(l!==j){i[i.length]=l}});return i},uniq:function(){var i=[];
-this.forEach(function(j){if(i.indexOf(j)<0){i[i.length]=j}});return i},rangeObserverClass:h.RangeObserver,addRangeObserver:function(l,n,p,m){var i=this._array_rangeObservers;
-if(!i){i=this._array_rangeObservers=h.CoreSet.create()}var o=this.rangeObserverClass;
-var j=g;var k=o.create(this,l,n,p,m,j);i.add(k);if(!this._array_isNotifyingRangeObservers){this._array_isNotifyingRangeObservers=e;
-this.addObserver("[]",this,this._array_notifyRangeObservers)}return k},updateRangeObserver:function(j,i){return j.update(this,i)
-},removeRangeObserver:function(k){var j=k.destroy(this);var i=this._array_rangeObservers;
-if(i){i.remove(k)}return j},enumerableContentDidChange:function(p,o,n){var i=this._array_rangeObservers,l=this._array_oldLength,m,k,j;
-this.beginPropertyChanges();this.notifyPropertyChange("length");if(i&&i.length>0){if(l===undefined){l=0
-}this._array_oldLength=m=this.get("length");if(p===undefined){p=0}if(n===undefined){n=m-l
-}if(n!==0||o===undefined){k=m-p;if(n<0){k-=n}}else{k=o}j=this._array_rangeChanges;
-if(!j){j=this._array_rangeChanges=h.IndexSet.create()}j.add(p,k)}this.notifyPropertyChange("[]");
-this.endPropertyChanges();return this},_array_notifyRangeObservers:function(){var k=this._array_rangeObservers,l=this._array_rangeChanges,j=k?k.length:0,i,m;
-if(j>0&&l&&l.length>0){for(i=0;i<j;i++){k[i].rangeDidChange(l)}l.clear()}}};h.mixin(Array.prototype,h.Array);
-h.Array=h.mixin({},h.Enumerable,h.Array);h.Array.slice=function(j,l){var i=[];var k=this.get("length");
-if(h.none(j)){j=0}if(h.none(l)||(l>k)){l=k}while(j<l){i[i.length]=this.objectAt(j++)
-}return i};h.Array.indexOf=function(l,k){var j,i=this.get("length");if(k===undefined){k=0
-}else{k=(k<0)?Math.ceil(k):Math.floor(k)}if(k<0){k+=i}for(j=k;j<i;j++){if(this.objectAt(j)===l){return j
-}}return -1};if(!Array.prototype.indexOf){Array.prototype.indexOf=h.Array.indexOf
-}h.Array.lastIndexOf=function(l,k){var j,i=this.get("length");if(k===undefined){k=i-1
-}else{k=(k<0)?Math.ceil(k):Math.floor(k)}if(k<0){k+=i}for(j=k;j>=0;j--){if(this.objectAt(j)===l){return j
-}}return -1};if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=h.Array.lastIndexOf
-}(function(){h.mixin(Array.prototype,{replace:function(l,o,n){if(this.isFrozen){throw h.FROZEN_ERROR
-}if(!n||n.length===0){this.splice(l,o)}else{var m=[l,o].concat(n);this.splice.apply(this,m)
-}var k=n?(n.get?n.get("length"):n.length):0;this.enumerableContentDidChange(l,o,k-o);
-return this},unknownProperty:function(l,m){var k=this.reducedProperty(l,m);if((m!==undefined)&&k===undefined){k=this[l]=m
-}return k}});var j=Array.prototype.indexOf;if(!j||(j===h.Array.indexOf)){Array.prototype.indexOf=function(n,m){var l,k=this.length;
-if(m===undefined){m=0}else{m=(m<0)?Math.ceil(m):Math.floor(m)}if(m<0){m+=k}for(l=m;
-l<k;l++){if(this[l]===n){return l}}return -1}}var i=Array.prototype.lastIndexOf;if(!i||(i===h.Array.lastIndexOf)){Array.prototype.lastIndexOf=function(n,m){var l,k=this.length;
-if(m===undefined){m=k-1}else{m=(m<0)?Math.ceil(m):Math.floor(m)}if(m<0){m+=k}for(l=m;
-l>=0;l--){if(this[l]===n){return l}}return -1}}})()});tiki.module("sproutcore/runtime:mixins/comparable",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-"import core";"export package";h.Comparable={isComparable:e,compare:function(j,i){throw"%@.compare() is not implemented".fmt(this.toString())
-}}});tiki.module("sproutcore/runtime:mixins/copyable",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-"import core";"export package";h.Copyable={isCopyable:e,copy:function(){throw"%@.copy() is not implemented"
-},frozenCopy:function(){var i=this.get?this.get("isFrozen"):this.isFrozen;if(i===e){return this
-}else{if(i===undefined){throw"%@ does not support freezing"}else{return this.copy().freeze()
-}}}};h.mixin(Array.prototype,h.Copyable);Array.prototype.copy=Array.prototype.slice
-});tiki.module("sproutcore/runtime:mixins/delegate_support",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-"import core";"export package";h.DelegateSupport={delegateFor:function(k){var j=1,i=arguments.length,l;
-while(j<i){l=arguments[j];if(l&&l[k]!==undefined){return l}j++}return(this[k]!==undefined)?this:null
-},invokeDelegateMethod:function(k,i,j){j=h.A(arguments);j=j.slice(2,j.length);if(!k||!k[i]){k=this
-}var l=k[i];return l?l.apply(k,j):null},getDelegateProperty:function(l,m){var j=1,i=arguments.length,k;
-while(j<i){k=arguments[j++];if(k&&k[l]!==undefined){return k.get?k.get(l):k[l]}}return(this[l]!==undefined)?this.get(l):undefined
-}}});tiki.module("sproutcore/runtime:mixins/enumerable",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:system/enumerator");"import core";"import system/enumerator";
-"export package";h.Enumerable={isEnumerable:e,nextObject:function(i,k,j){return this.objectAt?this.objectAt(i):this[i]
-},firstObject:function(){if(this.get("length")===0){return undefined}if(this.objectAt){return this.objectAt(0)
-}var j=h.Enumerator._popContext(),i;i=this.nextObject(0,null,j);j=h.Enumerator._pushContext(j);
-return i}.property(),enumerator:function(){return h.Enumerator.create(this)},forEach:function(o,n){if(typeof o!=="function"){throw new TypeError()
-}var j=this.get?this.get("length"):this.length;if(n===undefined){n=null}var m=null;
-var k=h.Enumerator._popContext();for(var i=0;i<j;i++){var l=this.nextObject(i,m,k);
-o.call(n,l,i,this);m=l}m=null;k=h.Enumerator._pushContext(k);return this},getEach:function(i){return this.map(function(j){return j?(j.get?j.get(i):j[i]):null
-},this)},setEach:function(i,j){this.forEach(function(k){if(k){if(k.set){k.set(i,j)
-}else{k[i]=j}}},this);return this},map:function(p,o){if(typeof p!=="function"){throw new TypeError()
-}var j=this.get?this.get("length"):this.length;if(o===undefined){o=null}var k=[];
-var n=null;var l=h.Enumerator._popContext();for(var i=0;i<j;i++){var m=this.nextObject(i,n,l);
-k[i]=p.call(o,m,i,this);n=m}n=null;l=h.Enumerator._pushContext(l);return k},mapProperty:function(i){return this.map(function(j){return j?(j.get?j.get(i):j[i]):null
-})},filter:function(p,o){if(typeof p!=="function"){throw new TypeError()}var j=this.get?this.get("length"):this.length;
-if(o===undefined){o=null}var k=[];var n=null;var l=h.Enumerator._popContext();for(var i=0;
-i<j;i++){var m=this.nextObject(i,n,l);if(p.call(o,m,i,this)){k.push(m)}n=m}n=null;
-l=h.Enumerator._pushContext(l);return k},sortProperty:function(j){var k=(typeof j===h.T_STRING)?arguments:j,i=k.length,l;
-if(this instanceof Array){l=this}else{l=[];this.forEach(function(m){l.push(m)})}if(!l){return[]
-}return l.sort(function(o,n){var m,q,s,r,p=0;for(m=0;p===0&&m<i;m++){q=k[m];s=o?(o.get?o.get(q):o[q]):null;
-r=n?(n.get?n.get(q):n[q]):null;p=h.compare(s,r)}return p})},filterProperty:function(r,n){var l=this.get?this.get("length"):this.length;
-var m=[];var q=null;var j=h.Enumerator._popContext();for(var o=0;o<l;o++){var k=this.nextObject(o,q,j);
-var p=k?(k.get?k.get(r):k[r]):null;var i=(n===undefined)?!!p:h.isEqual(p,n);if(i){m.push(k)
-}q=k}q=null;j=h.Enumerator._pushContext(j);return m},find:function(p,l){if(typeof p!=="function"){throw new TypeError()
-}var k=this.get?this.get("length"):this.length;if(l===undefined){l=null}var o=null,j,q=g,m=null;
-var i=h.Enumerator._popContext();for(var n=0;n<k&&!q;n++){j=this.nextObject(n,o,i);
-if(q=p.call(l,j,n,this)){m=j}o=j}j=o=null;i=h.Enumerator._pushContext(i);return m
-},findProperty:function(q,n){var k=this.get?this.get("length"):this.length;var r=g,l=null,p=null,j,o;
-var i=h.Enumerator._popContext();for(var m=0;m<k&&!r;m++){j=this.nextObject(m,p,i);
-o=j?(j.get?j.get(q):j[q]):null;r=(n===undefined)?!!o:h.isEqual(o,n);if(r){l=j}p=j
-}p=j=null;i=h.Enumerator._pushContext(i);return l},every:function(p,o){if(typeof p!=="function"){throw new TypeError()
-}var j=this.get?this.get("length"):this.length;if(o===undefined){o=null}var k=e;var n=null;
-var l=h.Enumerator._popContext();for(var i=0;k&&(i<j);i++){var m=this.nextObject(i,n,l);
-if(!p.call(o,m,i,this)){k=g}n=m}n=null;l=h.Enumerator._pushContext(l);return k},everyProperty:function(q,m){var k=this.get?this.get("length"):this.length;
-var l=e;var p=null;var i=h.Enumerator._popContext();for(var n=0;l&&(n<k);n++){var j=this.nextObject(n,p,i);
-var o=j?(j.get?j.get(q):j[q]):null;l=(m===undefined)?!!o:h.isEqual(o,m);p=j}p=null;
-i=h.Enumerator._pushContext(i);return l},some:function(p,o){if(typeof p!=="function"){throw new TypeError()
-}var j=this.get?this.get("length"):this.length;if(o===undefined){o=null}var k=g;var n=null;
-var l=h.Enumerator._popContext();for(var i=0;(!k)&&(i<j);i++){var m=this.nextObject(i,n,l);
-if(p.call(o,m,i,this)){k=e}n=m}n=null;l=h.Enumerator._pushContext(l);return k},someProperty:function(q,m){var k=this.get?this.get("length"):this.length;
-var l=g;var p=null;var i=h.Enumerator._popContext();for(var n=0;!l&&(n<k);n++){var j=this.nextObject(n,p,i);
-var o=j?(j.get?j.get(q):j[q]):null;l=(m===undefined)?!!o:h.isEqual(o,m);p=j}p=null;
-i=h.Enumerator._pushContext(i);return l},reduce:function(o,p,q){if(typeof o!=="function"){throw new TypeError()
-}var k=this.get?this.get("length"):this.length;if(k===0&&p===undefined){throw new TypeError()
-}var l=p;var n=null;var i=h.Enumerator._popContext();for(var m=0;m<k;m++){var j=this.nextObject(m,n,i);
-if(j!==null){if(l===undefined){l=j}else{l=o.call(null,l,j,m,this,q)}}n=j}n=null;i=h.Enumerator._pushContext(i);
-if(l===undefined){throw new TypeError()}return l},invoke:function(p){var m=this.get?this.get("length"):this.length;
-if(m<=0){return[]}var q;var o=[];var k=arguments.length;if(k>1){for(q=1;q<k;q++){o.push(arguments[q])
-}}var n=[];var r=null;var j=h.Enumerator._popContext();for(q=0;q<m;q++){var l=this.nextObject(q,r,j);
-var i=l?l[p]:null;if(i){n[q]=i.apply(l,o)}r=l}r=null;j=h.Enumerator._pushContext(j);
-return n},invokeWhile:function(l,q){var n=this.get?this.get("length"):this.length;
-if(n<=0){return null}var r;var p=[];var k=arguments.length;if(k>2){for(r=2;r<k;r++){p.push(arguments[r])
-}}var o=l;var s=null;var j=h.Enumerator._popContext();for(r=0;(o===l)&&(r<n);r++){var m=this.nextObject(r,s,j);
-var i=m?m[q]:null;if(i){o=i.apply(m,p)}s=m}s=null;j=h.Enumerator._pushContext(j);
-return o},toArray:function(){var i=[];this.forEach(function(j){i.push(j)},this);return i
-}};h._buildReducerFor=function(i,j){return function(l,m){var n=this[i];if(h.typeOf(n)!==h.T_FUNCTION){return this.unknownProperty?this.unknownProperty(l,m):null
-}else{var k=h.Enumerable.reduce.call(this,n,null,j);return k}}.property("[]")};h.Reducers={"[]":function(i,j){return this
-}.property(),enumerableContentDidChange:function(j,i){this.notifyPropertyChange("[]");
-return this},reducedProperty:function(r,o,n){if(!r||r.charAt(0)!=="@"){return undefined
-}var l=r.match(/^@([^(]*)(\(([^)]*)\))?$/);if(!l||l.length<2){return undefined}var q=l[1];
-var s=l[3];q="reduce"+q.slice(0,1).toUpperCase()+q.slice(1);var i=this[q];if(h.typeOf(i)!==h.T_FUNCTION){return undefined
-}if(n===g){return h.Enumerable.reduce.call(this,i,null,s)}var k=h._buildReducerFor(q,s);
-var j=this.constructor.prototype;if(j){j[r]=k;var m=j._properties||[];m.push(r);j._properties=m;
-this.registerDependentKey(r,"[]")}return h.Enumerable.reduce.call(this,i,null,s)},reduceMax:function(i,l,j,m,k){if(k&&l){l=l.get?l.get(k):l[k]
-}if(i===null){return l}return(l>i)?l:i},reduceMaxObject:function(j,m,k,n,l){var i=j,o=m;
-if(l){if(m){o=m.get?m.get(l):m[l]}if(j){i=j.get?j.get(l):j[l]}}if(i===null){return m
-}return(o>i)?m:j},reduceMin:function(i,l,j,m,k){if(k&&l){l=l.get?l.get(k):l[k]}if(i===null){return l
-}return(l<i)?l:i},reduceMinObject:function(j,m,k,n,l){var i=j,o=m;if(l){if(m){o=m.get?m.get(l):m[l]
-}if(j){i=j.get?j.get(l):j[l]}}if(i===null){return m}return(o<i)?m:j},reduceAverage:function(j,n,l,o,m){if(m&&n){n=n.get?n.get(m):n[m]
-}var k=(j||0)+n;var i=o.get?o.get("length"):o.length;if(l>=i-1){k=k/i}return k},reduceSum:function(i,l,j,m,k){if(k&&l){l=l.get?l.get(k):l[k]
-}return(i===null)?l:i+l}};h.mixin(h.Enumerable,h.Reducers);h.mixin(Array.prototype,h.Reducers);
-Array.prototype.isEnumerable=e;(function(){var i={nextObject:h.Enumerable.nextObject,enumerator:h.Enumerable.enumerator,firstObject:h.Enumerable.firstObject,sortProperty:h.Enumerable.sortProperty,mapProperty:function(o){var m=this.length;
-var n=[];for(var l=0;l<m;l++){var p=this[l];n[l]=p?(p.get?p.get(o):p[o]):null}return n
-},filterProperty:function(p,r){var n=this.length;var o=[];for(var m=0;m<n;m++){var q=this[m];
-var s=q?(q.get?q.get(p):q[p]):null;var l=(r===undefined)?!!s:h.isEqual(s,r);if(l){o.push(q)
-}}return o},find:function(r,q){if(typeof r!=="function"){throw new TypeError()}var m=this.length;
-if(q===undefined){q=null}var o,n=null,p=g;for(var l=0;l<m&&!p;l++){o=this[l];if(p=r.call(q,o,l,this)){n=o
-}}o=null;return n},findProperty:function(o,r){var m=this.length;var p,s,q=g,n=null;
-for(var l=0;l<m&&!q;l++){s=(p=this[l])?(p.get?p.get(o):p[o]):null;q=(r===undefined)?!!s:h.isEqual(s,r);
-if(q){n=p}}p=null;return n},everyProperty:function(o,q){var m=this.length;var n=e;
-for(var l=0;n&&(l<m);l++){var p=this[l];var r=p?(p.get?p.get(o):p[o]):null;n=(q===undefined)?!!r:h.isEqual(r,q)
-}return n},someProperty:function(o,q){var m=this.length;var n=g;for(var l=0;!n&&(l<m);
-l++){var p=this[l];var r=p?(p.get?p.get(o):p[o]):null;n=(q===undefined)?!!r:h.isEqual(r,q)
-}return n},invoke:function(n){var m=this.length;if(m<=0){return[]}var l;var p=[];
-var r=arguments.length;if(r>1){for(l=1;l<r;l++){p.push(arguments[l])}}var o=[];for(l=0;
-l<m;l++){var q=this[l];var s=q?q[n]:null;if(s){o[l]=s.apply(q,p)}}return o},invokeWhile:function(n,s){var p=this.length;
-if(p<=0){return null}var t;var r=[];var m=arguments.length;if(m>2){for(t=2;t<m;t++){r.push(arguments[t])
-}}var q=n;for(t=0;(q===n)&&(t<p);t++){var o=this[t];var l=o?o[s]:null;if(l){q=l.apply(o,r)
-}}return q},toArray:function(){var m=this.length;if(m<=0){return[]}var n=[];for(var l=0;
-l<m;l++){var o=this[l];n.push(o)}return n},getEach:function(o){var n=[];var m=this.length;
-for(var l=0;l<m;l++){var p=this[l];n[l]=p?(p.get?p.get(o):p[o]):null}return n},setEach:function(n,o){var m=this.length;
-for(var l=0;l<m;l++){var p=this[l];if(p){if(p.set){p.set(n,o)}else{p[n]=o}}}return this
-}};var k={forEach:function(p,o){if(typeof p!=="function"){throw new TypeError()}var m=this.length;
-if(o===undefined){o=null}for(var l=0;l<m;l++){var n=this[l];p.call(o,n,l,this)}return this
-},map:function(q,p){if(typeof q!=="function"){throw new TypeError()}var m=this.length;
-if(p===undefined){p=null}var n=[];for(var l=0;l<m;l++){var o=this[l];n[l]=q.call(p,o,l,this)
-}return n},filter:function(q,p){if(typeof q!=="function"){throw new TypeError()}var m=this.length;
-if(p===undefined){p=null}var n=[];for(var l=0;l<m;l++){var o=this[l];if(q.call(p,o,l,this)){n.push(o)
-}}return n},every:function(q,p){if(typeof q!=="function"){throw new TypeError()}var m=this.length;
-if(p===undefined){p=null}var n=e;for(var l=0;n&&(l<m);l++){var o=this[l];if(!q.call(p,o,l,this)){n=g
-}}return n},some:function(q,p){if(typeof q!=="function"){throw new TypeError()}var m=this.length;
-if(p===undefined){p=null}var n=g;for(var l=0;(!n)&&(l<m);l++){var o=this[l];if(q.call(p,o,l,this)){n=e
-}}return n},reduce:function(r,n,q){if(typeof r!=="function"){throw new TypeError()
-}var m=this.length;if(m===0&&n===undefined){throw new TypeError()}var o=n;for(var l=0;
-l<m;l++){var p=this[l];if(p!==null){if(o===undefined){o=p}else{o=r.call(null,o,p,l,this,q)
-}}}if(o===undefined){throw new TypeError()}return o}};for(var j in k){if(!k.hasOwnProperty(j)){continue
-}if(!Array.prototype[j]||((typeof Prototype==="object")&&Prototype.Version.match(/^1\.6/))){Array.prototype[j]=k[j]
-}}h.mixin(Array.prototype,i)})()});tiki.module("sproutcore/runtime:mixins/freezable",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-"import core";"export package";h.FROZEN_ERROR=new Error("Cannot modify a frozen object");
-h.Freezable={isFreezable:e,isFrozen:g,freeze:function(){if(this.set){this.set("isFrozen",e)
-}else{this.isFrozen=e}return this}};h.mixin(Array.prototype,h.Freezable)});tiki.module("sproutcore/runtime:mixins/observable",function(d,e,b){var a=d("sproutcore/runtime:core"),c=a.SC,j=a.SproutCore,i=a.YES,f=a.NO;
-d("sproutcore/runtime:private/observer_set");d("sproutcore/runtime:private/chain_observer");
-"import core";"import private/observer_set";"import private/chain_observer";"export package";
-var h=false;c.LOG_OBSERVERS=f;c.Observable={isObservable:i,automaticallyNotifiesObserversFor:function(k){return i
-},get:function(m){var l=this[m],k;if(l===undefined){return this.unknownProperty(m)
-}else{if(l&&l.isProperty){if(l.isCacheable){k=this._kvo_cache;if(!k){k=this._kvo_cache={}
-}return(k[l.cacheKey]!==undefined)?k[l.cacheKey]:(k[l.cacheKey]=l.call(this,m))}else{return l.call(this,m)
-}}else{return l}}},set:function(r,p){var l=this[r],s=this.automaticallyNotifiesObserversFor(r),o=p,m,k,q,n;
-if(this._kvo_cacheable&&(k=this._kvo_cache)){m=this._kvo_cachedep;if(!m||(m=m[r])===undefined){m=this._kvo_computeCachedDependentsFor(r)
-}if(m){q=m.length;while(--q>=0){n=m[q];k[n.cacheKey]=k[n.lastSetValueKey]=undefined
-}}}if(l&&l.isProperty){k=this._kvo_cache;if(l.isVolatile||!k||(k[l.lastSetValueKey]!==p)){if(!k){k=this._kvo_cache={}
-}k[l.lastSetValueKey]=p;if(s){this.propertyWillChange(r)}o=l.call(this,r,p);if(l.isCacheable){k[l.cacheKey]=o
-}if(s){this.propertyDidChange(r,o,i)}}}else{if(l===undefined){if(s){this.propertyWillChange(r)
-}this.unknownProperty(r,p);if(s){this.propertyDidChange(r,o)}}else{if(this[r]!==p){if(s){this.propertyWillChange(r)
-}o=this[r]=p;if(s){this.propertyDidChange(r,o)}}}}return this},unknownProperty:function(k,l){if(!(l===undefined)){this[k]=l
-}return l},beginPropertyChanges:function(){this._kvo_changeLevel=(this._kvo_changeLevel||0)+1;
-return this},endPropertyChanges:function(){this._kvo_changeLevel=(this._kvo_changeLevel||1)-1;
-var l=this._kvo_changeLevel,k=this._kvo_changes;if((l<=0)&&k&&(k.length>0)&&!c.Observers.isObservingSuspended){this._notifyPropertyObservers()
-}return this},propertyWillChange:function(k){return this},propertyDidChange:function(v,t,m){this._kvo_revision=(this._kvo_revision||0)+1;
-var l=this._kvo_changeLevel||0,q,u,r,k,n,p=c.LOG_OBSERVERS&&!(this.LOG_OBSERVING===f);
-if(this._kvo_cacheable&&(k=this._kvo_cache)){if(!m){n=this[v];if(n&&n.isProperty){k[n.cacheKey]=k[n.lastSetValueKey]=undefined
-}}q=this._kvo_cachedep;if(!q||(q=q[v])===undefined){q=this._kvo_computeCachedDependentsFor(v)
-}if(q){u=q.length;while(--u>=0){r=q[u];k[r.cacheKey]=k[r.lastSetValueKey]=undefined
-}}}var o=c.Observers.isObservingSuspended;if((l>0)||o){var s=this._kvo_changes;if(!s){s=this._kvo_changes=c.CoreSet.create()
-}s.add(v);if(o){if(p){console.log("%@%@: will not notify observers because observing is suspended".fmt(c.KVO_SPACES,this))
-}c.Observers.objectHasPendingChanges(this)}}else{this._notifyPropertyObservers(v)
-}return this},registerDependentKey:function(r,m){var o=this._kvo_dependents,l=this[r],s,q,k,p,n;
-if(c.typeOf(m)===c.T_ARRAY){s=m;k=0}else{s=arguments;k=1}q=s.length;if(!o){this._kvo_dependents=o={}
-}while(--q>=k){p=s[q];n=o[p];if(!n){n=o[p]=[]}n.push(r)}},_kvo_addCachedDependents:function(l,p,r,m){var k=p.length,o,n,q;
-while(--k>=0){n=p[k];m.add(n);o=this[n];if(o&&(o instanceof Function)&&o.isProperty){if(o.isCacheable){l.push(o)
-}if((q=r[n])&&q.length>0){this._kvo_addCachedDependents(l,q,r,m)}}}},_kvo_computeCachedDependentsFor:function(m){var n=this._kvo_cachedep,p=this._kvo_dependents,o=p?p[m]:null,k,l;
-if(!n){n=this._kvo_cachedep={}}if(!o||o.length===0){return n[m]=null}k=n[m]=[];l=c._TMP_SEEN_SET=(c._TMP_SEEN_SET||c.CoreSet.create());
-l.add(m);this._kvo_addCachedDependents(k,o,p,l);l.clear();if(k.length===0){k=n[m]=null
-}return k},_kvo_for:function(m,l){var k=this[m];if(!this._kvo_cloned){this._kvo_cloned={}
-}if(!k){k=this[m]=(l===undefined)?[]:l.create();this._kvo_cloned[m]=i}else{if(!this._kvo_cloned[m]){k=this[m]=k.copy();
-this._kvo_cloned[m]=i}}return k},addObserver:function(m,p,r,l){var n,k,o,q;if(r===undefined){r=p;
-p=this}if(!p){p=this}if(c.typeOf(r)===c.T_STRING){r=p[r]}if(!r){throw"You must pass a method to addObserver()"
-}m=m.toString();if(m.indexOf(".")>=0){k=c._ChainObserver.createChain(this,m,p,r,l);
-k.masterTarget=p;k.masterMethod=r;this._kvo_for(c.keyFor("_kvo_chains",m)).push(k)
-}else{if((this[m]===undefined)&&(m.indexOf("@")===0)){this.get(m)}if(p===this){p=null
-}n=c.keyFor("_kvo_observers",m);this._kvo_for(n,c.ObserverSet).add(p,r,l);this._kvo_for("_kvo_observed_keys",c.CoreSet).add(m)
-}if(this.didAddObserver){this.didAddObserver(m,p,r)}return this},removeObserver:function(m,p,r){var n,o,l,q,k;
-if(r===undefined){r=p;p=this}if(!p){p=this}if(c.typeOf(r)===c.T_STRING){r=p[r]}if(!r){throw"You must pass a method to addObserver()"
-}m=m.toString();if(m.indexOf(".")>=0){n=c.keyFor("_kvo_chains",m);if(o=this[n]){o=this._kvo_for(n);
-k=o.length;while(--k>=0){l=o[k];if(l&&(l.masterTarget===p)&&(l.masterMethod===r)){o[k]=l.destroyChain()
-}}}}else{if(p===this){p=null}n=c.keyFor("_kvo_observers",m);if(q=this[n]){q=this._kvo_for(n);
-q.remove(p,r);if(q.targets<=0){this._kvo_for("_kvo_observed_keys",c.CoreSet).remove(m)
-}}}if(this.didRemoveObserver){this.didRemoveObserver(m,p,r)}return this},hasObserverFor:function(l){c.Observers.flush(this);
-var n=this[c.keyFor("_kvo_observers",l)],m=this[c.keyFor("_kvo_local",l)],k;if(m&&m.length>0){return i
-}if(n&&n.getMembers().length>0){return i}return f},initObservable:function(){if(this._observableInited){return
-}this._observableInited=i;if(!h){h=i;d("sproutcore/runtime:system/binding");d("sproutcore/runtime:private/observer_queue")
-}var o,v,t,s,q,n,u;if(v=this._observers){var p=v.length;for(o=0;o<p;o++){t=v[o];q=this[t];
-n=q.propertyPaths;u=(n)?n.length:0;for(var l=0;l<u;l++){var w=n[l];var k=w.indexOf(".");
-if(k<0){this.addObserver(w,this,q)}else{if(w.indexOf("*")===0){this.addObserver(w.slice(1),this,q)
-}else{var r=null;if(k===0){r=this;w=w.slice(1)}else{if(k===4&&w.slice(0,5)==="this."){r=this;
-w=w.slice(5)}else{if(k<0&&w.length===4&&w==="this"){r=this;w=""}}}c.Observers.addObserver(w,this,q,r)
-}}}}}this.bindings=[];if(v=this._bindings){for(o=0;o<v.length;o++){t=v[o];s=this[t];
-var m=t.slice(0,-7);this[t]=this.bind(m,s)}}if(v=this._properties){for(o=0;o<v.length;
-o++){t=v[o];if(s=this[t]){if(s.isCacheable){this._kvo_cacheable=i}if(s.dependentKeys&&(s.dependentKeys.length>0)){this.registerDependentKey(t,s.dependentKeys)
-}}}}},observersForKey:function(k){var l=this._kvo_for("_kvo_observers",k);return l.getMembers()||[]
-},_notifyPropertyObservers:function(D){if(!this._observableInited){this.initObservable()
-}c.Observers.flush(this);var q=c.LOG_OBSERVERS&&!(this.LOG_OBSERVING===f);var y,B,w,n,x,v,A;
-var z,t,k,p,C,m,s,o;var l,r,u;if(q){r=c.KVO_SPACES=(c.KVO_SPACES||"")+"  ";console.log('%@%@: notifying observers after change to key "%@"'.fmt(r,this,D))
-}n=this["_kvo_observers_*"];this._kvo_changeLevel=(this._kvo_changeLevel||0)+1;while(((B=this._kvo_changes)&&(B.length>0))||D){A=++this.propertyRevision;
-if(!B){B=c.CoreSet.create()}this._kvo_changes=null;if(D==="*"){B.add("*");B.addEach(this._kvo_for("_kvo_observed_keys",c.CoreSet))
-}else{if(D){B.add(D)}}if(w=this._kvo_dependents){for(x=0;x<B.length;x++){D=B[x];v=w[D];
-if(v&&(s=v.length)){if(q){console.log("%@...including dependent keys for %@: %@".fmt(r,D,v))
-}u=this._kvo_cache;if(!u){u=this._kvo_cache={}}while(--s>=0){B.add(D=v[s]);if(o=this[D]){this[o.cacheKey]=undefined;
-u[o.cacheKey]=u[o.lastSetValueKey]=undefined}}}}}while(B.length>0){D=B.pop();y=this[c.keyFor("_kvo_observers",D)];
-if(y){z=y.getMembers();t=z.length;for(p=0;p<t;p++){k=z[p];if(k[3]===A){continue}C=k[0]||this;
-m=k[1];l=k[2];k[3]=A;if(q){console.log('%@...firing observer on %@ for key "%@"'.fmt(r,C,D))
-}if(l!==undefined){m.call(C,this,D,null,l,A)}else{m.call(C,this,D,null,A)}}}z=this[c.keyFor("_kvo_local",D)];
-if(z){t=z.length;for(p=0;p<t;p++){k=z[p];m=this[k];if(m){if(q){console.log('%@...firing local observer %@.%@ for key "%@"'.fmt(r,this,k,D))
-}m.call(this,this,D,null,A)}}}if(n&&D!=="*"){z=n.getMembers();t=z.length;for(p=0;
-p<t;p++){k=z[p];C=k[0]||this;m=k[1];l=k[2];if(q){console.log('%@...firing * observer on %@ for key "%@"'.fmt(r,C,D))
-}if(l!==undefined){m.call(C,this,D,null,l,A)}else{m.call(C,this,D,null,A)}}}if(this.propertyObserver){if(q){console.log('%@...firing %@.propertyObserver for key "%@"'.fmt(r,this,D))
-}this.propertyObserver(this,D,null,A)}}if(B){B.destroy()}D=null}this._kvo_changeLevel=(this._kvo_changeLevel||1)-1;
-if(q){c.KVO_SPACES=r.slice(0,-2)}return i},bind:function(k,m,o){var n;if(o!==undefined){m=[m,o]
-}var l=c.typeOf(m);if(l===c.T_STRING||l===c.T_ARRAY){n=this[k+"BindingDefault"]||c.Binding;
-n=n.beget().from(m)}else{n=m}n=n.to(k,this).connect();this.bindings.push(n);return n
-},didChangeFor:function(k){k=c.hashFor(k);var l=this._kvo_didChange_valueCache;if(!l){l=this._kvo_didChange_valueCache={}
-}var p=this._kvo_didChange_revisionCache;if(!p){p=this._kvo_didChange_revisionCache={}
-}var o=l[k]||{};var t=p[k]||{};var n=false;var m=this._kvo_revision||0;var r=arguments.length;
-while(--r>=1){var s=arguments[r];if(t[s]!=m){var q=this.get(s);if(o[s]!==q){n=true;
-o[s]=q}}t[s]=m}l[k]=o;p[k]=t;return n},setIfChanged:function(k,l){return(this.get(k)!==l)?this.set(k,l):this
-},getPath:function(l){var k=c.tupleForPropertyPath(l,this);if(k===null||k[0]===null){return undefined
-}return k[0].get(k[1])},setPath:function(m,l){if(m.indexOf(".")>=0){var k=c.tupleForPropertyPath(m,this);
-if(!k||!k[0]){return null}k[0].set(k[1],l)}else{this.set(m,l)}return this},setPathIfChanged:function(m,l){if(m.indexOf(".")>=0){var k=c.tupleForPropertyPath(m,this);
-if(!k||!k[0]){return null}if(k[0].get(k[1])!==l){k[0].set(k[1],l)}}else{this.setIfChanged(m,l)
-}return this},getEach:function(){var m=c.A(arguments);var l=[];for(var k=0;k<m.length;
-k++){l[l.length]=this.getPath(m[k])}return l},incrementProperty:function(k){this.set(k,(this.get(k)||0)+1);
-return this.get(k)},decrementProperty:function(k){this.set(k,(this.get(k)||0)-1);
-return this.get(k)},toggleProperty:function(k,l,m){if(l===undefined){l=true}if(m===undefined){m=false
-}l=(this.get(k)==l)?m:l;this.set(k,l);return this.get(k)},notifyPropertyChange:function(k,l){this.propertyWillChange(k);
-this.propertyDidChange(k,l);return this},allPropertiesDidChange:function(){this._kvo_cache=null;
-this._notifyPropertyObservers("*");return this},addProbe:function(k){this.addObserver(k,c.logChange)
-},removeProbe:function(k){this.removeObserver(k,c.logChange)},logProperty:function(){var l=c.$A(arguments);
-for(var k=0;k<l.length;k++){var m=l[k];console.log("%@:%@: ".fmt(c.guidFor(this),m),this.get(m))
-}},propertyRevision:1};c.logChange=function g(m,k,l){console.log("CHANGE: %@[%@] => %@".fmt(m,k,m.get(k)))
-};c.mixin(Array.prototype,c.Observable)});tiki.module("sproutcore/runtime:private/chain_observer",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-"import core";h._ChainObserver=function(i){this.property=i};h._ChainObserver.createChain=function(l,r,n,i,j){var k=r.split("."),p=new h._ChainObserver(k[0]),o=p,m=k.length;
-for(var q=1;q<m;q++){o=o.next=new h._ChainObserver(k[q])}p.objectDidChange(l);o.target=n;
-o.method=i;o.context=j;return p};h._ChainObserver.prototype={isChainObserver:true,object:null,property:null,next:null,target:null,method:null,objectDidChange:function(i){if(i===this.object){return
-}if(this.object&&this.object.removeObserver){this.object.removeObserver(this.property,this,this.propertyDidChange)
-}this.object=i;if(this.object&&this.object.addObserver){this.object.addObserver(this.property,this,this.propertyDidChange)
-}this.propertyDidChange()},propertyDidChange:function(){var j=this.object;var m=this.property;
-var l=(j&&j.get)?j.get(m):null;if(this.next){this.next.objectDidChange(l)}var n=this.target,o=this.method,k=this.context;
-if(n&&o){var i=j?j.propertyRevision:null;if(k){o.call(n,j,m,l,k,i)}else{o.call(n,j,m,l,i)
-}}},destroyChain:function(){var i=this.object;if(i&&i.removeObserver){i.removeObserver(this.property,this,this.propertyDidChange)
-}if(this.next){this.next.destroyChain()}this.next=this.target=this.method=this.object=this.context=null;
-return null}}});tiki.module("sproutcore/runtime:private/observer_queue",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:system/set");"import core";"import system/set";h.Observers={queue:[],addObserver:function(k,l,m,j){var i;
-if(h.typeOf(k)===h.T_STRING){i=h.tupleForPropertyPath(k,j)}else{i=k}if(i){i[0].addObserver(i[1],l,m)
-}else{this.queue.push([k,l,m,j])}},removeObserver:function(n,o,p,l){var k,j,i,m;i=h.tupleForPropertyPath(n,l);
-if(i){i[0].removeObserver(i[1],o,p)}k=this.queue.length;j=this.queue;while(--k>=0){m=j[k];
-if((m[0]===n)&&(m[1]===o)&&(m[2]==p)&&(m[3]===l)){j[k]=null}}},addPendingRangeObserver:function(i){var j=this.rangeObservers;
-if(!j){j=this.rangeObservers=h.CoreSet.create()}j.add(i);return this},_TMP_OUT:[],flush:function(i){var m=this.queue;
-if(m&&m.length>0){var p=(this.queue=[]);var q=m.length;while(--q>=0){var r=m[q];if(!r){continue
-}var n=h.tupleForPropertyPath(r[0],r[3]);if(n){n[0].addObserver(n[1],r[1],r[2])}else{p.push(r)
-}}}if(i._kvo_needsRangeObserver){var o=this.rangeObservers,l=o?o.get("length"):0,j=this._TMP_OUT,k;
-for(q=0;q<l;q++){k=o[q];if(k.setupPending(i)){j.push(k)}}if(j.length>0){o.removeEach(j)
-}j.length=0;i._kvo_needsRangeObserver=g}},isObservingSuspended:0,_pending:h.CoreSet.create(),objectHasPendingChanges:function(i){this._pending.add(i)
-},suspendPropertyObserving:function(){this.isObservingSuspended++},resumePropertyObserving:function(){var k;
-if(--this.isObservingSuspended<=0){k=this._pending;this._pending=h.CoreSet.create();
-var j,i=k.length;for(j=0;j<i;j++){k[j]._notifyPropertyObservers()}k.clear();k=null
-}}}});tiki.module("sproutcore/runtime:private/observer_set",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-"import core";h.ObserverSet={targets:0,_membersCacheIsValid:g,add:function(l,n,j){var k=(l)?h.guidFor(l):"__this__";
-var i=this[k];if(!i){i=this[k]=h.CoreSet.create();i.target=l;i.isTargetSet=e;this.targets++
-}i.add(n);if(j!==undefined){var m=i.contexts;if(!j){m={}}m[h.guidFor(n)]=j}this._membersCacheIsValid=g
-},remove:function(k,l){var j=(k)?h.guidFor(k):"__this__";var i=this[j];if(!i){return g
-}i.remove(l);if(i.length<=0){i.target=null;i.isTargetSet=g;i.contexts=null;delete this[j];
-this.targets--}else{if(i.contexts){delete i.contexts[h.guidFor(l)]}}this._membersCacheIsValid=g;
-return e},invokeMethods:function(){for(var j in this){if(!this.hasOwnProperty(j)){continue
-}var k=this[j];if(k&&k.isTargetSet){var i=k.length;var l=k.target;while(--i>=0){k[i].call(l)
-}}}},getMembers:function(){if(this._membersCacheIsValid){return this._members}if(!this._members){this._members=[]
-}else{this._members.length=0}var j=this._members;for(var k in this){if(!this.hasOwnProperty(k)){continue
-}var l=this[k];if(l&&l.isTargetSet){var i=l.length;var m=l.target;var o=l.contexts;
-if(o){while(--i>=0){var n=l[i];j.push([m,n,o[h.guidFor(n)]])}}else{while(--i>=0){j.push([m,l[i]])
-}}}}this._membersCacheIsValid=e;return j},clone:function(){var j,l,k,i=h.ObserverSet.create();
-for(k in this){if(!this.hasOwnProperty(k)){continue}j=this[k];if(j&&j.isTargetSet){l=j.clone();
-l.target=j.target;if(j.contexts){l.contexts=h.clone(j.contexts)}i[k]=l}}i.targets=this.targets;
-i._membersCacheIsValid=g;return i},create:function(){return h.beget(this)}};h.ObserverSet.slice=h.ObserverSet.clone
-});tiki.module("sproutcore/runtime:system/binding",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:system/set");"import core";"import system/set";"export package";
-h.LOG_BINDINGS=g;h.BENCHMARK_BINDING_NOTIFICATIONS=g;h.BENCHMARK_BINDING_SETUP=g;
-h.MULTIPLE_PLACEHOLDER="@@MULT@@";h.NULL_PLACEHOLDER="@@NULL@@";h.EMPTY_PLACEHOLDER="@@EMPTY@@";
-h.Binding={beget:function(j){var i=h.beget(this);i.parentBinding=this;if(j!==undefined){i=i.from(j)
-}return i},builder:function(){var j=this;var i=function(k){return j.beget().from(k)
-};i.beget=function(){return j.beget()};return i},from:function(j,i){if(!j){return this
-}var k=(this===h.Binding)?this.beget():this;k._fromPropertyPath=j;k._fromRoot=i;k._fromTuple=null;
-return k},to:function(j,i){var k=(this===h.Binding)?this.beget():this;k._toPropertyPath=j;
-k._toRoot=i;k._toTuple=null;return k},connect:function(){if(this.isConnected){return this
-}this.isConnected=e;this._connectionPending=e;this._syncOnConnect=e;h.Binding._connectQueue.add(this);
-return this},_connect:function(){if(!this._connectionPending){return}this._connectionPending=g;
-var k,i;var j=h.BENCHMARK_BINDING_SETUP;if(j){h.Benchmark.start("SC.Binding.connect()")
-}k=this._fromPropertyPath;i=this._fromRoot;if(h.typeOf(k)===h.T_STRING){if(k.indexOf(".")===0){k=k.slice(1);
-if(!i){i=this._toRoot}}else{if(k.indexOf("*")===0){k=[this._fromRoot||this._toRoot,k.slice(1)];
-i=null}}}h.Observers.addObserver(k,this,this.fromPropertyDidChange,i);if(!this._oneWay){k=this._toPropertyPath;
-i=this._toRoot;h.Observers.addObserver(k,this,this.toPropertyDidChange,i)}if(j){h.Benchmark.end("SC.Binding.connect()")
-}if(this._syncOnConnect){this._syncOnConnect=g;if(j){h.Benchmark.start("SC.Binding.connect().sync")
-}this.sync();if(j){h.Benchmark.end("SC.Binding.connect().sync")}}},disconnect:function(){if(!this.isConnected){return this
-}if(this._connectionPending){this._connectionPending=g}else{h.Observers.removeObserver(this._fromPropertyPath,this,this.fromPropertyDidChange,this._fromRoot);
-if(!this._oneWay){h.Observers.removeObserver(this._toPropertyPath,this,this.toPropertyDidChange,this._toRoot)
-}}this.isConnected=g;return this},fromPropertyDidChange:function(k,j){var i=k?k.get(j):null;
-if(i!==this._bindingValue){this._setBindingValue(k,j);this._changePending=e;h.Binding._changeQueue.add(this)
-}},toPropertyDidChange:function(k,j){if(this._oneWay){return}var i=k.get(j);if(i!==this._transformedBindingValue){this._setBindingValue(k,j);
-this._changePending=e;h.Binding._changeQueue.add(this)}},_setBindingValue:function(j,i){this._bindingSource=j;
-this._bindingKey=i},_computeBindingValue:function(){var o=this._bindingSource,m=this._bindingKey,k;
-if(!o){return}this._bindingValue=k=o.getPath(m);var n=this._transforms;if(n){var j=n.length;
-for(var i=0;i<j;i++){var l=n[i];k=l(k,this)}}if(this._noError&&h.typeOf(k)===h.T_ERROR){k=null
-}this._transformedBindingValue=k},_connectQueue:h.CoreSet.create(),_alternateConnectQueue:h.CoreSet.create(),_changeQueue:h.CoreSet.create(),_alternateChangeQueue:h.CoreSet.create(),_changePending:g,flushPendingChanges:function(){if(this._isFlushing){return g
-}this._isFlushing=e;h.Observers.suspendPropertyObserving();var j=g;var k=h.LOG_BINDINGS;
-var i,l;while((i=this._connectQueue).length>0){this._connectQueue=this._alternateConnectQueue;
-this._alternateConnectQueue=i;while(l=i.pop()){l._connect()}}while((i=this._changeQueue).length>0){if(k){console.log("Begin: Trigger changed bindings")
-}j=e;this._changeQueue=this._alternateChangeQueue;this._alternateChangeQueue=i;while(l=i.pop()){l.applyBindingValue()
-}if(k){console.log("End: Trigger changed bindings")}}this._isFlushing=g;h.Observers.resumePropertyObserving();
-return j},applyBindingValue:function(){this._changePending=g;this._computeBindingTargets();
-this._computeBindingValue();var i=this._bindingValue;var j=this._transformedBindingValue;
-var k=h.BENCHMARK_BINDING_NOTIFICATIONS;var l=h.LOG_BINDINGS;if(!this._oneWay&&this._fromTarget){if(l){console.log("%@: %@ -> %@".fmt(this,i,j))
-}if(k){h.Benchmark.start(this.toString()+"->")}this._fromTarget.setPathIfChanged(this._fromPropertyKey,i);
-if(k){h.Benchmark.end(this.toString()+"->")}}if(this._toTarget){if(l){console.log("%@: %@ <- %@".fmt(this,i,j))
-}if(k){h.Benchmark.start(this.toString()+"<-")}this._toTarget.setPathIfChanged(this._toPropertyKey,j);
-if(k){h.Benchmark.start(this.toString()+"<-")}}},sync:function(){if(!this.isConnected){return this
-}if(this._connectionPending){this._syncOnConnect=e}else{this._computeBindingTargets();
-var k=this._fromTarget;var j=this._fromPropertyKey;if(!k||!j){return this}var i=k.getPath(j);
-if(i!==this._bindingValue){this._setBindingValue(k,j);this._changePending=e;h.Binding._changeQueue.add(this)
-}}return this},_syncOnConnect:g,_computeBindingTargets:function(){if(!this._fromTarget){var k,j,i;
-k=this._fromPropertyPath;j=this._fromRoot;if(h.typeOf(k)===h.T_STRING){if(k.indexOf(".")===0){k=k.slice(1);
-if(!j){j=this._toRoot}}else{if(k.indexOf("*")===0){k=[j||this._toRoot,k.slice(1)];
-j=null}}}i=h.tupleForPropertyPath(k,j);if(i){this._fromTarget=i[0];this._fromPropertyKey=i[1]
-}}if(!this._toTarget){k=this._toPropertyPath;j=this._toRoot;i=h.tupleForPropertyPath(k,j);
-if(i){this._toTarget=i[0];this._toPropertyKey=i[1]}}},oneWay:function(k,i){if((i===undefined)&&(h.typeOf(k)===h.T_BOOL)){i=k;
-k=null}var j=this.from(k);if(j===h.Binding){j=j.beget()}j._oneWay=(i===undefined)?e:i;
-return j},transform:function(j){var k=(this===h.Binding)?this.beget():this;var i=k._transforms;
-if(i&&(i===k.parentBinding._transform)){i=k._transforms=i.slice()}if(!i){i=k._transforms=[]
-}i.push(j);return k},resetTransforms:function(){var i=(this===h.Binding)?this.beget():this;
-i._transforms=null;return i},noError:function(k,i){if((i===undefined)&&(h.typeOf(k)===h.T_BOOL)){i=k;
-k=null}var j=this.from(k);if(j===h.Binding){j=j.beget()}j._noError=(i===undefined)?e:i;
-return j},single:function(j,i){if(i===undefined){i=h.MULTIPLE_PLACEHOLDER}return this.from(j).transform(function(m,l){if(m&&m.isEnumerable){var k=m.get("length");
-m=(k>1)?i:(k<=0)?null:m.firstObject()}return m})},notEmpty:function(j,i){if(i===undefined){i=h.EMPTY_PLACEHOLDER
-}return this.from(j).transform(function(l,k){if(h.none(l)||(l==="")||(h.isArray(l)&&l.length===0)){l=i
-}return l})},notNull:function(j,i){if(i===undefined){i=h.EMPTY_PLACEHOLDER}return this.from(j).transform(function(l,k){if(h.none(l)){l=i
-}return l})},multiple:function(i){return this.from(i).transform(function(j){if(!h.isArray(j)){j=(j==null)?[]:[j]
-}return j})},bool:function(i){return this.from(i).transform(function(j){var k=h.typeOf(j);
-if(k===h.T_ERROR){return j}return(k==h.T_ARRAY)?(j.length>0):(j==="")?g:!!j})},not:function(i){return this.from(i).transform(function(j){var k=h.typeOf(j);
-if(k===h.T_ERROR){return j}return !((k==h.T_ARRAY)?(j.length>0):(j==="")?g:!!j)})
-},isNull:function(i){return this.from(i).transform(function(j){var k=h.typeOf(j);
-return(k===h.T_ERROR)?j:h.none(j)})},toString:function(){var k=this._fromRoot?"<%@>:%@".fmt(this._fromRoot,this._fromPropertyPath):this._fromPropertyPath;
-var j=this._toRoot?"<%@>:%@".fmt(this._toRoot,this._toPropertyPath):this._toPropertyPath;
-var i=this._oneWay?"[oneWay]":"";return"SC.Binding%@(%@ -> %@)%@".fmt(h.guidFor(this),k,j,i)
-}};h.binding=function(j,i){return h.Binding.from(j,i)}});tiki.module("sproutcore/runtime:system/cookie",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:system/object");"import core";"import system/object";"export package";
-h.Cookie=h.Object.extend({name:null,value:"",expires:null,path:null,domain:null,secure:g,isCookie:e,destroy:function(){this.set("expires",-1);
-this.write();arguments.callee.base.apply(this,arguments)},write:function(){var j=this.get("name"),q=this.get("value"),k=this.get("expires"),s=this.get("path"),m=this.get("domain"),i=this.get("secure");
-var p="";if(k&&(h.typeOf(k)===h.T_NUMBER||(h.DateTime&&k.get&&k.get("milliseconds"))||h.typeOf(k.toUTCString)===h.T_FUNCTION)){var l;
-if(h.typeOf(k)===h.T_NUMBER){l=new Date();l.setTime(l.getTime()+(k*24*60*60*1000))
-}else{if(h.DateTime&&k.get&&k.get("milliseconds")){l=new Date(k.get("milliseconds"))
-}else{if(h.typeOf(k.toUTCString)===h.T_FUNCTION){l=k}}}if(l){p="; expires="+l.toUTCString()
-}}var r=s?"; path="+s:"";var o=m?"; domain="+m:"";var n=i?"; secure":"";document.cookie=[j,"=",encodeURIComponent(q),p,r,o,n].join("");
-return this}});h.Cookie.mixin({find:function(j){if(document.cookie&&document.cookie!=""){var m=document.cookie.split(";");
-for(var l=0;l<m.length;l++){var k=String(m[l]).trim();if(k.substring(0,j.length+1)===(j+"=")){return h.Cookie.create({name:j,value:decodeURIComponent(k.substring(j.length+1))})
-}}}return null}})});tiki.module("sproutcore/runtime:system/enumerator",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-"import core";"export package";h.Enumerator=function(i){this.enumerable=i;this.reset();
-return this};h.Enumerator.prototype={nextObject:function(){var k=this._index;var i=this._length;
-if(k>=i){return undefined}var j=this.enumerable.nextObject(k,this._previousObject,this._context);
-this._previousObject=j;this._index=k+1;if(k>=i){this._context=h.Enumerator._pushContext(this._context)
-}return j},reset:function(){var j=this.enumerable;if(!j){throw h.$error("Enumerator has been destroyed")
-}this._length=j.get?j.get("length"):j.length;var i=this._length;this._index=0;this._previousObject=null;
-this._context=(i>0)?h.Enumerator._popContext():null},destroy:function(){this.enumerable=this._length=this._index=this._previousObject=this._context=null
-}};h.Enumerator.create=function(i){return new h.Enumerator(i)};h.Enumerator._popContext=function(){var i=this._contextCache?this._contextCache.pop():null;
-return i||{}};h.Enumerator._pushContext=function(j){this._contextCache=this._contextCache||[];
-var i=this._contextCache;i.push(j);return null}});tiki.module("sproutcore/runtime:system/error",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-"import core";"export package";h.Error=h.Object.extend({code:-1,message:"",errorValue:null,errorObject:function(){return this
-}.property().cacheable(),label:null,toString:function(){return"SC.Error:%@:%@ (%@)".fmt(h.guidFor(this),this.get("message"),this.get("code"))
-},isError:e});h.Error.desc=function(l,i,m,k){var j={message:l};if(i!==undefined){j.label=i
-}if(k!==undefined){j.code=k}if(m!==undefined){j.errorValue=m}return this.create(j)
-};h.$error=function(j,i,k,l){return h.Error.desc(j,i,k,l)};h.ok=function(i){return(i!==false)&&!(i&&i.isError)
-};h.$ok=h.ok;h.val=function(i){if(i&&i.isError){return i.get?i.get("errorValue"):null
-}else{return i}};h.$val=h.val;h.Error.HAS_MULTIPLE_VALUES=-100});tiki.module("sproutcore/runtime:system/index_set",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:mixins/enumerable");c("sproutcore/runtime:mixins/observable");
-c("sproutcore/runtime:mixins/freezable");c("sproutcore/runtime:mixins/copyable");
-"import core";"import mixins/enumerable";"import mixins/observable";"import mixins/freezable";
-"import mixins/copyable";"export package";h.IndexSet=h.mixin({},h.Enumerable,h.Observable,h.Freezable,h.Copyable,{_sc_sliceContent:function(l){if(l.length<1000){return l.slice()
-}var k=0,i=[],j=l[0];while(j!==0){i[k]=j;k=(j<0)?(0-j):j;j=l[k]}i[k]=0;this._hint(0,k,i);
-return i},create:function(k,j){var i=h.beget(this);i.initObservable();if(k&&k.isIndexSet){i._content=this._sc_sliceContent(k._content);
-i.max=k.max;i.length=k.length;i.source=k.source}else{i._content=[0];if(k!==undefined){i.add(k,j)
-}}return i},isIndexSet:e,HINT_SIZE:256,length:0,max:0,min:function(){var i=this._content,j=i[0];
-return(j===0)?-1:(j>0)?0:Math.abs(j)}.property("[]").cacheable(),firstObject:function(){return(this.get("length")>0)?this.get("min"):undefined
-}.property(),rangeStartForIndex:function(k){var n=this._content,i=this.get("max"),j,m,l;
-if(k>=i){return i}if(Math.abs(n[k])>k){return k}l=k-(k%h.IndexSet.HINT_SIZE);j=n[l];
-if(j<0||j>k){j=l}m=Math.abs(n[j]);while(m<k){j=m;m=Math.abs(n[j])}return j},isEqual:function(k){if(k===this){return e
-}if(!k||!k.isIndexSet||(k.max!==this.max)||(k.length!==this.length)){return g}var m=this._content,j=k._content,l=0,i=m[l];
-do{if(j[l]!==i){return g}l=Math.abs(i);i=m[l]}while(l!==0);return e},indexBefore:function(j){if(j===0){return -1
-}j--;var k=this._content,i=this.get("max"),l=this.rangeStartForIndex(j);if(!k){return null
-}while((l===i)||(k[l]<0)){if(l===0){return -1}j=l-1;l=this.rangeStartForIndex(j)}return j
-},indexAfter:function(j){var l=this._content,i=this.get("max"),m,k;if(!l||(j>=i)){return -1
-}j++;m=this.rangeStartForIndex(j);k=l[m];while(k<0){if(k===0){return -1}j=m=Math.abs(k);
-k=l[m]}return j},contains:function(o,k){var j,n,i,m,l;if(k===undefined){if(o===null||o===undefined){return g
-}if(typeof o===h.T_NUMBER){k=1}else{if(o&&o.isIndexSet){if(o===this){return e}j=o._content;
-n=0;i=j[n];while(i!==0){if((i>0)&&!this.contains(n,i-n)){return g}n=Math.abs(i);i=j[n]
-}return e}else{k=o.length;o=o.start}}}m=this.rangeStartForIndex(o);l=this._content[m];
-return(l>0)&&(m<=o)&&(l>=(o+k))},intersects:function(n,k){var j,m,i,l;if(k===undefined){if(typeof n===h.T_NUMBER){k=1
-}else{if(n&&n.isIndexSet){if(n===this){return e}j=n._content;m=0;i=j[m];while(i!==0){if((i>0)&&this.intersects(m,i-m)){return e
-}m=Math.abs(i);i=j[m]}return g}else{k=n.length;n=n.start}}}m=this.rangeStartForIndex(n);
-j=this._content;i=j[m];l=n+k;while(m<l){if(i===0){return g}if((i>0)&&(i>n)){return e
-}m=Math.abs(i);i=j[m]}return g},without:function(j,i){if(j===this){return h.IndexSet.create()
-}return this.clone().remove(j,i)},replace:function(k,i){if(i===undefined){if(typeof k===h.T_NUMBER){i=1
-}else{if(k&&k.isIndexSet){this._content=this._sc_sliceContent(k._content);this.beginPropertyChanges().set("max",k.max).set("length",k.length).set("source",k.source).enumerableContentDidChange().endPropertyChanges();
-return this}else{i=k.length;k=k.start}}}var j=this.length;this._content.length=1;
-this._content[0]=0;this.length=this.max=0;return this.add(k,i)},add:function(i,j){if(this.isFrozen){throw h.FROZEN_ERROR
-}var m,q,l;if(i&&i.isIndexSet){m=i._content;if(!m){return this}q=0;l=m[0];while(l!==0){if(l>0){this.add(q,l-q)
-}q=l<0?0-l:l;l=m[q]}return this}else{if(j===undefined){if(i===null||i===undefined){return this
-}else{if(typeof i===h.T_NUMBER){j=1}else{j=i.length;i=i.start}}}else{if(j===null){j=1
-}}}if(j<=0){return this}var n=this.get("max"),k=n,p,o;m=this._content;if(i===n){if(i>0){q=this.rangeStartForIndex(i-1);
-l=m[q];if(l>0){delete m[n];m[q]=n=i+j;i=q}else{m[n]=n=i+j}}else{m[i]=n=j}m[n]=0;this.set("max",n);
-this.set("length",this.length+j);j=n-i}else{if(i>n){m[n]=0-i;m[i]=i+j;m[i+j]=0;this.set("max",i+j);
-this.set("length",this.length+j);j=i+j-n;i=n}else{q=this.rangeStartForIndex(i);l=m[q];
-n=i+j;p=0;if((i>0)&&(q===i)&&(l<=0)){q=this.rangeStartForIndex(i-1);l=m[q]}if(l<0){m[q]=0-i;
-if(Math.abs(l)>n){m[i]=0-n;m[n]=l}else{m[i]=l}}else{i=q;if(l>n){n=l}}q=i;while(q<n){o=m[q];
-if(o===0){m[n]=0;l=n;p+=n-q}else{l=Math.abs(o);if(l>n){m[n]=o;l=n}if(o<0){p+=l-q}}delete m[q];
-q=l}if((q=m[n])>0){delete m[n];n=q}m[i]=n;if(n>k){this.set("max",n)}this.set("length",this.get("length")+p);
-j=n-i}}this._hint(i,j);if(p!==0){this.enumerableContentDidChange()}return this},remove:function(i,j){if(this.isFrozen){throw h.FROZEN_ERROR
-}if(j===undefined){if(i===null||i===undefined){return this}else{if(typeof i===h.T_NUMBER){j=1
-}else{if(i.isIndexSet){i.forEachRange(this.remove,this);return this}else{j=i.length;
-i=i.start}}}}if(j<=0){return this}var n=this.get("max"),k=n,m=this._content,r,l,q,o,p;
-if(i>=n){return this}r=this.rangeStartForIndex(i);l=m[r];p=i+j;q=0;if((i>0)&&(r===i)&&(l>0)){r=this.rangeStartForIndex(i-1);
-l=m[r]}if(l>0){m[r]=i;if(l>p){m[i]=p;m[p]=l}else{m[i]=l}}else{i=r;l=Math.abs(l);if(l>p){p=l
-}}r=i;while(r<p){o=m[r];if(o===0){m[p]=0;l=p}else{l=Math.abs(o);if(l>p){m[p]=o;l=p
-}if(o>0){q+=l-r}}delete m[r];r=l}if((r=m[p])<0){delete m[p];p=Math.abs(r)}if(m[p]===0){delete m[p];
-m[i]=0;this.set("max",i)}else{m[i]=0-p}this.set("length",this.get("length")-q);j=p-i;
-this._hint(i,j);if(q!==0){this.enumerableContentDidChange()}return this},_hint:function(o,l,k){if(k===undefined){k=this._content
-}var j=h.IndexSet.HINT_SIZE,i=Math.abs(k[o]),n=o-(o%j)+j,m=o+l;while(n<m){while((i!==0)&&(i<=n)){o=i;
-i=Math.abs(k[o])}if(i===0){delete k[n]}else{if(n!==o){k[n]=o}}n+=j}},clear:function(){if(this.isFrozen){throw h.FROZEN_ERROR
-}var i=this.length;this._content.length=1;this._content[0]=0;this.set("length",0).set("max",0);
-if(i>0){this.enumerableContentDidChange()}},addEach:function(j){if(this.isFrozen){throw h.FROZEN_ERROR
-}this.beginPropertyChanges();var i=j.get("length");if(j.isSCArray){while(--i>=0){this.add(j.objectAt(i))
-}}else{if(j.isEnumerable){j.forEach(function(k){this.add(k)},this)}}this.endPropertyChanges();
-return this},removeEach:function(j){if(this.isFrozen){throw h.FROZEN_ERROR}this.beginPropertyChanges();
-var i=j.get("length");if(j.isSCArray){while(--i>=0){this.remove(j.objectAt(i))}}else{if(j.isEnumerable){j.forEach(function(k){this.remove(k)
-},this)}}this.endPropertyChanges();return this},clone:function(){return h.IndexSet.create(this)
-},inspect:function(){var m=this._content,j=m.length,i=0,k=[],l;for(i=0;i<j;i++){l=m[i];
-if(l!==undefined){k.push("%@:%@".fmt(i,l))}}return"SC.IndexSet<%@>".fmt(k.join(" , "))
-},forEachRange:function(n,l){var j=this._content,m=0,i=j[m],k=this.source;if(l===undefined){l=null
-}while(i!==0){if(i>0){n.call(l,m,i-m,this,k)}m=Math.abs(i);i=j[m]}return this},forEachIn:function(j,k,r,n){var o=this._content,q=0,p=0,l=j+k,i=this.source,m=o[q];
-if(n===undefined){n=null}while(m!==0){if(q<j){q=j}while((q<m)&&(q<l)){r.call(n,q++,p++,this,i)
-}if(q>=l){q=m=0}else{q=Math.abs(m);m=o[q]}}return this},lengthIn:function(o,l){var i=0;
-if(l===undefined){if(o===null||o===undefined){return 0}else{if(typeof o===h.T_NUMBER){l=1
-}else{if(o.isIndexSet){o.forEachRange(function(q,p){i+=this.lengthIn(q,p)},this);
-return i}else{l=o.length;o=o.start}}}}if(this.get("length")===0){return 0}var k=this._content,n=0,j=k[n],m=o+l;
-while(n<m&&j!==0){if(j>0){i+=(j>m)?m-n:j-n}n=Math.abs(j);j=k[n]}return i},source:null,indexOf:function(l,k){var n=this.source;
-if(!n){throw"%@.indexOf() requires source".fmt(this)}var j=n.get("length"),m=this._content,o=m[0]<0?Math.abs(m[0]):0,i;
-while(o>=0&&o<j){i=n.indexOf(l,o);if(i<0){return -1}if(this.contains(i)){return i
-}o=i+1}return -1},lastIndexOf:function(l,k){var m=this.source;if(!m){throw"%@.lastIndexOf() requires source".fmt(this)
-}var j=m.get("length"),n=this.max-1,i;if(n>=j){n=j-1}while(n>=0){i=m.lastIndexOf(l,n);
-if(i<0){return -1}if(this.contains(i)){return i}n=i+1}return -1},forEachObject:function(o,m){var l=this.source;
-if(!l){throw"%@.forEachObject() requires source".fmt(this)}var k=this._content,n=0,i=0,j=k[n];
-if(m===undefined){m=null}while(j!==0){while(n<j){o.call(m,l.objectAt(n),n,l,this);
-n++}n=Math.abs(j);j=k[n]}return this},addObject:function(k,l){var m=this.source;if(!m){throw"%@.addObject() requires source".fmt(this)
-}var j=m.get("length"),n=0,i;while(n>=0&&n<j){i=m.indexOf(k,n);if(i>=0){this.add(i);
-if(l){return this}n=i++}else{return this}}return this},addObjects:function(j,i){j.forEach(function(k){this.addObject(k,i)
-},this);return this},removeObject:function(k,l){var m=this.source;if(!m){throw"%@.removeObject() requires source".fmt(this)
-}var j=m.get("length"),n=0,i;while(n>=0&&n<j){i=m.indexOf(k,n);if(i>=0){this.remove(i);
-if(l){return this}n=i+1}else{return this}}return this},removeObjects:function(j,i){j.forEach(function(k){this.removeObject(k,i)
-},this);return this},LOG_OBSERVING:g,forEach:function(o,m){var k=this._content,n=0,i=0,l=this.source,j=k[n];
-if(m===undefined){m=null}while(j!==0){while(n<j){o.call(m,n++,i++,this,l)}n=Math.abs(j);
-j=k[n]}return this},nextObject:function(n,j,k){var m=this._content,l=k.next,i=this.get("max");
-if(j===null){j=l=0}else{if(j>=i){delete k.next;return null}else{j++}}if(j===l){do{j=Math.abs(l);
-l=m[j]}while(l<0);k.next=l}return j},toString:function(){var i=[];this.forEachRange(function(k,j){i.push(j===1?k:"%@..%@".fmt(k,k+j-1))
-},this);return"SC.IndexSet<%@>".fmt(i.join(","))},max:0});h.IndexSet.slice=h.IndexSet.copy=h.IndexSet.clone;
-h.IndexSet.EMPTY=h.IndexSet.create().freeze()});tiki.module("sproutcore/runtime:system/logger",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:system/object");"import core";"import system/object";"export package";
-h.LOGGER_LOG_DELIMITER=", ";h.LOGGER_LOG_ERROR="ERROR: ";h.LOGGER_LOG_INFO="INFO: ";
-h.LOGGER_LOG_WARN="WARNING: ";h.Logger=h.Object.create({exists:function(){return typeof(this.get("reporter"))!=="undefined"&&this.get("reporter")!=null
-}.property("reporter").cacheable(),fallBackOnAlert:g,fallBackOnLog:e,format:e,reporter:console,log:function(){var i=this.get("reporter");
-if(this.get("exists")&&typeof(i.log)==="function"){if(this.get("format")){i.log(this._argumentsToString.apply(this,arguments))
-}else{i.log.apply(i,arguments)}return true}else{if(this.fallBackOnAlert){var j=this.get("format")?this._argumentsToString.apply(this,arguments):arguments;
-if(this.get("exists")&&typeof(i.alert)==="function"){i.alert(j)}else{alert(j)}return true
-}}return false},dir:function(){var i=this.get("reporter");if(this.get("exists")&&typeof(i.dir)==="function"){i.dir.apply(i,arguments);
-return true}return(this.fallBackOnLog)?this.log.apply(this,arguments):false},dirxml:function(){var i=this.get("reporter");
-if(this.get("exists")&&typeof(i.dirxml)==="function"){i.dirxml.apply(i,arguments);
-return true}return(this.fallBackOnLog)?this.log.apply(this,arguments):false},error:function(){var j=this.get("reporter");
-if(this.get("exists")&&typeof(j.error)==="function"){j.error.apply(j,arguments);return true
-}else{if(this.fallBackOnLog){var i=this._argumentsToArray(arguments);if(typeof(i.unshift)==="function"){i.unshift(h.LOGGER_LOG_ERROR)
-}return this.log.apply(this,i)}}return false},group:function(j){var i=this.get("reporter");
-if(this.get("exists")&&typeof(i.group)==="function"){i.group(j);return true}return false
-},groupEnd:function(){var i=this.get("reporter");if(this.get("exists")&&typeof(i.groupEnd)==="function"){i.groupEnd();
-return true}return false},info:function(){var j=this.get("reporter");if(this.get("exists")&&typeof(j.info)==="function"){j.info.apply(j,arguments);
-return true}else{if(this.fallBackOnLog){var i=this._argumentsToArray(arguments);if(typeof(i.unshift)==="function"){i.unshift(h.LOGGER_LOG_INFO)
-}return this.log.apply(this,i)}}return false},profile:function(){var i=this.get("reporter");
-if(this.get("exists")&&typeof(i.profile)==="function"){i.profile();return true}return false
-},profileEnd:function(){var i=this.get("reporter");if(this.get("exists")&&typeof(i.profileEnd)==="function"){i.profileEnd();
-return true}return false},time:function(j){var i=this.get("reporter");if(this.get("exists")&&typeof(i.time)==="function"){i.time(j);
-return true}return false},timeEnd:function(j){var i=this.get("reporter");if(this.get("exists")&&typeof(i.timeEnd)==="function"){i.timeEnd(j);
-return true}return false},trace:function(){var i=this.get("reporter");if(this.get("exists")&&typeof(i.trace)==="function"){i.trace();
-return true}return false},warn:function(){var j=this.get("reporter");if(this.get("exists")&&typeof(j.warn)==="function"){j.warn.apply(j,arguments);
-return true}else{if(this.fallBackOnLog){var i=this._argumentsToArray(arguments);if(typeof(i.unshift)==="function"){i.unshift(h.LOGGER_LOG_WARN)
-}return this.log.apply(this,i)}}return false},_argumentsToArray:function(l){if(!l){return[]
-}var j=[];for(var k=0;k<l.length;k++){j[k]=l[k]}return j},_argumentsToString:function(){var k="";
-for(var j=0;j<arguments.length-1;j++){k+=arguments[j]+h.LOGGER_LOG_DELIMITER}k+=arguments[arguments.length-1];
-return k}})});tiki.module("sproutcore/runtime:system/object",function(f,g,b){var a=f("sproutcore/runtime:core"),d=a.SC,j=a.SproutCore,i=a.YES,h=a.NO;
-f("sproutcore/runtime:mixins/observable");f("sproutcore/runtime:system/set");"import core";
-"import mixins/observable";"import system/set";"export package";d.BENCHMARK_OBJECTS=h;
-d._object_extend=function c(q,p){if(!p){throw"SC.Object.extend expects a non-null value.  Did you forget to 'sc_require' something?  Or were you passing a Protocol to extend() as if it were a mixin?"
-}q._kvo_cloned=null;var G,w,C,o,r=q.concatenatedProperties,u=d.K;var m,l;w=(r)?r.length:0;
-var k=(w>0)?{}:null;while(--w>=0){G=r[w];m=q[G];l=p[G];if(m){if(!(m instanceof Array)){m=d.$A(m)
-}k[G]=(l)?m.concat(l):l}else{if(!(l instanceof Array)){l=d.$A(l)}k[G]=l}}var F=q._bindings,v=h;
-var D=q._observers,E=h;var s=q._properties,n=h;var z,t,x;var B=q.outlets,A=h;if(p.outlets){B=(B||d.EMPTY_ARRAY).concat(p.outlets);
-A=i}for(G in p){if(G==="_kvo_cloned"){continue}if(!p.hasOwnProperty(G)){continue}var y=(k.hasOwnProperty(G)?k[G]:null)||p[G];
-if(G.slice(-7)==="Binding"){if(!v){F=(F||d.EMPTY_ARRAY).slice();v=i}if(F===null){F=(q._bindings||d.EMPTY_ARRAY).slice()
-}F[F.length]=G}else{if(y&&(y instanceof Function)){if(!y.superclass&&(y!==(o=q[G]))){y.superclass=y.base=o||u
-}if(y.propertyPaths){if(!E){D=(D||d.EMPTY_ARRAY).slice();E=i}D[D.length]=G}else{if(z=y.localPropertyPaths){t=z.length;
-while(--t>=0){x=q._kvo_for(d.keyFor("_kvo_local",z[t]),d.Set);x.add(G);q._kvo_for("_kvo_observed_keys",d.CoreSet).add(z[t])
-}}else{if(y.dependentKeys){if(!n){s=(s||d.EMPTY_ARRAY).slice();n=i}s[s.length]=G}else{if(y.autoconfiguredOutlet){if(!A){B=(B||d.EMPTY_ARRAY).slice();
-A=i}B[B.length]=G}}}}}}q[G]=y}if(p.hasOwnProperty("toString")){G="toString";y=(k.hasOwnProperty(G)?k[G]:null)||p[G];
-if(!y.superclass&&(y!==(o=q[G]))){y.superclass=y.base=o||u}q[G]=y}q._bindings=F||[];
-q._observers=D||[];q._properties=s||[];q.outlets=B||[];return q};d.Object=function(k){return this._object_init(k)
-};d.mixin(d.Object,{mixin:function(l){var k=arguments.length,m;for(m=0;m<k;m++){d.mixin(this,arguments[m])
-}return this},superclass:null,extend:function(o){var n=d.BENCHMARK_OBJECTS;if(n){d.Benchmark.start("SC.Object.extend")
-}var q,m=function(r){return this._object_init(r)};for(q in this){if(!this.hasOwnProperty(q)){continue
-}m[q]=this[q]}if(this.hasOwnProperty("toString")){m.toString=this.toString}m.superclass=this;
-d.generateGuid(m);m.subclasses=d.Set.create();this.subclasses.add(m);var p=(m.prototype=d.beget(this.prototype));
-var l,k=arguments.length;for(l=0;l<k;l++){d._object_extend(p,arguments[l])}p.constructor=m;
-if(n){d.Benchmark.end("SC.Object.extend")}return m},create:function(k){var l=this;
-return new l(arguments)},isClass:i,subclasses:d.Set.create(),toString:function(){return d._object_className(this)
-},subclassOf:function(l){if(this===l){return h}var k=this;while(k=k.superclass){if(k===l){return i
-}}return h},hasSubclass:function(k){return(k&&k.subclassOf)?k.subclassOf(this):h},kindOf:function(k){return(this===k)||this.subclassOf(k)
-}});d.Object.prototype={_kvo_enabled:i,_object_init:function(m){var l,k=(m)?m.length:0;
-for(l=0;l<k;l++){d._object_extend(this,m[l])}d.generateGuid(this);this.init();var n=this.initMixin;
-k=(n)?n.length:0;for(l=0;l<k;l++){n[l].call(this)}return this},mixin:function(){var l,k=arguments.length;
-for(l=0;l<k;l++){d.mixin(this,arguments[l])}for(l=0;l<k;l++){var m=arguments[l].initMixin;
-if(m){m.call(this)}}return this},init:function(){this.initObservable();return this
-},isDestroyed:h,destroy:function(){if(this.get("isDestroyed")){return this}this.set("isDestroyed",i);
-var l,m=this.destroyMixin,k=(m)?m.length:0;for(l=0;l<k;l++){m[l].call(this)}return this
-},isObject:true,respondsTo:function(k){return !!(d.typeOf(this[k])===d.T_FUNCTION)
-},tryToPerform:function(l,m,k){return this.respondsTo(l)&&(this[l](m,k)!==h)},superclass:function(l){var k=arguments.callee.caller;
-if(!k){throw"superclass cannot determine the caller method"}return k.superclass?k.superclass.apply(this,arguments):null
-},instanceOf:function(k){return this.constructor===k},kindOf:function(k){return this.constructor.kindOf(k)
-},toString:function(){if(!this._object_toString){var k=d._object_className(this.constructor);
-var l="%@:%@".fmt(k,d.guidFor(this));if(k){this._object_toString=l}else{return l}}return this._object_toString
-},awake:function(k){this.outlets.forEach(function(l){this.get(l)},this);this.bindings.invoke("sync")
-},invokeOnce:function(k){d.RunLoop.currentRunLoop.invokeOnce(this,k);return this},invokeLast:function(k){d.RunLoop.currentRunLoop.invokeLast(this,k);
-return this},concatenatedProperties:["concatenatedProperties","initMixin","destroyMixin"]};
-d.Object.prototype.constructor=d.Object;d.mixin(d.Object.prototype,d.Observable);
-function e(){if(d._object_foundObjectClassNames){return}d._object_foundObjectClassNames=true;
-var l=[];var k=function(m,n,q){q--;if(l.indexOf(n)>=0){return}l.push(n);for(var o in n){if(o=="__scope__"){continue
-}if(o=="superclass"){continue}if(!o.match(/^[A-Z0-9]/)){continue}var r=(m)?[m,o].join("."):o;
-var p=n[o];switch(d.typeOf(p)){case d.T_CLASS:if(!p._object_className){p._object_className=r
-}if(q>=0){k(r,p,q)}break;case d.T_OBJECT:if(q>=0){k(r,p,q)}break;case d.T_HASH:if(((m)||(r==="SC"))&&(q>=0)){k(r,p,q)
-}break;default:break}}};k(null,f("system:package").global,2)}d.instanceOf=function(k,l){return !!(k&&k.constructor===l)
-};d.kindOf=function(k,l){if(k&&!k.isClass){k=k.constructor}return !!(k&&k.kindOf(l))
-};d._object_className=function(l){if(!d.isReady){return""}if(!l._object_className){e()
-}if(l._object_className){return l._object_className}var k=l;while(k&&!k._object_className){k=k.superclass
-}return(k&&k._object_className)?k._object_className:"Anonymous"}});tiki.module("sproutcore/runtime:system/range_observer",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:private/observer_queue");c("sproutcore/runtime:system/index_set");
-"import core";"import private/observer_queue";"import system/index_set";"export package";
-h.RangeObserver={isRangeObserver:e,toString:function(){var i=this.indexes?this.indexes.toString():"SC.IndexSet<..>";
-return i.replace("IndexSet","RangeObserver(%@)".fmt(h.guidFor(this)))},create:function(l,n,m,o,k,i){var j=h.beget(this);
-j.source=l;j.indexes=n?n.frozenCopy():null;j.target=m;j.method=o;j.context=k;j.isDeep=i||g;
-j.beginObserving();return j},extend:function(m){var l=h.beget(this),k=arguments,j=k.length,i;
-for(i=0;i<j;i++){h.mixin(l,k[i])}return l},destroy:function(i){this.endObserving();
-return this},update:function(i,j){if(this.indexes&&this.indexes.isEqual(j)){return this
-}this.indexes=j?j.frozenCopy():null;this.endObserving().beginObserving();return this
-},beginObserving:function(){if(!this.isDeep){return this}var j=this.observing;if(!j){j=this.observing=h.CoreSet.create()
-}var i=this._beginObservingForEach;if(!i){i=this._beginObservingForEach=function(k){var l=this.source.objectAt(k);
-if(l&&l.addObserver){j.push(l);l._kvo_needsRangeObserver=e}}}this.indexes.forEach(i,this);
-this.isObserving=g;h.Observers.addPendingRangeObserver(this);return this},setupPending:function(i){var l=this.observing;
-if(this.isObserving||!l||(l.get("length")===0)){return e}if(l.contains(i)){this.isObserving=e;
-var j=this._setupPendingForEach;if(!j){var k=this.source,m=this.objectPropertyDidChange;
-j=this._setupPendingForEach=function(n){var q=this.source.objectAt(n),o=h.guidFor(q),p;
-if(q&&q.addObserver){l.push(q);q.addObserver("*",this,m);p=this[o];if(p===undefined||p===null){this[o]=n
-}else{if(p.isIndexSet){p.add(n)}else{p=this[o]=h.IndexSet.create(p).add(n)}}}}}this.indexes.forEach(j,this);
-return e}else{return g}},endObserving:function(){if(!this.isDeep){return this}var m=this.observing;
-if(this.isObserving){var j=this.objectPropertyDidChange,k=this.source,i,n,l;if(m){n=m.length;
-for(i=0;i<n;i++){l=m[i];l.removeObserver("*",this,j);this[h.guidFor(l)]=null}m.length=0
-}this.isObserving=g}if(m){m.clear()}return this},rangeDidChange:function(j){var i=this.indexes;
-if(!j||!i||i.intersects(j)){this.endObserving();this.method.call(this.target,this.source,null,"[]",j,this.context);
-this.beginObserving()}return this},objectPropertyDidChange:function(l,n,o,i){var m=this.context,p=this.method,k=h.guidFor(l),j=this[k];
-if(j&&!j.isIndexSet){j=this[k]=h.IndexSet.create(j).freeze()}if(m){p.call(this.target,this.source,l,n,j,m,i)
-}else{p.call(this.target,this.source,l,n,j,i)}}}});tiki.module("sproutcore/runtime:system/run_loop",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:private/observer_set");c("sproutcore/runtime:system/object");
-"import core";"import private/observer_set";"import system/object";"export package";
-h.RunLoop=h.Object.extend({beginRunLoop:function(){this._start=new Date().getTime();
-if(h.LOG_BINDINGS||h.LOG_OBSERVERS){console.log("-- SC.RunLoop.beginRunLoop at %@".fmt(this._start))
-}return this},endRunLoop:function(){var i;if(h.LOG_BINDINGS||h.LOG_OBSERVERS){console.log("-- SC.RunLoop.endRunLoop ~ flushing application queues")
-}do{i=this.flushApplicationQueues();if(!i){i=this._flushinvokeLastQueue()}}while(i);
-this._start=null;if(h.LOG_BINDINGS||h.LOG_OBSERVERS){console.log("-- SC.RunLoop.endRunLoop ~ End")
-}return this},invokeOnce:function(i,j){if(j===undefined){j=i;i=this}if(h.typeOf(j)===h.T_STRING){j=i[j]
-}if(!this._invokeQueue){this._invokeQueue=h.ObserverSet.create()}this._invokeQueue.add(i,j);
-return this},invokeLast:function(i,j){if(j===undefined){j=i;i=this}if(h.typeOf(j)===h.T_STRING){j=i[j]
-}if(!this._invokeLastQueue){this._invokeLastQueue=h.ObserverSet.create()}this._invokeLastQueue.add(i,j);
-return this},flushApplicationQueues:function(){var j=g;var i=this._invokeQueue;if(i&&i.targets>0){this._invokeQueue=null;
-j=e;i.invokeMethods()}return h.Binding.flushPendingChanges()||j},_flushinvokeLastQueue:function(){var i=this._invokeLastQueue,j=g;
-if(i&&i.targets>0){this._invokeLastQueue=null;j=e;if(j){i.invokeMethods()}}return j
-}});h.RunLoop.currentRunLoop=null;h.RunLoop.runLoopClass=h.RunLoop;h.RunLoop.begin=function(){var i=this.currentRunLoop;
-if(!i){i=this.currentRunLoop=this.runLoopClass.create()}i.beginRunLoop();return this
-};h.RunLoop.end=function(){var i=this.currentRunLoop;if(!i){throw"SC.RunLoop.end() called outside of a runloop!"
-}i.endRunLoop();return this};h.run=function(j,i){h.RunLoop.begin();j.call(i);h.RunLoop.end()
-}});tiki.module("sproutcore/runtime:system/selection_set",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:system/object");c("sproutcore/runtime:mixins/enumerable");c("sproutcore/runtime:mixins/copyable");
-c("sproutcore/runtime:mixins/freezable");c("sproutcore/runtime:system/set");c("sproutcore/runtime:system/index_set");
-"import core";"import system/object";"import mixins/enumerable";"import mixins/copyable";
-"import mixins/freezable";"import system/set";"import system/index_set";"export package";
-h.SelectionSet=h.Object.extend(h.Enumerable,h.Freezable,h.Copyable,{isSelectionSet:e,length:function(){var i=0,j=this._sets,k=this._objects;
-if(k){i+=k.get("length")}if(j){j.forEach(function(l){i+=l.get("length")})}return i
-}.property().cacheable(),sources:function(){var k=[],l=this._sets,j=l?l.length:0,i,n,m;
-for(i=0;i<j;i++){n=l[i];if(n&&n.get("length")>0&&n.source){k.push(n.source)}}return k
-}.property().cacheable(),indexSetForSource:function(m){if(!m||!m.isSCArray){return null
-}var j=this._indexSetCache,l=this._objects,k,i;if(!j){j=this._indexSetCache={}}k=j[h.guidFor(m)];
-if(k&&k._sourceRevision&&(k._sourceRevision!==m.propertyRevision)){k=null}if(!k){k=this._indexSetForSource(m,g);
-if(k&&k.get("length")===0){k=null}if(l){if(k){k=k.copy()}l.forEach(function(n){if((i=m.indexOf(n))>=0){if(!k){k=h.IndexSet.create()
-}k.add(i)}},this)}if(k){k=j[h.guidFor(m)]=k.frozenCopy();k._sourceRevision=m.propertyRevision
-}}return k},_indexSetForSource:function(n,o){if(o===undefined){o=e}var l=h.guidFor(n),k=this[l],m=this._sets,i=m?m.length:0,j=null;
-if(k>=i){k=null}if(h.none(k)){if(o&&!this.isFrozen){this.propertyWillChange("sources");
-if(!m){m=this._sets=[]}j=m[i]=h.IndexSet.create();j.source=n;this[l]=i;this.propertyDidChange("sources")
-}}else{j=m?m[k]:null}return j},add:function(i,j,l){if(this.isFrozen){throw h.FROZEN_ERROR
-}var o,n,r,q,k,m,p,s;if(j===undefined&&l===undefined){if(!i){throw"Must pass params to SC.SelectionSet.add()"
-}if(i.isIndexSet){return this.add(i.source,i)}if(i.isSelectionSet){o=i._sets;s=i._objects;
-n=o?o.length:0;this.beginPropertyChanges();for(r=0;r<n;r++){q=o[r];if(q&&q.get("length")>0){this.add(q.source,q)
-}}if(s){this.addObjects(s)}this.endPropertyChanges();return this}}q=this._indexSetForSource(i,e);
-k=this.get("length");p=q.get("length");m=k-p;q.add(j,l);this._indexSetCache=null;
-m+=q.get("length");if(m!==k){this.propertyDidChange("length");this.enumerableContentDidChange();
-if(p===0){this.notifyPropertyChange("sources")}}return this},remove:function(i,j,l){if(this.isFrozen){throw h.FROZEN_ERROR
-}var o,n,r,q,k,m,p,s;if(j===undefined&&l===undefined){if(!i){throw"Must pass params to SC.SelectionSet.remove()"
-}if(i.isIndexSet){return this.remove(i.source,i)}if(i.isSelectionSet){o=i._sets;s=i._objects;
-n=o?o.length:0;this.beginPropertyChanges();for(r=0;r<n;r++){q=o[r];if(q&&q.get("length")>0){this.remove(q.source,q)
-}}if(s){this.removeObjects(s)}this.endPropertyChanges();return this}}q=this._indexSetForSource(i,e);
-k=this.get("length");m=k-q.get("length");if(q&&(s=this._objects)){if(l!==undefined){j=h.IndexSet.create(j,l);
-l=undefined}s.forEach(function(t){r=i.indexOf(t);if(j.contains(r)){s.remove(t);m--
-}},this)}q.remove(j,l);p=q.get("length");m+=p;this._indexSetCache=null;if(m!==k){this.propertyDidChange("length");
-this.enumerableContentDidChange();if(p===0){this.notifyPropertyChange("sources")}}return this
-},contains:function(j,l,i){if(l===undefined&&i===undefined){return this.containsObject(j)
-}var k=this.indexSetForSource(j);if(!k){return g}return k.contains(l,i)},intersects:function(j,l,i){var k=this.indexSetForSource(j,g);
-if(!k){return g}return k.intersects(l,i)},_TMP_ARY:[],addObject:function(j){var k=this._TMP_ARY,i;
-k[0]=j;i=this.addObjects(k);k.length=0;return i},addObjects:function(i){var l=this._objects,j,k;
-if(!l){l=this._objects=h.CoreSet.create()}j=l.get("length");l.addEach(i);k=l.get("length");
-this._indexSetCache=null;if(k!==j){this.propertyDidChange("length");this.enumerableContentDidChange()
-}return this},removeObject:function(j){var k=this._TMP_ARY,i;k[0]=j;i=this.removeObjects(k);
-k.length=0;return i},removeObjects:function(j){var m=this._objects,k,l,i;if(!m){return this
-}k=m.get("length");m.removeEach(j);l=m.get("length");if(i=this._sets){i.forEach(function(n){k+=n.get("length");
-n.removeObjects(j);l+=n.get("length")},this)}this._indexSetCache=null;if(l!==k){this.propertyDidChange("length");
-this.enumerableContentDidChange()}return this},containsObject:function(k){var m=this._objects;
-if(m&&m.contains(k)){return e}var l=this._sets,j=l?l.length:0,i,n;for(i=0;i<j;i++){n=l[i];
-if(n&&n.indexOf(k)>=0){return e}}return g},constrain:function(l){var m,j,i,k;this.beginPropertyChanges();
-this.get("sources").forEach(function(n){if(n===l){return}var o=this._indexSetForSource(l,g);
-if(o){this.remove(l,o)}},this);m=this._indexSetForSource(l,g);if(m&&((i=m.get("max"))>(j=l.get("length")))){this.remove(l,j,i-j)
-}if(k=this._objects){k.forEach(function(n){if(l.indexOf(n)<0){this.removeObject(n)
-}},this)}this.endPropertyChanges();return this},isEqual:function(o){var n,l,j,i,k,m;
-if(!o||!o.isSelectionSet){return g}if(o===this){return e}if((this._sets===o._sets)&&(this._objects===o._objects)){return e
-}if(this.get("length")!==o.get("length")){return g}n=this._objects;l=o._objects;if(n||l){if((n?n.get("length"):0)!==(l?l.get("length"):0)){return g
-}if(n&&!n.isEqual(l)){return g}}k=this.get("sources");i=k.get("length");for(j=0;j<i;
-j++){m=k.objectAt(j);n=this._indexSetForSource(m,g);l=this._indexSetForSource(m,g);
-if(!!l!==!!n){return g}if(n&&!n.isEqual(l)){return g}}return e},clear:function(){if(this.isFrozen){throw h.FROZEN_ERROR
-}if(this._sets){this._sets.length=0}if(this._objects){this._objects=null}this._indexSetCache=null;
-this.propertyDidChange("length");this.enumerableContentDidChange();this.notifyPropertyChange("sources");
-return this},copy:function(){var k=this.constructor.create(),l=this._sets,j=l?l.length:0,i,m;
-if(l&&j>0){l=k._sets=l.slice();for(i=0;i<j;i++){if(!(m=l[i])){continue}m=l[i]=m.copy();
-k[h.guidFor(m.source)]=i}}if(this._objects){k._objects=this._objects.copy()}return k
-},freeze:function(){if(this.isFrozen){return this}var i=this._sets,j=i?i.length:0,k;
-while(--j>=0){if(k=i[j]){k.freeze()}}if(this._objects){this._objects.freeze()}return arguments.callee.base.apply(this,arguments)
-},toString:function(){var i=this._sets||[];i=i.map(function(j){return j.toString().replace("SC.IndexSet",h.guidFor(j.source))
-},this);if(this._objects){i.push(this._objects.toString())}return"SC.SelectionSet:%@<%@>".fmt(h.guidFor(this),i.join(","))
-},firstObject:function(){var j=this._sets,k=this._objects;if(j&&j.get("length")>0){var m=j?j[0]:null,l=m?m.source:null,i=m?m.firstObject():-1;
-if(l&&i>=0){return l.objectAt(i)}}return k?k.firstObject():undefined}.property(),nextObject:function(k,m,j){var l,i;
-if(k===0){l=j.objects=[];this.forEach(function(n){l.push(n)},this);j.max=l.length
-}l=j.objects;i=l[k];if(k+1>=j.max){j.objects=j.max=null}return i},forEach:function(o,m){var k=this._sets,l=this._objects,j=k?k.length:0,n,i;
-for(i=0;i<j;i++){n=k[i];if(n){n.forEachObject(o,m)}}if(l){l.forEach(o,m)}return this
-}});h.SelectionSet.prototype.clone=h.SelectionSet.prototype.copy;h.SelectionSet.EMPTY=h.SelectionSet.create().freeze()
-});tiki.module("sproutcore/runtime:system/set",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:mixins/enumerable");c("sproutcore/runtime:mixins/copyable");
-c("sproutcore/runtime:mixins/freezable");c("sproutcore/runtime:mixins/observable");
-"import core";"import mixins/enumerable";"import mixins/copyable";"import mixins/freezable";
-"import mixins/observable";"export package";h.Set=h.mixin({},h.Enumerable,h.Observable,h.Freezable,{create:function(j){var k,i,l=h.Set._pool,m=this.isObservable;
-if(!m&&j===undefined&&l.length>0){k=l.pop()}else{k=h.beget(this);if(m){k.initObservable()
-}if(j&&j.isEnumerable&&j.get("length")>0){k.isObservable=g;if(j.isSCArray){i=j.get?j.get("length"):j.length;
-while(--i>=0){k.add(j.objectAt(i))}}else{if(j.isSet){i=j.length;while(--i>=0){k.add(j[i])
-}}else{j.forEach(function(n){k.add(n)},this)}}k.isObservable=m}}return k},isSet:e,length:0,firstObject:function(){return(this.length>0)?this[0]:undefined
-}.property(),clear:function(){if(this.isFrozen){throw h.FROZEN_ERROR}this.length=0;
-return this},contains:function(j){if(j===null){return g}var i=this[h.hashFor(j)];
-return(!h.none(i)&&(i<this.length)&&(this[i]===j))},isEqual:function(i){if(!i||!i.isSet||(i.get("length")!==this.get("length"))){return g
-}var j=this.get("length");while(--j>=0){if(!i.contains(this[j])){return g}}return e
-},add:function(l){if(this.isFrozen){throw h.FROZEN_ERROR}if(l===null||l===undefined){return this
-}var k=h.hashFor(l);var j=this[k];var i=this.length;if((j===null||j===undefined)||(j>=i)||(this[j]!==l)){this[i]=l;
-this[k]=i;this.length=i+1}if(this.isObservable){this.enumerableContentDidChange()
-}return this},addEach:function(k){if(this.isFrozen){throw h.FROZEN_ERROR}if(!k||!k.isEnumerable){throw"%@.addEach must pass enumerable".fmt(this)
-}var i,j=this.isObservable;if(j){this.beginPropertyChanges()}if(k.isSCArray){i=k.get("length");
-while(--i>=0){this.add(k.objectAt(i))}}else{if(k.isSet){i=k.length;while(--i>=0){this.add(k[i])
-}}else{k.forEach(function(l){this.add(l)},this)}}if(j){this.endPropertyChanges()}return this
-},remove:function(l){if(this.isFrozen){throw h.FROZEN_ERROR}if(h.none(l)){return this
-}var k=h.hashFor(l);var j=this[k];var i=this.length;if(h.none(j)||(j>=i)||(this[j]!==l)){return this
-}delete this[k];if(j<(i-1)){l=this[j]=this[i-1];this[h.hashFor(l)]=j}this.length=i-1;
-if(this.isObservable){this.enumerableContentDidChange()}return this},pop:function(){if(this.isFrozen){throw h.FROZEN_ERROR
-}var i=(this.length>0)?this[this.length-1]:null;if(i){this.remove(i)}return i},removeEach:function(k){if(this.isFrozen){throw h.FROZEN_ERROR
-}if(!k||!k.isEnumerable){throw"%@.addEach must pass enumerable".fmt(this)}var i,j=this.isObservable;
-if(j){this.beginPropertyChanges()}if(k.isSCArray){i=k.get("length");while(--i>=0){this.remove(k.objectAt(i))
-}}else{if(k.isSet){i=k.length;while(--i>=0){this.remove(k[i])}}else{k.forEach(function(l){this.remove(l)
-},this)}}if(j){this.endPropertyChanges()}return this},copy:function(){return this.constructor.create(this)
-},destroy:function(){this.isFrozen=g;if(!this.isObservable){h.Set._pool.push(this.clear())
-}return this},forEach:function(k,l){var j=this.length;if(!l){l=this}for(var i=0;i<j;
-i++){k.call(l,this[i],i,this)}return this},toString:function(){var j=this.length,i,k=[];
-for(i=0;i<j;i++){k[i]=this[i]}return"SC.Set<%@>".fmt(k.join(","))},_pool:[],isObservable:e});
-h.Set.constructor=h.Set;h.Set.clone=h.Set.copy;h.Set.push=h.Set.unshift=h.Set.add;
-h.Set.shift=h.Set.pop;h.Set.addObject=h.Set.add;h.Set.removeObject=h.Set.remove;h.Set._pool=[];
-h.CoreSet=h.beget(h.Set);h.CoreSet.isObservable=g;h.CoreSet.constructor=h.CoreSet
-});tiki.module("sproutcore/runtime:system/sparse_array",function(c,b,d){var a=c("sproutcore/runtime:core"),h=a.SC,f=a.SproutCore,e=a.YES,g=a.NO;
-c("sproutcore/runtime:system/index_set");c("sproutcore/runtime:system/object");c("sproutcore/runtime:mixins/enumerable");
-c("sproutcore/runtime:mixins/array");c("sproutcore/runtime:mixins/delegate_support");
-"import core";"import system/index_set";"import system/object";"import mixins/enumerable";
-"import mixins/array";"import mixins/delegate_support";"export package";h.SparseArray=h.Object.extend(h.Enumerable,h.Array,h.DelegateSupport,{_requestingLength:0,_requestingIndex:0,length:function(){var i=this.delegate;
-if(i&&h.none(this._length)&&i.sparseArrayDidRequestLength){this._requestingLength++;
-i.sparseArrayDidRequestLength(this);this._requestingLength--}return this._length||0
-}.property().cacheable(),provideLength:function(i){if(h.none(i)){this._sa_content=null
-}if(i!==this._length){this._length=i;if(this._requestingLength<=0){this.enumerableContentDidChange()
-}}return this},rangeWindowSize:1,requestedRangeIndex:[],objectAt:function(i){var k=this._sa_content,j;
-if(!k){k=this._sa_content=[]}if((j=k[i])===undefined){this.requestIndex(i);j=k[i]
-}return j},definedIndexes:function(l){var k=h.IndexSet.create(),m=this._sa_content,j,i;
-if(!m){return k.freeze()}if(l){l.forEach(function(n){if(m[n]!==undefined){k.add(n)
-}})}else{i=m.length;for(j=0;j<i;j++){if(m[j]!==undefined){k.add(j)}}}return k.freeze()
-},_TMP_RANGE:{},requestIndex:function(j){var k=this.delegate;if(!k){return this}var i=this.get("rangeWindowSize"),m=j;
-if(i>1){m=m-Math.floor(m%i)}if(i<1){i=1}this._requestingIndex++;if(k.sparseArrayDidRequestRange){var l=this._TMP_RANGE;
-if(this.wasRangeRequested(m)===-1){l.start=m;l.length=i;k.sparseArrayDidRequestRange(this,l);
-this.requestedRangeIndex.push(m)}}else{if(k.sparseArrayDidRequestIndex){while(--i>=0){k.sparseArrayDidRequestIndex(this,m+i)
-}}}this._requestingIndex--;return this},wasRangeRequested:function(l){var k,j;for(k=0,j=this.requestedRangeIndex.length;
-k<j;k++){if(this.requestedRangeIndex[k]===l){return k}}return -1},rangeRequestCompleted:function(k){var j=this.wasRangeRequested(k);
-if(j>=0){this.requestedRangeIndex.removeAt(j,1);return e}return g},provideObjectsInRange:function(j,m){var k=this._sa_content;
-if(!k){k=this._sa_content=[]}var l=j.start,i=j.length;while(--i>=0){k[l+i]=m[i]}if(this._requestingIndex<=0){this.enumerableContentDidChange()
-}return this},_TMP_PROVIDE_ARRAY:[],_TMP_PROVIDE_RANGE:{length:1},provideObjectAtIndex:function(k,j){var l=this._TMP_PROVIDE_ARRAY,i=this._TMP_PROVIDE_RANGE;
-l[0]=j;i.start=k;return this.provideObjectsInRange(i,l)},objectsDidChangeInRange:function(i){var j=this._sa_content;
-if(j){if(i.start===0&&h.maxRange(i)>=j.length){this._sa_content=null}else{var l=i.start,k=Math.min(l+i.length,j.length);
-while(--k>=l){j[k]=undefined}}}this.enumerableContentDidChange(i);return this},indexOf:function(k){var i=this.delegate;
-if(i&&i.sparseArrayDidRequestIndexOf){return i.sparseArrayDidRequestIndexOf(this,k)
-}else{var j=this._sa_content;if(!j){j=this._sa_content=[]}return j.indexOf(k)}},replace:function(j,o,m){m=m||[];
-var k=this.delegate;if(k){if(!k.sparseArrayShouldReplace||!k.sparseArrayShouldReplace(this,j,o,m)){return this
-}}var l=this._sa_content;if(!l){l=this._sa_content=[]}l.replace(j,o,m);var i=m?(m.get?m.get("length"):m.length):0;
-var n=i-o;if(!h.none(this._length)){this.propertyWillChange("length");this._length+=n;
-this.propertyDidChange("length")}this.enumerableContentDidChange(j,o,n);return this
-},reset:function(){this._sa_content=null;this._length=null;this.enumerableContentDidChange();
-this.invokeDelegateMethod(this.delegate,"sparseArrayDidReset",this);return this}});
-h.SparseArray.array=function(i){return this.create({_length:i||0})}});tiki.module("sproutcore/runtime:package",function(c,b,d){var a;
-a=c("sproutcore/runtime:core");b.SC=a.SC;b.SproutCore=a.SproutCore;b.YES=a.YES;b.NO=a.NO;
-c("sproutcore/runtime:mixins/array");c("sproutcore/runtime:mixins/comparable");c("sproutcore/runtime:mixins/copyable");
-c("sproutcore/runtime:mixins/delegate_support");c("sproutcore/runtime:mixins/enumerable");
-c("sproutcore/runtime:mixins/freezable");c("sproutcore/runtime:mixins/observable");
-c("sproutcore/runtime:system/binding");c("sproutcore/runtime:system/cookie");c("sproutcore/runtime:system/enumerator");
-c("sproutcore/runtime:system/error");c("sproutcore/runtime:system/index_set");c("sproutcore/runtime:system/logger");
-c("sproutcore/runtime:system/object");c("sproutcore/runtime:system/range_observer");
-c("sproutcore/runtime:system/run_loop");c("sproutcore/runtime:system/selection_set");
-c("sproutcore/runtime:system/set");c("sproutcore/runtime:system/sparse_array")});
-tiki.script("sproutcore/runtime:en/1a415d7e025bbaaf9462034aaa4d4e00db320bf1/javascript.js");
-tiki.register("sproutcore/datastore",{depends:["sproutcore/runtime"],packages:{"sproutcore/runtime":{}},scripts:[{url:"/static/sproutcore/datastore/en/03fb4a845dd24dd06461a3e068a1e76c8370d052/javascript.js",id:"sproutcore/datastore:en/03fb4a845dd24dd06461a3e068a1e76c8370d052/javascript.js"}]});
-tiki.global("sproutcore/datastore");tiki.script("sproutcore/datastore:en/03fb4a845dd24dd06461a3e068a1e76c8370d052/javascript.js");
-tiki.register("sproutcore/foundation",{depends:["sproutcore/runtime"],packages:{"sproutcore/runtime":{}},scripts:[{url:"/static/sproutcore/foundation/en/ed50641e9278e55501165cb24eee859fe1f0ac61/javascript.js",id:"sproutcore/foundation:en/ed50641e9278e55501165cb24eee859fe1f0ac61/javascript.js"}]});
-tiki.global("sproutcore/foundation");SC.Locale=SC.Object.extend({init:function(){if(!this.language){SC.Locale._assignLocales()
-}if(!this.hasStrings){var c=this._deprecatedLanguageCodes||[];c.push(this.language);
-var b=c.length;var a=null;while(!a&&--b>=0){a=String[c[b]]}if(a){this.hasStrings=YES;
-this.strings=a}}},hasStrings:NO,strings:{},toString:function(){if(!this.language){SC.Locale._assignLocales()
-}return"SC.Locale["+this.language+"]"+SC.guidFor(this)},locWithDefault:function(a,b){return this.strings[a]||b||a
-}});SC.Locale.mixin({useAutodetectedLanguage:NO,preferredLanguage:null,createCurrentLocale:function(){var c=(String.useAutodetectedLanguage!==undefined)?String.useAutodetectedLanguage:this.useAutodetectedLanguage;
-var b=(String.preferredLanguage!==undefined)?String.preferredLanguage:this.preferredLanguage;
-var d=((c)?SC.browser.language:null)||b||SC.browser.language||"en";d=SC.Locale.normalizeLanguage(d);
-var a=this.localeClassFor(d);if(d!=this.currentLanguage){this.currentLanguage=d;this.currentLocale=a.create()
-}return this.currentLocale},localeClassFor:function(c){c=SC.Locale.normalizeLanguage(c);
-var b,a=this.locales[c];if(!a&&((b=c.split("-")[0])!==c)&&(a=this.locales[b])){a=this.locales[c]=a.extend()
-}if(!a){a=this.locales[c]=this.locales.en.extend()}return a},define:function(b,c){var a;
-if(c===undefined&&(SC.typeOf(b)!==SC.T_STRING)){a=this;c=b}else{a=SC.Locale.localeClassFor(b)
-}SC.mixin(a.prototype,c);return a},options:function(){return this.prototype},addStrings:function(b){var a=this.prototype.strings;
-if(a){if(!this.prototype.hasOwnProperty("strings")){this.prototype.strings=SC.clone(a)
-}}else{a=this.prototype.strings={}}if(b){this.prototype.strings=SC.mixin(a,b)}this.prototype.hasStrings=YES;
-return this},_map:{english:"en",french:"fr",german:"de",japanese:"ja",jp:"ja",spanish:"es"},normalizeLanguage:function(a){if(!a){return"en"
-}return SC.Locale._map[a.toLowerCase()]||a},_assignLocales:function(){for(var a in this.locales){this.locales[a].prototype.language=a
-}},toString:function(){if(!this.prototype.language){SC.Locale._assignLocales()}return"SC.Locale["+this.prototype.language+"]"
-},extend:function(){var a=SC.Object.extend.apply(this,arguments);a.addStrings=SC.Locale.addStrings;
-a.define=SC.Locale.define;a.options=SC.Locale.options;a.toString=SC.Locale.toString;
-return a}});SC.Locale.locales={en:SC.Locale.extend({_deprecatedLanguageCodes:["English"]}),fr:SC.Locale.extend({_deprecatedLanguageCodes:["French"]}),de:SC.Locale.extend({_deprecatedLanguageCodes:["German"]}),ja:SC.Locale.extend({_deprecatedLanguageCodes:["Japanese","jp"]}),es:SC.Locale.extend({_deprecatedLanguageCodes:["Spanish"]})};
-SC.stringsFor=function(c,b){var a=SC.Locale.localeClassFor(c);a.addStrings(b);return this
-};sc_require("system/locale");SC.stringsFor("English",{"_SC.DateTime.dayNames":"Sunday Monday Tuesday Wednesday Thursday Friday Saturday","_SC.DateTime.abbreviatedDayNames":"Sun Mon Tue Wed Thu Fri Sat","_SC.DateTime.monthNames":"January February March April May June July August September October November December","_SC.DateTime.abbreviatedMonthNames":"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"});
-SC.DROP_ON=1;SC.DROP_BEFORE=2;SC.DROP_AFTER=4;SC.DROP_ANY=7;SC.mixin({data:function(c,b,d){c=(c===window)?"@window":c;
-var e=SC.hashFor(c);var a=SC._data_cache;if(!a){SC._data_cache=a={}}var f=a[e];if(b&&!f){a[e]=f={}
-}if(f&&(d!==undefined)){f[b]=d}return(b)?f[b]:f},removeData:function(d,c){d=(d===window)?"@window":d;
-var e=SC.hashFor(d);var a=SC._data_cache;if(!a){return undefined}var f=a[e];if(!f){return undefined
-}var b=(c)?f[c]:f;if(c){delete f[c]}else{delete a[e]}return b}});SC.mixin(Function.prototype,{invokeLater:function(g,a){if(a===undefined){a=1
-}var e=this;if(arguments.length>2){var b=SC.$A(arguments).slice(2,arguments.length);
-b.unshift(g);var d=this,c=e;e=function(){return c.apply(d,b.slice(1))}}return SC.Timer.schedule({target:g,action:e,interval:a})
-}});SC.Controller=SC.Object.extend({isEditable:YES});SC.mixin(SC.Object.prototype,{invokeLater:function(b,a){if(a===undefined){a=1
-}var e=b,c,d;if(arguments.length>2){c=SC.$A(arguments).slice(2);if(SC.typeOf(e)===SC.T_STRING){e=this[b]
-}d=e;e=function(){return d.apply(this,c)}}return SC.Timer.schedule({target:this,action:e,interval:a})
-},invokeWith:function(b,c,d){if(d===undefined){d=c;c=this}if(!c){c=this}if(SC.typeOf(d)===SC.T_STRING){d=c[d]
-}var a=this.getPath(b);d.call(c,a,this);return this}});SC.RunLoop=SC.RunLoop.extend({startTime:function(){if(!this._start){this._start=Date.now()
-}return this._start}.property(),endRunLoop:function(){this.fireExpiredTimers();var a=arguments.callee.base.apply(this,arguments);
-this.scheduleNextTimeout();return a},scheduleTimer:function(b,a){this._timerQueue=b.removeFromTimerQueue(this._timerQueue);
-this._timerQueue=b.scheduleInTimerQueue(this._timerQueue,a);return this},cancelTimer:function(a){this._timerQueue=a.removeFromTimerQueue(this._timerQueue);
-return this},TIMER_ARRAY:[],fireExpiredTimers:function(){if(!this._timerQueue||this._firing){return NO
-}var d=this.get("startTime");this._firing=YES;var e=this.TIMER_ARRAY;this._timerQueue=this._timerQueue.collectExpiredTimers(e,d);
-var c,b=e.length;for(c=0;c<b;c++){e[c].fire()}var a=e.length>0;e.length=0;this._firing=NO;
-return a},scheduleNextTimeout:function(){var d=this._timerQueue;var b=NO;if(!d){if(this._timeout){clearTimeout(this._timeout)
-}}else{var c=d._timerQueueRunTime;if(this._timeoutAt!==c){if(this._timeout){clearTimeout(this._timeout)
-}var a=Math.max(0,c-Date.now());this._timeout=setTimeout(this._timeoutDidFire,a);
-this._timeoutAt=c}b=YES}return b},_timeoutDidFire:function(){var a=SC.RunLoop.currentRunLoop;
-a._timeout=a._timeoutAt=null;SC.RunLoop.begin().end()}});SC.RunLoop.currentRunLoop=SC.RunLoop.create();
-/* @license
-
-Portions of this software are copyright Yahoo, Inc, used under the following license:
-
-Software License Agreement (BSD License)
-Copyright (c) 2009, Yahoo! Inc.
-All rights reserved.
-Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this list of conditions and the
-following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-Neither the name of Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Sources of Intellectual Property Included in the YUI Library
-Where not otherwise indicated, all YUI content is authored by Yahoo! engineers and consists of Yahoo!-owned intellectual property. YUI is issued by Yahoo! under the BSD license above. In some specific instances, YUI will incorporate work done by developers outside of Yahoo! with their express permission.
-
-*/
-SC.BRANCH_OPEN=17;
-SC.BRANCH_CLOSED=18;SC.LEAF_NODE=32;SC.CollectionContent={isCollectionContent:YES,contentIndexIsSelected:function(b,c,a){var d=b.get("selection");
-return d?d.contains(c,a):NO},contentIndexIsEnabled:function(b,c,a){return b.get("isEnabled")
-},contentGroupIndexes:function(a,b){return null},contentIndexIsGroup:function(b,c,a){return NO
-},contentIndexOutlineLevel:function(b,c,a){return -1},contentIndexDisclosureState:function(b,c,a){return SC.LEAF_NODE
-},contentIndexExpand:function(b,c,a){console.log("contentIndexExpand(%@, %@, %@)".fmt(b,c,a))
-},contentIndexCollapse:function(b,c,a){console.log("contentIndexCollapse(%@, %@, %@)".fmt(b,c,a))
-}};SC.ContentDisplay={concatenatedProperties:"contentDisplayProperties",displayProperties:["content"],contentDisplayProperties:[],_display_contentDidChange:function(e,a,d){if((d=this.get("content"))!=this._display_content){var c=this._display_contentPropertyDidChange;
-var b=this._display_content;if(b){if(SC.isArray(b)){b.invoke("removeObserver","*",this,c)
-}else{if(b.removeObserver){b.removeObserver("*",this,c)}}}b=this._display_content=d;
-if(b){if(SC.isArray(b)){b.invoke("addObserver","*",this,c)}else{if(b.addObserver){b.addObserver("*",this,c)
-}}}this.allPropertiesDidChange();this.endPropertyChanges()}}.observes("content"),_display_contentPropertyDidChange:function(e,c,d,b){if(c==="*"){this.displayDidChange()
-}else{var a=this.get("contentDisplayProperties");if(a&&a.indexOf(c)>=0){this.displayDidChange()
-}}}};sc_require("system/locale");SC.STRING_TITLEIZE_REGEXP=(/([\s|\-|\_|\n])([^\s|\-|\_|\n]?)/g);
-SC.String={loc:function(){if(!SC.Locale.currentLocale){SC.Locale.createCurrentLocale()
-}var a=SC.Locale.currentLocale.locWithDefault(this)||this;return a.fmt.apply(a,arguments)
-},locWithDefault:function(b){if(!SC.Locale.currentLocale){SC.Locale.createCurrentLocale()
-}var c=SC.Locale.currentLocale.locWithDefault(b)||this;var a=SC.$A(arguments);a.shift();
-return c.fmt.apply(c,a)},capitalize:function(){return this.charAt(0).toUpperCase()+this.slice(1)
-},capitalizeEach:function(){return this.replace(SC.STRING_TITLEIZE_REGEXP,function(c,a,b){return(b)?(a+b.toUpperCase()):a
-}).capitalize()},titleize:function(){var a=this.replace(/([a-z])([A-Z])/g,"$1_$2");
-return a.replace(SC.STRING_TITLEIZE_REGEXP,function(c,d,b){return(b)?(" "+b.toUpperCase()):" "
-}).capitalize()},camelize:function(){var b=this.replace(SC.STRING_TITLEIZE_REGEXP,function(e,f,d){return(d)?d.toUpperCase():""
-});var c=b.charAt(0),a=c.toLowerCase();return(c!==a)?(a+b.slice(1)):b},classify:function(){var a=this.replace(SC.STRING_TITLEIZE_REGEXP,function(e,f,d){return(d)?d.toUpperCase():""
-});var c=a.charAt(0),b=c.toUpperCase();return(c!==b)?(b+a.slice(1)):a},decamelize:function(){return this.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()
-},dasherize:function(){return this.decamelize().replace(/[ _]/g,"-")},humanize:function(){return this.decamelize().replace(/[\-_]/g," ")
-},removeDiacritics:function(){var a=SC.diacriticMappingTable;if(!a){SC.diacriticMappingTable={"�":"A","�":"A","�":"A","�":"A","�":"A","�":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"A","?":"B","?":"B","?":"B","�":"C","?":"C","?":"C","?":"C","?":"C","?":"C","?":"D","?":"D","?":"D","?":"D","?":"D","?":"D","�":"E","�":"E","�":"E","�":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"E","?":"F","?":"G","?":"G","?":"G","?":"G","?":"G","?":"G","?":"G","?":"H","?":"H","?":"H","?":"H","?":"H","?":"H","?":"H","�":"I","�":"I","�":"I","�":"I","?":"I","?":"I","?":"I","?":"I","?":"I","?":"I","?":"I","?":"I","?":"I","?":"I","?":"I","?":"I","?":"J","?":"K","?":"K","?":"K","?":"K","?":"K","?":"L","?":"L","?":"L","?":"L","?":"L","?":"L","?":"L","?":"M","?":"M","?":"M","�":"N","?":"N","?":"N","?":"N","?":"N","?":"N","?":"N","?":"N","?":"N","�":"O","�":"O","�":"O","�":"O","�":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"O","?":"P","?":"P","?":"R","?":"R","?":"R","?":"R","?":"R","?":"R","?":"R","?":"R","?":"R","?":"S","?":"S","?":"S","�":"S","?":"S","?":"S","?":"S","?":"S","?":"S","?":"S","?":"T","?":"T","?":"T","?":"T","?":"T","?":"T","?":"T","�":"U","�":"U","�":"U","�":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"U","?":"V","?":"V","?":"W","?":"W","?":"W","?":"W","?":"W","?":"W","?":"X","?":"X","�":"Y","?":"Y","�":"Y","?":"Y","?":"Y","?":"Y","?":"Y","?":"Y","?":"Y","?":"Z","?":"Z","�":"Z","?":"Z","?":"Z","?":"Z","?":"`","�":"a","�":"a","�":"a","�":"a","�":"a","�":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"a","?":"b","?":"b","?":"b","�":"c","?":"c","?":"c","?":"c","?":"c","?":"c","?":"d","?":"d","?":"d","?":"d","?":"d","?":"d","�":"e","�":"e","�":"e","�":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"e","?":"f","?":"g","?":"g","?":"g","?":"g","?":"g","?":"g","?":"g","?":"h","?":"h","?":"h","?":"h","?":"h","?":"h","?":"h","?":"h","�":"i","�":"i","�":"i","�":"i","?":"i","?":"i","?":"i","?":"i","?":"i","?":"i","?":"i","?":"i","?":"i","?":"i","?":"i","?":"j","?":"j","?":"k","?":"k","?":"k","?":"k","?":"k","?":"l","?":"l","?":"l","?":"l","?":"l","?":"l","?":"l","?":"m","?":"m","?":"m","�":"n","?":"n","?":"n","?":"n","?":"n","?":"n","?":"n","?":"n","?":"n","�":"o","�":"o","�":"o","�":"o","�":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"o","?":"p","?":"p","?":"r","?":"r","?":"r","?":"r","?":"r","?":"r","?":"r","?":"r","?":"r","?":"s","?":"s","?":"s","�":"s","?":"s","?":"s","?":"s","?":"s","?":"s","?":"s","?":"t","?":"t","?":"t","?":"t","?":"t","?":"t","?":"t","?":"t","�":"u","�":"u","�":"u","�":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"u","?":"v","?":"v","?":"w","?":"w","?":"w","?":"w","?":"w","?":"w","?":"w","?":"x","?":"x","�":"y","�":"y","?":"y","?":"y","?":"y","?":"y","?":"y","?":"y","?":"y","?":"y","?":"z","?":"z","�":"z","?":"z","?":"z","?":"z"};
-a=SC.diacriticMappingTable}var d,e;var b="";var f=this.length;for(var c=0;c<=f;++c){d=this.charAt(c);
-e=a[d];if(e){b+=e}else{b+=d}}return b},trim:function(){return this.replace(/^\s+|\s+$/g,"")
-},trimLeft:function(){return this.replace(/^\s+/g,"")},trimRight:function(){return this.replace(/\s+$/g,"")
-}};SC.String.strip=SC.String.trim;SC.supplement(String.prototype,SC.String);String.prototype.loc=SC.String.loc;
-SC.String.fmt=String.prototype.fmt;sc_require("mixins/string");SC.MIXED_STATE="__MIXED__";
-SC.HUGE_CONTROL_SIZE="sc-huge-size";SC.LARGE_CONTROL_SIZE="sc-large-size";SC.REGULAR_CONTROL_SIZE="sc-regular-size";
-SC.SMALL_CONTROL_SIZE="sc-small-size";SC.TINY_CONTROL_SIZE="sc-tiny-size";SC.Control={initMixin:function(){this._control_contentDidChange()
-},isSelected:NO,isSelectedBindingDefault:SC.Binding.oneWay().bool(),isActive:NO,isActiveBindingDefault:SC.Binding.oneWay().bool(),value:null,content:null,contentValueKey:null,contentPropertyDidChange:function(b,a){return this.updatePropertyFromContent("value",a,"contentValueKey")
-},updatePropertyFromContent:function(f,b,e,d){var c=b==="*";if(e===undefined){e="content%@Key".fmt(f.capitalize())
-}if(d===undefined){d=this.get("content")}e=this[e]?this.get(e):this.getDelegateProperty(e,this.displayDelegate);
-if(e&&(c||b===e)){var a=(d)?(d.get?d.get(e):d[e]):null;this.set(f,a)}return this},updateContentWithValueObserver:function(){var a=this.contentValueKey?this.get("contentValueKey"):this.getDelegateProperty("contentValueKey",this.displayDelegate);
-var b=this.get("content");if(!a||!b){return}var c=this.get("value");if(typeof b.setIfChanged===SC.T_FUNCTION){b.setIfChanged(a,c)
-}else{if(b[a]!==c){b[a]=c}}}.observes("value"),fieldKey:null,fieldLabel:null,errorLabel:function(){var a,c,b;
-if(a=this.get("fieldLabel")){return a}c=this.get("fieldKey")||this.constructor.toString();
-b=(c||"").humanize().capitalize();return"ErrorLabel.%@".fmt(c).locWithDefault("FieldKey.%@".fmt(c).locWithDefault(b))
-}.property("fieldLabel","fieldKey").cacheable(),controlSize:SC.REGULAR_CONTROL_SIZE,displayProperties:"isEnabled isSelected isActive controlSize".w(),_CONTROL_TMP_CLASSNAMES:{},renderMixin:function(a,e){var c=this.get("isSelected"),b=!this.get("isEnabled");
-var d=this._CONTROL_TMP_CLASSNAMES;d.mixed=c===SC.MIXED_STATE;d.sel=c&&(c!==SC.MIXED_STATE);
-d.active=this.get("isActive");a.setClass(d).addClass(this.get("controlSize"));if(!e&&this.$input){this.$input().attr("disabled",b)
-}},_control_content:null,_control_contentDidChange:function(){var b=this.get("content");
-if(this._control_content===b){return}var c=this.contentPropertyDidChange;var a=this._control_content;
-if(a&&a.removeObserver){a.removeObserver("*",this,c)}this._control_content=b;if(b&&b.addObserver){b.addObserver("*",this,c)
-}this.contentPropertyDidChange(b,"*")}.observes("content")};SC.Editable={isEditable:NO,isEditing:NO,beginEditing:function(){if(!this.get("isEditable")){return NO
-}if(this.get("isEditing")){return YES}this.set("isEditing",YES);this.becomeFirstResponder();
-return YES},discardEditing:function(){return !this.get("isEditing")},commitEditing:function(){if(!this.get("isEditing")){return YES
-}this.set("isEditing",NO);this.resignFirstResponder();return YES}};SC.SelectionSupport={hasSelectionSupport:YES,allowsSelection:YES,allowsMultipleSelection:YES,allowsEmptySelection:YES,firstSelectableObject:function(){return this.get("firstObject")
-}.property(),selection:function(c,f){var b=this._scsel_selection,g=b?b.get("length"):0,d,e,a;
-if((f===undefined)||!this.get("allowsSelection")){f=b}a=(f&&f.isEnumerable)?f.get("length"):0;
-if((a>1)&&!this.get("allowsMultipleSelection")){if(g>1){f=SC.SelectionSet.create().addObject(b.get("firstObject")).freeze();
-a=1}else{f=b;a=g}}if((a===0)&&!this.get("allowsEmptySelection")){if(g===0){f=this.get("firstSelectableObject");
-if(f){f=SC.SelectionSet.create().addObject(f).freeze()}else{f=SC.SelectionSet.EMPTY
-}a=f.get("length")}else{f=b;a=g}}if(a===0){f=SC.SelectionSet.EMPTY}f=f.frozenCopy();
-this._scsel_selection=f;return f}.property("arrangedObjects","allowsEmptySelection","allowsMultipleSelection","allowsSelection").cacheable(),hasSelection:function(){var a=this.get("selection");
-return !!a&&(a.get("length")>0)}.property("selection").cacheable(),selectObjects:function(b,c){if(!b||b.get("length")===0){if(!c){this.set("selection",SC.SelectionSet.EMPTY)
-}return this}var a=this.get("selection");if(c&&a){a=a.copy()}else{a=SC.SelectionSet.create()
-}a.addObjects(b).freeze();this.set("selection",a);return this},selectObject:function(a,b){if(a===null){if(!b){this.set("selection",null)
-}return this}else{return this.selectObjects([a],b)}},deselectObjects:function(b){if(!b||b.get("length")===0){return this
-}var a=this.get("selection");if(!a||a.get("length")===0){return this}a=a.copy().removeObjects(b).freeze();
-this.set("selection",a.freeze());return this},deselectObject:function(a){if(!a){return this
-}else{return this.deselectObjects([a])}},updateSelectionAfterContentChange:function(){var e=this.get("arrangedObjects"),f=this.get("selection"),d=f,c,b,a;
-if(d&&e&&d.get("sources").indexOf(e)>=0){c=d.indexSetForSource(e);b=e.get("length");
-a=c?c.get("max"):0;if(a>b){d=d.copy().remove(e,b,a-b).freeze();this.set("selection",d)
-}}if(d===f){b=f?f.get("length"):0;a=e?e.get("length"):0;if((b===0)&&!this.get("allowsEmptySelection")&&a>0){this.notifyPropertyChange("selection")
-}}return this}};SC.StaticLayout={hasStaticLayout:YES,useStaticLayout:NO,renderMixin:function(a,b){a.setClass("sc-static-layout",this.get("useStaticLayout"))
-},clippingFrame:null,parentViewDidResize:null,beginLiveResize:null,endLiveResize:null,viewDidResize:null};
-SC.TreeItemContent={isTreeItemContent:YES,treeItemChildren:null,treeItemIsExpanded:YES,treeItemIsGrouped:NO,treeItemDisclosureState:function(b,a){return this.get("treeItemIsExpanded")?SC.BRANCH_OPEN:SC.BRANCH_CLOSED
-},treeItemCollapse:function(b,a){this.setIfChanged("treeItemIsExpanded",NO)},treeItemExpand:function(b,a){this.setIfChanged("treeItemIsExpanded",YES)
-},treeItemBranchIndexes:function(e,c){var d=this.get("treeItemChildren"),b,g,a,f;
-if(!d){return null}b=SC.IndexSet.create();g=d.get("length");for(a=0;a<g;a++){if(!(f=d.objectAt(a))){continue
-}if(!f.get("treeItemChildren")){continue}if(f.treeItemDisclosureState(this,a)!==SC.LEAF_NODE){b.add(a)
-}}return b.get("length")>0?b:null}};SC.Validatable={initMixin:function(){this._validatable_validatorDidChange()
-},validator:null,errorLabel:null,isValid:function(){return SC.typeOf(this.get("value"))!==SC.T_ERROR
-}.property("value"),ownerForm:null,performValidate:function(c){var a=SC.VALIDATE_OK;
-if(this._validator){var b=this.get("ownerForm");if(c){a=this._validator.validatePartial(b,this);
-if((a==SC.VALIDATE_NO_CHANGE)&&(this._validator.validateChange(b,this)==SC.VALIDATE_OK)){a=SC.VALIDATE_OK
-}}else{a=this._validator.validateChange(b,this)}}return a},performValidateSubmit:function(){return this._validator?this._validator.validateSubmit(this.get("ownerForm"),this):SC.VALIDATE_OK
-},performValidateKeyDown:function(a){var b=a.getCharString();if(!b){return YES}return this._validator?this._validator.validateKeyDown(this.get("ownerForm"),this,b):YES
-},validatorObject:function(){return this._validator}.property(),validateSubmit:function(){return this.performValidateSubmit()
-},objectForFieldValue:function(b,a){return this._validator?this._validator.objectForFieldValue(b,this.get("ownerForm"),this):b
-},fieldValueForObject:function(a){return this._validator?this._validator.fieldValueForObject(a,this.get("ownerForm"),this):a
-},_validatable_displayObserver:function(){this.displayDidChange()}.observes("isValid"),updateLayerMixin:function(a){a.setClass("invalid",!this.get("isValid"))
-},_validatable_validatorDidChange:function(){var a=this.get("ownerForm");var b=SC.Validator.findFor(a,this,this.get("validator"));
-if(b!=this._validator){this.propertyWillChange("validatorObject");if(this._validator){this._validator.detachFrom(a,this)
-}this._validator=b;if(this._validator){this._validator.attachTo(a,this)}this.propertyDidChange("validatorObject")
-}}.observes("validator","ownerForm")};SC.browser=(function(){var c=navigator.userAgent.toLowerCase();
-var a=(c.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];var b={version:a,safari:(/webkit/).test(c)?a:0,opera:(/opera/).test(c)?a:0,msie:(/msie/).test(c)&&!(/opera/).test(c)?a:0,mozilla:(/mozilla/).test(c)&&!(/(compatible|webkit)/).test(c)?a:0,mobileSafari:(/apple.*mobile.*safari/).test(c)?a:0,windows:!!(/(windows)/).test(c),mac:!!((/(macintosh)/).test(c)||(/(mac os x)/).test(c)),language:(navigator.language||navigator.browserLanguage).split("-",1)[0]};
-SC.extend(b,{isOpera:!!b.opera,isIe:!!b.msie,isIE:!!b.msie,isSafari:!!b.safari,isMobileSafari:!!b.mobileSafari,isMozilla:!!b.mozilla,isWindows:!!b.windows,isMac:!!b.mac,current:b.msie?"msie":b.mozilla?"mozilla":b.safari?"safari":b.opera?"opera":"unknown"});
-return b})();SC.Builder=function(a){return SC.Builder.create(a)};SC.Builder.create=function create(c){var b=SC.mixin(SC.beget(this.fn),c||{});
-if(c.hasOwnProperty("toString")){b.toString=c.toString}var a=function(){var d=SC.beget(b);
-d.defaultClass=this;d.constructor=a;return d.init.apply(d,arguments)};a.fn=a.prototype=b;
-a.extend=SC.Builder.create;a.mixin=SC.Builder.mixin;return a};SC.Builder.mixin=function(){var b=arguments.length,a;
-for(a=0;a<b;a++){SC.mixin(this,arguments[a])}return this};SC.Builder.fn={init:function(a){if(a!==undefined){if(SC.typeOf(a)===SC.T_ARRAY){var b=a.length;
-while(--b>=0){this[b]=a.objectAt?a.objectAt(b):a[b]}this.length=a.length}else{this[0]=a;
-this.length=1}}return this},size:function(){return this.length},pushStack:function(){var a=this.constructor.apply(this,arguments);
-a.prevObject=this;return a},end:function(){return this.prevObject||this.constructor()
-},toString:function(){return"%@$(%@)".fmt(this.defaultClass.toString(),SC.A(this).invoke("toString").join(","))
-},mixin:SC.Builder.mixin};(function(){var a=SC.Enumerable,c=SC.Builder.fn,b,d;for(b in a){if(!a.hasOwnProperty(b)){continue
-}d=Array.prototype[b]||a[b];c[b]=d}})();sc_require("system/builder");SC.CoreQuery=(function(){var u=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,e=/^.[^:#\[\.]*$/,f;
-var s=SC.browser.msie?"styleFloat":"cssFloat";var m=(SC.browser.safari&&parseInt(SC.browser.version,0)<417)?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)";
-var p=new RegExp("^("+m+"+)(#)("+m+"+)");var j=new RegExp("^([#.]?)("+m+"*)");var d=new RegExp("([#.]?)("+m+"*)","g");
-var i=["Left","Right"];var c=["Top","Bottom"];var k={position:"absolute",visibility:"hidden",display:"block"};
-var r=function r(x,w,C){var B=w=="width"?x.offsetWidth:x.offsetHeight;var z=0,v=0,A=C.length,y;
-while(--A>=0){y=C[A];z+=parseFloat(b.curCSS(x,"padding"+y,true))||0;v+=parseFloat(b.curCSS(x,"border"+y+"Width",true))||0
-}B-=Math.round(z+v);return B};var g=SC.guidKey,q=0,t={},a=/z-?index|font-?weight|opacity|zoom|line-?height/i,n=document.defaultView||{};
-var l=function l(w){if(!SC.browser.safari){return false}var v=n.getComputedStyle(w,null);
-return !v||v.getPropertyValue("color")==""};function h(v,w){return v[0]&&parseInt(b.curCSS(v[0],w,true),10)||0
-}var o,b;b=o=SC.Builder.create({jquery:"SC.CoreQuery",init:function(v,x){v=v||document;
-if(v.nodeType){this[0]=v;this.length=1;return this}else{if(typeof v==="string"){var w=u.exec(v);
-if(w&&(w[1]||!x)){if(w[1]){v=b.clean([w[1]],x)}else{var y=document.getElementById(w[3]);
-if(y){if(y.id!=w[3]){return b().find(v)}return b(y)}v=[]}}else{return b(x).find(v)
-}}else{if(SC.typeOf(v)===SC.T_FUNCTION){return SC.ready(v)}}}return this.setArray(b.makeArray(v))
-},size:function(){return this.length},get:function(v){return v===f?b.makeArray(this):this[v]
-},find:function(v){var w=b.map(this,function(x){return b.find(v,x)});return this.pushStack(w)
-},filter:function(v){return this.pushStack((SC.typeOf(v)===SC.T_FUNCTION)&&b.grep(this,function(x,w){return v.call(x,w)
-})||b.multiFilter(v,this))},not:function(v){if(typeof v==="string"){if(e.test(v)){return this.pushStack(b.multiFilter(v,this,true))
-}else{v=b.multiFilter(v,this)}}var w=v.length&&v[v.length-1]!==f&&!v.nodeType;return this.filter(function(){return w?b.inArray(this,v)<0:this!=v
-})},setArray:function(v){this.length=0;Array.prototype.push.apply(this,v);return this
-},map:function(v){return this.pushStack(b.map(this,function(x,w){return v.call(x,w,x)
-}))},each:function(w,v){return b.each(this,w,v)},index:function(v){if(v&&v.jquery){v=v[0]
-}return Array.prototype.indexOf.call(this,v)},eq:function(v){return this.slice(v,+v+1)
-},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))
-},add:function(v){return this.pushStack(b.merge(this.get(),typeof v==="string"?b(v):b.makeArray(v)).uniq())
-},attr:function(w,y,x){var v=w;if(typeof w==="string"){if(y===f){return this[0]&&b[x||"attr"](this[0],w)
-}else{v={};v[w]=y}}return this.each(function(z){for(w in v){b.attr((x)?this.style:this,w,b.prop(this,v[w],x,z,w))
-}})},html:function(v){return v===f?(this[0]?this[0].innerHTML.replace(/ CQ\d+="(?:\d+|null)"/g,""):null):this.empty().append(v)
-},andSelf:function(){return this.add(this.prevObject)},is:function(v){return !!v&&b.multiFilter(v,this).length>0
-},hasClass:function(v){return Array.prototype.every.call(this,function(w){return(w.nodeType!=1)||b.className.has(w,v)
-})},val:function(B){if(B===f){var v=this[0];if(v){if(b.nodeName(v,"option")){return(v.attributes.value||{}).specified?v.value:v.text
-}if(b.nodeName(v,"select")){var z=v.selectedIndex,C=[],D=v.options,y=v.type=="select-one";
-if(z<0){return null}var w,A=y?z+1:D.length;for(w=y?z:0;w<A;w++){var x=D[w];if(x.selected){B=b(x).val();
-if(y){return B}C.push(B)}}return C}return(v.value||"").replace(/\r/g,"")}return f
-}else{if(typeof B==="number"){B+=""}this.each(function(){if(this.nodeType!=1){return
-}if(SC.typeOf(B)===SC.T_ARRAY&&(/radio|checkbox/).test(this.type)){this.checked=(b.inArray(this.value,B)>=0||b.inArray(this.name,B)>=0)
-}else{if(b.nodeName(this,"select")){var E=b.makeArray(B);b("option",this).each(function(){this.selected=(b.inArray(this.value,E)>=0||b.inArray(this.text,E)>=0)
-});if(!E.length){this.selectedIndex=-1}}else{this.value=B}}})}return this},clone:function(){var v=this.map(function(){if(SC.browser.msie&&!b.isXMLDoc(this)){var y=this.cloneNode(true),x=document.createElement("div");
-x.appendChild(y);return b.clean([x.innerHTML])[0]}else{return this.cloneNode(true)
-}});var w=v.find("*").andSelf().each(function(){if(this[SC.guidKey]!==f){this[SC.guidKey]=null
-}});return v},css:function(v,w){if((v=="width"||v=="height")&&parseFloat(w,0)<0){w=f
-}return this.attr(v,w,"curCSS")},text:function(w){if(typeof w!=="object"&&w!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(w))
-}var v="";b.each(w||this,function(){b.each(this.childNodes,function(){if(this.nodeType!=8){v+=this.nodeType!=1?this.nodeValue:b.fn.text([this])
-}})});return v},show:function(){var v=SC.$.isVisible;this.each(function(){if(!v(this)){this.style.display=this.oldblock||"";
-if(b.css(this,"display")=="none"){var w=b("<"+this.tagName+"/>");b("body").append(w);
-this.style.display=w.css("display");if(this.style.display==="none"){this.style.display="block"
-}w.remove();w=null}}});return this},hide:function(){var v=SC.$.isVisible;this.each(function(){if(v(this)){this.oldblock=this.oldblock||b.css(this,"display");
-this.style.display="none"}});return this},domManip:function(x,y,w,A){var z=this.length>1,v;
-return this.each(function(){if(!v){v=b.clean(x,this.ownerDocument);if(w){v.reverse()
-}}var B=this;if(y&&b.nodeName(this,"table")&&b.nodeName(v[0],"tr")){B=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"))
-}b.each(v,function(){var C=z?b(this).clone(true)[0]:this;A.call(B,C)})})},append:function(){return this.domManip(arguments,true,false,function(v){if(this.nodeType==1){this.appendChild(v)
-}})},prepend:function(){return this.domManip(arguments,true,true,function(v){if(this.nodeType==1){this.insertBefore(v,this.firstChild)
-}})},before:function(){return this.domManip(arguments,false,false,function(v){this.parentNode.insertBefore(v,this)
-})},after:function(){return this.domManip(arguments,false,true,function(v){this.parentNode.insertBefore(v,this.nextSibling)
-})},replaceWith:function(v){return this.after(v).remove()},removeData:function(v){return this.each(function(){SC.removeData(this,v)
-})}});o.mixin({nodeName:function(w,v){return w.nodeName&&w.nodeName.toUpperCase()==v.toUpperCase()
-},map:function(v,A){var w=[];for(var x=0,y=v.length;x<y;x++){var z=A(v[x],x);if(z!=null){w[w.length]=z
-}}return w.concat.apply([],w)},each:function(x,B,w){var v,y=0,z=x.length;if(w){if(z===f){for(v in x){if(B.apply(x[v],w)===false){break
-}}}else{for(;y<z;){if(B.apply(x[y++],w)===false){break}}}}else{if(z===f){for(v in x){if(B.call(x[v],v,x[v])===false){break
-}}}else{for(var A=x[0];y<z&&B.call(A,y,A)!==false;A=x[++y]){}}}return x},isXMLDoc:function(v){return v.documentElement&&!v.body||v.tagName&&v.ownerDocument&&!v.ownerDocument.body
-},clean:function(v,x){var w=[];x=x||document;if(typeof x.createElement=="undefined"){x=x.ownerDocument||x[0]&&x[0].ownerDocument||document
-}b.each(v,function(B,D){if(typeof D==="number"){D+=""}if(!D){return}if(typeof D==="string"){D=D.replace(/(<(\w+)[^>]*?)\/>/g,function(G,H,F){return F.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?G:H+"></"+F+">"
-});var A=D.replace(/^\s+/,"").substring(0,10).toLowerCase(),E=x.createElement("div");
-var C=!A.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!A.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||A.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!A.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!A.indexOf("<td")||!A.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!A.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||SC.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];
-E.innerHTML=C[1]+D+C[2];while(C[0]--){E=E.lastChild}if(SC.browser.msie){var z=!A.indexOf("<table")&&A.indexOf("<tbody")<0?E.firstChild&&E.firstChild.childNodes:C[1]=="<table>"&&A.indexOf("<tbody")<0?E.childNodes:[];
-for(var y=z.length-1;y>=0;--y){if(b.nodeName(z[y],"tbody")&&!z[y].childNodes.length){z[y].parentNode.removeChild(z[y])
-}}if(/^\s/.test(D)){E.insertBefore(x.createTextNode(D.match(/^\s*/)[0]),E.firstChild)
-}}D=b.makeArray(E.childNodes)}if(D.length===0&&(!b.nodeName(D,"form")&&!b.nodeName(D,"select"))){return
-}if(D[0]===f||b.nodeName(D,"form")||D.options){w.push(D)}else{w=b.merge(w,D)}});return w
-},find:function(I,w){if(typeof I!="string"){return[I]}if(I.indexOf(",")>=0){var D=I.split(",").map(function(K){return b.find(K,w)
-});return D.concat.apply([],D).uniq()}if(w&&w.nodeType!=1&&w.nodeType!=9){return[]
-}w=w||document;var D=[w],F,v=YES;var z=I.match(d),C=z.length,y;for(var G=0;G<C;G++){I=z[G];
-if(I===" "||I===""){v=YES}else{if(v){y=j.exec(I);if((y[1]==="")&&(G<(C-1))&&(z[G+1].charAt(0)==="#")){I=z[G+1];
-z[G+1]=z[G];y=j.exec(I)}var B=[],A=D.length,E,H,x=y[2],J;for(E=0;E<A;E++){H=D[E];
-switch(y[1]){case"":if(!x){x="*"}if(x=="*"&&H.nodeName.toLowerCase()=="object"){x="param"
-}B=b.merge(B,H.getElementsByTagName(x));break;case"#":if(H===document){J=document.getElementById(x);
-if(SC.browser.msie&&J&&J.getAttribute("id")!==x){J=NO}else{if(J){B.push(J)}J=YES}}else{J=NO
-}if(!J){J=H.getElementsByTagName("*");J=Array.prototype.find.call(J,function(K){return K.getAttribute&&(K.getAttribute("id")===x)
-});if(J){B.push(J)}}break;case".":if(H.getElementsByClassName){B=b.merge(B,H.getElementsByClassName(x))
-}else{B=b.merge(B,b.classFilter(H.getElementsByTagName("*"),x))}break;default:}}delete D;
-D=B;v=NO}else{D=b.filter(I,D)}}}if(D&&D[0]==w){D.shift()}return D.uniq()},classFilter:function(A,v,z){v=" "+v+" ";
-var x=[];for(var w=0;A[w];w++){var y=(" "+A[w].className+" ").indexOf(v)>=0;if(!z&&y||z&&!y){x.push(A[w])
-}}return x},filter:function(w,A,z){var v=j.exec(w),B=v[2],y=v[1],x;if(y==="."){return b.classFilter(b.makeArray(A),B,z)
-}else{if(y==="#"){x=function(D){var C=D&&D.getAttribute&&(D.getAttribute("id")===B);
-return(z)?!C:C}}else{x=function(D){var C=b.nodeName(D,B);return(z)?!C:C}}return Array.prototype.filter.call(b.makeArray(A),x)
-}},multiFilter:function(y,v,x){y=(y.indexOf(","))?y.split(","):[y];var A=y.length,z,w=[];
-while(--A>=0){z=b.filter(y[A].trim(),v,x);w=x?v=z:b.merge(z,w)}return w},merge:function(y,v){var w=0,x,z=y.length;
-if(SC.browser.msie){while(x=v[w++]){if(x.nodeType!=8){y[z++]=x}}}else{while(x=v[w++]){y[z++]=x
-}}return y},makeArray:function(x){var v=[];if(x!=null){var w=x.length;if(w==null||typeof x==="string"||x.setInterval){v[0]=x
-}else{while(w){v[--w]=x[w]}}}return v},inArray:function(v,w){return(w.indexOf)?w.indexOf(v):Array.prototype.indexOf.call(w,v)
-},boxModel:!SC.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":s,cssFloat:s,styleFloat:s,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan"},prop:function(y,z,x,w,v){if(SC.typeOf(z)===SC.T_FUNCTION){z=z.call(y,w)
-}return z&&(typeof z==="number")&&x=="curCSS"&&!a.test(v)?z+"px":z},grep:function(w,A,v){var x=[];
-for(var y=0,z=w.length;y<z;y++){if(!v!=!A(w[y],y)){x.push(w[y])}}return x},className:{add:function(w,x){var v=b.className.has;
-b.each((x||"").split(/\s+/),function(y,z){if(w.nodeType==1&&!v(w.className,z)){w.className+=(w.className?" ":"")+z
-}})},remove:function(v,w){if(v.nodeType==1){v.className=w!==f?b.grep(v.className.split(/\s+/),function(x){return !b.className.has(w,x)
-}).join(" "):""}},has:function(w,v){return w&&b.inArray(v,(w.className||w).toString().split(/\s+/))>-1
-}},swap:function(A,z,C,B,v){var w={};for(var y in z){w[y]=A.style[y];A.style[y]=z[y]
-}var x=C(A,B,v);for(var y in z){A.style[y]=w[y]}return x},css:function(x,v,y){if(v=="width"||v=="height"){var A,z=(v=="width")?i:c,w=k;
-A=SC.$.isVisible(x)?r(x,v,z):b.swap(x,w,r,v,z);return Math.max(0,A)}return b.curCSS(x,v,y)
-},curCSS:function(B,w,x){var G,v=B.style;if(w=="opacity"&&SC.browser.msie){G=b.attr(v,"opacity");
-return G==""?"1":G}if(SC.browser.opera&&w==="display"){var H=v.outline;v.outline="0 solid black";
-v.outline=H}var y=w.match(/float/i);if(y){w=s}if(!x&&v&&v[w]){G=v[w]}else{if(n.getComputedStyle){if(y){w="float"
-}w=w.replace(/([A-Z])/g,"-$1").toLowerCase();var I=n.getComputedStyle(B,null);if(I&&!l(B,n)){G=I.getPropertyValue(w)
-}else{var A=[],J=[],K=B,D=0,F,C;for(;K&&l(K);K=K.parentNode){J.unshift(K)}for(C=J.length;
-D<C;D++){if(l(J[D])){A[D]=J[D].style.display;J[D].style.display="block"}}G=(w=="display"&&A[J.length-1]!=null)?"none":(I&&I.getPropertyValue(w))||"";
-for(D=0,F=A.length;D<F;D++){if(A[D]!=null){J[D].style.display=A[D]}}}if(w=="opacity"&&G==""){G="1"
-}}else{if(B.currentStyle){G=B.currentStyle[w]||B.currentStyle[w.camelize()];if(!(/^\d+(px)?$/i).test(G)&&(/^\d/).test(G)){var z=v.left,E=B.runtimeStyle.left;
-B.runtimeStyle.left=B.currentStyle.left;v.left=G||0;G=v.pixelLeft+"px";v.left=z;B.runtimeStyle.left=E
-}}}}return G},dir:function(x,w){var v=[],y=x[w];while(y&&y!=document){if(y.nodeType==1){v.push(y)
-}y=y[w]}return v},nth:function(z,v,x,y){v=v||1;var w=0;for(;z;z=z[x]){if(z.nodeType==1&&++w==v){break
-}}return z},sibling:function(x,w){var v=[];for(;x;x=x.nextSibling){if(x.nodeType==1&&x!=w){v.push(x)
-}}return v},attr:function(w,v,C){if(!w||w.nodeType==3||w.nodeType==8){return f}var x=!b.isXMLDoc(w),B=C!==f,z=SC.browser.msie;
-v=x&&b.props[v]||v;if(w.tagName){var A=/href|src|style/.test(v);if(v=="selected"&&w.parentNode){w.parentNode.selectedIndex
-}if(v in w&&x&&!A){if(B){if(v=="type"&&b.nodeName(w,"input")&&w.parentNode){throw"type property can't be changed"
-}w[v]=C}if(b.nodeName(w,"form")&&w.getAttributeNode(v)){return w.getAttributeNode(v).nodeValue
-}if(v=="tabIndex"){var D=w.getAttributeNode("tabIndex");return D&&D.specified?D.value:w.nodeName.match(/(button|input|object|select|textarea)/i)?0:w.nodeName.match(/^(a|area)$/i)&&w.href?0:f
-}return w[v]}if(z&&x&&v==="style"){return b.attr(w.style,"cssText",C)}if(B){w.setAttribute(v,""+C)
-}var y=(z&&x&&A)?w.getAttribute(v,2):w.getAttribute(v);return y===null?f:y}if(z&&v=="opacity"){if(B){w.zoom=1;
-w.filter=(w.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(C,0)+""=="NaN"?"":"alpha(opacity="+C*100+")")
-}return w.filter&&w.filter.indexOf("opacity=")>=0?(parseFloat(w.filter.match(/opacity=([^)]*)/)[1])/100)+"":""
-}v=v.camelize();if(B){w[v]=C}return w[v]}});b.fn.init.prototype=b.fn;b.each({parent:function(v){return v.parentNode
-},parents:function(v){return b.dir(v,"parentNode")},next:function(v){return b.nth(v,2,"nextSibling")
-},prev:function(v){return b.nth(v,2,"previousSibling")},nextAll:function(v){return b.dir(v,"nextSibling")
-},prevAll:function(v){return b.dir(v,"previousSibling")},siblings:function(v){return b.sibling(v.parentNode.firstChild,v)
-},children:function(v){return b.sibling(v.firstChild)},contents:function(v){return b.nodeName(v,"iframe")?v.contentDocument||v.contentWindow.document:b.makeArray(v.childNodes)
-}},function(v,w){b.fn[v]=function(x){var y=b.map(this,w);if(x&&typeof x=="string"){y=b.multiFilter(x,y)
-}return this.pushStack(y.uniq())}});b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(v,w){b.fn[v]=function(){var x=arguments;
-return this.each(function(){for(var y=0,z=x.length;y<z;y++){b(x[y])[w](this)}})}});
-b.each({removeAttr:function(v){b.attr(this,v,"");if(this.nodeType==1){this.removeAttribute(v)
-}},addClass:function(v){b.className.add(this,v)},removeClass:function(v){b.className.remove(this,v)
-},toggleClass:function(v){b.className[b.className.has(this,v)?"remove":"add"](this,v)
-},remove:function(v){if(!v||b.filter(v,[this]).length){if(this.parentNode){this.parentNode.removeChild(this)
-}}},empty:function(){while(this.firstChild){this.removeChild(this.firstChild)}}},function(v,w){b.fn[v]=function(){return this.each(w,arguments)
-}});b.each(["Height","Width"],function(y,w){var z=w.toLowerCase();b.fn[z]=function(A){if(this[0]===window){if(SC.browser.opera){ret=document.body["client"+w]
-}else{if(SC.browser.safari){ret=window["inner"+w]}else{if(document.compatMode){ret=documentElement["client"+w]
-}else{ret=document.body["client"+w]}}}}else{if(this[0]===document){ret=Math.max(Math.max(document.body["scroll"+w],document.documentElement["scroll"+w]),Math.max(document.body["offset"+w],document.documentElement["offset"+w]))
-}else{if(A==f){return this.length?b.css(this[0],z):null}else{return this.css(z,(typeof A==="string")?A:A+"px")
-}}}return ret};var v=y?"Left":"Top",x=y?"Right":"Bottom";b.fn["inner"+w]=function(){return this[w.toLowerCase()]()+h(this,"padding"+v)+h(this,"padding"+x)
-};b.fn["outer"+w]=function(A){return this["inner"+w]()+h(this,"border"+v+"Width")+h(this,"border"+x+"Width")+(A?h(this,"margin"+v)+h(this,"margin"+x):0)
-}});o.fn.offset=function(){var w=0,E=0,x=this[0],J=SC.browser,A;if(!x){return f}function z(K){I(b.curCSS(K,"borderLeftWidth",true),b.curCSS(K,"borderTopWidth",true))
-}function I(K,L){w+=parseInt(K,10)||0;E+=parseInt(L,10)||0}var G=x.parentNode,D=x,v=x.offsetParent,F=x.ownerDocument,H=J.safari&&parseInt(J.version,0)<522&&!(/adobeair/i).test(J.userAgent),C=b.curCSS,y=b.css(x,"position")=="fixed";
-if(!(J.mozilla&&x==document.body)&&x.getBoundingClientRect){var B=x.getBoundingClientRect();
-I(B.left+Math.max(F.documentElement.scrollLeft,F.body.scrollLeft),B.top+Math.max(F.documentElement.scrollTop,F.body.scrollTop));
-I(-F.documentElement.clientLeft,-F.documentElement.clientTop)}else{I(x.offsetLeft,x.offsetTop);
-while(v){I(v.offsetLeft,v.offsetTop);if(J.mozilla&&!(/^t(able|d|h)$/i).test(v.tagName)||J.safari&&!H){z(v)
-}if(!y&&C(v,"position")=="fixed"){y=true}D=(/^body$/i).test(v.tagName)?D:v;v=v.offsetParent
-}while(G&&G.tagName&&!(/^body|html$/i).test(G.tagName)){if(!(/^inline|table.*$/i).test(C(G,"display"))){I(-G.scrollLeft,-G.scrollTop)
-}if(J.mozilla&&C(G,"overflow")!="visible"){z(G)}G=G.parentNode}if((H&&(y||C(D,"position")=="absolute"))||(J.mozilla&&C(D,"position")!="absolute")){I(-F.body.offsetLeft,-F.body.offsetTop)
-}if(y){I(Math.max(F.documentElement.scrollLeft,F.body.scrollLeft),Math.max(F.documentElement.scrollTop,F.body.scrollTop))
-}}A={top:E,left:w};return A};o.fn.mixin({position:function(){var z=0,y=0,w;if(this[0]){var x=this.offsetParent(),A=this.offset(),v=/^body|html$/i.test(x[0].tagName)?{top:0,left:0}:x.offset();
-A.top-=h(this,"marginTop");A.left-=h(this,"marginLeft");v.top+=h(x,"borderTopWidth");
-v.left+=h(x,"borderLeftWidth");w={top:A.top-v.top,left:A.left-v.left}}return w},offsetParent:function(){var v=this[0].offsetParent||document.body;
-while(v&&(!(/^body|html$/i).test(v.tagName)&&b.css(v,"position")=="static")){v=v.offsetParent
-}return b(v)}});b.each(["Left","Top"],function(w,v){var x="scroll"+v;b.fn[x]=function(y){if(!this[0]){return
-}return y!=f?this.each(function(){this==window||this==document?window.scrollTo(!w?y:b(window).scrollLeft(),w?y:b(window).scrollTop()):this[x]=y
-}):this[0]==window||this[0]==document?self[w?"pageYOffset":"pageXOffset"]||b.boxModel&&document.documentElement[x]||document.body[x]:this[0][x]
-}});return o}());SC.$=(typeof jQuery=="undefined")?SC.CoreQuery:jQuery;SC.mixin(SC.$.fn,{isCoreQuery:YES,toString:function(){var c=[];
-var b=this.length,a=0;for(a=0;a<b;a++){c[a]="%@: %@".fmt(a,(this[a])?this[a].toString():"(null)")
-}return"<$:%@>(%@)".fmt(SC.guidFor(this),c.join(" , "))},isVisible:function(){return Array.prototype.every.call(this,function(a){return SC.$.isVisible(a)
-})},first:function(){return this.pushStack([this[0]])},last:function(){return this.pushStack([this[this.length-1]])
-},view:function(){return this.map(function(){var b=null,a=SC.viewKey,d=this,c;while(!b&&d&&(d!==document)){if(c=d.getAttribute("id")){b=SC.View.views[c]
-}d=d.parentNode}d=null;return b})},setClass:function(d,c){if(SC.none(d)){return this
-}var e=SC.typeOf(d)!==SC.T_STRING;var a=this._fixupClass,b;this.each(function(){if(this.nodeType!==1){return
-}var h=this.className.split(/\s+/),g=NO;if(e){for(var f in d){if(!d.hasOwnProperty(f)){continue
-}g=a(h,f,d[f])||g}}else{g=a(h,d,c)}if(g){this.className=h.join(" ")}});return this
-},_fixupClass:function(d,a,c){var b=d.indexOf(a);if(c){if(b<0){d.push(a);return YES
-}}else{if(b>=0){d[b]=null;return YES}}return NO},within:function(e){e=SC.$(e);var d,c,g,b,a=e.length;
-var f=this.length;while(!d&&(--f>=0)){g=this[f];for(b=0;!d&&(b<a);b++){c=e[b];while(c&&(c!==g)){c=c.parentNode
-}d=c===g}}g=c=null;return d}});(function(){var c={};var f={find:function(i,h){return(h!==undefined)?SC.Enumerable.find.call(this,i,h):c.find.call(this,i)
-},filter:function(i,h){return(h!==undefined)?this.pushStack(SC.Enumerable.filter.call(this,i,h)):c.filter.call(this,i)
-},filterProperty:function(h,i){return this.pushStack(SC.Enumerable.filterProperty.call(this,h,i))
-},indexOf:SC.$.index,map:function(i,h){return(h!==undefined)?SC.Enumerable.map.call(this,i,h):c.map.call(this,i)
-}};var g=SC.$.jquery==="SC.CoreQuery";var d=SC.$.fn,a=g?f:SC.Enumerable;for(var b in a){if(!a.hasOwnProperty(b)){continue
-}var e=a[b];if(b in f){c[b]=d[b];e=f[b]}d[b]=e}})();SC.mixin(SC.$,{isVisible:function(a){var b=SC.$;
-return("hidden"!=a.type)&&(b.css(a,"display")!="none")&&(b.css(a,"visibility")!="hidden")
-}});sc_require("system/core_query");SC.Event=function(d){if(d){this.originalEvent=d;
-var g=SC.Event._props,c=g.length,b=c;while(--b>=0){var e=g[b];this[e]=d[e]}}this.timeStamp=this.timeStamp||Date.now();
-if(!this.target){this.target=this.srcElement||document}if(this.target.nodeType===3){this.target=this.target.parentNode
-}if(!this.relatedTarget&&this.fromElement){this.relatedTarget=(this.fromElement===this.target)?this.toElement:this.fromElement
-}if(SC.none(this.pageX)&&!SC.none(this.clientX)){var h=document.documentElement,a=document.body;
-this.pageX=this.clientX+(h&&h.scrollLeft||a&&a.scrollLeft||0)-(h.clientLeft||0);this.pageY=this.clientY+(h&&h.scrollTop||a&&a.scrollTop||0)-(h.clientTop||0)
-}if(!this.which&&((this.charCode||d.charCode===0)?this.charCode:this.keyCode)){this.which=this.charCode||this.keyCode
-}if(!this.metaKey&&this.ctrlKey){this.metaKey=this.ctrlKey}if(!this.which&&this.button){this.which=((this.button&1)?1:((this.button&2)?3:((this.button&4)?2:0)))
-}if(SC.browser.safari&&d.wheelDelta!==undefined){this.wheelDelta=this.wheelDeltaY=0-(d.wheelDeltaY||d.wheelDelta);
-this.wheelDeltaX=0-(d.wheelDeltaX||0)}else{if(!SC.none(d.detail)){var f=Math.floor(d.detail*2);
-if(d.axis&&(d.axis===d.HORIZONTAL_AXIS)){this.wheelDeltaX=f;this.wheelDeltaY=this.wheelDelta=0
-}else{this.wheelDeltaY=this.wheelDelta=f;this.wheelDeltaX=0}}else{this.wheelDelta=this.wheelDeltaY=SC.browser.msie?0-d.wheelDelta:d.wheelDelta;
-this.wheelDeltaX=0}}return this};SC.mixin(SC.Event,{create:function(a){return new SC.Event(a)
-},add:function(e,d,f,g,c){if(e&&e.isCoreQuery){if(e.length>0){e.forEach(function(h){this.add(h,d,f,g,c)
-},this);return this}else{e=e.get(0)}}if(!e){return this}if(e.nodeType==3||e.nodeType==8){return SC.Event
-}if(SC.browser.msie&&e.setInterval){e=window}if(SC.typeOf(f)===SC.T_FUNCTION){c=g;
-g=f;f=null}else{if(f&&SC.typeOf(g)===SC.T_STRING){g=f[g]}}var b=SC.data(e,"events")||SC.data(e,"events",{});
-var a=b[d];if(!a){a=b[d]={};this._addEventListener(e,d)}a[SC.guidFor(g)]=[f,g,c];
-SC.Event._global[d]=YES;e=b=a=null;return this},remove:function(f,e,g,h){if(f&&f.isCoreQuery){if(f.length>0){f.forEach(function(i){this.remove(i,e,g,h)
-},this);return this}else{f=f.get(0)}}if(!f){return this}if(f.nodeType==3||f.nodeType==8){return SC.Event
-}if(SC.browser.msie&&f.setInterval){f=window}var a,d,c=SC.data(f,"events");if(!c){return this
-}if(e===undefined){for(e in c){this.remove(f,e)}}else{if(a=c[e]){var b=NO;if(g||h){if(SC.typeOf(g)===SC.T_FUNCTION){h=g;
-g=null}else{if(SC.typeOf(h)===SC.T_STRING){h=g[h]}}delete c[SC.guidFor(h)];d=null;
-for(d in a){break}if(d===null){b=YES}}else{b=YES}if(b){delete c[e];this._removeEventListener(f,e)
-}d=null;for(d in c){break}if(!d){SC.removeData(f,"events");delete this._elements[SC.guidFor(f)]
-}}}f=c=a=null;return this},NO_BUBBLE:["blur","focus","change"],simulateEvent:function(d,c,b){var a=SC.Event.create({type:c,target:d,preventDefault:function(){this.cancelled=YES
-},stopPropagation:function(){this.bubbles=NO},allowDefault:function(){this.hasCustomEventHandling=YES
-},timeStamp:Date.now(),bubbles:(this.NO_BUBBLE.indexOf(c)<0),cancelled:NO,normalized:YES});
-if(b){SC.mixin(a,b)}return a},trigger:function(c,b,i,j){if(c&&c.isCoreQuery){if(c.length>0){c.forEach(function(m){this.trigger(m,b,i,j)
-},this);return this}else{c=c.get(0)}}if(!c){return this}if(c.nodeType==3||c.nodeType==8){return undefined
-}i=SC.A(i);var h,k=SC.typeOf(c[b]||null)===SC.T_FUNCTION;var a=i[0];if(!a||!a.preventDefault){a=this.simulateEvent(c,b);
-i.unshift(a)}a.type=b;var g=c;do{h=SC.Event.handle.apply(g,i);g=(g===document)?null:(g.parentNode||document)
-}while(!h&&a.bubbles&&g);g=null;var d=c["on"+b];var l=SC.CoreQuery.nodeName(c,"a")&&b==="click";
-if((!k||l)&&d&&d.apply(c,i)===NO){h=NO}if(k&&j!==NO&&h!==NO&&!l){this.triggered=YES;
-try{c[b]()}catch(f){}}this.triggered=NO;return h},handle:function(b){if((typeof SC==="undefined")||SC.Event.triggered){return YES
-}var c,g,e,i,d,h;h=SC.A(arguments);h[0]=b=SC.Event.normalizeEvent(b||window.event);
-d=(SC.data(this,"events")||{})[b.type];if(!d){return NO}for(var j in d){var k=d[j];
-var a=k[1];b.handler=a;b.data=b.context=k[2];var f=k[0]||this;g=a.apply(f,h);if(c!==NO){c=g
-}if(g===NO){b.preventDefault();b.stopPropagation()}}return c},unload:function(){var a,b=this._elements;
-for(a in b){this.remove(b[a])}for(a in b){delete b[a]}delete this._elements},special:{ready:{setup:function(){SC._bindReady();
-return},teardown:function(){return}},mouseenter:{setup:function(){if(SC.browser.msie){return NO
-}SC.Event.add(this,"mouseover",SC.Event.special.mouseover.handler);return YES},teardown:function(){if(SC.browser.msie){return NO
-}SC.Event.remove(this,"mouseover",SC.Event.special.mouseover.handler);return YES},handler:function(a){if(SC.Event._withinElement(a,this)){return YES
-}a.type="mouseenter";return SC.Event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(SC.browser.msie){return NO
-}SC.Event.add(this,"mouseout",SC.Event.special.mouseleave.handler);return YES},teardown:function(){if(SC.browser.msie){return NO
-}SC.Event.remove(this,"mouseout",SC.Event.special.mouseleave.handler);return YES},handler:function(a){if(SC.Event._withinElement(a,this)){return YES
-}a.type="mouseleave";return SC.Event.handle.apply(this,arguments)}}},KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,_withinElement:function(d,c){var b=d.relatedTarget;
-while(b&&b!=c){try{b=b.parentNode}catch(a){b=c}}return b===c},_addEventListener:function(d,c){var e,b=this.special[c];
-if(!b||b.setup.call(d)===NO){var a=SC.guidFor(d);this._elements[a]=d;e=SC.data(d,"listener")||SC.data(d,"listener",function(){return SC.Event.handle.apply(SC.Event._elements[a],arguments)
-});if(d.addEventListener){d.addEventListener(c,e,NO)}else{if(d.attachEvent){d.attachEvent("on"+c,e)
-}}}d=b=e=null},_removeEventListener:function(c,b){var d,a=SC.Event.special[b];if(!a||(a.teardown.call(c)===NO)){d=SC.data(c,"listener");
-if(d){if(c.removeEventListener){c.removeEventListener(b,d,NO)}else{if(c.detachEvent){c.detachEvent("on"+b,d)
-}}}}c=a=d=null},_elements:{},normalizeEvent:function(a){if(a==window.event){return SC.Event.create(a)
-}else{return a.normalized?a:SC.Event.create(a)}},_global:{},_props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view which touches targetTouches changedTouches".split(" ")});
-SC.Event.prototype={hasCustomEventHandling:NO,allowDefault:function(){this.hasCustomEventHandling=YES;
-return this},preventDefault:function(){var a=this.originalEvent;if(a){if(a.preventDefault){a.preventDefault()
-}a.returnValue=NO}this.hasCustomEventHandling=YES;return this},stopPropagation:function(){var a=this.originalEvent;
-if(a){if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=YES}this.hasCustomEventHandling=YES;
-return this},stop:function(){return this.preventDefault().stopPropagation()},normalized:YES,getCharString:function(){return(this.charCode>0)?String.fromCharCode(this.which):null
-},commandCodes:function(){var e=this.keyCode,b=null,c=null,a="",d;if(e){b=SC.FUNCTION_KEYS[e];
-if(!b&&(this.altKey||this.ctrlKey||this.metaKey)){b=SC.PRINTABLE_KEYS[e]}if(b){if(this.altKey){a+="alt_"
-}if(this.ctrlKey||this.metaKey){a+="ctrl_"}if(this.shiftKey){a+="shift_"}}}if(!b){e=this.which;
-c=b=String.fromCharCode(e);d=b.toLowerCase();if(this.metaKey){a="meta_";b=d}else{b=null
-}}if(b){b=a+b}return[b,c]}};SC.Event.observe=SC.Event.add;SC.Event.stopObserving=SC.Event.remove;
-SC.Event.fire=SC.Event.trigger;SC.Event.add(window,"unload",SC.Event.prototype,SC.Event.unload);
-SC.MODIFIER_KEYS={16:"shift",17:"ctrl",18:"alt"};SC.FUNCTION_KEYS={8:"backspace",9:"tab",13:"return",19:"pause",27:"escape",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",44:"printscreen",45:"insert",46:"delete",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock"};
-SC.PRINTABLE_KEYS={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'};
-SC.SYSTEM_CURSOR="default";SC.AUTO_CURSOR=SC.DEFAULT_CURSOR="auto";SC.CROSSHAIR_CURSOR="crosshair";
-SC.HAND_CURSOR=SC.POINTER_CURSOR="pointer";SC.MOVE_CURSOR="move";SC.E_RESIZE_CURSOR="e-resize";
-SC.NE_RESIZE_CURSOR="ne-resize";SC.NW_RESIZE_CURSOR="nw-resize";SC.N_RESIZE_CURSOR="n-resize";
-SC.SE_RESIZE_CURSOR="se-resize";SC.SW_RESIZE_CURSOR="sw-resize";SC.S_RESIZE_CURSOR="s-resize";
-SC.W_RESIZE_CURSOR="w-resize";SC.IBEAM_CURSOR=SC.TEXT_CURSOR="text";SC.WAIT_CURSOR="wait";
-SC.HELP_CURSOR="help";SC.Cursor=SC.Object.extend({init:function(){arguments.callee.base.apply(this,arguments);
-var a=this.get("cursorStyle")||SC.DEFAULT_CURSOR;var b=this.constructor.sharedStyleSheet();
-if(b.insertRule){b.insertRule(".%@ {cursor: %@;}".fmt(SC.guidFor(this),a),b.cssRules?b.cssRules.length:0)
-}else{if(b.addRule){b.addRule("."+SC.guidFor(this),"cursor: "+a)}}this.cursorStyle=a;
-this.className=SC.guidFor(this);return this},className:null,cursorStyle:SC.DEFAULT_CURSOR,cursorStyleDidChange:function(){var d=this.get("cursorStyle")||SC.DEFAULT_CURSOR;
-var f=this._rule;if(f){f.style.cursor=d;return}var c="."+this.get("className");var e=this.constructor.sharedStyleSheet();
-var g=(e.cssRules?e.cssRules:e.rules)||[];for(var b=0,a=g.length;b<a;++b){f=g[b];
-if(f.selectorText===c){this._rule=f;f.style.cursor=d;break}}}.observes("cursorStyle")});
-SC.Cursor.sharedStyleSheet=function(){var b=this._styleSheet;if(!b){b=document.createElement("style");
-b.type="text/css";var a=document.getElementsByTagName("head")[0];if(!a){a=document.documentElement
-}a.appendChild(b);b=document.styleSheets[document.styleSheets.length-1];this._styleSheet=b
-}return b};SC.Responder=SC.Object.extend({isResponder:YES,pane:null,responderContext:null,nextResponder:null,isFirstResponder:NO,hasFirstResponder:NO,acceptsFirstResponder:YES,becomeFirstResponder:function(){var a=this.get("pane")||this.get("responderContext")||this.pane();
-if(a&&this.get("acceptsFirstResponder")){if(a.get("firstResponder")!==this){a.makeFirstResponder(this)
-}}return this},resignFirstResponder:function(){var a=this.get("pane")||this.get("responderContext");
-if(a&&(a.get("firstResponder")===this)){a.makeFirstResponder(null)}return YES},willLoseFirstResponder:function(a){},didBecomeFirstResponder:function(a){}});
-sc_require("system/browser");sc_require("system/event");sc_require("system/cursor");
-sc_require("system/responder");sc_require("mixins/string");SC.viewKey=SC.guidKey+"_view";
-SC.LAYOUT_HORIZONTAL="sc-layout-horizontal";SC.LAYOUT_VERTICAL="sc-layout-vertical";
-SC._VIEW_DEFAULT_DIMS="marginTop marginLeft".w();SC.ANCHOR_TOP={top:0};SC.ANCHOR_LEFT={left:0};
-SC.ANCHOR_TOP_LEFT={top:0,left:0};SC.ANCHOR_BOTTOM={bottom:0};SC.ANCHOR_RIGHT={right:0};
-SC.ANCHOR_BOTTOM_RIGHT={bottom:0,right:0};SC.FULL_WIDTH={left:0,right:0};SC.FULL_HEIGHT={top:0,bottom:0};
-SC.ANCHOR_CENTER={centerX:0,centerY:0};SC.LAYOUT_AUTO="auto";SC.EMPTY_CHILD_VIEWS_ARRAY=[];
-SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone=YES;SC.View=SC.Responder.extend(SC.DelegateSupport,{concatenatedProperties:"outlets displayProperties layoutProperties classNames renderMixin didCreateLayerMixin willDestroyLayerMixin".w(),pane:function(){var a=this;
-while(a&&!a.isPane){a=a.get("parentView")}return a}.property("parentView").cacheable(),page:null,splitView:function(){var a=this;
-while(a&&!a.isSplitView){a=a.get("parentView")}return a}.property("parentView").cacheable(),parentView:null,backgroundColor:null,isEnabled:YES,isEnabledBindingDefault:SC.Binding.oneWay().bool(),isEnabledInPane:function(){var a=this.get("isEnabled"),b;
-if(a&&(b=this.get("parentView"))){a=b.get("isEnabledInPane")}return a}.property("parentView","isEnabled"),isVisible:YES,isVisibleBindingDefault:SC.Binding.bool(),isVisibleInWindow:NO,recomputeIsVisibleInWindow:function(c){var e=this.get("isVisibleInWindow");
-var g=this.get("isVisible"),d;if(g){g=(c===undefined)?((d=this.get("parentView"))?d.get("isVisibleInWindow"):NO):c
-}if(e!==g){this.set("isVisibleInWindow",g);this._needsVisibiltyChange=YES;var f=this.get("childViews"),b=f.length,a;
-for(a=0;a<b;a++){f[a].recomputeIsVisibleInWindow(g)}if(g){if(this.parentViewDidResize){this.parentViewDidResize()
-}if(this.get("childViewsNeedLayout")){this.invokeOnce(this.layoutChildViewsIfNeeded)
-}}this.set("layerNeedsUpdate",YES);if(!g&&this.get("isFirstResponder")){this.resignFirstResponder()
-}}return this}.observes("isVisible"),childViews:SC.EMPTY_CHILD_VIEWS_ARRAY,insertBefore:function(b,d){b.beginPropertyChanges();
-if(b.get("parentView")){b.removeFromParent()}if(this.willAddChild){this.willAddChild(b,d)
-}if(b.willAddToParent){b.willAddToParent(this,d)}b.set("parentView",this);var a,c=this.get("childViews");
-if(c.needsClone){this.set(c=[])}a=(d)?c.indexOf(d):c.length;if(a<0){a=c.length}c.insertAt(a,b);
-b.parentViewDidChange();b.layoutDidChange();if(this.didAddChild){this.didAddChild(b,d)
-}if(b.didAddToParent){b.didAddToParent(this,d)}b.endPropertyChanges();return this
-},removeChild:function(b){if(!b){return this}if(b.parentView!==this){throw"%@.removeChild(%@) must belong to parent".fmt(this,b)
-}if(b.willRemoveFromParent){b.willRemoveFromParent()}if(this.willRemoveChild){this.willRemoveChild(b)
-}b.set("parentView",null);var c=this.get("childViews");var a=c.indexOf(b);if(a>=0){c.removeAt(a)
-}b.parentViewDidChange();if(this.didRemoveChild){this.didRemoveChild(b)}if(b.didRemoveFromParent){b.didRemoveFromParent(this)
-}return this},removeAllChildren:function(){var b=this.get("childViews"),a;while(a=b.objectAt(b.get("length")-1)){this.removeChild(a)
-}return this},removeFromParent:function(){var a=this.get("parentView");if(a){a.removeChild(this)
-}return this},replaceChild:function(a,b){a.beginPropertyChanges();b.beginPropertyChanges();
-this.beginPropertyChanges();this.insertBefore(a,b).removeChild(b);this.endPropertyChanges();
-b.endPropertyChanges();a.endPropertyChanges();return this},replaceAllChildren:function(c){var b=c.get("length"),a;
-this.beginPropertyChanges();this.destroyLayer().removeAllChildren();for(a=0;a<b;a++){this.appendChild(c.objectAt(a))
-}this.replaceLayer();this.endPropertyChanges();return this},appendChild:function(a){return this.insertBefore(a,null)
-},parentViewDidChange:function(){this.recomputeIsVisibleInWindow();this.set("layerLocationNeedsUpdate",YES);
-this.invokeOnce(this.updateLayerLocationIfNeeded);this._invalidatePaneCacheForSelfAndAllChildViews();
-return this}.observes("isVisible"),_invalidatePaneCacheForSelfAndAllChildViews:function(){this.notifyPropertyChange("pane");
-var c=this.get("childViews");var b=c.length;for(var a=0;a<b;++a){var d=c[a];if(d._invalidatePaneCacheForSelfAndAllChildViews){d._invalidatePaneCacheForSelfAndAllChildViews()
-}}},layer:function(a,c){if(c!==undefined){this._view_layer=c}else{c=this._view_layer;
-if(!c){var b=this.get("parentView");if(b){b=b.get("layer")}if(b){this._view_layer=c=this.findLayerInParentLayer(b)
-}b=null}}return c}.property("isVisibleInWindow").cacheable(),$:function(c){var a,b=this.get("layer");
-a=!b?SC.$([]):(c===undefined)?SC.$(b):SC.$(c,b);b=null;return a},containerLayer:function(){return this.get("layer")
-}.property("layer").cacheable(),layerId:function(){return SC.guidFor(this)}.property().cacheable(),findLayerInParentLayer:function(d){var a=this.get("layerId");
-var f,c,b,h,e;if(d.getElementById){e=d.getElementById(a)}else{e=document.getElementById(a)
-}if(SC.browser.msie&&e&&e.id!==a){e=null}if(!e&&d.querySelector){}if(!e){e=d.firstChild;
-var g=[];g.push(d);while(g.length!==0){f=g[0];g.shift();if(f.id===a){h=true;e=f;break
-}for(c=0,b=f.childNodes.length;c<b;c++){g.push(f.childNodes[c])}}if(!h){e=null}}return e
-},displayDidChange:function(){this.set("layerNeedsUpdate",YES);return this},layerNeedsUpdate:NO,_view_layerNeedsUpdateDidChange:function(){if(this.get("layerNeedsUpdate")){this.invokeOnce(this.updateLayerIfNeeded)
-}}.observes("layerNeedsUpdate"),updateLayerIfNeeded:function(){var a=this.get("isVisibleInWindow");
-if((a||this._needsVisibiltyChange)&&this.get("layerNeedsUpdate")){this._needsVisibiltyChange=NO;
-if(this.get("layer")){this.beginPropertyChanges();this.set("layerNeedsUpdate",NO);
-this.updateLayer();this.endPropertyChanges()}}else{this.set("layerNeedsUpdate",NO)
-}return this},updateLayer:function(){var a=this.renderContext(this.get("layer"));
-this.prepareContext(a,NO);a.update();if(this.didUpdateLayer){this.didUpdateLayer()
-}return this},renderContext:function(a){return SC.RenderContext(a)},createLayer:function(){if(this.get("layer")){return this
-}var a=this.renderContext(this.get("tagName"));this.prepareContext(a,YES);this.set("layer",a.element());
-this._notifyDidCreateLayer();return this},_notifyDidCreateLayer:function(){if(this.didCreateLayer){this.didCreateLayer()
-}var c=this.didCreateLayerMixin,b,a;if(c){b=c.length;for(a=0;a<b;++a){c[a].call(this)
-}}var d=this.get("childViews");b=d.length;for(a=0;a<b;++a){if(!d[a]){continue}d[a]._notifyDidCreateLayer()
-}},destroyLayer:function(){var a=this.get("layer");if(a){this._notifyWillDestroyLayer();
-if(a.parentNode){a.parentNode.removeChild(a)}a=null}return this},replaceLayer:function(){this.destroyLayer();
-this.set("layerLocationNeedsUpdate",YES);this.invokeOnce(this.updateLayerLocationIfNeeded)
-},_notifyWillDestroyLayer:function(){if(this.willDestroyLayer){this.willDestroyLayer()
-}var c=this.willDestroyLayerMixin,b,a;if(c){b=c.length;for(a=0;a<b;++a){c[a].call(this)
-}}var d=this.get("childViews");b=d.length;for(a=0;a<b;++a){d[a]._notifyWillDestroyLayer()
-}this.set("layer",null)},prepareContext:function(f,h){var e,b,a,d,c,g;if(h){d=this.layerId?this.get("layerId"):SC.guidFor(this);
-f.id(d).classNames(this.get("classNames"),YES);this.renderLayout(f,h)}else{f.resetClassNames();
-f.classNames(this.get("classNames"),YES)}if(this.get("isTextSelectable")){f.addClass("allow-select")
-}if(!this.get("isEnabled")){f.addClass("disabled")}if(!this.get("isVisible")){f.addClass("hidden")
-}if(this.get("isFirstResponder")){f.addClass("focus")}c=this.get("backgroundColor");
-if(c){f.addStyle("backgroundColor",c)}g=this.get("cursor");if(g){f.addClass(g.get("className"))
-}this.beginPropertyChanges();this.set("layerNeedsUpdate",NO);this.render(f,h);if(e=this.renderMixin){b=e.length;
-for(a=0;a<b;++a){e[a].call(this,f,h)}}this.endPropertyChanges()},renderChildViews:function(e,f){var d=this.get("childViews"),b=d.length,a,c;
-for(a=0;a<b;++a){c=d[a];if(!c){continue}e=e.begin(c.get("tagName"));c.prepareContext(e,f);
-e=e.end()}return e},render:function(a,b){if(b){this.renderChildViews(a,b)}},tagName:"div",classNames:["sc-view"],toolTip:null,isTextSelectable:NO,displayProperties:["isFirstResponder","isVisible"],cursor:null,layerLocationNeedsUpdate:NO,updateLayerLocationIfNeeded:function(a){if(this.get("layerLocationNeedsUpdate")){this.set("layerLocationNeedsUpdate",NO);
-this.updateLayerLocation()}return this},updateLayerLocation:function(){var e=this.get("layer");
-var d=this.get("parentView");var b=d?d.get("containerLayer"):null;if(e&&e.parentNode&&e.parentNode!==b){e.parentNode.removeChild(e)
-}if(!d){if(e&&e.parentNode){e.parentNode.removeChild(e)}}else{if(!b){if(e){if(e.parentNode){e.parentNode.removeChild(e)
-}this.destroyLayer()}}else{if(!e){this.createLayer();e=this.get("layer")}var f=d.get("childViews");
-var c=f.objectAt(f.indexOf(this)+1);var a=(c)?c.get("layer"):null;if(c&&(!a||a.parentNode!==b)){c.updateLayerLocationIfNeeded();
-a=c.get("layer")}if((e.parentNode!==b)||(e.nextSibling!==a)){b.insertBefore(e,a);
-if(this.parentViewDidResize){this.parentViewDidResize()}}}}b=d=e=null;return this
-},nextResponder:function(){return this.get("parentView")}.property("parentView").cacheable(),acceptsFirstResponder:NO,isKeyResponder:NO,willLoseKeyResponderTo:function(a){},willBecomeKeyResponderFrom:function(a){},didLoseKeyResponderTo:function(a){},didBecomeKeyResponderFrom:function(a){},interpretKeyEvents:function(b){var a=b.commandCodes(),d=a[0],e=a[1],g;
-if(!d&&!e){return null}if(d){var h=SC.MODIFIED_KEY_BINDINGS[d]||SC.BASE_KEY_BINDINGS[d.match(/[^_]+$/)[0]];
-if(h){var f=this,c=this.get("pane"),i=null;while(f&&!(i=f.tryToPerform(h,b))){f=(f===c)?null:f.get("nextResponder")
-}return i}}if(e&&this.respondsTo("insertText")){g=this.insertText(e,b);return g?(g===YES?this:g):null
-}return null},insertText:function(a){return NO},performKeyEquivalent:function(e,c){var d=NO,f=this.get("childViews"),b=f.length,a=-1;
-while(!d&&(++a<b)){d=f[a].performKeyEquivalent(e,c)}return d},nextKeyView:null,nextValidKeyView:function(){var a=SC.CoreSet.create(),b=this._computeNextValidKeyView(a);
-a.destroy();return b}.property("nextKeyView"),_computeNextValidKeyView:function(c){var d=this.get("nextKeyView"),e,b,a;
-c.add(this);if(!d){e=this.get("parentView");b=e?e.get("childViews"):null;a=b?b.indexOf(this):-1;
-if(a<0){d=null}else{if(a+1>=b.get("length")){d=b.objectAt(0)}else{d=b.objectAt(a+1)
-}}}if(d&&!d.get("acceptsFirstResponder")){if(c.contains(d)){d=null}else{d=d._computeNextValidKeyView(c)
-}}return d},previousKeyView:null,previousValidKeyView:function(){var a=SC.CoreSet.create(),b=this._computePreviousValidKeyView(a);
-a.destroy();return b}.property("previousKeyView"),_computePreviousValidKeyView:function(c){var d=this.get("previousKeyView"),e,b,a;
-c.add(this);if(!d){e=this.get("parentView");b=e?e.get("childViews"):null;a=b?b.indexOf(this):-1;
-if(a<0){d=null}else{if(a>0){d=b.objectAt(a-1)}else{d=b.objectAt(b.get("length")-1)
-}}}if(d&&!d.get("acceptsFirstResponder")){if(c.contains(d)){d=null}else{d=d._computePreviousValidKeyView(c)
-}}return d},init:function(){var e,g,c,b,a,d,h;arguments.callee.base.apply(this,arguments);
-if(!this.get("isMaterialized")){SC.View.views[this.get("layerId")]=this}var f=this.get("childViews");
-this.childViews=f?f.slice():[];this.createChildViews();h=this.get("displayProperties");
-b=h.length;while(--b>=0){this.addObserver(h[b],this,this.displayDidChange)}if(this.get("isDropTarget")){SC.Drag.addDropTarget(this)
-}if(this.get("isScrollable")){SC.Drag.addScrollableView(this)}},awake:function(){arguments.callee.base.apply(this,arguments);
-var c=this.get("childViews"),b=c.length,a;for(a=0;a<b;++a){if(!c[a]){continue}c[a].awake()
-}},destroy:function(){if(this.get("isDestroyed")){return this}arguments.callee.base.apply(this,arguments);
-this.removeFromParent();this._destroy();if(this.get("isDropTarget")){SC.Drag.removeDropTarget(this)
-}if(this.get("isScrollable")){SC.Drag.removeScrollableView(this)}return this},_destroy:function(){if(this.get("isDestroyed")){return this
-}this.destroyLayer();var c=this.get("childViews"),b=c.length,a;if(b){c=c.slice();
-for(a=0;a<b;++a){c[a]._destroy()}}delete SC.View.views[this.get("layerId")];delete this._CQ;
-delete this.page;this.set("isDestroyed",YES);return this},createChildViews:function(){var f=this.get("childViews"),b=f.length,a,e,d,c;
-this.beginPropertyChanges();for(a=0;a<b;++a){if(e=(c=f[a])){if(typeof e===SC.T_STRING){c=this[e]
-}else{e=null}if(!c){console.error("No view with name "+e+" has been found in "+this.toString());
-continue}if(c.isClass){c=this.createChildView(c);if(e){this[e]=c}}}f[a]=c}this.endPropertyChanges();
-return this},createChildView:function(a,b){if(!b){b={}}b.owner=b.parentView=this;
-b.isVisibleInWindow=this.get("isVisibleInWindow");if(!b.page){b.page=this.page}a=a.create(b);
-return a},adjust:function(a,d){var b=SC.clone(this.get("layout")),c=NO,f;if(a===undefined){return this
-}if(SC.typeOf(a)===SC.T_STRING){f=b[a];if(SC.none(d)){if(f!==undefined){c=YES}delete b[a]
-}else{if(f!==d){c=YES}b[a]=d}}else{var e=a;for(a in e){if(!e.hasOwnProperty(a)){continue
-}d=e[a];f=b[a];if(d===null){if(f!==undefined){c=YES}delete b[a]}else{if(d!==undefined){if(f!==d){c=YES
-}b[a]=d}}}}if(c){this.set("layout",b)}return this},layout:{top:0,left:0,bottom:0,right:0},convertFrameToView:function(i,d){var c=0,b=0,g=0,e=0,a=this,h;
-if(this.get("useStaticLayout")){throw"convertFrameToView is not available with static layout"
-}while(a){h=a.get("frame");c+=h.x;b+=h.y;a=a.get("layoutView")}if(d){a=d;while(a){h=a.get("frame");
-g+=h.x;e+=h.y;a=a.get("layoutView")}}c=i.x+c-g;b=i.y+b-e;return{x:c,y:b,width:i.width,height:i.height}
-},convertFrameFromView:function(b,a){var j=0,h=0,g=0,e=0,i=this,c,d;if(this.get("useStaticLayout")){throw"convertFrameToView is not available with static layout"
-}while(i){d=i.get("frame");j+=d.x;h+=d.y;i=i.get("parentView")}if(a){i=a;while(i){d=i.get("frame");
-g+=d.x;e+=d.y;i=i.get("parentView")}}j=b.x-j+g;h=b.y-h+e;return{x:j,y:h,width:b.width,height:b.height}
-},scrollToVisible:function(){var a=this.get("parentView");while(a&&!a.get("isScrollable")){a=a.get("parentView")
-}if(a){a.scrollToVisible();return a.scrollToVisible(this)}else{return NO}},frame:function(){return this.computeFrameWithParentFrame(null)
-}.property("layout","useStaticLayout").cacheable(),computeFrameWithParentFrame:function(a){var g=this.get("layout");
-var h={},c,e,d=SC.LAYOUT_AUTO;var b=this.get("useStaticLayout");if(g.width!==undefined&&g.width===SC.LAYOUT_AUTO&&b!==undefined&&!b){c=SC.Error.desc("%@.layout() you cannot use width:auto if staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
-console.error(c.toString());throw c}if(g.height!==undefined&&g.height===SC.LAYOUT_AUTO&&b!==undefined&&!b){c=SC.Error.desc("%@.layout() you cannot use height:auto if staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
-console.error(c.toString());throw c}if(b){return null}if(!SC.none(g.left)){h.x=Math.floor(g.left);
-if(g.width!==undefined){if(g.width===d){h.width=d}else{h.width=Math.floor(g.width)
-}}else{if(!a){a=this.computeParentDimensions(g)}h.width=Math.floor(a.width-h.x-(g.right||0))
-}}else{if(!SC.none(g.right)){if(!a){a=this.computeParentDimensions(g)}if(SC.none(g.width)){h.width=a.width-g.right;
-h.x=0}else{if(g.width===d){h.width=d}else{h.width=Math.floor(g.width||0)}h.x=Math.floor(a.width-g.right-h.width)
-}}else{if(!SC.none(g.centerX)){if(!a){a=this.computeParentDimensions(g)}if(g.width===d){h.width=d
-}else{h.width=Math.floor(g.width||0)}h.x=Math.floor((a.width-h.width)/2+g.centerX)
-}else{h.x=0;if(SC.none(g.width)){if(!a){a=this.computeParentDimensions(g)}h.width=Math.floor(a.width)
-}else{if(g.width===d){h.width=d}else{h.width=Math.floor(g.width||0)}}}}}if(!SC.none(g.top)){h.y=Math.floor(g.top);
-if(g.height!==undefined){if(g.height===d){h.height=d}else{h.height=Math.floor(g.height)
-}}else{if(!a){a=this.computeParentDimensions(g)}h.height=Math.floor(a.height-h.y-(g.bottom||0))
-}}else{if(!SC.none(g.bottom)){if(!a){a=this.computeParentDimensions(g)}if(SC.none(g.height)){h.height=a.height-g.bottom;
-h.y=0}else{if(g.height===d){h.height=d}else{h.height=Math.floor(g.height||0)}h.y=Math.floor(a.height-g.bottom-h.height)
-}}else{if(!SC.none(g.centerY)){if(!a){a=this.computeParentDimensions(g)}if(g.height===d){h.height=d
-}else{h.height=Math.floor(g.height||0)}h.y=Math.floor((a.height-h.height)/2+g.centerY)
-}else{h.y=0;if(SC.none(g.height)){if(!a){a=this.computeParentDimensions(g)}h.height=Math.floor(a.height)
-}else{if(g.height===d){h.height=d}else{h.height=Math.floor(g.height||0)}}}}}if(h.height===d||h.width===d){e=this.get("layer");
-if(h.height===d){h.height=e?e.clientHeight:0}if(h.width===d){h.width=e?e.clientWidth:0
-}}if(!SC.none(g.maxHeight)&&(h.height>g.maxHeight)){h.height=g.maxHeight}if(!SC.none(g.minHeight)&&(h.height<g.minHeight)){h.height=g.minHeight
-}if(!SC.none(g.maxWidth)&&(h.width>g.maxWidth)){h.width=g.maxWidth}if(!SC.none(g.minWidth)&&(h.width<g.minWidth)){h.width=g.minWidth
-}if(h.height<0){h.height=0}if(h.width<0){h.width=0}return h},computeParentDimensions:function(e){var b,c=this.get("parentView"),a=(c)?c.get("frame"):null;
-if(a){b={width:a.width,height:a.height}}else{var d=e;b={width:(d.left||0)+(d.width||0)+(d.right||0),height:(d.top||0)+(d.height||0)+(d.bottom||0)}
-}return b},clippingFrame:function(){var b=this.get("parentView"),c=this.get("frame"),a=c;
-if(b){b=b.get("clippingFrame");a=SC.intersectRects(b,c)}a.x-=c.x;a.y-=c.y;return a
-}.property("parentView","frame").cacheable(),_sc_view_clippingFrameDidChange:function(){var d=this.get("childViews"),b=d.length,a,c;
-for(a=0;a<b;++a){c=d[a];if(!c.hasStaticLayout){c.notifyPropertyChange("clippingFrame")
-}}}.observes("clippingFrame"),parentViewDidResize:function(){var a=this.get("layout");
-var b=((a.left!==undefined)&&(a.top!==undefined)&&(a.width!==undefined)&&(a.height!==undefined));
-if(!b){this.notifyPropertyChange("frame");this.viewDidResize()}},viewDidResize:function(){var d=this.childViews,b=d.length,a,c;
-for(a=0;a<b;++a){c=d[a];if(c.parentViewDidResize){c.parentViewDidResize()}}}.observes("layout"),beginLiveResize:function(){if(this.willBeginLiveResize){this.willBeginLiveResize()
-}var d=this.get("childViews"),b=d.length,a,c;for(a=0;a<b;++a){c=d[a];if(c.beginLiveResize){c.beginLiveResize()
-}}return this},endLiveResize:function(){var d=this.get("childViews"),b=d.length,a,c;
-for(a=b-1;a>=0;--a){c=d[a];if(c.endLiveResize){c.endLiveResize()}}if(this.didEndLiveResize){this.didEndLiveResize()
-}return this},layoutStyle:function(){var b=this.get("layout"),d={},a=null,e,j=SC.LAYOUT_AUTO;
-var k=this.get("useStaticLayout");if(b.width!==undefined&&b.width===SC.LAYOUT_AUTO&&!k){e=SC.Error.desc("%@.layout() you cannot use width:auto if  staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
-console.error(e.toString());throw e}if(b.height!==undefined&&b.height===SC.LAYOUT_AUTO&&!k){e=SC.Error.desc("%@.layout() you cannot use height:auto if  staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
-console.error(e.toString());throw e}if(!SC.none(b.left)){d.left=Math.floor(b.left);
-if(b.width!==undefined){if(b.width===SC.LAYOUT_AUTO){d.width=SC.LAYOUT_AUTO}else{d.width=Math.floor(b.width)
-}d.right=null}else{d.width=null;d.right=Math.floor(b.right||0)}d.marginLeft=0}else{if(!SC.none(b.right)){d.right=Math.floor(b.right);
-d.marginLeft=0;if(SC.none(b.width)){d.left=0;d.width=null}else{d.left=null;if(b.width===SC.LAYOUT_AUTO){d.width=SC.LAYOUT_AUTO
-}else{d.width=Math.floor(b.width||0)}}}else{if(!SC.none(b.centerX)){d.left="50%";
-d.width=Math.floor(b.width||0);d.marginLeft=Math.floor(b.centerX-d.width/2);d.right=null
-}else{if(!SC.none(b.width)){d.left=0;d.right=null;if(b.width===SC.LAYOUT_AUTO){d.width=SC.LAYOUT_AUTO
-}else{d.width=Math.floor(b.width)}d.marginLeft=0}else{d.left=0;d.right=0;d.width=null;
-d.marginLeft=0}}}}d.minWidth=(b.minWidth===undefined)?null:b.minWidth;d.maxWidth=(b.maxWidth===undefined)?null:b.maxWidth;
-if(!SC.none(b.top)){d.top=Math.floor(b.top);if(b.height!==undefined){if(b.height===SC.LAYOUT_AUTO){d.height=SC.LAYOUT_AUTO
-}else{d.height=Math.floor(b.height)}d.bottom=null}else{d.height=null;d.bottom=Math.floor(b.bottom||0)
-}d.marginTop=0}else{if(!SC.none(b.bottom)){d.marginTop=0;d.bottom=Math.floor(b.bottom);
-if(SC.none(b.height)){d.top=0;d.height=null}else{d.top=null;if(b.height===SC.LAYOUT_AUTO){d.height=SC.LAYOUT_AUTO
-}else{d.height=Math.floor(b.height||0)}}}else{if(!SC.none(b.centerY)){d.top="50%";
-d.height=Math.floor(b.height||0);d.marginTop=Math.floor(b.centerY-d.height/2);d.bottom=null
-}else{if(!SC.none(b.height)){d.top=0;d.bottom=null;if(b.height===SC.LAYOUT_AUTO){d.height=SC.LAYOUT_AUTO
-}else{d.height=Math.floor(b.height||0)}d.marginTop=0}else{d.top=0;d.bottom=0;d.height=null;
-d.marginTop=0}}}}d.minHeight=(b.minHeight===undefined)?null:b.minHeight;d.maxHeight=(b.maxHeight===undefined)?null:b.maxHeight;
-d.zIndex=SC.none(b.zIndex)?null:b.zIndex.toString();d.backgroundPosition=SC.none(b.backgroundPosition)?null:b.backgroundPosition.toString();
-var h=SC._VIEW_DEFAULT_DIMS,c=h.length,f;while(--c>=0){f=h[c];if(d[f]===0){d[f]=null
-}}for(var i in d){var g=d[i];if(typeof g===SC.T_NUMBER){d[i]=(g+"px")}}return d}.property().cacheable(),layoutView:function(){return this.get("parentView")
-}.property("parentView").cacheable(),layoutDidChange:function(){this.beginPropertyChanges();
-if(this.frame){this.notifyPropertyChange("frame")}this.notifyPropertyChange("layoutStyle");
-this.endPropertyChanges();var a=this.get("layoutView");if(a){a.set("childViewsNeedLayout",YES);
-a.layoutDidChangeFor(this);if(a.get("childViewsNeedLayout")){a.invokeOnce(a.layoutChildViewsIfNeeded)
-}}return this}.observes("layout"),childViewsNeedLayout:NO,layoutDidChangeFor:function(b){var a=this._needLayoutViews;
-if(!a){a=this._needLayoutViews=SC.CoreSet.create()}a.add(b)},layoutChildViewsIfNeeded:function(a){if(!a){a=this.get("isVisibleInWindow")
-}if(a&&this.get("childViewsNeedLayout")){this.set("childViewsNeedLayout",NO);this.layoutChildViews()
-}return this},layoutChildViews:function(){var f=this._needLayoutViews,b=f?f.length:0,a;
-var c,e,d;for(a=0;a<b;a++){c=f[a];c.updateLayout()}c=e=d=null;f.clear()},updateLayout:function(){var b=this.get("layer"),a;
-if(b){a=this.renderContext(b);this.renderLayout(a);a.update()}b=null;return this},renderLayout:function(a,b){a.addStyle(this.get("layoutStyle"))
-},isView:YES,selectStart:function(a){return this.get("isTextSelectable")}});SC.View.mixin({isViewClass:YES,design:function(){if(this.isDesign){return this
-}var a=this.extend.apply(this,arguments);a.isDesign=YES;if(SC.ViewDesigner){SC.ViewDesigner.didLoadDesign(a,this,SC.A(arguments))
-}return a},layout:function(a){this.prototype.layout=a;return this},classNames:function(a){a=(this.prototype.classNames||[]).concat(a);
-this.prototype.classNames=a;return this},tagName:function(a){this.prototype.tagName=a;
-return this},childView:function(a){var b=this.prototype.childViews||[];if(b===this.superclass.prototype.childViews){b=b.slice()
-}b.push(a);this.prototype.childViews=b;return this},bind:function(b,d){var c=this.prototype,a=this.superclass.prototype;
-var e=c._bindings;if(!e||e===a._bindings){e=c._bindings=(e||[]).slice()}b=b+"Binding";
-c[b]=d;e.push(b);return this},prop:function(a,b){this.prototype[a]=b;return this},localization:function(b,a){if(a){b.rootElement=SC.$(a).get(0)
-}return b},viewFor:function(d,c){var b=SC.$A(arguments);if(SC.none(d)){b.shift()}else{b[0]={rootElement:SC.$(d).get(0)}
-}var a=this.create.apply(this,arguments);b=b[0]=null;return a},create:function(){var b=this,a=new b(arguments);
-if(SC.ViewDesigner){SC.ViewDesigner.didCreateView(a,SC.$A(arguments))}return a},loc:function(e){var b=e.childViews;
-delete e.childViews;this.applyLocalizedAttributes(e);if(SC.ViewDesigner){SC.ViewDesigner.didLoadLocalization(this,SC.$A(arguments))
-}var d=this.prototype.childViews,a=d.length;while(--a>=0){var c=d[a];e=b[a];if(e&&c&&c.loc){c.loc(e)
-}}return this},applyLocalizedAttributes:function(a){SC.mixin(this.prototype,a)},views:{}});
-SC.outlet=function(a){return function(b){return(this[b]=SC.objectForPropertyPath(a,this))
-}.property()};SC.View.unload=function(){var a=SC.View.views;if(a){for(var b in a){if(!a.hasOwnProperty(b)){continue
-}delete a[b]}}};SC.Event.add(window,"unload",SC.View,SC.View.unload);sc_require("views/view");
-SC.Pane=SC.View.extend({isPane:YES,page:null,rootResponder:null,currentWindowSize:null,computeParentDimensions:function(){var a=this.get("currentWindowSize");
-return{width:(a)?a.width:1000,height:(a)?a.height:1000}},frame:function(){return this.computeFrameWithParentFrame(null)
-}.property(),windowSizeDidChange:function(b,a){this.set("currentWindowSize",a);this.parentViewDidResize();
-return this},sendEvent:function(c,a,d){var b;if(!d){d=this.get("firstResponder")}while(d&&!d.tryToPerform(c,a)){d=(d===this)?null:d.get("nextResponder")
-}if(!d&&(d=this.get("defaultResponder"))){if(typeof d===SC.T_STRING){d=SC.objectForPropertyPath(d)
-}if(!d){d=null}else{if(d.isResponderContext){d=d.sendAction(c,this,a)}else{d=d.tryToPerform(c,a)?d:null
-}}}return a.mouseHandler||d},defaultResponder:null,nextResponder:function(){return null
-}.property().cacheable(),firstResponder:null,acceptsKeyPane:YES,isKeyPane:NO,becomeKeyPane:function(){if(this.get("isKeyPane")){return this
-}if(this.rootResponder){this.rootResponder.makeKeyPane(this)}return this},resignKeyPane:function(){if(!this.get("isKeyPane")){return this
-}if(this.rootResponder){this.rootResponder.makeKeyPane(null)}return this},makeFirstResponder:function(a){var c=this.get("firstResponder"),b=this.get("isKeyPane");
-if(c===a){return this}if(c){c.willLoseFirstResponder(c)}if(b){if(c){c.willLoseKeyResponderTo(a)
-}if(a){a.willBecomeKeyResponderFrom(c)}}if(c){c.beginPropertyChanges().set("isFirstResponder",NO).set("isKeyResponder",NO).endPropertyChanges()
-}this.set("firstResponder",a);if(a){a.beginPropertyChanges().set("isFirstResponder",YES).set("isKeyResponder",b).endPropertyChanges()
-}if(b){if(a){a.didBecomeKeyResponderFrom(c)}if(c){c.didLoseKeyResponderTo(a)}}if(a){a.didBecomeFirstResponder(a)
-}return this},_forwardKeyChange:function(d,b,g,f){var c,a,e;if(d&&(a=this.get("firstResponder"))){e=(g)?g.get("firstResponder"):null;
-c=this.get("firstResponder");if(c){c[b](e)}if((f!==undefined)&&a){a.set("isKeyResponder",f)
-}}},willLoseKeyPaneTo:function(a){this._forwardKeyChange(this.get("isKeyPane"),"willLoseKeyResponderTo",a,NO);
-return this},willBecomeKeyPaneFrom:function(a){this._forwardKeyChange(!this.get("isKeyPane"),"willBecomeKeyResponderFrom",a,YES);
-return this},didLoseKeyPaneTo:function(b){var a=this.get("isKeyPane");this.set("isKeyPane",NO);
-this._forwardKeyChange(a,"didLoseKeyResponderTo",b);return this},didBecomeKeyPaneFrom:function(b){var a=this.get("isKeyPane");
-this.set("isKeyPane",YES);this._forwardKeyChange(!a,"didBecomeKeyResponderFrom",b,YES);
-return this},isMainPane:NO,focusFrom:function(a){},blurTo:function(a){},blurMainTo:function(a){this.set("isMainPane",NO)
-},focusMainFrom:function(a){this.set("isMainPane",YES)},append:function(){return this.appendTo(document.body)
-},remove:function(){if(!this.get("isVisibleInWindow")){return this}if(!this.get("isPaneAttached")){return this
-}var b=this.get("layer");if(b.parentNode){b.parentNode.removeChild(b)}b=null;this.resignKeyPane();
-var a=this.rootResponder;if(this.get("isMainPane")){a.makeMainPane(null)}a.panes.remove(this);
-this.rootResponder=null;this.set("isPaneAttached",NO);this.parentViewDidChange();
-return this},appendTo:function(b){var a=this.get("layer");if(!a){a=this.createLayer().get("layer")
-}if(this.get("isPaneAttached")&&(a.parentNode===b)){return this}b.insertBefore(a,null);
-b=a=null;return this.paneDidAttach()},prependTo:function(b){if(this.get("isPaneAttached")){return this
-}var a=this.get("layer");if(!a){a=this.createLayer().get("layer")}if(this.get("isPaneAttached")&&(a.parentNode===b)){return this
-}b.insertBefore(a,b.firstChild);b=a=null;return this.paneDidAttach()},before:function(c){if(this.get("isPaneAttached")){return this
-}var a=this.get("layer");if(!a){a=this.createLayer().get("layer")}var b=c.parentNode;
-if(this.get("isPaneAttached")&&(a.parentNode===b)){return this}b.insertBefore(a,c);
-b=c=a=null;return this.paneDidAttach()},after:function(c){var a=this.get("layer");
-if(!a){a=this.createLayer().get("layer")}var b=c.parentNode;if(this.get("isPaneAttached")&&(a.parentNode===b)){return this
-}b.insertBefore(a,c.nextSibling);b=c=a=null;return this.paneDidAttach()},removeFromParent:function(){},paneDidAttach:function(){var a=(this.rootResponder=SC.RootResponder.responder);
-a.panes.add(this);this.set("currentWindowSize",a.computeWindowSize());this.set("isPaneAttached",YES);
-this.parentViewDidChange();return this},isPaneAttached:NO,recomputeIsVisibleInWindow:function(c){var d=this.get("isVisibleInWindow");
-var f=this.get("isPaneAttached")&&this.get("isVisible");if(d!==f){this.set("isVisibleInWindow",f);
-if(f&&this.get("layerNeedsUpdate")){this.updateLayerIfNeeded()}if(f&&this.get("childViewsNeedLayout")){this.layoutChildViewsIfNeeded()
-}var e=this.get("childViews"),b=e.length,a;for(a=0;a<b;a++){e[a].recomputeIsVisibleInWindow(f)
-}if(!f&&this.get("isFirstResponder")){this.resignFirstResponder()}}if(f){if(this.parentViewDidResize){this.parentViewDidResize()
-}if(this.get("childViewsNeedLayout")){this.invokeOnce(this.layoutChildViewsIfNeeded)
-}}return this},updateLayerLocation:function(){return this},init:function(){var a=!!this.get("layer");
-arguments.callee.base.apply(this,arguments);if(a){this.paneDidAttach()}},classNames:"sc-pane".w()});
-sc_require("mixins/tree_item_content");sc_require("mixins/collection_content");SC.TreeItemObserver=SC.Object.extend(SC.Array,SC.CollectionContent,{item:null,delegate:null,parentObserver:null,parentItem:function(){var a=this.get("parentObserver");
-return a?a.get("item"):null}.property("parentObserver").cacheable(),index:null,outlineLevel:0,children:null,disclosureState:SC.BRANCH_OPEN,branchIndexes:function(){var e=this.get("item"),b,f,a,d,c;
-if(!e){return SC.IndexSet.EMPTY}else{if(e.isTreeItemContent){f=this.get("parentItem");
-a=this.get("index");return e.treeItemBranchIndexes(f,a)}else{d=this.get("children");
-if(!d){return null}c=SC.IndexSet.create();b=d.get("length");f=e;for(a=0;a<b;a++){if(!(e=d.objectAt(a))){continue
-}if(!this._computeChildren(e,f,a)){continue}if(this._computeDisclosureState(e,f,a)!==SC.LEAF_NODE){c.add(a)
-}}return c.get("length")>0?c:null}}}.property("children").cacheable(),isHeaderVisible:function(){return !!this.get("parentObserver")
-}.property("parentObserver").cacheable(),length:0,objectAt:function(d){var a=this.get("length"),f=this.get("item"),b=this._objectAtCache,h=d,g=0,c,e;
-if(d>=a){return undefined}if(this.get("isHeaderVisible")){if(d===0){return f}else{h--
-}}f=null;if(!b){b=this._objectAtCache=[]}if((f=b[d])!==undefined){return f}e=this.get("children");
-if(!e){return undefined}if(c=this.get("branchIndexes")){c.forEach(function(l){if(f||(l>h)){return
-}var k=this.branchObserverAt(l),j;if(!k){return}j=k.get("length");if(l+j>h){f=k.objectAt(h-l);
-h=-1}else{h-=j-1}},this)}if(h>=0){f=e.objectAt(h)}b[d]=f;return f},replace:function(a,b,j,d){var i=a,g=null,e,f,h;
-if(d===undefined){d=SC.DROP_BEFORE}if(this.get("isHeaderVisible")){i--}if(i<0){throw"Tree Item cannot replace itself"
-}if(e=this.get("branchIndexes")){e.forEach(function(k){if(g||(k>=i)){return}if(!(g=this.branchObserverAt(k))){return
-}f=g.get("length");if((k+f===i)&&d===SC.DROP_AFTER){i-=k}else{if(k+f>i){i-=k}else{i-=f-1;
-g=null}}},this)}if(g){g.replace(i,b,j,d);return this}h=i+b;if(b>1&&e){e.forEachIn(i,e.get("max")-i,function(k){if(k>h){return
-}if(!(g=this.branchObserverAt(k))){return}f=g.get("length");h-=f-1},this)}b=h-i;var c=this.get("children");
-if(!c){throw"cannot replace() tree item with no children"}if((b<0)||(h>c.get("length"))){throw"replace() range must lie within a single tree item"
-}c.replace(i,b,j,d);return this},observerContentDidChange:function(g,f,e){this.invalidateBranchObserversAt(g);
-this._objectAtCache=this._outlineLevelCache=null;this._disclosureStateCache=null;
-this._contentGroupIndexes=NO;this.notifyPropertyChange("branchIndexes");var b=this.get("length"),c=this._computeLength(),a=this.get("parentObserver"),d;
-if(b!==c){this.set("length",c)}if(!this._notifyParent){return this}if(a){d=SC.IndexSet.create(this.get("index"));
-a._childrenRangeDidChange(a.get("children"),null,"[]",d)}else{if(b===c){f=this.expandChildIndex(g+f);
-g=this.expandChildIndex(g);f=f-g;e=0}else{g=this.expandChildIndex(g);f=c-g;e=c-b}this.enumerableContentDidChange(g,f,e)
-}},expandChildIndex:function(c){var b=c;if(this.get("isHeaderVisible")){c++}var a=this.get("branchIndexes");
-if(!a||a.get("length")===0){return b}a.forEachIn(0,c,function(d){b+=this.branchObserverAt(d).get("length")-1
-},this);return b},_contentGroupIndexes:NO,contentGroupIndexes:function(g,e){if(e!==this){return null
-}var f=this._contentGroupIndexes;if(f!==NO){return f}if(this.get("parentObserver")){return null
-}var j=this.get("item"),i,b,d,h,c,a;if(j&&j.isTreeItemContent){i=j.get("treeItemIsGrouped")
-}else{i=!!this.delegate.get("treeItemIsGrouped")}if(i){f=SC.IndexSet.create();b=this.get("branchIndexes");
-a=this.get("children");d=a?a.get("length"):0;h=c=0;if(b){b.forEach(function(l){f.add(h,(l+1)-c);
-h+=(l+1)-c;c=l+1;var k=this.branchObserverAt(l);if(k){h+=k.get("length")-1}},this)
-}if(c<d){f.add(h,d-c)}}else{f=null}this._contentGroupIndexes=f;return f},contentIndexIsGroup:function(b,d,a){var c=this.contentGroupIndexes(b,d);
-return c?c.contains(a):NO},contentIndexOutlineLevel:function(j,g,e){if(g!==this){return -1
-}var a=this._outlineLevelCache;if(a&&(a[e]!==undefined)){return a[e]}if(!a){a=this._outlineLevelCache=[]
-}var f=this.get("length"),k=e,d=0,h=null,c,b,i;if(e>=f){return -1}if(this.get("isHeaderVisible")){if(e===0){return a[0]=this.get("outlineLevel")-1
-}else{k--}}if(c=this.get("branchIndexes")){c.forEach(function(n){if((h!==null)||(n>k)){return
-}var m=this.branchObserverAt(n),l;if(!m){return}l=m.get("length");if(n+l>k){h=m.contentIndexOutlineLevel(j,m,k-n);
-k=-1}else{k-=l-1}},this)}if(k>=0){h=this.get("outlineLevel")}a[e]=h;return h},contentIndexDisclosureState:function(j,g,e){if(g!==this){return -1
-}var a=this._disclosureStateCache;if(a&&(a[e]!==undefined)){return a[e]}if(!a){a=this._disclosureStateCache=[]
-}var f=this.get("length"),k=e,d=0,h=null,c,b,i;if(e>=f){return SC.LEAF_NODE}if(this.get("isHeaderVisible")){if(e===0){return a[0]=this.get("disclosureState")
-}else{k--}}if(c=this.get("branchIndexes")){c.forEach(function(n){if((h!==null)||(n>k)){return
-}var m=this.branchObserverAt(n),l;if(!m){return}l=m.get("length");if(n+l>k){h=m.contentIndexDisclosureState(j,m,k-n);
-k=-1}else{k-=l-1}},this)}if(k>=0){h=SC.LEAF_NODE}a[e]=h;return h},contentIndexExpand:function(b,f,a){var c,g=a,d,e;
-if(f!==this){return}if(this.get("isHeaderVisible")){if(a===0){this._expand(this.get("item"));
-return}else{g--}}if(c=this.get("branchIndexes")){c.forEach(function(k){if(k>=g){return
-}var j=this.branchObserverAt(k),h;if(!j){return}h=j.get("length");if(k+h>g){j.contentIndexExpand(b,j,g-k);
-g=-1}else{g-=h-1}},this)}if(g>=0){d=this.get("children");e=d?d.objectAt(g):null;if(e){this._expand(e,this.get("item"),g)
-}}},contentIndexCollapse:function(b,f,a){var c,d,e,g=a;if(f!==this){return}if(this.get("isHeaderVisible")){if(a===0){this._collapse(this.get("item"));
-return}else{g--}}if(c=this.get("branchIndexes")){c.forEach(function(k){if(k>=g){return
-}var j=this.branchObserverAt(k),h;if(!j){return}h=j.get("length");if(k+h>g){j.contentIndexCollapse(b,j,g-k);
-g=-1}else{g-=h-1}},this)}if(g>=0){d=this.get("children");e=d?d.objectAt(g):null;if(e){this._collapse(e,this.get("item"),g)
-}}},branchObserverAt:function(d){var g=this._branchObserversByIndex,c=this._branchObserverIndexes,e,h,b,j,a,f,i;
-if(!g){g=this._branchObserversByIndex=[]}if(!c){c=this._branchObserverIndexes=SC.IndexSet.create()
-}if(e=g[d]){return e}a=this.get("children");j=a?a.objectAt(d):null;if(!j){return null
-}g[d]=e=SC.TreeItemObserver.create({item:j,delegate:this.get("delegate"),parentObserver:this,index:d,outlineLevel:this.get("outlineLevel")+1});
-c.add(d);return e},invalidateBranchObserversAt:function(c){var b=this._branchObserversByIndex,a=this._branchObserverIndexes;
-if(!b||b.length<=c){return this}if(c<0){c=0}a.forEachIn(c,a.get("max")-c,function(e){var d=b[e];
-if(d){d.destroy()}},this);b.length=c;return this},init:function(){arguments.callee.base.apply(this,arguments);
-var a=this.get("item");if(!a){throw"SC.TreeItemObserver.item cannot be null"}a.addObserver("*",this,this._itemPropertyDidChange);
-this._itemPropertyDidChange(a,"*");this._notifyParent=YES},destroy:function(){this.invalidateBranchObserversAt(0);
-this._objectAtCache=null;var c=this.get("item");if(c){c.removeObserver("*",this,this._itemPropertyDidChange)
-}var a=this._children,b=this._childrenRangeObserver;if(a&&b){a.removeRangeObserver(b)
-}arguments.callee.base.apply(this,arguments)},_itemPropertyDidChange:function(f,b){var a=this.get("children"),e=this.get("disclosureState"),d=this.get("item"),c;
-this.beginPropertyChanges();c=this._computeDisclosureState(d);if(e!==c){this.set("disclosureState",c)
-}c=this._computeChildren(d);if(a!==c){this.set("children",c)}this.endPropertyChanges()
-},_childrenDidChange:function(){var c=this.get("disclosureState"),d=c===SC.BRANCH_OPEN?this.get("children"):null,b=this._children,a=this._childrenRangeObserver;
-if(b===d){return this}if(a){b.removeRangeObserver(a)}if(d){this._childrenRangeObserver=d.addRangeObserver(null,this,this._childrenRangeDidChange)
-}else{this._childrenRangeObserver=null}this._children=d;this._childrenRangeDidChange(d,null,"[]",null)
-}.observes("children","disclosureState"),_childrenRangeDidChange:function(f,i,h,d){var a=this.get("children"),e=a?a.get("length"):0,c=d?d.get("min"):0,g=d?d.get("max"):e,b=this._childrenLen||0;
-this._childrenLen=e;this.observerContentDidChange(c,g-c,e-b)},_computeDisclosureState:function(d,e,b){var c,a;
-if(!d||!this._computeChildren(d)){return SC.LEAF_NODE}else{if(d.isTreeItemContent){if(e===undefined){e=this.get("parentItem")
-}if(b===undefined){b=this.get("index")}return d.treeItemDisclosureState(e,b)}else{c=this._treeItemIsExpandedKey;
-if(!c){a=this.get("delegate");c=a?a.get("treeItemIsExpandedKey"):"treeItemIsExpanded";
-this._treeItemIsExpandedKey=c}return d.get(c)?SC.BRANCH_OPEN:SC.BRANCH_CLOSED}}},_collapse:function(d,e,b){var c,a;
-if(!d||!this._computeChildren(d)){return this}else{if(d.isTreeItemContent){if(e===undefined){e=this.get("parentItem")
-}if(b===undefined){b=this.get("index")}d.treeItemCollapse(e,b)}else{c=this._treeItemIsExpandedKey;
-if(!c){a=this.get("delegate");c=a?a.get("treeItemIsExpandedKey"):"treeItemIsExpanded";
-this._treeItemIsExpandedKey=c}d.setIfChanged(c,NO)}}return this},_expand:function(d,e,b){var c,a;
-if(!d||!this._computeChildren(d)){return this}else{if(d.isTreeItemContent){if(e===undefined){e=this.get("parentItem")
-}if(b===undefined){b=this.get("index")}d.treeItemExpand(e,b)}else{c=this._treeItemIsExpandedKey;
-if(!c){a=this.get("delegate");c=a?a.get("treeItemIsExpandedKey"):"treeItemIsExpanded";
-this._treeItemIsExpandedKey=c}d.setIfChanged(c,YES)}}return this},_computeChildren:function(c){var a,b;
-if(!c){return null}else{if(c.isTreeItemContent){return c.get("treeItemChildren")}else{b=this._treeItemChildrenKey;
-if(!b){a=this.get("delegate");b=a?a.get("treeItemChildrenKey"):"treeItemChildren";
-this._treeItemChildrenKey=b}return c.get(b)}}},_computeLength:function(){var b=this.get("isHeaderVisible")?1:0,d=this.get("disclosureState"),c=this.get("children"),a;
-if((d===SC.BRANCH_OPEN)&&c){b+=c.get("length");if(a=this.get("branchIndexes")){a.forEach(function(e){var f=this.branchObserverAt(e);
-b+=f.get("length")-1},this)}}return b}});sc_require("system/responder");SC.ResponderContext=SC.Responder.extend({isResponderContext:YES,trace:NO,defaultResponder:null,nextResponder:function(){return this.get("defaultResponder")
-}.property("defaultResponder").cacheable(),firstResponder:null,nextResponderFor:function(a){var b=a.get("nextResponder");
-if(typeof b===SC.T_STRING){b=SC.objectForPropertyPath(b,this)}else{if(!b&&(a!==this)){b=this
-}}return b},responderNameFor:function(a){if(!a){return"(No Responder)"}else{if(a._scrc_name){return a._scrc_name
-}}var b=this.NAMESPACE;this._findResponderNamesFor(this,3,b?[this.NAMESPACE]:[]);
-return a._scrc_name||a.toString()},_findResponderNamesFor:function(a,e,d){var b,c;
-for(b in a){if(b==="nextResponder"){continue}c=a[b];if(c&&c.isResponder){if(c._scrc_name){continue
-}d.push(b);c._scrc_name=d.join(".");if(e>0){this._findResponderNamesFor(c,e-1,d)}d.pop()
-}}},makeFirstResponder:function(a){var e=this.get("firstResponder"),c=this.get("nextResponder"),d=this.get("trace"),b;
-if(this._locked){if(d){console.log("%@: AFTER ACTION: makeFirstResponder => %@".fmt(this,this.responderNameFor(a)))
-}this._pendingResponder=a;return}if(d){console.log("%@: makeFirstResponder => %@".fmt(this,this.responderNameFor(a)))
-}this._locked=YES;this._pendingResponder=null;b=a?this.nextResponderFor(a):null;while(b){if(b.get("hasFirstResponder")){break
-}b=(b===c)?null:this.nextResponderFor(b)}if(!b){b=c}this._notifyWillLoseFirstResponder(e,e,b);
-if(e){e.set("isFirstResponder",NO)}this.set("firstResponder",a);if(a){a.set("isFirstResponder",YES)
-}this._notifyDidBecomeFirstResponder(a,a,b);this._locked=NO;if(this._pendingResponder){this.makeFirstResponder(this._pendingResponder);
-this._pendingResponder=null}return this},_notifyWillLoseFirstResponder:function(b,d,a){if(d===a){return
-}d.willLoseFirstResponder(b);d.set("hasFirstResponder",NO);var c=this.nextResponderFor(d);
-if(c){this._notifyWillLoseFirstResponder(b,c,a)}},_notifyDidBecomeFirstResponder:function(b,d,a){if(d===a){return
-}var c=this.nextResponderFor(d);if(c){this._notifyDidBecomeFirstResponder(b,c,a)}d.set("hasFirstResponder",YES);
-d.didBecomeFirstResponder(b)},sendAction:function(g,d,c){var a=this.get("firstResponder"),e=this.get("nextResponder"),f=this.get("trace"),h=NO,b;
-this._locked=YES;if(f){console.log("%@: begin action '%@' (%@, %@)".fmt(this,g,d,c))
-}while(!h&&a){if(a.tryToPerform){h=a.tryToPerform(g,d,c)}if(!h){a=(a===e)?null:this.nextResponderFor(a)
-}}if(f){if(!h){console.log("%@:  action '%@' NOT HANDLED".fmt(this,g))}else{console.log("%@: action '%@' handled by %@".fmt(this,g,this.responderNameFor(a)))
-}}this._locked=NO;if(b=this._pendingResponder){this._pendingResponder=null;this.makeFirstResponder(b)
-}return a}});sc_require("system/responder_context");SC.Application=SC.ResponderContext.extend({});
-sc_require("core");SC.Benchmark={verbose:NO,enabled:YES,stats:{},globalStartTime:null,start:function(b,a,e,d){if(!this.enabled){return
-}var f=(e||Date.now()),c;if(a){c=this._subStatFor(b,a)}else{c=this._statFor(b)}if(d&&c._starts.length>0){c._starts.push("ignore")
-}else{c._starts.push(f)}c._times.push({start:f,_subStats:{}});return b},end:function(c,b,f){var e;
-if(!this.enabled){return}if(b){e=this._subStatFor(c,b)}else{e=this._statFor(c)}var g=e._starts.pop();
-if(!g){console.log('SC.Benchmark "%@" ended without a matching start.  No information was saved.'.fmt(c));
-return}if(g=="ignore"){return}var a=(f||Date.now());var d=a-g;e._times[e._times.length-1].end=a;
-e._times[e._times.length-1].dur=d;e.amt+=d;e.runs++;if(this.verbose){this.log(c)}},setGlobalStartTime:function(a){this.globalStartTime=a
-},bench:function(e,d,a){if(!d){d="bench%@".fmt(this._benchCount++)}if(!a){a=1}var b;
-while(--a>=0){var c=SC.Benchmark.start(d);b=e();SC.Benchmark.end(c)}return b},install:function(a,d,b){a["b__"+d]=a[d];
-var c=a["b__"+d];a[d]=function(){var f="%@(%@)".fmt(d,$A(arguments).join(", "));SC.Benchmark.start(f,b);
-var e=c.apply(this,arguments);SC.Benchmark.end(f);return e}},restore:function(a,b){a[b]=a["b__"+b]
-},report:function(c){if(c){return this._genReport(c)}var b=[];for(var a in this.stats){if(!this.stats.hasOwnProperty(a)){continue
-}b.push(this._genReport(a))}return b.join("\n")},timelineReport:function(a){a=(a)?"SproutCore Application":a;
-var b=[a,"User-Agent: %@".fmt(navigator.userAgent),"Report Generated: %@ (%@)".fmt(new Date().toString(),Date.now()),""];
-var d=this._compileChartData(true);for(var c=0;c<d.length;c++){if(d[c][4]){b.push(this._timelineGenSubReport(d[c]))
-}else{b.push(this._timelineGenReport(d[c]))}}return b.join("\n")},timelineChart:function(s){var o=0;
-this.hideChart();var m=this._compileChartData(false);var j=m.length;if(j===0){return
-}var b=this.globalStartTime?this.globalStartTime:m[0][1];var d=m[j-1][2]-b;var n=50+j*30;
-var p=Math.ceil(d/200)+1;var r=p*50;var c=document.createElement("div");c.className="sc-benchmark-graph";
-document.body.appendChild(c);var t=document.createElement("div");t.innerHTML=((s)?s:"SproutCore Application")+(" - Total Captured Time: "+d+" ms - Points Captured: "+j)+' [<a href="javascript:SC.Benchmark.hideChart();">Hide Chart</a>]';
-t.className="sc-benchmark-title";c.appendChild(t);var f=document.createElement("div");
-f.className="sc-benchmark-top";f.style.width=r+"px";c.appendChild(f);for(o=0;o<p;
-o++){var q=document.createElement("div");q.className="sc-benchmark-tick";q.style.left=(o*50)+"px";
-q.style.height=n+"px";var e=document.createElement("div");e.className="sc-benchmark-tick-label";
-e.style.left=(o*50)+"px";e.innerHTML=o*200+" ms";c.appendChild(q);c.appendChild(e)
-}for(o=0;o<j;o++){var k=document.createElement("div");k.style.top=(75+(o*30))+"px";
-k.style.width=r+"px";k.className=(o%2===0)?"sc-benchmark-row even":"sc-benchmark-row";
-c.appendChild(k);var l=document.createElement("div");var h=m[o][1];var g=m[o][2];
-var a=m[o][3];l.innerHTML="&nbsp;"+(m[o][0]+" <span class='sc-benchmark-emphasis'>"+a+"ms</span>");
-l.className="sc-benchmark-bar";l.style.cssText="left:"+(((h-b)/4))+"px; width: "+((a/4))+"px; top: "+(53+(o*30))+"px;";
-l.title="start: "+(h-b)+" ms, end: "+(g-b)+" ms, duration: "+a+" ms";c.appendChild(l)
-}this._graph=c},hideChart:function(){if(this._graph){try{document.body.removeChild(this._graph)
-}catch(a){}}},log:function(a){console.log(this.report(a))},startProfile:function(a){if(!this.enabled){return
-}if(console&&console.profile){console.profile(a)}},endProfile:function(a){if(!this.enabled){return
-}if(console&&console.profileEnd){console.profileEnd(a)}},_compileChartData:function(g){var l=[],a;
-for(var m in this.stats){var e=this.stats[m];for(var f=0;f<e._times.length;f++){var n=e._times[f];
-a=(e._times.length>1)?(f+1)+" - "+m:m;l.push([a,n.start,n.end,n.dur,false]);if(g){var b=n._subStats;
-for(var c in b){var h=b[c];for(var d=0;d<h._times.length;d++){var o=h._times[d];a=(h._times.length>1)?(d+1)+" - "+c:c;
-l.push([a,o.start,o.end,o.dur,true])}}}}}l.sort(function(j,i){if(j[1]<i[1]){return -1
-}else{if(j[1]==i[1]){if(j[3]&&!i[3]){return -1}if(!j[3]&&i[3]){return 1}return 0}}return 1
-});return l},_genReport:function(a){var b=this._statFor(a);var c=(b.runs>0)?(Math.floor(b.amt*1000/b.runs)/1000):0;
-return"BENCH %@ msec: %@ (%@x)".fmt(c,(b.name||a),b.runs)},_timelineGenReport:function(a){if(this.globalStartTime){return"BENCH start: %@ msec, duration: %@ msec,  %@".fmt((a[1]-this.globalStartTime),a[3],a[0])
-}else{return"BENCH duration: %@ msec, %@".fmt(a[3],a[0])}},_timelineGenSubReport:function(a){if(this.globalStartTime){return"   CHECKPOINT BENCH start: %@ msec, duration: %@ msec,  %@".fmt((a[1]-this.globalStartTime),a[3],a[0])
-}else{return"   CHECKPOINT BENCH duration: %@ msec, %@".fmt(a[3],a[0])}},_subStatFor:function(d,c){var e=this.stats[c]._times.length;
-if(e===0){return}var a=this.stats[c]._times[this.stats[c]._times.length-1]._subStats;
-var b=a[d];if(!b){a[d]={runs:0,amt:0,name:d,_starts:[],_times:[]};b=a[d]}return b
-},_statFor:function(b){var a=this.stats[b];if(!a){a=this.stats[b]={runs:0,amt:0,name:b,_starts:[],_times:[]};
-a=this.stats[b]}return a},reset:function(){this.stats={}},_bench:function(b,a){SC.Benchmark.bench(b,a,1)
-},_benchCount:1};SC.Benchmark=SC.Benchmark;SC.mixin({logBundleLoading:NO,bundleIsLoaded:function(a){var b=SC.BUNDLE_INFO[a];
-return b?!!b.loaded:NO},_scb_bundleDidLoad:function(b,h,a,j){var d,n;if(SC.typeOf(h)===SC.T_STRING){n=SC.objectForPropertyPath(h)
-}if(SC.typeOf(a)===SC.T_STRING){d=SC.objectForPropertyPath(a,n)}if(!d){if(SC.LAZY_INSTANTIATION[b]){var l=SC.LAZY_INSTANTIATION[b];
-if(SC.logBundleLoading){console.log("SC.loadBundle(): Bundle '%@' is marked for lazy instantiation, instantiating it now�".fmt(b))
-}for(var f=0,c=l.length;f<c;f++){try{l[f]()}catch(g){console.log("SC.loadBundle(): Failted to lazily instatiate entry for  '%@'".fmt(b))
-}}delete SC.LAZY_INSTANTIATION[b];if(SC.typeOf(h)===SC.T_STRING){n=SC.objectForPropertyPath(h)
-}if(SC.typeOf(a)===SC.T_STRING){d=SC.objectForPropertyPath(a,n)}if(!a){throw"SC.loadBundle(): could not find callback for lazily instantiated bundle '%@'".fmt(b)
-}}else{throw"SC.loadBundle(): could not find callback for '%@'".fmt(b)}}if(!j){j=[]
-}j.push(b);var k=!!SC.RunLoop.currentRunLoop;if(k){SC.RunLoop.begin()}d.apply(n,j);
-if(k){SC.RunLoop.end()}},tryToLoadBundle:function(d,e,f,b){var a,c;if(SC.typeOf(e)===SC.T_STRING){c=SC.objectForPropertyPath(e)
-}if(SC.typeOf(f)===SC.T_STRING){a=SC.objectForPropertyPath(f,c)}if(a||SC.LAZY_INSTANTIATION[d]){if(SC.logBundleLoading){console.log("SC.loadBundle(): Bundle '%@' found through other means, will attempt to load�".fmt(d))
-}SC.BUNDLE_INFO[d]={loaded:YES};return SC.BUNDLE_INFO[d]}return NO},loadBundle:function(s,w,d){var p,t;
-if(d===undefined&&SC.typeOf(w)===SC.T_FUNCTION){d=w;w=null}var m=SC.BUNDLE_INFO[s],v,u;
-var c=SC.A(arguments).slice(3);if(SC.logBundleLoading){console.log("SC.loadBundle(): Attempting to load '%@'".fmt(s))
-}if(!m){if(SC.logBundleLoading){console.log("SC.loadBundle(): Attemping to load %@ without SC.BUNDLE_INFO entry� could be loaded through other means.".fmt(s))
-}m=this.tryToLoadBundle(s,w,d,c)}if(!m){throw"SC.loadBundle(): could not find bundle '%@'".fmt(s)
-}else{if(m.loaded){if(SC.logBundleLoading){console.log("SC.loadBundle(): Bundle '%@' already loaded, skipping.".fmt(s))
-}if(d){if(SC.isReady){SC._scb_bundleDidLoad(s,w,d,c)}else{SC.ready(SC,function(){SC._scb_bundleDidLoad(s,w,d,c)
-})}}}else{if(SC.logBundleLoading){console.log("SC.loadBundle(): Bundle '%@' is not loaded, loading now.".fmt(s))
-}v=m.callbacks||[];if(d){v.push(function(){SC._scb_bundleDidLoad(s,w,d,c)});m.callbacks=v
-}if(!m.loading){var b=m.requires||[];var f=YES;for(p=0,t=b.length;p<t;++p){var n=b[p];
-var j=SC.BUNDLE_INFO[n];if(!j){throw"SC.loadBundle(): could not find required bundle '%@' for bundle '%@'".fmt(n,s)
-}else{if(j.loading){f=NO;break}else{if(j.loaded){continue}else{f=NO;var o=j.dependents;
-if(!o){j.dependents=o=[]}o.push(s);if(SC.logBundleLoading){console.log("SC.loadBundle(): '%@' depends on '%@', loading dependency�".fmt(s,n))
-}SC.loadBundle(n);break}}}}if(f){var k,e,g,a,h,l;h=document.getElementsByTagName("head")[0];
-if(!h){h=document.documentElement}k=m.styles||[];for(p=0,t=k.length;p<t;++p){g=k[p];
-if(g.length>0){a=document.createElement("link");a.setAttribute("href",g);a.setAttribute("rel","stylesheet");
-a.setAttribute("type","text/css");h.appendChild(a)}}var i=this._jsBundleLoadQueue;
-if(!i){this._jsBundleLoadQueue=i={}}i[s]=[];var r=i[s];e=m.scripts||[];for(p=0,t=e.length;
-p<t;++p){g=e[p];if(g.length>0){r.push(g)}}m.loading=YES;this.scriptDidLoad(s)}}}}},scriptDidLoad:function(c){var a=this._jsBundleLoadQueue;
-if(a){var e=a[c];if(e){var b=e.shift();if(SC.logBundleLoading){console.log("SC.scriptDidLoad(): Loading next file in '%@' -> '%@'".fmt(c,b))
-}var d=document.createElement("script");d.setAttribute("type","text/javascript");
-d.setAttribute("src",b);document.body.appendChild(d)}}},bundleDidLoad:function(d){var f=SC.BUNDLE_INFO[d],e,c;
-if(!f){f=SC.BUNDLE_INFO[d]={loaded:YES};return}if(f.loaded&&SC.logBundleLoading){console.log("SC.bundleDidLoad() called more than once for bundle '%@'. Skipping.".fmt(d));
-return}delete f.loading;f.loaded=YES;if(SC.isReady){SC._invokeCallbacksForBundle(d)
-}else{SC.ready(SC,function(){SC._invokeCallbacksForBundle(d)})}var g=f.dependents||[];
-for(var b=0,a=g.length;b<a;++b){if(SC.logBundleLoading){console.log("SC.loadBundle(): Bundle '%@' has completed loading, loading '%@' that depended on it.".fmt(d,g[b]))
-}SC.loadBundle(g[b])}},_invokeCallbacksForBundle:function(c){var e=SC.BUNDLE_INFO[c],d;
-if(!e){return}if(SC.logBundleLoading){console.log("SC.loadBundle(): Bundle '%@' has completed loading, invoking callbacks.".fmt(c))
-}d=e.callbacks||[];SC.RunLoop.begin();for(var b=0,a=d.length;b<a;++b){d[b]()}SC.RunLoop.end()
-}});sc_require("system/locale");SC.IMAGE_ABORTED_ERROR=SC.$error("SC.Image.AbortedError","Image",-100);
-SC.IMAGE_FAILED_ERROR=SC.$error("SC.Image.FailedError","Image",-101);SC.imageCache=SC.Object.create({loadLimit:4,activeRequests:0,loadImage:function(a,e,f,d){var b=SC.typeOf(e);
-if(SC.none(f)&&SC.typeOf(e)===SC.T_FUNCTION){e=null;f=e}if(SC.typeOf(f)===SC.T_STRING){f=e[f]
-}if(SC.none(d)){d=SC.none(e)&&SC.none(f)}var c=this._imageEntryFor(a);if(c.status===this.IMAGE_LOADED){if(f){f.call(e||c.image,c.url,c.image)
-}}else{if(e||f){this._addCallback(c,e,f)}c.retainCount++;this._scheduleImageEntry(c,d)
-}},releaseImage:function(a,d,e){var c=this._imageEntryFor(a,NO);if(!c){return this
-}if(--c.retainCount<=0){this._deleteEntry(c)}else{if(d||e){var b=SC.typeOf(d);if(SC.none(e)&&SC.typeOf(d)===SC.T_FUNCTION){d=null;
-e=d}if(SC.typeOf(e)===SC.T_STRING){e=d[e]}this._removeCallback(c,d,e)}}},reloadImage:function(a){var b=this._imageEntryFor(a,NO);
-if(b&&b.status===this.IMAGE_LOADED){b.status=this.IMAGE_WAITING}},loadNextImage:function(){var c=null,a;
-if(this.get("activeRequests")>=this.get("loadLimit")){return}a=this._foregroundQueue;
-while(a.length>0&&!c){c=a.shift()}if(!c){a=this._backgroundQueue;while(a.length>0&&!c){c=a.shift()
-}}this.set("isLoading",!!c);if(c){var b=c.image;b.onabort=this._imageDidAbort;b.onerror=this._imageDidError;
-b.onload=this._imageDidLoad;b.src=c.url;this._loading.push(c);this.incrementProperty("activeRequests");
-this.loadNextImage()}},_imageEntryFor:function(c,a){if(a===undefined){a=YES}var d=this._images[c];
-if(!d&&a){var b=new Image();d=this._images[c]={url:c,status:this.IMAGE_WAITING,callbacks:[],retainCount:0,image:b};
-b.entry=d}return d},_deleteEntry:function(a){this._unscheduleEntry(a);delete this._images[a.url]
-},_addCallback:function(c,d,e){var b=c.callbacks;var a=b.find(function(f){return f[0]===d&&f[1]===e
-},this);if(!a){b.push([d,e])}b=null;return this},_removeCallback:function(b,c,d){var a=b.callbacks;
-a.forEach(function(f,e){if(f[0]===c&&f[1]===d){a[e]=null}},this);a=null;return this
-},_scheduleImageEntry:function(d,c){var b=this._backgroundQueue;var e=this._foregroundQueue;
-if(d.status===this.IMAGE_LOADED){return this}if((d.status===this.IMAGE_QUEUE)&&!c&&d.isBackground){b[b.indexOf(d)]=null;
-d.status=this.IMAGE_WAITING}if(d.status!==this.IMAGE_QUEUE){var a=(c)?b:e;a.push(d);
-d.status=this.IMAGE_QUEUE;d.isBackground=c}if(!this.isLoading){this.invokeLater(this.loadNextImage,100)
-}this.set("isLoading",YES);return this},_unscheduleImageEntry:function(b){if(b.status!==this.IMAGE_QUEUE){return this
-}var a=b.isBackground?this._backgroundQueue:this._foregroundQueue;a[a.indexOf(b)]=null;
-if(this._loading.indexOf(b)>=0){a.image.abort();this.imageStatusDidChange(b,this.ABORTED)
-}return this},_imageDidAbort:function(){SC.imageCache.imageStatusDidChange(this.entry,SC.imageCache.ABORTED)
-},_imageDidError:function(){SC.imageCache.imageStatusDidChange(this.entry,SC.imageCache.ERROR)
-},_imageDidLoad:function(){SC.imageCache.imageStatusDidChange(this.entry,SC.imageCache.LOADED)
-},imageStatusDidChange:function(c,a){if(!c){return}var b=c.url;var d;switch(a){case this.LOADED:d=c.image;
-break;case this.ABORTED:d=SC.IMAGE_ABORTED_ERROR;break;case this.ERROR:d=SC.IMAGE_FAILED_ERROR;
-break;default:d=SC.IMAGE_FAILED_ERROR;break}c.callbacks.forEach(function(f){var g=f[0],h=f[1];
-h.call(g,b,d)},this);c.callbacks=[];c.status=(a===this.LOADED)?this.IMAGE_LOADED:this.IMAGE_WAITING;
-var e=c.image;if(e){e.onload=e.onerror=e.onabort=null;if(a!==this.LOADED){c.image=null
-}}this._loading[this._loading.indexOf(c)]=null;if(this._loading.length>this.loadLimit*2){this._loading=this._loading.compact()
-}this.decrementProperty("activeRequests");this.loadNextImage()},init:function(){arguments.callee.base.apply(this,arguments);
-this._images={};this._loading=[];this._foregroundQueue=[];this._backgroundQueue=[]
-},IMAGE_LOADED:"loaded",IMAGE_QUEUED:"queued",IMAGE_WAITING:"waiting",ABORTED:"aborted",ERROR:"error",LOADED:"loaded"});
-SC.Page=SC.Object.extend({owner:null,get:function(a){var b=this[a];if(b&&b.isClass){this[a]=b=b.create({page:this});
-if(!this.get("inDesignMode")){b.awake()}return b}else{return arguments.callee.base.apply(this,arguments)
-}},awake:function(){for(var a in this){if(!this.hasOwnProperty(a)){continue}var b=this[a];
-if(b&&b.isViewClass){this[a]=b=b.create({page:this})}}return this},getIfConfigured:function(b){var a=this[b];
-return(a&&a.isViewClass)?null:this.get(b)},loc:function(c){for(var b in c){if(!c.hasOwnProperty(b)){continue
-}var a=this[b];if(!a||!a.isViewClass){continue}a.loc(c[b])}return this}});SC.Page.design=SC.Page.create;
-SC.Page.localization=function(a){return a};sc_require("system/event");SC.mixin({_isReadyBound:NO,_bindReady:function(){if(this._isReadyBound){return
-}this._isReadyBound=YES;tiki.require("system").ready(this,this._didBecomeReady)},_readyQueue:[],_afterReadyQueue:[],isReady:NO,_didBecomeReady:function(){if(SC.isReady){return
-}if(typeof SC.mapDisplayNames===SC.T_FUNCTION){SC.mapDisplayNames()}SC.Locale.createCurrentLocale();
-if(document&&document.getElementsByTagName){var d=document.getElementsByTagName("body")[0];
-if(d){var g=d.className;var c=SC.Locale.currentLanguage.toLowerCase();d.className=(g&&g.length>0)?[g,c].join(" "):c
-}}SC.Benchmark.start("ready");SC.RunLoop.begin();var i,b,h,e;do{b=SC._readyQueue;
-SC._readyQueue=[];for(h=0,e=b.length;h<e;h++){i=b[h];var f=i[0]||document;var a=i[1];
-if(a){a.call(f)}}}while(SC._readyQueue.length>0);SC.isReady=YES;SC._readyQueue=null;
-SC.Event.trigger("ready",null,document,NO);if(SC.removeLoading){SC.$("#loading").remove()
-}if((SC.mode===SC.APP_MODE)&&(typeof main!="undefined")&&(main instanceof Function)&&!SC.suppressMain){main()
-}if(SC.routes&&SC.routes.ping){SC.routes.ping()}SC.RunLoop.end();SC.Benchmark.end("ready");
-SC.Benchmark.log()},ready:function(b,c){var a=this._readyQueue;if(c===undefined){c=b;
-b=null}else{if(SC.typeOf(c)===SC.T_STRING){c=b[c]}}if(!c){return this}if(this.isReady){return c.call(b||document)
-}a.push([b,c]);return this}});SC._bindReady();SC.removeLoading=YES;SC.APP_MODE="APP_MODE";
-SC.TEST_MODE="TEST_MODE";SC.mode=SC.APP_MODE;sc_require("system/builder");SC.MODE_REPLACE="replace";
-SC.MODE_APPEND="append";SC.MODE_PREPEND="prepend";SC.RenderContext=SC.Builder.create({SELF_CLOSING:SC.CoreSet.create().addEach("area base basefront br hr input img link meta".w()),init:function(b,a){if(b===undefined){b="div"
-}if(a){this.prevObject=a;this.strings=a.strings;this.offset=a.length+a.offset}if(!this.strings){this.strings=[]
-}this.needsContent=YES;if(SC.typeOf(b)===SC.T_STRING){this._tagName=b.toLowerCase();
-this._needsTag=YES;var d=this;while(d){d.length++;d=d.prevObject}this.strings.push(null);
-this._selfClosing=this.SELF_CLOSING.contains(this._tagName)}else{this._elem=b;this._needsTag=NO;
-this.length=0;this.needsContent=NO}return this},strings:null,offset:0,length:0,updateMode:SC.MODE_REPLACE,needsContent:NO,get:function(b){var a=this.strings||[];
-return(b===undefined)?a.slice(this.offset,this.length):a[b+this.offset]},push:function(d){var b=this.strings,a=arguments.length;
-if(!b){this.strings=b=[]}if(a>1){b.push.apply(b,arguments)}else{b.push(d)}var e=this;
-while(e){e.length+=a;e=e.prevObject}this.needsContent=YES;return this},text:function(c){var b=arguments.length,a=0;
-for(a=0;a<b;a++){this.push(SC.RenderContext.escapeHTML(arguments[a]))}return this
-},join:function(b){if(this._needsTag){this.end()}var a=this.strings;return a?a.join(b||""):""
-},begin:function(a){return SC.RenderContext(a,this)},element:function(){if(this._elem){return this._elem
-}var a,b;if(!SC.RenderContext.factory){SC.RenderContext.factory=document.createElement("div")
-}SC.RenderContext.factory.innerHTML=this.join();if(SC.RenderContext.factory.innerHTML.length>0){b=SC.RenderContext.factory.firstChild.cloneNode(true);
-SC.RenderContext.factory.innerHTML=""}else{b=null}return b},remove:function(a){if(!a){return
-}var b,c=this._elem;if(!c||!c.removeChild){return}b=document.getElementById(a);if(b){b=c.removeChild(b);
-b=null}},update:function(){var a=this._elem,e=this.updateMode,i,g,k,c,h,d,f;if(!a){return
-}if(this.length>0){if(e===SC.MODE_REPLACE){a.innerHTML=this.join()}else{c=a.cloneNode(false);
-c.innerHTML=this.join();f=(e===SC.MODE_APPEND)?null:a.firstChild;h=c.firstChild;while(h){d=h.nextSibling;
-a.insertBefore(h,d);h=d}h=d=c=f=null}}if(this._attrsDidChange&&(g=this._attrs)){for(i in g){if(!g.hasOwnProperty(i)){continue
-}if(g[i]===null){a.removeAttribute(i)}else{SC.$(a).attr(i,g[i])}}}if(this._classNamesDidChange&&(g=this._classNames)){SC.$(a).attr("class",g.join(" "))
-}if(this._idDidChange&&(g=this._id)){SC.$(a).attr("id",g)}if(this._stylesDidChange&&(k=this._styles)){var b=this._STYLE_PAIR_ARRAY,j=this._JOIN_ARRAY;
-for(i in k){if(!k.hasOwnProperty(i)){continue}g=k[i];if(g===null){continue}if(typeof g===SC.T_NUMBER){g=g.toString()+"px"
-}b[0]=i.dasherize();b[1]=g;j.push(b.join(": "))}SC.$(a).attr("style",j.join("; "));
-j.length=0}a=this._elem=null;return this.prevObject||this},_DEFAULT_ATTRS:{},_TAG_ARRAY:[],_JOIN_ARRAY:[],_STYLE_PAIR_ARRAY:[],end:function(){var l=this._TAG_ARRAY,b,j,h;
-var i=this._attrs,d=this._classNames;var a=this._id,k=this._styles;l[0]="<";l[1]=this._tagName;
-if(i||d||k||a){if(!i){i=this._DEFAULT_ATTRS}if(a){i.id=a}if(d){i["class"]=d.join(" ")
-}if(k){j=this._JOIN_ARRAY;b=this._STYLE_PAIR_ARRAY;for(h in k){if(!k.hasOwnProperty(h)){continue
-}b[0]=h.dasherize();b[1]=k[h];if(b[1]===null){continue}if(typeof b[1]===SC.T_NUMBER){b[1]="%@px".fmt(b[1])
-}j.push(b.join(": "))}i.style=j.join("; ");j.length=0}l.push(" ");for(h in i){if(!i.hasOwnProperty(h)){continue
-}if(i[h]===null){continue}l.push(h);l.push('="');l.push(i[h]);l.push('" ')}if(i===this._DEFAULT_ATTRS){delete i.style;
-delete i["class"];delete i.id}}var g=this.strings;var f=(this._selfClosing===NO)?NO:(this.length===1);
-l.push(f?" />":">");g[this.offset]=l.join("");l.length=0;if(!f){l[0]="</";l[1]=this._tagName;
-l[2]=">";g.push(l.join(""));var e=this;while(e){e.length++;e=e.prevObject}l.length=0
-}this._elem=null;return this.prevObject||this},tag:function(a,b){return this.begin(a,b).end()
-},tagName:function(a){if(a===undefined){if(!this._tagName&&this._elem){this._tagName=this._elem.tagName
-}return this._tagName}else{this._tagName=a;this._tagNameDidChange=YES;return this
-}},id:function(a){if(a===undefined){if(!this._id&&this._elem){this._id=this._elem.id
-}return this._id}else{this._id=a;this._idDidChange=YES;return this}},classNames:function(b,a){if(b===undefined){if(!this._classNames&&this._elem){this._classNames=(this._elem.getAttribute("class")||"").split(" ")
-}if(this._cloneClassNames){this._classNames=(this._classNames||[]).slice();this._cloneClassNames=NO
-}if(!this._classNames){this._classNames=[]}return this._classNames}else{this._classNames=b;
-this._cloneClassNames=a||NO;this._classNamesDidChange=YES;return this}},hasClass:function(a){return this.classNames().indexOf(a)>=0
-},addClass:function(a){var b=this.classNames();if(b.indexOf(a)<0){b.push(a);this._classNamesDidChange=YES
-}return this},removeClass:function(b){var c=this._classNames,a;if(!c&&this._elem){c=this._classNames=(this._elem.getAttribute("class")||"").split(" ")
-}if(c&&(a=c.indexOf(b))>=0){if(this._cloneClassNames){c=this._classNames=c.slice();
-this._cloneClassNames=NO}c[a]=null;this._classNamesDidChange=YES}return this},resetClassNames:function(){this._classNames=[];
-this._classNamesDidChange=YES;return this},setClass:function(d,c){var f,a,b,e;if(c!==undefined){return c?this.addClass(d):this.removeClass(d)
-}else{f=this._classNames;if(!f&&this._elem){f=this._classNames=(this._elem.getAttribute("class")||"").split(" ")
-}if(!f){f=this._classNames=[]}if(this._cloneClassNames){f=this._classNames=f.slice();
-this._cloneClassNames=NO}e=NO;for(b in d){if(!d.hasOwnProperty(b)){continue}a=f.indexOf(b);
-if(d[b]){if(a<0){f.push(b);e=YES}}else{if(a>=0){f[a]=null;e=YES}}}if(e){this._classNamesDidChange=YES
-}}return this},_STYLE_REGEX:/\s*([^:\s]+)\s*:\s*([^;\s]+)\s*;?/g,styles:function(d,e){var a,c,b;
-if(d===undefined){if(!this._styles&&this._elem){a=SC.$(this._elem).attr("style");
-if(a&&(a=a.toString()).length>0){if(SC.browser.msie){a=a.toLowerCase()}d={};c=this._STYLE_REGEX;
-c.lastIndex=0;while(b=c.exec(a)){d[b[1].camelize()]=b[2]}this._styles=d;this._cloneStyles=NO
-}else{this._styles={}}}else{if(!this._styles){this._styles={}}else{if(this._cloneStyles){this._styles=SC.beget(this._styles);
-this._cloneStyles=NO}}}return this._styles}else{this._styles=d;this._cloneStyles=e||NO;
-this._stylesDidChange=YES;return this}},addStyle:function(a,e){var b,d=NO,c=this.styles();
-if(typeof a===SC.T_STRING){if(e===undefined){return c[a]}else{if(c[a]!==e){c[a]=e;
-this._stylesDidChange=YES}}}else{for(b in a){if(!a.hasOwnProperty(b)){continue}e=a[b];
-if(c[b]!==e){c[b]=e;d=YES}}if(d){this._stylesDidChange=YES}}return this},removeStyle:function(a){if(!this._styles&&!this._elem){return this
-}var b=this.styles();if(b[a]){b[a]=null;this._stylesDidChange=YES}},attr:function(a,e){var c,b=this._attrs,d=NO;
-if(!b){this._attrs=b={}}if(typeof a===SC.T_STRING){if(e===undefined){return b[a]}else{if(b[a]!==e){b[a]=e;
-this._attrsDidChange=YES}}}else{for(c in a){if(!a.hasOwnProperty(c)){continue}e=a[c];
-if(b[c]!==e){b[c]=e;d=YES}}if(d){this._attrsDidChange=YES}}return this}});SC.RenderContext.fn.html=SC.RenderContext.fn.push;
-SC.RenderContext.fn.css=SC.RenderContext.fn.addStyle;if(!SC.browser.isSafari||parseInt(SC.browser.version,10)<526){SC.RenderContext._safari3=YES
-}SC.RenderContext.escapeHTML=function(d){var c,b,a;if(SC.none(d)){return d}c=this.escapeHTMLElement;
-if(!c){c=this.escapeHTMLElement=document.createElement("div")}b=this.escapeTextNode;
-if(!b){b=this.escapeTextNode=document.createTextNode("");c.appendChild(b)}b.data=d;
-a=c.innerHTML;if(SC.RenderContext._safari3){a=a.replace(/>/g,"&gt;")}b=c=null;return a
-};SC.Response=SC.Object.extend({isError:NO,errorValue:function(){return this}.property().cacheable(),errorObject:null,request:null,originalRequest:function(){var a=this.get("request");
-while(a.get("source")){a=a.get("source")}return a}.property("request").cacheable(),type:function(){return this.getPath("request.type")
-}.property("request").cacheable(),address:function(){return this.getPath("request.address")
-}.property("request").cacheable(),isJSON:function(){return this.getPath("request.isJSON")||NO
-}.property("request").cacheable(),isXML:function(){return this.getPath("request.isXML")||NO
-}.property("request").cacheable(),listeners:function(){return this.getPath("request.listeners")
-}.property("request").cacheable(),status:-100,headers:null,encodedBody:null,body:function(){var a=this.get("encodedBody");
-if(a&&this.get("isJSON")){try{a=SC.json.decode(a)}catch(b){return SC.Error.create({message:b.name+": "+b.message,label:"Response",errorValue:this})
-}}return a}.property("encodedBody").cacheable(),response:function(){return this.get("body")
-}.property("body").cacheable(),isCancelled:NO,fire:function(){var a=this.get("request"),b=a?a.get("source"):null;
-if(b&&b.willSend){b.willSend(a,this)}a.freeze();if(!this.get("isCancelled")){this.invokeTransport()
-}if(!this.get("isCancelled")&&b&&b.didSend){b.didSend(a,this)}},invokeTransport:function(){this.receive(function(a){this.set("status",200)
-},this)},receive:function(d,a){var b=this.get("request");var c=b?b.get("source"):null;
-if(c&&c.willReceive){c.willReceive(b,this)}d.call(a,!this.get("isCancelled"));if(!this.get("isCancelled")&&c&&c.didReceive){c.didReceive(b,this)
-}if(!this.get("isCancelled")){this.notify()}SC.Request.manager.transportDidClose(this);
-return this},cancel:function(){if(!this.get("isCancelled")){this.set("isCancelled",YES);
-this.cancelTransport();SC.Request.manager.transportDidClose(this)}},cancelTransport:function(){},_notifyListener:function(b,a){var e=b[a],f,d,c;
-if(!e){return NO}f=(e.params||[]).copy();f.unshift(this);d=e.target;c=e.action;if(SC.typeOf(c)===SC.T_STRING){c=d[c]
-}return c.apply(d,f)},notify:function(){var b=this.get("listeners"),a=this.get("status"),c=Math.floor(a/100)*100,d=NO;
-if(!b){return this}SC.RunLoop.begin();d=this._notifyListener(b,a);if(!d){d=this._notifyListener(b,c)
-}if(!d){d=this._notifyListener(b,0)}SC.RunLoop.end();return this},toString:function(){var a=arguments.callee.base.apply(this,arguments);
-return"%@<%@ %@, status=%@".fmt(a,this.get("type"),this.get("address"),this.get("status"))
-}});SC.XHRResponse=SC.Response.extend({headers:function(){var c=this.get("rawRequest"),b=c?c.getAllResponseHeaders():null,a={};
-if(!b){return a}b.split("\n").forEach(function(g){var d=g.indexOf(":"),e,f;if(d>=0){e=g.slice(0,d);
-f=g.slice(d+1).trim();a[e]=f}},this);return a}.property("status").cacheable(),header:function(a){var b=this.get("rawRequest");
-return b?b.getResponseHeader(a):null},encodedBody:function(){var b=this.get("rawRequest"),a;
-if(!b){a=null}else{if(this.get("isXML")){a=b.responseXML}else{a=b.responseText}}return a
-}.property("status").cacheable(),cancelTransport:function(){var a=this.get("rawRequest");
-if(a){a.abort()}this.set("rawRequest",null)},invokeTransport:function(){var d,g,b,c,f;
-function e(){for(var h=0;h<arguments.length;h++){try{var j=arguments[h]();return j
-}catch(k){}}return NO}d=e(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")
-},function(){return new ActiveXObject("Microsoft.XMLHTTP")});this.set("rawRequest",d);
-c=!!this.getPath("request.isAsynchronous");if(c){if(!SC.browser.msie){SC.Event.add(d,"readystatechange",this,this.finishRequest,d)
-}else{g=this;b=function(){if(!g){return null}var h=g.finishRequest();g=null;return h
-};d.onreadystatechange=b}}d.open(this.get("type"),this.get("address"),c);f=this.getPath("request.headers");
-for(var a in f){d.setRequestHeader(a,f[a])}d.send(this.getPath("request.encodedBody"));
-if(!c){this.finishRequest()}return d},finishRequest:function(c){var e=this.get("rawRequest"),a=e.readyState,d,b,f;
-if(a===4){this.receive(function(g){if(!g){return}b=-1;try{b=e.status||0}catch(h){}if((b<200)||(b>=300)){f=e.statusText;
-d=SC.$error(f||"HTTP Request failed","Request",b);d.set("errorValue",this);this.set("isError",YES);
-this.set("errorObject",d)}this.set("status",b)},this)}if(a===4){e.onreadystatechange=function(){}
-}}});sc_require("system/response");SC.Request=SC.Object.extend(SC.Copyable,SC.Freezable,{isAsynchronous:YES,isJSON:NO,isXML:NO,headers:function(){var a=this._headers;
-if(!a){a=this._headers={}}return a}.property().cacheable(),responseClass:SC.XHRResponse,source:null,address:null,type:"GET",body:null,encodedBody:function(){var a=this.get("body");
-if(a&&this.get("isJSON")){a=SC.json.encode(a)}return a}.property("isJSON","isXML","body").cacheable(),willSend:function(b,a){},didSend:function(b,a){},willReceive:function(b,a){},didReceive:function(b,a){},COPY_KEYS:"isAsynchronous isJSON isXML address type body responseClass willSend didSend willReceive didReceive".w(),copy:function(){var a={},d=this.COPY_KEYS,f=d.length,b,c,e;
-while(--f>=0){b=d[f];if(this.hasOwnProperty(b)){a[b]=this.get(b)}}if(this.hasOwnProperty("listeners")){a.listeners=SC.copy(this.get("listeners"))
-}if(this.hasOwnProperty("_headers")){a._headers=SC.copy(this._headers)}a.source=this.get("source")||this;
-return this.constructor.create(a)},header:function(a,b){var c;if(SC.typeOf(a)===SC.T_STRING){c=this._headers;
-if(arguments.length===1){return c?c[a]:null}else{this.propertyWillChange("headers");
-if(!c){c=this._headers={}}c[a]=b;this.propertyDidChange("headers");return this}}else{if(b===undefined){c=a;
-this.beginPropertyChanges();for(a in c){if(!c.hasOwnProperty(a)){continue}this.header(a,c[a])
-}this.endPropertyChanges();return this}}return this},json:function(a){if(a===undefined){a=YES
-}if(a){this.set("isXML",NO)}return this.set("isJSON",a)},xml:function(a){if(a===undefined){a=YES
-}if(a){this.set("isJSON",NO)}return this.set("isXML",a)},_prep:function(){var a=!!this.header("Content-Type");
-if(this.get("isJSON")&&!a){this.header("Content-Type","application/json")}else{if(this.get("isXML")&&!a){this.header("Content-Type","text/xml")
-}}return this},send:function(a){if(a){this.set("body",a)}return SC.Request.manager.sendRequest(this.copy()._prep())
-},resend:function(){var a=this.get("source")?this:this.copy()._prep();return SC.Request.manager.sendRequest(a)
-},notify:function(a,e,d){var c=YES,f;if(SC.typeOf(a)!==SC.T_NUMBER){f=SC.A(arguments).slice(2);
-d=e;e=a;a=0;c=NO}else{f=SC.A(arguments).slice(3)}var b=this.get("listeners");if(!b){this.set("listeners",b={})
-}b[a]={target:e,action:d,params:f};return this}});SC.Request.mixin({getUrl:function(a){return SC.Request.create().set("address",a).set("type","GET")
-},postUrl:function(b,a){var c=SC.Request.create().set("address",b).set("type","POST");
-if(a){c.set("body",a)}return c},deleteUrl:function(a){return SC.Request.create().set("address",a).set("type","DELETE")
-},putUrl:function(b,a){var c=SC.Request.create().set("address",b).set("type","PUT");
-if(a){c.set("body",a)}return c}});SC.Request.manager=SC.Object.create(SC.DelegateSupport,{maxRequests:6,inflight:[],pending:[],sendRequest:function(b){if(!b){return null
-}var a=b.get("responseClass").create({request:b});this.get("pending").pushObject(a);
-this.fireRequestIfNeeded();return a},cancel:function(b){var d=this.get("pending"),c=this.get("inflight"),a;
-if(d.indexOf(b)>=0){this.propertyWillChange("pending");d.removeObject(b);this.propertyDidChange("pending");
-return YES}else{if(c.indexOf(b)>=0){b.cancel();c.removeObject(b);this.fireRequestIfNeeded();
-return YES}else{return NO}}},cancelAll:function(){if(this.get("pending").length||this.get("inflight").length){this.set("pending",[]);
-this.get("inflight").forEach(function(a){a.cancel()});this.set("inflight",[]);return YES
-}else{return NO}},fireRequestIfNeeded:function(){var d=this.get("pending"),c=this.get("inflight"),a=this.get("maxRequests"),b;
-if((d.length>0)&&(c.length<a)){b=d.shiftObject();c.pushObject(b);b.fire()}},transportDidClose:function(a){this.get("inflight").removeObject(a);
-this.fireRequestIfNeeded()}});sc_require("system/ready");SC.RootResponder=SC.Object.extend({panes:null,init:function(){arguments.callee.base.apply(this,arguments);
-this.panes=SC.Set.create()},mainPane:null,makeMainPane:function(b){var a=this.get("mainPane");
-if(a===b){return this}this.beginPropertyChanges();if(this.get("keyPane")===a){this.makeKeyPane(b)
-}this.set("mainPane",b);if(a){a.blurMainTo(b)}if(b){b.focusMainFrom(a)}this.endPropertyChanges();
-return this},keyPane:null,previousKeyPanes:[],makeKeyPane:function(f){var e,a,d;if(f){if(!f.get("acceptsKeyPane")){return this
-}else{var a=this.get("keyPane");if(a===f){return this}else{if(a){d=this.get("previousKeyPanes");
-d.push(a)}e=f}}}else{a=this.get("keyPane");d=this.get("previousKeyPanes");var e=null;
-while(d.length>0){var c=d.pop();if(c.get("isPaneAttached")&&c.get("acceptsKeyPane")){e=c;
-break}}}if(!e){var b=this.get("mainPane");if(b.get("acceptsKeyPane")){e=b}}if(a){a.willLoseKeyPaneTo(e)
-}if(e){e.willBecomeKeyPaneFrom(a)}this.set("keyPane",e);if(e){e.didBecomeKeyPaneFrom(a)
-}if(a){a.didLoseKeyPaneTo(e)}return this},computeWindowSize:function(){return{width:640,height:480}
-},defaultResponder:null,sendAction:function(c,d,b,e,a){d=this.targetForAction(c,d,b,e);
-if(d&&d.isResponderContext){return !!d.sendAction(c,b,a)}else{return d&&d.tryToPerform(c,b)
-}},_responderFor:function(c,a){var b=c?c.get("defaultResponder"):null;if(c){c=c.get("firstResponder")||c;
-do{if(c.respondsTo(a)){return c}}while(c=c.get("nextResponder"))}if(typeof b===SC.T_STRING){b=SC.objectForPropertyPath(b)
-}if(!b){return null}else{if(b.isResponderContext){return b}else{if(b.respondsTo(a)){return b
-}else{return null}}}},targetForAction:function(b,e,d,f){if(!b||(SC.typeOf(b)!==SC.T_STRING)){return null
-}if(e){if(SC.typeOf(e)===SC.T_STRING){e=SC.objectForPropertyPath(e)}if(e){if(e.respondsTo&&!e.respondsTo(b)){e=null
-}else{if(SC.typeOf(e[b])!==SC.T_FUNCTION){e=null}}}return e}if(f){return this._responderFor(f,b)
-}var a=this.get("keyPane"),c=this.get("mainPane");if(a&&(a!==f)){e=this._responderFor(a,b)
-}if(!e&&c&&(c!==a)){e=this._responderFor(c,b)}if(!e&&(e=this.get("defaultResponder"))){if(SC.typeOf(e)===SC.T_STRING){e=SC.objectForPropertyPath(e);
-if(e){this.set("defaultResponder",e)}}if(e){if(e.respondsTo&&!e.respondsTo(b)){e=null
-}else{if(SC.typeOf(e[b])!==SC.T_FUNCTION){e=null}}}}return e},targetViewForEvent:function(a){return a.target?SC.$(a.target).view()[0]:null
-},sendEvent:function(c,a,d){var e,b;SC.RunLoop.begin();if(d){e=d.get("pane")}else{e=this.get("keyPane")||this.get("mainPane")
-}b=(e)?e.sendEvent(c,a,d):null;SC.RunLoop.end();return b},listenFor:function(b,a){b.forEach(function(c){var d=this[c];
-if(d){SC.Event.add(a,c,this,d)}},this);a=null;return this},setup:function(){}});SC.ready(SC.RootResponder,SC.RootResponder.ready=function(){var a;
-a=SC.RootResponder.responder=SC.RootResponder.create();a.setup()});SC.routes=SC.Object.create({location:function(b,c){if(c!==undefined){if(c===null){c=""
-}if(typeof(c)=="object"){var d=c.route?c.route.split("&"):[""];var a=d.shift();var e={};
-d.forEach(function(g){var f=g.split("=");e[f[0]]=f[1]});for(b in c){if(!c.hasOwnProperty(b)){continue
-}if(b!="route"){e[b]=encodeURIComponent(""+c[b])}}d=[a];for(b in e){if(!e.hasOwnProperty(b)){continue
-}d.push([b,e[b]].join("="))}c=d.join("&")}if(this._location!=c){this._location=c;
-this._setWindowLocation(c)}}return this._location}.property(),ping:function(){if(!this._didSetupHistory){this._didSetupHistory=true;
-this._setupHistory()}this._checkWindowLocation()},add:function(a,c,d){if(d===undefined&&SC.typeOf(c)===SC.T_FUNCTION){d=c;
-c=null}else{if(SC.typeOf(d)===SC.T_STRING){d=c[d]}}var b=a.split("/");if(!this._routes){this._routes=SC.routes._Route.create()
-}this._routes.addRoute(b,c,d);return this},gotoRoute:function(a){var e={},d,b,c,f;
-this._lastRoute=a;d=a.split("&");if(d&&d.length>0){a=d.shift();d.forEach(function(g){var h=g.split("=");
-if(h&&h.length>1){e[h[0]]=decodeURIComponent(h[1])}})}else{a=""}d=a.split("/");if(!this._routes){this._routes=SC.routes._Route.create()
-}b=this._routes.functionForRoute(d,e);if(b){c=b._target;f=b._method;if(f){f.call(c,e)
-}}},init:function(){arguments.callee.base.call(this);if(SC.browser.isSafari&&!(SC.browser.safari>=3)){SC.mixin(this,this.browserFuncs.safari)
-}else{if(SC.browser.isIE){SC.mixin(this,this.browserFuncs.ie)}else{if(SC.browser.isMozilla){SC.mixin(this,this.browserFuncs.firefox)
-}}}this._didSetupHistory=false},invokeCheckWindowLocation:function(c){var b=this.__checkWindowLocation,a=this;
-if(!b){b=this.__checkWindowLocation=function(){a._checkWindowLocation()}}setTimeout(b,c)
-},browserFuncs:{safari:{_setupHistory:function(){var a=location.hash;a=(a&&a.length>0)?a.slice(1,a.length):"";
-this._cloc=a;this._backStack=[];this._backStack.length=history.length;this._backStack.push(a);
-this._forwardStack=[];this.invokeCheckWindowLocation(1000)},_checkWindowLocation:function(){var b=(history.length-this._lastLength)!==0;
-var e=(b)?(history.length-this._backStack.length):0;this._lastLength=history.length;
-if(b){console.log("historyDidChange")}if(e){if(e<0){this._forwardStack.push(this._cloc);
-for(var a=0;a<Math.abs(e+1);a++){this._forwardStack.push(this._backStack.pop())}this._cloc=this._backStack.pop()
-}else{this._backStack.push(this._cloc);for(a=0;a<(e-1);a++){this._backStack.push(this._forwardStack.pop())
-}this._cloc=this._forwardStack.pop()}}else{if(b&&this._locationDidChange){this.gotoRoute(this._cloc);
-this._locationDidChange=false}}var d=this._cloc;var c=this.get("location");if(d!=c){this.set("location",(d)?d:"");
-this.gotoRoute(d)}this.invokeCheckWindowLocation(50)},_setWindowLocation:function(b){var a=this._cloc;
-if(a!=b){this._backStack.push(this._cloc);this._forwardStack.length=0;this._cloc=b;
-location.hash=(b&&b.length>0)?b:"";this._locationDidChange=true}}},ie:{_setupHistory:function(){this.invokeCheckWindowLocation(1000)
-},_checkWindowLocation:function(){var b=this.get("location");var a=location.hash;
-a=(a&&a.length>0)?a.slice(1,a.length):"";if(a!=b){this.set("location",(a)?a:"")}this.invokeCheckWindowLocation(100)
-},_setWindowLocation:function(b){var a=location.hash;a=(a&&a.length>0)?a.slice(1,a.length):"";
-if(a!=b){location.hash=(b&&b.length>0)?b:"#"}this.gotoRoute(b)}},firefox:{_checkWindowLocation:function(){var b=this.get("location");
-var a=location.hash;a=(a&&a.length>0)?a.slice(1,a.length):"";if(a!=b){SC.RunLoop.begin();
-this.set("location",(a)?a:"");SC.RunLoop.end()}this.invokeCheckWindowLocation(150)
-},_setWindowLocation:function(b){var a=location.hash;a=(a&&a.length>0)?a.slice(1,a.length):"";
-if(a!=b){location.hash=(b&&b.length>0)?b:"#"}this.gotoRoute(b)}}},_setupHistory:function(){var a=this;
-this.invokeCheckWindowLocation(1000)},_checkWindowLocation:function(){var b=this.get("location");
-var a=decodeURI(location.hash);a=(a&&a.length>0)?a.slice(1,a.length):"";if(a!==b){SC.RunLoop.begin();
-this.set("location",(a)?a:"");SC.RunLoop.end()}this.invokeCheckWindowLocation(150)
-},_setWindowLocation:function(b){var a=location.hash;a=(a&&a.length>0)?a.slice(1,a.length):"";
-if(a!=b){location.hash=(b&&b.length>0)?encodeURI(b):"#"}this.gotoRoute(b)},_routes:null,_Route:SC.Object.extend({_target:null,_method:null,_static:null,_dynamic:null,_wildcard:null,addRoute:function(d,c,f){if(!d||d.length===0){this._target=c;
-this._method=f}else{var b=d.shift();var e=null;switch(b.slice(0,1)){case":":b=b.slice(1,b.length);
-var a=this._dynamic[b]||[];e=SC.routes._Route.create();a.push(e);this._dynamic[b]=a;
-break;case"*":b=b.slice(1,b.length);this._wildcard=b;this._target=c;this._method=f;
-break;default:a=this._static[b]||[];e=SC.routes._Route.create();a.push(e);this._static[b]=a
-}if(e){e.addRoute(d,c,f)}}},functionForRoute:function(c,b){if(!c||c.length===0){return this
-}else{var a=c.shift(),f=null,j,h,e,d;j=this._static[a];if(j){for(e=0,d=j.length;(e<d)&&(f===null);
-e++){var g=c.slice();f=j[e].functionForRoute(g,b)}}if(f===null){for(var i in this._dynamic){j=this._dynamic[i];
-if(j){for(e=0,d=j.length;(e<d)&&(f===null);e++){g=c.slice();f=j[e].functionForRoute(g,b);
-if(f&&b){b[i]=a}}}if(f){break}}}if((f===null)&&this._wildcard){c.unshift(a);if(b){b[this._wildcard]=c.join("/")
-}f=this}return f}},init:function(){arguments.callee.base.call(this);this._static={};
-this._dynamic={}}})});SC.TextSelection=SC.Object.extend(SC.Copyable,SC.Freezable,{start:-1,end:-1,length:function(){var b=this.get("start");
-var a=this.get("end");if((b)===-1||(a===-1)){return -1}else{return a-b}}.property("start","end").cacheable(),init:function(){arguments.callee.base.apply(this,arguments);
-this.freeze()},copy:function(){return SC.TextSelection.create({start:this.get("start"),end:this.get("end")})
-},toString:function(){var a=this.get("length");if(a&&a>0){if(a===1){return"[%@ character selected: {%@, %@}]".fmt(a,this.get("start"),this.get("end"))
-}else{return"[%@ characters selected: {%@, %@}]".fmt(a,this.get("start"),this.get("end"))
-}}else{return"[no text selected; caret at %@]".fmt(this.get("start"))}}});SC.time=function(a){var b=SC.beget(fn);
-b.value=timeOffset;return b};(function(){var a=new Date();SC.mixin(SC.time,{month:function(c,b){a.setTime(c);
-if(b===undefined){return a.getMonth()}a.setMonth(b);return a.getTime()},utc:function(b){a.setTime(b);
-return b+(a.getTimezoneOffset()*60*1000)},local:function(b){a.setTime(b);return b-(a.getTimezoneOffset()*60*1000)
-},parse:function(b){},format:function(b){}})})();SC.time.fmt=SC.time.format;SC.time.fn={done:function(){return this.value
-}};"month day year".split(" ").forEach(function(a){SC.time.fn[a]=function(b){if(b===undefined){return SC.time[a](this.value)
-}else{this.value=SC.time[a](this.value,b);return this}}});var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
-var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");
-function LZ(a){return(a<0||a>9?"":"0")+a}SC.Locale.define("en",{longMonthNames:"January February March April May".split(" "),shortMonthNames:[],shortDateFormat:"dd/mm/yy",longDateFormat:""});
-SC.mixin(Date,{now:function(){return new Date().getTime()},isDate:function(c,b){var a=Date.getDateFromFormat(c,b);
-if(a==0){return false}return true},compareDates:function(e,f,c,d){var b=Date.getDateFromFormat(e,f);
-var a=Date.getDateFromFormat(c,d);if(b==0||a==0){return -1}else{if(b>a){return 1}}return 0
-},getDateFromFormat:function(z,q){z=z+"";q=q+"";var w=0;var l=0;var s="";var f="";
-var v="";var h,g;var b=new Date();var j=b.getFullYear();var u=b.getMonth()+1;var t=1;
-var d=b.getHours();var r=b.getMinutes();var n=b.getSeconds();var k="";var o=SC.Locale.currentLocale;
-while(l<q.length){s=q.charAt(l);f="";while((q.charAt(l)==s)&&(l<q.length)){f+=q.charAt(l++)
-}if(f=="yyyy"||f=="yy"||f=="y"){if(f=="yyyy"){h=4;g=4}if(f=="yy"){h=2;g=2}if(f=="y"){h=2;
-g=4}j=Date._getInt(z,w,h,g);if(j==null){return 0}w+=j.length;if(j.length==2){if(j>70){j=1900+(j-0)
-}else{j=2000+(j-0)}}}else{if(f=="MMM"||f=="NNN"){u=0;for(var p=0;p<MONTH_NAMES.length;
-p++){var e=MONTH_NAMES[p];if(z.substring(w,w+e.length).toLowerCase()==e.toLowerCase()){if(f=="MMM"||(f=="NNN"&&p>11)){u=p+1;
-if(u>12){u-=12}w+=e.length;break}}}if((u<1)||(u>12)){return 0}}else{if(f=="EE"||f=="E"){for(var p=0;
-p<DAY_NAMES.length;p++){var m=DAY_NAMES[p];if(z.substring(w,w+m.length).toLowerCase()==m.toLowerCase()){w+=m.length;
-break}}}else{if(f=="MM"||f=="M"){u=Date._getInt(z,w,f.length,2);if(u==null||(u<1)||(u>12)){return 0
-}w+=u.length}else{if(f=="dd"||f=="d"){t=Date._getInt(z,w,f.length,2);if(t==null||(t<1)||(t>31)){return 0
-}w+=t.length}else{if(f=="hh"||f=="h"){d=Date._getInt(z,w,f.length,2);if(d==null||(d<1)||(d>12)){return 0
-}w+=d.length}else{if(f=="HH"||f=="H"){d=Date._getInt(z,w,f.length,2);if(d==null||(d<0)||(d>23)){return 0
-}w+=d.length}else{if(f=="KK"||f=="K"){d=Date._getInt(z,w,f.length,2);if(d==null||(d<0)||(d>11)){return 0
-}w+=d.length}else{if(f=="kk"||f=="k"){d=Date._getInt(z,w,f.length,2);if(d==null||(d<1)||(d>24)){return 0
-}w+=d.length;d--}else{if(f=="mm"||f=="m"){r=Date._getInt(z,w,f.length,2);if(r==null||(r<0)||(r>59)){return 0
-}w+=r.length}else{if(f=="ss"||f=="s"){n=Date._getInt(z,w,f.length,2);if(n==null||(n<0)||(n>59)){return 0
-}w+=n.length}else{if(f=="a"){if(z.substring(w,w+2).toLowerCase()=="am"){k="AM"}else{if(z.substring(w,w+2).toLowerCase()=="pm"){k="PM"
-}else{return 0}}w+=2}else{if(z.substring(w,w+f.length)!=f){return 0}else{w+=f.length
-}}}}}}}}}}}}}}if(w!=z.length){return 0}if(u==2){if(((j%4==0)&&(j%100!=0))||(j%400==0)){if(t>29){return 0
-}}else{if(t>28){return 0}}}if((u==4)||(u==6)||(u==9)||(u==11)){if(t>30){return 0}}if(d<12&&k=="PM"){d=d-0+12
-}else{if(d>11&&k=="AM"){d-=12}}var a=new Date(j,u-1,t,d,r,n);return a.getTime()},parseDate:function(k){var g=(arguments.length==2)?arguments[1]:false;
-generalFormats=new Array("E NNN dd HH:mm:ss UTC yyyy","y-M-d","y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d","d MMM y","d.MMM.y","y MMM d","y.MMM.d");
-monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");
-var b=new Array("generalFormats",g?"dateFirst":"monthFirst",g?"monthFirst":"dateFirst");
-var h=null;h=0;var e=new Date().getTime();switch(k.toLowerCase()){case"yesterday".loc():h=e-(24*60*60*1000);
-break;case"today".loc():case"now".loc():h=e;break;case"tomorrow".loc():h=e+(24*60*60*1000);
-break}if(h>0){return new Date(h)}for(var f=0;f<b.length;f++){var a=window[b[f]];for(var c=0;
-c<a.length;c++){h=Date.getDateFromFormat(k,a[c]);if(h==0){h=Date.getDateFromFormat(k,a[c]+" H:m:s")
-}if(h==0){h=Date.getDateFromFormat(k,a[c]+" h:m:s a")}if(h!=0){return new Date(h)
-}}}return null},_isInteger:function(c){var b="1234567890";for(var a=0;a<c.length;
-a++){if(b.indexOf(c.charAt(a))==-1){return false}}return true},_getInt:function(f,d,e,c){for(var a=c;
-a>=e;a--){var b=f.substring(d,d+a);if(b.length<e){return null}if(Date._isInteger(b)){return b
-}}return null}});SC.mixin(Date.prototype,{format:function(D){D=D+"";var I=this;var l="";
-var v=0;var G="";var f="";var j=I.getFullYear()+"";var g=I.getMonth()+1;var F=I.getDate();
-var o=I.getDay();var n=I.getHours();var x=I.getMinutes();var q=I.getSeconds();var t,u,b,r,J,e,C,B,z,p,N,n,L,i,a,A;
-var w=new Object();if(j.length<4){j=""+(j-0+1900)}w.y=""+j;w.yyyy=j;w.yy=j.substring(2,4);
-w.M=g;w.MM=LZ(g);w.MMM=MONTH_NAMES[g-1];w.NNN=MONTH_NAMES[g+11];w.d=F;w.dd=LZ(F);
-w.E=DAY_NAMES[o+7];w.EE=DAY_NAMES[o];w.H=n;w.HH=LZ(n);if(n==0){w.h=12}else{if(n>12){w.h=n-12
-}else{w.h=n}}w.hh=LZ(w.h);if(n>11){w.K=n-12}else{w.K=n}w.k=n+1;w.KK=LZ(w.K);w.kk=LZ(w.k);
-if(n>11){w.a="PM"}else{w.a="AM"}w.m=x;w.mm=LZ(x);w.s=q;w.ss=LZ(q);while(v<D.length){G=D.charAt(v);
-f="";while((D.charAt(v)==G)&&(v<D.length)){f+=D.charAt(v++)}if(w[f]!=null){l=l+w[f]
-}else{l=l+f}}return l},utcFormat:function(){return(new Date(this.getTime()+(this.getTimezoneOffset()*60*1000))).format("E NNN dd HH:mm:ss UTC yyyy")
-}});SC.Timer=SC.Object.extend({target:null,action:null,isPooled:YES,interval:0,startTime:null,repeats:NO,until:null,isPaused:NO,isScheduled:NO,isValid:YES,lastFireTime:0,fireTime:function(){if(!this.get("isValid")){return -1
-}var e=this.get("startTime");if(!e||e===0){return -1}var a=this.get("interval"),c=this.get("lastFireTime");
-if(c<e){c=e}var b;if(this.get("repeats")){if(a===0){b=c}else{b=e+(Math.floor((c-e)/a)+1)*a
-}}else{b=e+a}var d=this.get("until");if(d&&d>0&&b>d){b=d}return b}.property("interval","startTime","repeats","until","isValid","lastFireTime").cacheable(),schedule:function(){if(!this.get("isValid")){return this
-}this.beginPropertyChanges();if(!this.startTime){this.set("startTime",SC.RunLoop.currentRunLoop.get("startTime"))
-}var a=this.get("fireTime"),b=this.get("lastFireTime");if(a>=b){this.set("isScheduled",YES);
-SC.RunLoop.currentRunLoop.scheduleTimer(this,a)}this.endPropertyChanges();return this
-},invalidate:function(){this.beginPropertyChanges();this.set("isValid",NO);SC.RunLoop.currentRunLoop.cancelTimer(this);
-this.action=this.target=null;this.endPropertyChanges();if(this.get("isPooled")){SC.Timer.returnTimerToPool(this)
-}return this},fire:function(){var b=Date.now();this.set("lastFireTime",b);var a=this.get("fireTime");
-if(!this.get("isPaused")){this.performAction()}if(a>b){this.schedule()}else{this.invalidate()
-}},performAction:function(){var a=SC.typeOf(this.action);if(a==SC.T_FUNCTION){this.action.call((this.target||this),this)
-}else{if(a===SC.T_STRING){if(this.action.indexOf(".")>=0){var e=this.action.split(".");
-var c=e.pop();var d=SC.objectForPropertyPath(e,window);var b=d.get?d.get(c):d[c];
-if(b&&SC.typeOf(b)==SC.T_FUNCTION){b.call(d,this)}else{throw"%@: Timer could not find a function at %@".fmt(this,this.action)
-}}else{SC.RootResponder.responder.sendAction(this.action,this.target,this)}}}},init:function(){arguments.callee.base.apply(this,arguments);
-if(this.startTime instanceof Date){this.startTime=this.startTime.getTime()}if(this.until instanceof Date){this.until=this.until.getTime()
-}},RESET_DEFAULTS:{target:null,action:null,isPooled:YES,isPaused:NO,isScheduled:NO,isValid:YES,interval:0,repeats:NO,until:null,startTime:null,lastFireTime:0},reset:function(b){if(!b){b=SC.EMPTY_HASH
-}this.propertyWillChange("fireTime");var c=this.RESET_DEFAULTS;for(var a in c){if(!c.hasOwnProperty(a)){continue
-}this[a]=SC.none(b[a])?c[a]:b[a]}this.propertyDidChange("fireTime");return this},removeFromTimerQueue:function(c){var b=this._timerQueuePrevious,a=this._timerQueueNext;
-if(!b&&!a&&c!==this){return c}if(b){b._timerQueueNext=a}if(a){a._timerQueuePrevious=b
-}this._timerQueuePrevious=this._timerQueueNext=null;return(c===this)?a:c},scheduleInTimerQueue:function(c,b){this._timerQueueRunTime=b;
-var a=c;var d=null;while(a&&a._timerQueueRunTime<b){d=a;a=a._timerQueueNext}if(d){d._timerQueueNext=this;
-this._timerQueuePrevious=d}if(a){a._timerQueuePrevious=this;this._timerQueueNext=a
-}return(a===c)?this:c},collectExpiredTimers:function(c,a){if(this._timerQueueRunTime>a){return this
-}c.push(this);var b=this._timerQueueNext;this._timerQueueNext=null;if(b){b._timerQueuePrevious=null
-}return b?b.collectExpiredTimers(c,a):null}});SC.Timer.schedule=function(a){var b;
-if(!a||SC.none(a.isPooled)||a.isPooled){b=this.timerFromPool(a)}else{b=this.create(a)
-}return b.schedule()};SC.Timer.timerFromPool=function(a){var b=this._timerPool;if(!b){b=this._timerPool=[]
-}var c=b.pop();if(!c){c=this.create()}return c.reset(a)};SC.Timer.returnTimerToPool=function(a){if(!this._timerPool){this._timerPool=[]
-}this._timerPool.push(a);return this};SC.UserDefaults=SC.Object.extend({userDomain:null,appDomain:null,_defaults:null,defaults:function(a){this._defaults=a;
-this.allPropertiesDidChange()},readDefault:function(f){var d=undefined;f=this._normalizeKeyName(f);
-var a=this._userKeyName(f);if(this._written){d=this._written[a]}var c=window.localStorage;
-if(!c&&window.globalStorage){c=window.globalStorage[window.location.hostname]}if(c){d=c[["SC.UserDefaults",a].join("@")];
-if(!SC.none(d)){try{d=SC.json.decode(d)}catch(g){d=undefined}}else{d=undefined}}var b=this.delegate;
-if(b&&b.userDefaultsNeedsDefault){d=b.userDefaultsNeedsDefault(this,f,a)}if((d===undefined)&&this._defaults){d=this._defaults[a]||this._defaults[f]
-}return d},writeDefault:function(e,f){e=this._normalizeKeyName(e);var a=this._userKeyName(e);
-var c=this._written;if(!c){c=this._written={}}c[a]=f;var d=window.localStorage;if(!d&&window.globalStorage){d=window.globalStorage[window.location.hostname]
-}if(d){d[["SC.UserDefaults",a].join("@")]=SC.json.encode(f)}var b=this.delegate;if(b&&b.userDefaultsDidChange){b.userDefaultsDidChange(this,e,f,a)
-}return this},resetDefault:function(e){var d=this._normalizeKeyName(e);var a=this._userKeyName(d);
-this.propertyWillChange(e);this.propertyWillChange(d);var b=this._written;if(b){delete b[a]
-}var c=window.localStorage;if(!c&&window.globalStorage){c=window.globalStorage[window.location.hostname]
-}if(c){delete c[["SC.UserDefaults",a].join("@")]}this.propertyDidChange(e);this.propertyDidChange(d);
-return this},unknownProperty:function(a,b){if(b===undefined){return this.readDefault(a)
-}else{this.writeDefault(a,b);return b}},_normalizeKeyName:function(a){if(a.indexOf(":")<0){var b=this.get("appDomain")||"app";
-a=[b,a].join(":")}return a},_userKeyName:function(b){var a=this.get("userDomain")||"(anonymous)";
-return[a,b].join("@")},_domainDidChange:function(){var a=NO;if(this.get("userDomain")!==this._scud_userDomain){this._scud_userDomain=this.get("userDomain");
-a=YES}if(this.get("appDomain")!==this._scud_appDomain){this._scud_appDomain=this.get("appDomain");
-a=YES}if(a){this.allPropertiesDidChange()}}.observes("userDomain","appDomain"),init:function(){arguments.callee.base.apply(this,arguments);
-this._scud_userDomain=this.get("userDomain");this._scud_appDomain=this.get("appDomain")
-}});SC.userDefaults=SC.UserDefaults.create();sc_require("system/browser");SC.mixin({_downloadFrames:0,_copy_computed_props:["maxWidth","maxHeight","paddingLeft","paddingRight","paddingTop","paddingBottom","fontFamily","fontSize","fontStyle","fontWeight"],download:function(e){var a=document.createElement("iframe");
-var d="DownloadFrame_"+this._downloadFrames;SC.$(a).attr("id",d);a.style.border="10px";
-a.style.width="0px";a.style.height="0px";a.style.position="absolute";a.style.top="-10000px";
-a.style.left="-10000px";if(!SC.browser.isSafari){SC.$(a).attr("src",e)}document.getElementsByTagName("body")[0].appendChild(a);
-if(SC.browser.isSafari){SC.$(a).attr("src",e)}this._downloadFrames=this._downloadFrames+1;
-if(!SC.browser.isSafari){var c=function(){document.body.removeChild(document.getElementById(d));
-d=null};var b=c.invokeLater(null,2000)}a=null},normalizeURL:function(a){if(a.slice(0,1)=="/"){a=window.location.protocol+"//"+window.location.host+a
-}else{if((a.slice(0,5)=="http:")||(a.slice(0,6)=="https:")){}else{a=window.location.href+"/"+a
-}}return a},minX:function(a){return a.x||0},maxX:function(a){return(a.x||0)+(a.width||0)
-},midX:function(a){return(a.x||0)+((a.width||0)/2)},minY:function(a){return a.y||0
-},maxY:function(a){return(a.y||0)+(a.height||0)},midY:function(a){return(a.y||0)+((a.height||0)/2)
-},centerX:function(b,a){return(a.width-b.width)/2},centerY:function(b,a){return(a.height-b.height)/2
-},pointInRect:function(a,b){return(a.x>=SC.minX(b))&&(a.y>=SC.minY(b))&&(a.x<=SC.maxX(b))&&(a.y<=SC.maxY(b))
-},rectsEqual:function(b,a,c){if(!b||!a){return(b==a)}if(SC.none(c)){c=0.1}if((b.y!=a.y)&&(Math.abs(b.y-a.y)>c)){return NO
-}if((b.x!=a.x)&&(Math.abs(b.x-a.x)>c)){return NO}if((b.width!=a.width)&&(Math.abs(b.width-a.width)>c)){return NO
-}if((b.height!=a.height)&&(Math.abs(b.height-a.height)>c)){return NO}return YES},intersectRects:function(b,a){var c={x:Math.max(SC.minX(b),SC.minX(a)),y:Math.max(SC.minY(b),SC.minY(a)),width:Math.min(SC.maxX(b),SC.maxX(a)),height:Math.min(SC.maxY(b),SC.maxY(a))};
-c.width=Math.max(0,c.width-c.x);c.height=Math.max(0,c.height-c.y);return c},unionRects:function(b,a){var c={x:Math.min(SC.minX(b),SC.minX(a)),y:Math.min(SC.minY(b),SC.minY(a)),width:Math.max(SC.maxX(b),SC.maxX(a)),height:Math.max(SC.maxY(b),SC.maxX(a))};
-c.width=Math.max(0,c.width-c.x);c.height=Math.max(0,c.height-c.y);return c},cloneRect:function(a){return{x:a.x,y:a.y,width:a.width,height:a.height}
-},stringFromRect:function(a){return"{%@, %@, %@, %@}".fmt(a.x,a.y,a.width,a.height)
-},stringFromLayout:function(e){var d=["maxHeight","maxWidth","minHeight","minWidth","centerY","centerX","width","height","bottom","right","top","left"];
-var a=[];var c=d.length;while(--c>=0){var b=d[c];if(e.hasOwnProperty(b)){a.push(b+":"+e[b])
-}}return"{"+a.join(", ")+"}"},heightForString:function(g,d,c,f){var e=this._heightCalcElement,b,a;
-b=(f&&SC.typeOf(f)===SC.T_ARRAY)?f.join(" "):"";if(!d){d=100}if(!e){e=this._heightCalcElement=document.createElement("div");
-document.body.insertBefore(e,null)}c="%@; width: %@px; left: %@px; position: absolute".fmt(c,d,(-1*d));
-e.setAttribute("style",c);if(b!==""){e.setAttribute("class",b)}e.textContent=g;a=e.clientHeight;
-e=null;return a},metricsForString:function(k,n,a){var j=this._metricsCalculationElement,d,m,g,o,c;
-g=SC.A(a).join(" ");if(!j){j=this._metricsCalculationElement=document.createElement("div");
-document.body.insertBefore(j,null)}if(SC.typeOf(n)!=SC.T_STRING){var f=null;if(document.defaultView&&document.defaultView.getComputedStyle){f=document.defaultView.getComputedStyle(n,null)
-}else{f=n.currentStyle}c=f.cssText;if(!c||c.trim()===""){var l=this._copy_computed_props;
-for(var h=0;h<l.length;h++){var b=l[h],e=f[b];j.style[b]=e}SC.mixin(j.style,{left:"0px",top:"0px",position:"absolute",bottom:"auto",right:"auto",width:"auto",height:"auto"})
-}else{j.setAttribute("style",c+"; position:absolute; left: 0px; top: 0px; bottom: auto; right: auto; width: auto; height: auto;")
-}f=null}else{c=n;j.setAttribute("style",c+"; position:absolute; left: 0px; top: 0px; bottom: auto; right: auto; width: auto; height: auto;")
-}if(typeof j.innerText!="undefined"){j.innerText=k}else{j.textContent=k}j.className=g;
-var p={width:j.clientWidth,height:j.clientHeight};j.innerHTML="";j.className="";j.setAttribute("style","");
-j=null;return p},viewportOffset:function(c){if(c.getBoundingClientRect){var d=c.getBoundingClientRect();
-return{x:d.left,y:d.top}}var i=0;var e=0;var h=c;var b=SC.browser.mozilla>=3;while(h){e+=(h.offsetTop||0);
-if(!b||(h!==c)){e+=(h.clientTop||0)}i+=(h.offsetLeft||0);if(!b||(h!==c)){i+=(h.clientLeft||0)
-}if(SC.browser.mozilla){var g=SC.$(h).attr("overflow");if(g!=="visible"){var f=parseInt(SC.$(h).attr("borderLeftWidth"),0)||0;
-var j=parseInt(SC.$(h).attr("borderTopWidth"),0)||0;if(c!==h){f*=2;j*=2}i+=f;e+=j
-}var a=h.offsetParent;if((SC.browser.mozilla>=3)&&a){e-=a.clientTop;i-=a.clientLeft
-}}if(h.offsetParent==document.body&&SC.$(h).attr("position")=="absolute"){break}h=h.offsetParent
-}h=c;while(h){if(!SC.browser.isOpera||h.tagName=="BODY"){e-=h.scrollTop||0;i-=h.scrollLeft||0
-}h=h.parentNode}return{x:i,y:e}},ZERO_POINT:{x:0,y:0},ZERO_RANGE:{start:0,length:0},RANGE_NOT_FOUND:{start:0,length:-1},valueInRange:function(b,a){return(b>=0)&&(b>=a.start)&&(b<(a.start+a.length))
-},minRange:function(a){return a.start},maxRange:function(a){return(a.length<0)?-1:(a.start+a.length)
-},unionRanges:function(c,b){if((c===null)||(c.length<0)){return b}if((b===null)||(b.length<0)){return c
-}var d=Math.min(c.start,b.start);var a=Math.max(SC.maxRange(c),SC.maxRange(b));return{start:d,length:a-d}
-},intersectRanges:function(c,b){if((c===null)||(b===null)){return SC.RANGE_NOT_FOUND
-}if((c.length<0)||(b.length<0)){return SC.RANGE_NOT_FOUND}var d=Math.max(SC.minRange(c),SC.minRange(b));
-var a=Math.min(SC.maxRange(c),SC.maxRange(b));if(a<d){return SC.RANGE_NOT_FOUND}return{start:d,length:a-d}
-},subtractRanges:function(c,b){if((c===null)||(b===null)){return SC.RANGE_NOT_FOUND
-}if((c.length<0)||(b.length<0)){return SC.RANGE_NOT_FOUND}var a=Math.max(SC.minRange(c),SC.minRange(b));
-var d=Math.min(SC.maxRange(c),SC.maxRange(b));if(a<d){return SC.RANGE_NOT_FOUND}return{start:d,length:a-d}
-},cloneRange:function(a){return{start:a.start,length:a.length}},rangesEqual:function(b,a){if(b===a){return true
-}if(b===null){return a.length<0}if(a===null){return b.length<0}return(b.start==a.start)&&(b.length==a.length)
-},convertHsvToHex:function(j,w,o){var a=0;var k=0;var n=0;if(o>0){var e=(j==1)?0:Math.floor(j*6);
-var l=(j==1)?0:(j*6)-e;var d=o*(1-w);var c=o*(1-(w*l));var u=o*(1-(w*(1-l)));var m=[[o,u,d],[c,o,d],[d,o,u],[d,c,o],[u,d,o],[o,d,c]];
-a=Math.round(255*m[e][0]);k=Math.round(255*m[e][1]);n=Math.round(255*m[e][2])}return this.parseColor("rgb("+a+","+k+","+n+")")
-},convertHexToHsv:function(g){var c=this.expandColor(g);var a=Math.max(Math.max(c[0],c[1]),c[2]);
-var d=Math.min(Math.min(c[0],c[1]),c[2]);var f=(a==d)?0:((a==c[0])?((c[1]-c[2])/(a-d)/6):((a==c[1])?((c[2]-c[0])/(a-d)/6+1/3):((c[0]-c[1])/(a-d)/6+2/3)));
-f=(f<0)?(f+1):((f>1)?(f-1):f);var e=(a===0)?0:(1-d/a);var b=a/255;return[f,e,b]},PARSE_COLOR_RGBRE:/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i,PARSE_COLOR_HEXRE:/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,expandColor:function(b){var c,e,d,a;
-c=this.parseColor(b);if(c){e=parseInt(c.slice(1,3),16);d=parseInt(c.slice(3,5),16);
-a=parseInt(c.slice(5,7),16);return[e,d,a]}},parseColor:function(d){var e=0,a="#",c;
-if(c=this.PARSE_COLOR_RGBRE.exec(d)){var b;for(e=1;e<=3;e++){b=Math.max(0,Math.min(255,parseInt(c[e],0)));
-a+=this.toColorPart(b)}return a}if(c=this.PARSE_COLOR_HEXRE.exec(d)){if(c[1].length==3){for(e=0;
-e<3;e++){a+=c[1].charAt(e)+c[1].charAt(e)}return a}return"#"+c[1]}return false},toColorPart:function(a){if(a>255){a=255
-}var b=a.toString(16);if(a<16){return"0"+b}return b},getStyle:function(a,b){var c="";
-if(document.defaultView&&document.defaultView.getComputedStyle){c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b)
-}else{if(a.currentStyle){b=b.replace(/\-(\w)/g,function(d,e){return e.toUpperCase()
-});c=a.currentStyle[b]}}return c}});sc_require("views/view");SC.ContainerView=SC.View.extend({classNames:["sc-container-view"],nowShowing:null,contentView:null,contentViewBindingDefault:SC.Binding.single(),replaceContent:function(a){this.removeAllChildren();
-if(a){this.appendChild(a)}},createChildViews:function(){var a=this.get("contentView");
-if(a){a=this.contentView=this.createChildView(a);this.childViews=[a]}},awake:function(){arguments.callee.base.apply(this,arguments);
-var a=this.get("nowShowing");if(a&&a.length>0){this.nowShowingDidChange()}},nowShowingDidChange:function(){var b=this.get("nowShowing");
-var a=null;if(SC.typeOf(b)===SC.T_STRING){if(b===SC.CONTENT_SET_DIRECTLY){return}if(b&&b.length>0){if(b.indexOf(".")>0){a=SC.objectForPropertyPath(b,null)
-}else{a=SC.objectForPropertyPath(b,this.get("page"))}}}else{a=b}if(a&&!(a instanceof SC.View)){a=null
-}this.set("contentView",a)}.observes("nowShowing"),contentViewDidChange:function(){this.replaceContent(this.get("contentView"))
-}.observes("contentView")});sc_require("views/view");sc_require("mixins/control");
-sc_require("mixins/validatable");SC.FieldView=SC.View.extend(SC.Control,SC.Validatable,{isTextArea:NO,followSafariTabFocusBehavior:NO,_field_isMouseDown:NO,fieldValue:function(){var a=this.get("value");
-if(SC.typeOf(a)===SC.T_ERROR){a=a.get("value")}return this.fieldValueForObject(a)
-}.property("value","validator").cacheable(),$input:function(){if(this.get("isTextArea")){return this.$("textarea").andSelf().filter("textarea")
-}else{return this.$("input").andSelf().filter("input")}},setFieldValue:function(b){if(SC.none(b)){b=""
-}var a=this.$input();if(a.val()!==b){a.val(b)}return this},getFieldValue:function(){return this.$input().val()
-},_field_fieldValueDidChange:function(a){SC.RunLoop.begin();this.fieldValueDidChange(NO);
-SC.RunLoop.end()},fieldValueDidChange:function(a){var c=this.getFieldValue();var b=this.objectForFieldValue(c,a);
-this.setIfChanged("value",b)},_field_valueDidChange:function(){this.setFieldValue(this.get("fieldValue"))
-}.observes("value"),didCreateLayer:function(){this.setFieldValue(this.get("fieldValue"));
-SC.Event.add(this.$input(),"change",this,this._field_fieldValueDidChange)},willDestroyLayer:function(){SC.Event.remove(this.$input(),"change",this,this._field_fieldValueDidChange)
-},updateLayer:function(){arguments.callee.base.apply(this,arguments)},mouseDown:function(a){this._field_isMouseDown=YES;
-a.allowDefault();return YES},mouseOut:function(a){if(this._field_isMouseDown){this.set("isActive",NO)
-}a.allowDefault();return YES},mouseOver:function(a){this.set("isActive",this._field_isMouseDown);
-a.allowDefault();return YES},mouseUp:function(a){if(this._field_isMouseDown){this.set("isActive",NO)
-}this._field_isMouseDown=NO;a.allowDefault();return YES},keyDown:function(b){if(b.which===9){var a=b.shiftKey?this.get("previousValidKeyView"):this.get("nextValidKeyView");
-a.becomeFirstResponder();return YES}if(this.performValidateKeyDown(b)){this._isKeyDown=YES;
-b.allowDefault()}else{b.stop()}return YES},acceptsFirstResponder:function(){if(!this.get("followSafariTabFocusBehavior")){return this.get("isEnabled")
-}return NO}.property("isEnabled"),willBecomeKeyResponderFrom:function(a){if(!this._isFocused){this._isFocused=YES;
-this.becomeFirstResponder();if(this.get("isVisibleInWindow")){this.$input().get(0).focus()
-}}},willLoseKeyResponderTo:function(a){if(this._isFocused){this._isFocused=NO}},_field_setFieldValue:function(b){this.propertyWillChange("fieldValue");
-if(this.fieldValueForObject){b=this.fieldValueForObject(b)}var a=this.setFieldValue(b);
-this.propertyDidChange("fieldValue");return a},_field_getFieldValue:function(){var a=this.getFieldValue();
-if(this.objectForFieldValue){a=this.objectForFieldValue(a)}return a}});sc_require("views/view");
-sc_require("mixins/control");SC.IMAGE_STATE_NONE="none";SC.IMAGE_STATE_LOADING="loading";
-SC.IMAGE_STATE_LOADED="loaded";SC.IMAGE_STATE_FAILED="failed";SC.IMAGE_STATE_SPRITE="sprite";
-SC.BLANK_IMAGE_URL="/static/sproutcore/foundation/en/ed50641e9278e55501165cb24eee859fe1f0ac61/blank.gif";
-SC.ImageView=SC.View.extend(SC.Control,{classNames:"sc-image-view",tagName:"img",status:SC.IMAGE_STATE_NONE,value:null,useImageCache:YES,canLoadInBackground:NO,localize:YES,displayProperties:"status toolTip".w(),render:function(c,f){var a=this.get("status"),d=this.get("value");
-if(a===SC.IMAGE_STATE_NONE&&d){this._image_valueDidChange()}a=this.get("status");
-var e=(a===SC.IMAGE_STATE_LOADED)?d:SC.BLANK_IMAGE_URL;if(a===SC.IMAGE_STATE_SPRITE){c.addClass(d)
-}c.attr("src",e);var b=this.get("toolTip");if(SC.typeOf(b)===SC.T_STRING){if(this.get("localize")){b=b.loc()
-}c.attr("title",b);c.attr("alt",b)}},_image_valueDidChange:function(){var b=this.get("value"),c;
-if(b&&b.isEnumerable){b=b.firstObject()}c=SC.ImageView.valueIsUrl(b);if(c&&this.get("useImageCache")){var a=this.get("isVisibleInWindow")||this.get("canLoadInBackground");
-this._loadingUrl=b;SC.imageCache.loadImage(b,this,this.imageDidLoad,a);if(this._loadingUrl){this.set("status",SC.IMAGE_STATE_LOADING)
-}}else{this._loadingUrl=null;this.set("status",(c)?SC.IMAGE_STATE_LOADED:SC.IMAGE_STATE_SPRITE);
-this.displayDidChange()}}.observes("value"),imageDidLoad:function(a,b){if(a===this._loadingUrl){this._loadingUrl=null
-}if(this.get("value")===a){this.set("status",SC.$ok(b)?SC.IMAGE_STATE_LOADED:SC.IMAGE_STATE_FAILED);
-this.displayDidChange()}}});SC.ImageView.valueIsUrl=function(a){return a?a.indexOf("/")>=0:NO
-};sc_require("views/view");sc_require("mixins/control");SC.ALIGN_LEFT="left";SC.ALIGN_RIGHT="right";
-SC.ALIGN_CENTER="center";SC.REGULAR_WEIGHT="normal";SC.BOLD_WEIGHT="bold";SC.LabelView=SC.View.extend(SC.Control,{classNames:["sc-label-view"],fontWeight:SC.REGULAR_WEIGHT,escapeHTML:true,escapeHTMLBindingDefault:SC.Binding.oneWay().bool(),localize:false,localizeBindingDefault:SC.Binding.oneWay().bool(),formatter:null,value:"",hint:null,exampleInlineTextFieldView:SC.InlineTextFieldView,icon:null,textAlign:SC.ALIGN_LEFT,isInlineEditorMultiline:NO,displayValue:function(){var f=this.get("value");
-var d=this.getDelegateProperty("formatter",this.displayDelegate);if(d){var e=(SC.typeOf(d)===SC.T_FUNCTION)?d(f,this):d.fieldValueForObject(f,this);
-if(!SC.none(e)){f=e}}if(SC.typeOf(f)===SC.T_ARRAY){var c=[];for(var b=0;b<f.get("length");
-b++){var a=f.objectAt(b);if(!SC.none(a)&&a.toString){a=a.toString()}c.push(a)}f=c.join(",")
-}if(!SC.none(f)&&f.toString){f=f.toString()}if(f&&this.getDelegateProperty("localize",this.displayDelegate)){f=f.loc()
-}if(this.get("escapeHTML")){f=SC.RenderContext.escapeHTML(f)}return f}.property("value","localize","formatter","escapeHTML").cacheable(),isEditable:NO,isEditableBindingDefault:SC.Binding.bool(),isEditing:NO,validator:null,doubleClick:function(a){return this.beginEditing()
-},beginEditing:function(){if(this.get("isEditing")){return YES}if(!this.get("isEditable")){return NO
-}var b=this.$();var d=this.get("value")||"";var c=SC.viewportOffset(b[0]);var a=this.convertFrameFromView(this.get("frame"),null);
-c.width=a.width;c.height=a.height;SC.InlineTextFieldView.beginEditing({frame:c,delegate:this,exampleElement:b,value:d,multiline:this.get("isInlineEditorMultiline"),isCollection:NO,validator:this.get("validator"),exampleInlineTextFieldView:this.get("exampleInlineTextFieldView")})
-},discardEditing:function(){if(!this.get("isEditing")){return YES}return SC.InlineTextFieldView.discardEditing()
-},commitEditing:function(){if(!this.get("isEditing")){return YES}return SC.InlineTextFieldView.commitEditing()
-},inlineEditorWillBeginEditing:function(a){this.set("isEditing",YES)},inlineEditorDidBeginEditing:function(a){this._oldOpacity=this.$().css("opacity");
-this.$().css("opacity",0)},inlineEditorShouldEndEditing:function(a,b){return YES},inlineEditorDidEndEditing:function(a,b){this.setIfChanged("value",b);
-this.$().css("opacity",this._oldOpacity);this._oldOpacity=null;this.set("isEditing",NO)
-},displayProperties:"displayValue textAlign fontWeight icon".w(),_TEMPORARY_CLASS_HASH:{},render:function(c,h){var f=this.get("displayValue"),e=this.get("icon"),g=this.get("hint");
-if(e){var a=(e.indexOf("/")>=0)?e:"/static/sproutcore/foundation/en/ed50641e9278e55501165cb24eee859fe1f0ac61/blank.gif";
-var d=(a===e)?"":e;e='<img src="%@" alt="" class="icon %@" />'.fmt(a,d);c.push(e)
-}if(g&&(!f||f==="")){c.push('<span class="sc-hint">',g,"</span>")}else{c.push(f)}c.addStyle("text-align",this.get("textAlign")).addStyle("font-weight",this.get("fontWeight"));
-var b=this._TEMPORARY_CLASS_HASH;b.icon=!!this.get("icon");c.setClass(b);if(this.get("isEditing")){c.addStyle("opacity",0)
-}}});sc_require("views/field");sc_require("system/text_selection");sc_require("mixins/static_layout");
-SC.TextFieldView=SC.FieldView.extend(SC.StaticLayout,SC.Editable,{tagName:"label",classNames:["sc-text-field-view"],isPassword:NO,isTextArea:NO,hint:null,isEditing:NO,leftAccessoryView:null,rightAccessoryView:null,_isFocused:NO,isEditable:function(){return this.get("isEnabled")
-}.property("isEnabled").cacheable(),selection:function(l,j){var d=this.$input().get(0);
-var e,a,c;if(j===undefined){if(d){a=null;c=null;if(!d.value){a=c=0}else{if("selectionStart" in d){a=d.selectionStart
-}if("selectionEnd" in d){c=d.selectionEnd}if(a===null||c===null){var k=document.selection;
-if(k){var i=k.type;if(i&&(i==="None"||i==="Text")){e=k.createRange();if(!this.get("isTextArea")){var b=e.text.length;
-a=Math.abs(e.moveStart("character",0-(d.value.length+1)));c=a+b}else{var h=e.duplicate();
-h.moveToElementText(d);h.setEndPoint("EndToStart",e);a=h.text.length;c=a+e.text.length
-}}}}}return SC.TextSelection.create({start:a,end:c})}else{return null}}else{if(!j||!j.kindOf||!j.kindOf(SC.TextSelection)){throw"When setting the selection, you must specify an SC.TextSelection instance."
-}if(d){var g,f;if("selectionStart" in d){d.selectionStart=j.get("start");g=YES}if("selectionEnd" in d){d.selectionEnd=j.get("end");
-f=YES}if(!g||!f){e=d.createTextRange();a=j.get("start");e.move("character",a);e.moveEnd("character",j.get("end")-a);
-e.select()}}}}.property("fieldValue").cacheable(),displayProperties:"hint fieldValue isEditing leftAccessoryView rightAccessoryView isTextArea".w(),createChildViews:function(){this.accessoryViewObserver()
-},accessoryViewObserver:function(){var f;var h=["leftAccessoryView","rightAccessoryView"];
-var a=h.length;for(var b=0;b<a;b++){var e=h[b];var d=this["_"+e];var g=this.get(e);
-if(!(d&&g&&(d===g))){if(d){f=d.get("classNames");f=f.without("sc-text-field-accessory-view");
-d.set("classNames",f);this.removeChild(d);d=null;this["_"+e]=null}if(g){if(g.isClass){g=g.create({layoutView:this})
-}f=g.get("classNames");var c="sc-text-field-accessory-view";if(f.indexOf(c)<0){f.push(c)
-}this.appendChild(g);this["_"+e]=g}}}}.observes("leftAccessoryView","rightAccessoryView"),layoutChildViewsIfNeeded:function(a){if(!a){a=this.get("isVisibleInWindow")
-}if(a&&this.get("childViewsNeedLayout")){var b=this.get("rightAccessoryView");if(b&&b.get){var c=b.get("layout");
-if(c){c.left=null;if(!c.right){c.right=0}b.adjust({layout:c})}}}arguments.callee.base.apply(this,arguments)
-},render:function(c,a){arguments.callee.base.apply(this,arguments);var e=this.get("isEnabled")?"":'disabled="disabled"';
-var b=SC.guidFor(this);var h=this.get("isPassword")?"password":"text";if(this.get("isTextArea")){c.addClass("text-area")
-}var i=this.get("fieldValue");if(SC.none(i)){i=""}c.setClass("not-empty",i.length>0);
-var g=this._getAccessoryViewWidths();var d=g.left;var f=g.right;if(d){d+="px"}if(f){f+="px"
-}this._renderField(c,a,i,d,f);if(SC.browser.mozilla){this.invokeLast(this._applyFirefoxCursorFix)
-}},_forceRenderFirstTime:NO,_renderFieldLikeFirstTime:function(){this.set("_forceRenderFirstTime",YES)
-}.observes("isTextArea"),_renderField:function(c,a,l,d,i){var f=this.get("hint");
-if(a||this._forceRenderFirstTime){this._forceRenderFirstTime=NO;var g=this.get("isEnabled")?"":'disabled="disabled"';
-var b=SC.guidFor(this);c.push('<span class="border"></span>');var m="";if(d||i){m='style="';
-if(d){m+="left: "+d+"; "}if(i){m+="right: "+i+";"}m+='"'}c.push('<span class="padding" %@>'.fmt(m));
-c.push('<span class="sc-hint">',f,"</span>");if(this.get("isTextArea")){c.push('<textarea name="%@" %@>%@</textarea></span>'.fmt(b,g,l))
-}else{var j=this.get("isPassword")?"password":"text";c.push('<input type="%@" name="%@" %@ value="%@"/></span>'.fmt(j,b,g,l))
-}}else{var k=this.$(".sc-hint");if(f!==this._textField_currentHint){this._textField_currentHint=f;
-k.text(f)}var h=this.$input()[0];if(h){if(!this.get("isEnabled")){h.disabled="true"
-}else{h.disabled=null}var e=h.parentNode;if(d){if(e.style.left!==d){e.style.left=d
-}}else{e.style.left=null}if(i){if(e.style.right!==i){e.style.right=i}}else{e.style.right=null
-}}}},_getAccessoryViewWidths:function(){var c={};var j=["left","right"];var d=j.length;
-for(var f=0;f<d;f++){var g=j[f];var k=this.get(g+"AccessoryView");if(k&&k.get){var b=k.get("frame");
-if(b){var a=b.width;if(a){var h=k.get("layout");if(h){var e=h[g];a+=e}c[g]=a}}}}return c
-},didCreateLayer:function(){arguments.callee.base.apply(this,arguments);var a=this.$input();
-SC.Event.add(a,"focus",this,this._textField_fieldDidFocus);SC.Event.add(a,"blur",this,this._textField_fieldDidBlur);
-SC.Event.add(a,"select",this,this._textField_selectionDidChange);if(SC.browser.mozilla){this._cacheInputElement=this.$input();
-this._cachePaddingElement=this.$(".padding")}},willDestroyLayer:function(){arguments.callee.base.apply(this,arguments);
-var a=this.$input();SC.Event.remove(a,"focus",this,this._textField_fieldDidFocus);
-SC.Event.remove(a,"blur",this,this._textField_fieldDidBlur);SC.Event.remove(a,"select",this,this._textField_selectionDidChange)
-},_textField_fieldDidFocus:function(a){SC.RunLoop.begin();this.fieldDidFocus();SC.RunLoop.end()
-},_textField_fieldDidBlur:function(a){SC.RunLoop.begin();this.fieldDidBlur();SC.RunLoop.end()
-},fieldDidFocus:function(a){this.beginEditing()},fieldDidBlur:function(){this.commitEditing()
-},_topOffsetForFirefoxCursorFix:3,_applyFirefoxCursorFix:function(){if(SC.browser.mozilla){var h,d,c,i,b,g,e,f;
-e=this._cacheInputElement;f=this._cachePaddingElement;if(f&&f[0]){g=f[0];b=SC.$(g).offset();
-if(e[0].tagName.toLowerCase()==="input"){h=b.top+this._topOffsetForFirefoxCursorFix
-}else{h=b.top}d=b.left;c=g.offsetWidth;i=g.offsetHeight;var a="position: fixed; top: %@px; left: %@px; width: %@px; height: %@px;".fmt(h,d,c,i);
-if(!this._prevStyle||this._prevStyle!=a){e.attr("style",a)}this._prevStyle=a}}return this
-},_textField_selectionDidChange:function(){this.notifyPropertyChange("selection")
-},willBecomeKeyResponderFrom:function(a){if(this.get("isVisibleInWindow")){this.$input()[0].focus();
-if(!this._txtFieldMouseDown){if(SC.browser.mozilla){this.invokeOnce(this._selectRootElement)
-}else{if(SC.browser.safari){this.invokeLater(this._selectRootElement,1)}else{this._selectRootElement()
-}}}}},willLoseKeyResponderTo:function(a){},_selectRootElement:function(){this.$input()[0].select()
-},didLoseKeyResponderTo:function(a){this.$input()[0].blur()},parentViewDidResize:function(){if(SC.browser.mozilla){this.invokeLast(this._applyFirefoxCursorFix)
-}arguments.callee.base.apply(this,arguments)},keyDown:function(b){if((b.which===13)&&!this.get("isTextArea")){return NO
-}if(b.which===27){return NO}if(b.which===9&&!this.get("isTextArea")){var a=b.shiftKey?this.get("previousValidKeyView"):this.get("nextValidKeyView");
-a.becomeFirstResponder();return YES}if(b.which===8){b.dontForceDeleteKey=YES}if(this.performValidateKeyDown(b)){this._isKeyDown=YES;
-b.allowDefault()}else{b.stop()}return YES},keyUp:function(a){this.notifyPropertyChange("selection");
-if(this._isKeyDown){this.invokeLater(this.fieldValueDidChange,1,YES)}this._isKeyDown=NO;
-a.allowDefault();return YES},mouseDown:function(a){this._txtFieldMouseDown=YES;if(!this.get("isEnabled")){a.stop();
-return YES}else{if((this.value&&this.value.length===0)||!this.value){return YES}else{if(SC.browser.mozilla){this.$input()[0].focus()
-}return arguments.callee.base.apply(this,arguments)}}},mouseUp:function(a){this._txtFieldMouseDown=NO;
-this.notifyPropertyChange("selection");if(!this.get("isEnabled")){a.stop();return YES
-}else{if((this.value&&this.value.length===0)||!this.value){this.$input()[0].focus();
-return YES}else{return arguments.callee.base.apply(this,arguments)}}},selectStart:function(a){return YES
-}});sc_require("panes/pane");SC.MainPane=SC.Pane.extend({layout:{left:0,right:0,top:0,bottom:0},paneDidAttach:function(){var b=arguments.callee.base.apply(this,arguments);
-var a=this.rootResponder;a.makeMainPane(this);if(!a.get("keyRootView")){a.makeKeyPane(this)
-}return b},acceptsKeyPane:YES,classNames:["sc-main"]});tiki.script("sproutcore/foundation:en/ed50641e9278e55501165cb24eee859fe1f0ac61/javascript.js");
-tiki.register("sproutcore/desktop",{depends:["sproutcore/runtime","sproutcore/datastore","sproutcore/foundation"],packages:{"sproutcore/runtime":{},"sproutcore/foundation":{},"sproutcore/datastore":{}},scripts:[{url:"/static/sproutcore/desktop/en/401f741f60c74ac80f68ac40328f274b54416791/javascript.js",id:"sproutcore/desktop:en/401f741f60c74ac80f68ac40328f274b54416791/javascript.js"}]});
-tiki.global("sproutcore/desktop");SC.stringsFor("English",{"Invalid.CreditCard(%@)":"%@ is not a valid credit card number","Invalid.Email(%@)":"%@ is not a valid email address","Invalid.NotEmpty(%@)":"%@ must not be empty","Invalid.Password":"Your passwords do not match.  Please try typing them again.","Invalid.General(%@)":"%@ is invalid.  Please try again.","Invalid.Number(%@)":"%@ is not a number."});
-SC.allowsBackspaceToPreviousPage=NO;SC.BORDER_BEZEL="sc-bezel-border";SC.BORDER_BLACK="sc-black-border";
-SC.BORDER_GRAY="sc-gray-border";SC.BORDER_TOP="sc-top-border";SC.BORDER_BOTTOM="sc-bottom-border";
-SC.BORDER_NONE=null;SC.Border={borderStyle:SC.BORDER_GRAY,_BORDER_REGEXP:(/-border$/),renderMixin:function(a,c){var b=this.get("borderStyle");
-if(b){if(this._BORDER_REGEXP.exec(b)){a.addClass(b)}else{content.addStyle("border","1px %@ solid".fmt(b))
-}}}};SC.Scrollable={isScrollable:true,verticalLineScroll:20,horizontalLineScroll:20,verticalPageScroll:function(){return this.get("innerFrame").height
-}.property("innerFrame"),horizontalPageScroll:function(){return this.get("innerFrame").width
-}.property("innerFrame"),hasVerticalScroller:function(){return this.get("scrollFrame").height>this.get("innerFrame").height
-}.property("scrollFrame"),hasHorizontalScroller:function(){return this.get("scrollFrame").width>this.get("innerFrame").width
-}.property("scrollFrame"),scrollBy:function(a){var b=this.get("scrollFrame");var c=this.get("innerFrame");
-if(!this.get("hasVerticalScroller")){a.y=0}if(b.height<=c.height){a.y=0}if(!this.get("hasHorizontalScroller")){a.x=0
-}if(b.width<=c.width){a.x=0}var d={x:b.x-(a.x||0),y:b.y-(a.y||0)};this.set("scrollFrame",d);
-d=this.get("scrollFrame");return{x:d.x-b.x,y:d.y-b.y}},scrollTo:function(a,b){this.set("scrollFrame",{x:0-a,y:0-b})
-},scrollToVisible:function(b){var e=this.get("innerFrame");var d=this.get("scrollFrame");
-var a=this.convertFrameFromView(b.get("frame"),b);a.x-=(e.x+d.x);a.y-=(e.y+d.y);var c={x:0-d.x,y:0-d.y,width:e.width,height:e.height};
-c.y-=Math.max(0,SC.minY(c)-SC.minY(a));c.x-=Math.max(0,SC.minX(c)-SC.minX(a));c.y+=Math.max(0,SC.maxY(a)-SC.maxY(c));
-c.x+=Math.max(0,SC.maxX(a)-SC.maxX(c));this.scrollTo(c.x,c.y)},scrollDownLine:function(a){if(a===undefined){a=1
-}return this.scrollBy({y:this.get("verticalLineScroll")*a}).y},scrollUpLine:function(a){if(a===undefined){a=1
-}return 0-this.scrollBy({y:0-this.get("verticalLineScroll")*a}).y},scrollRightLine:function(a){if(a===undefined){a=1
-}return this.scrollTo({y:this.get("horizontalLineScroll")*a}).x},scrollLeftLine:function(a){if(a===undefined){a=1
-}return 0-this.scrollTo({y:0-this.get("horizontalLineScroll")*a}).x},scrollDownPage:function(a){if(a===undefined){a=1
-}return this.scrollBy({y:this.get("verticalPageScroll")*a}).y},scrollUpPage:function(a){if(a===undefined){a=1
-}return 0-this.scrollBy({y:0-this.get("verticalPageScroll")*a}).y},scrollRightPage:function(a){if(a===undefined){a=1
-}return this.scrollTo({y:this.get("horizontalPageScroll")*a}).x},scrollLeftPage:function(a){if(a===undefined){a=1
-}return 0-this.scrollTo({y:0-this.get("horizontalPageScroll")*a}).x}};SC.DRAG_LINK=4;
-SC.DRAG_COPY=1;SC.DRAG_MOVE=2;SC.DRAG_NONE=0;SC.DRAG_ANY=7;SC.DRAG_AUTOSCROLL_ZONE_THICKNESS=20;
-SC.Drag=SC.Object.extend({source:null,ghostView:null,ghostActsLikeCursor:NO,dragView:null,ghost:YES,slideBack:YES,mouseDownEvent:null,ghostOffset:{x:0,y:0},location:{},dataTypes:function(){if(this.dataSource){return this.dataSource.get("dragDataTypes")||[]
-}var d=this.data;if(d){var a=[];for(var b in d){if(d.hasOwnProperty(b)){a.push(b)
-}}return a}var c=this.get("source");if(c&&c.dragDataTypes){return c.get("dragDataTypes")||[]
-}return[]}.property().cacheable(),hasDataType:function(a){return(this.get("dataTypes").indexOf(a)>=0)
-},dataForType:function(a){if(this.dataSource){return this.dataSource.dragDataForType(this,a)
-}else{if(this.data){return this.data[a]}else{var b=this.get("source");if(b&&SC.typeOf(b.dragDataForType)==SC.T_FUNCTION){return b.dragDataForType(this,a)
-}else{return null}}}},dataSource:null,data:null,allowedDragOperations:SC.DRAG_ANY,_dragInProgress:YES,startDrag:function(){this._createGhostView();
-var n=this.event;var h={x:n.pageX,y:n.pageY};this.set("location",h);var b=this.dragView;
-var d=b.get("pane");var o=b.get("parentView");var k=b.get("clippingFrame");var i=o?o.convertFrameToView(b.get("frame"),null):b.get("frame");
-var j=d?d.get("frame"):{x:0,y:0};b.adjust({top:i.y+j.y,left:i.x+j.x,width:i.width,height:i.height});
-var e=b.get("frame");var m=i;if(this.ghostActsLikeCursor){this.ghostOffset={x:14,y:14}
-}else{this.ghostOffset={x:(h.x-m.x),y:(h.y-m.y)}}if(!this._ghostViewHidden){this._positionGhostView(n)
-}this.ghostView.rootResponder.dragDidStart(this);var a=this.source;if(a&&a.dragDidBegin){a.dragDidBegin(this,h)
-}var c=this._dropTargets();for(var l=0,g=c.length;l<g;l++){c[l].tryToPerform("dragStarted",this,n)
-}},mouseDragged:function(a){var b=this._autoscroll(a);var f=this.get("location");
-if(!b&&(a.pageX==f.x)&&(a.pageY==f.y)){return}f={x:a.pageX,y:a.pageY};this.set("location",f);
-var d=this.source;var c=this._lastTarget;var e=this._findDropTarget(a);var g=SC.DRAG_NONE;
-while(e&&(e!=c)&&(g==SC.DRAG_NONE)){if(e&&d&&d.dragSourceOperationMaskFor){g=d.dragSourceOperationMaskFor(this,e)
-}else{g=SC.DRAG_ANY}if((g!=SC.DRAG_NONE)&&e&&e.computeDragOperations){g=g&e.computeDragOperations(this,a,g)
-}else{g=SC.DRAG_NONE}this.allowedDragOperations=g;if(g==SC.DRAG_NONE){e=this._findNextDropTarget(e)
-}}if(e!=c){if(c&&c.dragExited){c.dragExited(this,a)}if(e){if(e.dragEntered){e.dragEntered(this,a)
-}if(e.dragUpdated){e.dragUpdated(this,a)}}this._lastTarget=e}else{if(e&&e.dragUpdated){e.dragUpdated(this,a)
-}}if(d&&d.dragDidMove){d.dragDidMove(this,f)}if(!this._ghostViewHidden){this._positionGhostView(a)
-}},mouseUp:function(l){var g={x:l.pageX,y:l.pageY},h=this._lastTarget,d=this.allowedDragOperations;
-this.set("location",g);try{if(h&&h.acceptDragOperation&&h.acceptDragOperation(this,d)){d=h.performDragOperation?h.performDragOperation(this,d):SC.DRAG_NONE
-}else{d=SC.DRAG_NONE}}catch(i){console.error("Exception in SC.Drag.mouseUp(acceptDragOperation|performDragOperation): %@".fmt(i))
-}try{if(h&&h.dragExited){h.dragExited(this,l)}}catch(j){console.error("Exception in SC.Drag.mouseUp(target.dragExited): %@".fmt(j))
-}var c=this._dropTargets();for(var k=0,f=c.length;k<f;k++){try{c[k].tryToPerform("dragEnded",this,l)
-}catch(b){console.error("Exception in SC.Drag.mouseUp(dragEnded on %@): %@".fmt(c[k],b))
-}}this._destroyGhostView();var a=this.source;if(a&&a.dragDidEnd){a.dragDidEnd(this,g,d)
-}this._lastTarget=null;this._dragInProgress=NO},_createGhostView:function(){var b=this,c=this.dragView.get("frame"),a;
-a=this.ghostView=SC.Pane.create({classNames:["sc-ghost-view"],layout:{top:c.y,left:c.x,width:c.width,height:c.height},owner:this,didCreateLayer:function(){if(b.dragView){var d=b.dragView.get("layer");
-if(d){this.get("layer").appendChild(d.cloneNode(true))}}}});a.append()},_positionGhostView:function(a){var c=this.get("location");
-c.x-=this.ghostOffset.x;c.y-=this.ghostOffset.y;var b=this.ghostView;if(b){b.adjust({top:c.y,left:c.x});
-b.invokeOnce("updateLayout")}},_ghostViewHidden:NO,hideGhostView:function(){if(this.ghostView&&!this._ghostViewHidden){this.ghostView.remove();
-this._ghostViewHidden=YES}},unhideGhostView:function(){if(this._ghostViewHidden){this._ghostViewHidden=NO;
-this._createGhostView()}},_destroyGhostView:function(){if(this.ghostView){this.ghostView.remove();
-this.ghostView=null;this._ghostViewHidden=NO}},_dropTargets:function(){if(this._cachedDropTargets){return this._cachedDropTargets
-}var b=[];var d=SC.Drag._dropTargets;for(var c in d){if(d.hasOwnProperty(c)){b.push(d[c])
-}}var f={};var e=SC.Drag._dropTargets;var a=function(g){if(!g){return 0}var i=SC.guidFor(g);
-var h=f[i];if(!h){h=1;while(g=g.get("parentView")){if(e[SC.guidFor(g)]!==undefined){h++
-}}f[i]=h}return h};b.sort(function(h,g){if(h===g){return 0}h=a(h);g=a(g);return(h>g)?-1:1
-});this._cachedDropTargets=b;return b},_findDropTarget:function(c){var g={x:c.pageX,y:c.pageY};
-var e,f;var d=this._dropTargets();for(var b=0,a=d.length;b<a;b++){e=d[b];if(!e.get("isVisibleInWindow")){continue
-}f=e.convertFrameToView(e.get("clippingFrame"),null);if(SC.pointInRect(g,f)){return e
-}}return null},_findNextDropTarget:function(a){var b=SC.Drag._dropTargets;while(a=a.get("parentView")){if(b[SC.guidFor(a)]){return a
-}}return null},_autoscroll:function(l){if(!l){l=this._lastAutoscrollEvent}if(!this._dragInProgress){return NO
-}var g=l?{x:l.pageX,y:l.pageY}:this.get("location"),h=this._findScrollableView(g),m=null,k,c,d,i,b,a,e;
-while(h&&!m){k=h.get("canScrollVertical")?1:0;c=h.get("canScrollHorizontal")?1:0;
-if(k||c){a=h.get("containerView");if(a){e=h.convertFrameToView(a.get("frame"),null)
-}else{k=c=0}}if(k){i=SC.maxY(e);d=i-SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;if(g.y>=d&&g.y<=i){k=1
-}else{d=SC.minY(e);i=d+SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;if(g.y>=d&&g.y<=i){k=-1}else{k=0
-}}}if(c){i=SC.maxX(e);d=i-SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;if(g.x>=d&&g.x<=i){c=1
-}else{d=SC.minX(e);i=d+SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;if(g.x>=d&&g.x<=i){c=-1}else{c=0
-}}}if(k||c){m=h}else{h=this._findNextScrollableView(h)}}if(m&&(this._lastScrollableView===m)){if((Date.now()-this._hotzoneStartTime)>100){this._horizontalScrollAmount*=1.05;
-this._verticalScrollAmount*=1.05}}else{this._lastScrollableView=m;this._horizontalScrollAmount=15;
-this._verticalScrollAmount=15;this._hotzoneStartTime=(m)?Date.now():null;c=k=0}if(m&&(c||k)){var j={x:c*this._horizontalScrollAmount,y:k*this._verticalScrollAmount};
-m.scrollBy(j)}if(m){if(l){this._lastAutoscrollEvent={pageX:l.pageX,pageY:l.pageY}
-}this.invokeLater(this._autoscroll,100,null);return YES}else{this._lastAutoscrollEvent=null;
-return NO}},_scrollableViews:function(){if(this._cachedScrollableView){return this._cachedScrollableView
-}var a=[];var c=SC.Drag._scrollableViews;for(var b in c){if(c.hasOwnProperty(b)){a.push(c[b])
-}}a=a.sort(function(f,d){var e=f;while(e=e.get("parentView")){if(d==e){return -1}}return 1
-});this._cachedScrollableView=a;return a},_findScrollableView:function(f){var c=this._scrollableViews(),b=c?c.length:0,d,e,a;
-for(a=0;a<b;a++){d=c[a];if(!d.get("isVisibleInWindow")){continue}e=d.convertFrameToView(d.get("clippingFrame"),null);
-if(SC.pointInRect(f,e)){return d}}return null},_findNextScrollableView:function(a){var b=SC.Drag._scrollableViews;
-while(a=a.get("parentView")){if(b[SC.guidFor(a)]){return a}}return null}});SC.Drag.mixin({start:function(b){var a=this.create(b);
-a.startDrag();return a},_dropTargets:{},_scrollableViews:{},addDropTarget:function(a){this._dropTargets[SC.guidFor(a)]=a
-},removeDropTarget:function(a){delete this._dropTargets[SC.guidFor(a)]},addScrollableView:function(a){this._scrollableViews[SC.guidFor(a)]=a
-},removeScrollableView:function(a){delete this._scrollableViews[SC.guidFor(a)]}});
+var ENV={platform:"classic",mode:"production"},SC=SC||{BUNDLE_INFO:{},LAZY_INSTANTIATION:{}};SC.json=JSON;
+SC.browser=function(){var a=navigator.userAgent.toLowerCase(),b=(a.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];a={version:b,safari:/webkit/.test(a)?b:0,opera:/opera/.test(a)?b:0,msie:/msie/.test(a)&&!/opera/.test(a)?b:0,mozilla:/mozilla/.test(a)&&!/(compatible|webkit)/.test(a)?b:0,mobileSafari:/apple.*mobile.*safari/.test(a)?b:0,windows:!!/(windows)/.test(a),mac:!!(/(macintosh)/.test(a)||/(mac os x)/.test(a)),language:(navigator.language||navigator.browserLanguage).split("-",1)[0]};a.current=
+a.msie?"msie":a.mozilla?"mozilla":a.safari?"safari":a.opera?"opera":"unknown";return a}();SC.bundleDidLoad=function(a){var b=this.BUNDLE_INFO[a];b||(b=this.BUNDLE_INFO[a]={});b.loaded=true};SC.bundleIsLoaded=function(a){return(a=this.BUNDLE_INFO[a])?!!a.loaded:false};SC.loadBundle=function(){throw"SC.loadBundle(): SproutCore is not loaded.";};
+SC.setupBodyClassNames=function(){var a=document.body;if(a){var b,c,d,e,f;b=SC.browser.current;c=SC.browser.windows?"windows":SC.browser.mac?"mac":"other-platform";e=document.documentElement.style;d=e.MozBoxShadow!==undefined||e.webkitBoxShadow!==undefined||e.oBoxShadow!==undefined||e.boxShadow!==undefined;e=e.MozBorderRadius!==undefined||e.webkitBorderRadius!==undefined||e.oBorderRadius!==undefined||e.borderRadius!==undefined;f=a.className?a.className.split(" "):[];d&&f.push("box-shadow");e&&f.push("border-rad");
+f.push(b);f.push(c);SC.browser.mobileSafari&&f.push("mobile-safari");a.className=f.join(" ")}};
+if("undefined"===typeof tiki)var tiki=function(){function a(f,g){b.push({m:f,a:g})}var b=[],c={},d={},e={_modules:d,_factories:c,isBootstrap:true,queue:b,register:function(f,g){if(f==="tiki"&&"undefined"!==typeof ENV)if(ENV.app==="tiki"&&ENV.mode==="test"){if(!g.depends)g.depends=[];g.depends.push("core_test")}a("register",arguments);return this},script:function(){a("script",arguments);return this},stylesheet:function(){a("stylesheet",arguments);return this},module:function(f,g){c[f]=g;a("module",
+arguments);return this},require:function(f){var g,h,j;if(f.indexOf(":")<0)f="tiki:"+f;if(g=d[f])g=g.exports;else{g={};j=d[f]={id:f,exports:g,boot:this};h=c[f];if(typeof h!=="function")throw f+" is not function";f=c["tiki:index"]?e.require("tiki:index"):null;h.call(g,e.require,g,j,f);g=j.exports}return g},destroy:function(){if(this.isDestroyed)return this;this.isDestroyed=true;d=c=b=this.queue=null;return this}};e.require.loader=e;e.ENV=typeof ENV!=="undefined"?ENV:undefined;e.ARGV=typeof ARGV!=="undefined"?
+ARGV:undefined;return e}();tiki.register("tiki",{scripts:[{url:"/static/tiki/en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js",id:"tiki:en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js"}]});
+tiki.module("tiki:index",function(a,b){function c(x,D,E){var z=D.length;x=x||{};var p,u,A;for(E=E;E<z;E++)if(p=D[E])for(u in p)if(p.hasOwnProperty(u)){A=p[u];if(x!==A)if(A!==undefined)x[u]=A}return x}function d(){return function(){this.__init(arguments);return this}}function e(x,D,E,z,p,u){if(x[D])z&&z.isInvocation?z.invoke():v.invoke(z,p,u,2);else{D=z&&z.isInvocation?z.retain():v.create(z,p,u,2);x[E]||(x[E]=[]);x[E].push(D);x.schedule()}}function f(x,D){var E=x[D],z=E?E.length:0,p,u;for(p=0;p<z;p++){u=
+E[p];u.invoke();u.release()}x[D]=null}b.T_ERROR="error";b.T_OBJECT="object";b.T_NULL="null";b.T_CLASS="class";b.T_HASH="hash";b.T_FUNCTION="function";b.T_UNDEFINED="undefined";b.T_NUMBER="number";b.T_BOOL="boolean";b.T_ARRAY="array";b.T_STRING="string";b.T_BOOLEAN="boolean";b.YES=true;b.NO=false;var g=[],h=function(x){if(x&&x.isArray)return true;if(!x)return false;if("undefined"!==typeof x.length)if(typeof x!=="function"&&typeof x!=="string"&&x.constructor!==String)return true;return false};b.isArray=
+h;Array.prototype.isArray=true;b.$A=function(x){if(x===null||x===undefined)return[];if(x.slice instanceof Function)return typeof x==="string"?[x]:x.slice();if(x.toArray)return x.toArray();if(!h(x))return[x];for(var D=[],E=x.length;--E>=0;)D[E]=x[E];return D};b.typeOf=function(x){if(x===undefined)return"undefined";if(x===null)return"null";var D=typeof x;if(D=="object")D=h(x)?"array":x instanceof Function?x.isClass?"class":"function":x instanceof Error||x.isError?"error":x.isObject?"object":x.isClass?
+"class":x.constructor===Object?"hash":x.constructor===Number?"number":x.constructor===String?"string":"object";else if(D==="function")D=x.isClass?"class":"function";return D};var j="_tk_guid_"+(new Date).getTime(),k=0,l=[],m=[],n=function(x){var D="tk"+k++;if(x)x[j]=D;return D};b.generateGuid=n;b.guidFor=function(x){if(x===undefined)return"(undefined)";if(x===null)return"(null)";if(x===Object)return"(Object)";if(x===Array)return"(Array)";if(x[j])return x[j];switch(typeof x){case "number":return l[x]=
+l[x]||"nu"+x;case "string":return m[x]=m[x]||"st"+x;case "boolean":return x?"(true)":"(false)";default:return n(x)}};b.mixin=function(x){return c(x,arguments,1)};var o=function(){},q=o.prototype,t=function(x){var D;if("object"!==typeof x)return x;o.prototype=x;D=new o;o.prototype=q;return c(D,arguments,1)};b.beget=t;var r=function(x){var D;if(D=this.init)D.apply(this,x)};b.extend=function(x){var D=d(),E;if("function"===typeof x){E=D.prototype=t(x.prototype);if(!E.__init)E.__init=r;c(E,arguments,1)}else E=
+D.prototype=c({__init:r},arguments,0);return E.constructor=D};var s=function(x,D){g[0]=D;var E;for(E in x)if(x.hasOwnProperty(E)){D=x[E];if("function"===typeof D){g[1]=E;D.displayName=g.join(".")}}g.length=0;return x};b.setupDisplayNames=s;s(b,"tiki");b.Retainable=a("retainable");b.Invocation=a("invocation");b.Promise=a("promise");var v=a("invocation"),w,y;w=function(x,D){e(w,"isReady","queue",x,D,arguments)};b.ready=w;w.main=function(x,D){e(w,"isReady","mqueue",x,D,arguments)};w.isReady=false;w.fire=
+function(){if(!w.isReady){w.isReady=true;if(a.loader)a.loader.isReady=true;w.cleanup&&w.cleanup();w.cleanup=null;f(w,"queue");f(w,"mqueue");var x=a.loader?a.loader.nextReady:null;x&&x!==w&&x.fire()}};w.fire.displayName="ready.fire()";w.schedule=function(){};if("undefined"!==typeof document)if(document.addEventListener){w.cleanup=function(){document.removeEventListener("DOMContentLoaded",w.fire,false);document.removeEventListener("load",w.fire,false)};document.addEventListener("DOMContentLoaded",w.fire,
+false);document.addEventListener("load",w.fire,false)}else if(document.attachEvent){w.cleanup=function(){document.detachEvent("onreadystatechange",w.fire);document.detachEvent("onload",w.fire);w.ieHandler=null};document.attachEvent("onreadystatechange",w.fire);document.attachEvent("onload",w.fire);if(document.documentElement.doScroll&&window==window.top){w.ieHandler=function(){if(w.ieHandler&&!w.isReady)try{document.documentElement.doScroll("left")}catch(x){setTimeout(w.ieHandler,0);return}w.fire()};
+w.ieHandler()}}if(a.loader&&a.loader.previousLoader){if(a.loader.previousLoader.isReady)w.fire();else a.loader.previousLoader.nextReady=w;a.loader.previousLoder=null}y=function(x,D){e(y,"isUnloading","queue",x,D,arguments)};b.unload=y;y.isUnloading=false;y.fire=function(){if(!y.isUnloading){y.isUnloading=true;y.cleanup&&y.cleanup();y.cleanup=null;var x=y.queue,D=x?x.length:0,E,z;for(E=0;E<D;E++){z=x[E];z.invoke();z.release()}y.queue=null}};y.schedule=function(){if(!y.isScheduled){y.isScheduled=true;
+if("undefined"!==typeof document)if(document.addEventListener){y.cleanup=function(){document.removeEventListener("unload",y.fire)};document.addEventListener("unload",y.fire,false)}else if(document.attachEvent){y.cleanup=function(){document.detachEvent("onunload",y.fire)};document.attachEvent("unload",y.fire)}}}});
+tiki.module("tiki:invocation",function(a,b,c,d){a=a("retainable");var e,f=Array.prototype.slice,g=[];e=d.extend(a,{init:function(h,j,k,l){if(k&&l!==undefined)k=k.length>l?f.call(k,l):null;this.recycled++;this.inPool=this.isDestroyed=false;this.target=h;this.method=j;this.args=k;return this},destroy:function(){this.isDestroyed=true;this.retainCount=1;this.inPool=true;this.target=this.method=this.args=null;g.push(this);return this},invoke:function(){return e.invoke(this.target,this.method,this.args,
+undefined,arguments)},isInvocation:true,recycled:0});e.create=function(h,j,k,l){return g.length>0?g.pop().init(h,j,k,l):new e(h,j,k,l)};e.invoke=function(h,j,k,l,m){if(!j&&d.typeOf(h)===d.T_FUNCTION)j=h;if(d.typeOf(j)===d.T_STRING)j=h[j];if(!j)throw"Invocation: method "+this.method+" not defined";if(l!==undefined&&k)k=k.length>l?f.call(k,l):null;if(m&&m.length>0)k=k?k.concat(m):m;return k?j.apply(h,k):j.call(h)};b=c.exports=e;b.Invocation=e});
+tiki.module("tiki:loader",function(a,b,c,d){function e(r,s){n[0]=r;n[1]=s;return n.join("::")}function f(r){var s=q[r];if(s)return s;return q[r]="tiki/"+r}function g(r,s){var v=t[r],w;v||(v=t[r]={});(w=v[s])||(w=v[s]=r+":"+s);return w}var h=a("promise"),j=a("sandbox"),k,l=["(function(require, exports, module, tiki) {",null,"\n});\n//@ sourceURL=",null,"\n"],m={},n=[],o=Object.keys;o||(o=function(r){var s,v=[];for(s in r)r.hasOwnProperty(s)&&v.push(s);return v});var q={},t={};k=function(r,s,v){this.id=
+r;this.scripts=[];this.packages=[];this.stylesheets=[];this.modules=[];this.ENV=v;this.sandbox=j.create(r,this);this.register("default",{});this.register("tiki",{});r=s?s.length:0;var w;for(v=0;v<r;v++){w=s[v];this[w.m].apply(this,w.a)}return this};k.prototype={scripts:null,stylesheets:null,packages:null,sandbox:null,modules:null,destroy:function(){},resolve:function(r,s,v){var w,y,x,D;if(r.match(/(^\.\.?\/)|(\/\.\.?\/)|(\/\.\.?\/?$)/)){if((y=r.indexOf(":"))>=0){v=r.slice(0,y);r=r.slice(y+1);s=[]}else if(r.match(/^\.\.?\//)){if(!s)throw"base required to resolve relative: "+
+r;y=s.indexOf(":");v||(v=s.slice(0,y));if(y>=0)s=s.slice(y+1);s=s.split("/");s.pop()}else s=[];D=r.split("/");w=D.length;for(y=0;y<w;y++){x=D[y];if(x===".."){if(s.length<1)throw"invalid path: "+r;s.pop()}else x!=="."&&s.push(x)}r=s.join("/");if(v)r=g(v,r)}return r},canonical:function(r,s,v){var w=this.resolve(r,s,v),y=this._factories,x=this._catalog;if((r=w.indexOf(":"))<0){if(!v&&s&&(r=s.indexOf(":")))v=s.slice(0,r);if(v==="default")v="tiki";r=g(v,w);w=!x||y&&y[r]?r:x[w]?g(w,"index"):x[f(w)]?g(f(w),
+"index"):r}else{v=w.slice(0,r);if(v==="default")w=g("tiki",w.slice(r+1));else if(x&&!x[v]&&x[f(v)])w=f(w)}return w},evaluate:function(r,s){l[1]=r;l[3]=s||"(unknown module)";r=l.join("");r=eval(r);l[1]=l[3]=null;return r},load:function(r,s){var v=this._factories;r=this.canonical(r,s);if(!this.ready(r))throw r+" is not ready";if((s=v[r])&&"string"===typeof s){s=this.evaluate(s,r);v[r]=s}if(!s.displayName)s.displayName=r;return s},global:function(r){var s,v,w,y,x,D;r=this.canonical(r);if((w=r.indexOf(":"))<
+0)throw"package not found: "+r;x=r.slice(0,w);r.split(":");s=this._catalog[x];if(!s)throw x+" is not registered";v=(s=s.depends)?s.length:0;if(v<=0)return this;y=this._factories;if(!y)return this;for(w=0;w<v;w++){x=s[w];if(!m[x]){m[x]=true;if(!this.ready(x))throw"cannot make "+x+" global because it is not ready";r=this.canonical(x);if(y[r]){x=this.require(r);if(!x)throw"require "+r+" failed";if(r=x.__globals__){v=r.length;for(w=0;w<v;w++){D=r[w];window[D]=x[D]}}else for(D in x)if(x.hasOwnProperty(D))window[D]=
+x[D]}}}},register:function(r,s){if(r.indexOf(":")>0)return this.module(r,s);var v=this._catalog,w;if(!v)v=this._catalog={};if(s=(v[r]=s)?s.packages:null)for(w in s)!s.hasOwnProperty(w)||v[w]||(v[w]=s[w]);this._resolved("catalog",r)||this.packages.push(r);this._promiseFor("catalog",r).resolve(r)},script:function(r){this._resolved("scripts",r)||this.scripts.push(r);this._promiseFor("scripts",r).resolve(r);return this},stylesheet:function(r){this._resolved("stylesheets",r)||this.stylesheets.push(r);
+this._promiseFor("stylesheets",r).resolve(r);return this},module:function(r,s){var v=this._factories;if(!v)v=this._factories={};v[r]=s;this._resolved("modules",r)||this.modules.push(r);this._promiseFor("modules",r).resolve(r)},async:function(r){return this._async(r,null)},_async:function(r,s){var v=this._promiseFor("loads",r);if(v.isPending)if(this.ready(r))v.resolve();else{var w=this;v.action(function(y){w._promiseFor("catalog",r).then(y,function(){w._loadPackage(r,y,s||{});y.resolve()},function(x){y.cancel(x)});
+w._loadPackage(r,y,s||{})}).run()}return v},require:function(r,s){return this.sandbox.require(r,s)},ready:function(r){return this._ready(r,null)},_ready:function(r,s){if(s)if(s[r])return true;else s[r]=true;var v,w,y,x,D;v=r.indexOf(":");v=v>=0?r.slice(0,v):r;if(!this._resolved("catalog",v))return false;w=this._catalog[v];for(x=(y=w.depends)?y.length:0;--x>=0;){s||(s={});D=y[x];if(!this._ready(D,s))return false}for(x=(y=w.stylesheets)?y.length:0;--x>=0;){s=y[x];if("string"!==typeof s)s=s.id;if(!this._resolved("stylesheets",
+s))return false}for(x=(y=w.scripts)?y.length:0;--x>=0;){s=y[x];if("string"!==typeof s)s=s.id;if(!this._resolved("scripts",s))return false}if(r!==v)if(!this._resolved("modules",r))return false;return true},main:function(r,s){var v=this.require("index","tiki").ready;if(!v)throw"cannot register main because system.ready does not exist";v.main(this,function(){this.async(r).then(this,function(){this.require(r)[s]()})});return this},_loadScript:function(r){var s,v;if("string"!==typeof r){s=r.id;v=r.url}else s=
+v=r;r=this._promiseFor("scripts",s);r.isPending&&r.action(function(){var w=document.body,y;w||promise.cancel("no document to append script");y=document.createElement("script");y.setAttribute("src",v);w.appendChild(y)});return r},_loadStylesheet:function(r){var s,v;if("string"!==typeof r){s=r.id;v=r.url}else s=v=r;r=this._promiseFor("stylesheets",s);if(r.isPending){var w=this;r.action(function(y){var x=document.body;x||y.cancel("no document to append stylesheet");y=document.createElement("link");y.setAttribute("rel",
+"stylesheet");y.setAttribute("href",v);x.appendChild(y);w.stylesheet(s)})}return r},_loadPackage:function(r,s,v){if(v)if(v[r]){console&&console.warn&&console.warn("detected cyclical reference to "+r+" seen="+o(v).join(", "));return}else v[r]=true;var w=this._catalog?this._catalog[r]:null,y,x,D,E;if(!w)return this;x=(y=w.depends)?y.length:0;for(E=h.create(e("load-package",r));--x>=0;){r=y[x];r!=="tiki"&&E.depends(this._async(r,v))}s.depends(E);E.resolve();x=(y=w.scripts)?y.length:0;D=null;for(v=w.ordered!==
+false;--x>=0;){r=this._loadScript(y[x]);s.depends(r);if(v)D&&r.then(D,D.run,D.cancel);else r.run();D=r}D&&v&&E.then(D,D.run,D.cancel);x=(y=w.stylesheets)?y.length:0;for(D=null;--x>=0;){r=this._loadStylesheet(y[x]);s.depends(r);D&&r.then(D,D.run,D.cancel);D=r}D&&E.then(D,D.run,D.cancel)},_promiseFor:function(r,s,v){var w=this._promises,y;if(!w)w=this._promises={};(y=w[r])||(y=w[r]={});if(v===undefined){w=y;v=s}else(w=y[s])||(w=y[s]={});(y=w[v])||(y=w[v]=h.create(e(r,s)));return y},_discoveredStylesheets:false,
+discoverStylesheets:function(){this._discoveredStylesheets=true;if("undefined"===typeof document)return this;for(var r=document.getElementsByTagName("link"),s=r?r.length:0,v,w;--s>=0;){v=r[s];if(!(!v||v.rel!=="stylesheet")){(w=v.getAttribute("loadid")||v.getAttribute("LOADID"))&&this.stylesheet(w.toString());(w=v.href)&&this.stylesheet(w.toString())}}return this},_resolved:function(r,s,v){r==="stylesheets"&&!this._discoveredStylesheets&&this.discoverStylesheets();var w=this._promises;if(w)w=w[r];
+if(w)w=w[s];if(w&&v)w=w[v];return w?w.isResolved:false},_inspectLoader:function(){var r=[],s,v;r.push("Loader<id="+this.id+">:");if(this.packages.length>0){r.push("  packages: "+this.packages.join(","));r.push("")}if(this.scripts.length>0){r.push("  scripts:");s=this.scripts.length;for(v=0;v<s;v++)r.push("    "+this.scripts[v]);r.push("")}if(this.stylesheets.length>0){r.push("  stylesheets:");s=this.scripts.length;for(v=0;v<s;v++)r.push("    "+this.scripts[v]);r.push("")}if(this.modules.length>0){r.push("  modules: ");
+s=this.modules.length;for(v=0;v<s;v++)r.push("    "+this.modules[v]);r.push("")}return r.join("\n")},_inspectModule:function(r){var s=[],v=r.slice(0,r.indexOf(":")),w;if(this._catalog&&!this._catalog[v]){w="tiki/"+v;if(this._catalog[w]){v=w;r="tiki/"+r}}s.push(r+" ("+(this.ready(r)?"READY":"NOT READY")+"):");s.push(this._inspectPackage(v));return s.join("\n")},_inspectPackage:function(r){if(this._catalog&&!this._catalog[r]){var s="tiki/"+r;if(this._catalog[s])r=s}s=[];var v=this._catalog?this._catalog[r]:
+null,w,y,x;s.push(r+" ("+(this.ready(r)?"READY":"NOT READY")+"): "+(v?"":"Not in Catalog!"));if(!v)return s.join("\n");w=v.depends?v.depends.length:0;if(w>0){x=[];for(r=0;r<w;r++){y=v.depends[r];x.push(y+" ("+(this.ready(y)?"READY":"NOT READY")+")")}s.push("  depends: "+x.join(", "))}w=v.scripts?v.scripts.length:0;if(w>0){s.push("\n  scripts:");for(r=0;r<w;r++){y=v.scripts[r];if("string"!==typeof y)y=y.id;s.push("    "+y+" ("+(this._resolved("scripts",y)?"READY":"NOT READY")+")")}}w=v.stylesheets?
+v.stylesheets.length:0;if(w>0){s.push("\n  stylesheets:");for(r=0;r<w;r++){y=v.stylesheets[r];if("string"!==typeof y)y=y.id;s.push("    "+y+"("+(this._resolved("stylesheets",y)?"READY":"NOT READY")+")")}}return s.join("\n")},inspect:function(r){return arguments.length===0?this._inspectLoader():r.indexOf(":")<0?this._inspectPackage(r):this._inspectModule(r)},toString:function(){return"Loader<id="+this.id+">"}};d.setupDisplayNames(k.prototype,"Loader");k.setup=function(r,s){if(r&&!r.isBootstrap)return r;
+s=new k(r?r.id:"default",r?r.queue:null,s);(s.previousLoader=r)&&r.destroy&&r.destroy();return s};b=c.exports=k;b.Loader=k;b.setup=k.setup});
+tiki.module("tiki:promise",function(a,b,c,d){function e(j,k,l){j=d.guidFor(j)+":"+j.id+"."+k+"() dep="+j.holds+" status="+h[j._status]+" handlers="+(j._handlers?j._handlers.length:"null");if(l)j+=" pr="+l.toString();console&&console.log&&console.log(j)}b=a("retainable");a("invocation");var f,g=[],h={4097:"PENDING",12289:"BLOCKED_PENDING",12290:"BLOCKED_RESOLVED",16386:"RESOLVED",16388:"CANCELLED"};f=d.extend(b,{init:function(j){this.inPool=false;this.id=j;this._status=4097;this._actionStatus=257;
+this.holds=0;this.retain();return this},destroy:function(){this.isDestroyed=false;this.retainCount=1;this.inPool=true;this.target=this.method=this._actions=null;g.push(this);return this},value:null,isPending:true,isResolved:false,isCancelled:false,hasAction:false,_status:4097,_actionStatus:257,resolve:function(j){f.LOG_PROMISES&&e(this,"resolve");switch(this._status){case 4097:this.value=j;this._makeResolved();break;case 12289:this.value=j;this._status=12290;break}return this},_makeResolved:function(){this.isPending=
+false;this.isResolved=true;this._status=16386;this._didResolve();this._invoke("__resolved",this.value,true);this.release()},cancel:function(j){f.LOG_PROMISES&&e(this,"cancel");switch(this._status){case 4097:case 12289:this.value=j;this._makeCancelled()}return this},_makeCancelled:function(){this._status=16388;this.isPending=false;this.isCancelled=true;this._didCancel();this._invoke("__cancel",this.value,true);this.release()},update:function(j){f.LOG_PROMISES&&e(this,"update");switch(this._status){case 4097:case 12289:this._invoke("__progress",
+j,false);break}return this},then:function(j,k,l,m){var n=typeof j,o=this.values;if(arguments.length<4&&("function"===n||"string"===n)){m=l;l=k;k=j;j=this}n=f.create();switch(this._status){case 16386:if(k)o=k.call(j,this.value,this);n.resolve(o);break;case 16388:if(l)o=l.call(j,this.value,this);n.cancel(o);break;default:n.__resolved=k;n.__cancel=l;n.__progress=m;n.__target=j;if(!this._handlers)this._handlers=[];this._handlers.push(n)}return n},_invoke:function(j,k,l){var m=this._handlers,n=m?m.length:
+0,o,q,t;if(n<=0)return this;for(o=0;o<n;o++){q=m[o];t=(t=q[j])?t.call(q.__target,k,this):null;if(l){j==="__cancel"?q.cancel(t):q.resolve(t);q.__resolve=q.__cancel=q.__progress=q.__target=null}}if(l)this._handlers=null},depends:function(j){f.LOG_PROMISES&&e(this,"depends",j);switch(this._status){case 4097:this._status=12289;this.holds=1;if(!this._depends)this._depends={};this._depends[d.guidFor(j)]=j;j.then(this,this._resolveHold,this._cancelHold);break;case 12289:case 12290:this.holds++;this._depends[d.guidFor(j)]=
+j;j.then(this,this._resolveHold,this._cancelHold);break}return this},_resolveHold:function(j,k){f.LOG_PROMISES&&e(this,"resolveHold",k);this._depends&&delete this._depends[d.guidFor(k)];switch(this._status){case 12289:if(this.holds<=1){this._status=4097;this.holds=null}else this.holds--;break;case 12290:if(this.holds<=1){this.holds=null;this._makeResolved()}else this.holds--;break}},_cancelHold:function(j,k){f.LOG_PROMISES&&e(this,"cancelHold",k);this._depends&&delete this._depends[d.guidFor(k)];
+if(this._status&12288){this.holds=null;this.value=new Error("hold cancelled");this._makeCancelled()}},action:function(j,k){if(this._actionStatus===257){if(arguments.length===1){k=j;j=this}this.hasAction=true;this.actionTarget=j;this.actionMethod=k;this._actionStatus=258}return this},run:function(){if(this._actionStatus===258){this._actionStatus=512;this.actionMethod.call(this.actionTarget,this);this._actionStatus=768}return this},_didResolve:function(){this._actionStatus=768},_didCancel:function(){this._actionStatus=
+768},toString:function(){return"Promise<guid="+d.guidFor(this)+" id="+this.id+" status="+h[this._status]+">"}});f.create=function(j){return g.length>0?g.pop().init(j):new f(j)};f.create.displayName="Promise.create";f.LOG_PROMISES=false;d.setupDisplayNames(f.prototype,"Promise");b=c.exports=f;b.Promise=f});
+tiki.module("tiki:retainable",function(a,b,c){a={retainCount:1,isDestroyed:false,retain:function(){this.retainCount++;return this},release:function(){--this.retainCount<=0&&this.__destroy();return this},__destroy:function(){if(!this.isDestroyed){this.isDestroyed=true;this.destroy&&this.destroy()}}};b=c.exports=a;b.Retainable=a});
+tiki.module("tiki:sandbox",function(a,b,c){var d;d=function(e,f){function g(){var m=arguments.length,n;if(m>0)for(;--m>=0;){if((n=arguments[m])&&j[n]){delete j[n];delete k[n];l.splice(l.indexOf(n),1)}}else{j={};k={};l.length=0}}function h(m,n,o){var q,t,r;if(n){q=m.indexOf(":");if(q>=0)m=m.slice(0,q);m=n+":"+m}m=f.canonical(m,o);if(o=j[m]){o=o.exports;k[m]||(k[m]=o);return o||{}}l.push(m);n={};j[m]=q={id:m,exports:n};o=function(s,v){return h(s,v,m)};o.displayName="Sandbox.require";o.loader=f;o.clear=
+g;o.sandbox=this;t=f.load(m);r=h("tiki:index");if(!t)throw"could not load function for "+m;t.call(n,o,n,q,r);n=q.exports;if((o=k[m])&&o!==n)throw"circular require in "+m;return k[m]=n}var j={},k={},l=[];this.id=e;this.modules=l;this.loader=f;g.displayName="Sandbox.clear";this.clear=g;this.require=function(m,n){return h(m,n)};this.require.displayName="Sandbox.require"};d.create=function(e,f){return new d(e,f)};d.create.displayName="Sandbox.create";d.prototype={};b=c.exports=d;b.Sandbox=d});
+tiki.module("tiki:system",function(a,b,c,d){if(a.loader){b.env=a.loader.ENV;b.args=a.loader.ARGV}a=function(e){d.console&&d.console.log&&d.console.log(e)};b.print=a;c=function(){return null};b.stdin={read:c,readLine:c};b.stdout=b.stderr={write:a,writeLine:a,print:a};b.platform="tiki";b.global=window;d.unload(function(){b.global={}})});
+tiki.module("tiki:timer",function(a,b){function c(h){if(h){delete f[h.timerKey];delete h.timerKey;h.release()}}function d(h,j){return function(){h.invoke();j&&c(h)}}var e=a("invocation"),f={},g={};b.setTimeout=function(h,j,k){var l,m;if(arguments.length>2){m=e.create(k,h,arguments,3);h=d(m,true)}l=setTimeout(h,j);if(m){m.timerKey=l;f[l]=m}return l};b.clearTimeout=function(h){c(f[h]);clearTimeout(h)};b.setInterval=function(h,j,k){var l,m;if(arguments.length>2){m=e.create(k,h,arguments,3);h=d(m,false)}l=
+setInterval(h,j);if(m)g[l]=m;return l};b.clearInterval=function(h){var j=g[h];if(j){j.release();delete g[h]}clearInterval(h)}});tiki=tiki.require("tiki:loader").setup(tiki,"undefined"===typeof ENV?null:ENV,"undefined"===typeof ARGV?null:ARGV);tiki.script("tiki:en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js");tiki.stylesheet("sproutcore/desktop:en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/stylesheet.css");tiki.stylesheet("sproutcore/foundation:en/a04970954a917ede9918ca06897bc0e1406986d5/stylesheet.css");
+tiki.register("sproutcore/runtime",{packages:{tiki:{scripts:[{url:"/static/tiki/en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js",id:"tiki:en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js"}]}},depends:["tiki"],scripts:[{url:"/static/sproutcore/runtime/en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js",id:"sproutcore/runtime:en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js"}]});
+tiki.module("sproutcore/runtime:core",function(a,b,c){var d=a("system","default"),e,f;if(d.platform==="tiki"){if("undefined"===typeof console)console=d.console;if("undefined"===typeof sc_require)sc_require=function(){};if("undefined"===typeof sc_resource)sc_resource=function(){}}e=window.SC==undefined?(f={}):window.SC;e.global=function(g,h){d.global[g]=h;return e};e.global.remove=function(g){delete d.global[g];return e};e.global("SC",e);e.mixin=function(){var g=arguments[0]||{},h=1,j=arguments.length,
+k,l,m;if(j===1){g=this||{};h=0}for(;h<j;h++)if(k=arguments[h])for(m in k)if(k.hasOwnProperty(m)){l=k[m];if(g!==l)if(l!==undefined)g[m]=l}return g};e.supplement=function(){var g=arguments[0]||{},h=1,j=arguments.length,k;if(j===1){g=this||{};h=0}for(;h<j;h++)if(k=arguments[h])for(var l in k)if(k.hasOwnProperty(l)){var m=g[l],n=k[l];if(g!==n)if(n!==undefined&&m===undefined)g[l]=n}return g};e.extend=e.mixin;e.mixin({T_ERROR:"error",T_OBJECT:"object",T_NULL:"null",T_CLASS:"class",T_HASH:"hash",T_FUNCTION:"function",
+T_UNDEFINED:"undefined",T_NUMBER:"number",T_BOOL:"boolean",T_ARRAY:"array",T_STRING:"string",typeOf:function(g){if(g===undefined)return e.T_UNDEFINED;if(g===null)return e.T_NULL;var h=typeof g;if(h=="object")h=g instanceof Array?e.T_ARRAY:g instanceof Function?g.isClass?e.T_CLASS:e.T_FUNCTION:e.Error&&g instanceof e.Error?e.T_ERROR:g.isObject===true?e.T_OBJECT:e.T_HASH;else if(h===e.T_FUNCTION)h=g.isClass?e.T_CLASS:e.T_FUNCTION;return h},none:function(g){return g===null||g===undefined},empty:function(g){return g===
+null||g===undefined||g===""},isArray:function(g){if(g&&g.objectAt)return true;var h=g?g.length:null,j=e.typeOf(g);return!(e.none(h)||j===e.T_FUNCTION||j===e.T_STRING||g.setInterval)},makeArray:function(g){return e.isArray(g)?g:e.A(g)},A:function(g){if(e.none(g))return[];if(g.slice instanceof Function)return typeof g==="string"?[g]:g.slice();if(g.toArray)return g.toArray();if(!e.isArray(g))return[g];for(var h=[],j=g.length;--j>=0;)h[j]=g[j];return h},guidKey:"_sc_guid_"+(new Date).getTime(),_nextGUID:0,
+_numberGuids:[],_stringGuids:{},_keyCache:{},guidFor:function(g){if(g===undefined)return"(undefined)";if(g===null)return"(null)";if(g===Object)return"(Object)";if(g===Array)return"(Array)";var h=this.guidKey;if(g[h])return g[h];switch(typeof g){case e.T_NUMBER:return this._numberGuids[g]=this._numberGuids[g]||"nu"+g;case e.T_STRING:return this._stringGuids[g]=this._stringGuids[g]||"st"+g;case e.T_BOOL:return g?"(true)":"(false)";default:return e.generateGuid(g)}},keyFor:function(g,h){var j,k=this._keyCache[g];
+k||(k=this._keyCache[g]={});(j=k[h])||(j=k[h]=g+"_"+h);return j},generateGuid:function(g){var h="sc"+this._nextGUID++;if(g)g[this.guidKey]=h;return h},hashFor:function(g){return g&&g.hash&&typeof g.hash===e.T_FUNCTION?g.hash():this.guidFor(g)},isEqual:function(g,h){return g===null?h===null:g===undefined?h===undefined:this.hashFor(g)===this.hashFor(h)},compare:function(g,h){if(g===h)return 0;var j=e.typeOf(g),k=e.typeOf(h),l=e.ORDER_DEFINITION_MAPPING;if(!l){var m=e.ORDER_DEFINITION;l=e.ORDER_DEFINITION_MAPPING=
+{};var n,o;n=0;for(o=m.length;n<o;++n)l[m[n]]=n;delete e.ORDER_DEFINITION}m=l[j];k=l[k];if(m<k)return-1;if(m>k)return 1;switch(j){case e.T_BOOL:case e.T_NUMBER:if(g<h)return-1;if(g>h)return 1;return 0;case e.T_STRING:j=g.localeCompare(h);if(j<0)return-1;if(j>0)return 1;return 0;case e.T_ARRAY:j=g.length;k=h.length;l=Math.min(j,k);n=m=0;for(o=arguments.callee;m===0&&n<l;){m=o(g[n],h[n]);n++}if(m!==0)return m;if(j<k)return-1;if(j>k)return 1;return 0;case e.T_OBJECT:if(g.constructor.isComparable===true)return g.constructor.compare(g,
+h);return 0;default:return 0}},K:function(){return this},EMPTY_ARRAY:[],EMPTY_HASH:{},EMPTY_RANGE:{start:0,length:0},beget:function(g){if(e.none(g))return null;var h=e.K;h.prototype=g;var j=new h;h.prototype=null;if(e.typeOf(g.didBeget)===e.T_FUNCTION)j=g.didBeget(j);return j},copy:function(g){var h=g;if(g&&g.isCopyable)return g.copy();switch(e.typeOf(g)){case e.T_ARRAY:h=g.clone&&e.typeOf(g.clone)===e.T_FUNCTION?g.clone():g.slice();break;case e.T_HASH:case e.T_OBJECT:if(g.clone&&e.typeOf(g.clone)===
+e.T_FUNCTION)h=g.clone();else{h={};for(var j in g)h[j]=g[j]}}return h},merge:function(){var g={},h=arguments.length,j;for(j=0;j<h;j++)e.mixin(g,arguments[j]);return g},keys:function(g){var h=[];for(var j in g)h.push(j);return h},inspect:function(g){var h,j=[];for(var k in g){h=g[k];if(h!=="toString"){if(e.typeOf(h)===e.T_FUNCTION)h="function() { ... }";j.push(k+": "+h)}}return"{"+j.join(" , ")+"}"},tupleForPropertyPath:function(g,h){if(e.typeOf(g)===e.T_ARRAY)return g;var j,k=g.indexOf("*");if(k<
+0)k=g.lastIndexOf(".");j=k>=0?g.slice(k+1):g;return(g=this.objectForPropertyPath(g,h,k))&&j?[g,j]:null},objectForPropertyPath:function(g,h,j){var k,l,m;if(!h)h=d.global;if(e.typeOf(g)===e.T_STRING){if(j===undefined)j=g.length;for(k=0;h&&k<j;){l=g.indexOf(".",k);if(l<0||l>j)l=j;m=g.slice(k,l);h=h.get?h.get(m):h[m];k=l+1}if(k<j)h=undefined}else{k=0;for(j=g.length;k<j&&h;)if(m=g[k++])h=h.get?h.get(m):h[m];if(k<j)h=undefined}return h},STRINGS:{},stringsFor:function(g,h){e.mixin(e.STRINGS,h);return this}});
+e.clone=e.copy;e.$A=e.A;e.didLoad=e.K;e.ORDER_DEFINITION=[e.T_ERROR,e.T_UNDEFINED,e.T_NULL,e.T_BOOL,e.T_NUMBER,e.T_STRING,e.T_ARRAY,e.T_HASH,e.T_OBJECT,e.T_FUNCTION,e.T_CLASS];e.mixin(Function.prototype,{property:function(){this.dependentKeys=e.$A(arguments);var g=e.guidFor(this);this.cacheKey="__cache__"+g;this.lastSetValueKey="__lastValue__"+g;this.isProperty=true;return this},cacheable:function(g){this.isProperty=true;if(!this.dependentKeys)this.dependentKeys=[];this.isCacheable=g===undefined?
+true:g;return this},idempotent:function(g){this.isProperty=true;if(!this.dependentKeys)this.dependentKeys=[];this.isVolatile=g===undefined?true:g;return this},observes:function(){for(var g=arguments.length,h=null,j=null;--g>=0;){var k=arguments[g];if(k.indexOf(".")<0&&k.indexOf("*")<0){if(!h)h=this.localPropertyPaths=[];h.push(k)}else{if(!j)j=this.propertyPaths=[];j.push(k)}}return this}});String.prototype.fmt=function(){var g=arguments,h=0;return this.replace(/%@([0-9]+)?/g,function(j,k){k=k?parseInt(k,
+0)-1:h++;j=g[k];return(j===null?"(null)":j===undefined?"":j).toString()})};String.prototype.loc=function(){var g=e.STRINGS[this]||this;return g.fmt.apply(g,arguments)};String.prototype.w=function(){var g=[],h=this.split(" "),j=h.length,k,l=0;for(l=0;l<j;++l){k=h[l];k.length!==0&&g.push(k)}return g};c.exports=e;e.SC=e;e.SproutCore=f;e.YES=true;e.NO=false});
+tiki.module("sproutcore/runtime:index",function(a,b,c){b=c.exports=a("core");a("mixins/array");a("mixins/comparable");a("mixins/copyable");a("mixins/delegate_support");a("mixins/enumerable");a("mixins/freezable");a("mixins/observable");a("system/binding");a("system/cookie");a("system/enumerator");a("system/error");a("system/index_set");a("system/logger");a("system/object");a("system/range_observer");a("system/run_loop");a("system/selection_set");a("system/set");a("system/sparse_array");b.__globals__=
+["SC","SproutCore","YES","NO"]});
+tiki.module("sproutcore/runtime:mixins/array",function(a){var b=a("core");a("mixins/observable");a("mixins/enumerable");a("system/range_observer");b.OUT_OF_RANGE_EXCEPTION="Index out of range";b.Array={isSCArray:true,replace:function(){throw"replace() must be implemented to support SC.Array";},objectAt:function(c){if(!(c<0))if(!(c>=this.get("length")))return this.get(c)},"[]":function(c,d){d!==undefined&&this.replace(0,this.get("length"),d);return this}.property(),insertAt:function(c,d){if(c>this.get("length"))throw b.OUT_OF_RANGE_EXCEPTION;
+this.replace(c,0,[d]);return this},removeAt:function(c,d){var e=0,f=[];if(typeof c===b.T_NUMBER){if(c<0||c>=this.get("length"))throw b.OUT_OF_RANGE_EXCEPTION;if(d===undefined){this.replace(c,1,f);return this}else c=b.IndexSet.create(c,d)}this.beginPropertyChanges();c.forEachRange(function(g,h){g-=e;e+=h;this.replace(g,h,f)},this);this.endPropertyChanges();return this},removeObject:function(c){for(var d=this.get("length")||0;--d>=0;)this.objectAt(d)==c&&this.removeAt(d);return this},removeObjects:function(c){this.beginPropertyChanges();
+c.forEach(function(d){this.removeObject(d)},this);this.endPropertyChanges();return this},pushObject:function(c){this.insertAt(this.get("length"),c);return c},pushObjects:function(c){this.beginPropertyChanges();c.forEach(function(d){this.pushObject(d)},this);this.endPropertyChanges();return this},popObject:function(){var c=this.get("length");if(c!==0){var d=this.objectAt(c-1);this.removeAt(c-1);return d}},shiftObject:function(){if(this.get("length")!==0){var c=this.objectAt(0);this.removeAt(0);return c}},
+unshiftObject:function(c){this.insertAt(0,c);return c},unshiftObjects:function(c){this.beginPropertyChanges();c.forEach(function(d){this.unshiftObject(d)},this);this.endPropertyChanges();return this},isEqual:function(c){if(!c)return false;if(c==this)return true;var d=c.get("length");if(d!=this.get("length"))return false;for(;--d>=0;)if(!b.isEqual(c.objectAt(d),this.objectAt(d)))return false;return true},compact:function(){return this.without(null)},without:function(c){if(this.indexOf(c)<0)return this;
+var d=[];this.forEach(function(e){if(e!==c)d[d.length]=e});return d},uniq:function(){var c=[];this.forEach(function(d){if(c.indexOf(d)<0)c[c.length]=d});return c},rangeObserverClass:b.RangeObserver,addRangeObserver:function(c,d,e,f){var g=this._array_rangeObservers;if(!g)g=this._array_rangeObservers=b.CoreSet.create();if(this._array_oldLength===undefined)this._array_oldLength=this.get("length");c=this.rangeObserverClass.create(this,c,d,e,f,false);g.add(c);if(!this._array_isNotifyingRangeObservers){this._array_isNotifyingRangeObservers=
+true;this.addObserver("[]",this,this._array_notifyRangeObservers)}return c},updateRangeObserver:function(c,d){return c.update(this,d)},removeRangeObserver:function(c){var d=c.destroy(this),e=this._array_rangeObservers;e&&e.remove(c);return d},enumerableContentDidChange:function(c,d,e){var f=this._array_rangeObservers,g=this._array_oldLength;this.beginPropertyChanges();this.notifyPropertyChange("length");if(f&&f.length>0){if(g===undefined)g=0;this._array_oldLength=f=this.get("length");if(c===undefined)c=
+0;if(e===undefined)e=f-g;if(e!==0||d===undefined){d=f-c;if(e<0)d-=e}else d=d;e=this._array_rangeChanges;if(!e)e=this._array_rangeChanges=b.IndexSet.create();e.add(c,d)}this.notifyPropertyChange("[]");this.endPropertyChanges();return this},_array_notifyRangeObservers:function(){var c=this._array_rangeObservers,d=this._array_rangeChanges,e=c?c.length:0,f;if(e>0&&d&&d.length>0){for(f=0;f<e;f++)c[f].rangeDidChange(d);d.clear()}}};b.mixin(Array.prototype,b.Array);b.Array=b.mixin({},b.Enumerable,b.Array);
+b.Array.slice=function(c,d){var e=[],f=this.get("length");if(b.none(c))c=0;if(b.none(d)||d>f)d=f;for(;c<d;)e[e.length]=this.objectAt(c++);return e};b.Array.indexOf=function(c,d){var e=this.get("length");d=d===undefined?0:d<0?Math.ceil(d):Math.floor(d);if(d<0)d+=e;for(d=d;d<e;d++)if(this.objectAt(d)===c)return d;return-1};if(!Array.prototype.indexOf)Array.prototype.indexOf=b.Array.indexOf;b.Array.lastIndexOf=function(c,d){var e=this.get("length");d=d===undefined?e-1:d<0?Math.ceil(d):Math.floor(d);
+if(d<0)d+=e;for(d=d;d>=0;d--)if(this.objectAt(d)===c)return d;return-1};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=b.Array.lastIndexOf;(function(){b.mixin(Array.prototype,{replace:function(d,e,f){if(this.isFrozen)throw b.FROZEN_ERROR;!f||f.length===0?this.splice(d,e):this.splice.apply(this,[d,e].concat(f));f=f?f.get?f.get("length"):f.length:0;this.enumerableContentDidChange(d,e,f-e);return this},unknownProperty:function(d,e){var f=this.reducedProperty(d,e);if(e!==undefined&&f===undefined)f=
+this[d]=e;return f}});var c=Array.prototype.indexOf;if(!c||c===b.Array.indexOf)Array.prototype.indexOf=function(d,e){var f=this.length;e=e===undefined?0:e<0?Math.ceil(e):Math.floor(e);if(e<0)e+=f;for(e=e;e<f;e++)if(this[e]===d)return e;return-1};c=Array.prototype.lastIndexOf;if(!c||c===b.Array.lastIndexOf)Array.prototype.lastIndexOf=function(d,e){var f=this.length;e=e===undefined?f-1:e<0?Math.ceil(e):Math.floor(e);if(e<0)e+=f;for(e=e;e>=0;e--)if(this[e]===d)return e;return-1}})()});
+tiki.module("sproutcore/runtime:mixins/comparable",function(a){a("core").Comparable={isComparable:true,compare:function(){throw"%@.compare() is not implemented".fmt(this.toString());}}});
+tiki.module("sproutcore/runtime:mixins/copyable",function(a){a=a("core");a.Copyable={isCopyable:true,copy:function(){throw"%@.copy() is not implemented";},frozenCopy:function(){var b=this.get?this.get("isFrozen"):this.isFrozen;if(b===true)return this;else if(b===undefined)throw"%@ does not support freezing".fmt(this);else return this.copy().freeze()}};a.mixin(Array.prototype,a.Copyable);Array.prototype.copy=Array.prototype.slice});
+tiki.module("sproutcore/runtime:mixins/delegate_support",function(a){var b=a("core");b.DelegateSupport={delegateFor:function(c){for(var d=1,e=arguments.length,f;d<e;){if((f=arguments[d])&&f[c]!==undefined)return f;d++}return this[c]!==undefined?this:null},invokeDelegateMethod:function(c,d,e){e=b.A(arguments);e=e.slice(2,e.length);if(!c||!c[d])c=this;var f=c[d];return f?f.apply(c,e):null},getDelegateProperty:function(c){for(var d=1,e=arguments.length,f;d<e;)if((f=arguments[d++])&&f[c]!==undefined)return f.get?
+f.get(c):f[c];return this[c]!==undefined?this.get(c):undefined}}});
+tiki.module("sproutcore/runtime:mixins/enumerable",function(a){var b=a("core");a("system/enumerator");b.Enumerable={isEnumerable:true,nextObject:function(c){return this.objectAt?this.objectAt(c):this[c]},firstObject:function(){if(this.get("length")!==0){if(this.objectAt)return this.objectAt(0);var c=b.Enumerator._popContext(),d;d=this.nextObject(0,null,c);b.Enumerator._pushContext(c);return d}}.property(),enumerator:function(){return b.Enumerator.create(this)},forEach:function(c,d){if(typeof c!==
+"function")throw new TypeError;var e=this.get?this.get("length"):this.length;if(d===undefined)d=null;for(var f=null,g=b.Enumerator._popContext(),h=0;h<e;h++){f=this.nextObject(h,f,g);c.call(d,f,h,this);f=f}b.Enumerator._pushContext(g);return this},getEach:function(c){return this.map(function(d){return d?d.get?d.get(c):d[c]:null},this)},setEach:function(c,d){this.forEach(function(e){if(e)if(e.set)e.set(c,d);else e[c]=d},this);return this},map:function(c,d){if(typeof c!=="function")throw new TypeError;
+var e=this.get?this.get("length"):this.length;if(d===undefined)d=null;for(var f=[],g=null,h=b.Enumerator._popContext(),j=0;j<e;j++){g=this.nextObject(j,g,h);f[j]=c.call(d,g,j,this);g=g}b.Enumerator._pushContext(h);return f},mapProperty:function(c){return this.map(function(d){return d?d.get?d.get(c):d[c]:null})},filter:function(c,d){if(typeof c!=="function")throw new TypeError;var e=this.get?this.get("length"):this.length;if(d===undefined)d=null;for(var f=[],g=null,h=b.Enumerator._popContext(),j=0;j<
+e;j++){g=this.nextObject(j,g,h);c.call(d,g,j,this)&&f.push(g);g=g}b.Enumerator._pushContext(h);return f},sortProperty:function(c){var d=typeof c===b.T_STRING?arguments:c,e=d.length,f;if(this instanceof Array)f=this;else{f=[];this.forEach(function(g){f.push(g)})}if(!f)return[];return f.sort(function(g,h){var j,k,l;for(j=l=0;l===0&&j<e;j++){k=d[j];l=g?g.get?g.get(k):g[k]:null;k=h?h.get?h.get(k):h[k]:null;l=b.compare(l,k)}return l})},filterProperty:function(c,d){for(var e=this.get?this.get("length"):
+this.length,f=[],g=null,h=b.Enumerator._popContext(),j=0;j<e;j++){var k=(g=this.nextObject(j,g,h))?g.get?g.get(c):g[c]:null;(d===undefined?!!k:b.isEqual(k,d))&&f.push(g);g=g}b.Enumerator._pushContext(h);return f},find:function(c,d){if(typeof c!=="function")throw new TypeError;var e=this.get?this.get("length"):this.length;if(d===undefined)d=null;for(var f=null,g=false,h=null,j=b.Enumerator._popContext(),k=0;k<e&&!g;k++){f=this.nextObject(k,f,j);if(g=c.call(d,f,k,this))h=f;f=f}b.Enumerator._pushContext(j);
+return h},findProperty:function(c,d){for(var e=this.get?this.get("length"):this.length,f=false,g=null,h=null,j=b.Enumerator._popContext(),k=0;k<e&&!f;k++){f=(h=this.nextObject(k,h,j))?h.get?h.get(c):h[c]:null;if(f=d===undefined?!!f:b.isEqual(f,d))g=h;h=h}b.Enumerator._pushContext(j);return g},every:function(c,d){if(typeof c!=="function")throw new TypeError;var e=this.get?this.get("length"):this.length;if(d===undefined)d=null;for(var f=true,g=null,h=b.Enumerator._popContext(),j=0;f&&j<e;j++){g=this.nextObject(j,
+g,h);c.call(d,g,j,this)||(f=false);g=g}b.Enumerator._pushContext(h);return f},everyProperty:function(c,d){for(var e=this.get?this.get("length"):this.length,f=true,g=null,h=b.Enumerator._popContext(),j=0;f&&j<e;j++){f=(g=this.nextObject(j,g,h))?g.get?g.get(c):g[c]:null;f=d===undefined?!!f:b.isEqual(f,d);g=g}b.Enumerator._pushContext(h);return f},some:function(c,d){if(typeof c!=="function")throw new TypeError;var e=this.get?this.get("length"):this.length;if(d===undefined)d=null;for(var f=false,g=null,
+h=b.Enumerator._popContext(),j=0;!f&&j<e;j++){g=this.nextObject(j,g,h);if(c.call(d,g,j,this))f=true;g=g}b.Enumerator._pushContext(h);return f},someProperty:function(c,d){for(var e=this.get?this.get("length"):this.length,f=false,g=null,h=b.Enumerator._popContext(),j=0;!f&&j<e;j++){f=(g=this.nextObject(j,g,h))?g.get?g.get(c):g[c]:null;f=d===undefined?!!f:b.isEqual(f,d);g=g}b.Enumerator._pushContext(h);return f},reduce:function(c,d,e){if(typeof c!=="function")throw new TypeError;var f=this.get?this.get("length"):
+this.length;if(f===0&&d===undefined)throw new TypeError;d=d;for(var g=null,h=b.Enumerator._popContext(),j=0;j<f;j++){g=this.nextObject(j,g,h);if(g!==null)d=d===undefined?g:c.call(null,d,g,j,this,e);g=g}b.Enumerator._pushContext(h);if(d===undefined)throw new TypeError;return d},invoke:function(c){var d=this.get?this.get("length"):this.length;if(d<=0)return[];var e,f=[],g=arguments.length;if(g>1)for(e=1;e<g;e++)f.push(arguments[e]);g=[];var h=null,j=b.Enumerator._popContext();for(e=0;e<d;e++){var k=
+(h=this.nextObject(e,h,j))?h[c]:null;if(k)g[e]=k.apply(h,f);h=h}b.Enumerator._pushContext(j);return g},invokeWhile:function(c,d){var e=this.get?this.get("length"):this.length;if(e<=0)return null;var f,g=[],h=arguments.length;if(h>2)for(f=2;f<h;f++)g.push(arguments[f]);h=c;var j=null,k=b.Enumerator._popContext();for(f=0;h===c&&f<e;f++){var l=(j=this.nextObject(f,j,k))?j[d]:null;if(l)h=l.apply(j,g);j=j}b.Enumerator._pushContext(k);return h},toArray:function(){var c=[];this.forEach(function(d){c.push(d)},
+this);return c},groupBy:function(c){for(var d=this.get?this.get("length"):this.length,e=[],f=null,g=b.Enumerator._popContext(),h=[],j=[],k=0;k<d;k++){var l=(f=this.nextObject(k,f,g))?f.get?f.get(c):f[c]:null;if(b.none(h[l])){h[l]=[];j.push(l)}h[l].push(f);f=f}b.Enumerator._pushContext(g);k=0;for(c=j.length;k<c;k++)e.push(h[j[k]]);return e}};b._buildReducerFor=function(c,d){return function(e,f){var g=this[c];return b.typeOf(g)!==b.T_FUNCTION?this.unknownProperty?this.unknownProperty(e,f):null:b.Enumerable.reduce.call(this,
+g,null,d)}.property("[]")};b.Reducers={"[]":function(){return this}.property(),enumerableContentDidChange:function(){this.notifyPropertyChange("[]");return this},reducedProperty:function(c,d,e){if(!(!c||c.charAt(0)!=="@")){d=c.match(/^@([^(]*)(\(([^)]*)\))?$/);if(!(!d||d.length<2)){var f=d[1];d=d[3];f="reduce"+f.slice(0,1).toUpperCase()+f.slice(1);var g=this[f];if(b.typeOf(g)===b.T_FUNCTION){if(e===false)return b.Enumerable.reduce.call(this,g,null,d);f=b._buildReducerFor(f,d);if(e=this.constructor.prototype){e[c]=
+f;f=e._properties||[];f.push(c);e._properties=f;this.registerDependentKey(c,"[]")}return b.Enumerable.reduce.call(this,g,null,d)}}}},reduceMax:function(c,d,e,f,g){if(g&&d)d=d.get?d.get(g):d[g];if(c===null)return d;return d>c?d:c},reduceMaxObject:function(c,d,e,f,g){e=c;f=d;if(g){if(d)f=d.get?d.get(g):d[g];if(c)e=c.get?c.get(g):c[g]}if(e===null)return d;return f>e?d:c},reduceMin:function(c,d,e,f,g){if(g&&d)d=d.get?d.get(g):d[g];if(c===null)return d;return d<c?d:c},reduceMinObject:function(c,d,e,f,
+g){e=c;f=d;if(g){if(d)f=d.get?d.get(g):d[g];if(c)e=c.get?c.get(g):c[g]}if(e===null)return d;return f<e?d:c},reduceAverage:function(c,d,e,f,g){if(g&&d)d=d.get?d.get(g):d[g];c=(c||0)+d;f=f.get?f.get("length"):f.length;if(e>=f-1)c/=f;return c},reduceSum:function(c,d,e,f,g){if(g&&d)d=d.get?d.get(g):d[g];return c===null?d:c+d}};b.mixin(b.Enumerable,b.Reducers);b.mixin(Array.prototype,b.Reducers);Array.prototype.isEnumerable=true;(function(){var c={nextObject:b.Enumerable.nextObject,enumerator:b.Enumerable.enumerator,
+firstObject:b.Enumerable.firstObject,sortProperty:b.Enumerable.sortProperty,mapProperty:function(f){for(var g=this.length,h=[],j=0;j<g;j++){var k=this[j];h[j]=k?k.get?k.get(f):k[f]:null}return h},filterProperty:function(f,g){for(var h=this.length,j=[],k=0;k<h;k++){var l=this[k],m=l?l.get?l.get(f):l[f]:null;(g===undefined?!!m:b.isEqual(m,g))&&j.push(l)}return j},groupBy:function(f){for(var g=this.length,h=[],j=[],k=[],l=0;l<g;l++){var m=this[l],n=m?m.get?m.get(f):m[f]:null;if(b.none(j[n])){j[n]=[];
+k.push(n)}j[n].push(m)}l=0;for(f=k.length;l<f;l++)h.push(j[k[l]]);return h},find:function(f,g){if(typeof f!=="function")throw new TypeError;var h=this.length;if(g===undefined)g=null;for(var j,k=null,l=false,m=0;m<h&&!l;m++){j=this[m];if(l=f.call(g,j,m,this))k=j}return k},findProperty:function(f,g){var h=this.length,j,k;k=false;for(var l=null,m=0;m<h&&!k;m++){k=(j=this[m])?j.get?j.get(f):j[f]:null;if(k=g===undefined?!!k:b.isEqual(k,g))l=j}return l},everyProperty:function(f,g){for(var h=this.length,
+j=true,k=0;j&&k<h;k++){j=(j=this[k])?j.get?j.get(f):j[f]:null;j=g===undefined?!!j:b.isEqual(j,g)}return j},someProperty:function(f,g){for(var h=this.length,j=false,k=0;!j&&k<h;k++){j=(j=this[k])?j.get?j.get(f):j[f]:null;j=g===undefined?!!j:b.isEqual(j,g)}return j},invoke:function(f){var g=this.length;if(g<=0)return[];var h,j=[],k=arguments.length;if(k>1)for(h=1;h<k;h++)j.push(arguments[h]);k=[];for(h=0;h<g;h++){var l=this[h],m=l?l[f]:null;if(m)k[h]=m.apply(l,j)}return k},invokeWhile:function(f,g){var h=
+this.length;if(h<=0)return null;var j,k=[],l=arguments.length;if(l>2)for(j=2;j<l;j++)k.push(arguments[j]);l=f;for(j=0;l===f&&j<h;j++){var m=this[j],n=m?m[g]:null;if(n)l=n.apply(m,k)}return l},toArray:function(){var f=this.length;if(f<=0)return[];for(var g=[],h=0;h<f;h++)g.push(this[h]);return g},getEach:function(f){for(var g=[],h=this.length,j=0;j<h;j++){var k=this[j];g[j]=k?k.get?k.get(f):k[f]:null}return g},setEach:function(f,g){for(var h=this.length,j=0;j<h;j++){var k=this[j];if(k)if(k.set)k.set(f,
+g);else k[f]=g}return this}},d={forEach:function(f,g){if(typeof f!=="function")throw new TypeError;var h=this.length;if(g===undefined)g=null;for(var j=0;j<h;j++)f.call(g,this[j],j,this);return this},map:function(f,g){if(typeof f!=="function")throw new TypeError;var h=this.length;if(g===undefined)g=null;for(var j=[],k=0;k<h;k++)j[k]=f.call(g,this[k],k,this);return j},filter:function(f,g){if(typeof f!=="function")throw new TypeError;var h=this.length;if(g===undefined)g=null;for(var j=[],k=0;k<h;k++){var l=
+this[k];f.call(g,l,k,this)&&j.push(l)}return j},every:function(f,g){if(typeof f!=="function")throw new TypeError;var h=this.length;if(g===undefined)g=null;for(var j=true,k=0;j&&k<h;k++)f.call(g,this[k],k,this)||(j=false);return j},some:function(f,g){if(typeof f!=="function")throw new TypeError;var h=this.length;if(g===undefined)g=null;for(var j=false,k=0;!j&&k<h;k++)if(f.call(g,this[k],k,this))j=true;return j},reduce:function(f,g,h){if(typeof f!=="function")throw new TypeError;var j=this.length;if(j===
+0&&g===undefined)throw new TypeError;g=g;for(var k=0;k<j;k++){var l=this[k];if(l!==null)g=g===undefined?l:f.call(null,g,l,k,this,h)}if(g===undefined)throw new TypeError;return g}};for(var e in d)if(d.hasOwnProperty(e))if(!Array.prototype[e]||typeof Prototype==="object"&&Prototype.Version.match(/^1\.6/))Array.prototype[e]=d[e];b.mixin(Array.prototype,c)})()});
+tiki.module("sproutcore/runtime:mixins/freezable",function(a){a=a("core");a.FROZEN_ERROR=new Error("Cannot modify a frozen object");a.Freezable={isFreezable:true,isFrozen:false,freeze:function(){if(this.set)this.set("isFrozen",true);else this.isFrozen=true;return this}};a.mixin(Array.prototype,a.Freezable)});
+tiki.module("sproutcore/runtime:mixins/observable",function(a){var b=a("core");a("private/observer_set");a("private/chain_observer");b.LOG_OBSERVERS=false;b.Observable={isObservable:true,automaticallyNotifiesObserversFor:function(){return true},get:function(c){var d=this[c],e;if(d===undefined)return this.unknownProperty(c);else if(d&&d.isProperty)if(d.isCacheable){e=this._kvo_cache;if(!e)e=this._kvo_cache={};return e[d.cacheKey]!==undefined?e[d.cacheKey]:(e[d.cacheKey]=d.call(this,c))}else return d.call(this,
+c);else return d},set:function(c,d){var e=this[c],f=this.automaticallyNotifiesObserversFor(c),g=d,h,j,k,l;if(!f&&this._kvo_cacheable&&(j=this._kvo_cache)){h=this._kvo_cachedep;if(!h||(h=h[c])===undefined)h=this._kvo_computeCachedDependentsFor(c);if(h)for(k=h.length;--k>=0;){l=h[k];j[l.cacheKey]=j[l.lastSetValueKey]=undefined}}if(e&&e.isProperty){j=this._kvo_cache;if(e.isVolatile||!j||j[e.lastSetValueKey]!==d){if(!j)j=this._kvo_cache={};j[e.lastSetValueKey]=d;f&&this.propertyWillChange(c);g=e.call(this,
+c,d);if(e.isCacheable)j[e.cacheKey]=g;f&&this.propertyDidChange(c,g,true)}}else if(e===undefined){f&&this.propertyWillChange(c);this.unknownProperty(c,d);f&&this.propertyDidChange(c,g)}else if(this[c]!==d){f&&this.propertyWillChange(c);g=this[c]=d;f&&this.propertyDidChange(c,g)}return this},unknownProperty:function(c,d){if(d!==undefined)this[c]=d;return d},beginPropertyChanges:function(){this._kvo_changeLevel=(this._kvo_changeLevel||0)+1;return this},endPropertyChanges:function(){this._kvo_changeLevel=
+(this._kvo_changeLevel||1)-1;var c=this._kvo_changes;this._kvo_changeLevel<=0&&c&&c.length>0&&!b.Observers.isObservingSuspended&&this._notifyPropertyObservers();return this},propertyWillChange:function(){return this},propertyDidChange:function(c,d,e){this._kvo_revision=(this._kvo_revision||0)+1;var f=this._kvo_changeLevel||0,g,h,j;d=b.LOG_OBSERVERS&&this.LOG_OBSERVING!==false;if(j=this._kvo_cache){if(!e)if((e=this[c])&&e.isProperty)j[e.cacheKey]=j[e.lastSetValueKey]=undefined;if(this._kvo_cacheable){e=
+this._kvo_cachedep;if(!e||(e=e[c])===undefined)e=this._kvo_computeCachedDependentsFor(c);if(e)for(g=e.length;--g>=0;){h=e[g];j[h.cacheKey]=j[h.lastSetValueKey]=undefined}}}j=b.Observers.isObservingSuspended;if(f>0||j){f=this._kvo_changes;if(!f)f=this._kvo_changes=b.CoreSet.create();f.add(c);if(j){d&&b.Logger.log("%@%@: will not notify observers because observing is suspended".fmt(b.KVO_SPACES,this));b.Observers.objectHasPendingChanges(this)}}else this._notifyPropertyObservers(c);return this},registerDependentKey:function(c,
+d){var e=this._kvo_dependents,f,g,h,j,k;if(b.typeOf(d)===b.T_ARRAY){f=d;h=0}else{f=arguments;h=1}g=f.length;if(!e)this._kvo_dependents=e={};for(;--g>=h;){j=f[g];(k=e[j])||(k=e[j]=[]);k.push(c)}},_kvo_addCachedDependents:function(c,d,e,f){for(var g=d.length,h,j,k;--g>=0;){j=d[g];f.add(j);if((h=this[j])&&h instanceof Function&&h.isProperty){h.isCacheable&&c.push(h);if((k=e[j])&&k.length>0)this._kvo_addCachedDependents(c,k,e,f)}}},_kvo_computeCachedDependentsFor:function(c){var d=this._kvo_cachedep,
+e=this._kvo_dependents,f=e?e[c]:null,g,h;if(!d)d=this._kvo_cachedep={};if(!f||f.length===0)return d[c]=null;g=d[c]=[];h=b._TMP_SEEN_SET=b._TMP_SEEN_SET||b.CoreSet.create();h.add(c);this._kvo_addCachedDependents(g,f,e,h);h.clear();if(g.length===0)g=d[c]=null;return g},_kvo_for:function(c,d){var e=this[c];if(!this._kvo_cloned)this._kvo_cloned={};if(e){if(!this._kvo_cloned[c]){e=this[c]=e.copy();this._kvo_cloned[c]=true}}else{e=this[c]=d===undefined?[]:d.create();this._kvo_cloned[c]=true}return e},addObserver:function(c,
+d,e,f){var g;if(e===undefined){e=d;d=this}d||(d=this);if(b.typeOf(e)===b.T_STRING)e=d[e];if(!e)throw"You must pass a method to addObserver()";c=c.toString();if(c.indexOf(".")>=0){f=b._ChainObserver.createChain(this,c,d,e,f);f.masterTarget=d;f.masterMethod=e;this._kvo_for(b.keyFor("_kvo_chains",c)).push(f)}else{this[c]===undefined&&c.indexOf("@")===0&&this.get(c);if(d===this)d=null;g=b.keyFor("_kvo_observers",c);this._kvo_for(g,b.ObserverSet).add(d,e,f);this._kvo_for("_kvo_observed_keys",b.CoreSet).add(c)}this.didAddObserver&&
+this.didAddObserver(c,d,e);return this},removeObserver:function(c,d,e){var f,g,h;if(e===undefined){e=d;d=this}d||(d=this);if(b.typeOf(e)===b.T_STRING)e=d[e];if(!e)throw"You must pass a method to removeObserver()";c=c.toString();if(c.indexOf(".")>=0){f=b.keyFor("_kvo_chains",c);if(this[f]){f=this._kvo_for(f);for(h=f.length;--h>=0;)if((g=f[h])&&g.masterTarget===d&&g.masterMethod===e)f[h]=g.destroyChain()}}else{if(d===this)d=null;f=b.keyFor("_kvo_observers",c);if(this[f]){f=this._kvo_for(f);f.remove(d,
+e);f.targets<=0&&this._kvo_for("_kvo_observed_keys",b.CoreSet).remove(c)}}this.didRemoveObserver&&this.didRemoveObserver(c,d,e);return this},hasObserverFor:function(c){b.Observers.flush(this);var d=this[b.keyFor("_kvo_observers",c)];if((c=this[b.keyFor("_kvo_local",c)])&&c.length>0)return true;if(d&&d.getMembers().length>0)return true;return false},initObservable:function(){if(!this._observableInited){this._observableInited=true;var c,d,e,f,g,h,j,k,l,m;if(d=this._observers){f=d.length;for(c=0;c<f;c++){e=
+d[c];e=this[e];h=(g=e.propertyPaths)?g.length:0;for(j=0;j<h;j++){k=g[j];l=k.indexOf(".");if(l<0)this.addObserver(k,this,e);else if(k.indexOf("*")===0)this.addObserver(k.slice(1),this,e);else{m=null;if(l===0){m=this;k=k.slice(1)}else if(l===4&&k.slice(0,5)==="this."){m=this;k=k.slice(5)}else if(l<0&&k.length===4&&k==="this"){m=this;k=""}b.Observers.addObserver(k,this,e,m)}}}}this.bindings=[];if(d=this._bindings){c=0;for(h=d.length;c<h;c++){e=d[c];f=this[e];g=e.slice(0,-7);this[e]=this.bind(g,f)}}if(d=
+this._properties){c=0;for(h=d.length;c<h;c++){e=d[c];if(f=this[e]){if(f.isCacheable)this._kvo_cacheable=true;f.dependentKeys&&f.dependentKeys.length>0&&this.registerDependentKey(e,f.dependentKeys)}}}}},observersForKey:function(c){return this._kvo_for("_kvo_observers",c).getMembers()||[]},_notifyPropertyObservers:function(c){this._observableInited||this.initObservable();b.Observers.flush(this);var d=b.LOG_OBSERVERS&&this.LOG_OBSERVING!==false,e,f,g,h,j,k,l,m,n,o,q,t;if(d){t=b.KVO_SPACES=(b.KVO_SPACES||
+"")+"  ";b.Logger.log('%@%@: notifying observers after change to key "%@"'.fmt(t,this,c))}g=this["_kvo_observers_*"];for(this._kvo_changeLevel=(this._kvo_changeLevel||0)+1;(f=this._kvo_changes)&&f.length>0||c;){k=++this.propertyRevision;f||(f=b.CoreSet.create());this._kvo_changes=null;if(c==="*"){f.add("*");f.addEach(this._kvo_for("_kvo_observed_keys",b.CoreSet))}else c&&f.add(c);if(e=this._kvo_dependents)for(h=0;h<f.length;h++){c=f[h];if((j=e[c])&&(o=j.length)){d&&b.Logger.log("%@...including dependent keys for %@: %@".fmt(t,
+c,j));l=this._kvo_cache;if(!l)l=this._kvo_cache={};for(;--o>=0;){f.add(c=j[o]);if(c=this[c]){this[c.cacheKey]=undefined;l[c.cacheKey]=l[c.lastSetValueKey]=undefined}}}}for(;f.length>0;){c=f.pop();if(e=this[b.keyFor("_kvo_observers",c)]){e=e.getMembers();h=e.length;for(l=0;l<h;l++){j=e[l];if(j[3]!==k){m=j[0]||this;n=j[1];q=j[2];j[3]=k;d&&b.Logger.log('%@...firing observer on %@ for key "%@"'.fmt(t,m,c));q!==undefined?n.call(m,this,c,null,q,k):n.call(m,this,c,null,k)}}}if(e=this[b.keyFor("_kvo_local",
+c)]){h=e.length;for(l=0;l<h;l++){j=e[l];if(n=this[j]){d&&b.Logger.log('%@...firing local observer %@.%@ for key "%@"'.fmt(t,this,j,c));n.call(this,this,c,null,k)}}}if(g&&c!=="*"){e=g.getMembers();h=e.length;for(l=0;l<h;l++){j=e[l];m=j[0]||this;n=j[1];q=j[2];d&&b.Logger.log('%@...firing * observer on %@ for key "%@"'.fmt(t,m,c));q!==undefined?n.call(m,this,c,null,q,k):n.call(m,this,c,null,k)}}if(this.propertyObserver){d&&b.Logger.log('%@...firing %@.propertyObserver for key "%@"'.fmt(t,this,c));this.propertyObserver(this,
+c,null,k)}}f&&f.destroy();c=null}this._kvo_changeLevel=(this._kvo_changeLevel||1)-1;if(d)b.KVO_SPACES=t.slice(0,-2);return true},bind:function(c,d,e){if(e!==undefined)d=[d,e];e=b.typeOf(d);if(e===b.T_STRING||e===b.T_ARRAY){e=this[c+"BindingDefault"]||b.Binding;e=e.beget().from(d)}else e=d;e=e.to(c,this).connect();this.bindings.push(e);return e},didChangeFor:function(c){var d,e,f,g,h,j,k,l,m;c=b.hashFor(c);d=this._kvo_didChange_valueCache;if(!d)d=this._kvo_didChange_valueCache={};e=this._kvo_didChange_revisionCache;
+if(!e)e=this._kvo_didChange_revisionCache={};f=d[c]||{};g=e[c]||{};h=false;j=this._kvo_revision||0;for(k=arguments.length;--k>=1;){l=arguments[k];if(g[l]!=j){m=this.get(l);if(f[l]!==m){h=true;f[l]=m}}g[l]=j}d[c]=f;e[c]=g;return h},setIfChanged:function(c,d){return this.get(c)!==d?this.set(c,d):this},getPath:function(c){c=b.tupleForPropertyPath(c,this);if(!(c===null||c[0]===null))return c[0].get(c[1])},setPath:function(c,d){if(c.indexOf(".")>=0){c=b.tupleForPropertyPath(c,this);if(!c||!c[0])return null;
+c[0].set(c[1],d)}else this.set(c,d);return this},setPathIfChanged:function(c,d){if(c.indexOf(".")>=0){c=b.tupleForPropertyPath(c,this);if(!c||!c[0])return null;c[0].get(c[1])!==d&&c[0].set(c[1],d)}else this.setIfChanged(c,d);return this},getEach:function(){var c=b.A(arguments),d=[],e,f;e=0;for(f=c.length;e<f;e++)d[d.length]=this.getPath(c[e]);return d},incrementProperty:function(c,d){d||(d=1);this.set(c,(this.get(c)||0)+d);return this.get(c)},decrementProperty:function(c,d){d||(d=1);this.set(c,(this.get(c)||
+0)-d);return this.get(c)},toggleProperty:function(c,d,e){if(d===undefined)d=true;if(e===undefined)e=false;d=this.get(c)==d?e:d;this.set(c,d);return this.get(c)},notifyPropertyChange:function(c,d){this.propertyWillChange(c);this.propertyDidChange(c,d);return this},allPropertiesDidChange:function(){this._kvo_cache=null;this._notifyPropertyObservers("*");return this},addProbe:function(c){this.addObserver(c,b.logChange)},removeProbe:function(c){this.removeObserver(c,b.logChange)},logProperty:function(){var c=
+b.$A(arguments),d,e,f;f=0;for(e=c.length;f<e;f++){d=c[f];b.Logger.log("%@:%@: ".fmt(b.guidFor(this),d),this.get(d))}},propertyRevision:1};b.logChange=function(c,d){b.Logger.log("CHANGE: %@[%@] => %@".fmt(c,d,c.get(d)))};b.mixin(b,{get:function(c,d){if(c){if(d===undefined)return this[c];if(c.get)return c.get(d);return c[d]}}});b.mixin(Array.prototype,b.Observable);a("system/binding");a("private/observer_queue")});
+tiki.module("sproutcore/runtime:private/chain_observer",function(a){var b=a("core");b._ChainObserver=function(c){this.property=c};b._ChainObserver.createChain=function(c,d,e,f,g){d=d.split(".");for(var h=new b._ChainObserver(d[0]),j=h,k=d.length,l=1;l<k;l++)j=j.next=new b._ChainObserver(d[l]);h.objectDidChange(c);j.target=e;j.method=f;j.context=g;return h};b._ChainObserver.prototype={isChainObserver:true,object:null,property:null,next:null,target:null,method:null,objectDidChange:function(c){if(c!==
+this.object){this.object&&this.object.removeObserver&&this.object.removeObserver(this.property,this,this.propertyDidChange);(this.object=c)&&this.object.addObserver&&this.object.addObserver(this.property,this,this.propertyDidChange);this.propertyDidChange()}},propertyDidChange:function(){var c=this.object,d=this.property,e=c&&c.get?c.get(d):null;this.next&&this.next.objectDidChange(e);var f=this.target,g=this.method,h=this.context;if(f&&g){var j=c?c.propertyRevision:null;h?g.call(f,c,d,e,h,j):g.call(f,
+c,d,e,j)}},destroyChain:function(){var c=this.object;c&&c.removeObserver&&c.removeObserver(this.property,this,this.propertyDidChange);this.next&&this.next.destroyChain();return this.next=this.target=this.method=this.object=this.context=null}}});
+tiki.module("sproutcore/runtime:private/observer_queue",function(a){var b=a("core");a("system/set");b.Observers={queue:[],addObserver:function(c,d,e,f){var g;(g=b.typeOf(c)===b.T_STRING?b.tupleForPropertyPath(c,f):c)?g[0].addObserver(g[1],d,e):this.queue.push([c,d,e,f])},removeObserver:function(c,d,e,f){var g,h,j;(g=b.tupleForPropertyPath(c,f))&&g[0].removeObserver(g[1],d,e);g=this.queue.length;for(h=this.queue;--g>=0;){j=h[g];if(j[0]===c&&j[1]===d&&j[2]==e&&j[3]===f)h[g]=null}},addPendingRangeObserver:function(c){var d=
+this.rangeObservers;if(!d)d=this.rangeObservers=b.CoreSet.create();d.add(c);return this},_TMP_OUT:[],flush:function(c){var d=this.queue;if(d&&d.length>0)for(var e=this.queue=[],f=d.length;--f>=0;){var g=d[f];if(g){var h=b.tupleForPropertyPath(g[0],g[3]);h?h[0].addObserver(h[1],g[1],g[2]):e.push(g)}}if(c._kvo_needsRangeObserver){e=(d=this.rangeObservers)?d.get("length"):0;g=this._TMP_OUT;for(f=0;f<e;f++){h=d[f];h.setupPending(c)&&g.push(h)}g.length>0&&d.removeEach(g);g.length=0;c._kvo_needsRangeObserver=
+false}},isObservingSuspended:0,_pending:b.CoreSet.create(),objectHasPendingChanges:function(c){this._pending.add(c)},suspendPropertyObserving:function(){this.isObservingSuspended++},resumePropertyObserving:function(){var c;if(--this.isObservingSuspended<=0){c=this._pending;this._pending=b.CoreSet.create();var d,e=c.length;for(d=0;d<e;d++)c[d]._notifyPropertyObservers();c.clear()}}}});
+tiki.module("sproutcore/runtime:private/observer_set",function(a){var b=a("core");b.ObserverSet={targets:0,_membersCacheIsValid:false,add:function(c,d,e){var f=c?b.guidFor(c):"__this__",g=this[f];if(!g){g=this[f]=b.CoreSet.create();g.target=c;g.isTargetSet=true;this.targets++}g.add(d);if(e!==undefined){c=g.contexts;if(!e)e=g.contexts={};c[b.guidFor(d)]=e}this._membersCacheIsValid=false},remove:function(c,d){c=c?b.guidFor(c):"__this__";var e=this[c];if(!e)return false;e.remove(d);if(e.length<=0){e.target=
+null;e.isTargetSet=false;e.contexts=null;delete this[c];this.targets--}else e.contexts&&delete e.contexts[b.guidFor(d)];this._membersCacheIsValid=false;return true},invokeMethods:function(){var c,d,e,f,g;for(c in this)if(this.hasOwnProperty(c))if((d=this[c])&&d.isTargetSet){e=d.length;for(f=d.target;--e>=0;)(g=d[e])&&g.call(f)}},getMembers:function(){if(this._membersCacheIsValid)return this._members;if(this._members)this._members.length=0;else this._members=[];var c=this._members;for(var d in this)if(this.hasOwnProperty(d)){var e=
+this[d];if(e&&e.isTargetSet){var f=e.length,g=e.target,h=e.contexts;if(h)for(;--f>=0;){var j=e[f];c.push([g,j,h[b.guidFor(j)]])}else for(;--f>=0;)c.push([g,e[f]])}}this._membersCacheIsValid=true;return c},clone:function(){var c,d,e,f=b.ObserverSet.create();for(e in this)if(this.hasOwnProperty(e))if((c=this[e])&&c.isTargetSet){d=c.clone();d.target=c.target;if(c.contexts)d.contexts=b.clone(c.contexts);f[e]=d}f.targets=this.targets;f._membersCacheIsValid=false;return f},create:function(){return b.beget(this)}};
+b.ObserverSet.slice=b.ObserverSet.clone});
+tiki.module("sproutcore/runtime:system/binding",function(a){var b=a("core");a("system/set");b.LOG_BINDINGS=false;b.BENCHMARK_BINDING_NOTIFICATIONS=false;b.BENCHMARK_BINDING_SETUP=false;b.MULTIPLE_PLACEHOLDER="@@MULT@@";b.NULL_PLACEHOLDER="@@NULL@@";b.EMPTY_PLACEHOLDER="@@EMPTY@@";b.Binding={beget:function(c){var d=b.beget(this);d.parentBinding=this;if(c!==undefined)d=d.from(c);return d},builder:function(){var c=this,d=function(e){return c.beget().from(e)};d.beget=function(){return c.beget()};return d},
+from:function(c,d){if(!c)return this;var e=this===b.Binding?this.beget():this;e._fromPropertyPath=c;e._fromRoot=d;e._fromTuple=null;return e},to:function(c,d){var e=this===b.Binding?this.beget():this;e._toPropertyPath=c;e._toRoot=d;e._toTuple=null;return e},connect:function(){if(this.isConnected)return this;this._syncOnConnect=this._connectionPending=this.isConnected=true;b.Binding._connectQueue.add(this);return this},_connect:function(){if(this._connectionPending){this._connectionPending=false;var c,
+d,e=b.BENCHMARK_BINDING_SETUP;e&&b.Benchmark.start("SC.Binding.connect()");c=this._fromPropertyPath;d=this._fromRoot;if(b.typeOf(c)===b.T_STRING)if(c.indexOf(".")===0){c=c.slice(1);if(!d)d=this._toRoot}else if(c.indexOf("*")===0){c=[this._fromRoot||this._toRoot,c.slice(1)];d=null}b.Observers.addObserver(c,this,this.fromPropertyDidChange,d);if(!this._oneWay){c=this._toPropertyPath;d=this._toRoot;b.Observers.addObserver(c,this,this.toPropertyDidChange,d)}e&&b.Benchmark.end("SC.Binding.connect()");if(this._syncOnConnect){this._syncOnConnect=
+false;e&&b.Benchmark.start("SC.Binding.connect().sync");this.sync();e&&b.Benchmark.end("SC.Binding.connect().sync")}}},disconnect:function(){if(!this.isConnected)return this;if(this._connectionPending)this._connectionPending=false;else{b.Observers.removeObserver(this._fromPropertyPath,this,this.fromPropertyDidChange,this._fromRoot||this._toRoot);this._oneWay||b.Observers.removeObserver(this._toPropertyPath,this,this.toPropertyDidChange,this._toRoot)}this.isConnected=false;return this},fromPropertyDidChange:function(c,
+d){if((c?c.get(d):null)!==this._bindingValue){this._setBindingValue(c,d);this._changePending=true;b.Binding._changeQueue.add(this)}},toPropertyDidChange:function(c,d){if(!this._oneWay)if(c.get(d)!==this._transformedBindingValue){this._setBindingValue(c,d);this._changePending=true;b.Binding._changeQueue.add(this)}},_setBindingValue:function(c,d){this._bindingSource=c;this._bindingKey=d},_computeBindingValue:function(){var c=this._bindingSource,d=this._bindingKey;this._bindingValue=c=c?c.getPath(d):
+null;var e=this._transforms;if(e){var f=e.length,g;for(d=0;d<f;d++){g=e[d];c=g(c,this)}}if(this._noError&&b.typeOf(c)===b.T_ERROR)c=null;this._transformedBindingValue=c},_connectQueue:b.CoreSet.create(),_alternateConnectQueue:b.CoreSet.create(),_changeQueue:b.CoreSet.create(),_alternateChangeQueue:b.CoreSet.create(),_changePending:false,flushPendingChanges:function(){if(this._isFlushing)return false;this._isFlushing=true;b.Observers.suspendPropertyObserving();for(var c=false,d=b.LOG_BINDINGS,e,f;(e=
+this._connectQueue).length>0;){this._connectQueue=this._alternateConnectQueue;for(this._alternateConnectQueue=e;f=e.pop();)f._connect()}for(;(e=this._changeQueue).length>0;){d&&b.Logger.log("Begin: Trigger changed bindings");c=true;this._changeQueue=this._alternateChangeQueue;for(this._alternateChangeQueue=e;f=e.pop();)f.applyBindingValue();d&&b.Logger.log("End: Trigger changed bindings")}this._isFlushing=false;b.Observers.resumePropertyObserving();return c},applyBindingValue:function(){this._changePending=
+false;this._computeBindingTargets();this._computeBindingValue();var c=this._bindingValue,d=this._transformedBindingValue,e=b.BENCHMARK_BINDING_NOTIFICATIONS,f=b.LOG_BINDINGS;if(!this._oneWay&&this._fromTarget){f&&b.Logger.log("%@: %@ -> %@".fmt(this,c,d));e&&b.Benchmark.start(this.toString()+"->");this._fromTarget.setPathIfChanged(this._fromPropertyKey,c);e&&b.Benchmark.end(this.toString()+"->")}if(this._toTarget){f&&b.Logger.log("%@: %@ <- %@".fmt(this,c,d));e&&b.Benchmark.start(this.toString()+
+"<-");this._toTarget.setPathIfChanged(this._toPropertyKey,d);e&&b.Benchmark.start(this.toString()+"<-")}},sync:function(){if(!this.isConnected)return this;if(this._connectionPending)this._syncOnConnect=true;else{this._computeBindingTargets();var c=this._fromTarget,d=this._fromPropertyKey;if(!c||!d)return this;if(c.getPath(d)!==this._bindingValue){this._setBindingValue(c,d);this._changePending=true;b.Binding._changeQueue.add(this)}}return this},_syncOnConnect:false,_computeBindingTargets:function(){if(!this._fromTarget){var c,
+d;c=this._fromPropertyPath;d=this._fromRoot;if(b.typeOf(c)===b.T_STRING)if(c.indexOf(".")===0){c=c.slice(1);if(!d)d=this._toRoot}else if(c.indexOf("*")===0){c=[d||this._toRoot,c.slice(1)];d=null}if(c=b.tupleForPropertyPath(c,d)){this._fromTarget=c[0];this._fromPropertyKey=c[1]}}if(!this._toTarget){c=this._toPropertyPath;d=this._toRoot;if(c=b.tupleForPropertyPath(c,d)){this._toTarget=c[0];this._toPropertyKey=c[1]}}},oneWay:function(c,d){if(d===undefined&&b.typeOf(c)===b.T_BOOL){d=c;c=null}c=this.from(c);
+if(c===b.Binding)c=c.beget();c._oneWay=d===undefined?true:d;return c},transform:function(c){var d=this===b.Binding?this.beget():this,e=d._transforms;if(e&&e===d.parentBinding._transform)e=d._transforms=e.slice();if(!e)e=d._transforms=[];e.push(c);return d},resetTransforms:function(){var c=this===b.Binding?this.beget():this;c._transforms=null;return c},noError:function(c,d){if(d===undefined&&b.typeOf(c)===b.T_BOOL){d=c;c=null}c=this.from(c);if(c===b.Binding)c=c.beget();c._noError=d===undefined?true:
+d;return c},single:function(c,d){if(d===undefined)d=b.MULTIPLE_PLACEHOLDER;return this.from(c).transform(function(e){if(e&&e.isEnumerable){var f=e.get("length");e=f>1?d:f<=0?null:e.firstObject()}return e})},notEmpty:function(c,d){if(d===undefined)d=b.EMPTY_PLACEHOLDER;return this.from(c).transform(function(e){if(b.none(e)||e===""||b.isArray(e)&&e.length===0)e=d;return e})},notNull:function(c,d){if(d===undefined)d=b.EMPTY_PLACEHOLDER;return this.from(c).transform(function(e){if(b.none(e))e=d;return e})},
+multiple:function(c){return this.from(c).transform(function(d){b.isArray(d)||(d=d==null?[]:[d]);return d})},bool:function(c){return this.from(c).transform(function(d){var e=b.typeOf(d);if(e===b.T_ERROR)return d;return e==b.T_ARRAY?d.length>0:d===""?false:!!d})},and:function(c,d){return this.from("and",b.Object.create({valueABinding:c,valueBBinding:d,and:function(){return this.get("valueA")&&this.get("valueB")}.property("valueA","valueB").cacheable()})).oneWay()},or:function(c,d){return this.from("or",
+b.Object.create({valueABinding:c,valueBBinding:d,or:function(){return this.get("valueA")||this.get("valueB")}.property("valueA","valueB").cacheable()})).oneWay()},not:function(c){return this.from(c).transform(function(d){var e=b.typeOf(d);if(e===b.T_ERROR)return d;return!(e==b.T_ARRAY?d.length>0:d===""?false:!!d)})},isNull:function(c){return this.from(c).transform(function(d){return b.typeOf(d)===b.T_ERROR?d:b.none(d)})},toString:function(){var c=this._fromRoot?"<%@>:%@".fmt(this._fromRoot,this._fromPropertyPath):
+this._fromPropertyPath,d=this._toRoot?"<%@>:%@".fmt(this._toRoot,this._toPropertyPath):this._toPropertyPath,e=this._oneWay?"[oneWay]":"";return"SC.Binding%@(%@ -> %@)%@".fmt(b.guidFor(this),c,d,e)}};b.binding=function(c,d){return b.Binding.from(c,d)}});
+tiki.module("sproutcore/runtime:system/cookie",function(a){var b=a("core");a("system/object");b.Cookie=b.Object.extend({name:null,value:"",expires:null,path:null,domain:null,secure:false,isCookie:true,destroy:function(){this.set("expires",-1);this.write();arguments.callee.base.apply(this,arguments)},write:function(){var c=this.get("name"),d=this.get("value"),e=this.get("expires"),f=this.get("path"),g=this.get("domain"),h=this.get("secure"),j="";if(e&&(b.typeOf(e)===b.T_NUMBER||b.DateTime&&e.get&&
+e.get("milliseconds")||b.typeOf(e.toUTCString)===b.T_FUNCTION)){var k;if(b.typeOf(e)===b.T_NUMBER){k=new Date;k.setTime(k.getTime()+e*24*60*60*1E3)}else if(b.DateTime&&e.get&&e.get("milliseconds"))k=new Date(e.get("milliseconds"));else if(b.typeOf(e.toUTCString)===b.T_FUNCTION)k=e;if(k)j="; expires="+k.toUTCString()}e=f?"; path="+f:"";g=g?"; domain="+g:"";h=h?"; secure":"";document.cookie=[c,"=",encodeURIComponent(d),j,e,g,h].join("");return this}});b.Cookie.mixin({find:function(c){if(document.cookie&&
+document.cookie!=="")for(var d=document.cookie.split(";"),e=0;e<d.length;e++){var f=String(d[e]).trim();if(f.substring(0,c.length+1)===c+"=")return b.Cookie.create({name:c,value:decodeURIComponent(f.substring(c.length+1))})}return null}})});
+tiki.module("sproutcore/runtime:system/enumerator",function(a){var b=a("core");b.Enumerator=function(c){this.enumerable=c;this.reset();return this};b.Enumerator.prototype={nextObject:function(){var c=this._index,d=this._length;if(!(c>=d)){var e=this.enumerable.nextObject(c,this._previousObject,this._context);this._previousObject=e;this._index=c+1;if(c>=d)this._context=b.Enumerator._pushContext(this._context);return e}},reset:function(){var c=this.enumerable;if(!c)throw b.$error("Enumerator has been destroyed");
+c=this._length=c.get?c.get("length"):c.length;this._index=0;this._previousObject=null;this._context=c>0?b.Enumerator._popContext():null},destroy:function(){this.enumerable=this._length=this._index=this._previousObject=this._context=null}};b.Enumerator.create=function(c){return new b.Enumerator(c)};b.Enumerator._popContext=function(){return(this._contextCache?this._contextCache.pop():null)||{}};b.Enumerator._pushContext=function(c){this._contextCache=this._contextCache||[];this._contextCache.push(c);
+return null}});
+tiki.module("sproutcore/runtime:system/error",function(a){var b=a("core");b.Error=b.Object.extend({code:-1,message:"",errorValue:null,errorObject:function(){return this}.property().cacheable(),label:null,toString:function(){return"SC.Error:%@:%@ (%@)".fmt(b.guidFor(this),this.get("message"),this.get("code"))},isError:true});b.Error.desc=function(c,d,e,f){c={message:c};if(d!==undefined)c.label=d;if(f!==undefined)c.code=f;if(e!==undefined)c.errorValue=e;return this.create(c)};b.$error=function(c,d,
+e,f){return b.Error.desc(c,d,e,f)};b.ok=function(c){return c!==false&&!(c&&c.isError)};b.$ok=b.ok;b.val=function(c){return c&&c.isError?c.get?c.get("errorValue"):null:c};b.$val=b.val;b.Error.HAS_MULTIPLE_VALUES=-100});
+tiki.module("sproutcore/runtime:system/index_set",function(a){var b=a("core");a("mixins/enumerable");a("mixins/observable");a("mixins/freezable");a("mixins/copyable");b.IndexSet=b.mixin({},b.Enumerable,b.Observable,b.Freezable,b.Copyable,{_sc_sliceContent:function(c){if(c.length<1E3)return c.slice();for(var d=0,e=[],f=c[0];f!==0;){e[d]=f;d=f<0?0-f:f;f=c[d]}e[d]=0;this._hint(0,d,e);return e},create:function(c,d){var e=b.beget(this);e.initObservable();if(c&&c.isIndexSet){e._content=this._sc_sliceContent(c._content);
+e.max=c.max;e.length=c.length;e.source=c.source}else{e._content=[0];c!==undefined&&e.add(c,d)}return e},isIndexSet:true,HINT_SIZE:256,length:0,max:0,min:function(){var c=this._content[0];return c===0?-1:c>0?0:Math.abs(c)}.property("[]").cacheable(),firstObject:function(){return this.get("length")>0?this.get("min"):undefined}.property(),rangeStartForIndex:function(c){var d=this._content,e=this.get("max"),f;if(c>=e)return e;if(Math.abs(d[c])>c)return c;f=c-c%b.IndexSet.HINT_SIZE;e=d[f];if(e<0||e>c)e=
+f;for(f=Math.abs(d[e]);f<c;){e=f;f=Math.abs(d[e])}return e},isEqual:function(c){if(c===this)return true;if(!c||!c.isIndexSet||c.max!==this.max||c.length!==this.length)return false;var d=this._content;c=c._content;var e=0,f=d[e];do{if(c[e]!==f)return false;e=Math.abs(f);f=d[e]}while(e!==0);return true},indexBefore:function(c){if(c===0)return-1;c--;var d=this._content,e=this.get("max"),f=this.rangeStartForIndex(c);if(!d)return null;for(;f===e||d[f]<0;){if(f===0)return-1;c=f-1;f=this.rangeStartForIndex(c)}return c},
+indexAfter:function(c){var d=this._content,e=this.get("max");if(!d||c>=e)return-1;c++;e=this.rangeStartForIndex(c);for(e=d[e];e<0;){if(e===0)return-1;c=e=Math.abs(e);e=d[e]}return c},contains:function(c,d){var e,f;if(d===undefined){if(c===null||c===undefined)return false;if(typeof c===b.T_NUMBER)d=1;else if(c&&c.isIndexSet){if(c===this)return true;c=c._content;d=0;for(e=c[d];e!==0;){if(e>0&&!this.contains(d,e-d))return false;d=Math.abs(e);e=c[d]}return true}else{d=c.length;c=c.start}}e=this.rangeStartForIndex(c);
+f=this._content[e];return f>0&&e<=c&&f>=c+d},intersects:function(c,d){var e,f,g;if(d===undefined)if(typeof c===b.T_NUMBER)d=1;else if(c&&c.isIndexSet){if(c===this)return true;e=c._content;f=0;for(g=e[f];g!==0;){if(g>0&&this.intersects(f,g-f))return true;f=Math.abs(g);g=e[f]}return false}else{d=c.length;c=c.start}f=this.rangeStartForIndex(c);e=this._content;g=e[f];for(d=c+d;f<d;){if(g===0)return false;if(g>0&&g>c)return true;f=Math.abs(g);g=e[f]}return false},without:function(c,d){if(c===this)return b.IndexSet.create();
+return this.clone().remove(c,d)},replace:function(c,d){if(d===undefined)if(typeof c===b.T_NUMBER)d=1;else if(c&&c.isIndexSet){this._content=this._sc_sliceContent(c._content);this.beginPropertyChanges().set("max",c.max).set("length",c.length).set("source",c.source).enumerableContentDidChange().endPropertyChanges();return this}else{d=c.length;c=c.start}this._content.length=1;this.length=this.max=this._content[0]=0;return this.add(c,d)},add:function(c,d){if(this.isFrozen)throw b.FROZEN_ERROR;var e,f,
+g;if(c&&c.isIndexSet){e=c._content;if(!e)return this;f=0;for(g=e[0];g!==0;){g>0&&this.add(f,g-f);f=g<0?0-g:g;g=e[f]}return this}else if(d===undefined)if(c===null||c===undefined)return this;else if(typeof c===b.T_NUMBER)d=1;else{d=c.length;c=c.start}else if(d===null)d=1;if(d<=0)return this;var h=this.get("max"),j=h,k;e=this._content;if(c===h){if(c>0){f=this.rangeStartForIndex(c-1);g=e[f];if(g>0){delete e[h];e[f]=h=c+d;c=f}else e[h]=h=c+d}else e[c]=h=d;e[h]=0;this.set("max",h);this.set("length",this.length+
+d);d=h-c}else if(c>h){e[h]=0-c;e[c]=c+d;e[c+d]=0;this.set("max",c+d);this.set("length",this.length+d);d=c+d-h;c=h}else{f=this.rangeStartForIndex(c);g=e[f];h=c+d;k=0;if(c>0&&f===c&&g<=0){f=this.rangeStartForIndex(c-1);g=e[f]}if(g<0){e[f]=0-c;if(Math.abs(g)>h){e[c]=0-h;e[h]=g}else e[c]=g}else{c=f;if(g>h)h=g}for(f=c;f<h;){d=e[f];if(d===0){e[h]=0;g=h;k+=h-f}else{g=Math.abs(d);if(g>h){e[h]=d;g=h}if(d<0)k+=g-f}delete e[f];f=g}if((f=e[h])>0){delete e[h];h=f}e[c]=h;h>j&&this.set("max",h);this.set("length",
+this.get("length")+k);d=h-c}this._hint(c,d);k!==0&&this.enumerableContentDidChange();return this},remove:function(c,d){if(this.isFrozen)throw b.FROZEN_ERROR;if(d===undefined)if(c===null||c===undefined)return this;else if(typeof c===b.T_NUMBER)d=1;else if(c.isIndexSet){c.forEachRange(this.remove,this);return this}else{d=c.length;c=c.start}if(d<=0)return this;var e=this.get("max"),f=this._content,g,h,j;if(c>=e)return this;e=this.rangeStartForIndex(c);g=f[e];j=c+d;h=0;if(c>0&&e===c&&g>0){e=this.rangeStartForIndex(c-
+1);g=f[e]}if(g>0){f[e]=c;if(g>j){f[c]=j;f[j]=g}else f[c]=g}else{c=e;g=Math.abs(g);if(g>j)j=g}for(e=c;e<j;){d=f[e];if(d===0){f[j]=0;g=j}else{g=Math.abs(d);if(g>j){f[j]=d;g=j}if(d>0)h+=g-e}delete f[e];e=g}if((e=f[j])<0){delete f[j];j=Math.abs(e)}if(f[j]===0){delete f[j];f[c]=0;this.set("max",c)}else f[c]=0-j;this.set("length",this.get("length")-h);d=j-c;this._hint(c,d);h!==0&&this.enumerableContentDidChange();return this},_hint:function(c,d,e){if(e===undefined)e=this._content;var f=b.IndexSet.HINT_SIZE,
+g=Math.abs(e[c]),h=c-c%f+f;for(d=c+d;h<d;){for(;g!==0&&g<=h;){c=g;g=Math.abs(e[c])}if(g===0)delete e[h];else if(h!==c)e[h]=c;h+=f}},clear:function(){if(this.isFrozen)throw b.FROZEN_ERROR;var c=this.length;this._content.length=1;this._content[0]=0;this.set("length",0).set("max",0);c>0&&this.enumerableContentDidChange()},addEach:function(c){if(this.isFrozen)throw b.FROZEN_ERROR;this.beginPropertyChanges();var d=c.get("length");if(c.isSCArray)for(;--d>=0;)this.add(c.objectAt(d));else c.isEnumerable&&
+c.forEach(function(e){this.add(e)},this);this.endPropertyChanges();return this},removeEach:function(c){if(this.isFrozen)throw b.FROZEN_ERROR;this.beginPropertyChanges();var d=c.get("length");if(c.isSCArray)for(;--d>=0;)this.remove(c.objectAt(d));else c.isEnumerable&&c.forEach(function(e){this.remove(e)},this);this.endPropertyChanges();return this},clone:function(){return b.IndexSet.create(this)},inspect:function(){var c=this._content,d=c.length,e=0,f=[],g;for(e=0;e<d;e++){g=c[e];g!==undefined&&f.push("%@:%@".fmt(e,
+g))}return"SC.IndexSet<%@>".fmt(f.join(" , "))},forEachRange:function(c,d){var e=this._content,f=0,g=e[f],h=this.source;if(d===undefined)d=null;for(;g!==0;){g>0&&c.call(d,f,g-f,this,h);f=Math.abs(g);g=e[f]}return this},forEachIn:function(c,d,e,f){var g=this._content,h=0,j=0;d=c+d;var k=this.source,l=g[h];if(f===undefined)f=null;for(;l!==0;){if(h<c)h=c;for(;h<l&&h<d;)e.call(f,h++,j++,this,k);if(h>=d)h=l=0;else{h=Math.abs(l);l=g[h]}}return this},lengthIn:function(c,d){var e=0;if(d===undefined)if(c===
+null||c===undefined)return 0;else if(typeof c===b.T_NUMBER)d=1;else if(c.isIndexSet){c.forEachRange(function(j,k){e+=this.lengthIn(j,k)},this);return e}else{d=c.length;c=c.start}if(this.get("length")===0)return 0;var f=this._content,g=0,h=f[g];for(c=c+d;g<c&&h!==0;){if(h>0)e+=h>c?c-g:h-g;g=Math.abs(h);h=f[g]}return e},source:null,indexOf:function(c){var d=this.source;if(!d)throw"%@.indexOf() requires source".fmt(this);var e=d.get("length"),f=this._content;for(f=f[0]<0?Math.abs(f[0]):0;f>=0&&f<e;){f=
+d.indexOf(c,f);if(f<0)return-1;if(this.contains(f))return f;f=f+1}return-1},lastIndexOf:function(c){var d=this.source;if(!d)throw"%@.lastIndexOf() requires source".fmt(this);var e=d.get("length"),f=this.max-1;if(f>=e)f=e-1;for(;f>=0;){e=d.lastIndexOf(c,f);if(e<0)return-1;if(this.contains(e))return e;f=e+1}return-1},forEachObject:function(c,d){var e=this.source;if(!e)throw"%@.forEachObject() requires source".fmt(this);var f=this._content,g=0,h=f[g];if(d===undefined)d=null;for(;h!==0;){for(;g<h;){c.call(d,
+e.objectAt(g),g,e,this);g++}g=Math.abs(h);h=f[g]}return this},addObject:function(c,d){var e=this.source;if(!e)throw"%@.addObject() requires source".fmt(this);for(var f=e.get("length"),g=0;g>=0&&g<f;){g=e.indexOf(c,g);if(g>=0){this.add(g);if(d)return this;g=g++}else return this}return this},addObjects:function(c,d){c.forEach(function(e){this.addObject(e,d)},this);return this},removeObject:function(c,d){var e=this.source;if(!e)throw"%@.removeObject() requires source".fmt(this);for(var f=e.get("length"),
+g=0;g>=0&&g<f;){g=e.indexOf(c,g);if(g>=0){this.remove(g);if(d)return this;g=g+1}else return this}return this},removeObjects:function(c,d){c.forEach(function(e){this.removeObject(e,d)},this);return this},LOG_OBSERVING:false,forEach:function(c,d){var e=this._content,f=0,g=0,h=this.source,j=e[f];if(d===undefined)d=null;for(;j!==0;){for(;f<j;)c.call(d,f++,g++,this,h);f=Math.abs(j);j=e[f]}return this},nextObject:function(c,d,e){c=this._content;var f=e.next,g=this.get("max");if(d===null)d=f=0;else if(d>=
+g){delete e.next;return null}else d++;if(d===f){do{d=Math.abs(f);f=c[d]}while(f<0);e.next=f}return d},toString:function(){var c=[];this.forEachRange(function(d,e){c.push(e===1?d:"%@..%@".fmt(d,d+e-1))},this);return"SC.IndexSet<%@>".fmt(c.join(","))},max:0});b.IndexSet.slice=b.IndexSet.copy=b.IndexSet.clone;b.IndexSet.EMPTY=b.IndexSet.create().freeze()});
+tiki.module("sproutcore/runtime:system/logger",function(){SC.LOGGER_LOG_DELIMITER=", ";SC.LOGGER_LOG_ERROR="ERROR: ";SC.LOGGER_LOG_INFO="INFO: ";SC.LOGGER_LOG_WARN="WARNING: ";SC.LOGGER_LOG_DEBUG="DEBUG: ";SC.Logger=SC.Object.create({debugEnabled:false,exists:function(){return typeof this.get("reporter")!=="undefined"&&this.get("reporter")!=null}.property("reporter").cacheable(),fallBackOnAlert:false,fallBackOnLog:true,format:true,reporter:console,log:function(){var a=this.get("reporter");if(this.get("exists")&&
+typeof a.log==="function"){this.get("format")?a.log(this._argumentsToString.apply(this,arguments)):a.log.apply(a,arguments);return true}else if(this.fallBackOnAlert){var b=this.get("format")?this._argumentsToString.apply(this,arguments):arguments;this.get("exists")&&typeof a.alert==="function"?a.alert(b):alert(b);return true}return false},debug:function(){var a=this.get("reporter");if(this.get("debugEnabled")!==true)return false;if(this.get("exists")&&typeof a.debug==="function"){a.debug.apply(a,
+arguments);return true}else if(this.fallBackOnLog){a=this._argumentsToArray(arguments);typeof a.unshift==="function"&&a.unshift(SC.LOGGER_LOG_DEBUG);return this.log.apply(this,a)}return false},dir:function(){var a=this.get("reporter");if(this.get("exists")&&typeof a.dir==="function"){a.dir.apply(a,arguments);return true}return this.fallBackOnLog?this.log.apply(this,arguments):false},dirxml:function(){var a=this.get("reporter");if(this.get("exists")&&typeof a.dirxml==="function"){a.dirxml.apply(a,
+arguments);return true}return this.fallBackOnLog?this.log.apply(this,arguments):false},error:function(){var a=this.get("reporter");if(this.get("exists")&&typeof a.error==="function"){a.error.apply(a,arguments);return true}else if(this.fallBackOnLog){a=this._argumentsToArray(arguments);typeof a.unshift==="function"&&a.unshift(SC.LOGGER_LOG_ERROR);return this.log.apply(this,a)}return false},group:function(a){var b=this.get("reporter");if(this.get("exists")&&typeof b.group==="function"){b.group(a);return true}return false},
+groupEnd:function(){var a=this.get("reporter");if(this.get("exists")&&typeof a.groupEnd==="function"){a.groupEnd();return true}return false},info:function(){var a=this.get("reporter");if(this.get("exists")&&typeof a.info==="function"){a.info.apply(a,arguments);return true}else if(this.fallBackOnLog){a=this._argumentsToArray(arguments);typeof a.unshift==="function"&&a.unshift(SC.LOGGER_LOG_INFO);return this.log.apply(this,a)}return false},profile:function(){var a=this.get("reporter");if(this.get("exists")&&
+typeof a.profile==="function"){a.profile();return true}return false},profileEnd:function(){var a=this.get("reporter");if(this.get("exists")&&typeof a.profileEnd==="function"){a.profileEnd();return true}return false},time:function(a){var b=this.get("reporter");if(this.get("exists")&&typeof b.time==="function"){b.time(a);return true}return false},timeEnd:function(a){var b=this.get("reporter");if(this.get("exists")&&typeof b.timeEnd==="function"){b.timeEnd(a);return true}return false},trace:function(){var a=
+this.get("reporter");if(this.get("exists")&&typeof a.trace==="function"){a.trace();return true}return false},warn:function(){var a=this.get("reporter");if(this.get("exists")&&typeof a.warn==="function"){a.warn.apply(a,arguments);return true}else if(this.fallBackOnLog){a=this._argumentsToArray(arguments);typeof a.unshift==="function"&&a.unshift(SC.LOGGER_LOG_WARN);return this.log.apply(this,a)}return false},_argumentsToArray:function(a){if(!a)return[];for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b},
+_argumentsToString:function(){for(var a="",b=0;b<arguments.length-1;b++)a+=arguments[b]+SC.LOGGER_LOG_DELIMITER;a+=arguments[arguments.length-1];return a}})});
+tiki.module("sproutcore/runtime:system/object",function(a){function b(){if(!c._object_foundObjectClassNames){c._object_foundObjectClassNames=true;var d=[],e=function(f,g,h){h--;if(!(d.indexOf(g)>=0)){d.push(g);for(var j in g)if(j!="__scope__")if(j!="superclass")if(j.match(/^[A-Z0-9]/)){var k=f?[f,j].join("."):j,l=g[j];switch(c.typeOf(l)){case c.T_CLASS:if(!l._object_className)l._object_className=k;h>=0&&e(k,l,h);break;case c.T_OBJECT:h>=0&&e(k,l,h);break;case c.T_HASH:if((f||k==="SC")&&h>=0)e(k,l,
+h);break;default:break}}}};e(null,a("system","default").global,2)}}var c=a("core");a("mixins/observable");a("system/set");c.BENCHMARK_OBJECTS=false;c._object_extend=function(d,e){if(!e)throw"SC.Object.extend expects a non-null value.  Did you forget to 'sc_require' something?  Or were you passing a Protocol to extend() as if it were a mixin?";d._kvo_cloned=null;var f,g,h,j=d.concatenatedProperties,k=c.K,l,m;g=j?j.length:0;for(var n=g>0?{}:null;--g>=0;){f=j[g];l=d[f];m=e[f];if(l){l instanceof Array||
+(l=c.$A(l));n[f]=m?l.concat(m):m}else{m instanceof Array||(m=c.$A(m));n[f]=m}}g=d._bindings;j=false;l=d._observers;m=false;var o=d._properties,q=false,t,r,s,v=d.outlets,w=false;if(e.outlets){v=(v||c.EMPTY_ARRAY).concat(e.outlets);w=true}for(f in e)if(f!=="_kvo_cloned")if(e.hasOwnProperty(f)){var y=(n.hasOwnProperty(f)?n[f]:null)||e[f];if(f.slice(-7)==="Binding"){if(!j){g=(g||c.EMPTY_ARRAY).slice();j=true}if(g===null)g=(d._bindings||c.EMPTY_ARRAY).slice();g[g.length]=f}else if(y&&y instanceof Function){if(!y.superclass&&
+y!==(h=d[f]))y.superclass=y.base=h||k;if(y.propertyPaths){if(!m){l=(l||c.EMPTY_ARRAY).slice();m=true}l[l.length]=f}else if(t=y.localPropertyPaths)for(r=t.length;--r>=0;){s=d._kvo_for(c.keyFor("_kvo_local",t[r]),c.Set);s.add(f);d._kvo_for("_kvo_observed_keys",c.CoreSet).add(t[r])}else if(y.dependentKeys){if(!q){o=(o||c.EMPTY_ARRAY).slice();q=true}o[o.length]=f}else if(y.autoconfiguredOutlet){if(!w){v=(v||c.EMPTY_ARRAY).slice();w=true}v[v.length]=f}}d[f]=y}if(e.hasOwnProperty("toString")){f="toString";
+y=(n.hasOwnProperty(f)?n[f]:null)||e[f];if(!y.superclass&&y!==(h=d[f]))y.superclass=y.base=h||k;d[f]=y}d._bindings=g||[];d._observers=l||[];d._properties=o||[];d.outlets=v||[];return d};c.Object=function(d){return this._object_init(d)};c.mixin(c.Object,{mixin:function(){var d=arguments.length,e;for(e=0;e<d;e++)c.mixin(this,arguments[e]);return this},superclass:null,extend:function(){var d=c.BENCHMARK_OBJECTS;d&&c.Benchmark.start("SC.Object.extend");var e,f=function(j){return this._object_init(j)};
+for(e in this)if(this.hasOwnProperty(e))f[e]=this[e];if(this.hasOwnProperty("toString"))f.toString=this.toString;f.superclass=this;c.generateGuid(f);f.subclasses=c.Set.create();this.subclasses.add(f);e=f.prototype=c.beget(this.prototype);var g,h=arguments.length;for(g=0;g<h;g++)c._object_extend(e,arguments[g]);e.constructor=f;d&&c.Benchmark.end("SC.Object.extend");return f},create:function(){return new this(arguments)},isClass:true,subclasses:c.Set.create(),toString:function(){return c._object_className(this)},
+subclassOf:function(d){if(this===d)return false;for(var e=this;e=e.superclass;)if(e===d)return true;return false},hasSubclass:function(d){return d&&d.subclassOf?d.subclassOf(this):false},kindOf:function(d){return this===d||this.subclassOf(d)}});c.Object.prototype={_kvo_enabled:true,_object_init:function(d){var e,f=d?d.length:0;for(e=0;e<f;e++)c._object_extend(this,d[e]);c.generateGuid(this);this.init();f=(d=this.initMixin)?d.length:0;for(e=0;e<f;e++)d[e].call(this);return this},mixin:function(){var d,
+e=arguments.length;for(d=0;d<e;d++)c.mixin(this,arguments[d]);for(d=0;d<e;d++){var f=arguments[d].initMixin;f&&f.call(this)}return this},init:function(){this.initObservable();return this},isDestroyed:false,destroy:function(){if(this.get("isDestroyed"))return this;this.set("isDestroyed",true);var d,e=this.destroyMixin,f=e?e.length:0;for(d=0;d<f;d++)e[d].call(this);return this},isObject:true,respondsTo:function(d){return c.typeOf(this[d])===c.T_FUNCTION},tryToPerform:function(d,e,f){return this.respondsTo(d)&&
+this[d](e,f)!==false},superclass:function(){var d=arguments.callee.caller;if(!d)throw"superclass cannot determine the caller method";return d.superclass?d.superclass.apply(this,arguments):null},instanceOf:function(d){return this.constructor===d},kindOf:function(d){return this.constructor.kindOf(d)},toString:function(){if(!this._object_toString){var d=c._object_className(this.constructor),e="%@:%@".fmt(d,c.guidFor(this));if(d)this._object_toString=e;else return e}return this._object_toString},awake:function(){this.outlets.forEach(function(d){this.get(d)},
+this);this.bindings.invoke("sync")},invokeOnce:function(d){c.RunLoop.currentRunLoop.invokeOnce(this,d);return this},invokeLast:function(d){c.RunLoop.currentRunLoop.invokeLast(this,d);return this},concatenatedProperties:["concatenatedProperties","initMixin","destroyMixin"]};c.Object.prototype.constructor=c.Object;c.mixin(c.Object.prototype,c.Observable);c.instanceOf=function(d,e){return!!(d&&d.constructor===e)};c.kindOf=function(d,e){if(d&&!d.isClass)d=d.constructor;return!!(d&&d.kindOf&&d.kindOf(e))};
+c._object_className=function(d){if(!c.isReady)return"";d._object_className||b();if(d._object_className)return d._object_className;for(d=d;d&&!d._object_className;)d=d.superclass;return d&&d._object_className?d._object_className:"Anonymous"}});
+tiki.module("sproutcore/runtime:system/range_observer",function(a){var b=a("core");a("private/observer_queue");a("system/index_set");b.RangeObserver={isRangeObserver:true,toString:function(){return(this.indexes?this.indexes.toString():"SC.IndexSet<..>").replace("IndexSet","RangeObserver(%@)".fmt(b.guidFor(this)))},create:function(c,d,e,f,g,h){var j=b.beget(this);j.source=c;j.indexes=d?d.frozenCopy():null;j.target=e;j.method=f;j.context=g;j.isDeep=h||false;j.beginObserving();return j},extend:function(){var c=
+b.beget(this),d=arguments,e=d.length,f;for(f=0;f<e;f++)b.mixin(c,d[f]);return c},destroy:function(){this.endObserving();return this},update:function(c,d){if(this.indexes&&this.indexes.isEqual(d))return this;this.indexes=d?d.frozenCopy():null;this.endObserving().beginObserving();return this},beginObserving:function(){if(!this.isDeep)return this;var c=this.observing;if(!c)c=this.observing=b.CoreSet.create();var d=this._beginObservingForEach;if(!d)d=this._beginObservingForEach=function(e){if((e=this.source.objectAt(e))&&
+e.addObserver){c.push(e);e._kvo_needsRangeObserver=true}};this.indexes.forEach(d,this);this.isObserving=false;b.Observers.addPendingRangeObserver(this);return this},setupPending:function(c){var d=this.observing;if(this.isObserving||!d||d.get("length")===0)return true;if(d.contains(c)){this.isObserving=true;c=this._setupPendingForEach;if(!c){var e=this.objectPropertyDidChange;c=this._setupPendingForEach=function(f){var g=this.source.objectAt(f),h=b.guidFor(g);if(g&&g.addObserver){d.push(g);g.addObserver("*",
+this,e);g=this[h];if(g===undefined||g===null)this[h]=f;else if(g.isIndexSet)g.add(f);else this[h]=b.IndexSet.create(g).add(f)}}}this.indexes.forEach(c,this);return true}else return false},endObserving:function(){if(!this.isDeep)return this;var c=this.observing;if(this.isObserving){var d=this.objectPropertyDidChange,e,f,g;if(c){f=c.length;for(e=0;e<f;e++){g=c[e];g.removeObserver("*",this,d);this[b.guidFor(g)]=null}c.length=0}this.isObserving=false}c&&c.clear();return this},rangeDidChange:function(c){var d=
+this.indexes;if(!c||!d||d.intersects(c)){this.endObserving();this.method.call(this.target,this.source,null,"[]",c,this.context);this.beginObserving()}return this},objectPropertyDidChange:function(c,d,e,f){e=this.context;var g=this.method,h=b.guidFor(c),j=this[h];if(j&&!j.isIndexSet)j=this[h]=b.IndexSet.create(j).freeze();e?g.call(this.target,this.source,c,d,j,e,f):g.call(this.target,this.source,c,d,j,f)}}});
+tiki.module("sproutcore/runtime:system/run_loop",function(a){var b=a("core");a("private/observer_set");a("system/object");b.RunLoop=b.Object.extend({beginRunLoop:function(){this._start=(new Date).getTime();if(b.LOG_BINDINGS||b.LOG_OBSERVERS)b.Logger.log("-- SC.RunLoop.beginRunLoop at %@".fmt(this._start));return this},endRunLoop:function(){var c;if(b.LOG_BINDINGS||b.LOG_OBSERVERS)b.Logger.log("-- SC.RunLoop.endRunLoop ~ flushing application queues");do(c=this.flushApplicationQueues())||(c=this._flushinvokeLastQueue());
+while(c);this._start=null;if(b.LOG_BINDINGS||b.LOG_OBSERVERS)b.Logger.log("-- SC.RunLoop.endRunLoop ~ End");return this},invokeOnce:function(c,d){if(d===undefined){d=c;c=this}if(b.typeOf(d)===b.T_STRING)d=c[d];if(!this._invokeQueue)this._invokeQueue=b.ObserverSet.create();this._invokeQueue.add(c,d);return this},invokeLast:function(c,d){if(d===undefined){d=c;c=this}if(b.typeOf(d)===b.T_STRING)d=c[d];if(!this._invokeLastQueue)this._invokeLastQueue=b.ObserverSet.create();this._invokeLastQueue.add(c,
+d);return this},flushApplicationQueues:function(){var c=NO,d=this._invokeQueue;if(d&&d.targets>0){this._invokeQueue=null;c=true;d.invokeMethods()}return b.Binding.flushPendingChanges()||c},_flushinvokeLastQueue:function(){var c=this._invokeLastQueue,d=false;if(c&&c.targets>0){this._invokeLastQueue=null;(d=true)&&c.invokeMethods()}return d}});b.RunLoop.currentRunLoop=null;b.RunLoop.runLoopClass=b.RunLoop;b.RunLoop.begin=function(){var c=this.currentRunLoop;if(!c)c=this.currentRunLoop=this.runLoopClass.create();
+c.beginRunLoop();return this};b.RunLoop.end=function(){var c=this.currentRunLoop;if(!c)throw"SC.RunLoop.end() called outside of a runloop!";c.endRunLoop();return this};b.run=function(c,d){b.RunLoop.begin();c.call(d);b.RunLoop.end()}});
+tiki.module("sproutcore/runtime:system/selection_set",function(a){var b=a("core");a("system/object");a("mixins/enumerable");a("mixins/copyable");a("mixins/freezable");a("system/set");a("system/index_set");b.SelectionSet=b.Object.extend(b.Enumerable,b.Freezable,b.Copyable,{isSelectionSet:true,length:function(){var c=0,d=this._sets,e=this._objects;if(e)c+=e.get("length");d&&d.forEach(function(f){c+=f.get("length")});return c}.property().cacheable(),sources:function(){var c=[],d=this._sets,e=d?d.length:
+0,f,g;for(f=0;f<e;f++)(g=d[f])&&g.get("length")>0&&g.source&&c.push(g.source);return c}.property().cacheable(),indexSetForSource:function(c){if(!c||!c.isSCArray)return null;var d=this._indexSetCache,e=this._objects,f,g;if(!d)d=this._indexSetCache={};if((f=d[b.guidFor(c)])&&f._sourceRevision&&f._sourceRevision!==c.propertyRevision)f=null;if(!f){if((f=this._indexSetForSource(c,false))&&f.get("length")===0)f=null;if(e){if(f)f=f.copy();e.forEach(function(h){if((g=c.indexOf(h))>=0){f||(f=b.IndexSet.create());
+f.add(g)}},this)}if(f){f=d[b.guidFor(c)]=f.frozenCopy();f._sourceRevision=c.propertyRevision}}return f},_indexSetForSource:function(c,d){if(d===undefined)d=true;var e=b.guidFor(c),f=this[e],g=this._sets,h=g?g.length:0,j=null;if(f>=h)f=null;if(b.none(f)){if(d&&!this.isFrozen){this.propertyWillChange("sources");if(!g)g=this._sets=[];j=g[h]=b.IndexSet.create();j.source=c;this[e]=h;this.propertyDidChange("sources")}}else j=g?g[f]:null;return j},add:function(c,d,e){if(this.isFrozen)throw b.FROZEN_ERROR;
+var f,g,h;if(d===undefined&&e===undefined){if(!c)throw"Must pass params to SC.SelectionSet.add()";if(c.isIndexSet)return this.add(c.source,c);if(c.isSelectionSet){d=c._sets;g=c._objects;e=d?d.length:0;this.beginPropertyChanges();for(f=0;f<e;f++)(c=d[f])&&c.get("length")>0&&this.add(c.source,c);g&&this.addObjects(g);this.endPropertyChanges();return this}}c=this._indexSetForSource(c,true);f=this.get("length");h=c.get("length");g=f-h;c.add(d,e);this._indexSetCache=null;g+=c.get("length");if(g!==f){this.propertyDidChange("length");
+this.enumerableContentDidChange();h===0&&this.notifyPropertyChange("sources")}return this},remove:function(c,d,e){if(this.isFrozen)throw b.FROZEN_ERROR;var f,g,h,j,k;if(d===undefined&&e===undefined){if(!c)throw"Must pass params to SC.SelectionSet.remove()";if(c.isIndexSet)return this.remove(c.source,c);if(c.isSelectionSet){f=c._sets;k=c._objects;e=f?f.length:0;this.beginPropertyChanges();for(g=0;g<e;g++)(h=f[g])&&h.get("length")>0&&this.remove(h.source,h);k&&this.removeObjects(k);this.endPropertyChanges();
+return this}}h=this._indexSetForSource(c,true);f=this.get("length");j=f-h.get("length");if(h&&(k=this._objects)){if(e!==undefined){d=b.IndexSet.create(d,e);e=undefined}k.forEach(function(l){g=c.indexOf(l);if(d.contains(g)){k.remove(l);j--}},this)}h.remove(d,e);h=h.get("length");j+=h;this._indexSetCache=null;if(j!==f){this.propertyDidChange("length");this.enumerableContentDidChange();h===0&&this.notifyPropertyChange("sources")}return this},contains:function(c,d,e){if(d===undefined&&e===undefined)return this.containsObject(c);
+c=this.indexSetForSource(c);if(!c)return false;return c.contains(d,e)},intersects:function(c,d,e){c=this.indexSetForSource(c,false);if(!c)return false;return c.intersects(d,e)},_TMP_ARY:[],addObject:function(c){var d=this._TMP_ARY;d[0]=c;c=this.addObjects(d);d.length=0;return c},addObjects:function(c){var d=this._objects,e;if(!d)d=this._objects=b.CoreSet.create();e=d.get("length");d.addEach(c);c=d.get("length");this._indexSetCache=null;if(c!==e){this.propertyDidChange("length");this.enumerableContentDidChange()}return this},
+removeObject:function(c){var d=this._TMP_ARY;d[0]=c;c=this.removeObjects(d);d.length=0;return c},removeObjects:function(c){var d=this._objects,e,f;if(!d)return this;e=d.get("length");d.removeEach(c);f=d.get("length");if(d=this._sets)d.forEach(function(g){e+=g.get("length");g.removeObjects(c);f+=g.get("length")},this);this._indexSetCache=null;if(f!==e){this.propertyDidChange("length");this.enumerableContentDidChange()}return this},containsObject:function(c){var d=this._objects;if(d&&d.contains(c))return true;
+var e=(d=this._sets)?d.length:0,f,g;for(f=0;f<e;f++)if((g=d[f])&&g.indexOf(c)>=0)return true;return false},constrain:function(c){var d,e,f;this.beginPropertyChanges();this.get("sources").forEach(function(g){if(g!==c)(g=this._indexSetForSource(c,false))&&this.remove(c,g)},this);if((d=this._indexSetForSource(c,false))&&(f=d.get("max"))>(e=c.get("length")))this.remove(c,e,f-e);if(d=this._objects)d.forEach(function(g){c.indexOf(g)<0&&this.removeObject(g)},this);this.endPropertyChanges();return this},
+isEqual:function(c){var d,e,f,g;if(!c||!c.isSelectionSet)return false;if(c===this)return true;if(this._sets===c._sets&&this._objects===c._objects)return true;if(this.get("length")!==c.get("length"))return false;d=this._objects;e=c._objects;if(d||e){if((d?d.get("length"):0)!==(e?e.get("length"):0))return false;if(d&&!d.isEqual(e))return false}g=this.get("sources");f=g.get("length");for(c=0;c<f;c++){e=g.objectAt(c);d=this._indexSetForSource(e,false);e=this._indexSetForSource(e,false);if(!!e!==!!d)return false;
+if(d&&!d.isEqual(e))return false}return true},clear:function(){if(this.isFrozen)throw b.FROZEN_ERROR;if(this._sets)this._sets.length=0;if(this._objects)this._objects=null;this._indexSetCache=null;this.propertyDidChange("length");this.enumerableContentDidChange();this.notifyPropertyChange("sources");return this},copy:function(){var c=this.constructor.create(),d=this._sets,e=d?d.length:0,f,g;if(d&&e>0){d=c._sets=d.slice();for(f=0;f<e;f++)if(g=d[f]){g=d[f]=g.copy();c[b.guidFor(g.source)]=f}}if(this._objects)c._objects=
+this._objects.copy();return c},freeze:function(){if(this.isFrozen)return this;for(var c=this._sets,d=c?c.length:0,e;--d>=0;)if(e=c[d])e.freeze();this._objects&&this._objects.freeze();return arguments.callee.base.apply(this,arguments)},toString:function(){var c=this._sets||[];c=c.map(function(d){return d.toString().replace("SC.IndexSet",b.guidFor(d.source))},this);this._objects&&c.push(this._objects.toString());return"SC.SelectionSet:%@<%@>".fmt(b.guidFor(this),c.join(","))},firstObject:function(){var c=
+this._sets,d=this._objects;if(c&&c.get("length")>0){var e=c?c[0]:null;c=e?e.source:null;e=e?e.firstObject():-1;if(c&&e>=0)return c.objectAt(e)}return d?d.firstObject():undefined}.property(),nextObject:function(c,d,e){var f;if(c===0){f=e.objects=[];this.forEach(function(g){f.push(g)},this);e.max=f.length}f=e.objects;d=f[c];if(c+1>=e.max)e.objects=e.max=null;return d},forEach:function(c,d){var e=this._sets,f=this._objects,g=e?e.length:0,h,j;for(j=0;j<g;j++)(h=e[j])&&h.forEachObject(c,d);f&&f.forEach(c,
+d);return this}});b.SelectionSet.prototype.clone=b.SelectionSet.prototype.copy;b.SelectionSet.EMPTY=b.SelectionSet.create().freeze()});
+tiki.module("sproutcore/runtime:system/set",function(a){var b=a("core");a("mixins/enumerable");a("mixins/copyable");a("mixins/freezable");a("mixins/observable");b.Set=b.mixin({},b.Enumerable,b.Observable,b.Freezable,{create:function(c){var d,e;e=b.Set._pool;var f=this.isObservable;if(!f&&c===undefined&&e.length>0)d=e.pop();else{d=b.beget(this);f&&d.initObservable();if(c&&c.isEnumerable&&c.get("length")>0){d.isObservable=false;if(c.isSCArray)for(e=c.get?c.get("length"):c.length;--e>=0;)d.add(c.objectAt(e));
+else if(c.isSet)for(e=c.length;--e>=0;)d.add(c[e]);else c.forEach(function(g){d.add(g)},this);d.isObservable=f}}return d},isSet:true,length:0,firstObject:function(){return this.length>0?this[0]:undefined}.property(),clear:function(){if(this.isFrozen)throw b.FROZEN_ERROR;this.length=0;return this},contains:function(c){if(c===null)return false;var d=this[b.hashFor(c)];return!b.none(d)&&d<this.length&&this[d]===c},isEqual:function(c){if(!c||!c.isSet||c.get("length")!==this.get("length"))return false;
+for(var d=this.get("length");--d>=0;)if(!c.contains(this[d]))return false;return true},add:function(c){if(this.isFrozen)throw b.FROZEN_ERROR;if(c===null||c===undefined)return this;var d=b.hashFor(c),e=this[d],f=this.length;if(e===null||e===undefined||e>=f||this[e]!==c){this[f]=c;this[d]=f;this.length=f+1}this.isObservable&&this.enumerableContentDidChange();return this},addEach:function(c){if(this.isFrozen)throw b.FROZEN_ERROR;if(!c||!c.isEnumerable)throw"%@.addEach must pass enumerable".fmt(this);
+var d,e=this.isObservable;e&&this.beginPropertyChanges();if(c.isSCArray)for(d=c.get("length");--d>=0;)this.add(c.objectAt(d));else if(c.isSet)for(d=c.length;--d>=0;)this.add(c[d]);else c.forEach(function(f){this.add(f)},this);e&&this.endPropertyChanges();return this},remove:function(c){if(this.isFrozen)throw b.FROZEN_ERROR;if(b.none(c))return this;var d=b.hashFor(c),e=this[d],f=this.length;if(b.none(e)||e>=f||this[e]!==c)return this;delete this[d];if(e<f-1){c=this[e]=this[f-1];this[b.hashFor(c)]=
+e}this.length=f-1;this.isObservable&&this.enumerableContentDidChange();return this},pop:function(){if(this.isFrozen)throw b.FROZEN_ERROR;var c=this.length>0?this[this.length-1]:null;c&&this.remove(c);return c},removeEach:function(c){if(this.isFrozen)throw b.FROZEN_ERROR;if(!c||!c.isEnumerable)throw"%@.addEach must pass enumerable".fmt(this);var d,e=this.isObservable;e&&this.beginPropertyChanges();if(c.isSCArray)for(d=c.get("length");--d>=0;)this.remove(c.objectAt(d));else if(c.isSet)for(d=c.length;--d>=
+0;)this.remove(c[d]);else c.forEach(function(f){this.remove(f)},this);e&&this.endPropertyChanges();return this},copy:function(){return this.constructor.create(this)},destroy:function(){this.isFrozen=false;this.isObservable||b.Set._pool.push(this.clear());return this},forEach:function(c,d){var e=this.length;d||(d=this);for(var f=0;f<e;f++)c.call(d,this[f],f,this);return this},toString:function(){var c=this.length,d,e=[];for(d=0;d<c;d++)e[d]=this[d];return"SC.Set<%@>".fmt(e.join(","))},_pool:[],isObservable:true});
+b.Set.constructor=b.Set;b.Set.clone=b.Set.copy;b.Set.push=b.Set.unshift=b.Set.add;b.Set.shift=b.Set.pop;b.Set.addObject=b.Set.add;b.Set.removeObject=b.Set.remove;b.Set._pool=[];b.CoreSet=b.beget(b.Set);b.CoreSet.isObservable=false;b.CoreSet.constructor=b.CoreSet});
+tiki.module("sproutcore/runtime:system/sparse_array",function(a){var b=a("core");a("system/index_set");a("system/object");a("mixins/enumerable");a("mixins/array");a("mixins/delegate_support");b.SparseArray=b.Object.extend(b.Enumerable,b.Array,b.DelegateSupport,{_requestingLength:0,_requestingIndex:0,length:function(){var c=this.delegate;if(c&&b.none(this._length)&&c.sparseArrayDidRequestLength){this._requestingLength++;c.sparseArrayDidRequestLength(this);this._requestingLength--}return this._length||
+0}.property().cacheable(),provideLength:function(c){if(b.none(c))this._sa_content=null;if(c!==this._length){this._length=c;this._requestingLength<=0&&this.enumerableContentDidChange()}return this},rangeWindowSize:1,requestedRangeIndex:[],objectAt:function(c){var d=this._sa_content,e;if(!d)d=this._sa_content=[];if((e=d[c])===undefined){this.requestIndex(c);e=d[c]}return e},definedIndexes:function(c){var d=b.IndexSet.create(),e=this._sa_content,f;if(!e)return d.freeze();if(c)c.forEach(function(g){e[g]!==
+undefined&&d.add(g)});else{f=e.length;for(c=0;c<f;c++)e[c]!==undefined&&d.add(c)}return d.freeze()},_TMP_RANGE:{},requestIndex:function(c){var d=this.delegate;if(!d)return this;var e=this.get("rangeWindowSize");c=c;if(e>1)c-=Math.floor(c%e);if(e<1)e=1;this._requestingIndex++;if(d.sparseArrayDidRequestRange){var f=this._TMP_RANGE;if(this.wasRangeRequested(c)===-1){f.start=c;f.length=e;d.sparseArrayDidRequestRange(this,f);this.requestedRangeIndex.push(c)}}else if(d.sparseArrayDidRequestIndex)for(;--e>=
+0;)d.sparseArrayDidRequestIndex(this,c+e);this._requestingIndex--;return this},wasRangeRequested:function(c){var d,e;d=0;for(e=this.requestedRangeIndex.length;d<e;d++)if(this.requestedRangeIndex[d]===c)return d;return-1},rangeRequestCompleted:function(c){c=this.wasRangeRequested(c);if(c>=0){this.requestedRangeIndex.removeAt(c,1);return true}return false},provideObjectsInRange:function(c,d){var e=this._sa_content;if(!e)e=this._sa_content=[];var f=c.start;for(c=c.length;--c>=0;)e[f+c]=d[c];this._requestingIndex<=
+0&&this.enumerableContentDidChange();return this},_TMP_PROVIDE_ARRAY:[],_TMP_PROVIDE_RANGE:{length:1},provideObjectAtIndex:function(c,d){var e=this._TMP_PROVIDE_ARRAY,f=this._TMP_PROVIDE_RANGE;e[0]=d;f.start=c;return this.provideObjectsInRange(f,e)},objectsDidChangeInRange:function(c){var d=this._sa_content;if(d)if(c.start===0&&b.maxRange(c)>=d.length)this._sa_content=null;else for(var e=c.start,f=Math.min(e+c.length,d.length);--f>=e;)d[f]=undefined;this.enumerableContentDidChange(c);return this},
+indexOf:function(c){var d=this.delegate;if(d&&d.sparseArrayDidRequestIndexOf)return d.sparseArrayDidRequestIndexOf(this,c);else{d=this._sa_content;if(!d)d=this._sa_content=[];return d.indexOf(c)}},replace:function(c,d,e){e=e||[];var f=this.delegate;if(f)if(!f.sparseArrayShouldReplace||!f.sparseArrayShouldReplace(this,c,d,e))return this;f=this._sa_content;if(!f)f=this._sa_content=[];f.replace(c,d,e);e=(e?e.get?e.get("length"):e.length:0)-d;if(!b.none(this._length)){this.propertyWillChange("length");
+this._length+=e;this.propertyDidChange("length")}this.enumerableContentDidChange(c,d,e);return this},reset:function(){this._length=this._sa_content=null;this.enumerableContentDidChange();this.invokeDelegateMethod(this.delegate,"sparseArrayDidReset",this);return this}});b.SparseArray.array=function(c){return this.create({_length:c||0})}});tiki.script("sproutcore/runtime:en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js");
+tiki.register("sproutcore/datastore",{packages:{"sproutcore/runtime":{scripts:[{url:"/static/sproutcore/runtime/en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js",id:"sproutcore/runtime:en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js"}]},tiki:{scripts:[{url:"/static/tiki/en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js",id:"tiki:en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js"}]}},depends:["tiki","sproutcore/runtime"],scripts:[{url:"/static/sproutcore/datastore/en/eb43c56c9a551db9bba1cd04f29ca1dfb2e47e4c/javascript.js",
+id:"sproutcore/datastore:en/eb43c56c9a551db9bba1cd04f29ca1dfb2e47e4c/javascript.js"}]});tiki.module("sproutcore/datastore:index",function(){});tiki.script("sproutcore/datastore:en/eb43c56c9a551db9bba1cd04f29ca1dfb2e47e4c/javascript.js");
+tiki.register("sproutcore/foundation",{packages:{"sproutcore/runtime":{scripts:[{url:"/static/sproutcore/runtime/en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js",id:"sproutcore/runtime:en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js"}]},tiki:{scripts:[{url:"/static/tiki/en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js",id:"tiki:en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js"}]}},stylesheets:[{url:"/static/sproutcore/foundation/en/a04970954a917ede9918ca06897bc0e1406986d5/stylesheet.css",
+id:"sproutcore/foundation:en/a04970954a917ede9918ca06897bc0e1406986d5/stylesheet.css"}],depends:["tiki","sproutcore/runtime"],scripts:[{url:"/static/sproutcore/foundation/en/a04970954a917ede9918ca06897bc0e1406986d5/javascript.js",id:"sproutcore/foundation:en/a04970954a917ede9918ca06897bc0e1406986d5/javascript.js"}]});tiki.global("sproutcore/foundation");
+SC.Locale=SC.Object.extend({init:function(){this.language||SC.Locale._assignLocales();if(!this.hasStrings){var a=this._deprecatedLanguageCodes||[];a.push(this.language);for(var b=a.length,c=null;!c&&--b>=0;)c=String[a[b]];if(c){this.hasStrings=YES;this.strings=c}}},hasStrings:NO,strings:{},toString:function(){this.language||SC.Locale._assignLocales();return"SC.Locale["+this.language+"]"+SC.guidFor(this)},locWithDefault:function(a,b){return this.strings[a]||b||a}});
+SC.Locale.mixin({useAutodetectedLanguage:NO,preferredLanguage:null,createCurrentLocale:function(){var a=String.preferredLanguage!==undefined?String.preferredLanguage:this.preferredLanguage;a=((String.useAutodetectedLanguage!==undefined?String.useAutodetectedLanguage:this.useAutodetectedLanguage)?SC.browser.language:null)||a||SC.browser.language||"en";a=SC.Locale.normalizeLanguage(a);var b=this.localeClassFor(a);if(a!=this.currentLanguage){this.currentLanguage=a;this.currentLocale=b.create()}return this.currentLocale},
+localeClassFor:function(a){a=SC.Locale.normalizeLanguage(a);var b,c=this.locales[a];if(!c&&(b=a.split("-")[0])!==a&&(c=this.locales[b]))c=this.locales[a]=c.extend();c||(c=this.locales[a]=this.locales.en.extend());return c},define:function(a,b){var c;if(b===undefined&&SC.typeOf(a)!==SC.T_STRING){c=this;b=a}else c=SC.Locale.localeClassFor(a);SC.mixin(c.prototype,b);return c},options:function(){return this.prototype},addStrings:function(a){var b=this.prototype.strings;if(b){if(!this.prototype.hasOwnProperty("strings"))this.prototype.strings=
+SC.clone(b)}else b=this.prototype.strings={};if(a)this.prototype.strings=SC.mixin(b,a);this.prototype.hasStrings=YES;return this},_map:{english:"en",french:"fr",german:"de",japanese:"ja",jp:"ja",spanish:"es"},normalizeLanguage:function(a){if(!a)return"en";return SC.Locale._map[a.toLowerCase()]||a},_assignLocales:function(){for(var a in this.locales)this.locales[a].prototype.language=a},toString:function(){this.prototype.language||SC.Locale._assignLocales();return"SC.Locale["+this.prototype.language+
+"]"},extend:function(){var a=SC.Object.extend.apply(this,arguments);a.addStrings=SC.Locale.addStrings;a.define=SC.Locale.define;a.options=SC.Locale.options;a.toString=SC.Locale.toString;return a}});SC.Locale.locales={en:SC.Locale.extend({_deprecatedLanguageCodes:["English"]}),fr:SC.Locale.extend({_deprecatedLanguageCodes:["French"]}),de:SC.Locale.extend({_deprecatedLanguageCodes:["German"]}),ja:SC.Locale.extend({_deprecatedLanguageCodes:["Japanese","jp"]}),es:SC.Locale.extend({_deprecatedLanguageCodes:["Spanish"]})};
+SC.stringsFor=function(a,b){SC.Locale.localeClassFor(a).addStrings(b);return this};sc_require("system/locale");SC.stringsFor("English",{"_SC.DateTime.dayNames":"Sunday Monday Tuesday Wednesday Thursday Friday Saturday","_SC.DateTime.abbreviatedDayNames":"Sun Mon Tue Wed Thu Fri Sat","_SC.DateTime.monthNames":"January February March April May June July August September October November December","_SC.DateTime.abbreviatedMonthNames":"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"});SC.DROP_ON=1;
+SC.DROP_BEFORE=2;SC.DROP_AFTER=4;SC.DROP_ANY=7;SC.SAFARI_FOCUS_BEHAVIOR=YES;SC.mixin({data:function(a,b,c){a=a===window?"@window":a;a=SC.hashFor(a);var d=SC._data_cache;if(!d)SC._data_cache=d={};var e=d[a];if(b&&!e)d[a]=e={};if(e&&c!==undefined)e[b]=c;return b?e[b]:e},removeData:function(a,b){a=a===window?"@window":a;a=SC.hashFor(a);var c=SC._data_cache;if(c){var d=c[a];if(d){var e=b?d[b]:d;if(b)delete d[b];else delete c[a];return e}}}});
+SC.mixin(Function.prototype,{invokeLater:function(a,b){if(b===undefined)b=1;var c=this;if(arguments.length>2){var d=SC.$A(arguments).slice(2,arguments.length);d.unshift(a);var e=this,f=c;c=function(){return f.apply(e,d.slice(1))}}return SC.Timer.schedule({target:a,action:c,interval:b})}});SC.Controller=SC.Object.extend({isEditable:YES});
+SC.SelectionSupport={hasSelectionSupport:YES,allowsSelection:YES,allowsMultipleSelection:YES,allowsEmptySelection:YES,firstSelectableObject:function(){return this.get("firstObject")}.property(),selection:function(a,b){var c=(a=this._scsel_selection)?a.get("length"):0,d;if(b===undefined||!this.get("allowsSelection"))b=a;d=b&&b.isEnumerable?b.get("length"):0;if(d>1&&!this.get("allowsMultipleSelection"))if(c>1){b=SC.SelectionSet.create().addObject(a.get("firstObject")).freeze();d=1}else{b=a;d=c}if(d===
+0&&!this.get("allowsEmptySelection"))if(c===0){b=(b=this.get("firstSelectableObject"))?SC.SelectionSet.create().addObject(b).freeze():SC.SelectionSet.EMPTY;d=b.get("length")}else{b=a;d=c}if(d===0)b=SC.SelectionSet.EMPTY;return this._scsel_selection=b=b.frozenCopy()}.property("arrangedObjects","allowsEmptySelection","allowsMultipleSelection","allowsSelection").cacheable(),hasSelection:function(){var a=this.get("selection");return!!a&&a.get("length")>0}.property("selection").cacheable(),selectObjects:function(a,
+b){if(!a||a.get("length")===0){b||this.set("selection",SC.SelectionSet.EMPTY);return this}var c=this.get("selection");c=b&&c?c.copy():SC.SelectionSet.create();c.addObjects(a).freeze();this.set("selection",c);return this},selectObject:function(a,b){if(a===null){b||this.set("selection",null);return this}else return this.selectObjects([a],b)},deselectObjects:function(a){if(!a||a.get("length")===0)return this;var b=this.get("selection");if(!b||b.get("length")===0)return this;b=b.copy().removeObjects(a).freeze();
+this.set("selection",b.freeze());return this},deselectObject:function(a){return a?this.deselectObjects([a]):this},updateSelectionAfterContentChange:function(){var a=this.get("arrangedObjects"),b=this.get("selection"),c=b,d,e;if(c&&a&&c.get("sources").indexOf(a)>=0){d=c.indexSetForSource(a);e=a.get("length");d=d?d.get("max"):0;if(d>e){c=c.copy().remove(a,e,d-e).freeze();this.set("selection",c)}}if(c===b){e=b?b.get("length"):0;d=a?a.get("length"):0;e===0&&!this.get("allowsEmptySelection")&&d>0&&this.notifyPropertyChange("selection")}return this}};
+sc_require("controllers/controller");sc_require("mixins/selection_support");
+SC.ArrayController=SC.Controller.extend(SC.Array,SC.SelectionSupport,{content:null,isEditable:YES,orderBy:null,allowsSingleContent:YES,destroyOnRemoval:NO,arrangedObjects:function(){return this}.property().cacheable(),canRemoveContent:function(){var a=this.get("content");return a&&this.get("isEditable")&&this.get("hasContent")?!a.isEnumerable||SC.typeOf(a.removeObject)===SC.T_FUNCTION:NO}.property("content","isEditable","hasContent"),canReorderContent:function(){var a=this.get("content");return!!a&&
+this.get("isEditable")&&!this.get("orderBy")&&!!a.isSCArray}.property("content","isEditable","orderBy"),canAddContent:function(){var a=this.get("content");return a&&this.get("isEditable")&&a.isEnumerable?SC.typeOf(a.addObject)===SC.T_FUNCTION||SC.typeOf(a.pushObject)===SC.T_FUNCTION:NO}.property("content","isEditable"),hasContent:function(){var a=this.get("content");return!!a&&(!!a.isEnumerable||!!this.get("allowsSingleContent"))}.property("content","allowSingleContent"),status:function(){var a=this.get("content");
+return(a=a?a.get("status"):null)?a:SC.Record.READY}.property().cacheable(),addObject:function(a){if(!this.get("canAddContent"))throw"%@ cannot add content".fmt(this);var b=this.get("content");if(b.isSCArray)b.pushObject(a);else if(b.addObject)b.addObject(a);else throw"%@.content does not support addObject".fmt(this);return this},removeObject:function(a){if(!this.get("canRemoveContent"))throw"%@ cannot remove content".fmt(this);var b=this.get("content");b.isEnumerable?b.removeObject(a):this.set("content",
+null);this.get("destroyOnRemoval")&&a.destroy&&a.destroy();return this},length:function(){var a=this._scac_observableContent();return a?a.get("length"):0}.property().cacheable(),objectAt:function(a){var b=this._scac_observableContent();return b?b.objectAt(a):undefined},replace:function(a,b,c){if(!c||c.get("length")===0){if(!this.get("canRemoveContent"))throw"%@ cannot remove objects from the current content".fmt(this);}else if(!this.get("canReorderContent"))throw"%@ cannot add or reorder the current content".fmt(this);
+var d=this.get("content"),e=[],f;if(this.get("destroyOnRemoval"))for(f=0;f<b;f++)e.push(d.objectAt(f+a));d&&d.replace(a,b,c);f=0;for(a=e.length;f<a;f++)e[f].destroy();return this},indexOf:function(a,b){var c=this._scac_observableContent();return c?c.indexOf(a,b):-1},init:function(){arguments.callee.base.apply(this,arguments);this._scac_contentDidChange()},_scac_cached:NO,_scac_observableContent:function(){var a=this._scac_cached;if(a!==NO)return a;var b=this.get("content"),c,d,e;if(SC.none(b))return this._scac_cached=
+[];if(!b.isEnumerable)return this._scac_cached=a=this.get("allowsSingleContent")?[b]:[];c=this.get("orderBy");if(!c)if(b.isSCArray)return this._scac_cached=b;else throw"%@.orderBy is required for unordered content".fmt(this);switch(SC.typeOf(c)){case SC.T_STRING:c=[c];break;case SC.T_FUNCTION:d=c;break;case SC.T_ARRAY:break;default:throw"%@.orderBy must be Array, String, or Function".fmt(this);}if(!d){e=c.get("length");d=function(f,g){var h=0,j=0,k,l;for(h=0;h<e&&j===0;h++){k=c.objectAt(h);l=NO;if(k.indexOf("ASC")>
+-1)k=k.split("ASC ")[1];else if(k.indexOf("DESC")>-1){k=k.split("DESC ")[1];l=YES}j=f?f.isObservable?f.get(k):f[k]:f;k=g?g.isObservable?g.get(k):g[k]:g;j=SC.compare(j,k);if(l)j=-1*j}return j}}a=[];b.forEach(function(f){a.push(f)});a.sort(d);d=null;return this._scac_cached=a},_scac_contentDidChange:function(){this._scac_cached=NO;var a=this.get("content"),b=!!this.get("orderBy"),c=this._scac_content,d=this._scac_length||0,e=this._scac_rangeObserver,f=this._scac_rangeDidChange,g=this._scac_enumerableDidChange,
+h=this._scac_contentStatusDidChange;if(c===a)return this;if(c){if(e&&c.isSCArray)c.removeRangeObserver(e);else c.isEnumerable&&c.removeObserver("[]",this,g);c.removeObserver("status",this,h)}e=null;this._scac_cached=NO;if(this._scac_content=a){if(!b&&a.isSCArray)e=a.addRangeObserver(null,this,f);else a.isEnumerable&&a.addObserver("[]",this,g);b=a.isEnumerable?a.get("length"):1;a.addObserver("status",this,h)}else b=SC.none(a)?0:1;this._scac_rangeObserver=e;this._scac_length=b;this._scac_contentStatusDidChange();
+this.enumerableContentDidChange(0,b,b-d);this.updateSelectionAfterContentChange()}.observes("content"),_scac_enumerableDidChange:function(){var a=this.get("content");a=a?a.get("length"):0;var b=this._scac_length;this._scac_length=a;this.beginPropertyChanges();this._scac_cached=NO;this.enumerableContentDidChange(0,a,a-b);this.endPropertyChanges();this.updateSelectionAfterContentChange()}.observes("orderBy"),_scac_rangeDidChange:function(a,b,c,d){if(c==="[]"){this._scac_length=this.get("content").get("length");
+this._scac_cached=NO;if(d){this.beginPropertyChanges();d.forEachRange(function(e,f){this.enumerableContentDidChange(e,f,0)},this);this.endPropertyChanges();this.updateSelectionAfterContentChange()}}},_scac_contentStatusDidChange:function(){this.notifyPropertyChange("status")}});sc_require("controllers/controller");
+SC.ObjectController=SC.Controller.extend({content:null,allowsMultipleContent:NO,hasContent:function(){return!SC.none(this.get("observableContent"))}.property("observableContent"),isEditable:YES,observableContent:function(){var a=this.get("content"),b,c;if(a&&a.isEnumerable){b=a.get("length");c=this.get("allowsMultipleContent");if(b===1)a=a.firstObject();else if(b===0||!c)a=null;if(a&&!c&&a.isEnumerable)a=null}return a}.property("content","allowsMultipleContent").cacheable(),destroy:function(){var a=
+this.get("observableContent");a&&SC.typeOf(a.destroy)===SC.T_FUNCTION&&a.destroy();this.set("content",null);return this},contentPropertyDidChange:function(a,b){b==="*"?this.allPropertiesDidChange():this.notifyPropertyChange(b)},unknownProperty:function(a,b){if(a==="content"){if(b!==undefined)this.content=b;return this.content}var c=this.get("observableContent"),d;if(!(c===null||c===undefined)){if(b===undefined)if(c.isEnumerable){b=c.getEach(a);a=b.get("length");if(a>0){d=YES;for(c=b.objectAt(0);--a>
+0&&d;)if(c!==b.objectAt(a))d=NO;if(d)b=c}else b=undefined}else b=c.isObservable?c.get(a):c[a];else{if(!this.get("isEditable"))throw"%@.%@ is not editable".fmt(this,a);if(c.isEnumerable)c.setEach(a,b);else if(c.isObservable)c.set(a,b);else c[a]=b}return b}},init:function(){arguments.callee.base.apply(this,arguments);this.get("content")&&this._scoc_contentDidChange();this.get("observableContent")&&this._scoc_observableContentDidChange()},_scoc_contentDidChange:function(){var a=this._scoc_content,b=
+this.get("content");if(a!==b){this._scoc_content=b;var c=this._scoc_enumerableContentDidChange;a&&a.isEnumerable&&a.removeObserver("[]",this,c);b&&b.isEnumerable&&b.addObserver("[]",this,c)}}.observes("content"),_scoc_observableContentDidChange:function(){var a=this._scoc_observableContent,b=this.get("observableContent"),c=this.contentPropertyDidChange,d=this._scoc_enumerableContentDidChange;if(a===b)return this;this._scoc_observableContent=b;if(a)if(a.isEnumerable)a.removeObserver("[]",this,d);else a.isObservable&&
+a.removeObserver("*",this,c);if(b)if(b.isEnumerable)b.addObserver("[]",this,d);else b.isObservable&&b.addObserver("*",this,c);a&&a.isEnumerable||b&&b.isEnumerable?this._scoc_enumerableContentDidChange():this.contentPropertyDidChange(b,"*")}.observes("observableContent"),_scoc_enumerableContentDidChange:function(){var a=this.get("observableContent"),b=this._scoc_observableContentItems,c=this.contentPropertyDidChange;if(b){b.forEach(function(d){d.isObservable&&d.removeObserver("*",this,c)},this);b.clear()}if(a&&
+a.isEnumerable){b||(b=SC.Set.create());a.forEach(function(d){if(!b.contains(d)){b.add(d);d.isObservable&&d.addObserver("*",this,c)}},this)}else b=null;this._scoc_observableContentItems=b;this.contentPropertyDidChange(a,"*");return this}});
+SC.TreeItemContent={isTreeItemContent:YES,treeItemChildren:null,treeItemIsExpanded:YES,treeItemIsGrouped:NO,treeItemDisclosureState:function(){return this.get("treeItemIsExpanded")?SC.BRANCH_OPEN:SC.BRANCH_CLOSED},treeItemCollapse:function(){this.setIfChanged("treeItemIsExpanded",NO)},treeItemExpand:function(){this.setIfChanged("treeItemIsExpanded",YES)},treeItemBranchIndexes:function(){var a=this.get("treeItemChildren"),b,c,d,e;if(!a)return null;b=SC.IndexSet.create();c=a.get("length");for(d=0;d<
+c;d++)if(e=a.objectAt(d))e.get("treeItemChildren")&&e.treeItemDisclosureState(this,d)!==SC.LEAF_NODE&&b.add(d);return b.get("length")>0?b:null}};SC.BRANCH_OPEN=17;SC.BRANCH_CLOSED=18;SC.LEAF_NODE=32;
+SC.CollectionContent={isCollectionContent:YES,contentIndexIsSelected:function(a,b,c){return(a=a.get("selection"))?a.contains(b,c):NO},contentIndexIsEnabled:function(a){return a.get("isEnabled")},contentGroupIndexes:function(){return null},contentIndexIsGroup:function(){return NO},contentIndexOutlineLevel:function(){return-1},contentIndexDisclosureState:function(){return SC.LEAF_NODE},contentIndexExpand:function(a,b,c){SC.Logger.log("contentIndexExpand(%@, %@, %@)".fmt(a,b,c))},contentIndexCollapse:function(a,
+b,c){SC.Logger.log("contentIndexCollapse(%@, %@, %@)".fmt(a,b,c))}};sc_require("mixins/tree_item_content");sc_require("mixins/collection_content");
+SC.TreeItemObserver=SC.Object.extend(SC.Array,SC.CollectionContent,{item:null,delegate:null,parentObserver:null,parentItem:function(){var a=this.get("parentObserver");return a?a.get("item"):null}.property("parentObserver").cacheable(),index:null,outlineLevel:0,children:null,disclosureState:SC.BRANCH_OPEN,branchIndexes:function(){var a=this.get("item"),b,c,d,e,f;if(a)if(a.isTreeItemContent){c=this.get("parentItem");d=this.get("index");return a.treeItemBranchIndexes(c,d)}else{e=this.get("children");
+if(!e)return null;f=SC.IndexSet.create();b=e.get("length");c=a;for(d=0;d<b;d++)if(a=e.objectAt(d))this._computeChildren(a,c,d)&&this._computeDisclosureState(a,c,d)!==SC.LEAF_NODE&&f.add(d);return f.get("length")>0?f:null}else return SC.IndexSet.EMPTY}.property("children").cacheable(),isHeaderVisible:function(){return!!this.get("parentObserver")}.property("parentObserver").cacheable(),length:0,objectAt:function(a){var b=this.get("length"),c=this.get("item"),d=this._objectAtCache,e=a,f;if(!(a>=b)){if(this.get("isHeaderVisible"))if(a===
+0)return c;else e--;c=null;if(!d)d=this._objectAtCache=[];if((c=d[a])!==undefined)return c;if(f=this.get("children")){if(b=this.get("branchIndexes"))b.forEach(function(g){if(!(c||g>e)){var h=this.branchObserverAt(g),j;if(h){j=h.get("length");if(g+j>e){c=h.objectAt(e-g);e=-1}else e-=j-1}}},this);if(e>=0)c=f.objectAt(e);return d[a]=c}}},replace:function(a,b,c,d){var e=a,f=null,g,h;if(d===undefined)d=SC.DROP_BEFORE;this.get("isHeaderVisible")&&e--;if(e<0)throw"Tree Item cannot replace itself";if(a=this.get("branchIndexes"))a.forEach(function(j){if(!(f||
+j>=e))if(f=this.branchObserverAt(j)){g=f.get("length");if(j+g===e&&d===SC.DROP_AFTER)e-=j;else if(j+g>e)e-=j;else{e-=g-1;f=null}}},this);if(f){f.replace(e,b,c,d);return this}h=e+b;b>1&&a&&a.forEachIn(e,a.get("max")-e,function(j){if(!(j>h))if(f=this.branchObserverAt(j)){g=f.get("length");h-=g-1}},this);b=h-e;a=this.get("children");if(!a)throw"cannot replace() tree item with no children";if(b<0||h>a.get("length"))throw"replace() range must lie within a single tree item";a.replace(e,b,c,d);return this},
+observerContentDidChange:function(a,b,c){this.invalidateBranchObserversAt(a);this._disclosureStateCache=this._objectAtCache=this._outlineLevelCache=null;this._contentGroupIndexes=NO;this.notifyPropertyChange("branchIndexes");var d=this.get("length"),e=this._computeLength();c=this.get("parentObserver");d!==e&&this.set("length",e);if(!this._notifyParent)return this;if(c){a=SC.IndexSet.create(this.get("index"));c._childrenRangeDidChange(c.get("children"),null,"[]",a)}else{if(d===e){b=this.expandChildIndex(a+
+b);a=this.expandChildIndex(a);b-=a;c=0}else{a=this.expandChildIndex(a);b=e-a;c=e-d}this.enumerableContentDidChange(a,b,c)}},expandChildIndex:function(a){var b=a;this.get("isHeaderVisible")&&a++;var c=this.get("branchIndexes");if(!c||c.get("length")===0)return b;c.forEachIn(0,a,function(d){b+=this.branchObserverAt(d).get("length")-1},this);return b},_contentGroupIndexes:NO,contentGroupIndexes:function(a,b){if(b!==this)return null;var c=this._contentGroupIndexes;if(c!==NO)return c;if(this.get("parentObserver"))return null;
+a=this.get("item");var d,e;if(a&&a.isTreeItemContent?a.get("treeItemIsGrouped"):!!this.delegate.get("treeItemIsGrouped")){c=SC.IndexSet.create();a=this.get("branchIndexes");b=(b=this.get("children"))?b.get("length"):0;d=e=0;a&&a.forEach(function(f){c.add(d,f+1-e);d+=f+1-e;e=f+1;if(f=this.branchObserverAt(f))d+=f.get("length")-1},this);e<b&&c.add(d,b-e)}else c=null;return this._contentGroupIndexes=c},contentIndexIsGroup:function(a,b,c){return(a=this.contentGroupIndexes(a,b))?a.contains(c):NO},contentIndexOutlineLevel:function(a,
+b,c){if(b!==this)return-1;if((b=this._outlineLevelCache)&&b[c]!==undefined)return b[c];if(!b)b=this._outlineLevelCache=[];var d=this.get("length"),e=c,f=null;if(c>=d)return-1;if(this.get("isHeaderVisible"))if(c===0)return b[0]=this.get("outlineLevel")-1;else e--;if(d=this.get("branchIndexes"))d.forEach(function(g){if(!(f!==null||g>e)){var h=this.branchObserverAt(g),j;if(h){j=h.get("length");if(g+j>e){f=h.contentIndexOutlineLevel(a,h,e-g);e=-1}else e-=j-1}}},this);if(e>=0)f=this.get("outlineLevel");
+return b[c]=f},contentIndexDisclosureState:function(a,b,c){if(b!==this)return-1;if((b=this._disclosureStateCache)&&b[c]!==undefined)return b[c];if(!b)b=this._disclosureStateCache=[];var d=this.get("length"),e=c,f=null;if(c>=d)return SC.LEAF_NODE;if(this.get("isHeaderVisible"))if(c===0)return b[0]=this.get("disclosureState");else e--;if(d=this.get("branchIndexes"))d.forEach(function(g){if(!(f!==null||g>e)){var h=this.branchObserverAt(g),j;if(h){j=h.get("length");if(g+j>e){f=h.contentIndexDisclosureState(a,
+h,e-g);e=-1}else e-=j-1}}},this);if(e>=0)f=SC.LEAF_NODE;return b[c]=f},contentIndexExpand:function(a,b,c){var d=c;if(b===this){if(this.get("isHeaderVisible"))if(c===0){this._expand(this.get("item"));return}else d--;if(b=this.get("branchIndexes"))b.forEach(function(e){if(!(e>=d)){var f=this.branchObserverAt(e),g;if(f){g=f.get("length");if(e+g>d){f.contentIndexExpand(a,f,d-e);d=-1}else d-=g-1}}},this);if(d>=0)(b=(b=this.get("children"))?b.objectAt(d):null)&&this._expand(b,this.get("item"),d)}},contentIndexCollapse:function(a,
+b,c){var d=c;if(b===this){if(this.get("isHeaderVisible"))if(c===0){this._collapse(this.get("item"));return}else d--;if(b=this.get("branchIndexes"))b.forEach(function(e){if(!(e>=d)){var f=this.branchObserverAt(e),g;if(f){g=f.get("length");if(e+g>d){f.contentIndexCollapse(a,f,d-e);d=-1}else d-=g-1}}},this);if(d>=0)(b=(b=this.get("children"))?b.objectAt(d):null)&&this._collapse(b,this.get("item"),d)}},branchObserverAt:function(a){var b=this._branchObserversByIndex,c=this._branchObserverIndexes,d;if(!b)b=
+this._branchObserversByIndex=[];if(!c)c=this._branchObserverIndexes=SC.IndexSet.create();if(d=b[a])return d;d=(d=this.get("children"))?d.objectAt(a):null;if(!d)return null;b[a]=d=SC.TreeItemObserver.create({item:d,delegate:this.get("delegate"),parentObserver:this,index:a,outlineLevel:this.get("outlineLevel")+1});c.add(a);return d},invalidateBranchObserversAt:function(a){var b=this._branchObserversByIndex,c=this._branchObserverIndexes;if(!b||b.length<=a)return this;if(a<0)a=0;c.forEachIn(a,c.get("max")-
+a,function(d){(d=b[d])&&d.destroy()},this);b.length=a;return this},init:function(){arguments.callee.base.apply(this,arguments);var a=this.get("item");if(!a)throw"SC.TreeItemObserver.item cannot be null";a.addObserver("*",this,this._itemPropertyDidChange);this._itemPropertyDidChange(a,"*");this._notifyParent=YES},destroy:function(){this.invalidateBranchObserversAt(0);this._objectAtCache=null;var a=this.get("item");a&&a.removeObserver("*",this,this._itemPropertyDidChange);a=this._children;var b=this._childrenRangeObserver;
+a&&b&&a.removeRangeObserver(b);arguments.callee.base.apply(this,arguments)},_itemPropertyDidChange:function(){var a=this.get("children"),b=this.get("disclosureState"),c=this.get("item"),d;this.beginPropertyChanges();d=this._computeDisclosureState(c);b!==d&&this.set("disclosureState",d);d=this._computeChildren(c);a!==d&&this.set("children",d);this.endPropertyChanges()},_childrenDidChange:function(){var a=this.get("disclosureState")===SC.BRANCH_OPEN?this.get("children"):null,b=this._children,c=this._childrenRangeObserver;
+if(b===a)return this;c&&b.removeRangeObserver(c);this._childrenRangeObserver=a?a.addRangeObserver(null,this,this._childrenRangeDidChange):null;this._children=a;this._childrenRangeDidChange(a,null,"[]",null)}.observes("children","disclosureState"),_childrenRangeDidChange:function(a,b,c,d){a=(a=this.get("children"))?a.get("length"):0;b=d?d.get("min"):0;d=d?d.get("max"):a;c=this._childrenLen||0;this._childrenLen=a;this.observerContentDidChange(b,d-b,a-c)},_computeDisclosureState:function(a,b,c){if(!a||
+!this._computeChildren(a))return SC.LEAF_NODE;else if(a.isTreeItemContent){if(b===undefined)b=this.get("parentItem");if(c===undefined)c=this.get("index");return a.treeItemDisclosureState(b,c)}else{b=this._treeItemIsExpandedKey;if(!b)this._treeItemIsExpandedKey=b=(b=this.get("delegate"))?b.get("treeItemIsExpandedKey"):"treeItemIsExpanded";return a.get(b)?SC.BRANCH_OPEN:SC.BRANCH_CLOSED}},_collapse:function(a,b,c){if(!a||!this._computeChildren(a))return this;else if(a.isTreeItemContent){if(b===undefined)b=
+this.get("parentItem");if(c===undefined)c=this.get("index");a.treeItemCollapse(b,c)}else{b=this._treeItemIsExpandedKey;if(!b)this._treeItemIsExpandedKey=b=(b=this.get("delegate"))?b.get("treeItemIsExpandedKey"):"treeItemIsExpanded";a.setIfChanged(b,NO)}return this},_expand:function(a,b,c){if(!a||!this._computeChildren(a))return this;else if(a.isTreeItemContent){if(b===undefined)b=this.get("parentItem");if(c===undefined)c=this.get("index");a.treeItemExpand(b,c)}else{b=this._treeItemIsExpandedKey;if(!b)this._treeItemIsExpandedKey=
+b=(b=this.get("delegate"))?b.get("treeItemIsExpandedKey"):"treeItemIsExpanded";a.setIfChanged(b,YES)}return this},_computeChildren:function(a){var b;if(a)if(a.isTreeItemContent)return a.get("treeItemChildren");else{b=this._treeItemChildrenKey;if(!b)this._treeItemChildrenKey=b=(b=this.get("delegate"))?b.get("treeItemChildrenKey"):"treeItemChildren";return a.get(b)}else return null},_computeLength:function(){var a=this.get("isHeaderVisible")?1:0,b=this.get("disclosureState"),c=this.get("children");
+if(b===SC.BRANCH_OPEN&&c){a+=c.get("length");if(b=this.get("branchIndexes"))b.forEach(function(d){d=this.branchObserverAt(d);a+=d.get("length")-1},this)}return a}});sc_require("controllers/object");sc_require("mixins/selection_support");sc_require("private/tree_item_observer");
+SC.TreeController=SC.ObjectController.extend(SC.SelectionSupport,{treeItemIsGrouped:NO,treeItemIsExpandedKey:"treeItemIsExpanded",treeItemChildrenKey:"treeItemChildren",arrangedObjects:function(){var a;return this._sctc_arrangedObjects=a=(a=this.get("content"))?SC.TreeItemObserver.create({item:a,delegate:this}):null}.property().cacheable(),_sctc_invalidateArrangedObjects:function(){this.propertyWillChange("arrangedObjects");var a=this._sctc_arrangedObjects;a&&a.destroy();this._sctc_arrangedObjects=
+null;this.propertyDidChange("arrangedObjects")}.observes("content","treeItemIsExpandedKey","treeItemChildrenKey","treeItemIsGrouped"),_sctc_arrangedObjectsContentDidChange:function(){this.updateSelectionAfterContentChange()}.observes("*arrangedObjects.[]"),firstSelectableObject:function(){var a=this.get("arrangedObjects"),b,c,d=0;if(!a)return null;b=a.contentGroupIndexes(null,a);for(c=a.get("length");b.contains(d)&&d<c;)d++;return d>=c?null:a.objectAt(d)}.property()});
+SC.mixin(SC.Object.prototype,{invokeLater:function(a,b){if(b===undefined)b=1;var c=a,d,e;if(arguments.length>2){d=SC.$A(arguments).slice(2);if(SC.typeOf(c)===SC.T_STRING)c=this[a];e=c;c=function(){return e.apply(this,d)}}return SC.Timer.schedule({target:this,action:c,interval:b})},invokeWith:function(a,b,c){if(c===undefined){c=b;b=this}b||(b=this);if(SC.typeOf(c)===SC.T_STRING)c=b[c];a=this.getPath(a);c.call(b,a,this);return this}});
+SC.RunLoop=SC.RunLoop.extend({startTime:function(){if(!this._start)this._start=Date.now();return this._start}.property(),endRunLoop:function(){this.fireExpiredTimers();var a=arguments.callee.base.apply(this,arguments);this.scheduleNextTimeout();return a},scheduleTimer:function(a,b){this._timerQueue=a.removeFromTimerQueue(this._timerQueue);this._timerQueue=a.scheduleInTimerQueue(this._timerQueue,b);return this},cancelTimer:function(a){this._timerQueue=a.removeFromTimerQueue(this._timerQueue);return this},
+TIMER_ARRAY:[],fireExpiredTimers:function(){if(!this._timerQueue||this._firing)return NO;var a=this.get("startTime"),b=this.TIMER_ARRAY,c;this._firing=YES;this._timerQueue=this._timerQueue.collectExpiredTimers(b,a);c=b.length;for(a=0;a<c;a++)b[a].fire();a=b.length>0;b.length=0;this._firing=NO;return a},scheduleNextTimeout:function(){var a=this._timerQueue,b=NO;if(a){a=a._timerQueueRunTime;if(this._timeoutAt!==a){this._timeout&&clearTimeout(this._timeout);b=Math.max(0,a-Date.now());this._timeout=setTimeout(this._timeoutDidFire,
+b);this._timeoutAt=a}b=YES}else this._timeout&&clearTimeout(this._timeout);return b},_timeoutDidFire:function(){var a=SC.RunLoop.currentRunLoop;a._timeout=a._timeoutAt=null;SC.RunLoop.begin().end()}});SC.RunLoop.currentRunLoop=SC.RunLoop.create();
+SC.Button={value:null,toggleOnValue:YES,toggleOffValue:NO,localize:NO,localizeBindingDefault:SC.Binding.bool(),title:"",contentTitleKey:null,icon:null,contentIconKey:null,needsEllipsis:YES,displayTitle:function(){var a=this.get("title");return a&&this.get("localize")?a.loc():a||""}.property("title","localize").cacheable(),keyEquivalent:null,renderTitle:function(a,b){var c=this.get("icon"),d="",e=this.get("displayTitle"),f=!SC.none(e)&&e.length>0;if(this.get("escapeHTML"))e=SC.RenderContext.escapeHTML(e);
+if(c){f=SC.BLANK_IMAGE_URL;d=c.indexOf("/")>=0?'<img src="'+c+'" alt="" class="icon" />':'<img src="'+f+'" alt="" class="'+c+'" />';f=YES}c=d+e;if(b){this.get("needsEllipsis")?a.push('<label class="sc-button-label ellipsis">'+c+"</label>"):a.push('<label class="sc-button-label">'+c+"</label>");this._ImageTitleCached=c}else{b=this.$("label");if(e=b[0])if(f){this.get("needsEllipsis")?b.addClass("ellipsis"):b.removeClass("ellipsis");if(this._ImageTitleCached!==c){this._ImageTitleCached=c;e.innerHTML=
+c}}else e.innerHTML=""}return a},contentPropertyDidChange:function(a,b){var c=this.get("displayDelegate");a=this.get("content");var d=this.getDelegateProperty("contentValueKey",c);if(d&&(b===d||b==="*"))this.set("value",a?a.get(d):null);if((d=this.getDelegateProperty("contentTitleKey",c))&&(b===d||b==="*"))this.set("title",a?a.get(d):null);if((c=this.getDelegateProperty("contentIconKey",c))&&(b===c||b==="*"))this.set("icon",a?a.get(c):null);return this},_button_displayObserver:function(){this.displayDidChange()}.observes("title",
+"icon","value"),performKeyEquivalent:function(a,b){if(!this.get("isEnabled"))return NO;var c=this.get("keyEquivalent");if(c){if(c===a)return this.triggerAction(b)}else if(this.get("isDefault")&&a==="return"||this.get("isCancel")&&a==="escape")return this.triggerAction(b);return NO},triggerAction:function(){throw"SC.Button.triggerAction() is not defined in %@".fmt(this);},computeIsSelectedForValue:function(a){var b=this.get("toggleOnValue"),c,d;if(SC.typeOf(a)===SC.T_ARRAY)if(a.length===1)c=a[0]==
+b;else{c=null;a.find(function(e){d=e==b;if(c===null)c=d;else if(d!==c)c=SC.MIXED_STATE;return c===SC.MIXED_STATE})}else c=a===SC.MIXED_STATE?SC.MIXED_STATE:a==b;return c},initMixin:function(){SC.none(this.get("value"))||this._button_valueDidChange()},_button_valueDidChange:function(){this.set("isSelected",this.computeIsSelectedForValue(this.get("value")))}.observes("value"),_button_isSelectedDidChange:function(){var a=this.get("isSelected"),b=this.computeIsSelectedForValue(this.get("value"));if(a!==
+SC.MIXED_STATE&&b!==a)this.set("value",this.get(a?"toggleOnValue":"toggleOffValue"))}.observes("isSelected")};
+SC.ContentDisplay={concatenatedProperties:"contentDisplayProperties",displayProperties:["content"],contentDisplayProperties:[],_display_contentDidChange:function(a,b,c){if((c=this.get("content"))!=this._display_content){a=this._display_contentPropertyDidChange;if(b=this._display_content)if(SC.isArray(b))b.invoke("removeObserver","*",this,a);else b.removeObserver&&b.removeObserver("*",this,a);if(b=this._display_content=c)if(SC.isArray(b))b.invoke("addObserver","*",this,a);else b.addObserver&&b.addObserver("*",
+this,a);this.allPropertiesDidChange();this.endPropertyChanges()}}.observes("content","contentDisplayProperties"),_display_contentPropertyDidChange:function(a,b){if(b==="*")this.displayDidChange();else(a=this.get("contentDisplayProperties"))&&a.indexOf(b)>=0&&this.displayDidChange()}};sc_require("system/locale");SC.STRING_TITLEIZE_REGEXP=/([\s|\-|\_|\n])([^\s|\-|\_|\n]?)/g;SC.STRING_DECAMELIZE_REGEXP=/([a-z])([A-Z])/g;SC.STRING_DASHERIZE_REGEXP=/[ _]/g;SC.STRING_HUMANIZE_REGEXP=/[\-_]/g;
+SC.STRING_TRIM_REGEXP=/^\s+|\s+$/g;SC.STRING_TRIM_LEFT_REGEXP=/^\s+/g;SC.STRING_TRIM_RIGHT_REGEXP=/\s+$/g;SC.STRING_REGEXP_ESCAPED_REGEXP=/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g;
+SC.String={loc:function(){SC.Locale.currentLocale||SC.Locale.createCurrentLocale();var a=SC.Locale.currentLocale.locWithDefault(this)||this;return a.fmt.apply(a,arguments)},locWithDefault:function(a){SC.Locale.currentLocale||SC.Locale.createCurrentLocale();var b=SC.Locale.currentLocale.locWithDefault(a)||this,c=SC.$A(arguments);c.shift();return b.fmt.apply(b,c)},capitalize:function(){return this.charAt(0).toUpperCase()+this.slice(1)},capitalizeEach:function(){return this.replace(SC.STRING_TITLEIZE_REGEXP,
+function(a,b,c){return c?b+c.toUpperCase():b}).capitalize()},titleize:function(){return this.replace(SC.STRING_DECAMELIZE_REGEXP,"$1_$2").replace(SC.STRING_TITLEIZE_REGEXP,function(a,b,c){return c?" "+c.toUpperCase():" "}).capitalize()},camelize:function(){var a=this.replace(SC.STRING_TITLEIZE_REGEXP,function(d,e,f){return f?f.toUpperCase():""}),b=a.charAt(0),c=b.toLowerCase();return b!==c?c+a.slice(1):a},classify:function(){var a=this.replace(SC.STRING_TITLEIZE_REGEXP,function(d,e,f){return f?f.toUpperCase():
+""}),b=a.charAt(0),c=b.toUpperCase();return b!==c?c+a.slice(1):a},decamelize:function(){return this.replace(SC.STRING_DECAMELIZE_REGEXP,"$1_$2").toLowerCase()},dasherize:function(){return this.decamelize().replace(SC.STRING_DASHERIZE_REGEXP,"-")},humanize:function(){return this.decamelize().replace(SC.STRING_HUMANIZE_REGEXP," ")},escapeForRegExp:function(){return this.replace(SC.STRING_REGEXP_ESCAPED_REGEXP,"\\$1")},removeDiacritics:function(){var a=SC.diacriticMappingTable;if(!a){SC.diacriticMappingTable=
+{"\u00c0":"A","\u00c1":"A","\u00c2":"A","\u00c3":"A","\u00c4":"A","\u00c5":"A","\u0100":"A","\u0102":"A","\u0104":"A","\u01cd":"A","\u01de":"A","\u01e0":"A","\u01fa":"A","\u0200":"A","\u0202":"A","\u0226":"A","\u1e00":"A","\u1ea0":"A","\u1ea2":"A","\u1ea4":"A","\u1ea6":"A","\u1ea8":"A","\u1eaa":"A","\u1eac":"A","\u1eae":"A","\u1eb0":"A","\u1eb2":"A","\u1eb4":"A","\u1eb6":"A","\u212b":"A","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u00c7":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u1e08":"C",
+"\u010e":"D","\u1e0a":"D","\u1e0c":"D","\u1e0e":"D","\u1e10":"D","\u1e12":"D","\u00c8":"E","\u00c9":"E","\u00ca":"E","\u00cb":"E","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u0228":"E","\u1e14":"E","\u1e16":"E","\u1e18":"E","\u1e1a":"E","\u1e1c":"E","\u1eb8":"E","\u1eba":"E","\u1ebc":"E","\u1ebe":"E","\u1ec0":"E","\u1ec2":"E","\u1ec4":"E","\u1ec6":"E","\u1e1e":"F","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u01e6":"G","\u01f4":"G","\u1e20":"G",
+"\u0124":"H","\u021e":"H","\u1e22":"H","\u1e24":"H","\u1e26":"H","\u1e28":"H","\u1e2a":"H","\u00cc":"I","\u00cd":"I","\u00ce":"I","\u00cf":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1e2c":"I","\u1e2e":"I","\u1ec8":"I","\u1eca":"I","\u0134":"J","\u0136":"K","\u01e8":"K","\u1e30":"K","\u1e32":"K","\u1e34":"K","\u0139":"L","\u013b":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u1e3a":"L","\u1e3c":"L","\u1e3e":"M","\u1e40":"M","\u1e42":"M",
+"\u00d1":"N","\u0143":"N","\u0145":"N","\u0147":"N","\u01f8":"N","\u1e44":"N","\u1e46":"N","\u1e48":"N","\u1e4a":"N","\u00d2":"O","\u00d3":"O","\u00d4":"O","\u00d5":"O","\u00d6":"O","\u014c":"O","\u014e":"O","\u0150":"O","\u01a0":"O","\u01d1":"O","\u01ea":"O","\u01ec":"O","\u020c":"O","\u020e":"O","\u022a":"O","\u022c":"O","\u022e":"O","\u0230":"O","\u1e4c":"O","\u1e4e":"O","\u1e50":"O","\u1e52":"O","\u1ecc":"O","\u1ece":"O","\u1ed0":"O","\u1ed2":"O","\u1ed4":"O","\u1ed6":"O","\u1ed8":"O","\u1eda":"O",
+"\u1edc":"O","\u1ede":"O","\u1ee0":"O","\u1ee2":"O","\u1e54":"P","\u1e56":"P","\u0154":"R","\u0156":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e58":"R","\u1e5a":"R","\u1e5c":"R","\u1e5e":"R","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u0218":"S","\u1e60":"S","\u1e62":"S","\u1e64":"S","\u1e66":"S","\u1e68":"S","\u0162":"T","\u0164":"T","\u021a":"T","\u1e6a":"T","\u1e6c":"T","\u1e6e":"T","\u1e70":"T","\u00d9":"U","\u00da":"U","\u00db":"U","\u00dc":"U","\u0168":"U","\u016a":"U","\u016c":"U",
+"\u016e":"U","\u0170":"U","\u0172":"U","\u01af":"U","\u01d3":"U","\u01d5":"U","\u01d7":"U","\u01d9":"U","\u01db":"U","\u0214":"U","\u0216":"U","\u1e72":"U","\u1e74":"U","\u1e76":"U","\u1e78":"U","\u1e7a":"U","\u1ee4":"U","\u1ee6":"U","\u1ee8":"U","\u1eea":"U","\u1eec":"U","\u1eee":"U","\u1ef0":"U","\u1e7c":"V","\u1e7e":"V","\u0174":"W","\u1e80":"W","\u1e82":"W","\u1e84":"W","\u1e86":"W","\u1e88":"W","\u1e8a":"X","\u1e8c":"X","\u00dd":"Y","\u0176":"Y","\u0178":"Y","\u0232":"Y","\u1e8e":"Y","\u1ef2":"Y",
+"\u1ef4":"Y","\u1ef6":"Y","\u1ef8":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u1e90":"Z","\u1e92":"Z","\u1e94":"Z","\u1fef":"`","\u00e0":"a","\u00e1":"a","\u00e2":"a","\u00e3":"a","\u00e4":"a","\u00e5":"a","\u0101":"a","\u0103":"a","\u0105":"a","\u01ce":"a","\u01df":"a","\u01e1":"a","\u01fb":"a","\u0201":"a","\u0203":"a","\u0227":"a","\u1e01":"a","\u1ea1":"a","\u1ea3":"a","\u1ea5":"a","\u1ea7":"a","\u1ea9":"a","\u1eab":"a","\u1ead":"a","\u1eaf":"a","\u1eb1":"a","\u1eb3":"a","\u1eb5":"a","\u1eb7":"a",
+"\u1e03":"b","\u1e05":"b","\u1e07":"b","\u00e7":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u1e09":"c","\u010f":"d","\u1e0b":"d","\u1e0d":"d","\u1e0f":"d","\u1e11":"d","\u1e13":"d","\u00e8":"e","\u00e9":"e","\u00ea":"e","\u00eb":"e","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u0229":"e","\u1e15":"e","\u1e17":"e","\u1e19":"e","\u1e1b":"e","\u1e1d":"e","\u1eb9":"e","\u1ebb":"e","\u1ebd":"e","\u1ebf":"e","\u1ec1":"e","\u1ec3":"e","\u1ec5":"e",
+"\u1ec7":"e","\u1e1f":"f","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u01e7":"g","\u01f5":"g","\u1e21":"g","\u0125":"h","\u021f":"h","\u1e23":"h","\u1e25":"h","\u1e27":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u00ec":"i","\u00ed":"i","\u00ee":"i","\u00ef":"i","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1e2d":"i","\u1e2f":"i","\u1ec9":"i","\u1ecb":"i","\u0135":"j","\u01f0":"j","\u0137":"k","\u01e9":"k","\u1e31":"k","\u1e33":"k","\u1e35":"k",
+"\u013a":"l","\u013c":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u1e3b":"l","\u1e3d":"l","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u00f1":"n","\u0144":"n","\u0146":"n","\u0148":"n","\u01f9":"n","\u1e45":"n","\u1e47":"n","\u1e49":"n","\u1e4b":"n","\u00f2":"o","\u00f3":"o","\u00f4":"o","\u00f5":"o","\u00f6":"o","\u014d":"o","\u014f":"o","\u0151":"o","\u01a1":"o","\u01d2":"o","\u01eb":"o","\u01ed":"o","\u020d":"o","\u020f":"o","\u022b":"o","\u022d":"o","\u022f":"o","\u0231":"o","\u1e4d":"o","\u1e4f":"o",
+"\u1e51":"o","\u1e53":"o","\u1ecd":"o","\u1ecf":"o","\u1ed1":"o","\u1ed3":"o","\u1ed5":"o","\u1ed7":"o","\u1ed9":"o","\u1edb":"o","\u1edd":"o","\u1edf":"o","\u1ee1":"o","\u1ee3":"o","\u1e55":"p","\u1e57":"p","\u0155":"r","\u0157":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e59":"r","\u1e5b":"r","\u1e5d":"r","\u1e5f":"r","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0219":"s","\u1e61":"s","\u1e63":"s","\u1e65":"s","\u1e67":"s","\u1e69":"s","\u0163":"t","\u0165":"t","\u021b":"t","\u1e6b":"t",
+"\u1e6d":"t","\u1e6f":"t","\u1e71":"t","\u1e97":"t","\u00f9":"u","\u00fa":"u","\u00fb":"u","\u00fc":"u","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u01b0":"u","\u01d4":"u","\u01d6":"u","\u01d8":"u","\u01da":"u","\u01dc":"u","\u0215":"u","\u0217":"u","\u1e73":"u","\u1e75":"u","\u1e77":"u","\u1e79":"u","\u1e7b":"u","\u1ee5":"u","\u1ee7":"u","\u1ee9":"u","\u1eeb":"u","\u1eed":"u","\u1eef":"u","\u1ef1":"u","\u1e7d":"v","\u1e7f":"v","\u0175":"w","\u1e81":"w","\u1e83":"w",
+"\u1e85":"w","\u1e87":"w","\u1e89":"w","\u1e98":"w","\u1e8b":"x","\u1e8d":"x","\u00fd":"y","\u00ff":"y","\u0177":"y","\u0233":"y","\u1e8f":"y","\u1e99":"y","\u1ef3":"y","\u1ef5":"y","\u1ef7":"y","\u1ef9":"y","\u017a":"z","\u017c":"z","\u017e":"z","\u1e91":"z","\u1e93":"z","\u1e95":"z"};a=SC.diacriticMappingTable}for(var b,c,d="",e=this.length,f=0;f<=e;++f){b=this.charAt(f);c=a[b];d+=c?c:b}return d},trim:function(){return this.replace(SC.STRING_TRIM_REGEXP,"")},trimLeft:function(){return this.replace(SC.STRING_TRIM_LEFT_REGEXP,
+"")},trimRight:function(){return this.replace(SC.STRING_TRIM_RIGHT_REGEXP,"")}};SC.String.strip=SC.String.trim;SC.supplement(String.prototype,SC.String);String.prototype.loc=SC.String.loc;SC.String.fmt=String.prototype.fmt;sc_require("mixins/string");SC.MIXED_STATE="__MIXED__";SC.HUGE_CONTROL_SIZE="sc-huge-size";SC.LARGE_CONTROL_SIZE="sc-large-size";SC.REGULAR_CONTROL_SIZE="sc-regular-size";SC.SMALL_CONTROL_SIZE="sc-small-size";SC.TINY_CONTROL_SIZE="sc-tiny-size";
+SC.Control={initMixin:function(){this._control_contentDidChange()},isSelected:NO,isSelectedBindingDefault:SC.Binding.oneWay().bool(),isActive:NO,isActiveBindingDefault:SC.Binding.oneWay().bool(),value:null,content:null,contentValueKey:null,contentPropertyDidChange:function(a,b){return this.updatePropertyFromContent("value",b,"contentValueKey")},updatePropertyFromContent:function(a,b,c,d){var e=b==="*";if(c===undefined)c="content"+a.capitalize()+"Key";if(d===undefined)d=this.get("content");if((c=this[c]?
+this.get(c):this.getDelegateProperty(c,this.displayDelegate))&&(e||b===c)){b=d?d.get?d.get(c):d[c]:null;this.set(a,b)}return this},updateContentWithValueObserver:function(){var a=this.contentValueKey?this.get("contentValueKey"):this.getDelegateProperty("contentValueKey",this.displayDelegate),b=this.get("content");if(a&&b){var c=this.get("value");if(typeof b.setIfChanged===SC.T_FUNCTION)b.setIfChanged(a,c);else if(b[a]!==c)b[a]=c}}.observes("value"),fieldKey:null,fieldLabel:null,errorLabel:function(){var a,
+b;if(a=this.get("fieldLabel"))return a;a=this.get("fieldKey")||this.constructor.toString();b=(a||"").humanize().capitalize();return"ErrorLabel."+a.locWithDefault(("FieldKey."+a).locWithDefault(b))}.property("fieldLabel","fieldKey").cacheable(),controlSize:SC.REGULAR_CONTROL_SIZE,displayProperties:"isEnabled isSelected isActive controlSize".w(),_CONTROL_TMP_CLASSNAMES:{},renderMixin:function(a,b){var c=this.get("isSelected"),d=!this.get("isEnabled"),e=this._CONTROL_TMP_CLASSNAMES;e.mixed=c===SC.MIXED_STATE;
+e.sel=c&&c!==SC.MIXED_STATE;e.active=this.get("isActive");a.setClass(e).addClass(this.get("controlSize"));!b&&this.$input&&this.$input().attr("type")!=="radio"&&this.$input().attr("disabled",d)},_control_content:null,_control_contentDidChange:function(){var a=this.get("content");if(this._control_content!==a){var b=this.contentPropertyDidChange,c=this._control_content;c&&c.removeObserver&&c.removeObserver("*",this,b);(this._control_content=a)&&a.addObserver&&a.addObserver("*",this,b);this.contentPropertyDidChange(a,
+"*")}}.observes("content")};SC.Editable={isEditable:NO,isEditing:NO,beginEditing:function(){if(!this.get("isEditable"))return NO;if(this.get("isEditing"))return YES;this.set("isEditing",YES);this.becomeFirstResponder();return YES},discardEditing:function(){return!this.get("isEditing")},commitEditing:function(){if(!this.get("isEditing"))return YES;this.set("isEditing",NO);this.resignFirstResponder();return YES}};
+SC.browser=function(){var a=navigator.userAgent.toLowerCase(),b=(a.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];a={version:b,safari:/webkit/.test(a)?b:0,opera:/opera/.test(a)?b:0,msie:/msie/.test(a)&&!/opera/.test(a)?b:0,mozilla:/mozilla/.test(a)&&!/(compatible|webkit)/.test(a)?b:0,mobileSafari:/apple.*mobile.*safari/.test(a)?b:0,windows:!!/(windows)/.test(a),mac:!!(/(macintosh)/.test(a)||/(mac os x)/.test(a)),language:(navigator.language||navigator.browserLanguage).split("-",1)[0],touch:"createTouch"in
+document};SC.extend(a,{isOpera:!!a.opera,isIe:!!a.msie,isIE:!!a.msie,isSafari:!!a.safari,isMobileSafari:!!a.mobileSafari,isMozilla:!!a.mozilla,isWindows:!!a.windows,isMac:!!a.mac,current:a.msie?"msie":a.mozilla?"mozilla":a.safari?"safari":a.opera?"opera":"unknown",compareVersion:function(){if(this._versionSplit===undefined){function c(g){return Number(g.match(/^[0-9]+/))}this._versionSplit=SC.A(this.version.split(".")).map(c)}for(var d=SC.A(arguments).map(Number),e=0;e<d.length;e++){var f=this._versionSplit[e]-
+d[e];if(isNaN(f))return 0;if(f!==0)return f}return 0}});return a}();SC.Builder=function(a){return SC.Builder.create(a)};SC.Builder.create=function(a){var b=SC.mixin(SC.beget(this.fn),a||{});if(a.hasOwnProperty("toString"))b.toString=a.toString;var c=function(){var d=SC.beget(b);d.defaultClass=this;d.constructor=c;return d.init.apply(d,arguments)};c.fn=c.prototype=b;c.extend=SC.Builder.create;c.mixin=SC.Builder.mixin;return c};
+SC.Builder.mixin=function(){var a=arguments.length,b;for(b=0;b<a;b++)SC.mixin(this,arguments[b]);return this};
+SC.Builder.fn={init:function(a){if(a!==undefined)if(SC.typeOf(a)===SC.T_ARRAY){for(var b=a.length;--b>=0;)this[b]=a.objectAt?a.objectAt(b):a[b];this.length=a.length}else{this[0]=a;this.length=1}return this},size:function(){return this.length},pushStack:function(){var a=this.constructor.apply(this,arguments);a.prevObject=this;return a},end:function(){return this.prevObject||this.constructor()},toString:function(){return"%@$(%@)".fmt(this.defaultClass.toString(),SC.A(this).invoke("toString").join(","))},
+mixin:SC.Builder.mixin};(function(){var a=SC.Enumerable,b=SC.Builder.fn,c,d;for(c in a)if(a.hasOwnProperty(c)){d=Array.prototype[c]||a[c];b[c]=d}})();sc_require("system/builder");
+SC.CoreQuery=function(){function a(p,u){return p[0]&&parseInt(z.curCSS(p[0],u,true),10)||0}var b=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,c=/^.[^:#\[\.]*$/,d=/ CQ\d+="(?:\d+|null)"/g,e=/(<(\w+)[^>]*?)\/>/g,f=/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i,g=/\s+/,h=/^\s+/,j=/^body|html$/i,k=/href|src|style/,l=/(button|input|object|select|textarea)/i,m=/alpha\([^)]*\)/,n=/opacity=([^)]*)/,o=SC.browser.msie?"styleFloat":"cssFloat",q=SC.browser.safari&&parseInt(SC.browser.version,0)<417?"(?:[\\w*_-]|\\\\.)":
+"(?:[\\w\u0128-\uffff*_-]|\\\\.)",t=new RegExp("^([#.]?)("+q+"*)"),r=new RegExp("([#.]?)("+q+"*)","g"),s=["Left","Right"],v=["Top","Bottom"],w={position:"absolute",visibility:"hidden",display:"block"},y=function(p,u,A){u=u==="width"?p.offsetWidth:p.offsetHeight;for(var C=0,B=0,F=A.length,G;--F>=0;){G=A[F];C+=parseFloat(z.curCSS(p,"padding"+G,true))||0;B+=parseFloat(z.curCSS(p,"border"+G+"Width",true))||0}u-=Math.round(C+B);return u},x=/z-?index|font-?weight|opacity|zoom|line-?height/i,D=document.defaultView||
+{},E=function(p){if(!SC.browser.safari)return false;p=D.getComputedStyle(p,null);return!p||p.getPropertyValue("color")===""},z;z=q=SC.Builder.create({jquery:"SC.CoreQuery",init:function(p,u){p=p||document;if(p.nodeType){this[0]=p;this.length=1;return this}else if(typeof p==="string"){var A=b.exec(p);if(A&&(A[1]||!u))if(A[1])p=z.clean([A[1]],u);else{if(u=document.getElementById(A[3])){if(u.id!=A[3])return z().find(p);return z(u)}p=[]}else return z(u).find(p)}else if(SC.typeOf(p)===SC.T_FUNCTION)return SC.ready(p);
+return this.setArray(z.makeArray(p))},size:function(){return this.length},get:function(p){return p===undefined?z.makeArray(this):this[p]},find:function(p){return this.pushStack(z.map(this,function(u){return z.find(p,u)}))},filter:function(p){return this.pushStack(SC.typeOf(p)===SC.T_FUNCTION&&z.grep(this,function(u,A){return p.call(u,A)})||z.multiFilter(p,this))},not:function(p){if(typeof p==="string")if(c.test(p))return this.pushStack(z.multiFilter(p,this,true));else p=z.multiFilter(p,this);var u=
+p.length&&p[p.length-1]!==undefined&&!p.nodeType;return this.filter(function(){return u?z.inArray(this,p)<0:this!=p})},setArray:function(p){this.length=0;Array.prototype.push.apply(this,p);return this},map:function(p){return this.pushStack(z.map(this,function(u,A){return p.call(u,A,u)}))},each:function(p,u){return z.each(this,p,u)},index:function(p){if(p&&p.jquery)p=p[0];return Array.prototype.indexOf.call(this,p)},eq:function(p){return this.slice(p,+p+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,
+arguments))},add:function(p){return this.pushStack(z.merge(this.get(),typeof p==="string"?z(p):z.makeArray(p)).uniq())},attr:function(p,u,A){var C=p;if(typeof p==="string")if(u===undefined)return this[0]&&z[A||"attr"](this[0],p);else{C={};C[p]=u}return this.each(function(B){for(p in C)z.attr(A?this.style:this,p,z.prop(this,C[p],A,B,p))})},html:function(p){return p===undefined?this[0]?this[0].innerHTML.replace(d,""):null:this.empty().append(p)},andSelf:function(){return this.add(this.prevObject)},
+is:function(p){return!!p&&z.multiFilter(p,this).length>0},hasClass:function(p){return Array.prototype.every.call(this,function(u){return u.nodeType===1&&z.className.has(u,p)})},val:function(p){if(p===undefined){var u=this[0];if(u){if(z.nodeName(u,"option"))return(u.attributes.value||{}).specified?u.value:u.text;if(z.nodeName(u,"select")){var A=u.selectedIndex,C=[],B=u.options;u=u.type==="select-one";if(A<0)return null;var F,G=u?A+1:B.length;for(F=u?A:0;F<G;F++){A=B[F];if(A.selected){p=z(A).val();
+if(u)return p;C.push(p)}}return C}return(u.value||"").replace(/\r/g,"")}}else{if(typeof p==="number")p+="";this.each(function(){if(this.nodeType===1)if(SC.typeOf(p)===SC.T_ARRAY&&/radio|checkbox/.test(this.type))this.checked=z.inArray(this.value,p)>=0||z.inArray(this.name,p)>=0;else if(z.nodeName(this,"select")){var K=z.makeArray(p);z("option",this).each(function(){this.selected=z.inArray(this.value,K)>=0||z.inArray(this.text,K)>=0});if(!K.length)this.selectedIndex=-1}else this.value=p});return this}},
+clone:function(){var p=this.map(function(){if(SC.browser.msie&&!z.isXMLDoc(this)){var u=this.cloneNode(true),A=document.createElement("div");A.appendChild(u);return z.clean([A.innerHTML])[0]}else return this.cloneNode(true)});p.find("*").andSelf().each(function(){if(this[SC.guidKey]!==undefined)this[SC.guidKey]=null});return p},css:function(p,u){if((p==="width"||p==="height")&&parseFloat(u,0)<0)u=undefined;return this.attr(p,u,"curCSS")},text:function(p){if(p!==undefined&&typeof p!=="object"&&p!=
+null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(p));var u="";z.each(p||this,function(){z.each(this.childNodes,function(){if(this.nodeType!==8)u+=this.nodeType!==1?this.nodeValue:z.fn.text([this])})});return u},show:function(){var p=SC.$.isVisible;this.each(function(){if(!p(this)){this.style.display=this.oldblock||"";if(z.css(this,"display")==="none"){var u=z("<"+this.tagName+"/>");z("body").append(u);this.style.display=u.css("display");if(this.style.display===
+"none")this.style.display="block";u.remove()}}});return this},hide:function(){var p=SC.$.isVisible;this.each(function(){if(p(this)){this.oldblock=this.oldblock||z.css(this,"display");this.style.display="none"}});return this},domManip:function(p,u,A,C){var B=this.length>1,F;return this.each(function(){if(!F){F=z.clean(p,this.ownerDocument);A&&F.reverse()}var G=this;if(u&&z.nodeName(this,"table")&&z.nodeName(F[0],"tr"))G=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));
+z.each(F,function(){var K=B?z(this).clone(true)[0]:this;C.call(G,K)})})},append:function(){return this.domManip(arguments,true,false,function(p){this.nodeType===1&&this.appendChild(p)})},prepend:function(){return this.domManip(arguments,true,true,function(p){this.nodeType===1&&this.insertBefore(p,this.firstChild)})},before:function(){return this.domManip(arguments,false,false,function(p){this.parentNode.insertBefore(p,this)})},after:function(){return this.domManip(arguments,false,true,function(p){this.parentNode.insertBefore(p,
+this.nextSibling)})},replaceWith:function(p){return this.after(p).remove()},removeData:function(p){return this.each(function(){SC.removeData(this,p)})}});q.mixin({nodeName:function(p,u){return p.nodeName&&p.nodeName.toUpperCase()===u.toUpperCase()},map:function(p,u){var A=[],C,B,F;B=0;for(F=p.length;B<F;B++){C=u(p[B],B);if(C!=null)A[A.length]=C}return A.concat.apply([],A)},each:function(p,u,A){var C,B=0,F=p.length;if(A)if(F===undefined)for(C in p){if(u.apply(p[C],A)===false)break}else for(;B<F;){if(u.apply(p[B++],
+A)===false)break}else if(F===undefined)for(C in p){if(u.call(p[C],C,p[C])===false)break}else for(A=p[0];B<F&&u.call(A,B,A)!==false;A=p[++B]);return p},isXMLDoc:function(p){return p.documentElement&&!p.body||p.tagName&&p.ownerDocument&&!p.ownerDocument.body},clean:function(p,u){var A=[];u=u||document;if(typeof u.createElement=="undefined")u=u.ownerDocument||u[0]&&u[0].ownerDocument||document;z.each(p,function(C,B){if(typeof B==="number")B+="";if(B){if(typeof B==="string"){B=B.replace(e,function(K,
+J,H){return H.match(f)?K:J+"></"+H+">"});var F=B.replace(h,"").substring(0,10).toLowerCase();C=u.createElement("div");var G=!F.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!F.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||F.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!F.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!F.indexOf("<td")||!F.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!F.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>",
+"</colgroup></table>"]||SC.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];for(C.innerHTML=G[1]+B+G[2];G[0]--;)C=C.lastChild;if(SC.browser.msie){F=!F.indexOf("<table")&&F.indexOf("<tbody")<0?C.firstChild&&C.firstChild.childNodes:G[1]==="<table>"&&F.indexOf("<tbody")<0?C.childNodes:[];for(G=F.length-1;G>=0;--G)z.nodeName(F[G],"tbody")&&!F[G].childNodes.length&&F[G].parentNode.removeChild(F[G]);/^\s/.test(B)&&C.insertBefore(u.createTextNode(B.match(/^\s*/)[0]),C.firstChild)}B=z.makeArray(C.childNodes)}if(!(B.length===
+0&&!z.nodeName(B,"form")&&!z.nodeName(B,"select")))if(B[0]===undefined||z.nodeName(B,"form")||B.options)A.push(B);else A=z.merge(A,B)}});return A},find:function(p,u){var A;if(typeof p!=="string")return[p];if(p.indexOf(",")>=0){A=p.split(",").map(function(M){return z.find(M,u)});return A.concat.apply([],A).uniq()}if(u&&u.nodeType!==1&&u.nodeType!==9)return[];u=u||document;A=[u];for(var C=YES,B=p.match(r),F=B.length,G=0;G<F;G++){p=B[G];if(p===" "||p==="")C=YES;else if(C){p=t.exec(p);if(p[1]===""&&G<
+F-1&&B[G+1].charAt(0)==="#"){p=B[G+1];B[G+1]=B[G];p=t.exec(p)}C=[];var K=A.length,J,H,L=p[2],I;for(J=0;J<K;J++){H=A[J];switch(p[1]){case "":L||(L="*");if(L==="*"&&H.nodeName.toLowerCase()==="object")L="param";C=z.merge(C,H.getElementsByTagName(L));break;case "#":if(H===document){I=document.getElementById(L);if(SC.browser.msie&&I&&I.getAttribute("id")!==L)I=NO;else{I&&C.push(I);I=YES}}else I=NO;if(!I){I=H.getElementsByTagName("*");(I=Array.prototype.find.call(I,function(M){return M.getAttribute&&M.getAttribute("id")===
+L}))&&C.push(I)}break;case ".":C=H.getElementsByClassName?z.merge(C,H.getElementsByClassName(L)):z.merge(C,z.classFilter(H.getElementsByTagName("*"),L));break;default:}}delete A;A=C;C=NO}else A=z.filter(p,A)}A&&A[0]==u&&A.shift();return A.uniq()},classFilter:function(p,u,A){u=" "+u+" ";for(var C=[],B,F=0;p[F];F++){B=(" "+p[F].className+" ").indexOf(u)>=0;if(!A&&B||A&&!B)C.push(p[F])}return C},filter:function(p,u,A){p=t.exec(p);var C=p[2];p=p[1];if(p===".")return z.classFilter(z.makeArray(u),C,A);
+else{p=p==="#"?function(B){B=B&&B.getAttribute&&B.getAttribute("id")===C;return A?!B:B}:function(B){B=z.nodeName(B,C);return A?!B:B};return Array.prototype.filter.call(z.makeArray(u),p)}},multiFilter:function(p,u,A){p=p.indexOf(",")?p.split(","):[p];for(var C=p.length,B,F=[];--C>=0;){B=z.filter(p[C].trim(),u,A);F=A?(u=B):z.merge(B,F)}return F},merge:function(p,u){var A=0,C,B=p.length;if(SC.browser.msie)for(;C=u[A++];){if(C.nodeType!==8)p[B++]=C}else for(;C=u[A++];)p[B++]=C;return p},makeArray:function(p){var u=
+[];if(p!==undefined||p!=null){var A=p.length;if(A==null||typeof p==="string"||p.setInterval)u[0]=p;else for(;A;)u[--A]=p[A]}return u},inArray:function(p,u){return u.indexOf?u.indexOf(p):Array.prototype.indexOf.call(u,p)},boxModel:!SC.browser.msie||document.compatMode==="CSS1Compat",props:{"for":"htmlFor","class":"className","float":o,cssFloat:o,styleFloat:o,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan"},prop:function(p,u,A,C,B){if(SC.typeOf(u)===SC.T_FUNCTION)u=
+u.call(p,C);return u&&typeof u==="number"&&A==="curCSS"&&!x.test(B)?u+"px":u},grep:function(p,u,A){for(var C=[],B=0,F=p.length;B<F;B++)!A!=!u(p[B],B)&&C.push(p[B]);return C},className:{add:function(p,u){var A=z.className.has;z.each((u||"").split(g),function(C,B){if(p.nodeType===1&&!A(p.className,B))p.className+=(p.className?" ":"")+B})},remove:function(p,u){if(p.nodeType===1)p.className=u!==undefined?z.grep(p.className.split(g),function(A){return!z.className.has(u,A)}).join(" "):""},has:function(p,
+u){return p&&z.inArray(u,(p.className||p).toString().split(g))>-1}},swap:function(p,u,A,C,B){var F={},G;for(G in u){F[G]=p.style[G];p.style[G]=u[G]}A=A(p,C,B);for(G in u)p.style[G]=F[G];return A},css:function(p,u,A){if(u==="width"||u==="height"){A=u==="width"?s:v;p=SC.$.isVisible(p)?y(p,u,A):z.swap(p,w,y,u,A);return Math.max(0,p)}return z.curCSS(p,u,A)},curCSS:function(p,u,A){var C,B=p.style;if(u==="opacity"&&SC.browser.msie){C=z.attr(B,"opacity");return C===""?"1":C}if(SC.browser.opera&&u==="display"){var F=
+B.outline;B.outline="0 solid black";B.outline=F}if(F=u.match(/float/i))u=o;if(!A&&B&&B[u])C=B[u];else if(D.getComputedStyle){if(F)u="float";u=u.replace(/([A-Z])/g,"-$1").toLowerCase();if((C=D.getComputedStyle(p,null))&&!E(p,D))C=C.getPropertyValue(u);else{B=[];A=[];F=p;for(p=0;F&&E(F);F=F.parentNode)A.unshift(F);for(F=A.length;p<F;p++)if(E(A[p])){B[p]=A[p].style.display;A[p].style.display="block"}C=u==="display"&&B[A.length-1]!==null?"none":C&&C.getPropertyValue(u)||"";p=0;for(F=B.length;p<F;p++)if(B[p]!==
+null)A[p].style.display=B[p]}if(u==="opacity"&&C==="")C="1"}else if(p.currentStyle){C=p.currentStyle[u]||p.currentStyle[u.camelize()];if(!/^\d+(px)?$/i.test(C)&&/^\d/.test(C)){u=B.left;A=p.runtimeStyle.left;p.runtimeStyle.left=p.currentStyle.left;B.left=C||0;C=B.pixelLeft+"px";B.left=u;p.runtimeStyle.left=A}}return C},dir:function(p,u){var A=[];for(p=p[u];p&&p!=document;){p.nodeType===1&&A.push(p);p=p[u]}return A},nth:function(p,u,A){u=u||1;for(var C=0;p;p=p[A])if(p.nodeType===1&&++C==u)break;return p},
+sibling:function(p,u){for(var A=[];p;p=p.nextSibling)p.nodeType===1&&p!=u&&A.push(p);return A},attr:function(p,u,A){if(!(!p||p.nodeType===3||p.nodeType===8)){var C=!z.isXMLDoc(p),B=A!==undefined,F=SC.browser.msie;u=C&&z.props[u]||u;if(p.tagName){var G=k.test(u);if(u in p&&C&&!G){if(B){if(u==="type"&&z.nodeName(p,"input")&&p.parentNode)throw"type property can't be changed";p[u]=A}if(z.nodeName(p,"form")&&p.getAttributeNode(u))return p.getAttributeNode(u).nodeValue;if(u==="tabIndex")return(u=p.getAttributeNode("tabIndex"))&&
+u.specified?u.value:p.nodeName.match(l)?0:p.nodeName.match(/^(a|area)$/i)&&p.href?0:undefined;return p[u]}if(F&&C&&u==="style")return z.attr(p.style,"cssText",A);B&&p.setAttribute(u,""+A);p=F&&C&&G?p.getAttribute(u,2):p.getAttribute(u);return p===null?undefined:p}if(F&&u==="opacity"){if(B){p.zoom=1;p.filter=(p.filter||"").replace(m,"")+(parseInt(A,0)+""=="NaN"?"":"alpha(opacity="+A*100+")")}return p.filter&&p.filter.indexOf("opacity=")>=0?parseFloat(p.filter.match(n)[1])/100+"":""}u=u.camelize();
+if(B)p[u]=A;return p[u]}}});z.fn.init.prototype=z.fn;z.each({parent:function(p){return p.parentNode},parents:function(p){return z.dir(p,"parentNode")},next:function(p){return z.nth(p,2,"nextSibling")},prev:function(p){return z.nth(p,2,"previousSibling")},nextAll:function(p){return z.dir(p,"nextSibling")},prevAll:function(p){return z.dir(p,"previousSibling")},siblings:function(p){return z.sibling(p.parentNode.firstChild,p)},children:function(p){return z.sibling(p.firstChild)},contents:function(p){return z.nodeName(p,
+"iframe")?p.contentDocument||p.contentWindow.document:z.makeArray(p.childNodes)}},function(p,u){z.fn[p]=function(A){var C=z.map(this,u);if(A&&typeof A==="string")C=z.multiFilter(A,C);return this.pushStack(C.uniq())}});z.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(p,u){z.fn[p]=function(){var A=arguments;return this.each(function(){for(var C=0,B=A.length;C<B;C++)z(A[C])[u](this)})}});z.each({removeAttr:function(p){z.attr(this,
+p,"");this.nodeType===1&&this.removeAttribute(p)},addClass:function(p){z.className.add(this,p)},removeClass:function(p){z.className.remove(this,p)},toggleClass:function(p){z.className[z.className.has(this,p)?"remove":"add"](this,p)},remove:function(p){if(!p||z.filter(p,[this]).length)this.parentNode&&this.parentNode.removeChild(this)},empty:function(){for(;this.firstChild;)this.removeChild(this.firstChild)}},function(p,u){z.fn[p]=function(){return this.each(u,arguments)}});z.each(["Height","Width"],
+function(p,u){var A=u.toLowerCase(),C;z.fn[A]=function(G){if(this[0]===window)C=SC.browser.opera?document.body["client"+u]:SC.browser.safari?window["inner"+u]:document.compatMode?documentElement["client"+u]:document.body["client"+u];else if(this[0]===document)C=Math.max(Math.max(document.body["scroll"+u],document.documentElement["scroll"+u]),Math.max(document.body["offset"+u],document.documentElement["offset"+u]));else return G===undefined?this.length?z.css(this[0],A):null:this.css(A,typeof G==="string"?
+G:G+"px");return C};var B=p?"Left":"Top",F=p?"Right":"Bottom";z.fn["inner"+u]=function(){return this[u.toLowerCase()]()+a(this,"padding"+B)+a(this,"padding"+F)};z.fn["outer"+u]=function(G){return this["inner"+u]()+a(this,"border"+B+"Width")+a(this,"border"+F+"Width")+(G?a(this,"margin"+B)+a(this,"margin"+F):0)}});q.fn.offset=function(){function p(N){u(z.curCSS(N,"borderLeftWidth",true),z.curCSS(N,"borderTopWidth",true))}function u(N,O){A+=parseInt(N,10)||0;C+=parseInt(O,10)||0}var A=0,C=0,B=this[0],
+F=SC.browser;if(B){var G=B.parentNode,K=B,J=B.offsetParent,H=B.ownerDocument,L=F.safari&&parseInt(F.version,0)<522&&!/adobeair/i.test(F.userAgent),I=z.curCSS,M=z.css(B,"position")==="fixed";if(!(F.mozilla&&B==document.body)&&B.getBoundingClientRect){B=B.getBoundingClientRect();u(B.left+Math.max(H.documentElement.scrollLeft,H.body.scrollLeft),B.top+Math.max(H.documentElement.scrollTop,H.body.scrollTop));u(-H.documentElement.clientLeft,-H.documentElement.clientTop)}else{for(u(B.offsetLeft,B.offsetTop);J;){u(J.offsetLeft,
+J.offsetTop);if(F.mozilla&&!/^t(able|d|h)$/i.test(J.tagName)||F.safari&&!L)p(J);if(!M&&I(J,"position")==="fixed")M=true;K=/^body$/i.test(J.tagName)?K:J;J=J.offsetParent}for(;G&&G.tagName&&!j.test(G.tagName);){/^inline|table.*$/i.test(I(G,"display"))||u(-G.scrollLeft,-G.scrollTop);F.mozilla&&I(G,"overflow")!=="visible"&&p(G);G=G.parentNode}if(L&&(M||I(K,"position")==="absolute")||F.mozilla&&I(K,"position")!=="absolute")u(-H.body.offsetLeft,-H.body.offsetTop);M&&u(Math.max(H.documentElement.scrollLeft,
+H.body.scrollLeft),Math.max(H.documentElement.scrollTop,H.body.scrollTop))}return{top:C,left:A}}};q.fn.mixin({position:function(){var p;if(this[0]){p=this.offsetParent();var u=this.offset(),A=j.test(p[0].tagName)?{top:0,left:0}:p.offset();u.top-=a(this,"marginTop");u.left-=a(this,"marginLeft");A.top+=a(p,"borderTopWidth");A.left+=a(p,"borderLeftWidth");p={top:u.top-A.top,left:u.left-A.left}}return p},offsetParent:function(){for(var p=this[0].offsetParent||document.body;p&&!j.test(p.tagName)&&z.css(p,
+"position")==="static";)p=p.offsetParent;return z(p)}});z.each(["Left","Top"],function(p,u){var A="scroll"+u;z.fn[A]=function(C){if(this[0])return C!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!p?C:z(window).scrollLeft(),p?C:z(window).scrollTop()):(this[A]=C)}):this[0]==window||this[0]==document?self[p?"pageYOffset":"pageXOffset"]||z.boxModel&&document.documentElement[A]||document.body[A]:this[0][A]}});return q}();SC.$=typeof jQuery=="undefined"?SC.CoreQuery:jQuery;
+SC.mixin(SC.$.fn,{isCoreQuery:YES,toString:function(){var a=[],b=this.length,c=0;for(c=0;c<b;c++)a[c]="%@: %@".fmt(c,this[c]?this[c].toString():"(null)");return"<$:%@>(%@)".fmt(SC.guidFor(this),a.join(" , "))},isVisible:function(){return Array.prototype.every.call(this,function(a){return SC.$.isVisible(a)})},first:function(){return this.pushStack([this[0]])},last:function(){return this.pushStack([this[this.length-1]])},view:function(){return this.map(function(){for(var a=null,b=this,c;!a&&b&&b!==
+document;){if(c=b.getAttribute("id"))a=SC.View.views[c];b=b.parentNode}return a})},setClass:function(a,b){if(SC.none(a))return this;var c=SC.typeOf(a)!==SC.T_STRING,d=this._fixupClass;this.each(function(){if(this.nodeType===1){var e=this.className.split(/\s+/),f=NO;if(c)for(var g in a){if(a.hasOwnProperty(g))f=d(e,g,a[g])||f}else f=d(e,a,b);if(f)this.className=e.join(" ")}});return this},_fixupClass:function(a,b,c){var d=a.indexOf(b);if(c){if(d<0){a.push(b);return YES}}else if(d>=0){a[d]=null;return YES}return NO},
+within:function(a){a=SC.$(a);for(var b,c,d,e=a.length,f=this.length;!b&&--f>=0;){c=this[f];for(d=0;!b&&d<e;d++){for(b=a[d];b&&b!==c;)b=b.parentNode;b=b===c}}return b}});
+(function(){var a={},b={find:function(g,h){return h!==undefined?SC.Enumerable.find.call(this,g,h):a.find.call(this,g)},filter:function(g,h){return h!==undefined?this.pushStack(SC.Enumerable.filter.call(this,g,h)):a.filter.call(this,g)},filterProperty:function(g,h){return this.pushStack(SC.Enumerable.filterProperty.call(this,g,h))},indexOf:SC.$.index,map:function(g,h){return h!==undefined?SC.Enumerable.map.call(this,g,h):a.map.call(this,g)}},c=SC.$.fn,d=SC.$.jquery==="SC.CoreQuery"?b:SC.Enumerable,
+e;for(var f in d)if(d.hasOwnProperty(f)){e=d[f];if(f in b){a[f]=c[f];e=b[f]}c[f]=e}})();SC.mixin(SC.$,{isVisible:function(a){var b=SC.$;return"hidden"!=a.type&&b.css(a,"display")!="none"&&b.css(a,"visibility")!="hidden"}});sc_require("system/core_query");
+SC.Event=function(a){if(a){this.originalEvent=a;for(var b=SC.Event._props,c=b.length,d;--c>=0;){d=b[c];this[d]=a[d]}}this.timeStamp=this.timeStamp||Date.now();if(!this.target)this.target=this.srcElement||document;if(this.target.nodeType===3)this.target=this.target.parentNode;if(!this.relatedTarget&&this.fromElement)this.relatedTarget=this.fromElement===this.target?this.toElement:this.fromElement;if(SC.none(this.pageX)&&!SC.none(this.clientX)){b=document.documentElement;c=document.body;this.pageX=
+this.clientX+(b&&b.scrollLeft||c&&c.scrollLeft||0)-(b.clientLeft||0);this.pageY=this.clientY+(b&&b.scrollTop||c&&c.scrollTop||0)-(b.clientTop||0)}if(!this.which&&(this.charCode||a.charCode===0?this.charCode:this.keyCode))this.which=this.charCode||this.keyCode;if(!this.metaKey&&this.ctrlKey)this.metaKey=this.ctrlKey;if(!this.which&&this.button)this.which=this.button&1?1:this.button&2?3:this.button&4?2:0;if(SC.browser.safari&&a.wheelDelta!==undefined){this.wheelDelta=0-(a.wheelDeltaY||a.wheelDeltaX);
+this.wheelDeltaY=0-(a.wheelDeltaY||0);this.wheelDeltaX=0-(a.wheelDeltaX||0)}else if(SC.none(a.detail)){this.wheelDelta=this.wheelDeltaY=SC.browser.msie?0-a.wheelDelta:a.wheelDelta;this.wheelDeltaX=0}else{b=Math.floor(a.detail*40);if(a.axis&&a.axis===a.HORIZONTAL_AXIS){this.wheelDeltaX=b;this.wheelDeltaY=this.wheelDelta=0}else{this.wheelDeltaY=this.wheelDelta=b;this.wheelDeltaX=0}}if(SC.browser.touch){if((a=this.changedTouches)&&a.length>0){a=a[0];this.pageX=a.pageX;this.pageY=a.pageY}a=b=this.target;
+if(a===SC.RootResponder.responder._touchInterceptElement){b.style.display="none";this.target=a=document.elementFromPoint(this.pageX,this.pageY);b.style.display="block"}}return this};
+SC.mixin(SC.Event,{create:function(a){return new SC.Event(a)},add:function(a,b,c,d,e){if(a&&a.isCoreQuery)if(a.length>0){a.forEach(function(h){this.add(h,b,c,d,e)},this);return this}else a=a[0];if(!a)return this;if(a.nodeType===3||a.nodeType===8)return SC.Event;if(SC.browser.msie&&a.setInterval)a=window;if(SC.typeOf(c)===SC.T_FUNCTION){e=d;d=c;c=null}else if(c&&SC.typeOf(d)===SC.T_STRING)d=c[d];var f=SC.data(a,"events")||SC.data(a,"events",{}),g=f[b];if(!g){g=f[b]={};this._addEventListener(a,b)}g[SC.guidFor(d)]=
+[c,d,e];SC.Event._global[b]=YES;a=f=g=null;return this},remove:function(a,b,c,d){if(a&&a.isCoreQuery)if(a.length>0){a.forEach(function(j){this.remove(j,b,c,d)},this);return this}else a=a[0];if(!a)return this;if(a.nodeType===3||a.nodeType===8)return SC.Event;if(SC.browser.msie&&a.setInterval)a=window;var e,f,g=SC.data(a,"events");if(!g)return this;if(b===undefined)for(b in g)this.remove(a,b);else if(e=g[b]){var h=NO;if(c||d){if(SC.typeOf(c)===SC.T_FUNCTION){d=c;c=null}else if(SC.typeOf(d)===SC.T_STRING)d=
+c[d];delete e[SC.guidFor(d)];f=null;for(f in e)break;if(f===null)h=YES}else h=YES;if(h){delete g[b];this._removeEventListener(a,b)}f=null;for(f in g)break;if(!f){SC.removeData(a,"events");delete this._elements[SC.guidFor(a)]}}a=g=e=null;return this},NO_BUBBLE:["blur","focus","change"],simulateEvent:function(a,b,c){a=SC.Event.create({type:b,target:a,preventDefault:function(){this.cancelled=YES},stopPropagation:function(){this.bubbles=NO},allowDefault:function(){this.hasCustomEventHandling=YES},timeStamp:Date.now(),
+bubbles:this.NO_BUBBLE.indexOf(b)<0,cancelled:NO,normalized:YES});c&&SC.mixin(a,c);return a},trigger:function(a,b,c,d){if(a&&a.isCoreQuery)if(a.length>0){a.forEach(function(k){this.trigger(k,b,c,d)},this);return this}else a=a[0];if(!a)return this;if(!(a.nodeType===3||a.nodeType===8)){c=SC.A(c);var e,f=SC.typeOf(a[b]||null)===SC.T_FUNCTION,g,h;g=c[0];if(!g||!g.preventDefault){g=this.simulateEvent(a,b);c.unshift(g)}g.type=b;h=a;do{e=SC.Event.handle.apply(h,c);h=h===document?null:h.parentNode||document}while(!e&&
+g.bubbles&&h);h=null;g=a["on"+b];h=SC.CoreQuery.nodeName(a,"a")&&b==="click";if((!f||h)&&g&&g.apply(a,c)===NO)e=NO;if(f&&d!==NO&&e!==NO&&!h){this.triggered=YES;try{a[b]()}catch(j){}}this.triggered=NO;return e}},handle:function(a){if(typeof SC==="undefined"||SC.Event.triggered)return YES;var b,c,d,e,f,g;e=SC.A(arguments);e[0]=a=SC.Event.normalizeEvent(a||window.event);d=(SC.data(this,"events")||{})[a.type];if(!d)return NO;for(f in d){g=d[f];c=g[1];a.handler=c;a.data=a.context=g[2];g=g[0]||this;c=c.apply(g,
+e);if(b!==NO)b=c;if(c===NO){a.preventDefault();a.stopPropagation()}}return b},unload:function(){var a,b=this._elements;for(a in b)this.remove(b[a]);for(a in b)delete b[a];delete this._elements},special:{ready:{setup:function(){SC._bindReady()},teardown:function(){}},mouseenter:{setup:function(){if(SC.browser.msie)return NO;SC.Event.add(this,"mouseover",SC.Event.special.mouseover.handler);return YES},teardown:function(){if(SC.browser.msie)return NO;SC.Event.remove(this,"mouseover",SC.Event.special.mouseover.handler);
+return YES},handler:function(a){if(SC.Event._withinElement(a,this))return YES;a.type="mouseenter";return SC.Event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(SC.browser.msie)return NO;SC.Event.add(this,"mouseout",SC.Event.special.mouseleave.handler);return YES},teardown:function(){if(SC.browser.msie)return NO;SC.Event.remove(this,"mouseout",SC.Event.special.mouseleave.handler);return YES},handler:function(a){if(SC.Event._withinElement(a,this))return YES;a.type="mouseleave";return SC.Event.handle.apply(this,
+arguments)}}},KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,_withinElement:function(a,b){for(a=a.relatedTarget;a&&a!=b;)try{a=a.parentNode}catch(c){a=b}return a===b},_addEventListener:function(a,b){var c;c=this.special[b];if(!c||c.setup.call(a)===NO){var d=SC.guidFor(a);this._elements[d]=a;c=SC.data(a,"listener")||SC.data(a,"listener",function(){return SC.Event.handle.apply(SC.Event._elements[d],
+arguments)});if(a.addEventListener)a.addEventListener(b,c,NO);else a.attachEvent&&a.attachEvent("on"+b,c)}a=c=c=null},_removeEventListener:function(a,b){var c;c=SC.Event.special[b];if(!c||c.teardown.call(a)===NO)if(c=SC.data(a,"listener"))if(a.removeEventListener)a.removeEventListener(b,c,NO);else a.detachEvent&&a.detachEvent("on"+b,c)},_elements:{},normalizeEvent:function(a){return a===window.event?SC.Event.create(a):a.normalized?a:SC.Event.create(a)},_global:{},_props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler hasCustomEventHandling keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view which touches targetTouches changedTouches".split(" ")});
+SC.Event.prototype={hasCustomEventHandling:NO,allowDefault:function(){this.hasCustomEventHandling=YES;return this},preventDefault:function(){var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=NO}this.hasCustomEventHandling=YES;return this},stopPropagation:function(){var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=YES}this.hasCustomEventHandling=YES;return this},stop:function(){return this.preventDefault().stopPropagation()},normalized:YES,
+getCharString:function(){return SC.browser.msie?this.keyCode==8||this.keyCode==9||this.keyCode>=37&&this.keyCode<=40?String.fromCharCode(0):this.keyCode>0?String.fromCharCode(this.keyCode):null:this.charCode>0?String.fromCharCode(this.charCode):null},commandCodes:function(){var a=this.keyCode,b=null,c=null,d="";if(a){b=SC.FUNCTION_KEYS[a];if(!b&&(this.altKey||this.ctrlKey||this.metaKey))b=SC.PRINTABLE_KEYS[a];if(b){if(this.altKey)d+="alt_";if(this.ctrlKey||this.metaKey)d+="ctrl_"}}if(!b){a=this.which;
+c=b=String.fromCharCode(a);a=b.toLowerCase();if(this.metaKey){d="meta_";b=a}else b=null}if(this.shiftKey&&b)d+="shift_";if(b)b=d+b;return[b,c]}};SC.Event.observe=SC.Event.add;SC.Event.stopObserving=SC.Event.remove;SC.Event.fire=SC.Event.trigger;SC.Event.add(window,"unload",SC.Event.prototype,SC.Event.unload);SC.MODIFIER_KEYS={16:"shift",17:"ctrl",18:"alt"};
+SC.FUNCTION_KEYS={8:"backspace",9:"tab",13:"return",19:"pause",27:"escape",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",44:"printscreen",45:"insert",46:"delete",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock"};
+SC.PRINTABLE_KEYS={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'};SC.PRINTABLE_KEYS_CHARCODE={};
+(function(){var a;for(i in SC.PRINTABLE_KEYS){a=SC.PRINTABLE_KEYS[i];SC.PRINTABLE_KEYS_CHARCODE[a.charCodeAt(0)]=i;if(a.toUpperCase()!=a)SC.PRINTABLE_KEYS_CHARCODE[a.toUpperCase().charCodeAt(0)]=i}})();SC.SYSTEM_CURSOR="default";SC.AUTO_CURSOR=SC.DEFAULT_CURSOR="auto";SC.CROSSHAIR_CURSOR="crosshair";SC.HAND_CURSOR=SC.POINTER_CURSOR="pointer";SC.MOVE_CURSOR="move";SC.E_RESIZE_CURSOR="e-resize";SC.NE_RESIZE_CURSOR="ne-resize";SC.NW_RESIZE_CURSOR="nw-resize";SC.N_RESIZE_CURSOR="n-resize";
+SC.SE_RESIZE_CURSOR="se-resize";SC.SW_RESIZE_CURSOR="sw-resize";SC.S_RESIZE_CURSOR="s-resize";SC.W_RESIZE_CURSOR="w-resize";SC.IBEAM_CURSOR=SC.TEXT_CURSOR="text";SC.WAIT_CURSOR="wait";SC.HELP_CURSOR="help";
+SC.Cursor=SC.Object.extend({init:function(){arguments.callee.base.apply(this,arguments);var a=this.get("cursorStyle")||SC.DEFAULT_CURSOR,b=this.constructor.sharedStyleSheet(),c=SC.guidFor(this);if(b.insertRule)b.insertRule("."+c+" {cursor: "+a+";}",b.cssRules?b.cssRules.length:0);else b.addRule&&b.addRule("."+c,"cursor: "+a);this.cursorStyle=a;this.className=c;return this},className:null,cursorStyle:SC.DEFAULT_CURSOR,cursorStyleDidChange:function(){var a,b,c,d,e,f;a=this.get("cursorStyle")||SC.DEFAULT_CURSOR;
+if(b=this._rule)b.style.cursor=a;else{c="."+this.get("className");b=this.constructor.sharedStyleSheet();d=(b.cssRules?b.cssRules:b.rules)||[];e=0;for(f=d.length;e<f;++e){b=d[e];if(b.selectorText===c){this._rule=b;b.style.cursor=a;break}}}}.observes("cursorStyle")});
+SC.Cursor.sharedStyleSheet=function(){var a,b=this._styleSheet;if(!b){b=document.createElement("style");b.type="text/css";a=document.getElementsByTagName("head")[0];if(!a)a=document.documentElement;a.appendChild(b);this._styleSheet=b=document.styleSheets[document.styleSheets.length-1]}return b};
+SC.Responder=SC.Object.extend({isResponder:YES,pane:null,responderContext:null,nextResponder:null,isFirstResponder:NO,hasFirstResponder:NO,acceptsFirstResponder:YES,becomingFirstResponder:NO,becomeFirstResponder:function(){var a=this.get("pane")||this.get("responderContext")||this.pane();a&&this.get("acceptsFirstResponder")&&a.get("firstResponder")!==this&&a.makeFirstResponder(this);return this},resignFirstResponder:function(){var a=this.get("pane")||this.get("responderContext");a&&a.get("firstResponder")===
+this&&a.makeFirstResponder(null);return YES},willLoseFirstResponder:function(){},didBecomeFirstResponder:function(){}});sc_require("system/browser");sc_require("system/event");sc_require("system/cursor");sc_require("system/responder");sc_require("mixins/string");SC.viewKey=SC.guidKey+"_view";SC.LAYOUT_HORIZONTAL="sc-layout-horizontal";SC.LAYOUT_VERTICAL="sc-layout-vertical";SC._VIEW_DEFAULT_DIMS="marginTop marginLeft".w();SC.ANCHOR_TOP={top:0};SC.ANCHOR_LEFT={left:0};SC.ANCHOR_TOP_LEFT={top:0,left:0};
+SC.ANCHOR_BOTTOM={bottom:0};SC.ANCHOR_RIGHT={right:0};SC.ANCHOR_BOTTOM_RIGHT={bottom:0,right:0};SC.FULL_WIDTH={left:0,right:0};SC.FULL_HEIGHT={top:0,bottom:0};SC.ANCHOR_CENTER={centerX:0,centerY:0};SC.LAYOUT_AUTO="auto";SC.CONTEXT_MENU_ENABLED=YES;SC.TABBING_ONLY_INSIDE_DOCUMENT=YES;SC.ROUTE_TOUCH=YES;SC.EMPTY_CHILD_VIEWS_ARRAY=[];SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone=YES;
+SC.View=SC.Responder.extend(SC.DelegateSupport,{concatenatedProperties:"outlets displayProperties layoutProperties classNames renderMixin didCreateLayerMixin willDestroyLayerMixin".w(),pane:function(){for(var a=this;a&&!a.isPane;)a=a.get("parentView");return a}.property("parentView").cacheable(),page:null,splitView:function(){for(var a=this;a&&!a.isSplitView;)a=a.get("parentView");return a}.property("parentView").cacheable(),parentView:null,backgroundColor:null,routeTouch:YES,isEnabled:YES,isEnabledBindingDefault:SC.Binding.oneWay().bool(),
+isEnabledInPane:function(){var a=this.get("isEnabled"),b;if(a&&(b=this.get("parentView")))a=b.get("isEnabledInPane");return a}.property("parentView","isEnabled"),isVisible:YES,isVisibleBindingDefault:SC.Binding.bool(),isVisibleInWindow:NO,isContextMenuEnabled:function(){return SC.CONTEXT_MENU_ENABLED}.property(),recomputeIsVisibleInWindow:function(a){this.get("isVisibleInWindow");var b=this.get("isVisible"),c;if(b)b=a===undefined?(c=this.get("parentView"))?c.get("isVisibleInWindow"):NO:a;this.set("isVisibleInWindow",
+b);this._needsVisibiltyChange=YES;a=this.get("childViews");c=a.length;var d;for(d=0;d<c;d++)a[d].recomputeIsVisibleInWindow(b);if(b){this.parentViewDidResize&&this.parentViewDidResize();this.get("childViewsNeedLayout")&&this.invokeOnce(this.layoutChildViewsIfNeeded)}this.set("layerNeedsUpdate",YES);!b&&this.get("isFirstResponder")&&this.resignFirstResponder();return this}.observes("isVisible"),childViews:SC.EMPTY_CHILD_VIEWS_ARRAY,insertBefore:function(a,b){a.beginPropertyChanges();a.get("parentView")&&
+a.removeFromParent();this.willAddChild&&this.willAddChild(a,b);a.willAddToParent&&a.willAddToParent(this,b);a.set("parentView",this);var c,d=this.get("childViews");if(d.needsClone)this.set(d=[]);c=b?d.indexOf(b):d.length;if(c<0)c=d.length;d.insertAt(c,a);a.parentViewDidChange();a.layoutDidChange();(c=a.get("pane"))&&c.get("isPaneAttached")&&a._notifyDidAppendToDocument();this.didAddChild&&this.didAddChild(a,b);a.didAddToParent&&a.didAddToParent(this,b);a.endPropertyChanges();return this},removeChild:function(a){if(!a)return this;
+if(a.parentView!==this)throw"%@.removeChild(%@) must belong to parent".fmt(this,a);a.willRemoveFromParent&&a.willRemoveFromParent();this.willRemoveChild&&this.willRemoveChild(a);a.set("parentView",null);var b=this.get("childViews"),c=b.indexOf(a);c>=0&&b.removeAt(c);a.parentViewDidChange();this.didRemoveChild&&this.didRemoveChild(a);a.didRemoveFromParent&&a.didRemoveFromParent(this);return this},removeAllChildren:function(){for(var a=this.get("childViews"),b;b=a.objectAt(a.get("length")-1);)this.removeChild(b);
+return this},removeFromParent:function(){var a=this.get("parentView");a&&a.removeChild(this);return this},replaceChild:function(a,b){a.beginPropertyChanges();b.beginPropertyChanges();this.beginPropertyChanges();this.insertBefore(a,b).removeChild(b);this.endPropertyChanges();b.endPropertyChanges();a.endPropertyChanges();return this},replaceAllChildren:function(a){var b=a.get("length"),c;this.beginPropertyChanges();this.destroyLayer().removeAllChildren();for(c=0;c<b;c++)this.appendChild(a.objectAt(c));
+this.replaceLayer();this.endPropertyChanges();return this},appendChild:function(a){return this.insertBefore(a,null)},parentViewDidChange:function(){this.recomputeIsVisibleInWindow();this.set("layerLocationNeedsUpdate",YES);this.invokeOnce(this.updateLayerLocationIfNeeded);this._invalidatePaneCacheForSelfAndAllChildViews();return this}.observes("isVisible"),_invalidatePaneCacheForSelfAndAllChildViews:function(){var a,b=this.get("childViews"),c=b.length,d;this.notifyPropertyChange("pane");for(d=0;d<
+c;++d){a=b[d];a._invalidatePaneCacheForSelfAndAllChildViews&&a._invalidatePaneCacheForSelfAndAllChildViews()}},layer:function(a,b){if(b!==undefined)this._view_layer=b;else{b=this._view_layer;if(!b){if(a=this.get("parentView"))a=a.get("layer");if(a)this._view_layer=b=this.findLayerInParentLayer(a)}}return b}.property("isVisibleInWindow").cacheable(),$:function(a){var b=this.get("layer");return!b?SC.$([]):a===undefined?SC.$(b):SC.$(a,b)},containerLayer:function(){return this.get("layer")}.property("layer").cacheable(),
+layerId:function(){return SC.guidFor(this)}.property().cacheable(),findLayerInParentLayer:function(a){var b=this.get("layerId"),c,d,e,f;f=a.getElementById?a.getElementById(b):document.getElementById(b);if(SC.browser.msie&&f&&f.id!==b)f=null;if(!f&&a.querySelector)f=a.querySelector("#"+b);if(!f){f=a.firstChild;var g=[];for(g.push(a);g.length!==0;){a=g[0];g.shift();if(a.id===b){e=true;f=a;break}c=0;for(d=a.childNodes.length;c<d;c++)g.push(a.childNodes[c])}e||(f=null)}return f},displayDidChange:function(){this.set("layerNeedsUpdate",
+YES);return this},layerNeedsUpdate:NO,_view_layerNeedsUpdateDidChange:function(){this.get("layerNeedsUpdate")&&this.invokeOnce(this.updateLayerIfNeeded)}.observes("layerNeedsUpdate"),updateLayerIfNeeded:function(){if((this.get("isVisibleInWindow")||this._needsVisibiltyChange)&&this.get("layerNeedsUpdate")){this._needsVisibiltyChange=NO;if(this.get("layer")){this.beginPropertyChanges();this.set("layerNeedsUpdate",NO);this.updateLayer();this.endPropertyChanges()}}else this.set("layerNeedsUpdate",NO);
+return this},updateLayer:function(){var a=this.renderContext(this.get("layer"));this.prepareContext(a,NO);a.update();if(a._innerHTMLReplaced)(a=this.get("pane"))&&a.get("isPaneAttached")&&this._notifyDidAppendToDocument();this.didUpdateLayer&&this.didUpdateLayer();this.designer&&this.designer.viewDidUpdateLayer&&this.designer.viewDidUpdateLayer();return this},renderContext:function(a){return SC.RenderContext(a)},createLayer:function(){if(this.get("layer"))return this;var a=this.renderContext(this.get("tagName"));
+this.prepareContext(a,YES);this.set("layer",a.element());this._notifyDidCreateLayer();return this},_notifyDidCreateLayer:function(){this.didCreateLayer&&this.didCreateLayer();var a=this.didCreateLayerMixin,b,c,d=this.get("childViews");if(a){b=a.length;for(c=0;c<b;++c)a[c].call(this)}b=d.length;for(c=0;c<b;++c)d[c]&&d[c]._notifyDidCreateLayer()},destroyLayer:function(){var a=this.get("layer");if(a){this._notifyWillDestroyLayer();a.parentNode&&a.parentNode.removeChild(a)}return this},replaceLayer:function(){this.destroyLayer();
+this.set("layerLocationNeedsUpdate",YES);this.invokeOnce(this.updateLayerLocationIfNeeded)},_notifyWillDestroyLayer:function(){this.willDestroyLayer&&this.willDestroyLayer();var a=this.willDestroyLayerMixin,b,c,d=this.get("childViews");if(a){b=a.length;for(c=0;c<b;++c)a[c].call(this)}b=d.length;for(c=0;c<b;++c)d[c]._notifyWillDestroyLayer();this.set("layer",null)},prepareContext:function(a,b){var c,d,e;if(b){c=this.layerId?this.get("layerId"):SC.guidFor(this);a.id(c).classNames(this.get("classNames"),
+YES);this.renderLayout(a,b)}else{a.resetClassNames();a.classNames(this.get("classNames"),YES)}this.get("isTextSelectable")&&a.addClass("allow-select");this.get("isEnabled")||a.addClass("disabled");this.get("isVisible")||a.addClass("hidden");this.get("isFirstResponder")&&a.addClass("focus");(c=this.get("backgroundColor"))&&a.addStyle("backgroundColor",c);(c=this.get("cursor"))&&a.addClass(c.get("className"));this.beginPropertyChanges();this.set("layerNeedsUpdate",NO);this.render(a,b);if(c=this.renderMixin){d=
+c.length;for(e=0;e<d;++e)c[e].call(this,a,b)}this.endPropertyChanges()},renderChildViews:function(a,b){var c=this.get("childViews"),d=c.length,e,f;for(e=0;e<d;++e)if(f=c[e]){a=a.begin(f.get("tagName"));f.prepareContext(a,b);a=a.end()}return a},render:function(a,b){b&&this.renderChildViews(a,b)},_notifyDidAppendToDocument:function(){this.didAppendToDocument&&this.didAppendToDocument();var a=0,b,c,d=this.get("childViews");a=0;for(c=d.length;a<c;a++){b=d[a];b._notifyDidAppendToDocument&&b._notifyDidAppendToDocument()}},
+tagName:"div",classNames:["sc-view"],toolTip:null,isTextSelectable:NO,displayProperties:["isFirstResponder","isVisible"],cursor:null,layerLocationNeedsUpdate:NO,updateLayerLocationIfNeeded:function(){if(this.get("layerLocationNeedsUpdate")){this.set("layerLocationNeedsUpdate",NO);this.updateLayerLocation()}return this},updateLayerLocation:function(){var a=this.get("layer"),b=this.get("parentView"),c=b?b.get("containerLayer"):null;a&&a.parentNode&&a.parentNode!==c&&a.parentNode.removeChild(a);if(b)if(c){if(!a){this.createLayer();
+a=this.get("layer");if(!a)return}b=b.get("childViews");var d=(b=b.objectAt(b.indexOf(this)+1))?b.get("layer"):null;if(b&&(!d||d.parentNode!==c)){b.updateLayerLocationIfNeeded();d=b.get("layer")}if(a.parentNode!==c||a.nextSibling!==d){c.insertBefore(a,d);this.parentViewDidResize&&this.parentViewDidResize()}}else{if(a){a.parentNode&&a.parentNode.removeChild(a);this.destroyLayer()}}else a&&a.parentNode&&a.parentNode.removeChild(a);return this},nextResponder:function(){return this.get("parentView")}.property("parentView").cacheable(),
+acceptsFirstResponder:NO,isKeyResponder:NO,willLoseKeyResponderTo:function(){},willBecomeKeyResponderFrom:function(){},didLoseKeyResponderTo:function(){},didBecomeKeyResponderFrom:function(){},interpretKeyEvents:function(a){var b=a.commandCodes(),c=b[0];b=b[1];if(!c&&!b)return null;if(c)if(c=SC.MODIFIED_KEY_BINDINGS[c]||SC.BASE_KEY_BINDINGS[c.match(/[^_]+$/)[0]]){b=this;for(var d=this.get("pane"),e=null;b&&!(e=b.tryToPerform(c,a));)b=b===d?null:b.get("nextResponder");return e}if(b&&this.respondsTo("insertText"))return(a=
+this.insertText(b,a))?a===YES?this:a:null;return null},insertText:function(){return NO},performKeyEquivalent:function(a,b){for(var c=NO,d=this.get("childViews"),e=d.length,f=-1;!c&&++f<e;)c=d[f].performKeyEquivalent(a,b);return c},nextKeyView:null,nextValidKeyView:function(){var a=[],b=this.pane(),c;c=b._computeNextValidKeyView(this,a);if(SC.TABBING_ONLY_IN_DOCUMENT&&SC.ret===null)c=b._computeNextValidKeyView(b,a);return c}.property("nextKeyView"),_computeNextValidKeyView:function(a,b){var c=this.get("nextKeyView"),
+d,e,f,g;if(this!==a&&b.indexOf(a)!=-1&&this.get("acceptsFirstResponder")&&this.get("isVisibleInWindow"))return this;b.push(this);if(!c){d=this.get("childViews");e=0;for(f=d.length;e<f;e++){g=d[e];if(g.get("isVisibleInWindow")&&g.get("isVisible"))c=g._computeNextValidKeyView(a,b);if(c)return c}c=null}return c},previousKeyView:null,previousValidKeyView:function(){return this.pane()._computePreviousValidKeyView(this,[])}.property("previousKeyView"),_computePreviousValidKeyView:function(a,b){var c=this.get("previousKeyView"),
+d,e,f;if(this!==a&&b.indexOf(a)!=-1&&this.get("acceptsFirstResponder")&&this.get("isVisibleInWindow"))return this;b.push(this);if(!c){d=this.get("childViews");for(e=d.length-1;0<=e;e--){f=d[e];if(f.get("isVisibleInWindow")&&f.get("isVisible"))c=f._computePreviousValidKeyView(a,b);if(c)return c}c=null}return c},init:function(){var a,b;arguments.callee.base.apply(this,arguments);this.get("isMaterialized")||(SC.View.views[this.get("layerId")]=this);this.childViews=(a=this.get("childViews"))?a.slice():
+[];this.createChildViews();b=this.get("displayProperties");for(a=b.length;--a>=0;)this.addObserver(b[a],this,this.displayDidChange);this.get("isDropTarget")&&SC.Drag.addDropTarget(this);this.get("isScrollable")&&SC.Drag.addScrollableView(this);SC.ROUTE_TOUCH&&this.get("routeTouch")&&this.routeTouchEvents()},routeTouchEvents:function(){if(!this.respondsTo("touchStart")&&this.respondsTo("mouseDown"))this.touchStart=this.mouseDown;if(!this.respondsTo("touchEnd")&&this.respondsTo("mouseUp"))this.touchEnd=
+this.mouseUp;if(!this.respondsTo("touchMoved")&&this.respondsTo("mouseMove"))this.touchMoved=this.mouseMove;if(!this.respondsTo("touchEntered")&&this.respondsTo("mouseEntered"))this.touchEntered=this.mouseEntered;if(!this.respondsTo("touchExited")&&this.respondsTo("mouseExited"))this.touchExited=this.mouseExited},awake:function(){arguments.callee.base.apply(this,arguments);var a=this.get("childViews"),b=a.length,c;for(c=0;c<b;++c)a[c]&&a[c].awake()},destroy:function(){if(this.get("isDestroyed"))return this;
+arguments.callee.base.apply(this,arguments);this.removeFromParent();this._destroy();this.get("isDropTarget")&&SC.Drag.removeDropTarget(this);this.get("isScrollable")&&SC.Drag.removeScrollableView(this);return this},_destroy:function(){if(this.get("isDestroyed"))return this;this.destroyLayer();var a=this.get("childViews"),b=a.length,c;if(b){a=a.slice();for(c=0;c<b;++c)a[c]._destroy()}delete SC.View.views[this.get("layerId")];delete this._CQ;delete this.page;this.set("isDestroyed",YES);return this},
+createChildViews:function(){var a=this.get("childViews"),b=a.length,c,d,e;this.beginPropertyChanges();for(c=0;c<b;++c){if(d=e=a[c]){if(typeof d===SC.T_STRING)e=this[d];else d=null;if(!e){SC.Logger.error("No view with name "+d+" has been found in "+this.toString());continue}if(e.isClass){e=this.createChildView(e);if(d)this[d]=e}}a[c]=e}this.endPropertyChanges();return this},createChildView:function(a,b){b||(b={});b.owner=b.parentView=this;b.isVisibleInWindow=this.get("isVisibleInWindow");if(!b.page)b.page=
+this.page;return a=a.create(b)},adjust:function(a,b){var c=SC.clone(this.get("layout")),d=NO,e;if(a===undefined)return this;if(SC.typeOf(a)===SC.T_STRING){e=c[a];if(SC.none(b)){if(e!==undefined)d=YES;delete c[a]}else{if(e!==b)d=YES;c[a]=b}}else{var f=a;for(a in f)if(f.hasOwnProperty(a)){b=f[a];e=c[a];if(b===null){if(e!==undefined)d=YES;delete c[a]}else if(b!==undefined){if(e!==b)d=YES;c[a]=b}}}d&&this.set("layout",c);return this},layout:{top:0,left:0,bottom:0,right:0},convertFrameToView:function(a,
+b){var c=0,d=0,e=0,f=0,g=this,h;if(this.get("useStaticLayout"))throw"convertFrameToView is not available with static layout";for(;g;){h=g.get("frame");c+=h.x;d+=h.y;g=g.get("layoutView")}if(b)for(g=b;g;){h=g.get("frame");e+=h.x;f+=h.y;g=g.get("layoutView")}c=a.x+c-e;d=a.y+d-f;return{x:c,y:d,width:a.width,height:a.height}},convertFrameFromView:function(a,b){var c=0,d=0,e=0,f=0,g=this,h;if(this.get("useStaticLayout"))throw"convertFrameToView is not available with static layout";for(;g&&g.get("frame");){h=
+g.get("frame");c+=h.x;d+=h.y;g=g.get("parentView")}if(b)for(g=b;g;){h=g.get("frame");e+=h.x;f+=h.y;g=g.get("parentView")}c=a.x-c+e;d=a.y-d+f;return{x:c,y:d,width:a.width,height:a.height}},scrollToVisible:function(){for(var a=this.get("parentView");a&&!a.get("isScrollable");)a=a.get("parentView");if(a){a.scrollToVisible();return a.scrollToVisible(this)}else return NO},frame:function(){return this.computeFrameWithParentFrame(null)}.property("layout","useStaticLayout").cacheable(),computeFrameWithParentFrame:function(a){var b=
+this.get("layout"),c={},d,e=SC.LAYOUT_AUTO,f=this.get("useStaticLayout"),g=this.get("parentView");d=b.right;var h=b.left,j=b.top,k=b.bottom,l=b.width,m=b.height,n=b.centerX,o=b.centerY;if(l!==undefined&&l===SC.LAYOUT_AUTO&&f!==undefined&&!f){b=SC.Error.desc("%@.layout() you cannot use width:auto if ".fmt(this)+"staticLayout is disabled","%@".fmt(this),-1);SC.Logger.error(b.toString());throw b;}if(m!==undefined&&m===SC.LAYOUT_AUTO&&f!==undefined&&!f){b=SC.Error.desc("%@.layout() you cannot use height:auto if ".fmt(this)+
+"staticLayout is disabled","%@".fmt(this),-1);SC.Logger.error(b.toString());throw b;}if(f){if(d=this.get("layer")){c=SC.viewportOffset(d);c.width=d.offsetWidth;c.height=d.offsetHeight;return c}return null}a||(a=this.computeParentDimensions(b));f=a.height;a=a.width;if(SC.none(h))if(SC.none(d))if(SC.none(n)){c.x=0;if(SC.none(l))c.width=a;else{if(l===e)c.width=e;c.width=SC.isPercentage(l)?l*a:l||0}}else{c.width=l===e?e:SC.isPercentage(l)?l*a:l||0;c.x=SC.isPercentage(n)?(a-c.width)/2+n*a:(a-c.width)/
+2+n}else if(SC.none(l)){c.width=SC.isPercentage(h)?a-a*d:a-d;c.x=0}else{c.width=l===e?e:SC.isPercentage(l)?a*l:l||0;c.x=SC.isPercentage(l)?a-d*a-c.width:a-d-c.width}else{c.x=SC.isPercentage(h)?a*h:h;if(l!==undefined)c.width=l===e?e:SC.isPercentage(l)?a*l:l;else{c.width=a-c.x;c.width-=d&&SC.isPercentage(d)?d*a:d||0}}if(SC.none(j))if(SC.none(k))if(SC.none(o)){c.y=0;if(SC.none(m))c.height=f;else{if(m===e)c.height=e;c.height=SC.isPercentage(m)?m*f:m||0}}else{if(m===e)c.height=e;c.height=m&&SC.isPercentage(m)?
+m*f:m||0;c.y=SC.isPercentage(o)?(f-c.height)/2+o*f:(f-c.height)/2+o}else if(SC.none(m)){c.height=SC.isPercentage(k)?f-k*f:f-k;c.y=0}else{if(m===e)c.height=e;c.height=m&&SC.isPercentage(m)?m*f:m||0;c.y=SC.isPercentage(k)?f-k*f-c.height:f-k-c.height}else{c.y=SC.isPercentage(j)?j*f:j;c.height=m!==undefined?m===e?e:SC.isPercentage(m)?m*f:m:k&&SC.isPercentage(k)?f-c.y-k*f:f-c.y-(k||0)}c.x=Math.floor(c.x);c.y=Math.floor(c.y);if(c.height!==e)c.height=Math.floor(c.height);if(c.width!==e)c.width=Math.floor(c.width);
+if(c.height===e||c.width===e){d=this.get("layer");if(c.height===e)c.height=d?d.clientHeight:0;if(c.width===e)c.width=d?d.clientWidth:0}if(this.get("hasBorder")){e=this.get("borderTop");d=this.get("borderLeft");c.height-=e+this.get("borderBottom");c.y+=e;c.width-=d+this.get("borderRight");c.x+=d}if(g&&g.isScrollContainer){g=g.get("parentView");c.x-=g.get("horizontalScrollOffset");c.y-=g.get("verticalScrollOffset")}if(!SC.none(b.maxHeight)&&c.height>b.maxHeight)c.height=b.maxHeight;if(!SC.none(b.minHeight)&&
+c.height<b.minHeight)c.height=b.minHeight;if(!SC.none(b.maxWidth)&&c.width>b.maxWidth)c.width=b.maxWidth;if(!SC.none(b.minWidth)&&c.width<b.minWidth)c.width=b.minWidth;if(c.height<0)c.height=0;if(c.width<0)c.width=0;return c},computeParentDimensions:function(a){var b=this.get("parentView");return(b=b?b.get("frame"):null)?{width:b.width,height:b.height}:{width:(a.left||0)+(a.width||0)+(a.right||0),height:(a.top||0)+(a.height||0)+(a.bottom||0)}},clippingFrame:function(){var a=this.get("parentView"),
+b=this.get("frame"),c=b;if(a){a=a.get("clippingFrame");c=SC.intersectRects(a,b)}c.x-=b.x;c.y-=b.y;return c}.property("parentView","frame").cacheable(),_sc_view_clippingFrameDidChange:function(){var a=this.get("childViews"),b=a.length,c,d;for(c=0;c<b;++c){d=a[c];d.hasStaticLayout||d.notifyPropertyChange("clippingFrame")}}.observes("clippingFrame"),parentViewDidResize:function(){var a=this.get("layout"),b;b=a.left!==undefined&&a.top!==undefined&&a.width!==undefined&&a.height!==undefined;a=SC.isPercentage(a.left)||
+SC.isPercentage(a.top)||SC.isPercentage(a.width)||SC.isPercentage(a.right)||SC.isPercentage(a.centerX)||SC.isPercentage(a.centerY);if(!b||a){this.notifyPropertyChange("frame");this.viewDidResize()}},viewDidResize:function(){var a=this.childViews,b=a.length,c,d;for(c=0;c<b;++c){d=a[c];d.parentViewDidResize&&d.parentViewDidResize()}}.observes("layout"),beginLiveResize:function(){this.willBeginLiveResize&&this.willBeginLiveResize();var a=this.get("childViews"),b=a.length,c,d;for(c=0;c<b;++c){d=a[c];
+d.beginLiveResize&&d.beginLiveResize()}return this},endLiveResize:function(){var a=this.get("childViews"),b,c;for(b=a.length-1;b>=0;--b){c=a[b];c.endLiveResize&&c.endLiveResize()}this.didEndLiveResize&&this.didEndLiveResize();return this},layoutStyle:function(){var a=this.get("layout"),b={},c=SC._VIEW_DEFAULT_DIMS,d=c.length,e,f=this.get("useStaticLayout"),g=a.right,h=a.left,j=a.top,k=a.bottom,l=a.width,m=a.height,n=a.maxWidth,o=a.maxHeight,q=a.centerX,t=a.centerY;if(l!==undefined&&l===SC.LAYOUT_AUTO&&
+!f){b=SC.Error.desc("%@.layout() you cannot use width:auto if ".fmt(this)+"staticLayout is disabled","%@".fmt(this),-1);SC.Logger.error(b.toString());throw b;}if(m!==undefined&&m===SC.LAYOUT_AUTO&&!f){b=SC.Error.desc("%@.layout() you cannot use height:auto if ".fmt(this)+"staticLayout is disabled","%@".fmt(this),-1);SC.Logger.error(b.toString());throw b;}if(SC.none(h))if(SC.none(g))if(SC.none(q)){if(SC.none(l)){b.left=0;b.right=0;b.width=null}else{b.left=0;b.right=null;b.width=l===SC.LAYOUT_AUTO?
+SC.LAYOUT_AUTO:SC.isPercentage(l)?l*100+"%":Math.floor(l)}b.marginLeft=0}else{b.left="50%";b.width=l&&SC.isPercentage(l)?l*100+"%":Math.floor(l||0);b.marginLeft=l&&SC.isPercentage(l)&&q>=0&&q<1?Math.floor((q-l/2)*100)+"%":l&&l>1&&(q>=1||q<=0)?Math.floor(q-b.width/2):0;b.right=null}else{b.right=SC.isPercentage(g)?Math.floor(g*100)+"%":Math.floor(g);b.marginLeft=0;if(SC.none(l)){if(SC.none(n))b.left=0;b.width=null}else{b.left=null;b.width=l===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:l&&SC.isPercentage(l)?l*100+
+"%":Math.floor(l||0)}}else{b.left=SC.isPercentage(h)?h*100+"%":Math.floor(h);b.marginLeft=0;if(l!==undefined){b.width=l===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:SC.isPercentage(l)?l*100+"%":Math.floor(l);b.right=null}else{b.width=null;b.right=g&&SC.isPercentage(g)?g*100+"%":Math.floor(g||0)}}b.minWidth=a.minWidth===undefined?null:a.minWidth;b.maxWidth=a.maxWidth===undefined?null:a.maxWidth;if(SC.none(j))if(SC.none(k))if(SC.none(t)){if(SC.none(m)){b.top=0;b.bottom=0;b.height=null}else{b.top=0;b.bottom=null;
+b.height=m===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:m&&SC.isPercentage(m)?m*100+"%":Math.floor(m||0)}b.marginTop=0}else{b.top="50%";b.bottom=null;b.height=m&&SC.isPercentage(m)?m*100+"%":Math.floor(m||0);if(m&&SC.isPercentage(m)&&t>=0&&t<1)b.marginTop=Math.floor((t-m/2)*100)+"%";else if(m&&m>1&&(t>=1||t<=0))b.marginTop=Math.floor(t-b.height/2);else{SC.Logger.error("You have to set height and centerY to use both percentages or pixels");b.marginTop=0}}else{b.marginTop=0;b.bottom=SC.isPercentage(k)?k*100+"%":
+Math.floor(k);if(SC.none(m)){if(SC.none(o))b.top=0;b.height=null}else{b.top=null;b.height=m===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:m&&SC.isPercentage(m)?m*100+"%":Math.floor(m||0)}}else{b.top=SC.isPercentage(j)?j*100+"%":Math.floor(j);if(m!==undefined){b.height=m===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:SC.isPercentage(m)?m*100+"%":Math.floor(m);b.bottom=null}else{b.height=null;b.bottom=k&&SC.isPercentage(k)?k*100+"%":Math.floor(k||0)}b.marginTop=0}b.minHeight=a.minHeight===undefined?null:a.minHeight;b.maxHeight=
+a.maxHeight===undefined?null:a.maxHeight;b.zIndex=SC.none(a.zIndex)?null:a.zIndex.toString();for(b.backgroundPosition=SC.none(a.backgroundPosition)?null:a.backgroundPosition.toString();--d>=0;){a=c[d];if(b[a]===0)b[a]=null}for(e in b){c=b[e];if(typeof c===SC.T_NUMBER)b[e]=c+"px"}return b}.property().cacheable(),layoutView:function(){return this.get("parentView")}.property("parentView").cacheable(),layoutDidChange:function(){this.beginPropertyChanges();this.frame&&this.notifyPropertyChange("frame");
+this.notifyPropertyChange("layoutStyle");this.endPropertyChanges();var a=this.get("layoutView");if(a){a.set("childViewsNeedLayout",YES);a.layoutDidChangeFor(this);a.get("childViewsNeedLayout")&&a.invokeOnce(a.layoutChildViewsIfNeeded)}return this}.observes("layout"),childViewsNeedLayout:NO,layoutDidChangeFor:function(a){var b=this._needLayoutViews;if(!b)b=this._needLayoutViews=SC.CoreSet.create();b.add(a)},layoutChildViewsIfNeeded:function(a){a||(a=this.get("isVisibleInWindow"));if(a&&this.get("childViewsNeedLayout")){this.set("childViewsNeedLayout",
+NO);this.layoutChildViews()}return this},layoutChildViews:function(){var a=this._needLayoutViews,b=a?a.length:0,c;for(c=0;c<b;++c)a[c].updateLayout();a.clear()},updateLayout:function(){var a=this.get("layer");if(a){a=this.renderContext(a);this.renderLayout(a);a.update()}return this},renderLayout:function(a){a.addStyle(this.get("layoutStyle"))},isView:YES,selectStart:function(){return this.get("isTextSelectable")},contextMenu:function(a){this.get("isContextMenuEnabled")||a.stop();return true}});
+SC.View.mixin({isViewClass:YES,design:function(){if(this.isDesign)return this;var a=this.extend.apply(this,arguments);a.isDesign=YES;SC.ViewDesigner&&SC.ViewDesigner.didLoadDesign(a,this,SC.A(arguments));return a},layout:function(a){this.prototype.layout=a;return this},convertLayoutToAnchoredLayout:function(a,b){var c={top:0,left:0,width:b.width,height:b.height},d=b.width;b=b.height;var e=a.right,f=a.left,g=a.top,h=a.bottom,j=a.width,k=a.height,l=a.centerX,m=a.centerY;if(SC.none(f))if(SC.none(e))if(SC.none(l))if(SC.none(j)){c.left=
+0;c.width=0}else{c.left=0;c.width=j===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:SC.isPercentage(j)?j*d:j}else{c.width=j&&SC.isPercentage(j)?j*d:j||0;c.left=(d-c.width)/2;c.left+=SC.isPercentage(l)?l*d:l}else if(SC.none(j)){c.left=0;c.width=e&&SC.isPercentage(e)?d-e*d:d-(e||0)}else if(j===SC.LAYOUT_AUTO)c.width=SC.LAYOUT_AUTO;else{c.width=SC.isPercentage(j)?j*d:j;SC.isPercentage(e);c.left=d-(c.width+e)}else{c.left=SC.isPercentage(f)?f*d:f;c.width=j!==undefined?j===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:SC.isPercentage(j)?
+j*d:j:e&&SC.isPercentage(e)?d-c.left-e*d:d-c.left-(e||0)}if(a.minWidth!==undefined)c.minWidth=a.minWidth;if(a.maxWidth!==undefined)c.maxWidth=a.maxWidth;if(SC.none(g))if(SC.none(h))if(SC.none(m))if(SC.none(k)){c.top=0;c.height=0}else{c.top=0;c.height=k===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:SC.isPercentage(k)?k*b:k}else{c.height=k&&SC.isPercentage(k)?k*b:k||0;c.top=(b-c.height)/2;c.top+=SC.isPercentage(m)?m*b:m}else if(SC.none(k)){c.top=0;c.height=h&&SC.isPercentage(h)?b-h*b:b-(h||0)}else if(k===SC.LAYOUT_AUTO)c.height=
+SC.LAYOUT_AUTO;else{c.height=SC.isPercentage(k)?k*b:k;c.top=b-c.height;c.top-=SC.isPercentage(h)?h*b:h}else{c.top=SC.isPercentage(g)?g*b:g;if(k!==undefined)c.height=k===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:SC.isPercentage(k)?k*b:k;else{c.height=b-c.top;c.height-=h&&SC.isPercentage(h)?h*b:h||0}}if(c.top)c.top=Math.floor(c.top);if(c.bottom)c.bottom=Math.floor(c.bottom);if(c.left)c.left=Math.floor(c.left);if(c.right)c.right=Math.floor(c.right);if(c.width!==SC.LAYOUT_AUTO)c.width=Math.floor(c.width);if(c.height!==
+SC.LAYOUT_AUTO)c.height=Math.floor(c.height);if(a.minHeight!==undefined)c.minHeight=a.minHeight;if(a.maxHeight!==undefined)c.maxHeight=a.maxHeight;return c},convertLayoutToCustomLayout:function(){},classNames:function(a){a=(this.prototype.classNames||[]).concat(a);this.prototype.classNames=a;return this},tagName:function(a){this.prototype.tagName=a;return this},childView:function(a){var b=this.prototype.childViews||[];if(b===this.superclass.prototype.childViews)b=b.slice();b.push(a);this.prototype.childViews=
+b;return this},bind:function(a,b){var c=this.prototype,d=this.superclass.prototype,e=c._bindings;if(!e||e===d._bindings)e=c._bindings=(e||[]).slice();a+="Binding";c[a]=b;e.push(a);return this},prop:function(a,b){this.prototype[a]=b;return this},localization:function(a,b){if(b)a.rootElement=SC.$(b)[0];return a},viewFor:function(a){var b=SC.$A(arguments);if(SC.none(a))b.shift();else b[0]={rootElement:SC.$(a)[0]};var c=this.create.apply(this,arguments);b[0]=null;return c},create:function(){var a=new this(arguments);
+SC.ViewDesigner&&SC.ViewDesigner.didCreateView(a,SC.$A(arguments));return a},loc:function(a){var b=a.childViews;delete a.childViews;this.applyLocalizedAttributes(a);SC.ViewDesigner&&SC.ViewDesigner.didLoadLocalization(this,SC.$A(arguments));for(var c=this.prototype.childViews,d=c.length,e;--d>=0;){e=c[d];(a=b[d])&&e&&e.loc&&e.loc(a)}return this},applyLocalizedAttributes:function(a){SC.mixin(this.prototype,a)},views:{}});
+SC.outlet=function(a){return function(b){return this[b]=SC.objectForPropertyPath(a,this)}.property()};SC.View.unload=function(){var a=SC.View.views;if(a)for(var b in a)a.hasOwnProperty(b)&&delete a[b]};SC.Event.add(window,"unload",SC.View,SC.View.unload);
+SC.Validatable={initMixin:function(){this._validatable_validatorDidChange()},validator:null,errorLabel:null,isValid:function(){return SC.typeOf(this.get("value"))!==SC.T_ERROR}.property("value"),ownerForm:null,performValidate:function(a){var b=SC.VALIDATE_OK;if(this._validator){var c=this.get("ownerForm");if(a){b=this._validator.validatePartial(c,this);if(b==SC.VALIDATE_NO_CHANGE&&this._validator.validateChange(c,this)==SC.VALIDATE_OK)b=SC.VALIDATE_OK}else b=this._validator.validateChange(c,this)}return b},
+performValidateSubmit:function(){return this._validator?this._validator.validateSubmit(this.get("ownerForm"),this):SC.VALIDATE_OK},performValidateKeyDown:function(a){a=a.getCharString();if(!a)return YES;return this._validator?this._validator.validateKeyDown(this.get("ownerForm"),this,a):YES},validatorObject:function(){return this._validator}.property(),validateSubmit:function(){return this.performValidateSubmit()},objectForFieldValue:function(a){return this._validator?this._validator.objectForFieldValue(a,
+this.get("ownerForm"),this):a},fieldValueForObject:function(a){return this._validator?this._validator.fieldValueForObject(a,this.get("ownerForm"),this):a},_validatable_displayObserver:function(){this.displayDidChange()}.observes("isValid"),renderMixin:function(a){a.setClass("invalid",!this.get("isValid"))},_validatable_validatorDidChange:function(){var a=this.get("ownerForm"),b=SC.Validator.findFor(a,this,this.get("validator"));if(b!=this._validator){this.propertyWillChange("validatorObject");this._validator&&
+this._validator.detachFrom(a,this);(this._validator=b)&&this._validator.attachTo(a,this);this.propertyDidChange("validatorObject")}}.observes("validator","ownerForm")};sc_require("views/view");sc_require("mixins/control");sc_require("mixins/validatable");
+SC.FieldView=SC.View.extend(SC.Control,SC.Validatable,{isTextArea:NO,_field_isMouseDown:NO,fieldValue:function(){var a=this.get("value");if(SC.typeOf(a)===SC.T_ERROR)a=a.get("errorValue");return this.fieldValueForObject(a)}.property("value","validator").cacheable(),$input:function(){return this.get("isTextArea")?this.$("textarea").andSelf().filter("textarea"):this.$("input").andSelf().filter("input")},setFieldValue:function(a){if(SC.none(a))a="";var b=this.$input();b.val()!==a&&b.val(a);return this},
+getFieldValue:function(){return this.$input().val()},_field_fieldValueDidChange:function(){SC.RunLoop.begin();this.fieldValueDidChange(NO);SC.RunLoop.end()},fieldValueDidChange:function(a){this.setIfChanged("value",this.objectForFieldValue(this.getFieldValue(),a))},_field_valueDidChange:function(){this.setFieldValue(this.get("fieldValue"))}.observes("fieldValue"),didCreateLayer:function(){this.setFieldValue(this.get("fieldValue"));SC.Event.add(this.$input(),"change",this,this._field_fieldValueDidChange)},
+didAppendToDocument:function(){if(this.get("isTextArea")){this.setFieldValue(this.get("fieldValue"));SC.Event.add(this.$input(),"change",this,this._field_fieldValueDidChange)}},willDestroyLayer:function(){SC.Event.remove(this.$input(),"change",this,this._field_fieldValueDidChange)},mouseDown:function(a){this._field_isMouseDown=YES;a.allowDefault();return YES},mouseOut:function(a){this._field_isMouseDown&&this.set("isActive",NO);a.allowDefault();return YES},mouseOver:function(a){this.set("isActive",
+this._field_isMouseDown);a.allowDefault();return YES},mouseUp:function(a){this._field_isMouseDown&&this.set("isActive",NO);this._field_isMouseDown=NO;a.allowDefault();return YES},keyDown:function(a){if(a.which===9){var b=a.shiftKey?this.get("previousValidKeyView"):this.get("nextValidKeyView");b?b.becomeFirstResponder():a.allowDefault();return YES}if(this.performValidateKeyDown(a)){this._isKeyDown=YES;a.allowDefault()}else a.stop();return YES},acceptsFirstResponder:function(){return SC.SAFARI_FOCUS_BEHAVIOR?
+NO:this.get("isEnabled")}.property("isEnabled"),willBecomeKeyResponderFrom:function(){if(!this._isFocused){this._isFocused=YES;this.becomeFirstResponder();this.get("isVisibleInWindow")&&this.$input()[0].focus()}},willLoseKeyResponderTo:function(){if(this._isFocused)this._isFocused=NO},_field_setFieldValue:function(a){this.propertyWillChange("fieldValue");if(this.fieldValueForObject)a=this.fieldValueForObject(a);a=this.setFieldValue(a);this.propertyDidChange("fieldValue");return a},_field_getFieldValue:function(){var a=
+this.getFieldValue();if(this.objectForFieldValue)a=this.objectForFieldValue(a);return a}});
+SC.TextSelection=SC.Object.extend(SC.Copyable,SC.Freezable,{start:-1,end:-1,length:function(){var a=this.get("start"),b=this.get("end");return a===-1||b===-1?-1:b-a}.property("start","end").cacheable(),init:function(){arguments.callee.base.apply(this,arguments);this.freeze()},copy:function(){return SC.TextSelection.create({start:this.get("start"),end:this.get("end")})},toString:function(){var a=this.get("length");return a&&a>0?a===1?"[%@ character selected: {%@, %@}]".fmt(a,this.get("start"),this.get("end")):
+"[%@ characters selected: {%@, %@}]".fmt(a,this.get("start"),this.get("end")):"[no text selected; caret at %@]".fmt(this.get("start"))}});SC.StaticLayout={hasStaticLayout:YES,useStaticLayout:NO,renderMixin:function(a){a.setClass("sc-static-layout",this.get("useStaticLayout"))},parentViewDidResize:function(){return null},beginLiveResize:function(){return null},endLiveResize:function(){return null},viewDidResize:function(){return null}};sc_require("views/field");sc_require("system/text_selection");
+sc_require("mixins/static_layout");
+SC.TextFieldView=SC.FieldView.extend(SC.StaticLayout,SC.Editable,{tagName:"label",classNames:["sc-text-field-view"],applyImmediately:YES,isPassword:NO,isTextArea:NO,hint:null,isEditing:NO,leftAccessoryView:null,rightAccessoryView:null,_isFocused:NO,_ignoreBlur:null,routeTouch:NO,isEditable:function(){return this.get("isEnabled")}.property("isEnabled").cacheable(),selection:function(a,b){a=this.$input()[0];var c,d;if(b===undefined)if(a){c=d=null;if(a.value){if("selectionStart"in a)d=a.selectionStart;
+if("selectionEnd"in a)c=a.selectionEnd;if(d===null||c===null)if(b=document.selection){var e=b.type;if(e&&(e==="None"||e==="Text")){c=b.createRange();if(this.get("isTextArea")){d=c.duplicate();d.moveToElementText(a);d.setEndPoint("EndToStart",c);d=d.text.length;c=d+c.text.length}else{b=c.text.length;d=Math.abs(c.moveStart("character",0-(a.value.length+1)));c=d+b}}}}else d=c=0;return SC.TextSelection.create({start:d,end:c})}else return null;else{if(!b||!b.kindOf||!b.kindOf(SC.TextSelection))throw"When setting the selection, you must specify an SC.TextSelection instance.";
+if(a)if(a.setSelectionRange)a.setSelectionRange(b.get("start"),b.get("end"));else{c=a.createTextRange();d=b.get("start");c.move("character",d);c.moveEnd("character",b.get("end")-d);c.select()}return b}}.property("fieldValue").cacheable(),displayProperties:"hint fieldValue isEditing leftAccessoryView rightAccessoryView isTextArea".w(),createChildViews:function(){this.accessoryViewObserver()},acceptsFirstResponder:function(){return this.get("isEnabled")}.property("isEnabled"),accessoryViewObserver:function(){var a,
+b=["leftAccessoryView","rightAccessoryView"],c=b.length,d,e,f,g;for(d=0;d<c;d++){e=b[d];f=this["_"+e];g=this.get(e);if(!(f&&g&&f===g)){if(f){a=f.get("classNames");a=a.without("sc-text-field-accessory-view");f.set("classNames",a);this.removeChild(f);this["_"+e]=null}if(g){if(g.isClass)g=g.create({layoutView:this});a=g.get("classNames");a.indexOf("sc-text-field-accessory-view")<0&&a.push("sc-text-field-accessory-view");this.appendChild(g);this["_"+e]=g}}}}.observes("leftAccessoryView","rightAccessoryView"),
+layoutChildViewsIfNeeded:function(a){a||(a=this.get("isVisibleInWindow"));if(a&&this.get("childViewsNeedLayout")){var b=this.get("rightAccessoryView");if(b&&b.get){var c=b.get("layout");if(c){c.left=null;if(!c.right)c.right=0;b.adjust({layout:c})}}}arguments.callee.base.apply(this,arguments)},render:function(a,b){arguments.callee.base.apply(this,arguments);this.get("isEnabled");SC.guidFor(this);this.get("isPassword");var c,d,e;this.get("isTextArea")&&a.addClass("text-area");c=this.get("fieldValue");
+if(SC.none(c))c="";c=String(c);a.setClass("not-empty",c.length>0);d=this._getAccessoryViewWidths();e=d.left;d=d.right;if(e)e+="px";if(d)d+="px";this._renderField(a,b,c,e,d);SC.browser.mozilla&&this.invokeLast(this._applyFirefoxCursorFix)},_forceRenderFirstTime:NO,_renderFieldLikeFirstTime:function(){this.set("_forceRenderFirstTime",YES)}.observes("isTextArea"),_renderField:function(a,b,c,d,e){var f=this.get("hint"),g,h;if(b||this._forceRenderFirstTime){this._forceRenderFirstTime=NO;b=this.get("isEnabled")?
+"":'disabled="disabled"';g=this.get("layerId");a.push('<span class="border"></span>');h="";if(d||e){h='style="';if(d)h+="left: "+d+"; ";if(e)h+="right: "+e+";";h+='"'}a.push('<span class="padding" '+h+">",'<span class="sc-hint">',f,"</span>");c=this.get("escapeHTML")?SC.RenderContext.escapeHTML(c):c;if(this.get("isTextArea"))a.push('<textarea name="',g,'" ',b,">",c,"</textarea></span>");else{d=this.get("isPassword")?"password":"text";a.push('<input type="',d,'" name="',g,'" ',b,' value="',c,'"/></span>')}}else{a=
+this.$(".sc-hint");if(f!==this._textField_currentHint){this._textField_currentHint=f;a.text(f)}if(a=this.$input()[0]){a.disabled=this.get("isEnabled")?null:"true";a=a.parentNode.style;if(d){if(a.left!==d)a.left=d}else a.left=null;if(e){if(a.right!==e)a.right=e}else a.right=null}}},_getAccessoryViewWidths:function(){var a={},b=["left","right"],c=b.length,d,e,f,g;for(d=0;d<c;d++){e=b[d];if((f=this.get(e+"AccessoryView"))&&f.get)if(g=f.get("frame"))if(g=g.width){if(f=f.get("layout")){f=f[e];g+=f}a[e]=
+g}}return a},didCreateLayer:function(){arguments.callee.base.apply(this,arguments);this.get("isTextArea")?this.invokeLast(this._addTextAreaEvents):this._addTextAreaEvents()},_addTextAreaEvents:function(){var a=this.$input();SC.Event.add(a,"focus",this,this._textField_fieldDidFocus);SC.Event.add(a,"blur",this,this._textField_fieldDidBlur);SC.Event.add(a,"select",this,this._textField_selectionDidChange);if(SC.browser.mozilla){this._cacheInputElement=this.$input();this._cachePaddingElement=this.$(".padding")}},
+willDestroyLayer:function(){arguments.callee.base.apply(this,arguments);var a=this.$input();SC.Event.remove(a,"focus",this,this._textField_fieldDidFocus);SC.Event.remove(a,"blur",this,this._textField_fieldDidBlur);SC.Event.remove(a,"select",this,this._textField_selectionDidChange)},_textField_fieldDidFocus:function(){SC.RunLoop.begin();this.fieldDidFocus();SC.RunLoop.end()},_textField_fieldDidBlur:function(){SC.RunLoop.begin();this._ignoreBlur=true;this.fieldDidBlur();this._ignoreBlur=false;SC.RunLoop.end()},
+fieldDidFocus:function(){this.beginEditing()},fieldDidBlur:function(){this.commitEditing()},_topOffsetForFirefoxCursorFix:3,_applyFirefoxCursorFix:function(){if(parseFloat(SC.browser.mozilla)<1.9&&!this.get("useStaticLayout")){var a,b,c,d,e;e=this._cacheInputElement;if((a=this._cachePaddingElement)&&a[0]){d=a[0];b=SC.$(d).offset();a=SC.browser.compareVersion(1,9,2)<0&&e[0].tagName.toLowerCase()==="input"?b.top+this._topOffsetForFirefoxCursorFix:b.top;b=b.left;c=d.offsetWidth;d=d.offsetHeight;a="position: fixed; top: %@px; left: %@px; width: %@px; height: %@px;".fmt(a,
+b,c,d);if(!this._prevStyle||this._prevStyle!=a)e.attr("style",a);this._prevStyle=a}}return this},_textField_selectionDidChange:function(){this.notifyPropertyChange("selection")},willBecomeKeyResponderFrom:function(){if(this.get("isVisibleInWindow")){var a=this.$input()[0];a&&a.focus();if(!this._txtFieldMouseDown)if(SC.browser.mozilla)this.invokeOnce(this._selectRootElement);else SC.browser.safari?this.invokeLater(this._selectRootElement,1):this._selectRootElement()}},willLoseKeyResponderTo:function(){},
+_selectRootElement:function(){this.$input()[0].select()},didLoseKeyResponderTo:function(){SC.none(this._ignoreBlur)&&this.$input()[0].blur()},parentViewDidResize:function(){SC.browser.mozilla&&this.invokeLast(this._applyFirefoxCursorFix);arguments.callee.base.apply(this,arguments)},keyDown:function(a){if(a.which===13&&!a.isIMEInput&&!this.get("isTextArea"))return NO;if(a.which===27)return NO;if(a.which===9){var b=a.shiftKey?this.get("previousValidKeyView"):this.get("nextValidKeyView");b?b.becomeFirstResponder():
+a.allowDefault();return YES}if(this.performValidateKeyDown(a)){this._isKeyDown=YES;a.allowDefault()}else a.stop();return YES},keyUp:function(a){this.notifyPropertyChange("selection");this._isKeyDown&&this.get("applyImmediately")&&this.invokeLater(this.fieldValueDidChange,1,YES);this._isKeyDown=NO;a.allowDefault();return YES},mouseDown:function(a){var b=this.get("fieldValue");this._txtFieldMouseDown=YES;if(this.get("isEnabled"))if(b&&b.length===0||!b){this.$input()[0].focus();return YES}else{SC.browser.safari||
+this.$input()[0].focus();return arguments.callee.base.apply(this,arguments)}else{a.stop();return YES}},mouseUp:function(a){var b=this.get("fieldValue");this._txtFieldMouseDown=NO;this.notifyPropertyChange("selection");if(this.get("isEnabled"))if(b&&b.length===0||!b){SC.browser.msie<8?this.invokeLater(this.focusIE7,1):this.$input()[0].focus();return YES}else return arguments.callee.base.apply(this,arguments);else{a.stop();return YES}},focusIE7:function(){this.$input()[0].focus()},selectStart:function(){return YES}});
+sc_require("views/text_field");
+SC.InlineTextFieldView=SC.TextFieldView.extend(SC.DelegateSupport,{_topOffsetForFirefoxCursorFix:0,beginEditing:function(a){if(a){var b={},c,d,e=this._delegate=a.delegate;if(this.invokeDelegateMethod(e,"inlineEditorShouldBeginEditing",this)){this.beginPropertyChanges();if(this.get("isEditing")&&!this.blurEditor()){this.endPropertyChanges();return NO}this._optframe=a.frame;this._optIsCollection=a.isCollection;this._exampleElement=a.exampleElement;this._delegate=a.delegate;this.set("delegate",this._delegate);
+if(!this._optframe||!this._delegate)throw"At least frame and delegate options are required for inline editor";this._originalValue=a.value||"";(this._multiline=a.multiline!==undefined?a.multiline:NO)?this.set("isTextArea",YES):this.set("isTextArea",NO);this._commitOnBlur=a.commitOnBlur!==undefined?a.commitOnBlur:YES;this.set("validator",a.validator);this.set("value",this._originalValue);this.set("isEditing",YES);a=this._delegate.pane();b.height=this._optframe.height;b.width=this._optframe.width;c=
+this._delegate.get("layout");d=a.$()[0];b.left=this._optIsCollection&&c.left?this._optframe.x-c.left-d.offsetLeft-1:this._optframe.x-d.offsetLeft-1;SC.browser.msie==7&&b.left--;b.top=this._optIsCollection&&c.top?this._optframe.y-c.top-d.offsetTop:this._optframe.y-d.offsetTop;if(SC.browser.msie==7)b.top-=2;this.set("layout",b);this.set("parentNode",a);a.appendChild(this);SC.RunLoop.begin().end();(this._className=this.getDelegateProperty(e,"inlineEditorClassName"))&&!this.hasClassName(this._className)&&
+this.setClassName(this._className,true);this.invokeDelegateMethod(e,"inlineEditorWillBeginEditing",this);this._previousFirstResponder=a?a.get("firstResponder"):null;this.endPropertyChanges();this.invokeLast(function(){this.becomeFirstResponder();this.invokeDelegateMethod(e,"inlineEditorDidBeginEditing",this)})}}},commitEditing:function(){if(!SC.$ok(this.validateSubmit()))return NO;return this._endEditing(this.get("value"))},discardEditing:function(){return this._endEditing(this._originalValue)},blurEditor:function(){if(!this.get("isEditing"))return YES;
+return this._commitOnBlur?this.commitEditing():this.discardEditing()},_endEditing:function(a){if(!this.get("isEditing"))return YES;var b=this._delegate;if(!this.invokeDelegateMethod(b,"inlineEditorShouldEndEditing",this,a))return NO;this.invokeDelegateMethod(b,"inlineEditorDidEndEditing",this,a);this._className&&this.setClassName(this._className,false);this._originalValue=this._delegate=this._exampleElement=this._optframe=this._className=null;this.set("isEditing",NO);if(this.get("isFirstResponder"))(a=
+this.get("pane"))&&this._previousFirstResponder?a.makeFirstResponder(this._previousFirstResponder):this.resignFirstResponder();this._previousFirstResponder=null;this.get("parentNode")&&this.removeFromParent();return YES},isEditing:NO,mouseDown:function(a){arguments.callee.base.call(this,a);return this.get("isEditing")},keyDown:function(a){a=this.interpretKeyEvents(a);this.fieldValueDidChange(true);return!a?NO:a},insertText:null,willRemoveFromParent:function(){this.$input()[0].blur()},willLoseFirstResponder:function(a){if(a===
+this){this._previousFirstResponder=null;this.$input()[0].blur();return this.blurEditor()}},cancel:function(){this.discardEditing();return YES},fieldValueDidChange:function(a){arguments.callee.base.call(this,a)},insertNewline:function(a){if(this._multiline){a.allowDefault();return arguments.callee.base.call(this,a)}else{this.get("value")!=this.$input().val()&&this.set("value",this.$input().val());this.commitEditing();return YES}},insertTab:function(){this.resignFirstResponder();this.commitEditing();
+if(this._delegate){var a=this._delegate.nextValidKeyView();a&&a.beginEditing&&a.beginEditing()}return YES},insertBacktab:function(){this.commitEditing();if(this._delegate){var a=this._delegate.previousValidKeyView();a&&a.beginEditing()}return YES},deleteForward:function(a){a.allowDefault();return YES},deleteBackward:function(a){a.allowDefault();return YES}});
+SC.InlineTextFieldView.mixin({beginEditing:function(a){this._exampleElement=a.exampleElement;var b=a.exampleInlineTextFieldView?a.exampleInlineTextFieldView:this,c=a.delegate.get("layout"),d=this.updateViewStyle(),e=this.updateViewPaddingStyle(),f=".inline-editor input{"+d+"} ";f=f+".inline-editor textarea{"+d+"} .inline-editor .padding{"+e+"}";d=document.getElementsByTagName("head")[0];e=document.createElement("style");e.type="text/css";e.media="screen";if(e.styleSheet)e.styleSheet.cssText=f;else e.appendChild(document.createTextNode(f));
+d.appendChild(e);this.editor=b.create({classNames:"inline-editor",layout:c});return this.editor.beginEditing(a)},commitEditing:function(){return this.editor?this.editor.commitEditing():YES},discardEditing:function(){return this.editor?this.editor.discardEditing():YES},updateViewStyle:function(){var a=this._exampleElement[0],b="",c=SC.getStyle(a,"font-size");if(c&&c.length>0)b=b+"font-size: "+c+" !important; ";if((c=SC.getStyle(a,"font-family"))&&c.length>0)b=b+"font-family: "+c+" !important; ";if((c=
+SC.getStyle(a,"font-weight"))&&c.length>0)b=b+"font-weight: "+c+" !important; ";if((c=SC.getStyle(a,"z-index"))&&c.length>0)b=b+"z-index: "+c+" !important; ";if((c=SC.getStyle(a,"line-height"))&&c.length>0)b=b+"line-height: "+c+" !important; ";if((c=SC.getStyle(a,"text-align"))&&c.length>0)b=b+"text-align: "+c+" !important; ";if((c=SC.getStyle(a,"top-margin"))&&c.length>0)b=b+"top-margin: "+c+" !important; ";if((c=SC.getStyle(a,"bottom-margin"))&&c.length>0)b=b+"bottom-margin: "+c+" !important; ";
+if((c=SC.getStyle(a,"left-margin"))&&c.length>0)b=b+"left-margin: "+c+" !important; ";if((c=SC.getStyle(a,"right-margin"))&&c.length>0)b=b+"right-margin: "+c+" !important; ";return b},updateViewPaddingStyle:function(){var a=this._exampleElement[0],b="",c=SC.getStyle(a,"padding-top");if(c&&c.length>0)b=b+"top: "+c+" !important; ";if((c=SC.getStyle(a,"padding-bottom"))&&c.length>0)b=b+"bottom: "+c+" !important; ";if((c=SC.getStyle(a,"padding-left"))&&c.length>0)b=b+"left: "+c+" !important; ";if((c=
+SC.getStyle(a,"padding-right"))&&c.length>0)b=b+"right: "+c+" !important; ";return b},editor:null});sc_require("views/view");
+SC.Pane=SC.View.extend({isPane:YES,page:null,rootResponder:null,currentWindowSize:null,computeParentDimensions:function(){var a=this.get("currentWindowSize"),b={x:0,y:0,width:1E3,height:1E3};if(a){b.width=a.width;b.height=a.height}else if(SC.RootResponder.responder){if(a=SC.RootResponder.responder.get("currentWindowSize")){b.width=a.width;b.height=a.height}}else{if(window.innerHeight){b.width=window.innerWidth;b.height=window.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){b.width=
+document.documentElement.clientWidth;b.height=document.documentElement.clientHeight}else if(document.body){b.width=document.body.clientWidth;b.height=document.body.clientHeight}this.windowSizeDidChange(null,b)}return b},frame:function(){return this.computeFrameWithParentFrame(null)}.property(),windowSizeDidChange:function(a,b){this.set("currentWindowSize",b);this.parentViewDidResize();return this},paneLayoutDidChange:function(){this.invokeOnce(this.updateLayout)}.observes("layout"),sendEvent:function(a,
+b,c){for(c||(c=this.get("firstResponder"));c&&!c.tryToPerform(a,b);)c=c===this?null:c.get("nextResponder");if(!c&&(c=this.get("defaultResponder"))){if(typeof c===SC.T_STRING)c=SC.objectForPropertyPath(c);c=c?c.isResponderContext?c.sendAction(a,this,b):c.tryToPerform(a,b)?c:null:null}return b.mouseHandler||c},sendTouchEvent:function(a,b,c){var d,e=NO,f=[];for(c||(c=this.get("firstResponder"));c;){if(c.respondsTo(a))switch(c[a](b)){case SC.MIXED_STATE:f.push(c);break;case YES:f=[c];c=null;e=YES;continue}c=
+c===this?null:c.get("nextResponder")}if(!e&&(c=this.get("defaultResponder"))){if(typeof c===SC.T_STRING)c=SC.objectForPropertyPath(c);if(c)if(c.isResponderContext)f=f.concat(c.sendTouchAction(a,this,b));else{if(c.respondsTo(a))d=c[a](b);switch(d){case SC.MIXED_STATE:f.push(c);break;case YES:f=[c]}}}return f},performKeyEquivalent:function(a,b){var c=arguments.callee.base.apply(this,arguments);if(!c){var d=this.get("defaultResponder");if(d){if(d.performKeyEquivalent)c=d.performKeyEquivalent(a,b);if(!c&&
+d.tryToPerform)c=d.tryToPerform(a,b)}}return c},defaultResponder:null,nextResponder:function(){return null}.property().cacheable(),firstResponder:null,acceptsKeyPane:YES,isKeyPane:NO,becomeKeyPane:function(){if(this.get("isKeyPane"))return this;this.rootResponder&&this.rootResponder.makeKeyPane(this);return this},resignKeyPane:function(){if(!this.get("isKeyPane"))return this;this.rootResponder&&this.rootResponder.makeKeyPane(null);return this},makeFirstResponder:function(a){var b=this.get("firstResponder"),
+c=this.get("isKeyPane");if(b===a)return this;b&&b.willLoseFirstResponder(b);if(c){b&&b.willLoseKeyResponderTo(a);a&&a.willBecomeKeyResponderFrom(b)}b&&b.beginPropertyChanges().set("isFirstResponder",NO).set("isKeyResponder",NO).endPropertyChanges();this.set("firstResponder",a);a&&a.beginPropertyChanges().set("isFirstResponder",YES).set("isKeyResponder",c).endPropertyChanges();if(c){a&&a.didBecomeKeyResponderFrom(b);b&&b.didLoseKeyResponderTo(a)}a&&a.didBecomeFirstResponder(a);return this},_forwardKeyChange:function(a,
+b,c,d){var e;if(a&&(e=this.get("firstResponder"))){c=c?c.get("firstResponder"):null;(a=this.get("firstResponder"))&&a[b](c);d!==undefined&&e&&e.set("isKeyResponder",d)}},willLoseKeyPaneTo:function(a){this._forwardKeyChange(this.get("isKeyPane"),"willLoseKeyResponderTo",a,NO);return this},willBecomeKeyPaneFrom:function(a){this._forwardKeyChange(!this.get("isKeyPane"),"willBecomeKeyResponderFrom",a,YES);return this},didLoseKeyPaneTo:function(a){var b=this.get("isKeyPane");this.set("isKeyPane",NO);this._forwardKeyChange(b,
+"didLoseKeyResponderTo",a);return this},didBecomeKeyPaneFrom:function(a){var b=this.get("isKeyPane");this.set("isKeyPane",YES);this._forwardKeyChange(!b,"didBecomeKeyResponderFrom",a,YES);return this},isMainPane:NO,focusFrom:function(){},blurTo:function(){},blurMainTo:function(){this.set("isMainPane",NO)},focusMainFrom:function(){this.set("isMainPane",YES)},append:function(){return this.appendTo(document.body)},remove:function(){if(!this.get("isVisibleInWindow"))return this;if(!this.get("isPaneAttached"))return this;
+this.set("isVisibleInWindow",NO);var a=this.get("layer");a.parentNode&&a.parentNode.removeChild(a);this.resignKeyPane();a=this.rootResponder;this.get("isMainPane")&&a.makeMainPane(null);a.panes.remove(this);this.rootResponder=null;this.set("isPaneAttached",NO);return this},appendTo:function(a){var b=this.get("layer");b||(b=this.createLayer().get("layer"));if(this.get("isPaneAttached")&&b.parentNode===a)return this;a.insertBefore(b,null);return this.paneDidAttach()},prependTo:function(a){if(this.get("isPaneAttached"))return this;
+var b=this.get("layer");b||(b=this.createLayer().get("layer"));if(this.get("isPaneAttached")&&b.parentNode===a)return this;a.insertBefore(b,a.firstChild);return this.paneDidAttach()},before:function(a){if(this.get("isPaneAttached"))return this;var b=this.get("layer");b||(b=this.createLayer().get("layer"));var c=a.parentNode;if(this.get("isPaneAttached")&&b.parentNode===c)return this;c.insertBefore(b,a);return this.paneDidAttach()},after:function(a){var b=this.get("layer");b||(b=this.createLayer().get("layer"));
+var c=a.parentNode;if(this.get("isPaneAttached")&&b.parentNode===c)return this;c.insertBefore(b,a.nextSibling);return this.paneDidAttach()},removeFromParent:function(){},paneDidAttach:function(){var a=this.rootResponder=SC.RootResponder.responder;a.panes.add(this);this.set("currentWindowSize",a.computeWindowSize());this.set("isPaneAttached",YES);this.parentViewDidChange();this._notifyDidAppendToDocument();return this},isPaneAttached:NO,recomputeIsVisibleInWindow:function(){this.get("isVisibleInWindow");
+var a=this.get("isVisible");this.set("isVisibleInWindow",a);this._needsVisibiltyChange=YES;a&&this.get("layerNeedsUpdate")&&this.updateLayerIfNeeded();a&&this.get("childViewsNeedLayout")&&this.layoutChildViewsIfNeeded();var b=this.get("childViews"),c=b.length,d;for(d=0;d<c;d++)b[d].recomputeIsVisibleInWindow(a);!a&&this.get("isFirstResponder")&&this.resignFirstResponder();if(a){this.parentViewDidResize&&this.parentViewDidResize();this.get("childViewsNeedLayout")&&this.invokeOnce(this.layoutChildViewsIfNeeded)}return this},
+updateLayerLocation:function(){return this},init:function(){var a=!!this.get("layer");arguments.callee.base.apply(this,arguments);var b=this.get("theme");if(!b&&"undefined"!==ENV)b=ENV.theme;if(b){var c=this.get("classNames").copy();c.push(b);this.set("classNames",c)}a&&this.paneDidAttach()},classNames:function(){var a=["sc-pane"],b,c,d,e;b=SC.browser.current;c=SC.browser.windows?"windows":SC.browser.mac?"mac":"other-platform";e=document.documentElement.style;d=e.MozBoxShadow!==undefined||e.webkitBoxShadow!==
+undefined||e.oBoxShadow!==undefined||e.boxShadow!==undefined;e=e.MozBorderRadius!==undefined||e.webkitBorderRadius!==undefined||e.oBorderRadius!==undefined||e.borderRadius!==undefined;d&&a.push("box-shadow");e&&a.push("border-rad");a.push(b);a.push(c);SC.browser.msie==7&&a.push("ie7");SC.browser.mobileSafari&&a.push("mobile-safari");return a}()});sc_require("system/responder");
+SC.ResponderContext=SC.Responder.extend({isResponderContext:YES,trace:NO,defaultResponder:null,nextResponder:function(){return this.get("defaultResponder")}.property("defaultResponder").cacheable(),firstResponder:null,nextResponderFor:function(a){var b=a.get("nextResponder");if(typeof b===SC.T_STRING)b=SC.objectForPropertyPath(b,this);else if(!b&&a!==this)b=this;return b},responderNameFor:function(a){if(a){if(a._scrc_name)return a._scrc_name}else return"(No Responder)";this._findResponderNamesFor(this,
+3,this.NAMESPACE?[this.NAMESPACE]:[]);return a._scrc_name||a.toString()},_findResponderNamesFor:function(a,b,c){var d,e;for(d in a)if(d!=="nextResponder")if((e=a[d])&&e.isResponder)if(!e._scrc_name){c.push(d);e._scrc_name=c.join(".");b>0&&this._findResponderNamesFor(e,b-1,c);c.pop()}},makeFirstResponder:function(a){var b=this.get("firstResponder"),c=this.get("nextResponder"),d=this.get("trace");if(this._locked){d&&SC.Logger.log("%@: AFTER ACTION: makeFirstResponder => %@".fmt(this,this.responderNameFor(a)));
+this._pendingResponder=a}else{d&&SC.Logger.log("%@: makeFirstResponder => %@".fmt(this,this.responderNameFor(a)));a.set("becomingFirstResponder",YES);this._locked=YES;this._pendingResponder=null;for(d=a?a:null;d;){if(d.get("hasFirstResponder"))break;d=d===c?null:this.nextResponderFor(d)}d||(d=c);this._notifyWillLoseFirstResponder(b,b,d);b&&b.set("isFirstResponder",NO);this.beginPropertyChanges();this.set("firstResponder",a);a&&a.set("isFirstResponder",YES);this._notifyDidBecomeFirstResponder(a,a,
+d);this.endPropertyChanges();this._locked=NO;if(this._pendingResponder){this.makeFirstResponder(this._pendingResponder);this._pendingResponder=null}a.set("becomingFirstResponder",NO);return this}},_notifyWillLoseFirstResponder:function(a,b,c){if(b!==c){b.willLoseFirstResponder(a);b.set("hasFirstResponder",NO);(b=this.nextResponderFor(b))&&this._notifyWillLoseFirstResponder(a,b,c)}},_notifyDidBecomeFirstResponder:function(a,b,c){if(b!==c){var d=this.nextResponderFor(b);d&&this._notifyDidBecomeFirstResponder(a,
+d,c);b.set("hasFirstResponder",YES);b.didBecomeFirstResponder(a)}},sendAction:function(a,b,c){var d=this.get("firstResponder"),e=this.get("nextResponder"),f=this.get("trace"),g=NO;this._locked=YES;for(f&&SC.Logger.log("%@: begin action '%@' (%@, %@)".fmt(this,a,b,c));!g&&d;){if(d.tryToPerform)g=d.tryToPerform(a,b,c);g||(d=d===e?null:this.nextResponderFor(d))}if(f)g?SC.Logger.log("%@: action '%@' handled by %@".fmt(this,a,this.responderNameFor(d))):SC.Logger.log("%@:  action '%@' NOT HANDLED".fmt(this,
+a));this._locked=NO;if(a=this._pendingResponder){this._pendingResponder=null;this.makeFirstResponder(a)}return d}});sc_require("system/responder_context");SC.Application=SC.ResponderContext.extend({});sc_require("core");
+SC.Benchmark={verbose:NO,enabled:YES,stats:{},globalStartTime:null,start:function(a,b,c,d){if(this.enabled){c=c||Date.now();b=b?this._subStatFor(a,b):this._statFor(a);d&&b._starts.length>0?b._starts.push("ignore"):b._starts.push(c);b._times.push({start:c,_subStats:{}});return a}},end:function(a,b,c){if(this.enabled){b=b?this._subStatFor(a,b):this._statFor(a);var d=b._starts.pop();if(d){if(d!="ignore"){c=c||Date.now();d=c-d;b._times[b._times.length-1].end=c;b._times[b._times.length-1].dur=d;b.amt+=
+d;b.runs++;this.verbose&&this.log(a)}}else SC.Logger.log('SC.Benchmark "%@" ended without a matching start.  No information was saved.'.fmt(a))}},setGlobalStartTime:function(a){this.globalStartTime=a},bench:function(a,b,c){b||(b="bench%@".fmt(this._benchCount++));c||(c=1);for(var d;--c>=0;){var e=SC.Benchmark.start(b);d=a();SC.Benchmark.end(e)}return d},install:function(a,b,c){a["b__"+b]=a[b];var d=a["b__"+b];a[b]=function(){var e="%@(%@)".fmt(b,$A(arguments).join(", "));SC.Benchmark.start(e,c);var f=
+d.apply(this,arguments);SC.Benchmark.end(e);return f}},restore:function(a,b){a[b]=a["b__"+b]},report:function(a){if(a)return this._genReport(a);a=[];for(var b in this.stats)this.stats.hasOwnProperty(b)&&a.push(this._genReport(b));return a.join("\n")},timelineReport:function(a){a=a?"SproutCore Application":a;a=[a,"User-Agent: %@".fmt(navigator.userAgent),"Report Generated: %@ (%@)".fmt((new Date).toString(),Date.now()),""];for(var b=this._compileChartData(true),c=0;c<b.length;c++)b[c][4]?a.push(this._timelineGenSubReport(b[c])):
+a.push(this._timelineGenReport(b[c]));return a.join("\n")},timelineChart:function(a){var b=0;this.hideChart();var c=this._compileChartData(false),d=c.length;if(d!==0){var e=this.globalStartTime?this.globalStartTime:c[0][1];b=c[d-1][2]-e;var f=50+d*30,g=Math.ceil(b/200)+1,h=g*50,j=document.createElement("div");j.className="sc-benchmark-graph";document.body.appendChild(j);var k=document.createElement("div");k.innerHTML=(a?a:"SproutCore Application")+(" - Total Captured Time: "+b+" ms - Points Captured: "+
+d)+' [<a href="javascript:SC.Benchmark.hideChart();">Hide Chart</a>]';k.className="sc-benchmark-title";j.appendChild(k);b=document.createElement("div");b.className="sc-benchmark-top";b.style.width=h+"px";j.appendChild(b);for(b=0;b<g;b++){a=document.createElement("div");a.className="sc-benchmark-tick";a.style.left=b*50+"px";a.style.height=f+"px";k=document.createElement("div");k.className="sc-benchmark-tick-label";k.style.left=b*50+"px";k.innerHTML=b*200+" ms";j.appendChild(a);j.appendChild(k)}for(b=
+0;b<d;b++){f=document.createElement("div");f.style.top=75+b*30+"px";f.style.width=h+"px";f.className=b%2===0?"sc-benchmark-row even":"sc-benchmark-row";j.appendChild(f);f=document.createElement("div");g=c[b][1];a=c[b][2];k=c[b][3];f.innerHTML="&nbsp;"+(c[b][0]+" <span class='sc-benchmark-emphasis'>"+k+"ms</span>");f.className="sc-benchmark-bar";f.style.cssText="left:"+(g-e)/4+"px; width: "+k/4+"px; top: "+(53+b*30)+"px;";f.title="start: "+(g-e)+" ms, end: "+(a-e)+" ms, duration: "+k+" ms";j.appendChild(f)}this._graph=
+j}},hideChart:function(){if(this._graph)try{document.body.removeChild(this._graph)}catch(a){}},log:function(a){SC.Logger.log(this.report(a))},startProfile:function(a){this.enabled&&console&&console.profile&&console.profile(a)},endProfile:function(a){this.enabled&&console&&console.profileEnd&&console.profileEnd(a)},_compileChartData:function(a){var b=[],c;for(var d in this.stats)for(var e=this.stats[d],f=0;f<e._times.length;f++){var g=e._times[f];c=e._times.length>1?f+1+" - "+d:d;b.push([c,g.start,
+g.end,g.dur,false]);if(a){g=g._subStats;for(var h in g)for(var j=g[h],k=0;k<j._times.length;k++){var l=j._times[k];c=j._times.length>1?k+1+" - "+h:h;b.push([c,l.start,l.end,l.dur,true])}}}b.sort(function(m,n){if(m[1]<n[1])return-1;else if(m[1]==n[1]){if(m[3]&&!n[3])return-1;if(!m[3]&&n[3])return 1;return 0}return 1});return b},_genReport:function(a){var b=this._statFor(a);return"BENCH %@ msec: %@ (%@x)".fmt(b.runs>0?Math.floor(b.amt*1E3/b.runs)/1E3:0,b.name||a,b.runs)},_timelineGenReport:function(a){return this.globalStartTime?
+"BENCH start: %@ msec, duration: %@ msec,  %@".fmt(a[1]-this.globalStartTime,a[3],a[0]):"BENCH duration: %@ msec, %@".fmt(a[3],a[0])},_timelineGenSubReport:function(a){return this.globalStartTime?"   CHECKPOINT BENCH start: %@ msec, duration: %@ msec,  %@".fmt(a[1]-this.globalStartTime,a[3],a[0]):"   CHECKPOINT BENCH duration: %@ msec, %@".fmt(a[3],a[0])},_subStatFor:function(a,b){if(this.stats[b]._times.length!==0){b=this.stats[b]._times[this.stats[b]._times.length-1]._subStats;var c=b[a];if(!c){b[a]=
+{runs:0,amt:0,name:a,_starts:[],_times:[]};c=b[a]}return c}},_statFor:function(a){var b=this.stats[a];if(!b){this.stats[a]={runs:0,amt:0,name:a,_starts:[],_times:[]};b=this.stats[a]}return b},reset:function(){this.stats={}},_bench:function(a,b){SC.Benchmark.bench(a,b,1)},_benchCount:1};SC.Benchmark=SC.Benchmark;
+SC.mixin({logBundleLoading:NO,bundleIsLoaded:function(a){return tiki.ready(a)},loadBundle:function(a,b,c){if(c===undefined&&SC.typeOf(b)===SC.T_FUNCTION){c=b;b=null}var d=SC.A(arguments).slice(3);if(b&&c===undefined){c=b;b=this}var e=function(){if(SC.T_STRING===typeof b)b=SC.objectForPropertyPath(b);if(SC.T_STRING===typeof c)c=SC.objectForPropertyPath(c,b);if(b){if(SC.T_STRING===typeof c)c=b[c];if(!c)throw"could not find callback for load";SC.RunLoop.begin();c.apply(b,d);SC.RunLoop.end()}e=b=c=null};
+tiki.async(a).then(function(){tiki.require("tiki").ready(this,e)})}});sc_require("system/locale");SC.IMAGE_ABORTED_ERROR=SC.$error("SC.Image.AbortedError","Image",-100);SC.IMAGE_FAILED_ERROR=SC.$error("SC.Image.FailedError","Image",-101);
+SC.imageCache=SC.Object.create({loadLimit:4,activeRequests:0,loadImage:function(a,b,c,d){SC.typeOf(b);if(SC.none(c)&&SC.typeOf(b)===SC.T_FUNCTION)c=b=null;if(SC.typeOf(c)===SC.T_STRING)c=b[c];if(SC.none(d))d=SC.none(b)&&SC.none(c);a=this._imageEntryFor(a);if(a.status===this.IMAGE_LOADED){if(c)c.call(b||a.image,a.url,a.image)}else{if(b||c)this._addCallback(a,b,c);a.retainCount++;this._scheduleImageEntry(a,d)}},releaseImage:function(a,b,c){a=this._imageEntryFor(a,NO);if(!a)return this;if(--a.retainCount<=
+0)this._deleteEntry(a);else if(b||c){SC.typeOf(b);if(SC.none(c)&&SC.typeOf(b)===SC.T_FUNCTION)c=b=null;if(SC.typeOf(c)===SC.T_STRING)c=b[c];this._removeCallback(a,b,c)}},reloadImage:function(a){if((a=this._imageEntryFor(a,NO))&&a.status===this.IMAGE_LOADED)a.status=this.IMAGE_WAITING},loadNextImage:function(){var a=null,b;if(!(this.get("activeRequests")>=this.get("loadLimit"))){for(b=this._foregroundQueue;b.length>0&&!a;)a=b.shift();if(!a)for(b=this._backgroundQueue;b.length>0&&!a;)a=b.shift();this.set("isLoading",
+!!a);if(a){b=a.image;b.onabort=this._imageDidAbort;b.onerror=this._imageDidError;b.onload=this._imageDidLoad;b.src=a.url;this._loading.push(a);this.incrementProperty("activeRequests");this.loadNextImage()}}},_imageEntryFor:function(a,b){if(b===undefined)b=YES;var c=this._images[a];if(!c&&b){b=new Image;c=this._images[a]={url:a,status:this.IMAGE_WAITING,callbacks:[],retainCount:0,image:b};b.entry=c}return c},_deleteEntry:function(a){this._unscheduleImageEntry(a);delete this._images[a.url]},_addCallback:function(a,
+b,c){a=a.callbacks;a.find(function(d){return d[0]===b&&d[1]===c},this)||a.push([b,c]);a=null;return this},_removeCallback:function(a,b,c){var d=a.callbacks;d.forEach(function(e,f){if(e[0]===b&&e[1]===c)d[f]=null},this);d=null;return this},_scheduleImageEntry:function(a,b){var c=this._backgroundQueue,d=this._foregroundQueue;if(a.status===this.IMAGE_LOADED)return this;if(a.status===this.IMAGE_QUEUED&&!b&&a.isBackground){c[c.indexOf(a)]=null;a.status=this.IMAGE_WAITING}if(a.status!==this.IMAGE_QUEUED){(b?
+c:d).push(a);a.status=this.IMAGE_QUEUED;a.isBackground=b}this.isLoading||this.invokeLater(this.loadNextImage,100);this.set("isLoading",YES);return this},_unscheduleImageEntry:function(a){if(a.status!==this.IMAGE_QUEUED)return this;var b=a.isBackground?this._backgroundQueue:this._foregroundQueue;b[b.indexOf(a)]=null;if(this._loading.indexOf(a)>=0){b.image.abort();this.imageStatusDidChange(a,this.ABORTED)}return this},_imageDidAbort:function(){SC.imageCache.imageStatusDidChange(this.entry,SC.imageCache.ABORTED)},
+_imageDidError:function(){SC.imageCache.imageStatusDidChange(this.entry,SC.imageCache.ERROR)},_imageDidLoad:function(){SC.imageCache.imageStatusDidChange(this.entry,SC.imageCache.LOADED)},imageStatusDidChange:function(a,b){if(a){var c=a.url,d;switch(b){case this.LOADED:d=a.image;break;case this.ABORTED:d=SC.IMAGE_ABORTED_ERROR;break;case this.ERROR:d=SC.IMAGE_FAILED_ERROR;break;default:d=SC.IMAGE_FAILED_ERROR;break}a.callbacks.forEach(function(f){f[1].call(f[0],c,d)},this);a.callbacks=[];a.status=
+b===this.LOADED?this.IMAGE_LOADED:this.IMAGE_WAITING;var e=a.image;if(e){e.onload=e.onerror=e.onabort=null;if(b!==this.LOADED)a.image=null}this._loading[this._loading.indexOf(a)]=null;if(this._loading.length>this.loadLimit*2)this._loading=this._loading.compact();this.decrementProperty("activeRequests");this.loadNextImage()}},init:function(){arguments.callee.base.apply(this,arguments);this._images={};this._loading=[];this._foregroundQueue=[];this._backgroundQueue=[]},IMAGE_LOADED:"loaded",IMAGE_QUEUED:"queued",
+IMAGE_WAITING:"waiting",ABORTED:"aborted",ERROR:"error",LOADED:"loaded"});SC.Math=SC.Object.create({near:function(a,b,c){c||(c=1.0E-5);return Math.abs(a-b)<=c},round:function(a,b){b||(b=0);var c=Math.pow(10,b);if(b<0){b=c.toString();c=b.substring(0,b.indexOf("1")+1)}a=a.valueOf();return Math.round(a*c)/c}});
+SC.Page=SC.Object.extend({owner:null,get:function(a){var b=this[a];if(b&&b.isClass){this[a]=b=b.create({page:this});this.get("inDesignMode")||b.awake();return b}else return arguments.callee.base.apply(this,arguments)},awake:function(){var a,b;for(b in this)if(this.hasOwnProperty(b))if((a=this[b])&&a.isViewClass)this[b]=a.create({page:this});return this},getIfConfigured:function(a){var b=this[a];return b&&b.isViewClass?null:this.get(a)},loc:function(a){var b,c;for(c in a)if(a.hasOwnProperty(c))(b=
+this[c])&&b.isViewClass&&b.loc(a[c]);return this}});SC.Page.design=SC.Page.create;SC.Page.localization=function(a){return a};sc_require("system/event");
+SC.mixin({_isReadyBound:NO,_bindReady:function(){if(!this._isReadyBound){this._isReadyBound=YES;tiki.require("tiki").ready.main(SC,SC._didBecomeReady)}},_readyQueue:[],_afterReadyQueue:[],isReady:NO,_didBecomeReady:function(){if(!SC.isReady){typeof SC.mapDisplayNames===SC.T_FUNCTION&&SC.mapDisplayNames();typeof SC.addInvokeOnceLastDebuggingInfo===SC.T_FUNCTION&&SC.addInvokeOnceLastDebuggingInfo();SC.Locale.createCurrentLocale();if(document&&document.getElementsByTagName){var a=document.getElementsByTagName("body")[0];
+if(a){var b=a.className,c=SC.Locale.currentLanguage.toLowerCase();a.className=b&&b.length>0?[b,c].join(" "):c}}SC.Benchmark.start("ready");SC.RunLoop.begin();var d;do{a=SC._readyQueue;SC._readyQueue=[];b=0;for(c=a.length;b<c;b++){d=a[b];var e=d[0]||document;(d=d[1])&&d.call(e)}}while(SC._readyQueue.length>0);SC.isReady=YES;SC._readyQueue=null;SC.Event.trigger("ready",null,document,NO);SC.removeLoading&&SC.$("#loading").remove();if(SC.userDefaults.get("ready"))SC.mode===SC.APP_MODE&&typeof main!="undefined"&&
+main instanceof Function&&!SC.suppressMain&&main();else SC.userDefaults.readyCallback(window,main);SC.routes&&SC.routes.ping&&SC.routes.ping();SC.RunLoop.end();SC.Benchmark.end("ready");SC.Benchmark.log()}},ready:function(a,b){var c=this._readyQueue;if(b===undefined){b=a;a=null}else if(SC.typeOf(b)===SC.T_STRING)b=a[b];if(!b)return this;if(this.isReady)return b.call(a||document);c.push([a,b]);return this}});SC._bindReady();SC.removeLoading=YES;SC.APP_MODE="APP_MODE";SC.TEST_MODE="TEST_MODE";
+SC.mode=SC.APP_MODE;sc_require("system/builder");SC.MODE_REPLACE="replace";SC.MODE_APPEND="append";SC.MODE_PREPEND="prepend";
+SC.RenderContext=SC.Builder.create({SELF_CLOSING:SC.CoreSet.create().addEach("area base basefront br hr input img link meta".w()),init:function(a,b){if(a===undefined)a="div";if(b){this.prevObject=b;this.strings=b.strings;this.offset=b.length+b.offset}if(!this.strings)this.strings=[];this.needsContent=YES;if(SC.typeOf(a)===SC.T_STRING){this._tagName=a.toLowerCase();this._needsTag=YES;for(a=this;a;){a.length++;a=a.prevObject}this.strings.push(null);this._selfClosing=this.SELF_CLOSING.contains(this._tagName)}else{this._elem=
+a;this._needsTag=NO;this.length=0;this.needsContent=NO}return this},strings:null,offset:0,length:0,updateMode:SC.MODE_REPLACE,needsContent:NO,get:function(a){var b=this.strings||[];return a===undefined?b.slice(this.offset,this.length):b[a+this.offset]},push:function(a){var b=this.strings,c=arguments.length;if(!b)this.strings=b=[];c>1?b.push.apply(b,arguments):b.push(a);for(b=this;b;){b.length+=c;b=b.prevObject}this.needsContent=YES;return this},text:function(){var a=arguments.length,b=0;for(b=0;b<
+a;b++)this.push(SC.RenderContext.escapeHTML(arguments[b]));return this},join:function(a){this._needsTag&&this.end();var b=this.strings;return b?b.join(a||""):""},begin:function(a){return SC.RenderContext(a,this)},element:function(){if(this._elem)return this._elem;var a;if(!SC.RenderContext.factory)SC.RenderContext.factory=document.createElement("div");SC.RenderContext.factory.innerHTML=this.join();if(SC.RenderContext.factory.innerHTML.length>0){a=SC.RenderContext.factory.firstChild.cloneNode(true);
+SC.RenderContext.factory.innerHTML=""}else a=null;return a},remove:function(a){if(a){var b=this._elem;if(b&&b.removeChild)(a=document.getElementById(a))&&b.removeChild(a)}},update:function(){var a=this._elem,b=this.updateMode,c,d,e,f;this._innerHTMLReplaced=NO;if(a){if(this.length>0){this._innerHTMLReplaced=YES;if(b===SC.MODE_REPLACE)a.innerHTML=this.join();else{b=a.cloneNode(false);b.innerHTML=this.join();for(b=b.firstChild;b;){f=b.nextSibling;a.insertBefore(b,f);b=f}}}if(this._attrsDidChange&&(d=
+this._attrs))for(c in d)if(d.hasOwnProperty(c))d[c]===null?a.removeAttribute(c):SC.$(a).attr(c,d[c]);if(this._classNamesDidChange&&(d=this._classNames))SC.$(a).attr("class",d.join(" "));if(this._idDidChange&&(d=this._id))SC.$(a).attr("id",d);if(this._stylesDidChange&&(e=this._styles)){b=this._STYLE_PAIR_ARRAY;f=this._JOIN_ARRAY;for(c in e)if(e.hasOwnProperty(c)){d=e[c];if(d!==null){if(typeof d===SC.T_NUMBER)d=d.toString()+"px";b[0]=c.dasherize();b[1]=d;f.push(b.join(": "))}}SC.$(a).attr("style",f.join("; "));
+f.length=0}this._elem=null;return this.prevObject||this}},_DEFAULT_ATTRS:{},_TAG_ARRAY:[],_JOIN_ARRAY:[],_STYLE_PAIR_ARRAY:[],end:function(){var a=this._TAG_ARRAY,b,c,d,e=this._attrs;b=this._classNames;c=this._id;var f=this._styles;a[0]="<";a[1]=this._tagName;if(e||b||f||c){if(!e)e=this._DEFAULT_ATTRS;if(c)e.id=c;if(b)e["class"]=b.join(" ");if(f){c=this._JOIN_ARRAY;b=this._STYLE_PAIR_ARRAY;for(d in f)if(f.hasOwnProperty(d)){b[0]=d.dasherize();b[1]=f[d];if(b[1]!==null){if(typeof b[1]===SC.T_NUMBER)b[1]+=
+"px";c.push(b.join(": "))}}e.style=c.join("; ");c.length=0}a.push(" ");for(d in e)e.hasOwnProperty(d)&&e[d]!==null&&a.push(d,'="',e[d],'" ');if(e===this._DEFAULT_ATTRS){delete e.style;delete e["class"];delete e.id}}d=this.strings;e=this._selfClosing===NO?NO:this.length===1;a.push(e?" />":">");d[this.offset]=a.join("");a.length=0;if(!e){a[0]="</";a[1]=this._tagName;a[2]=">";d.push(a.join(""));for(d=this;d;){d.length++;d=d.prevObject}a.length=0}this._elem=null;return this.prevObject||this},tag:function(a,
+b){return this.begin(a,b).end()},tagName:function(a){if(a===undefined){if(!this._tagName&&this._elem)this._tagName=this._elem.tagName;return this._tagName}else{this._tagName=a;this._tagNameDidChange=YES;return this}},id:function(a){if(a===undefined){if(!this._id&&this._elem)this._id=this._elem.id;return this._id}else{this._id=a;this._idDidChange=YES;return this}},classNames:function(a,b){if(a===undefined){if(!this._classNames&&this._elem)this._classNames=(SC.$(this._elem).attr("class")||"").split(" ");
+if(this._cloneClassNames){this._classNames=(this._classNames||[]).slice();this._cloneClassNames=NO}if(!this._classNames)this._classNames=[];return this._classNames}else{this._classNames=a;this._cloneClassNames=b||NO;this._classNamesDidChange=YES;return this}},hasClass:function(a){return this.classNames().indexOf(a)>=0},addClass:function(a){if(a===undefined||a===null){SC.Logger.warn("You are adding an undefined or empty class"+this.toString());return this}var b=this.classNames();if(SC.typeOf(a)===
+SC.T_STRING){if(b.indexOf(a)<0){b.push(a);this._classNamesDidChange=YES}}else for(var c=0,d=a.length;c<d;c++){var e=a[c];if(b.indexOf(e)<0){b.push(e);this._classNamesDidChange=YES}}return this},removeClass:function(a){var b=this._classNames,c;if(!b&&this._elem)b=this._classNames=(SC.$(this._elem).attr("class")||"").split(" ");if(b&&(c=b.indexOf(a))>=0){if(this._cloneClassNames){b=this._classNames=b.slice();this._cloneClassNames=NO}b[c]=null;this._classNamesDidChange=YES}return this},resetClassNames:function(){this._classNames=
+[];this._classNamesDidChange=YES;return this},setClass:function(a,b){var c,d,e;if(b!==undefined)return b?this.addClass(a):this.removeClass(a);else{b=this._classNames;if(!b&&this._elem)b=this._classNames=(SC.$(this._elem).attr("class")||"").split(" ");if(!b)b=this._classNames=[];if(this._cloneClassNames){b=this._classNames=b.slice();this._cloneClassNames=NO}e=NO;for(d in a)if(a.hasOwnProperty(d)){c=b.indexOf(d);if(a[d]){if(c<0){b.push(d);e=YES}}else if(c>=0){b[c]=null;e=YES}}if(e)this._classNamesDidChange=
+YES}return this},_STYLE_REGEX:/\s*([^:\s]+)\s*:\s*([^;]+)\s*;?/g,styles:function(a,b){var c,d;if(a===undefined){if(!this._styles&&this._elem)if((b=SC.$(this._elem).attr("style"))&&(b=b.toString()).length>0){if(SC.browser.msie)b=b.toLowerCase();a={};c=this._STYLE_REGEX;for(c.lastIndex=0;d=c.exec(b);)a[d[1].camelize()]=d[2];this._styles=a;this._cloneStyles=NO}else this._styles={};else if(this._styles){if(this._cloneStyles){this._styles=SC.beget(this._styles);this._cloneStyles=NO}}else this._styles=
+{};return this._styles}else{this._styles=a;this._cloneStyles=b||NO;this._stylesDidChange=YES;return this}},addStyle:function(a,b){var c,d=NO,e=this.styles();if(typeof a===SC.T_STRING)if(b===undefined)return e[a];else{if(e[a]!==b){e[a]=b;this._stylesDidChange=YES}}else{for(c in a)if(a.hasOwnProperty(c)){b=a[c];if(e[c]!==b){e[c]=b;d=YES}}if(d)this._stylesDidChange=YES}return this},removeStyle:function(a){if(!this._styles&&!this._elem)return this;var b=this.styles();if(b[a]){b[a]=null;this._stylesDidChange=
+YES}},attr:function(a,b){var c,d=this._attrs,e=NO;if(!d)this._attrs=d={};if(typeof a===SC.T_STRING)if(b===undefined)return d[a];else{if(d[a]!==b){d[a]=b;this._attrsDidChange=YES}}else{for(c in a)if(a.hasOwnProperty(c)){b=a[c];if(d[c]!==b){d[c]=b;e=YES}}if(e)this._attrsDidChange=YES}return this}});SC.RenderContext.fn.html=SC.RenderContext.fn.push;SC.RenderContext.fn.css=SC.RenderContext.fn.addStyle;if(!SC.browser.isSafari||parseInt(SC.browser.version,10)<526)SC.RenderContext._safari3=YES;
+SC.RenderContext.escapeHTML=function(a){var b,c;if(SC.none(a))return a;b=this.escapeHTMLElement;if(!b)b=this.escapeHTMLElement=document.createElement("div");c=this.escapeTextNode;if(!c){c=this.escapeTextNode=document.createTextNode("");b.appendChild(c)}c.data=a;a=b.innerHTML;if(SC.RenderContext._safari3)a=a.replace(/>/g,"&gt;");return a};
+SC.Response=SC.Object.extend({isError:NO,errorValue:function(){return this}.property().cacheable(),errorObject:null,request:null,originalRequest:function(){for(var a=this.get("request");a.get("source");)a=a.get("source");return a}.property("request").cacheable(),type:function(){return this.getPath("request.type")}.property("request").cacheable(),address:function(){return this.getPath("request.address")}.property("request").cacheable(),isJSON:function(){return this.getPath("request.isJSON")||NO}.property("request").cacheable(),
+isXML:function(){return this.getPath("request.isXML")||NO}.property("request").cacheable(),listeners:function(){return this.getPath("request.listeners")}.property("request").cacheable(),status:-100,headers:null,encodedBody:null,body:function(){var a=this.get("encodedBody");if(a&&this.get("isJSON"))try{a=SC.json.decode(a)}catch(b){return SC.Error.create({message:b.name+": "+b.message,label:"Response",errorValue:this})}return a}.property("encodedBody").cacheable(),response:function(){return this.get("body")}.property("body").cacheable(),
+isCancelled:NO,timedOut:null,timeoutTimer:null,fire:function(){var a=this.get("request"),b=a?a.get("source"):null;b&&b.willSend&&b.willSend(a,this);a.freeze();this.get("isCancelled")||this.invokeTransport();var c=a.get("timeout");c&&this.set("timeoutTimer",SC.Timer.schedule({target:this,action:"timeoutReached",interval:c,repeats:NO}));!this.get("isCancelled")&&b&&b.didSend&&b.didSend(a,this)},invokeTransport:function(){this.receive(function(){this.set("status",200)},this)},receive:function(a,b){if(!this.get("timedOut")){var c=
+this.get("timeoutTimer");c&&c.invalidate();this.set("timedOut",NO);var d=(c=this.get("request"))?c.get("source"):null;d&&d.willReceive&&d.willReceive(c,this);a.call(b,!this.get("isCancelled"));!this.get("isCancelled")&&d&&d.didReceive&&d.didReceive(c,this);this.get("isCancelled")||this.notify()}SC.Request.manager.transportDidClose(this);return this},cancel:function(){if(!this.get("isCancelled")){this.set("isCancelled",YES);this.cancelTransport();SC.Request.manager.transportDidClose(this)}},timeoutReached:function(){if(this.get("timedOut")===
+null){this.set("timedOut",YES);this.cancelTransport();SC.Request.manager.transportDidClose(this);var a=SC.$error("HTTP Request timed out","Request",408);a.set("errorValue",this);this.set("isError",YES);this.set("errorObject",a);var b=(a=this.get("request"))?a.get("source"):null;!this.get("isCancelled")&&b&&b.didTimeout&&b.didTimeout(a,this)}},cancelTransport:function(){},_notifyListener:function(a,b){var c=a[b];if(!c)return NO;a=(c.params||[]).copy();a.unshift(this);b=c.target;c=c.action;if(SC.typeOf(c)===
+SC.T_STRING)c=b[c];return c.apply(b,a)},notify:function(){var a=this.get("listeners"),b=this.get("status"),c=Math.floor(b/100)*100,d=NO;if(!a)return this;SC.RunLoop.begin();(d=this._notifyListener(a,b))||(d=this._notifyListener(a,c));d||this._notifyListener(a,0);SC.RunLoop.end();return this},toString:function(){return"%@<%@ %@, status=%@".fmt(arguments.callee.base.apply(this,arguments),this.get("type"),this.get("address"),this.get("status"))}});
+SC.XHRResponse=SC.Response.extend({headers:function(){var a=this.get("rawRequest");a=a?a.getAllResponseHeaders():null;var b={};if(!a)return b;a.split("\n").forEach(function(c){var d=c.indexOf(":"),e;if(d>=0){e=c.slice(0,d);c=c.slice(d+1).trim();b[e]=c}},this);return b}.property("status").cacheable(),header:function(a){var b=this.get("rawRequest");return b?b.getResponseHeader(a):null},encodedBody:function(){var a=this.get("rawRequest");return a?this.get("isXML")?a.responseXML:a.responseText:null}.property("status").cacheable(),
+cancelTransport:function(){var a=this.get("rawRequest");a&&a.abort();this.set("rawRequest",null)},invokeTransport:function(){function a(){for(var g=0;g<arguments.length;g++)try{return arguments[g]()}catch(h){}return NO}var b,c,d,e;b=a(function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")});this.set("rawRequest",b);if(e=!!this.getPath("request.isAsynchronous"))if(SC.browser.msie){c=this;d=function(){if(!c)return null;
+var g=c.finishRequest();if(g)c=null;return g};b.onreadystatechange=d}else SC.Event.add(b,"readystatechange",this,this.finishRequest,b);b.open(this.get("type"),this.get("address"),e);d=this.getPath("request.headers");for(var f in d)b.setRequestHeader(f,d[f]);b.send(this.getPath("request.encodedBody"));e||this.finishRequest();return b},finishRequest:function(){var a=this.get("rawRequest"),b,c,d;if(a.readyState===4){this.receive(function(e){if(e){c=-1;try{c=a.status||0}catch(f){}if(c<200||c>=300){try{d=
+a.statusText||""}catch(g){d=""}b=SC.$error(d||"HTTP Request failed","Request",c);b.set("errorValue",this);this.set("isError",YES);this.set("errorObject",b)}this.set("status",c)}},this);a.onreadystatechange=function(){};return YES}return NO}});sc_require("system/response");
+SC.Request=SC.Object.extend(SC.Copyable,SC.Freezable,{isAsynchronous:YES,isJSON:NO,isXML:NO,headers:function(){var a=this._headers;if(!a)a=this._headers={};return a}.property().cacheable(),responseClass:SC.XHRResponse,source:null,address:null,type:"GET",timeout:null,body:null,encodedBody:function(){var a=this.get("body");if(a&&this.get("isJSON"))a=SC.json.encode(a);return a}.property("isJSON","isXML","body").cacheable(),willSend:function(){},didSend:function(){},willReceive:function(){},didReceive:function(){},
+didTimeout:function(){},COPY_KEYS:"isAsynchronous isJSON isXML address type timeout body responseClass willSend didSend willReceive didReceive".w(),copy:function(){for(var a={},b=this.COPY_KEYS,c=b.length,d;--c>=0;){d=b[c];if(this.hasOwnProperty(d))a[d]=this.get(d)}if(this.hasOwnProperty("listeners"))a.listeners=SC.copy(this.get("listeners"));if(this.hasOwnProperty("_headers"))a._headers=SC.copy(this._headers);a.source=this.get("source")||this;return this.constructor.create(a)},header:function(a,
+b){var c;if(SC.typeOf(a)===SC.T_STRING){c=this._headers;if(arguments.length===1)return c?c[a]:null;else{this.propertyWillChange("headers");if(!c)c=this._headers={};c[a]=b;this.propertyDidChange("headers");return this}}else if(b===undefined){c=a;this.beginPropertyChanges();for(a in c)c.hasOwnProperty(a)&&this.header(a,c[a]);this.endPropertyChanges();return this}return this},async:function(a){if(a===undefined)a=YES;return this.set("isAsynchronous",a)},json:function(a){if(a===undefined)a=YES;a&&this.set("isXML",
+NO);return this.set("isJSON",a)},xml:function(a){if(a===undefined)a=YES;a&&this.set("isJSON",NO);return this.set("isXML",a)},_prep:function(){var a=!!this.header("Content-Type");if(this.get("isJSON")&&!a)this.header("Content-Type","application/json");else this.get("isXML")&&!a&&this.header("Content-Type","text/xml");return this},send:function(a){var b=this.get("timeout");if(b){if(!this.get("isAsynchronous"))throw"Timeout values cannot be used with synchronous requests";}else if(b===0)throw"The timeout value must either not be specified or must be greater than 0";
+a&&this.set("body",a);return SC.Request.manager.sendRequest(this.copy()._prep())},resend:function(){var a=this.get("source")?this:this.copy()._prep();return SC.Request.manager.sendRequest(a)},notify:function(a,b,c,d){if(SC.typeOf(a)!==SC.T_NUMBER){d=SC.A(arguments).slice(2);c=b;b=a;a=0}else d=SC.A(arguments).slice(3);var e=this.get("listeners");e||this.set("listeners",e={});e[a]={target:b,action:c,params:d};return this}});
+SC.Request.mixin({getUrl:function(a){return this.create().set("address",a).set("type","GET")},postUrl:function(a,b){a=this.create().set("address",a).set("type","POST");b&&a.set("body",b);return a},deleteUrl:function(a){return this.create().set("address",a).set("type","DELETE")},putUrl:function(a,b){a=this.create().set("address",a).set("type","PUT");b&&a.set("body",b);return a}});
+SC.Request.manager=SC.Object.create(SC.DelegateSupport,{maxRequests:6,inflight:[],pending:[],sendRequest:function(a){if(!a)return null;a=a.get("responseClass").create({request:a});this.get("pending").pushObject(a);this.fireRequestIfNeeded();return a},cancel:function(a){var b=this.get("pending"),c=this.get("inflight");if(b.indexOf(a)>=0){this.propertyWillChange("pending");b.removeObject(a);this.propertyDidChange("pending");return YES}else if(c.indexOf(a)>=0){a.cancel();c.removeObject(a);this.fireRequestIfNeeded();
+return YES}else return NO},cancelAll:function(){if(this.get("pending").length||this.get("inflight").length){this.set("pending",[]);this.get("inflight").forEach(function(a){a.cancel()});this.set("inflight",[]);return YES}else return NO},fireRequestIfNeeded:function(){var a=this.get("pending"),b=this.get("inflight"),c=this.get("maxRequests");if(a.length>0&&b.length<c){a=a.shiftObject();b.pushObject(a);a.fire()}},transportDidClose:function(a){this.get("inflight").removeObject(a);this.fireRequestIfNeeded()}});
+sc_require("system/ready");
+SC.RootResponder=SC.Object.extend({panes:null,init:function(){arguments.callee.base.apply(this,arguments);this.panes=SC.Set.create()},mainPane:null,makeMainPane:function(a){var b=this.get("mainPane");if(b===a)return this;this.beginPropertyChanges();this.get("keyPane")===b&&this.makeKeyPane(a);this.set("mainPane",a);b&&b.blurMainTo(a);a&&a.focusMainFrom(b);this.endPropertyChanges();return this},keyPane:null,previousKeyPanes:[],makeKeyPane:function(a){var b,c;if(a)if(a.get("acceptsKeyPane")){b=this.get("keyPane");
+if(b===a)return this;else{if(b){c=this.get("previousKeyPanes");c.push(b)}a=a}}else return this;else{b=this.get("keyPane");c=this.get("previousKeyPanes");for(a=null;c.length>0;){var d=c.pop();if(d.get("isPaneAttached")&&d.get("acceptsKeyPane")){a=d;break}}}if(!a)if((c=this.get("mainPane"))&&c.get("acceptsKeyPane"))a=c;b&&b.willLoseKeyPaneTo(a);a&&a.willBecomeKeyPaneFrom(b);this.set("keyPane",a);a&&a.didBecomeKeyPaneFrom(b);b&&b.didLoseKeyPaneTo(a);return this},computeWindowSize:function(){return{width:640,
+height:480}},defaultResponder:null,sendAction:function(a,b,c,d,e){return(b=this.targetForAction(a,b,c,d))&&b.isResponderContext?!!b.sendAction(a,c,e):b&&b.tryToPerform(a,c)},_responderFor:function(a,b){var c=a?a.get("defaultResponder"):null;if(a){a=a.get("firstResponder")||a;do if(a.respondsTo(b))return a;while(a=a.get("nextResponder"))}if(typeof c===SC.T_STRING)c=SC.objectForPropertyPath(c);return c?c.isResponderContext?c:c.respondsTo(b)?c:null:null},targetForAction:function(a,b,c,d){if(!a||SC.typeOf(a)!==
+SC.T_STRING)return null;if(b){if(SC.typeOf(b)===SC.T_STRING)b=SC.objectForPropertyPath(b);if(b)if(b.respondsTo&&!b.respondsTo(a))b=null;else if(SC.typeOf(b[a])!==SC.T_FUNCTION)b=null;return b}if(d)return this._responderFor(d,a);c=this.get("keyPane");var e=this.get("mainPane");if(c&&c!==d)b=this._responderFor(c,a);if(!b&&e&&e!==c)b=this._responderFor(e,a);if(!b&&(b=this.get("defaultResponder"))){if(SC.typeOf(b)===SC.T_STRING)(b=SC.objectForPropertyPath(b))&&this.set("defaultResponder",b);if(b)if(b.respondsTo&&
+!b.respondsTo(a))b=null;else if(SC.typeOf(b[a])!==SC.T_FUNCTION)b=null}return b},targetViewForEvent:function(a){return a.target?SC.$(a.target).view()[0]:null},sendEvent:function(a,b,c){var d;SC.RunLoop.begin();a=(d=c?c.get("pane"):this.get("keyPane")||this.get("mainPane"))?d.sendEvent(a,b,c):null;SC.RunLoop.end();return a},sendTouchEvent:function(a,b,c){var d;SC.RunLoop.begin();a=(d=c?c.get("pane"):this.get("keyPane")||this.get("mainPane"))?d.sendTouchEvent(a,b,c):null;SC.RunLoop.end();return a},
+listenFor:function(a,b){a.forEach(function(c){var d=this[c];d&&SC.Event.add(b,c,this,d)},this);b=null;return this},setup:function(){this.listenFor("touchstart touchmove touchend touchcancel".w(),document);if(SC.browser.touch){var a=document.createElement("div");a.id="sc-touch-intercept";a.style.position="absolute";a.style.top="0px";a.style.left="0px";a.style.bottom="0px";a.style.right="0px";a.style.zIndex=999;document.body.appendChild(a);this._touchInterceptElement=a}},touchstart:function(a){try{var b=
+this.targetViewForEvent(a);this._touchViews=this.sendTouchEvent("touchStart",a,b)}catch(c){SC.Logger.warn("Exception during touchStart: %@".fmt(c));this._touchViews=null;return NO}return b?a.hasCustomEventHandling:YES},touchmove:function(a){SC.RunLoop.begin();try{for(var b=this._lastHovered||[],c=[],d=this.targetViewForEvent(a),e,f,g,h;d&&d!==this;){b.indexOf(d)!==-1?d.tryToPerform("touchMoved",a):d.tryToPerform("touchEntered",a);c.push(d);d=d.get("nextResponder")}f=0;for(g=b.length;f<g;f++){d=b[f];
+(e=d.respondsTo("touchExited"))&&c.indexOf(d)===-1&&d.tryToPerform("touchExited",a)}this._lastHovered=c;h=this._touchViews;g=h.length;for(f=0;f<g;f++){d=h[f];if(d.respondsTo("touchDragged"))switch(d.touchDragged(a)){case YES:this.cancelTouch(h,d);h=null;this._touchViews=[d];break;case NO:h.removeObject(d);break}}}catch(j){SC.Logger.warn("Exception during touchMove: %@".fmt(j))}SC.RunLoop.end();return NO},touchend:function(a){try{a.cancel=NO;var b=null,c=this._touchViews,d,e,f;if(c){e=c.get("length");
+for(d=0;d<e;d++){f=c[d];f.respondsTo("touchEnd")&&f.touchEnd(a)}}this._touchViews=null}catch(g){SC.Logger.warn("Exception during touchEnd: %@".fmt(g));this._touchViews=null;return NO}return b?a.hasCustomEventHandling:YES},touchcancel:function(a){a.cancel=YES;return this.touchend(a)},cancelTouch:function(a,b,c){var d,e,f;f=a.get("length");for(e=0;e<f;e++){d=a.objectAt(e);d!==b&&d.tryToPerform("touchCancelled",c)}}});
+SC.ready(SC.RootResponder,SC.RootResponder.ready=function(){(SC.RootResponder.responder=SC.RootResponder.create()).setup()});
+SC.routes=SC.Object.create({location:function(a,b){if(b!==undefined){if(b===null)b="";if(typeof b=="object"){var c=b.route?b.route.split("&"):[""],d=c.shift(),e={};c.forEach(function(f){f=f.split("=");e[f[0]]=f[1]});for(a in b)if(b.hasOwnProperty(a))if(a!="route")e[a]=encodeURIComponent(""+b[a]);c=[d];for(a in e)e.hasOwnProperty(a)&&c.push([a,e[a]].join("="));b=c.join("&")}if(this._location!=b){this._location=b;this._setWindowLocation(b)}}return this._location}.property(),ping:function(){if(!this._didSetupHistory){this._didSetupHistory=
+true;this._setupHistory()}this._checkWindowLocation()},add:function(a,b,c){if(c===undefined&&SC.typeOf(b)===SC.T_FUNCTION){c=b;b=null}else if(SC.typeOf(c)===SC.T_STRING)c=b[c];a=a.split("/");if(!this._routes)this._routes=SC.routes._Route.create();this._routes.addRoute(a,b,c);return this},gotoRoute:function(a){var b={},c;this._lastRoute=a;if((c=a.split("&"))&&c.length>0){a=c.shift();c.forEach(function(d){if((d=d.split("="))&&d.length>1)b[d[0]]=decodeURIComponent(d[1])})}else a="";c=a.split("/");if(!this._routes)this._routes=
+SC.routes._Route.create();if(c=this._routes.functionForRoute(c,b)){a=c._target;(c=c._method)&&c.call(a,b)}},init:function(){arguments.callee.base.call(this);if(SC.browser.isSafari&&parseInt(SC.browser.version,0)<417)SC.mixin(this,this.browserFuncs.safari);else if(SC.browser.isIE)SC.mixin(this,this.browserFuncs.ie);else SC.browser.isMozilla&&SC.mixin(this,this.browserFuncs.firefox);this._didSetupHistory=false},invokeCheckWindowLocation:function(a){var b=this.__checkWindowLocation,c=this;if(!b)b=this.__checkWindowLocation=
+function(){c._checkWindowLocation()};setTimeout(b,a)},browserFuncs:{safari:{_setupHistory:function(){var a=location.hash;this._cloc=a=a&&a.length>0?a.slice(1,a.length):"";this._backStack=[];this._backStack.length=history.length;this._backStack.push(a);this._forwardStack=[];this.invokeCheckWindowLocation(1E3)},_checkWindowLocation:function(){var a=history.length-this._lastLength!==0,b=a?history.length-this._backStack.length:0;this._lastLength=history.length;a&&SC.Logger.log("historyDidChange");if(b)if(b<
+0){this._forwardStack.push(this._cloc);for(a=0;a<Math.abs(b+1);a++)this._forwardStack.push(this._backStack.pop());this._cloc=this._backStack.pop()}else{this._backStack.push(this._cloc);for(a=0;a<b-1;a++)this._backStack.push(this._forwardStack.pop());this._cloc=this._forwardStack.pop()}else if(a&&this._locationDidChange){this.gotoRoute(this._cloc);this._locationDidChange=false}b=this._cloc;a=this.get("location");if(b!=a){this.set("location",b?b:"");this.gotoRoute(b)}this.invokeCheckWindowLocation(50)},
+_setWindowLocation:function(a){if(this._cloc!=a){this._backStack.push(this._cloc);this._forwardStack.length=0;this._cloc=a;location.hash=a&&a.length>0?a:"";this._locationDidChange=true}}},ie:{_setupHistory:function(){this.invokeCheckWindowLocation(1E3)},_checkWindowLocation:function(){var a=this.get("location"),b=location.hash;b=b&&b.length>0?b.slice(1,b.length):"";if(b!=a)this.set("location",b?b:"");this.invokeCheckWindowLocation(100)},_setWindowLocation:function(a){var b=location.hash;b=b&&b.length>
+0?b.slice(1,b.length):"";if(b!=a)location.hash=a&&a.length>0?a:"#";this.gotoRoute(a)}},firefox:{_checkWindowLocation:function(){var a=this.get("location"),b=location.hash;b=b&&b.length>0?b.slice(1,b.length):"";if(b!=a){SC.RunLoop.begin();this.set("location",b?b:"");SC.RunLoop.end()}this.invokeCheckWindowLocation(150)},_setWindowLocation:function(a){var b=location.hash;b=b&&b.length>0?b.slice(1,b.length):"";if(b!=a)location.hash=a&&a.length>0?a:"#";this.gotoRoute(a)}}},_setupHistory:function(){this.invokeCheckWindowLocation(1E3)},
+_checkWindowLocation:function(){var a=this.get("location"),b=decodeURI(location.hash);b=b&&b.length>0?b.slice(1,b.length):"";if(b!==a){SC.RunLoop.begin();this.set("location",b?b:"");SC.RunLoop.end()}this.invokeCheckWindowLocation(150)},_setWindowLocation:function(a){var b=location.hash;b=b&&b.length>0?b.slice(1,b.length):"";if(b!=a)location.hash=a&&a.length>0?encodeURI(a):"#";this.gotoRoute(a)},_routes:null,_Route:SC.Object.extend({_target:null,_method:null,_static:null,_dynamic:null,_wildcard:null,
+addRoute:function(a,b,c){if(!a||a.length===0){this._target=b;this._method=c}else{var d=a.shift(),e=null;switch(d.slice(0,1)){case ":":d=d.slice(1,d.length);var f=this._dynamic[d]||[];e=SC.routes._Route.create();f.push(e);this._dynamic[d]=f;break;case "*":this._wildcard=d=d.slice(1,d.length);this._target=b;this._method=c;break;default:f=this._static[d]||[];e=SC.routes._Route.create();f.push(e);this._static[d]=f}e&&e.addRoute(a,b,c)}},functionForRoute:function(a,b){if(!a||a.length===0)return this;else{var c=
+a.shift(),d=null,e,f,g;if(e=this._static[c]){f=0;for(g=e.length;f<g&&d===null;f++){d=a.slice();d=e[f].functionForRoute(d,b)}}if(d===null)for(var h in this._dynamic){if(e=this._dynamic[h]){f=0;for(g=e.length;f<g&&d===null;f++){d=a.slice();if((d=e[f].functionForRoute(d,b))&&b)b[h]=c}}if(d)break}if(d===null&&this._wildcard){a.unshift(c);if(b)b[this._wildcard]=a.join("/");d=this}return d}},init:function(){arguments.callee.base.call(this);this._static={};this._dynamic={}}})});
+SC.time=function(){var a=SC.beget(fn);a.value=timeOffset;return a};(function(){var a=new Date;SC.mixin(SC.time,{month:function(b,c){a.setTime(b);if(c===undefined)return a.getMonth();a.setMonth(c);return a.getTime()},utc:function(b){a.setTime(b);return b+a.getTimezoneOffset()*60*1E3},local:function(b){a.setTime(b);return b-a.getTimezoneOffset()*60*1E3},parse:function(){},format:function(){}})})();SC.time.fmt=SC.time.format;SC.time.fn={done:function(){return this.value}};
+"month day year".split(" ").forEach(function(a){SC.time.fn[a]=function(b){if(b===undefined)return SC.time[a](this.value);else{this.value=SC.time[a](this.value,b);return this}}});
+var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(a){return(a<0||a>9?"":"0")+a}
+SC.Locale.define("en",{longMonthNames:"January February March April May".split(" "),shortMonthNames:[],shortDateFormat:"dd/mm/yy",longDateFormat:""});
+SC.mixin(Date,{now:function(){return(new Date).getTime()},isDate:function(a,b){if(Date.getDateFromFormat(a,b)==0)return false;return true},compareDates:function(a,b,c,d){a=Date.getDateFromFormat(a,b);c=Date.getDateFromFormat(c,d);if(a==0||c==0)return-1;else if(a>c)return 1;return 0},getDateFromFormat:function(a,b){a+="";b+="";var c=0,d=0,e="",f="",g,h,j=new Date,k=j.getFullYear(),l=j.getMonth()+1,m=1,n=j.getHours(),o=j.getMinutes();j=j.getSeconds();for(var q="";d<b.length;){e=b.charAt(d);for(f="";b.charAt(d)==
+e&&d<b.length;)f+=b.charAt(d++);if(f=="yyyy"||f=="yy"||f=="y"){if(f=="yyyy")h=g=4;if(f=="yy")h=g=2;if(f=="y"){g=2;h=4}k=Date._getInt(a,c,g,h);if(k==null)return 0;c+=k.length;if(k.length==2)k=k>70?1900+(k-0):2E3+(k-0)}else if(f=="MMM"||f=="NNN"){for(e=l=0;e<MONTH_NAMES.length;e++){var t=MONTH_NAMES[e];if(a.substring(c,c+t.length).toLowerCase()==t.toLowerCase())if(f=="MMM"||f=="NNN"&&e>11){l=e+1;if(l>12)l-=12;c+=t.length;break}}if(l<1||l>12)return 0}else if(f=="EE"||f=="E")for(e=0;e<DAY_NAMES.length;e++){f=
+DAY_NAMES[e];if(a.substring(c,c+f.length).toLowerCase()==f.toLowerCase()){c+=f.length;break}}else if(f=="MM"||f=="M"){l=Date._getInt(a,c,f.length,2);if(l==null||l<1||l>12)return 0;c+=l.length}else if(f=="dd"||f=="d"){m=Date._getInt(a,c,f.length,2);if(m==null||m<1||m>31)return 0;c+=m.length}else if(f=="hh"||f=="h"){n=Date._getInt(a,c,f.length,2);if(n==null||n<1||n>12)return 0;c+=n.length}else if(f=="HH"||f=="H"){n=Date._getInt(a,c,f.length,2);if(n==null||n<0||n>23)return 0;c+=n.length}else if(f=="KK"||
+f=="K"){n=Date._getInt(a,c,f.length,2);if(n==null||n<0||n>11)return 0;c+=n.length}else if(f=="kk"||f=="k"){n=Date._getInt(a,c,f.length,2);if(n==null||n<1||n>24)return 0;c+=n.length;n--}else if(f=="mm"||f=="m"){o=Date._getInt(a,c,f.length,2);if(o==null||o<0||o>59)return 0;c+=o.length}else if(f=="ss"||f=="s"){j=Date._getInt(a,c,f.length,2);if(j==null||j<0||j>59)return 0;c+=j.length}else if(f=="a"){if(a.substring(c,c+2).toLowerCase()=="am")q="AM";else if(a.substring(c,c+2).toLowerCase()=="pm")q="PM";
+else return 0;c+=2}else if(a.substring(c,c+f.length)!=f)return 0;else c+=f.length}if(c!=a.length)return 0;if(l==2)if(k%4==0&&k%100!=0||k%400==0){if(m>29)return 0}else if(m>28)return 0;if(l==4||l==6||l==9||l==11)if(m>30)return 0;if(n<12&&q=="PM")n=n-0+12;else if(n>11&&q=="AM")n-=12;return(new Date(k,l-1,m,n,o,j)).getTime()},parseDate:function(a){var b=arguments.length==2?arguments[1]:false;generalFormats=new Array("E NNN dd HH:mm:ss UTC yyyy","y-M-d","y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y",
+"MMM d","d MMM y","d.MMM.y","y MMM d","y.MMM.d");monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");b=new Array("generalFormats",b?"dateFirst":"monthFirst",b?"monthFirst":"dateFirst");var c=null;c=0;var d=(new Date).getTime();switch(a.toLowerCase()){case "yesterday".loc():c=d-864E5;break;case "today".loc():case "now".loc():c=d;break;case "tomorrow".loc():c=d+864E5;break}if(c>0)return new Date(c);for(d=0;d<b.length;d++)for(var e=
+window[b[d]],f=0;f<e.length;f++){c=Date.getDateFromFormat(a,e[f]);if(c==0)c=Date.getDateFromFormat(a,e[f]+" H:m:s");if(c==0)c=Date.getDateFromFormat(a,e[f]+" h:m:s a");if(c!=0)return new Date(c)}return null},_isInteger:function(a){for(var b=0;b<a.length;b++)if("1234567890".indexOf(a.charAt(b))==-1)return false;return true},_getInt:function(a,b,c,d){for(d=d;d>=c;d--){var e=a.substring(b,b+d);if(e.length<c)return null;if(Date._isInteger(e))return e}return null}});
+SC.mixin(Date.prototype,{format:function(a){a+="";var b=this,c="",d=0,e="",f="";e=b.getFullYear()+"";f=b.getMonth()+1;var g=b.getDate(),h=b.getDay(),j=b.getHours(),k=b.getMinutes(),l=b.getSeconds();b={};if(e.length<4)e=""+(e-0+1900);b.y=""+e;b.yyyy=e;b.yy=e.substring(2,4);b.M=f;b.MM=LZ(f);b.MMM=MONTH_NAMES[f-1];b.NNN=MONTH_NAMES[f+11];b.d=g;b.dd=LZ(g);b.E=DAY_NAMES[h+7];b.EE=DAY_NAMES[h];b.H=j;b.HH=LZ(j);b.h=j==0?12:j>12?j-12:j;b.hh=LZ(b.h);b.K=j>11?j-12:j;b.k=j+1;b.KK=LZ(b.K);b.kk=LZ(b.k);b.a=j>
+11?"PM":"AM";b.m=k;b.mm=LZ(k);b.s=l;for(b.ss=LZ(l);d<a.length;){e=a.charAt(d);for(f="";a.charAt(d)==e&&d<a.length;)f+=a.charAt(d++);c+=b[f]!=null?b[f]:f}return c},utcFormat:function(){return(new Date(this.getTime()+this.getTimezoneOffset()*60*1E3)).format("E NNN dd HH:mm:ss UTC yyyy")}});
+SC.Timer=SC.Object.extend({target:null,action:null,isPooled:NO,interval:0,startTime:null,repeats:NO,until:null,isPaused:NO,isScheduled:NO,isValid:YES,lastFireTime:0,fireTime:function(){if(!this.get("isValid"))return-1;var a=this.get("startTime");if(!a||a===0)return-1;var b=this.get("interval"),c=this.get("lastFireTime");if(c<a)c=a;a=this.get("repeats")?b===0?c:a+(Math.floor((c-a)/b)+1)*b:a+b;if((b=this.get("until"))&&b>0&&a>b)a=b;return a}.property("interval","startTime","repeats","until","isValid",
+"lastFireTime").cacheable(),schedule:function(){if(!this.get("isValid"))return this;this.beginPropertyChanges();this.startTime||this.set("startTime",SC.RunLoop.currentRunLoop.get("startTime"));var a=this.get("fireTime"),b=this.get("lastFireTime");if(a>=b){this.set("isScheduled",YES);SC.RunLoop.currentRunLoop.scheduleTimer(this,a)}this.endPropertyChanges();return this},invalidate:function(){this.beginPropertyChanges();this.set("isValid",NO);SC.RunLoop.currentRunLoop.cancelTimer(this);this.action=this.target=
+null;this.endPropertyChanges();this.get("isPooled")&&SC.Timer.returnTimerToPool(this);return this},fire:function(){var a=Date.now();this.set("lastFireTime",a);var b=this.get("fireTime");this.get("isPaused")||this.performAction();b>a?this.schedule():this.invalidate()},performAction:function(){var a=SC.typeOf(this.action);if(a==SC.T_FUNCTION)this.action.call(this.target||this,this);else if(a===SC.T_STRING)if(this.action.indexOf(".")>=0){var b=this.action.split(".");a=b.pop();b=SC.objectForPropertyPath(b,
+window);if((a=b.get?b.get(a):b[a])&&SC.typeOf(a)==SC.T_FUNCTION)a.call(b,this);else throw"%@: Timer could not find a function at %@".fmt(this,this.action);}else SC.RootResponder.responder.sendAction(this.action,this.target,this)},init:function(){arguments.callee.base.apply(this,arguments);if(this.startTime instanceof Date)this.startTime=this.startTime.getTime();if(this.until instanceof Date)this.until=this.until.getTime()},RESET_DEFAULTS:{target:null,action:null,isPooled:NO,isPaused:NO,isScheduled:NO,
+isValid:YES,interval:0,repeats:NO,until:null,startTime:null,lastFireTime:0},reset:function(a){if(!a)a=SC.EMPTY_HASH;this.propertyWillChange("fireTime");var b=this.RESET_DEFAULTS;for(var c in b)if(b.hasOwnProperty(c))this[c]=SC.none(a[c])?b[c]:a[c];this.propertyDidChange("fireTime");return this},removeFromTimerQueue:function(a){var b=this._timerQueuePrevious,c=this._timerQueueNext;if(!b&&!c&&a!==this)return a;if(b)b._timerQueueNext=c;if(c)c._timerQueuePrevious=b;this._timerQueuePrevious=this._timerQueueNext=
+null;return a===this?c:a},scheduleInTimerQueue:function(a,b){this._timerQueueRunTime=b;for(var c=a,d=null;c&&c._timerQueueRunTime<b;){d=c;c=c._timerQueueNext}if(d){d._timerQueueNext=this;this._timerQueuePrevious=d}if(c){c._timerQueuePrevious=this;this._timerQueueNext=c}return c===a?this:a},collectExpiredTimers:function(a,b){if(this._timerQueueRunTime>b)return this;a.push(this);var c=this._timerQueueNext;this._timerQueueNext=null;if(c)c._timerQueuePrevious=null;return c?c.collectExpiredTimers(a,b):
+null}});SC.Timer.schedule=function(a){return(!a||SC.none(a.isPooled)||a.isPooled?this.timerFromPool(a):this.create(a)).schedule()};SC.Timer.timerFromPool=function(a){var b=this._timerPool;if(!b)b=this._timerPool=[];(b=b.pop())||(b=this.create());return b.reset(a)};SC.Timer.returnTimerToPool=function(a){if(!this._timerPool)this._timerPool=[];this._timerPool.push(a);return this};
+SC.UserDefaults=SC.Object.extend({ready:NO,userDomain:null,appDomain:null,_defaults:null,_safari3DB:null,defaults:function(a){this._defaults=a;this.allPropertiesDidChange()},readDefault:function(a){var b=undefined,c,d,e;a=this._normalizeKeyName(a);c=this._userKeyName(a);if(this._written)b=this._written[c];if(SC.browser.msie=="7.0"){d=document.body;try{d.load("SC.UserDefaults")}catch(f){SC.Logger.err("Couldn't load userDefaults in IE7: "+f.description)}}else if(this.HTML5DB_noLocalStorage)e=this._safari3DB;
+else{d=window.localStorage;if(!d&&window.globalStorage)d=window.globalStorage[window.location.hostname]}if(d||e){b=["SC.UserDefaults",c].join("-at-");b=SC.browser.msie=="7.0"?d.getAttribute(b.replace(/\W/gi,"")):e?this.dataHash[b]:d[b];if(SC.none(b))b=undefined;else try{b=SC.json.decode(b)}catch(g){b=undefined}}if((d=this.delegate)&&d.userDefaultsNeedsDefault)b=d.userDefaultsNeedsDefault(this,a,c);if(b===undefined&&this._defaults)b=this._defaults[c]||this._defaults[a];return b},writeDefault:function(a,
+b){var c,d,e,f,g;a=this._normalizeKeyName(a);c=this._userKeyName(a);d=this._written;if(!d)d=this._written={};d[c]=b;if(SC.browser.msie=="7.0")e=document.body;else if(this.HTML5DB_noLocalStorage)g=this._safari3DB;else{e=window.localStorage;if(!e&&window.globalStorage)e=window.globalStorage[window.location.hostname]}f=["SC.UserDefaults",c].join("-at-");if(e||g){var h=SC.json.encode(b);if(SC.browser.msie=="7.0"){e.setAttribute(f.replace(/\W/gi,""),h);e.save("SC.UserDefaults")}else if(g){var j=this;g.transaction(function(l){l.executeSql("delete from SCLocalStorage where key = ?",
+[f],function(){l.executeSql("insert into SCLocalStorage(key, value) VALUES ('"+f+"', '"+h+"');",[],j._nullDataHandler,j.killTransaction)})});this.dataHash[f]=h}else try{e[f]=h}catch(k){SC.Logger.error("Failed using localStorage. "+k)}}(d=this.delegate)&&d.userDefaultsDidChange&&d.userDefaultsDidChange(this,a,b,c);return this},resetDefault:function(a){var b,c,d,e,f,g;b=this._normalizeKeyName(a);c=this._userKeyName(b);this.propertyWillChange(a);this.propertyWillChange(b);(d=this._written)&&delete d[c];
+if(SC.browser.msie=="7.0")e=document.body;else if(this.HTML5DB_noLocalStorage)g=this._safari3DB;else{e=window.localStorage;if(!e&&window.globalStorage)e=window.globalStorage[window.location.hostname]}f=["SC.UserDefaults",c].join("-at-");if(e)if(SC.browser.msie=="7.0"){e.setAttribute(f.replace(/\W/gi,""),null);e.save("SC.UserDefaults")}else if(g){g.transaction(function(h){h.executeSql("delete from SCLocalStorage where key = ?",[f],null)});delete this.dataHash[f]}else delete e[f];this.propertyDidChange(a);
+this.propertyDidChange(b);return this},unknownProperty:function(a,b){if(b===undefined)return this.readDefault(a);else{this.writeDefault(a,b);return b}},_normalizeKeyName:function(a){if(a.indexOf(":")<0)a=[this.get("appDomain")||"app",a].join(":");return a},_userKeyName:function(a){return[this.get("userDomain")||"(anonymous)",a].join("-at-")},_domainDidChange:function(){var a=NO;if(this.get("userDomain")!==this._scud_userDomain){this._scud_userDomain=this.get("userDomain");a=YES}if(this.get("appDomain")!==
+this._scud_appDomain){this._scud_appDomain=this.get("appDomain");a=YES}a&&this.allPropertiesDidChange()}.observes("userDomain","appDomain"),init:function(){arguments.callee.base.apply(this,arguments);if(SC.userDefaults&&SC.userDefaults.get("dataHash"))if(SC.userDefaults.get("dataHash"))this.dataHash=SC.userDefaults.get("dataHash");this._scud_userDomain=this.get("userDomain");this._scud_appDomain=this.get("appDomain");SC.browser.msie=="7.0"&&document.body.addBehavior("#default#userData");if(this.HTML5DB_noLocalStorage=
+parseInt(SC.browser.safari,0)>523&&parseInt(SC.browser.safari,0)<528){var a;try{if(window.openDatabase)a=openDatabase("scdb","1.0","SproutCore database",65536);else{SC.Logger.error("Trying to load a database with safari version 3.1 to get SC.UserDefaults to work. You are either in a previous version or there is a problem with your browser.");return}}catch(b){SC.Logger.error("Trying to load a database with safari version 3.1 to get SC.UserDefaults to work. You are either in a previous version or there is a problem with your browser.");
+return}if(a){var c=this;a.transaction(function(d){d.executeSql("CREATE TABLE IF NOT EXISTS SCLocalStorage(key TEXT NOT NULL PRIMARY KEY, value TEXT NOT NULL);",[],c._nullDataHandler,c.killTransaction)});a.transaction(function(d){d.parent=c;d.executeSql("SELECT * from SCLocalStorage;",[],function(e,f){for(var g={},h,j=0,k=f.rows.length;j<k;j++){h=f.rows.item(j);g[h.key]=h.value}e.parent.dataHash=g;SC.userDefaults.set("ready",YES)},c.killTransaction)});this._safari3DB=a}}else this.set("ready",YES)},
+_killTransaction:function(){return true},_nullDataHandler:function(){},readyCallback:function(a,b){this.func=b;this.ob=a},readyChanged:function(){if(this.ready===YES){var a=this.func;a&&a.apply(this.ob)}}.observes("ready")});SC.userDefaults=SC.UserDefaults.create();sc_require("system/browser");
+SC.mixin({_downloadFrames:0,_copy_computed_props:["maxWidth","maxHeight","paddingLeft","paddingRight","paddingTop","paddingBottom","fontFamily","fontSize","fontStyle","fontWeight","fontVariant","lineHeight","whiteSpace"],download:function(a){var b=document.createElement("iframe"),c="DownloadFrame_"+this._downloadFrames;SC.$(b).attr("id",c);b.style.border="10px";b.style.width="0px";b.style.height="0px";b.style.position="absolute";b.style.top="-10000px";b.style.left="-10000px";SC.browser.isSafari||
+SC.$(b).attr("src",a);document.getElementsByTagName("body")[0].appendChild(b);SC.browser.isSafari&&SC.$(b).attr("src",a);this._downloadFrames+=1;SC.browser.isSafari||function(){document.body.removeChild(document.getElementById(c));c=null}.invokeLater(null,2E3);b=null},normalizeURL:function(a){if(a.slice(0,1)=="/")a=window.location.protocol+"//"+window.location.host+a;else a.slice(0,5)=="http:"||a.slice(0,6)=="https:"||(a=window.location.href+"/"+a);return a},isPercentage:function(a){return a<1&&a>
+0},minX:function(a){return a.x||0},maxX:function(a){return(a.x||0)+(a.width||0)},midX:function(a){return(a.x||0)+(a.width||0)/2},minY:function(a){return a.y||0},maxY:function(a){return(a.y||0)+(a.height||0)},midY:function(a){return(a.y||0)+(a.height||0)/2},centerX:function(a,b){return(b.width-a.width)/2},centerY:function(a,b){return(b.height-a.height)/2},pointInRect:function(a,b){return a.x>=SC.minX(b)&&a.y>=SC.minY(b)&&a.x<=SC.maxX(b)&&a.y<=SC.maxY(b)},rectsEqual:function(a,b,c){if(!a||!b)return a==
+b;if(!c&&c!==0)c=0.1;if(a.y!=b.y&&Math.abs(a.y-b.y)>c)return NO;if(a.x!=b.x&&Math.abs(a.x-b.x)>c)return NO;if(a.width!=b.width&&Math.abs(a.width-b.width)>c)return NO;if(a.height!=b.height&&Math.abs(a.height-b.height)>c)return NO;return YES},intersectRects:function(a,b){a={x:Math.max(SC.minX(a),SC.minX(b)),y:Math.max(SC.minY(a),SC.minY(b)),width:Math.min(SC.maxX(a),SC.maxX(b)),height:Math.min(SC.maxY(a),SC.maxY(b))};a.width=Math.max(0,a.width-a.x);a.height=Math.max(0,a.height-a.y);return a},unionRects:function(a,
+b){a={x:Math.min(SC.minX(a),SC.minX(b)),y:Math.min(SC.minY(a),SC.minY(b)),width:Math.max(SC.maxX(a),SC.maxX(b)),height:Math.max(SC.maxY(a),SC.maxY(b))};a.width=Math.max(0,a.width-a.x);a.height=Math.max(0,a.height-a.y);return a},cloneRect:function(a){return{x:a.x,y:a.y,width:a.width,height:a.height}},stringFromRect:function(a){return"{x:"+a.x+", y:"+a.y+", width:"+a.width+", height:"+a.height+"}"},stringFromLayout:function(a){for(var b=["maxHeight","maxWidth","minHeight","minWidth","centerY","centerX",
+"width","height","bottom","right","top","left"],c=[],d=b.length;--d>=0;){var e=b[d];a.hasOwnProperty(e)&&c.push(e+":"+a[e])}return"{"+c.join(", ")+"}"},heightForString:function(a,b,c,d){var e=this._heightCalcElement;d=d&&SC.typeOf(d)===SC.T_ARRAY?d.join(" "):"";b||(b=100);if(!e){e=this._heightCalcElement=document.createElement("div");document.body.insertBefore(e,null)}c=c+"; width: "+b+"px; left: "+-1*b+"px; position: absolute";SC.$(e).attr("style",c);d!==""&&SC.$(e).attr("class",d);e.innerHTML=a;
+return e.clientHeight},prepareStringMeasurement:function(a,b){var c=this._metricsCalculationElement;b=SC.A(b).join(" ");if(!c){c=this._metricsCalculationElement=document.createElement("div");document.body.insertBefore(c,null)}if(SC.typeOf(a)!=SC.T_STRING){var d=null;d=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null):a.currentStyle;a=d.cssText;if(!a||a.trim()===""){a=this._copy_computed_props;for(var e=0;e<a.length;e++){var f=a[e];c.style[f]=
+d[f]}d=c.style;if(d.font===""){a="";if(d.fontStyle)a+=d.fontStyle+" ";if(d.fontVariant)a+=d.fontVariant+" ";if(d.fontWeight)a+=d.fontWeight+" ";a+=d.fontSize?d.fontSize:"10px";if(d.lineHeight)a+="/"+d.lineHeight;a+=" ";if(d.fontFamily)a+=d.fontFamily;c.style.font=a}SC.mixin(c.style,{left:"0px",top:"0px",position:"absolute",bottom:"auto",right:"auto",width:"auto",height:"auto"})}else c.setAttribute("style",a+"; position:absolute; left: 0px; top: 0px; bottom: auto; right: auto; width: auto; height: auto;")}else{a=
+a;c.setAttribute("style",a+"; position:absolute; left: 0px; top: 0px; bottom: auto; right: auto; width: auto; height: auto;")}c.className=b},teardownStringMeasurement:function(){var a=this._metricsCalculationElement;a.innerHTML="";a.className="";a.setAttribute("style","")},measureString:function(a){var b=this._metricsCalculationElement;if(!b)throw"measureString requires a string measurement environment to be set up. Did you mean metricsForString?";if(typeof b.innerText!="undefined")b.innerText=a;
+else b.textContent=a;return{width:b.clientWidth,height:b.clientHeight}},metricsForString:function(a,b,c){SC.prepareStringMeasurement(b,c);a=SC.measureString(a);SC.teardownStringMeasurement();return a},viewportOffset:function(a){if(a.getBoundingClientRect){a=a.getBoundingClientRect();return{x:a.left,y:a.top}}for(var b=0,c=0,d=a,e=SC.browser.mozilla>=3;d;){c+=d.offsetTop||0;if(!e||d!==a)c+=d.clientTop||0;b+=d.offsetLeft||0;if(!e||d!==a)b+=d.clientLeft||0;if(SC.browser.mozilla){if(SC.$(d).attr("overflow")!==
+"visible"){var f=parseInt(SC.$(d).attr("borderLeftWidth"),0)||0,g=parseInt(SC.$(d).attr("borderTopWidth"),0)||0;if(a!==d){f*=2;g*=2}b+=f;c+=g}f=d.offsetParent;if(SC.browser.mozilla.match(/1[.]9/)&&f){c-=f.clientTop;b-=f.clientLeft}}if(d.offsetParent==document.body&&SC.$(d).attr("position")=="absolute")break;d=d.offsetParent}for(d=a;d;){if(!SC.browser.isOpera||d.tagName=="BODY"){c-=d.scrollTop||0;b-=d.scrollLeft||0}d=d.parentNode}return{x:b,y:c}},ZERO_POINT:{x:0,y:0},ZERO_RANGE:{start:0,length:0},
+RANGE_NOT_FOUND:{start:0,length:-1},valueInRange:function(a,b){return a>=0&&a>=b.start&&a<b.start+b.length},minRange:function(a){return a.start},maxRange:function(a){return a.length<0?-1:a.start+a.length},unionRanges:function(a,b){if(a==null||a.length<0)return b;if(b==null||b.length<0)return a;var c=Math.min(a.start,b.start);a=Math.max(SC.maxRange(a),SC.maxRange(b));return{start:c,length:a-c}},intersectRanges:function(a,b){if(a==null||b==null)return SC.RANGE_NOT_FOUND;if(a.length<0||b.length<0)return SC.RANGE_NOT_FOUND;
+var c=Math.max(SC.minRange(a),SC.minRange(b));a=Math.min(SC.maxRange(a),SC.maxRange(b));if(a<c)return SC.RANGE_NOT_FOUND;return{start:c,length:a-c}},subtractRanges:function(a,b){if(a==null||b==null)return SC.RANGE_NOT_FOUND;if(a.length<0||b.length<0)return SC.RANGE_NOT_FOUND;var c=Math.max(SC.minRange(a),SC.minRange(b));a=Math.min(SC.maxRange(a),SC.maxRange(b));if(c<a)return SC.RANGE_NOT_FOUND;return{start:a,length:c-a}},cloneRange:function(a){return{start:a.start,length:a.length}},rangesEqual:function(a,
+b){if(a===b)return true;if(a==null)return b.length<0;if(b==null)return a.length<0;return a.start==b.start&&a.length==b.length},convertHsvToHex:function(a,b,c){var d=0,e=0,f=0;if(c>0){f=a==1?0:Math.floor(a*6);a=a==1?0:a*6-f;d=c*(1-b);e=c*(1-b*a);b=c*(1-b*(1-a));c=[[c,b,d],[e,c,d],[d,c,b],[d,e,c],[b,d,c],[c,d,e]];d=Math.round(255*c[f][0]);e=Math.round(255*c[f][1]);f=Math.round(255*c[f][2])}return this.parseColor("rgb("+d+","+e+","+f+")")},convertHexToHsv:function(a){var b=this.expandColor(a);a=Math.max(Math.max(b[0],
+b[1]),b[2]);var c=Math.min(Math.min(b[0],b[1]),b[2]);b=a==c?0:a==b[0]?(b[1]-b[2])/(a-c)/6:a==b[1]?(b[2]-b[0])/(a-c)/6+1/3:(b[0]-b[1])/(a-c)/6+2/3;b=b<0?b+1:b>1?b-1:b;return[b,a==0?0:1-c/a,a/255]},PARSE_COLOR_RGBRE:/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i,PARSE_COLOR_HEXRE:/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,expandColor:function(a){var b,c;if(b=this.parseColor(a)){a=parseInt(b.slice(1,3),16);c=parseInt(b.slice(3,5),16);b=parseInt(b.slice(5,7),16);return[a,c,b]}},parseColor:function(a){var b=
+0,c="#",d;if(d=this.PARSE_COLOR_RGBRE.exec(a)){for(b=1;b<=3;b++){a=Math.max(0,Math.min(255,parseInt(d[b],0)));c+=this.toColorPart(a)}return c}if(d=this.PARSE_COLOR_HEXRE.exec(a)){if(d[1].length==3){for(b=0;b<3;b++)c+=d[1].charAt(b)+d[1].charAt(b);return c}return"#"+d[1]}return false},toColorPart:function(a){if(a>255)a=255;var b=a.toString(16);if(a<16)return"0"+b;return b},getStyle:function(a,b){var c="";if(document.defaultView&&document.defaultView.getComputedStyle)c=document.defaultView.getComputedStyle(a,
+"").getPropertyValue(b);else if(a.currentStyle){b=b.replace(/\-(\w)/g,function(d,e){return e.toUpperCase()});c=a.currentStyle[b]}return c}});SC.VALIDATE_OK=YES;SC.VALIDATE_NO_CHANGE=NO;
+SC.Validator=SC.Object.extend({fieldValueForObject:function(a){return a},objectForFieldValue:function(a){return a},validate:function(){return true},validateError:function(a,b){return SC.$error("Invalid.General(%@)".loc(b.get("fieldValue")),b.get("fieldKey"))},validateChange:function(a,b){return this.validate(a,b)?SC.VALIDATE_OK:this.validateError(a,b)},validateSubmit:function(a,b){return this.validate(a,b)?SC.VALIDATE_OK:this.validateError(a,b)},validatePartial:function(a,b){return b.get("isValid")?
+SC.VALIDATE_NO_CHANGE:this.validate(a,b)?SC.VALIDATE_OK:this.validateError(a,b)},validateKeyDown:function(){return true},attachTo:function(){},detachFrom:function(){}});
+SC.Validator.mixin({OK:true,NO_CHANGE:false,findFor:function(a,b,c){var d;if(c){if(c instanceof SC.Validator)d=c;else if(c.isClass)d=c.create();else if(SC.typeOf(c)===SC.T_STRING){var e=null;if(d=c.match(/^(.+)\[(.*)\]/)){c=d[1];e=d[2]}c=c.classify();var f=SC.Validator[c];if(SC.none(f))throw"validator %@ not found for %@".fmt(c,b);else if(e){if(!a)throw"named validator (%@) could not be found for field %@ because the field does not belong to a form".fmt(e,b);if(!a._validatorHash)a._validatorHash=
+{};(d=e?a._validatorHash[e]:null)||(d=f.create());if(e)a._validatorHash[e]=d}else d=f.create()}return d}},fieldValueForObject:function(a,b,c){return this.prototype&&this.prototype.fieldValueForObject?this.prototype.fieldValueForObject(a,b,c):null},objectForFieldValue:function(a,b,c){return this.prototype&&this.prototype.objectForFieldValue?this.prototype.objectForFieldValue(a,b,c):null}});sc_require("validators/validator");
+SC.Validator.CreditCard=SC.Validator.extend({fieldValueForObject:function(a){if(typeof a=="string"&&a.length==16)a=[a.slice(0,4),a.slice(4,8),a.slice(8,12),a.slice(12,16)].join(" ");return a},objectForFieldValue:function(a){return a.replace(/[\s-\.\:]/g,"")},validate:function(a,b){return this.checkNumber(b.get("fieldValue"))},validateError:function(a,b){a=b.get("errorLabel")||"Field";return SC.$error("Invalid.CreditCard(%@)".loc(a),a)},validateKeyDown:function(a,b,c){return!!c.match(/[0-9\- ]/)},
+checkNumber:function(a){if(!a||a.length===0)return YES;a=a.replace(/[^0-9]/g,"");var b=a.length,c=parseInt(a,0),d=a.toString();d=d.replace(/^\s+|\s+$/g,"");a=0;for(var e=true,f=false,g,h=0;h<b;h++){g=""+d.substring(h,h+1);if("0123456789".indexOf(g)=="-1")e=false}e||(f=false);if(b===0&&f)f=false;else if(b>=15){for(d=b;d>0;d--){b=parseInt(c,0)%10;b=parseInt(b,0);a+=b;d--;c/=10;b=parseInt(c,0)%10;b*=2;switch(b){case 10:b=1;break;case 12:b=3;break;case 14:b=5;break;case 16:b=7;break;case 18:b=9;break;
+default:b=b}c/=10;a+=b}f=a%10===0?true:false}return f}});sc_require("validators/validator");SC.Validator.Date=SC.Validator.extend({format:"NNN d, yyyy h:mm:ss a",fieldValueForObject:function(a){var b;if(typeof a==="number")b=new Date(a);else if(a instanceof Date)b=a;if(b)a=b.format(this.get("format"));return a},objectForFieldValue:function(a){if(a)a=(a=Date.parseDate(a))?a.getTime():null;return a}});sc_require("validators/validator");
+SC.Validator.Email=SC.Validator.extend({validate:function(a,b){return(b.get("fieldValue")||"").match(/.+@.+\...+/)},validateError:function(a,b){a=b.get("errorLabel")||"Field";return SC.$error("Invalid.Email(%@)".loc(a),a)}});SC.Validator.EmailOrEmpty=SC.Validator.Email.extend({validate:function(a,b){return(a=b.get("fieldValue"))&&a.length>0?a.match(/.+@.+\...+/):true}});sc_require("validators/validator");
+SC.Validator.NotEmpty=SC.Validator.extend({validate:function(a,b){a=b.get("fieldValue");if((b=!!a)&&a.length)b=a.length>0;return b},validateError:function(a,b){a=b.get("errorLabel")||"Field";return SC.$error("Invalid.NotEmpty(%@)".loc(a.capitalize()),b.get("errorLabel"))}});sc_require("validators/validator");
+SC.Validator.Number=SC.Validator.extend({places:0,fieldValueForObject:function(a){switch(SC.typeOf(a)){case SC.T_NUMBER:a=a.toFixed(this.get("places"));break;case SC.T_NULL:case SC.T_UNDEFINED:a="";break}return a},objectForFieldValue:function(a){a=a.replace(/,/g,"");switch(SC.typeOf(a)){case SC.T_STRING:a=a.length===0?null:this.get("places")>0?parseFloat(a):a.length==1&&a.match(/-/)?null:parseInt(a,0);break;case SC.T_NULL:case SC.T_UNDEFINED:a=null;break}return a},validate:function(a,b){a=b.get("fieldValue");
+return a===""||!(isNaN(a)||isNaN(parseFloat(a)))},validateError:function(a,b){a=b.get("errorLabel")||"Field";return SC.$error("Invalid.Number(%@)".loc(a),a)},validateKeyDown:function(a,b,c){(a=b.$input().val())||(a="");a+=c;return this.get("places")===0?c.length===0?true:a.match(/^[\-{0,1}]?[0-9,\0]*/)[0]===a:c.length===0?true:a.match(/^[\-{0,1}]?[0-9,\0]*\.?[0-9\0]+/)===a}});sc_require("validators/validator");
+SC.Validator.Password=SC.Validator.extend({attachTo:function(a,b){arguments.callee.base.apply(this,arguments);if(!this.fields)this.fields=[];this.fields.push(b)},validate:function(a){if(!this.fields||this.fields.length===0)return true;var b=false,c=false,d=true,e=this.fields[0].get("fieldValue");this.fields.forEach(function(f){f=f.get("fieldValue");if(f!=e)d=false;if(!f||f.length===0)b=true;if(f&&f.length>0)c=true});return a?c===false?false:d:b===true?true:d},updateFields:function(a,b){if(!this.fields||
+this.fields.length===0)return true;var c="Invalid.Password".loc(),d=this._field;this.fields.forEach(function(e){a.setErrorFor(e,b?null:e==d?c:"")});return b?SC.VALIDATE_OK:c},validateChange:function(a){return this.updateFields(a,this.validate(false))},validateSubmit:function(a){return this.updateFields(a,this.validate(true))},validatePartial:function(a){return!this._field.get("isValid")?this.updateFields(a,this.validate(false)):SC.VALIDATE_NO_CHANGE}});sc_require("validators/validator");
+SC.Validator.PositiveInteger=SC.Validator.extend({defaultValue:null,fieldValueForObject:function(a){switch(SC.typeOf(a)){case SC.T_NUMBER:a=a.toFixed(0);break;case SC.T_NULL:case SC.T_UNDEFINED:a=this.get("defaultValue");break}return a},objectForFieldValue:function(a){a=a.replace(/,/g,"");switch(SC.typeOf(a)){case SC.T_STRING:a=a.length===0?this.get("defaultValue"):parseInt(a,0);break;case SC.T_NULL:case SC.T_UNDEFINED:a=this.get("defaultValue");break}return a},validate:function(a,b){a=b.get("fieldValue");
+return a===""||!isNaN(a)},validateError:function(a,b){a=b.get("errorLabel")||"Field";return SC.$error("Invalid.Number(%@)".loc(a),a)},validateKeyDown:function(a,b,c){(a=b.$input().val())||(a="");a+=c;return c.length===0?true:a.match(/^[0-9\0]*/)[0]===a}});sc_require("views/view");
+SC.ContainerView=SC.View.extend({classNames:["sc-container-view"],nowShowing:null,contentView:null,contentViewBindingDefault:SC.Binding.single(),replaceContent:function(a){this.removeAllChildren();a&&this.appendChild(a)},createChildViews:function(){var a=this.get("contentView");if(a){a=this.contentView=this.createChildView(a);this.childViews=[a]}},awake:function(){arguments.callee.base.apply(this,arguments);var a=this.get("nowShowing");a&&a.length>0&&this.nowShowingDidChange()},nowShowingDidChange:function(){var a=
+this.get("nowShowing"),b=null;if(SC.typeOf(a)===SC.T_STRING){if(a===SC.CONTENT_SET_DIRECTLY)return;if(a&&a.length>0)b=a.indexOf(".")>0?SC.objectForPropertyPath(a,null):SC.objectForPropertyPath(a,this.get("page"))}else b=a;if(b&&!(b instanceof SC.View))b=null;this.set("contentView",b)}.observes("nowShowing"),contentViewDidChange:function(){this.replaceContent(this.get("contentView"))}.observes("contentView")});sc_require("views/view");sc_require("mixins/control");SC.IMAGE_STATE_NONE="none";
+SC.IMAGE_STATE_LOADING="loading";SC.IMAGE_STATE_LOADED="loaded";SC.IMAGE_STATE_FAILED="failed";SC.IMAGE_STATE_SPRITE="sprite";SC.BLANK_IMAGE_DATAURL="data:image/gif;base64,R0lGODlhAQABAJAAAP///wAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw==";SC.BLANK_IMAGE_URL=SC.browser.msie&&SC.browser.msie<8?"/static/sproutcore/foundation/en/a04970954a917ede9918ca06897bc0e1406986d5/blank.gif":SC.BLANK_IMAGE_DATAURL;
+SC.ImageView=SC.View.extend(SC.Control,{classNames:"sc-image-view",tagName:"img",status:SC.IMAGE_STATE_NONE,value:null,useImageCache:YES,canLoadInBackground:NO,localize:YES,displayProperties:"status toolTip".w(),render:function(a){var b=this.get("status"),c=this.get("value");b===SC.IMAGE_STATE_NONE&&c&&this._image_valueDidChange();b=this.get("status");var d=b===SC.IMAGE_STATE_LOADED?c:SC.BLANK_IMAGE_URL;b===SC.IMAGE_STATE_SPRITE&&a.addClass(c);a.attr("src",d);b=this.get("toolTip");if(SC.typeOf(b)===
+SC.T_STRING){if(this.get("localize"))b=b.loc();a.attr("title",b);a.attr("alt",b)}},_image_valueDidChange:function(){var a=this.get("value"),b;if(a&&a.isEnumerable)a=a.firstObject();if((b=SC.ImageView.valueIsUrl(a))&&this.get("useImageCache")){b=this.get("isVisibleInWindow")||this.get("canLoadInBackground");this._loadingUrl=a;SC.imageCache.loadImage(a,this,this.imageDidLoad,b);this._loadingUrl&&this.set("status",SC.IMAGE_STATE_LOADING)}else{this._loadingUrl=null;this.set("status",b?SC.IMAGE_STATE_LOADED:
+SC.IMAGE_STATE_SPRITE);this.displayDidChange()}}.observes("value"),imageDidLoad:function(a,b){if(a===this._loadingUrl)this._loadingUrl=null;if(this.get("value")===a){this.set("status",SC.$ok(b)?SC.IMAGE_STATE_LOADED:SC.IMAGE_STATE_FAILED);this.displayDidChange()}}});SC.ImageView.valueIsUrl=function(a){return a?a.indexOf("/")>=0:NO};sc_require("views/view");sc_require("mixins/control");SC.ALIGN_LEFT="left";SC.ALIGN_RIGHT="right";SC.ALIGN_CENTER="center";SC.REGULAR_WEIGHT="normal";SC.BOLD_WEIGHT="bold";
+SC.LabelView=SC.View.extend(SC.Control,{classNames:["sc-label-view"],fontWeight:SC.REGULAR_WEIGHT,escapeHTML:true,escapeHTMLBindingDefault:SC.Binding.oneWay().bool(),localize:false,localizeBindingDefault:SC.Binding.oneWay().bool(),formatter:null,value:"",hint:null,exampleInlineTextFieldView:SC.InlineTextFieldView,icon:null,textAlign:SC.ALIGN_LEFT,isInlineEditorMultiline:NO,displayValue:function(){var a,b;a=this.get("value");if(b=this.getDelegateProperty("formatter",this.displayDelegate)){b=SC.typeOf(b)===
+SC.T_FUNCTION?b(a,this):b.fieldValueForObject(a,this);SC.none(b)||(a=b)}if(SC.typeOf(a)===SC.T_ARRAY){b=[];for(var c=0,d=a.get("length");c<d;c++){var e=a.objectAt(c);if(!SC.none(e)&&e.toString)e=e.toString();b.push(e)}a=b.join(",")}if(!SC.none(a)&&a.toString)a=a.toString();if(a&&this.getDelegateProperty("localize",this.displayDelegate))a=a.loc();if(this.get("escapeHTML"))a=SC.RenderContext.escapeHTML(a);return a}.property("value","localize","formatter","escapeHTML").cacheable(),hintValue:function(){var a=
+this.get("hint");if(this.get("escapeHTML"))a=SC.RenderContext.escapeHTML(a);return a}.property("hint","escapeHTML").cacheable(),isEditable:NO,isEditableBindingDefault:SC.Binding.bool(),isEditing:NO,validator:null,doubleClick:function(){return this.beginEditing()},beginEditing:function(){if(this.get("isEditing"))return YES;if(!this.get("isEditable"))return NO;var a=this.$(),b=this.get("value")||"",c=SC.viewportOffset(a[0]),d=this.convertFrameFromView(this.get("frame"),null);c.width=d.width;c.height=
+d.height;SC.InlineTextFieldView.beginEditing({frame:c,delegate:this,exampleElement:a,value:b,multiline:this.get("isInlineEditorMultiline"),isCollection:NO,validator:this.get("validator"),exampleInlineTextFieldView:this.get("exampleInlineTextFieldView")})},discardEditing:function(){if(!this.get("isEditing"))return YES;return SC.InlineTextFieldView.discardEditing()},commitEditing:function(){if(!this.get("isEditing"))return YES;return SC.InlineTextFieldView.commitEditing()},inlineEditorShouldBeginEditing:function(){return YES},
+inlineEditorWillBeginEditing:function(){this.set("isEditing",YES)},inlineEditorDidBeginEditing:function(){var a=this.$();this._oldOpacity=a.css("opacity");a.css("opacity",0)},inlineEditorShouldEndEditing:function(){return YES},inlineEditorDidEndEditing:function(a,b){this.setIfChanged("value",b);this.$().css("opacity",this._oldOpacity);this._oldOpacity=null;this.set("isEditing",NO)},displayProperties:"displayValue textAlign fontWeight icon".w(),_TEMPORARY_CLASS_HASH:{},render:function(a,b){var c=this.get("displayValue"),
+d=this.get("icon"),e=this.get("hintValue"),f=false,g=false;if(d){var h=d.indexOf("/")>=0?d:SC.BLANK_IMAGE_URL;d='<img src="'+h+'" alt="" class="icon '+(h===d?"":d)+'" />';if(d!==this._iconCache){this._iconCache=d;f=true}}c=e&&(!c||c==="")?'<span class="sc-hint">'+e+"</span>":c;if(c!==this._textCache){this._textCache=c;g=true}if(b||g||f)a.push(d,c);b={"text-align":this.get("textAlign"),"font-weight":this.get("fontWeight")};if(this.get("isEditing"))b.opacity=0;a.addStyle(b);b=this._TEMPORARY_CLASS_HASH;
+b.icon=!!this.get("icon");a.setClass(b)}});sc_require("panes/pane");SC.MainPane=SC.Pane.extend({layout:{left:0,right:0,top:0,bottom:0},paneDidAttach:function(){var a=arguments.callee.base.apply(this,arguments),b=this.rootResponder;b.makeMainPane(this);b.get("keyRootView")||b.makeKeyPane(this);return a},acceptsKeyPane:YES,classNames:["sc-main"]});tiki.script("sproutcore/foundation:en/a04970954a917ede9918ca06897bc0e1406986d5/javascript.js");
+tiki.register("sproutcore/desktop",{packages:{"sproutcore/runtime":{scripts:[{url:"/static/sproutcore/runtime/en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js",id:"sproutcore/runtime:en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js"}]},"sproutcore/datastore":{scripts:[{url:"/static/sproutcore/datastore/en/eb43c56c9a551db9bba1cd04f29ca1dfb2e47e4c/javascript.js",id:"sproutcore/datastore:en/eb43c56c9a551db9bba1cd04f29ca1dfb2e47e4c/javascript.js"}]},"sproutcore/foundation":{stylesheets:[{url:"/static/sproutcore/foundation/en/a04970954a917ede9918ca06897bc0e1406986d5/stylesheet.css",
+id:"sproutcore/foundation:en/a04970954a917ede9918ca06897bc0e1406986d5/stylesheet.css"}],scripts:[{url:"/static/sproutcore/foundation/en/a04970954a917ede9918ca06897bc0e1406986d5/javascript.js",id:"sproutcore/foundation:en/a04970954a917ede9918ca06897bc0e1406986d5/javascript.js"}]}},stylesheets:[{url:"/static/sproutcore/desktop/en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/stylesheet.css",id:"sproutcore/desktop:en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/stylesheet.css"}],depends:["sproutcore/runtime",
+"sproutcore/datastore","sproutcore/foundation"],scripts:[{url:"/static/sproutcore/desktop/en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/javascript.js",id:"sproutcore/desktop:en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/javascript.js"}]});tiki.global("sproutcore/desktop");
+SC.stringsFor("English",{"Invalid.CreditCard(%@)":"%@ is not a valid credit card number","Invalid.Email(%@)":"%@ is not a valid email address","Invalid.NotEmpty(%@)":"%@ must not be empty","Invalid.Password":"Your passwords do not match.  Please try typing them again.","Invalid.General(%@)":"%@ is invalid.  Please try again.","Invalid.Number(%@)":"%@ is not a number."});SC.allowsBackspaceToPreviousPage=NO;SC.BORDER_BEZEL="sc-bezel-border";SC.BORDER_BLACK="sc-black-border";SC.BORDER_GRAY="sc-gray-border";
+SC.BORDER_TOP="sc-top-border";SC.BORDER_BOTTOM="sc-bottom-border";SC.BORDER_NONE=null;
+SC.Border={borderTop:0,borderRight:0,borderBottom:0,borderLeft:0,borderStyle:SC.BORDER_GRAY,hasBorder:YES,displayProperties:["borderStyle"],_BORDER_REGEXP:/-border$/,initMixin:function(){this._sc_border_borderStyleDidChange()},renderMixin:function(a){var b=this.get("borderStyle");if(b)this._BORDER_REGEXP.exec(b)?a.addClass(b):a.addStyle("border","1px "+b+" solid")},_sc_border_borderStyleDidChange:function(){var a=this.get("borderStyle");if(a=SC.Border.dimensions[a])this.borderLeft=this.borderBottom=
+this.borderRight=this.borderTop=a}};SC.mixin(SC.Border,{dimensions:{"sc-bezel-border":1,"sc-black-border":1,"sc-gray-border":1,"sc-top-border":1,"sc-bottom-border":1}});SC.CollectionGroup={classNames:["sc-collection-group"]};SC.CollectionRowDelegate={isCollectionRowDelegate:YES,rowHeight:18,customRowHeightIndexes:null,contentIndexRowHeight:function(){return this.get("rowHeight")}};
+SC.CollectionViewDelegate={isCollectionViewDelegate:YES,collectionViewSelectionForProposedSelection:function(a,b){return b},collectionViewShouldSelectIndexes:function(a,b){return b},collectionViewShouldDeselectIndexes:function(a,b){return b},collectionViewShouldDeleteIndexes:function(a,b){return b},collectionViewDeleteContent:function(a,b,c){if(!b)return NO;if(SC.typeOf(b.destroyAt)===SC.T_FUNCTION){b.destroyAt(c);a.selectPreviousItem(NO,1);return YES}else if(SC.typeOf(b.removeAt)===SC.T_FUNCTION){b.removeAt(c);
+a.selectPreviousItem(NO,1);return YES}else return NO},collectionViewShouldBeginDrag:function(){return YES},collectionViewDragDataTypes:function(){return[]},collectionViewDragDataForType:function(){return null},collectionViewComputeDragOperations:function(a,b,c){return c},collectionViewValidateDragOperation:function(a,b,c,d,e){return e&SC.DROP_ON?SC.DRAG_NONE:c},collectionViewPerformDragOperation:function(){return SC.DRAG_NONE},collectionViewDragViewFor:function(){return null},ghostActsLikeCursor:NO};
+SC.Scrollable={isScrollable:true,verticalLineScroll:20,horizontalLineScroll:20,verticalPageScroll:function(){return this.get("innerFrame").height}.property("innerFrame"),horizontalPageScroll:function(){return this.get("innerFrame").width}.property("innerFrame"),hasVerticalScroller:function(){return this.get("scrollFrame").height>this.get("innerFrame").height}.property("scrollFrame"),hasHorizontalScroller:function(){return this.get("scrollFrame").width>this.get("innerFrame").width}.property("scrollFrame"),
+scrollBy:function(a){var b=this.get("scrollFrame"),c=this.get("innerFrame");if(!this.get("hasVerticalScroller"))a.y=0;if(b.height<=c.height)a.y=0;if(!this.get("hasHorizontalScroller"))a.x=0;if(b.width<=c.width)a.x=0;a={x:b.x-(a.x||0),y:b.y-(a.y||0)};this.set("scrollFrame",a);a=this.get("scrollFrame");return{x:a.x-b.x,y:a.y-b.y}},scrollTo:function(a,b){this.set("scrollFrame",{x:0-a,y:0-b})},scrollToVisible:function(a){var b=this.get("innerFrame"),c=this.get("scrollFrame");a=this.convertFrameFromView(a.get("frame"),
+a);a.x-=b.x+c.x;a.y-=b.y+c.y;b={x:0-c.x,y:0-c.y,width:b.width,height:b.height};b.y-=Math.max(0,SC.minY(b)-SC.minY(a));b.x-=Math.max(0,SC.minX(b)-SC.minX(a));b.y+=Math.max(0,SC.maxY(a)-SC.maxY(b));b.x+=Math.max(0,SC.maxX(a)-SC.maxX(b));this.scrollTo(b.x,b.y)},scrollDownLine:function(a){if(a===undefined)a=1;return this.scrollBy({y:this.get("verticalLineScroll")*a}).y},scrollUpLine:function(a){if(a===undefined)a=1;return 0-this.scrollBy({y:0-this.get("verticalLineScroll")*a}).y},scrollRightLine:function(a){if(a===
+undefined)a=1;return this.scrollTo({y:this.get("horizontalLineScroll")*a}).x},scrollLeftLine:function(a){if(a===undefined)a=1;return 0-this.scrollTo({y:0-this.get("horizontalLineScroll")*a}).x},scrollDownPage:function(a){if(a===undefined)a=1;return this.scrollBy({y:this.get("verticalPageScroll")*a}).y},scrollUpPage:function(a){if(a===undefined)a=1;return 0-this.scrollBy({y:0-this.get("verticalPageScroll")*a}).y},scrollRightPage:function(a){if(a===undefined)a=1;return this.scrollTo({y:this.get("horizontalPageScroll")*
+a}).x},scrollLeftPage:function(a){if(a===undefined)a=1;return 0-this.scrollTo({y:0-this.get("horizontalPageScroll")*a}).x}};
+SC.ModalPane=SC.Pane.extend({classNames:"sc-modal",layout:{top:0,left:0,bottom:0,right:0},_openPaneCount:0,paneWillAppend:function(){this._openPaneCount++;this.get("isVisibleInWindow")||this.append();return this},paneDidRemove:function(){this._openPaneCount--;if(this._openPaneCount<=0){this._openPaneCount=0;this.get("isVisibleInWindow")&&this.remove()}},mouseDown:function(a){var b=this.get("owner");b&&b.modalPaneDidClick&&b.modalPaneDidClick(a)},touchStart:function(a){this.mouseDown(a)}});sc_require("panes/modal");
+SC.PanelPane=SC.Pane.extend({layout:{left:0,right:0,top:0,bottom:0},classNames:["sc-panel"],acceptsKeyPane:YES,isModal:YES,modalPane:SC.ModalPane.extend({classNames:"for-sc-panel"}),contentView:null,contentViewBindingDefault:SC.Binding.single(),render:function(a,b){if(a.needsContent){this.renderChildViews(a,b);a.push("<div class='top-left-edge'></div>","<div class='top-edge'></div>","<div class='top-right-edge'></div>","<div class='right-edge'></div>","<div class='bottom-right-edge'></div>","<div class='bottom-edge'></div>",
+"<div class='bottom-left-edge'></div>","<div class='left-edge'></div>")}},replaceContent:function(a){this.removeAllChildren();a&&this.appendChild(a)},createChildViews:function(){var a=this.contentView;if(a){a=this.contentView=this.createChildView(a);this.childViews=[a]}},contentViewDidChange:function(){this.replaceContent(this.get("contentView"))}.observes("contentView"),_modalPane:function(){var a=this.get("modalPane");if(a&&a.isClass){a=a.create({owner:this});this.set("modalPane",a)}return a},appendTo:function(){var a;
+if(!this.get("isVisibleInWindow")&&this.get("isModal")&&(a=this._modalPane())){this._isShowingModal=YES;a.paneWillAppend(this)}return arguments.callee.base.apply(this,arguments)},remove:function(){var a,b=arguments.callee.base.apply(this,arguments);if(this._isShowingModal){this._isShowingModal=NO;if(a=this._modalPane())a.paneDidRemove(this)}return b},_isModalDidChange:function(){var a;if(this.get("isModal")){if(!this._isShowingModal&&this.get("isVisibleInWindow")&&(a=this._modalPane())){this._isShowingModal=
+YES;a.paneWillAppend(this)}}else if(this._isShowingModal&&(a=this._modalPane())){this._isShowingModal=NO;a.paneDidRemove(this)}}.observes("isModal"),paneDidAttach:function(){var a=arguments.callee.base.apply(this,arguments);this.becomeKeyPane();return a}});SC.TOGGLE_BEHAVIOR="toggle";SC.PUSH_BEHAVIOR="push";SC.TOGGLE_ON_BEHAVIOR="on";SC.TOGGLE_OFF_BEHAVIOR="off";SC.HOLD_BEHAVIOR="hold";SC.REGULAR_BUTTON_HEIGHT=24;
+SC.ButtonView=SC.View.extend(SC.Control,SC.Button,SC.StaticLayout,{tagName:"div",classNames:["sc-button-view"],theme:"square",buttonBehavior:SC.PUSH_BEHAVIOR,holdInterval:100,isDefault:NO,isDefaultBindingDefault:SC.Binding.oneWay().bool(),isCancel:NO,isCancelBindingDefault:SC.Binding.oneWay().bool(),href:"",action:null,target:null,supportFocusRing:NO,triggerAction:function(a){if(!this.get("isEnabled"))return NO;this.set("isActive",YES);this._action(a,YES);this.didTriggerAction();this.invokeLater("set",
+200,"isActive",NO);return true},didTriggerAction:function(){},titleMinWidth:80,init:function(){arguments.callee.base.apply(this,arguments);if(this.get("keyEquivalent"))this._defaultKeyEquivalent=this.get("keyEquivalent")},_TEMPORARY_CLASS_HASH:{},displayProperties:["href","icon","title","value","toolTip"],renderStyle:"renderDefault",render:function(a,b){var c;if(this.get("tagName")==="a"){c=this.get("href");if(!c||c.length===0)c="javascript:;";a.attr("href",c)}else a.attr("role","button");c=this.get("toolTip");
+if(SC.typeOf(c)===SC.T_STRING){if(this.get("localize"))c=c.loc();a.attr("title",c);a.attr("alt",c)}c=this._TEMPORARY_CLASS_HASH;c.def=this.get("isDefault");c.cancel=this.get("isCancel");c.icon=!!this.get("icon");a.attr("role","button").setClass(c);(c=this.get("theme"))&&a.addClass(c);this[this.get("renderStyle")](a,b)},renderDefault:function(a,b){if(b){a=a.push("<span class='sc-button-inner' style = 'min-width:",this.get("titleMinWidth"),"px'>");this.renderTitle(a,b);a.push("</span>");this.get("supportFocusRing")&&
+a.push('<div class="focus-ring">','<div class="focus-left"></div>','<div class="focus-middle"></div>','<div class="focus-right"></div></div>')}else this.renderTitle(a,b)},renderImage:function(a){var b=this.get("icon");b?a.push("<div class='img "+b+"'></div>"):a.push("<div class='img'></div>")},_defaultKeyEquivalent:null,_isDefaultOrCancelDidChange:function(){var a=!!this.get("isDefault"),b=!a&&this.get("isCancel");if(this.didChangeFor("defaultCancelChanged","isDefault","isCancel")){this.displayDidChange();
+if(a)this.set("keyEquivalent","return");else b?this.setIfChanged("keyEquivalent","escape"):this.set("keyEquivalent",this._defaultKeyEquivalent)}}.observes("isDefault","isCancel"),isMouseDown:false,mouseDown:function(a){var b=this.get("buttonBehavior");if(!this.get("isEnabled"))return YES;this.set("isActive",YES);this._isMouseDown=YES;if(b===SC.HOLD_BEHAVIOR)this._action(a);else if(!this._isFocused&&b!==SC.PUSH_BEHAVIOR){this._isFocused=YES;this.becomeFirstResponder();this.get("isVisibleInWindow")&&
+this.$()[0].focus()}return YES},mouseExited:function(){this._isMouseDown&&this.set("isActive",NO);return YES},mouseEntered:function(){this.set("isActive",this._isMouseDown);return YES},mouseUp:function(a){this._isMouseDown&&this.set("isActive",NO);this._isMouseDown=false;this.get("buttonBehavior")!==SC.HOLD_BEHAVIOR&&this.$().within(a.target)&&this.get("isEnabled")&&this._action(a);return YES},keyDown:function(a){if(a.which===9){var b=a.shiftKey?this.get("previousValidKeyView"):this.get("nextValidKeyView");
+b?b.becomeFirstResponder():a.allowDefault();return YES}if(a.which===13){this.triggerAction(a);return YES}return YES},_action:function(a,b){switch(this.get("buttonBehavior")){case SC.TOGGLE_BEHAVIOR:this.get("isSelected")?this.set("value",this.get("toggleOffValue")):this.set("value",this.get("toggleOnValue"));break;case SC.TOGGLE_ON_BEHAVIOR:this.set("value",this.get("toggleOnValue"));break;case SC.TOGGLE_OFF_BEHAVIOR:this.set("value",this.get("toggleOffValue"));break;case SC.HOLD_BEHAVIOR:this._runHoldAction(a,
+b);break;default:this._runAction(a)}},_runAction:function(a){var b=this.get("action"),c=this.get("target")||null;if(b)this._hasLegacyActionHandler()?this._triggerLegacyActionHandler(a):this.getPath("pane.rootResponder").sendAction(b,c,this,this.get("pane"))},_runHoldAction:function(a,b){if(this.get("isActive")){this._runAction();if(!b){SC.RunLoop.begin();this.invokeLater("_runHoldAction",this.get("holdInterval"),a);SC.RunLoop.end()}}},_hasLegacyActionHandler:function(){var a=this.get("action");if(a&&
+SC.typeOf(a)===SC.T_FUNCTION)return true;if(a&&SC.typeOf(a)===SC.T_STRING&&a.indexOf(".")!=-1)return true;return false},_triggerLegacyActionHandler:function(a){if(!this._hasLegacyActionHandler())return false;var b=this.get("action");SC.typeOf(b)===SC.T_FUNCTION&&this.action(a);if(SC.typeOf(b)===SC.T_STRING){eval("this.action = function(e) { return "+b+"(this, e); };");this.action(a)}},acceptsFirstResponder:function(){return SC.SAFARI_FOCUS_BEHAVIOR?NO:this.get("isEnabled")}.property("isEnabled"),
+willBecomeKeyResponderFrom:function(){if(!this._isFocused){this._isFocused=YES;this.becomeFirstResponder();if(this.get("isVisibleInWindow")){var a=this.$()[0];a&&a.focus()}}},willLoseKeyResponderTo:function(){if(this._isFocused)this._isFocused=NO},didAppendToDocument:function(){if(SC.browser.msie===7){var a=this.$();if(a&&a[0]){var b=a[0].clientWidth;a=parseInt(a.css("paddingRight"),0);this.$(".sc-button-label").css("minWidth",b-a*2+"px")}}}});sc_require("panes/panel");sc_require("views/button");
+SC.BUTTON1_STATUS="button1";SC.BUTTON2_STATUS="button2";SC.BUTTON3_STATUS="button3";
+SC.AlertPane=SC.PanelPane.extend({classNames:"sc-alert",delegate:null,icon:"sc-icon-alert-48",message:"",description:"",displayDescription:function(){var a=this.get("description");if(!a||a.length===0)return a;a=SC.RenderContext.escapeHTML(a);return'<p class="description">'+a.split("\n").join('</p><p class="description">')+"</p>"}.property("description").cacheable(),caption:"",displayCaption:function(){var a=this.get("caption");if(!a||a.length===0)return a;a=SC.RenderContext.escapeHTML(a);return'<p class="caption">'+
+a.split("\n").join('</p><p class="caption">')+"</p>"}.property("caption").cacheable(),buttonOne:SC.outlet("contentView.childViews.1.childViews.1"),buttonTwo:SC.outlet("contentView.childViews.1.childViews.0"),buttonThree:SC.outlet("contentView.childViews.2.childViews.0"),buttonThreeWrapper:SC.outlet("contentView.childViews.2"),layout:{centerX:0,width:500,top:55},contentView:SC.View.extend({useStaticLayout:YES,layout:{left:0,right:0,top:0,height:"auto"},childViews:[SC.View.extend(SC.StaticLayout,{classNames:["info"],
+render:function(a){var b=this.get("pane"),c=SC.BLANK_IMAGE_URL;b.get("icon")=="blank"&&a.addClass("plain");a.push('<img src="'+c+'" class="icon '+b.get("icon")+'" />');a.begin("h1").text(b.get("message")||"").end();a.push(b.get("displayDescription")||"");a.push(b.get("displayCaption")||"");a.push('<div class="separator"></div>')}}),SC.View.extend({layout:{bottom:13,height:24,right:18,width:466},childViews:["cancelButton","okButton"],classNames:["text-align-right"],cancelButton:SC.ButtonView.extend({useStaticLayout:YES,
+actionKey:SC.BUTTON2_STATUS,localize:YES,titleMinWidth:64,layout:{right:5,height:"auto",width:"auto",bottom:0},theme:"capsule",title:"Cancel",action:"dismiss",isVisible:NO}),okButton:SC.ButtonView.extend({useStaticLayout:YES,actionKey:SC.BUTTON1_STATUS,localize:YES,titleMinWidth:64,layout:{left:0,height:"auto",width:"auto",bottom:0},theme:"capsule",title:"OK",isDefault:YES,action:"dismiss"})}),SC.View.extend({layout:{bottom:13,height:24,left:18,width:150},isVisible:NO,childViews:[SC.ButtonView.extend({useStaticLayout:YES,
+actionKey:SC.BUTTON3_STATUS,localize:YES,titleMinWidth:64,layout:{left:0,height:"auto",width:"auto",bottom:0},theme:"capsule",title:"Extra",action:"dismiss",isVisible:NO})]})]}),dismiss:function(a){var b=this.delegate;b&&b.alertPaneDidDismiss&&b.alertPaneDidDismiss(this,a.get("actionKey"));this.remove()},alertInfoDidChange:function(){var a=this.getPath("contentView.childViews.0");a&&a.displayDidChange()}.observes("icon","message","displayDescription","displayCaption")});
+SC.AlertPane._normalizeArguments=function(a){a=SC.A(a);var b=a.length,c=a[b-1];if(SC.typeOf(c)!==SC.T_STRING)a[b-1]=null;else c=null;a[7]=c;return a};
+SC.AlertPane.show=function(){for(var a=this._normalizeArguments(arguments),b=this.create({message:a[0]||"",description:a[1]||null,caption:a[2]||null,icon:a[6]||"sc-icon-alert-48",delegate:a[7]}),c="buttonOne buttonTwo buttonThree".w(),d,e,f=0;f<3;f++){d=b.get(c[f]);if(e=a[f+3]){d.set("title",e).set("isVisible",YES);e=="?"&&d.set("titleMinWidth",0);f==2&&b.get("buttonThreeWrapper").set("isVisible",YES)}}a=b.append();b.adjust("height",b.childViews[0].$().height());b.updateLayout();return a};
+SC.AlertPane.warn=function(){var a=this._normalizeArguments(arguments);a[6]="sc-icon-alert-48";return this.show.apply(this,a)};SC.AlertPane.info=function(){var a=this._normalizeArguments(arguments);a[6]="sc-icon-info-48";return this.show.apply(this,a)};SC.AlertPane.error=function(){var a=this._normalizeArguments(arguments);a[6]="sc-icon-error-48";return this.show.apply(this,a)};SC.AlertPane.plain=function(){var a=this._normalizeArguments(arguments);a[6]="blank";return this.show.apply(this,a)};sc_require("panes/panel");
+SC.PalettePane=SC.PanelPane.extend({classNames:"sc-palette",isModal:NO,modalPane:SC.ModalPane,isAnchored:NO,_mouseOffsetX:null,_mouseOffsetY:null,mouseDown:function(a){var b=this.get("frame");this._mouseOffsetX=b?b.x-a.pageX:0;this._mouseOffsetY=b?b.y-a.pageY:0;return YES},mouseDragged:function(a){if(!this.isAnchored){this.set("layout",{width:this.layout.width,height:this.layout.height,left:this._mouseOffsetX+a.pageX,top:this._mouseOffsetY+a.pageY});this.updateLayout()}return YES}});sc_require("panes/palette");
+SC.PICKER_MENU="menu";SC.PICKER_FIXED="fixed";SC.PICKER_POINTER="pointer";SC.POINTER_LAYOUT=["perfectRight","perfectLeft","perfectTop","perfectBottom"];
+SC.PickerPane=SC.PalettePane.extend({classNames:"sc-picker",isAnchored:YES,isModal:YES,pointerPos:"perfectRight",pointerPosX:0,pointerPosY:0,anchorElement:null,preferType:null,preferMatrix:null,popup:function(a,b,c){a=a.isView?a.get("layer"):a;this.beginPropertyChanges();this.set("anchorElement",a);b&&this.set("preferType",b);c&&this.set("preferMatrix",c);this.endPropertyChanges();this.positionPane();this.append()},positionPane:function(){var a=this.get("anchorElement"),b=this.get("preferType"),c=
+this.get("preferMatrix"),d=this.get("layout");if(a){a=this.computeAnchorRect(a);d=SC.cloneRect(a);if(b)switch(b){case SC.PICKER_MENU:case SC.PICKER_FIXED:if(!c||c.length!==3)this.set("preferMatrix",[1,4,3]);d.x+=(this.preferMatrix[2]===0?d.width:0)+this.preferMatrix[0];d.y+=(this.preferMatrix[2]===3?d.height:0)+this.preferMatrix[1];break;default:d.y+=d.height;break}else d.y+=d.height;d=this.fitPositionToScreen(d,this.get("frame"),a);d={width:d.width,height:d.height,left:d.x,top:d.y}}else d={width:d.width,
+height:d.height,centerX:0,centerY:0};this.set("layout",d).updateLayout();return this},computeAnchorRect:function(a){var b=SC.viewportOffset(a);a=SC.$(a);var c=SC.RootResponder.responder.computeWindowSize();b.width=a.outerWidth();b.height=c.height-b.y<a.outerHeight()?c.height-b.y:a.outerHeight();return b},fitPositionToScreen:function(a,b,c){var d=SC.RootResponder.responder.computeWindowSize();d={x:0,y:0,width:d.width,height:d.height};b.x=a.x;b.y=a.y;if(this.preferType)switch(this.preferType){case SC.PICKER_MENU:b=
+this.fitPositionToScreenMenu(d,b,this.get("isSubMenu"));break;case SC.PICKER_POINTER:b=this.fitPositionToScreenPointer(d,b,c);break;case SC.PICKER_FIXED:break;default:break}else b=this.fitPositionToScreenDefault(d,b,c);this.displayDidChange();return b},fitPositionToScreenDefault:function(a,b,c){if(SC.maxX(b)>a.width){var d=Math.max(SC.maxX(c),b.width);b.x=Math.min(d,a.width)-b.width}if(SC.minX(b)<0){b.x=SC.minX(Math.max(c,0));if(SC.maxX(b)>a.width)b.x=Math.max(0,a.width-b.width)}if(SC.maxY(b)>a.height){d=
+Math.max(c.y-b.height,0);b.y=d>a.height?Math.max(0,a.height-b.height):d}if(SC.minY(b)<0){d=Math.min(SC.maxY(c),a.height-c.height);b.y=Math.max(d,0)}return b},fitPositionToScreenMenu:function(a,b,c){if(b.x+b.width>a.width-20)if(c)b.x-=b.width*2;else b.x=a.width-b.width-20;if(b.x<7)b.x=7;if(b.height+b.y+35>=a.height)if(b.height+50>=a.height){b.y=15;b.height=a.height-50}else b.y+=a.height-(b.height+b.y+35);return b},fitPositionToScreenPointer:function(a,b,c){var d=c.height>12?0:1,e=c.height>12?0:3,f=
+[[c.x+c.width+(7+d),c.y+parseInt(c.height/2,0)-40],[c.x-b.width-(7+d),c.y+parseInt(c.height/2,0)-40],[c.x+parseInt(c.width/2-b.width/2,0),c.y-b.height-(17+e)],[c.x+parseInt(c.width/2-b.width/2,0),c.y+c.height+(17+e)]];d=[[c.x+c.width+b.width+(7+d),c.y+parseInt(c.height/2,0)+b.height-24],[c.x-(7+d),c.y+parseInt(c.height/2,0)+b.height-24],[c.x+parseInt(c.width/2-b.width/2,0)+b.width,c.y-(17+e)],[c.x+parseInt(c.width/2-b.width/2,0)+b.width,c.y+c.height+b.height+(17+e)]];a=[[f[0][1]>0?0:0-f[0][1],d[0][0]<
+a.width?0:d[0][0]-a.width,d[0][1]<a.height?0:d[0][1]-a.height,f[0][0]>0?0:0-f[0][0]],[f[1][1]>0?0:0-f[1][1],d[1][0]<a.width?0:d[1][0]-a.width,d[1][1]<a.height?0:d[1][1]-a.height,f[1][0]>0?0:0-f[1][0]],[f[2][1]>0?0:0-f[2][1],d[2][0]<a.width?0:d[2][0]-a.width,d[2][1]<a.height?0:d[2][1]-a.height,f[2][0]>0?0:0-f[2][0]],[f[3][1]>0?0:0-f[3][1],d[3][0]<a.width?0:d[3][0]-a.width,d[3][1]<a.height?0:d[3][1]-a.height,f[3][0]>0?0:0-f[3][0]]];if(!this.preferMatrix||this.preferMatrix.length!==5)this.set("preferMatrix",
+[0,1,2,3,2]);d=this.preferMatrix;if(d[4]===-1){b.x=c.x+parseInt(c.width/2,0);b.y=c.y+parseInt(c.height/2,0)-parseInt(b.height/2,0);this.set("pointerPos",SC.POINTER_LAYOUT[0]+" fallback");this.set("pointerPosY",parseInt(b.height/2,0)-40)}else{b.x=f[d[4]][0];b.y=f[d[4]][1];this.set("pointerPos",SC.POINTER_LAYOUT[d[4]]);this.set("pointerPosY",0)}this.set("pointerPosX",0);c=0;for(var g=SC.POINTER_LAYOUT.length;c<g;c++){e=d[c];if(a[e][0]===0&&a[e][1]===0&&a[e][2]===0&&a[e][3]===0){if(d[4]!==e){b.x=f[e][0];
+b.y=f[e][1];this.set("pointerPosY",0);this.set("pointerPos",SC.POINTER_LAYOUT[e])}c=SC.POINTER_LAYOUT.length}else if((e===0||e===1)&&a[e][0]===0&&a[e][1]===0&&a[e][2]<b.height-91&&a[e][3]===0){if(d[4]!==e){b.x=f[e][0];this.set("pointerPos",SC.POINTER_LAYOUT[e])}b.y=f[e][1]-a[e][2];this.set("pointerPosY",a[e][2]);c=SC.POINTER_LAYOUT.length}else if((e===0||e===1)&&a[e][0]===0&&a[e][1]===0&&a[e][2]<=b.height-57&&a[e][3]===0){if(d[4]!==e)b.x=f[e][0];b.y=f[e][1]-(b.height-57);this.set("pointerPosY",b.height-
+59);this.set("pointerPos",SC.POINTER_LAYOUT[e]+" extra-low");c=SC.POINTER_LAYOUT.length}}return b},displayProperties:["pointerPosY"],render:function(a){var b=arguments.callee.base.apply(this,arguments);if(a.needsContent)this.get("preferType")==SC.PICKER_POINTER&&a.push('<div class="sc-pointer '+this.get("pointerPos")+'" style="margin-top: '+this.get("pointerPosY")+'px"></div>');else{var c=this.$(".sc-pointer");c.attr("class","sc-pointer "+this.get("pointerPos"));c.attr("style","margin-top: "+this.get("pointerPosY")+
+"px")}return b},modalPaneDidClick:function(a){this.clickInside(this.get("frame"),a)||this.remove();return YES},mouseDown:function(a){return this.modalPaneDidClick(a)},clickInside:function(a,b){return SC.pointInRect({x:b.pageX,y:b.pageY},a)},windowSizeDidChange:function(){this.positionPane()}});SC.SeparatorView=SC.View.extend({classNames:["sc-separator-view"],tagName:"span",layoutDirection:SC.LAYOUT_HORIZONTAL,render:function(a,b){b&&a.push("<span></span>");a.addClass(this.get("layoutDirection"))}});
+sc_require("views/button");sc_require("views/separator");
+SC.MenuItemView=SC.View.extend(SC.ContentDisplay,{classNames:["sc-menu-item"],acceptsFirstResponder:YES,content:null,isSubMenuViewVisible:null,hasMouseExited:NO,subMenu:function(){var a=this.get("content"),b;if(!a)return null;b=this.get("parentMenu");if(a=a.get(b.itemSubMenuKey))if(SC.kindOf(a,SC.MenuPane)){a.set("isModal",NO);a.set("isSubMenu",YES);a.set("parentMenu",b);return a}else return SC.MenuPane.create({layout:{width:200},items:a,isModal:NO,isSubMenu:YES,parentMenu:b});return null}.property("content").cacheable(),
+hasSubMenu:function(){return!!this.get("subMenu")}.property("subMenu").cacheable(),render:function(a){var b=this.get("content"),c=this.get("parentMenu"),d=this.get("itemWidth")||c.layout.width,e=this.get("itemHeight")||SC.DEFAULT_MENU_ITEM_HEIGHT;this.set("itemWidth",d);this.set("itemHeight",e);a=a.begin("a");if(b.get(c.itemSeparatorKey)){a.push('<span class="separator"></span>');a.addClass("disabled")}else{if(b=b.get(c.itemIconKey)){this.renderImage(a,b);a.addClass("has-icon")}b=this.get("title");
+if(SC.typeOf(b)!==SC.T_STRING)b=b.toString();this.renderLabel(a,b);this.getContentProperty("itemCheckboxKey")&&a.push('<div class="checkbox"></div>');this.get("hasSubMenu")&&this.renderBranch(a);(b=this.getContentProperty("itemShortCutKey"))&&this.renderShortcut(a,b)}a.end()},renderImage:function(a,b){var c;if(b&&SC.ImageView.valueIsUrl(b)){b=b;c=""}else{c=b;b=SC.BLANK_IMAGE_URL}a.begin("img").addClass("image").addClass(c).attr("src",b).end()},renderLabel:function(a,b){if(this.get("escapeHTML"))b=
+SC.RenderContext.escapeHTML(b);a.push("<span class='value ellipsis'>"+b+"</span>")},renderBranch:function(a){a.push('<span class="has-branch"></span>')},renderShortcut:function(a,b){a.push('<span class = "shortcut">'+b+"</span>")},isSeparator:function(){return this.getContentProperty("itemSeparatorKey")===YES}.property("content").cacheable(),showSubMenu:function(){var a=this.get("subMenu");a&&a.popup(this,[0,0,0])},isEnabled:function(){return this.getContentProperty("itemIsEnabledKey")!==NO&&this.getContentProperty("itemSeparatorKey")!==
+YES}.property("content.isEnabled").cacheable(),title:function(){var a=this.getContentProperty("itemTitleKey");if(this.getPath("parentMenu.localize")&&a)a=a.loc();return a||""}.property("content.title").cacheable(),getContentProperty:function(a){var b=this.get("content"),c=this.get("parentMenu");if(b)return b.get(c.get(a))},mouseUp:function(){var a;(a=this.getPath("parentMenu.rootMenu.targetMenuItem"))&&a.performAction();return YES},performAction:function(){if(!(!this.get("isEnabled")||this.get("hasSubMenu")))if(this.getContentProperty("itemDisableMenuFlashKey"))this.sendAction();
+else{this._flashCounter=0;this.invokeLater(this.flashHighlight,25);this.invokeLater(this.sendAction,200)}},sendAction:function(){var a=this.getContentProperty("itemActionKey"),b=this.getContentProperty("itemTargetKey"),c=this.getPath("parentMenu.rootMenu");a=a===undefined?c.get("action"):a;b=b===undefined?c.get("target"):b;c.set("selectedItem",this.get("content"));if(SC.typeOf(a)===SC.T_FUNCTION){a.apply(b,[c]);SC.Logger.warn("Support for menu item action functions has been deprecated. Please use target and action.")}else(c=
+this.getPath("pane.rootResponder")||SC.RootResponder.responder)&&c.sendAction(a,b,this,this.get("pane"));this.getPath("parentMenu.rootMenu").remove()},flashHighlight:function(){var a=this._flashCounter,b=this.$();a%2===0?b.addClass("focus"):b.removeClass("focus");if(a<=2){this.invokeLater(this.flashHighlight,50);this._flashCounter++}},mouseDown:function(){return YES},mouseEntered:function(){var a=this.get("parentMenu");a.set("mouseHasEntered",YES);a.set("currentMenuItem",this);this.get("hasSubMenu")&&
+this.invokeLater(this.showSubMenu,100);return YES},mouseExited:function(){var a;if(this.get("hasSubMenu")){this.get("subMenu");this.invokeLater(this.checkMouseLocation,200)}else{a=this.get("parentMenu");a.get("currentMenuItem")===this&&a.set("currentMenuItem",null)}return YES},checkMouseLocation:function(){var a=this.get("subMenu"),b=this.get("parentMenu"),c;if(!a.get("mouseHasEntered")){c=b.get("currentMenuItem");if(c===this||c===null){(b=b.get("previousMenuItem"))&&b.resignFirstResponder();a.remove()}}},
+moveUp:function(){var a=this.get("parentMenu");a&&a.moveUp(this);return YES},moveDown:function(){var a=this.get("parentMenu");a&&a.moveDown(this);return YES},moveRight:function(){this.showSubMenu();return YES},keyDown:function(a){return this.interpretKeyEvents(a)},keyUp:function(){return YES},cancel:function(){this.getPath("parentMenu.rootMenu").remove();return YES},didBecomeFirstResponder:function(a){if(a===this)(a=this.get("parentMenu"))&&a.set("currentSelectedMenuItem",this)},willLoseFirstResponder:function(a){if(a===
+this)if(a=this.get("parentMenu")){a.set("currentSelectedMenuItem",null);a.set("previousSelectedMenuItem",this)}},insertNewline:function(a,b){this.mouseUp(b)},closeParent:function(){this.$().removeClass("focus");var a=this.get("parentMenu");a&&a.remove()},clickInside:function(a,b){return SC.pointInRect({x:b.pageX,y:b.pageY},a)}});sc_require("panes/picker");sc_require("views/menu_item");if(!SC.DEFAULT_MENU_ITEM_HEIGHT)SC.DEFAULT_MENU_ITEM_HEIGHT=20;
+if(!SC.DEFAULT_MENU_ITEM_SEPARATOR_HEIGHT)SC.DEFAULT_MENU_ITEM_SEPARATOR_HEIGHT=9;if(!SC.DEFAULT_MENU_HEIGHT_PADDING)SC.DEFAULT_MENU_HEIGHT_PADDING=0;
+SC.MenuPane=SC.PickerPane.extend({classNames:["sc-menu"],items:[],itemHeight:SC.DEFAULT_MENU_ITEM_HEIGHT,itemSeparatorHeight:SC.DEFAULT_MENU_ITEM_SEPARATOR_HEIGHT,menuHeight:0,menuHeightPadding:SC.DEFAULT_MENU_HEIGHT_PADDING,selectedItem:null,exampleView:SC.MenuItemView,anchor:null,isSubMenu:NO,localize:YES,popup:function(a,b){var c;if(a)c=a.isView?a.get("layer"):a;this.beginPropertyChanges();this.set("anchorElement",c);this.set("anchor",a);this.set("preferType",SC.PICKER_MENU);b&&this.set("preferMatrix",
+b);this.endPropertyChanges();this.adjust("height",this.get("menuHeight"));this.positionPane();this.set("defaultResponder",this);this.append()},remove:function(){this.set("currentMenuItem",null);this.closeOpenMenus();this.resignKeyPane();return arguments.callee.base.apply(this,arguments)},itemTitleKey:"title",itemIsEnabledKey:"isEnabled",itemValueKey:"value",itemIconKey:"icon",itemHeightKey:"height",itemSubMenuKey:"subMenu",itemSeparatorKey:"separator",itemTargetKey:"target",itemActionKey:"action",
+itemCheckboxKey:"checkbox",itemShortCutKey:"shortcut",itemKeyEquivalentKey:"keyEquivalent",itemDisableMenuFlashKey:"disableMenuFlash",menuItemKeys:"itemTitleKey itemValueKey itemIsEnabledKey itemIconKey itemSeparatorKey itemActionKey itemCheckboxKey itemShortCutKey itemBranchKey itemHeightKey subMenuKey itemKeyEquivalentKey itemTargetKey".w(),preferType:SC.PICKER_MENU,isModal:YES,_menuView:null,createChildViews:function(){var a,b,c;a=this.createChildView(SC.MenuScrollView,{borderStyle:SC.BORDER_NONE});
+b=this._menuView=SC.View.create();c=this.get("menuItemViews");b.set("layout",{top:0,left:0,height:this.get("menuHeight")});b.replaceAllChildren(c);a.set("contentView",b);this.childViews=[a];return this},menuItemViews:function(){var a=[],b=this.get("displayItems"),c=this.get("exampleView"),d,e,f,g,h,j,k,l,m,n,o,q,t;if(!b)return a;g=this.get("itemHeightKey");h=this.get("itemSeparatorKey");j=this.get("itemHeight");n=this.get("itemKeyEquivalentKey");k=this.get("itemSeparatorHeight");l=m=Math.floor(this.get("menuHeightPadding")/
+2);o=this.menuItemKeys.map(SC._menu_fetchKeys,this);t=b.get("length");for(q=0;q<t;q++){d=b[q];(f=d.get(g))||(f=d.get(h)?k:j);e=this._menuView.createChildView(c,{layout:{height:f,top:l},contentDisplayProperties:o,content:d,parentMenu:this});a[q]=e;l+=f;if(d=d.get(n))this._keyEquivalents[d]=e}this.set("menuHeight",l+m);return a}.property("displayItems").cacheable(),menuItemViewForContentIndex:function(a){var b=this.get("menuItemViews");if(b)return b.objectAt(a)},_keyEquivalents:{},rootMenu:function(){if(this.get("isSubMenu"))return this.getPath("parentMenu.rootMenu");
+return this}.property("isSubMenu").cacheable(),windowSizeDidChange:function(){this.remove();return arguments.callee.base.apply(this,arguments)},displayItems:function(){var a=this.get("items");this.get("localize");this.get("itemHeight");var b,c=[],d,e,f;if(!a)return null;b=a.get("length");for(d=0;d<b;d++)if(e=a.objectAt(d)){f=SC.typeOf(e);if(f===SC.T_STRING)e=SC.Object.create({title:e,value:e,isEnabled:YES});else if(f===SC.T_HASH)e=SC.Object.create(e);else if(f===SC.T_ARRAY)e=this.convertArrayMenuItemToObject(e);
+e.contentIndex=d;c.push(e)}return c}.property("items").cacheable(),_sc_menu_itemsDidChange:function(){this._menuView.replaceAllChildren(this.get("menuItemViews"));this._menuView.adjust("height",this.get("menuHeight"))}.observes("items"),convertArrayMenuItemToObject:function(a){SC.Logger.warn("Support for Array-based menu items has been deprecated.  Please update your menus to use a hash.");var b;b=SC._menu_fetchKeys;var c=SC.Object.create();b=this.menuItemKeys.map(b,this);c[b[0]]=a[0];c[b[1]]=a[1];
+c[b[2]]=a[2];c[b[3]]=a[3];c[b[4]]=a[4];c[b[5]]=a[5];c[b[6]]=a[6];c[b[7]]=a[7];c[b[8]]=a[8];c[b[9]]=a[9];c[b[10]]=a[10];c[b[11]]=a[11];c[b[12]]=a[12];return c},currentMenuItem:function(a,b){if(b!==undefined){this._currentMenuItem!==null&&this.set("previousMenuItem",this._currentMenuItem);this._currentMenuItem=b;this.setPath("rootMenu.targetMenuItem",b);return b}return this._currentMenuItem}.property().cacheable(),_sc_menu_currentMenuItemDidChange:function(){var a=this.get("currentMenuItem"),b=this.get("previousMenuItem");
+if(b)if(!(b.get("hasSubMenu")&&a===null)){b.resignFirstResponder();this.closeOpenMenusFor(b)}a&&a.get("isEnabled")&&!a.get("isSeparator")&&a.becomeFirstResponder()}.observes("currentMenuItem"),closeOpenMenusFor:function(a){if(a)for(var b=a.get("parentMenu");b&&a;)if(b=a.get("subMenu")){b.remove();a.resignFirstResponder();a=b.get("previousMenuItem")}},closeOpenMenus:function(){this.closeOpenMenusFor(this.get("previousMenuItem"))},mouseDown:function(){this.modalPaneDidClick();return YES},keyUp:function(a){a=
+this.interpretKeyEvents(a);return!a?NO:a},moveUp:function(){var a=this.get("currentMenuItem"),b=this.get("menuItemViews");if(a){a=a.getPath("content.contentIndex");if(a===0)return YES;a=a-1}else a=b.get("length")-1;for(;a>=0;){if(b[a].get("isEnabled")){this.set("currentMenuItem",b[a]);break}a--}return YES},moveDown:function(){var a=this.get("currentMenuItem"),b=this.get("menuItemViews"),c=b.get("length");if(a){a=a.getPath("content.contentIndex");if(a===c)return YES;a=a+1}else a=0;for(;a<c;){if(b[a].get("isEnabled")){this.set("currentMenuItem",
+b[a]);break}a++}return YES},insertText:function(a){var b=this._timer,c=this._keyBuffer;b&&b.invalidate();this._timer=SC.Timer.schedule({target:this,action:"clearKeyBuffer",interval:500,isPooled:NO});c=c||"";c+=a.toUpperCase();this.selectMenuItemForString(c);this._keyBuffer=c;return YES},performKeyEquivalent:function(a){if(a=this._keyEquivalents[a]){a.performAction(YES);return YES}return NO},selectMenuItemForString:function(a){var b=this.get("menuItemViews"),c,d,e,f,g;if(b){g=a.length;f=b.get("length");
+for(e=0;e<f;e++){c=b.objectAt(e);if(d=c.get("title")){d=d.replace(/ /g,"").substr(0,g).toUpperCase();if(d===a){this.set("currentMenuItem",c);break}}}}},clearKeyBuffer:function(){this._keyBuffer=""},modalPaneDidClick:function(){this.closeOpenMenusFor(this.get("previousMenuItem"));this.remove();return YES}});SC._menu_fetchKeys=function(a){return this.get(a)};SC._menu_fetchItem=function(a){if(!a)return null;return this.get?this.get(a):this[a]};sc_require("views/button");
+SC.SelectButtonView=SC.ButtonView.extend({objects:[],objectsBindingDefault:SC.Binding.multiple(),nameKey:null,sortKey:null,valueKey:null,iconKey:null,isEnabledKey:"isEnabled",localize:YES,disableSort:YES,classNames:["select-button"],itemList:[],itemIdx:null,value:null,checkboxEnabled:YES,separatorPostion:null,_defaultVal:null,_defaultTitle:null,_defaultIcon:null,theme:"popup",displayProperties:["icon","value","controlSize","objects"],preferMatrix:null,SELECT_BUTTON_SPRITE_WIDTH:28,CUSTOM_MENU_ITEM_HEIGHT:20,
+isSelectedBinding:"*menu.isVisibleInWindow",isDefaultPosition:NO,lastMenuWidth:null,customView:null,customViewClassName:null,customViewMenuOffsetWidth:0,needsEllipsis:YES,menuPaneHeightPadding:0,supportFocusRing:YES,leftAlign:function(){var a=0,b=this.get("controlSize");if(b===SC.SMALL_CONTROL_SIZE)a=-12;if(b===SC.REGULAR_CONTROL_SIZE)a=-15;return a}.property("controlSize"),sortObjects:function(a){if(!this.get("disableSort")){var b=this.get("sortKey")||this.get("nameKey");a=a.sort(function(c,d){if(b){c=
+c.get?c.get(b):c[b];d=d.get?d.get(b):d[b]}return c<d?-1:c>d?1:0})}return a},render:function(a,b){arguments.callee.base.apply(this,arguments);var c,d,e,f,g,h,j,k,l,m,n,o,q,t,r,s,v;c=this.layout.width;b&&c&&this.adjust({width:c-this.SELECT_BUTTON_SPRITE_WIDTH});c=this.get("objects");c=this.sortObjects(c);d=c.length;e=this.get("nameKey");f=this.get("iconKey");g=this.get("valueKey");v=this.get("isEnabledKey");h=this.get("checkboxEnabled");j=this.get("value");k=this.get("localize");l=this.get("separatorPostion");
+m=[];n=YES;o=0;c.forEach(function(w){if(w){q=e?w.get?w.get(e):w[e]:w.toString();q=k?q.loc():q;t=f?w.get?w.get(f):w[f]:null;if(SC.none(w[f]))t=null;r=g?w.get?w.get(g):w[g]:w;if(!SC.none(j)&&!SC.none(r))if(j===r){this.set("title",q);this.set("icon",t)}if(r===this.get("value")){this.set("itemIdx",o);n=!h?NO:YES}else n=NO;s=w[v];if(NO!==s)s=YES;if(o===0){this._defaultVal=r;this._defaultTitle=q;this._defaultIcon=t}w=SC.Object.create({title:q,icon:t,value:r,isEnabled:s,checkbox:n,target:this,action:this.displaySelectedItem});
+m.push(w)}o+=1;if(l&&o===d-l){w=SC.Object.create({separator:YES});m.push(w)}this.set("itemList",m)},this);b&&this.invokeLast(function(){var w=this.get("value");if(SC.none(w)){this.set("value",this._defaultVal);this.set("title",this._defaultTitle);this.set("icon",this._defaultIcon)}});this.set("CUSTOM_MENU_ITEM_HEIGHT",this.get("controlSize")===SC.SMALL_CONTROL_SIZE?18:20);this.changeSelectButtonPreferMatrix(this.itemIdx)},_action:function(){var a,b,c,d,e,f,g,h,j;a=this.$(".sc-button-label")[0];b=
+this.get("layer").offsetWidth;c=a.scrollWidth;d=this.get("lastMenuWidth");if(c){a=a.offsetWidth;if(c&&a)b=b+c-a}if(!d||b>d)d=b;b=this.get("itemList");g=this.get("customViewClassName");c=this.get("customViewMenuOffsetWidth");a="sc-view sc-pane sc-panel sc-palette sc-picker sc-menu select-button sc-scroll-view sc-menu-scroll-view sc-container-view menuContainer sc-button-view sc-menu-item sc-regular-size";a=g?a+" "+g:a;h=0;for(j=b.length;h<j;++h){e=b.objectAt(h);g=document.createElement("div");g.style.cssText=
+"top:-10000px; left: -10000px;  position: absolute;";g.className=a;g.innerHTML=e.title;document.body.appendChild(g);e=g.offsetWidth+c;if(!f||e>f)f=e;document.body.removeChild(g)}d=f>d?f:d;f=SC.RootResponder.responder.get("currentWindowSize").width;if(d>f)d=f-25;this.set("lastMenuWidth",d);this.get("value");f=this.get("itemList");b=this.get("controlSize");c=this.get("menuPaneHeightPadding");a=this.get("customView");d=SC.MenuPane.create({classNames:["select-button"],items:f,exampleView:a?a:SC.MenuItemView,
+isEnabled:YES,menuHeightPadding:c,preferType:SC.PICKER_MENU,itemHeightKey:"height",layout:{width:d},controlSize:b,itemWidth:d,itemHeight:this.get("itemHeight")||20,contentView:SC.View.extend({})});if(!d)return NO;d.popup(this,this.preferMatrix);d.set("currentMenuItem",d.menuItemViewForContentIndex(this.get("itemIdx")));return YES},displaySelectedItem:function(a){a=a.get("selectedItem");this.set("value",a.get("value"));this.set("title",a.get("title"));this.set("itemIdx",a.get("contentIndex"))},changeSelectButtonPreferMatrix:function(){var a=
+this.get("controlSize")===SC.SMALL_CONTROL_SIZE?0:-2,b=a,c=this.get("itemIdx"),d=this.get("leftAlign");if(this.get("isDefaultPosition")){a=[d,4,3];this.set("preferMatrix",a)}else{if(c)b=c*this.CUSTOM_MENU_ITEM_HEIGHT+a;a=[d,-b,2];this.set("preferMatrix",a)}},mouseDown:function(){if(!this.get("isEnabled"))return YES;this.set("isActive",YES);this._isMouseDown=YES;this.becomeFirstResponder();this._action();return YES},keyDown:function(a){if(this.interpretKeyEvents(a))return YES;else arguments.callee.base.apply(this,
+arguments)},interpretKeyEvents:function(a){if(a)if(a.keyCode===38||a.keyCode===40)this._action();else a.keyCode===27&&this.resignFirstResponder();return arguments.callee.base.apply(this,arguments)},acceptsFirstResponder:function(){return this.get("isEnabled")}.property("isEnabled")});sc_require("panes/panel");
+SC.SheetPane=SC.PanelPane.extend({classNames:"sc-sheet",transitionDuration:200,_state:"NO_VIEW",init:function(){arguments.callee.base.apply(this,arguments);if(SC.Animatable){SC.SheetPane.ANIMATABLE_AVAILABLE=YES;this.mixin(SC.Animatable);if(!this.transitions)this.transitions={};if(!this.transitions.top)this.transitions.top={duration:this.transitionDuration===200?0.3:this.transitionDuration/1E3,action:"_complete",target:this}}},append:function(){var a=this.get("layout");if(!a.height||!a.top)a=SC.View.convertLayoutToAnchoredLayout(a,
+this.computeParentDimensions());a.top=-1*a.height;this.disableAnimation&&this.disableAnimation();this.adjust(a);this.updateLayout();this.enableAnimation&&this.enableAnimation();return arguments.callee.base.apply(this,arguments)},remove:function(){var a=this,b=arguments;this.invokeLater(function(){b.callee.base.apply(a,b)},this.transitionDuration);this.slideUp();return this},paneDidAttach:function(){var a=arguments.callee.base.apply(this,arguments);this.slideDown();return a},slideDown:function(){this._state=
+SC.SheetPane.ANIMATING;this._direction=SC.SheetPane.SLIDE_DOWN;if(SC.SheetPane.ANIMATABLE_AVAILABLE){this.transitions.top.timing=SC.Animatable.TRANSITION_EASE_OUT;this.adjust("top",0)}else{this._start=Date.now();this._end=this._start+this.get("transitionDuration");this.tick()}},slideUp:function(){this._state=SC.SheetPane.ANIMATING;this._direction=SC.SheetPane.SLIDE_UP;if(SC.SheetPane.ANIMATABLE_AVAILABLE){var a=this.get("layout");this.transitions.top.timing=SC.Animatable.TRANSITION_EASE_IN;this.adjust("top",
+-1*a.height)}else{this._start=Date.now();this._end=this._start+this.get("transitionDuration");this.tick()}},_complete:function(){if(this._direction===SC.SheetPane.SLIDE_DOWN){SC.SheetPane.ANIMATABLE_AVAILABLE||this.adjust("top",0);SC.browser.mozilla&&this.parentViewDidChange()}else{var a=this.get("layout");SC.SheetPane.ANIMATABLE_AVAILABLE||this.adjust("top",-1*a.height)}this._state=SC.SheetPane.READY;this.updateLayout()},blurTo:function(){this.setFirstResponder("")},tick:function(){this._timer=null;
+var a=(Date.now()-this._start)/(this._end-this._start),b=this,c=this._direction,d=this.get("layout");if(a<0)a=0;if(a>=1){this._complete();return this}a=Math.floor(d.height*a);if(c==SC.SheetPane.SLIDE_DOWN)b.adjust("top",0-(d.height-a));else c==SC.SheetPane.SLIDE_UP&&b.adjust("top",0-a);this._timer=this.invokeLater(this.tick,20);b.updateLayout();return this}});SC.SheetPane.mixin({ANIMATABLE_AVAILABLE:NO,NO_VIEW:"NO_VIEW",ANIMATING:"ANIMATING",READY:"READY",SLIDE_DOWN:"SLIDEDOWN",SLIDE_UP:"SLIDEUP"});
+SC.DRAG_LINK=4;SC.DRAG_COPY=1;SC.DRAG_MOVE=2;SC.DRAG_NONE=0;SC.DRAG_ANY=7;SC.DRAG_AUTOSCROLL_ZONE_THICKNESS=20;
+SC.Drag=SC.Object.extend({source:null,ghostView:null,ghostActsLikeCursor:NO,dragView:null,ghost:YES,slideBack:YES,mouseDownEvent:null,ghostOffset:{x:0,y:0},location:{},dataTypes:function(){if(this.dataSource)return this.dataSource.get("dragDataTypes")||[];var a=this.data;if(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b}if((a=this.get("source"))&&a.dragDataTypes)return a.get("dragDataTypes")||[];return[]}.property().cacheable(),hasDataType:function(a){return this.get("dataTypes").indexOf(a)>=
+0},dataForType:function(a){if(this.dataSource)return this.dataSource.dragDataForType(this,a);else if(this.data)return this.data[a];else{var b=this.get("source");return b&&SC.typeOf(b.dragDataForType)==SC.T_FUNCTION?b.dragDataForType(this,a):null}},dataSource:null,data:null,allowedDragOperations:SC.DRAG_ANY,_dragInProgress:YES,_dragViewWasVisible:null,startDrag:function(){this._createGhostView();var a=this.event,b={x:a.pageX,y:a.pageY};this.set("location",b);var c=this._getDragView(),d=c.get("parentView");
+d=d?d.convertFrameToView(c.get("frame"),null):c.get("frame");if(this.ghost){this._dragViewWasVisible=c.get("isVisible");c.set("isVisible",NO)}this.ghostOffset=this.ghostActsLikeCursor?{x:14,y:14}:{x:b.x-d.x,y:b.y-d.y};this._ghostViewHidden||this._positionGhostView(a);this.ghostView.rootResponder.dragDidStart(this);(c=this.source)&&c.dragDidBegin&&c.dragDidBegin(this,b);b=this._dropTargets();c=0;for(d=b.length;c<d;c++)b[c].tryToPerform("dragStarted",this,a)},mouseDragged:function(a){var b=this._autoscroll(a),
+c=this.get("location");if(!(!b&&a.pageX===c.x&&a.pageY===c.y)){c={x:a.pageX,y:a.pageY};this.set("location",c);b=this.source;for(var d=this._lastTarget,e=this._findDropTarget(a),f=SC.DRAG_NONE;e&&e!==d&&f===SC.DRAG_NONE;){f=e&&b&&b.dragSourceOperationMaskFor?b.dragSourceOperationMaskFor(this,e):SC.DRAG_ANY;if(f!==SC.DRAG_NONE&&e&&e.computeDragOperations)f&=e.computeDragOperations(this,a,f);else f=SC.DRAG_NONE;this.allowedDragOperations=f;if(f===SC.DRAG_NONE)e=this._findNextDropTarget(e)}if(e!==d){d&&
+d.dragExited&&d.dragExited(this,a);if(e){e.dragEntered&&e.dragEntered(this,a);e.dragUpdated&&e.dragUpdated(this,a)}this._lastTarget=e}else e&&e.dragUpdated&&e.dragUpdated(this,a);b&&b.dragDidMove&&b.dragDidMove(this,c);this._ghostViewHidden||this._positionGhostView(a)}},mouseUp:function(a){var b={x:a.pageX,y:a.pageY},c=this._lastTarget,d=this.allowedDragOperations;this.set("location",b);try{d=c&&c.acceptDragOperation&&c.acceptDragOperation(this,d)?c.performDragOperation?c.performDragOperation(this,
+d):SC.DRAG_NONE:SC.DRAG_NONE}catch(e){SC.Logger.error("Exception in SC.Drag.mouseUp(acceptDragOperation|performDragOperation): %@".fmt(e))}try{c&&c.dragExited&&c.dragExited(this,a)}catch(f){SC.Logger.error("Exception in SC.Drag.mouseUp(target.dragExited): %@".fmt(f))}c=this._dropTargets();for(var g=0,h=c.length;g<h;g++)try{c[g].tryToPerform("dragEnded",this,a)}catch(j){SC.Logger.error("Exception in SC.Drag.mouseUp(dragEnded on %@): %@".fmt(c[g],j))}this._destroyGhostView();if(this.ghost){this._dragViewWasVisible&&
+this._getDragView().set("isVisible",YES);this._dragViewWasVisible=null}(a=this.source)&&a.dragDidEnd&&a.dragDidEnd(this,b,d);this._lastTarget=null;this._dragInProgress=NO},_getDragView:function(){if(!this.dragView){if(!this.source||!this.source.isView)throw"Source can't be used as dragView, because it's not a view.";this.dragView=this.source}return this.dragView},_createGhostView:function(){var a=this._getDragView(),b=a.get("frame");(this.ghostView=SC.Pane.create({classNames:["sc-ghost-view"],layout:{top:b.y,
+left:b.x,width:b.width,height:b.height},owner:this,didCreateLayer:function(){if(a){var c=a.get("layer");if(c){c=c.cloneNode(true);c.style.top="0px";c.style.left="0px";this.get("layer").appendChild(c)}}}})).append()},_positionGhostView:function(){var a=this.get("location");a.x-=this.ghostOffset.x;a.y-=this.ghostOffset.y;var b=this.ghostView;if(b){b.adjust({top:a.y,left:a.x});b.invokeOnce("updateLayout")}},_ghostViewHidden:NO,hideGhostView:function(){if(this.ghostView&&!this._ghostViewHidden){this.ghostView.remove();
+this._ghostViewHidden=YES}},unhideGhostView:function(){if(this._ghostViewHidden){this._ghostViewHidden=NO;this._createGhostView()}},_destroyGhostView:function(){if(this.ghostView){this.ghostView.remove();this.ghostView=null;this._ghostViewHidden=NO}},_dropTargets:function(){if(this._cachedDropTargets)return this._cachedDropTargets;var a=[],b=SC.Drag._dropTargets;for(var c in b)b.hasOwnProperty(c)&&a.push(b[c]);var d={},e=SC.Drag._dropTargets,f=function(g){if(!g)return 0;var h=SC.guidFor(g),j=d[h];
+if(!j){for(j=1;g=g.get("parentView");)e[SC.guidFor(g)]!==undefined&&j++;d[h]=j}return j};a.sort(function(g,h){if(g===h)return 0;g=f(g);h=f(h);return g>h?-1:1});return this._cachedDropTargets=a},_findDropTarget:function(a){a={x:a.pageX,y:a.pageY};for(var b,c,d=this._dropTargets(),e=0,f=d.length;e<f;e++){b=d[e];if(b.get("isVisibleInWindow")){c=b.convertFrameToView(b.get("clippingFrame"),null);if(SC.pointInRect(a,c))return b}}return null},_findNextDropTarget:function(a){for(var b=SC.Drag._dropTargets;a=
+a.get("parentView");)if(b[SC.guidFor(a)])return a;return null},_autoscroll:function(a){if(!a)a=this._lastAutoscrollEvent;if(!this._dragInProgress)return NO;for(var b=a?{x:a.pageX,y:a.pageY}:this.get("location"),c=this._findScrollableView(b),d=null,e,f,g,h,j;c&&!d;){e=c.get("canScrollVertical")?1:0;f=c.get("canScrollHorizontal")?1:0;if(e||f)if(g=c.get("containerView"))j=c.convertFrameToView(g.get("frame"),null);else e=f=0;if(e){h=SC.maxY(j);g=h-SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;if(b.y>=g&&b.y<=h)e=
+1;else{g=SC.minY(j);h=g+SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;e=b.y>=g&&b.y<=h?-1:0}}if(f){h=SC.maxX(j);g=h-SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;if(b.x>=g&&b.x<=h)f=1;else{g=SC.minX(j);h=g+SC.DRAG_AUTOSCROLL_ZONE_THICKNESS;f=b.x>=g&&b.x<=h?-1:0}}if(e||f)d=c;else c=this._findNextScrollableView(c)}if(d&&this._lastScrollableView===d){if(Date.now()-this._hotzoneStartTime>100){this._horizontalScrollAmount*=1.05;this._verticalScrollAmount*=1.05}}else{this._lastScrollableView=d;this._verticalScrollAmount=this._horizontalScrollAmount=
+15;this._hotzoneStartTime=d?Date.now():null;f=e=0}if(d&&(f||e))d.scrollBy({x:f*this._horizontalScrollAmount,y:e*this._verticalScrollAmount});if(d){if(a)this._lastAutoscrollEvent={pageX:a.pageX,pageY:a.pageY};this.invokeLater(this._autoscroll,100,null);return YES}else{this._lastAutoscrollEvent=null;return NO}},_scrollableViews:function(){if(this._cachedScrollableView)return this._cachedScrollableView;var a=[],b=SC.Drag._scrollableViews;for(var c in b)b.hasOwnProperty(c)&&a.push(b[c]);return this._cachedScrollableView=
+a=a.sort(function(d,e){for(d=d;d=d.get("parentView");)if(e==d)return-1;return 1})},_findScrollableView:function(a){var b=this._scrollableViews(),c=b?b.length:0,d,e,f;for(f=0;f<c;f++){d=b[f];if(d.get("isVisibleInWindow")){e=d.convertFrameToView(d.get("clippingFrame"),null);if(SC.pointInRect(a,e))return d}}return null},_findNextScrollableView:function(a){for(var b=SC.Drag._scrollableViews;a=a.get("parentView");)if(b[SC.guidFor(a)])return a;return null}});
+SC.Drag.mixin({start:function(a){a=this.create(a);a.startDrag();return a},_dropTargets:{},_scrollableViews:{},addDropTarget:function(a){this._dropTargets[SC.guidFor(a)]=a},removeDropTarget:function(a){delete this._dropTargets[SC.guidFor(a)]},addScrollableView:function(a){this._scrollableViews[SC.guidFor(a)]=a},removeScrollableView:function(a){delete this._scrollableViews[SC.guidFor(a)]}});
 SC.MODIFIED_KEY_BINDINGS={"ctrl_.":"cancel",shift_tab:"insertBacktab",shift_left:"moveLeftAndModifySelection",shift_right:"moveRightAndModifySelection",shift_up:"moveUpAndModifySelection",shift_down:"moveDownAndModifySelection",alt_left:"moveLeftAndModifySelection",alt_right:"moveRightAndModifySelection",alt_up:"moveUpAndModifySelection",alt_down:"moveDownAndModifySelection",ctrl_a:"selectAll"};
-SC.BASE_KEY_BINDINGS={escape:"cancel",backspace:"deleteBackward","delete":"deleteForward","return":"insertNewline",tab:"insertTab",left:"moveLeft",right:"moveRight",up:"moveUp",down:"moveDown",home:"moveToBeginningOfDocument",end:"moveToEndOfDocument",pagedown:"pageDown",pageup:"pageUp"};
-SC.CAPTURE_BACKSPACE_KEY=NO;SC.PANEL_ORDER_LAYER=4096;SC.PALETTE_ORDER_LAYER=8192;
-SC.POPUP_ORDER_LAYER=12288;SC.RootResponder=SC.RootResponder.extend({platform:"desktop",focusedPane:function(){var a=this.get("orderedPanes");
-return a[a.length-1]}.property("orderedPanes"),orderedPanes:null,orderBefore:function(c,g){var a=this.get("focusedPane");
-var h=this.get("orderedPanes").without(c);var f,i,d,e;var b=c.get("orderLayer");if(g){f=h.length;
-i=h.indexOf(g);d=g.get("orderLayer");if(d<b){while((g.get("orderLayer")<b)&&(++i<f)){g=h[i]
-}if(i>=f){g=null}}else{if(d>b){while((g.get("orderLayer")>b)&&(--i>=0)){g=h[i]}g=(i<0)?h[0]:h[i+1]
-}}}else{i=h.length;while((--i>=0)&&!g){g=h[i];if(g.get("orderLayer")>b){g=null}}if(i<0){g=h[0]
-}else{g=h[i+1]}}if(g){i=h.indexOf(g);h.insertAt(i,c)}else{h.push(c)}this.set("orderedPanes",h);
-e=this.get("focusedPane");if(e!==a){if(a){a.blurTo(e)}if(e){e.focusFrom(a)}}return this
-},orderOut:function(e){var d=this.get("focusedPane"),c=this.get("keyPane");var b=this.get("orderedPanes").without(e);
-this.set("orderedPanes",b);if(d===e){var a=this.get("focusedPane");if(d){d.blurTo(a)
-}if(a){a.focusFrom(d)}if(c===e){this.makeKeyPane(a)}}else{if(c===e){this.makeKeyPane(null)
-}}return this},init:function(){arguments.callee.base.apply(this,arguments);this.orderedPanes=[]
-},setup:function(){this.listenFor("keydown keyup mousedown mouseup click dblclick mouseout mouseover mousemove selectstart".w(),document).listenFor("resize focus blur".w(),window);
-if(this.keypress){if(SC.CAPTURE_BACKSPACE_KEY&&SC.browser.mozilla){var b=this;document.onkeypress=function(c){c=SC.Event.normalizeEvent(c);
-return b.keypress.call(b,c)};SC.Event.add(window,"unload",this,function(){document.onkeypress=null
-})}else{SC.Event.add(document,"keypress",this,this.keypress)}}"drag selectstart".w().forEach(function(d){var e=this[d];
-if(e){if(SC.browser.msie){var c=this;document.body["on"+d]=function(f){return e.call(c,SC.Event.normalizeEvent(event||window.event))
-};SC.Event.add(window,"unload",this,function(){document.body["on"+d]=null})}else{SC.Event.add(document,d,this,e)
-}}},this);var a=SC.browser.mozilla?"DOMMouseScroll":"mousewheel";SC.Event.add(document,a,this,this.mousewheel);
-this.set("currentWindowSize",this.computeWindowSize());this.focus()},attemptKeyEquivalent:function(b){var e=null;
-var d=b.commandCodes()[0];if(!d){return NO}var a=this.get("keyPane"),f=this.get("mainPane"),c=this.get("mainMenu");
-if(a){e=a.performKeyEquivalent(d,b)}if(!e&&f&&(f!==a)){e=f.performKeyEquivalent(d,b)
-}if(!e&&c){e=c.performKeyEquivalent(d,b)}return e},currentWindowSize:null,computeWindowSize:function(){var a;
-if(window.innerHeight){a={width:window.innerWidth,height:window.innerHeight}}else{if(document.documentElement&&document.documentElement.clientHeight){a={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}
-}else{if(document.body){a={width:document.body.clientWidth,height:document.body.clientHeight}
-}}}return a},resize:function(){this._resize();return YES},_resize:function(){var a=this.computeWindowSize(),b=this.get("currentWindowSize");
-this.set("currentWindowSize",a);if(!SC.rectsEqual(a,b)){if(this.panes){SC.RunLoop.begin();
-this.panes.invoke("windowSizeDidChange",b,a);SC.RunLoop.end()}}},hasFocus:NO,focus:function(){if(!this.get("hasFocus")){SC.$("body").addClass("sc-focus").removeClass("sc-blur");
-SC.RunLoop.begin();this.set("hasFocus",YES);SC.RunLoop.end()}return YES},blur:function(){if(this.get("hasFocus")){SC.$("body").addClass("sc-blur").removeClass("sc-focus");
-SC.RunLoop.begin();this.set("hasFocus",NO);SC.RunLoop.end()}return YES},dragDidStart:function(a){this._mouseDownView=a;
-this._drag=a},_lastModifiers:null,_handleModifierChanges:function(b){var a;a=this._lastModifiers=(this._lastModifiers||{alt:false,ctrl:false,shift:false});
-var c=false;if(b.altKey!==a.alt){a.alt=b.altKey;c=true}if(b.ctrlKey!==a.ctrl){a.ctrl=b.ctrlKey;
-c=true}if(b.shiftKey!==a.shift){a.shift=b.shiftKey;c=true}b.modifiers=a;return(c)?(this.sendEvent("flagsChanged",b)?b.hasCustomEventHandling:YES):YES
-},_isFunctionOrNonPrintableKey:function(a){return !!(a.altKey||a.ctrlKey||a.metaKey||((a.charCode!==a.which)&&SC.FUNCTION_KEYS[a.which]))
-},_isModifierKey:function(a){return !!SC.MODIFIER_KEYS[a.charCode]},keydown:function(a){if(!a.kindOf){this._ffevt=null
-}else{a=this._ffevt}if(a===null){return YES}if(SC.browser.mozilla&&(a.which===8)){return true
-}var b=this._handleModifierChanges(a);var d=a.target||a.srcElement;var c=(a.which===8)&&!SC.allowsBackspaceToPreviousPage&&(d===document.body);
-if(this._isModifierKey(a)){return(c?NO:b)}b=YES;if(this._isFunctionOrNonPrintableKey(a)){if(SC.browser.mozilla&&a.keyCode>=37&&a.keyCode<=40){this._ffevt=a;
-SC.RunLoop.begin();this.invokeLater(this.keydown,50);SC.RunLoop.end()}b=this.sendEvent("keyDown",a);
-if(!b){b=!this.attemptKeyEquivalent(a)}else{b=a.hasCustomEventHandling;if(b){c=NO
-}}}return c?NO:b},keypress:function(a){var b;if(SC.browser.mozilla&&(a.which===8)){b=this.sendEvent("keyDown",a);
-return b?(SC.allowsBackspaceToPreviousPage||a.hasCustomEventHandling):YES}else{if(a.charCode!==undefined&&a.charCode===0){return YES
-}return this.sendEvent("keyDown",a)?a.hasCustomEventHandling:YES}},keyup:function(a){if(this._ffevt){this._ffevt=null
-}var b=this._handleModifierChanges(a);if(this._isModifierKey(a)){return b}return this.sendEvent("keyUp",a)?a.hasCustomEventHandling:YES
-},mousedown:function(c){try{this.focus();if(SC.browser.msie){this._lastMouseDownX=c.clientX;
-this._lastMouseDownY=c.clientY}this._clickCount+=1;if(!this._lastMouseUpAt||((Date.now()-this._lastMouseUpAt)>200)){this._clickCount=1
-}c.clickCount=this._clickCount;var b=this.targetViewForEvent(c);var a=null;if(b){a=b.get("pane").get("firstResponder")
-}if(a&&a.kindOf(SC.InlineTextFieldView)&&a!==b){a.resignFirstResponder()}b=this._mouseDownView=this.sendEvent("mouseDown",c,b);
-if(b&&b.respondsTo("mouseDragged")){this._mouseCanDrag=YES}}catch(d){console.warn("Exception during mousedown: %@".fmt(d));
-this._mouseDownView=null;this._mouseCanDrag=NO;throw d}return b?c.hasCustomEventHandling:YES
-},mouseup:function(b){try{if(this._drag){this._drag.tryToPerform("mouseUp",b);this._drag=null
-}var c=null,a=this._mouseDownView;this._lastMouseUpAt=Date.now();b.clickCount=this._clickCount;
-if(a){c=this.sendEvent("mouseUp",b,a);if(!c&&(this._clickCount===2)){c=this.sendEvent("doubleClick",b,a)
-}if(!c){c=this.sendEvent("click",b,a)}}if(!c){a=this.targetViewForEvent(b);if(this._clickCount===2){c=this.sendEvent("doubleClick",b,a)
-}if(!c){c=this.sendEvent("click",b,a)}}this._mouseCanDrag=NO;this._mouseDownView=null
-}catch(d){this._drag=null;this._mouseCanDrag=NO;this._mouseDownView=null;throw d}return(c)?b.hasCustomEventHandling:YES
-},dblclick:function(a){if(SC.browser.isIE){this._clickCount=2;this.mouseup(a)}},mousewheel:function(b){try{var a=this.targetViewForEvent(b);
-var c=this.sendEvent("mouseWheel",b,a)}catch(d){throw d}return(c)?b.hasCustomEventHandling:YES
-},_lastHovered:null,mousemove:function(d){SC.RunLoop.begin();try{this.focus();if(this._drag){if(SC.browser.msie){if(this._lastMouseDownX!==d.clientX&&this._lastMouseDownY!==d.clientY){this._drag.tryToPerform("mouseDragged",d)
-}}else{this._drag.tryToPerform("mouseDragged",d)}}else{var c=this._lastHovered||[];
-var f=[];var b=this.targetViewForEvent(d);var i;while(b&&(b!==this)){if(c.indexOf(b)!==-1){b.tryToPerform("mouseMoved",d);
-f.push(b)}else{b.tryToPerform("mouseEntered",d);f.push(b)}b=b.get("nextResponder")
-}for(var h=0,a=c.length;h<a;h++){b=c[h];i=b.respondsTo("mouseExited");if(i&&!(f.indexOf(b)!==-1)){b.tryToPerform("mouseExited",d)
-}}this._lastHovered=f;if(this._mouseDownView){if(SC.browser.msie){if(this._lastMouseDownX!==d.clientX&&this._lastMouseDownY!==d.clientY){this._mouseDownView.tryToPerform("mouseDragged",d)
-}}else{this._mouseDownView.tryToPerform("mouseDragged",d)}}}}catch(g){throw g}SC.RunLoop.end()
-},_mouseCanDrag:YES,selectstart:function(b){var a=this.sendEvent("selectStart",b,this.targetViewForEvent(b));
-return(a!==null?YES:NO)&&(this._mouseCanDrag?NO:YES)},drag:function(){return false
-}});sc_require("core");SC.UndoManager=SC.Object.extend({undoActionName:function(){return this.undoStack?this.undoStack.name:null
-}.property("undoStack"),redoActionName:function(){return this.redoStack?this.redoStack.name:null
-}.property("redoStack"),canUndo:function(){return this.undoStack!=null}.property("undoStack"),canRedo:function(){return this.redoStack!=null
-}.property("redoStack"),undo:function(){this._undoOrRedo("undoStack","isUndoing")
-},redo:function(){this._undoOrRedo("redoStack","isRedoing")},isUndoing:false,isRedoing:false,groupingLevel:0,registerUndo:function(b,a){this.beginUndoGroup(a);
-this._activeGroup.actions.push(b);this.endUndoGroup(a)},beginUndoGroup:function(b){if(this._activeGroup){this.groupingLevel++
-}else{var a=this.isUndoing?"redoStack":"undoStack";this._activeGroup={name:b,actions:[],prev:this.get(a)};
-this.set(a,this._activeGroup);this.groupingLevel=1}},endUndoGroup:function(a){if(!this._activeGroup){raise("endUndoGroup() called outside group.")
-}if(this.groupingLevel>1){this.groupingLevel--}else{this._activeGroup=null;this.groupingLevel=0
-}this.propertyDidChange(this.isUndoing?"redoStack":"undoStack")},setActionName:function(a){if(!this._activeGroup){raise("setActionName() called outside group.")
-}this._activeGroup.name=a},_activeGroup:null,undoStack:null,redoStack:null,_undoOrRedo:function(a,c){if(this._activeGroup){return false
-}if(this.get(a)==null){return true}this.set(c,true);var e=this.get(a);this.set(a,e.prev);
-var b;var d=e.actions.length>1;if(d){this.beginUndoGroup(e.name)}while(b=e.actions.pop()){b()
-}if(d){this.endUndoGroup(e.name)}this.set(c,false)}});SC.NATURAL_SCROLLER_THICKNESS=16;
-SC.ScrollerView=SC.View.extend({classNames:["sc-scroller-view"],scrollerThickness:SC.NATURAL_SCROLLER_THICKNESS,value:function(a,c){if(c!==undefined){if(c>=0){this._value=c
-}}else{var b=this._value||0;return Math.min(b,this.get("maximum"))}}.property("maximum").cacheable(),maximum:0,isEnabled:YES,layoutDirection:SC.LAYOUT_VERTICAL,ownerScrollValueKey:function(){var a=null;
-switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:a="verticalScrollOffset";
-break;case SC.LAYOUT_HORIZONTAL:a="horizontalScrollOffset";break;default:a=null}return a
-}.property("layoutDirection").cacheable(),displayProperties:"maximum isEnabled layoutDirection".w(),render:function(b,c){var a=this.get("maximum");
-switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:b.addClass("sc-vertical");
-if(c){b.push('<div class="sc-inner" style="height: %@px;">&nbsp;</div>'.fmt(a))}else{this.$("div")[0].style.height=a+"px"
-}break;case SC.LAYOUT_HORIZONTAL:b.addClass("sc-horizontal");if(c){b.push('<div class="sc-inner" style="width: %@px;">&nbsp;</div>'.fmt(a))
-}else{this.$("div")[0].style.width=a+"px"}break;default:throw"You must set a layoutDirection for your scroller class."
-}b.setClass("disabled",!this.get("isEnabled"))},didCreateLayer:function(){var c=this._sc_scroller_scrollDidChange;
-SC.Event.add(this.$(),"scroll",this,c);var b=this.get("value");var a=this.get("layer");
-switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:a.scrollTop=b;break;case SC.LAYOUT_HORIZONTAL:a.scrollLeft=b;
-break}},willDestroyLayer:function(){var a=this._sc_scroller_scrollDidChange;SC.Event.remove(this.$(),"scroll",this,a)
-},_sc_scroller_armScrollTimer:function(){if(!this._sc_scrollTimer){SC.RunLoop.begin();
-var a=this._sc_scroller_scrollDidChange;this._sc_scrollTimer=this.invokeLater(a,50);
-SC.RunLoop.end()}},_sc_scroller_scrollDidChange:function(){var b=Date.now(),d=this._sc_lastScroll;
-if(d&&(b-d)<50){return this._sc_scroller_armScrollTimer()}this._sc_scrollTimer=null;
-this._sc_lastScroll=b;SC.RunLoop.begin();if(!this.get("isEnabled")){return}var c=this.get("layer"),a=0;
-switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:this._sc_scrollValue=a=c.scrollTop;
-break;case SC.LAYOUT_HORIZONTAL:this._sc_scrollValue=a=c.scrollLeft;break}this.set("value",a);
-SC.RunLoop.end()},_sc_scroller_valueDidChange:function(){var a=this.get("value");
-if(a!==this._sc_scrollValue){var b=this.get("layer");if(b){switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:b.scrollTop=a;
-break;case SC.LAYOUT_HORIZONTAL:b.scrollLeft=a;break}}}}.observes("value")});sc_require("views/scroller");
-sc_require("mixins/border");SC.ScrollView=SC.View.extend(SC.Border,{classNames:["sc-scroll-view"],isScrollable:YES,contentView:null,horizontalScrollOffset:0,verticalScrollOffset:0,maximumHorizontalScrollOffset:function(){if(!this.get("canScrollHorizontal")){return 0
-}var b=this.get("contentView");var a=b?b.get("frame").width:0;if(b.calculatedWidth&&b.calculatedWidth!==0){a=b.calculatedWidth
-}var c=this.get("containerView").get("frame").width;return Math.max(0,a-c)}.property(),maximumVerticalScrollOffset:function(){if(!this.get("canScrollVertical")){return 0
-}var a=this.get("contentView");var b=(a&&a.get("frame"))?a.get("frame").height:0;
-if(a.calculatedHeight&&a.calculatedHeight!==0){b=a.calculatedHeight}var c=this.get("containerView").get("frame").height;
-return Math.max(0,b-c)}.property(),verticalLineScroll:20,horizontalLineScroll:20,verticalPageScroll:function(){return this.get("frame").height
-}.property("frame"),horizontalPageScroll:function(){return this.get("frame").width
-}.property("frame"),hasHorizontalScroller:YES,horizontalScrollerView:SC.ScrollerView,isHorizontalScrollerVisible:YES,canScrollHorizontal:function(){return !!(this.get("hasHorizontalScroller")&&this.get("horizontalScrollerView")&&this.get("isHorizontalScrollerVisible"))
-}.property("isHorizontalScrollerVisible").cacheable(),autohidesHorizontalScroller:YES,hasVerticalScroller:YES,verticalScrollerView:SC.ScrollerView,isVerticalScrollerVisible:YES,canScrollVertical:function(){return !!(this.get("hasVerticalScroller")&&this.get("verticalScrollerView")&&this.get("isVerticalScrollerVisible"))
-}.property("isVerticalScrollerVisible").cacheable(),autohidesVerticalScroller:YES,verticalScrollerBottom:0,containerView:SC.ContainerView,scrollTo:function(a,b){if(b===undefined&&SC.typeOf(a)===SC.T_HASH){b=a.y;
-a=a.x}if(!SC.none(a)){a=Math.max(0,Math.min(this.get("maximumHorizontalScrollOffset"),a));
-this.set("horizontalScrollOffset",a)}if(!SC.none(b)){b=Math.max(0,Math.min(this.get("maximumVerticalScrollOffset"),b));
-this.set("verticalScrollOffset",b)}return this},scrollBy:function(a,b){if(b===undefined&&SC.typeOf(a)===SC.T_HASH){b=a.y;
-a=a.x}a=(a)?this.get("horizontalScrollOffset")+a:null;b=(b)?this.get("verticalScrollOffset")+b:null;
-return this.scrollTo(a,b)},scrollToVisible:function(b){if(arguments.length===0){return arguments.callee.base.apply(this,arguments)
-}var d=this.get("contentView");if(!d){return NO}var a=b.get("frame");if(!a){return NO
-}a=d.convertFrameFromView(a,b.get("parentView"));var c=SC.cloneRect(this.get("containerView").get("frame"));
-c.x=this.get("horizontalScrollOffset");c.y=this.get("verticalScrollOffset");var f=c.x,e=c.y;
-c.y-=Math.max(0,SC.minY(c)-SC.minY(a));c.x-=Math.max(0,SC.minX(c)-SC.minX(a));c.y+=Math.max(0,SC.maxY(a)-SC.maxY(c));
-c.x+=Math.max(0,SC.maxX(a)-SC.maxX(c));if((f!==c.x)||(e!==c.y)){this.scrollTo(c.x,c.y);
-return YES}else{return NO}},scrollDownLine:function(a){if(a===undefined){a=1}return this.scrollBy(null,this.get("verticalLineScroll")*a)
-},scrollUpLine:function(a){if(a===undefined){a=1}return this.scrollBy(null,0-this.get("verticalLineScroll")*a)
-},scrollRightLine:function(a){if(a===undefined){a=1}return this.scrollTo(this.get("horizontalLineScroll")*a,null)
-},scrollLeftLine:function(a){if(a===undefined){a=1}return this.scrollTo(0-this.get("horizontalLineScroll")*a,null)
-},scrollDownPage:function(a){if(a===undefined){a=1}return this.scrollBy(null,this.get("verticalPageScroll")*a)
-},scrollUpPage:function(a){if(a===undefined){a=1}return this.scrollBy(null,0-(this.get("verticalPageScroll")*a))
-},scrollRightPage:function(a){if(a===undefined){a=1}return this.scrollBy(this.get("horizontalPageScroll")*a,null)
-},scrollLeftPage:function(a){if(a===undefined){a=1}return this.scrollBy(0-(this.get("horizontalPageScroll")*a),null)
-},tile:function(){var a=this.get("hasHorizontalScroller")?this.get("horizontalScrollerView"):null;
-var d=a&&this.get("isHorizontalScrollerVisible");var f=this.get("hasVerticalScroller")?this.get("verticalScrollerView"):null;
-var c=f&&this.get("isVerticalScrollerVisible");var b=this.get("containerView");var i={left:0,top:0};
-var h;var e=((d)?a.get("scrollerThickness"):0);var g=(c)?f.get("scrollerThickness"):0;
-if(d){a.set("layout",{left:0,bottom:0,right:g-1,height:e});i.bottom=e-1}else{i.bottom=0
-}if(a){a.set("isVisible",d)}if(c){e=e+this.get("verticalScrollerBottom");f.set("layout",{top:0,bottom:e,right:0,width:g});
-i.right=g-1}else{i.right=0}if(f){f.set("isVisible",c)}b.set("layout",i)},scrollerVisibilityDidChange:function(){this.tile()
-}.observes("isVerticalScrollerVisible","isHorizontalScrollerVisible"),_scroll_wheelDeltaX:0,_scroll_wheelDeltaY:0,mouseWheel:function(a){this._scroll_wheelDeltaX+=a.wheelDeltaX;
-this._scroll_wheelDeltaY+=a.wheelDeltaY;this.invokeLater(this._scroll_mouseWheel,10);
-return YES},_scroll_mouseWheel:function(){this.scrollBy(this._scroll_wheelDeltaX,this._scroll_wheelDeltaY);
-this._scroll_wheelDeltaX=this._scroll_wheelDeltaY=0},createChildViews:function(){var b=[],a;
-if(SC.none(a=this.containerView)){a=SC.ContainerView}b.push(this.containerView=this.createChildView(a,{contentView:this.contentView}));
-this.contentView=this.containerView.get("contentView");if(a=this.horizontalScrollerView){if(this.get("hasHorizontalScroller")){a=this.horizontalScrollerView=this.createChildView(a,{layoutDirection:SC.LAYOUT_HORIZONTAL,valueBinding:"*owner.horizontalScrollOffset"});
-b.push(a)}else{this.horizontalScrollerView=null}}if(a=this.verticalScrollerView){if(this.get("hasVerticalScroller")){a=this.verticalScrollerView=this.createChildView(a,{layoutDirection:SC.LAYOUT_VERTICAL,valueBinding:"*owner.verticalScrollOffset"});
-b.push(a)}else{this.verticalScrollerView=null}}this.childViews=b;this.contentViewDidChange();
-this.tile()},init:function(){arguments.callee.base.apply(this,arguments);this._scroll_contentView=this.get("contentView");
-var a=this._scroll_contentView;if(a){a.addObserver("frame",this,this.contentViewFrameDidChange)
-}if(this.get("isVisibleInWindow")){this._scsv_registerAutoscroll()}},_scsv_registerAutoscroll:function(){if(this.get("isVisibleInWindow")){SC.Drag.addScrollableView(this)
-}else{SC.Drag.removeScrollableView(this)}}.observes("isVisibleInWindow"),contentViewDidChange:function(){var c=this.get("contentView"),a=this._scroll_contentView;
-var b=this.contentViewFrameDidChange;if(c!==a){if(a){a.removeObserver("frame",this,b)
-}this._scroll_contentView=c;if(c){c.addObserver("frame",this,b)}this.containerView.set("contentView",c);
-this.contentViewFrameDidChange()}}.observes("contentView"),oldMaxHOffset:0,oldMaxVOffset:0,contentViewFrameDidChange:function(){var j=this.get("contentView"),i=(j)?j.get("frame"):null,b=(i)?i.width:0,l=(i)?i.height:0,g=this.get("frame");
-this._scroll_contentWidth=b;this._scroll_contentHeight=l;if(this.get("hasHorizontalScroller")&&(j=this.get("horizontalScrollerView"))){b-=1;
-if(this.get("autohidesHorizontalScroller")){this.set("isHorizontalScrollerVisible",b>g.width)
-}j.setIfChanged("maximum",b)}if(this.get("hasVerticalScroller")&&(j=this.get("verticalScrollerView"))){l-=1;
-if(this.get("autohidesVerticalScroller")){this.set("isVerticalScrollerVisible",l>g.height)
-}l-=this.get("verticalScrollerBottom");j.setIfChanged("maximum",l)}if(!this.get("isVerticalScrollerVisible")&&(this.get("verticalScrollOffset")!==0)&&this.get("autohidesVerticalScroller")){this.set("verticalScrollOffset",0)
-}if(!this.get("isHorizontalScrollerVisible")&&(this.get("horizontalScrollOffset")!==0)&&this.get("autohidesHorizontalScroller")){this.set("horizontalScrollOffset",0)
-}var k=this.get("maximumVerticalScrollOffset"),h=this.get("verticalScrollOffset"),e=this.get("maximumHorizontalScrollOffset"),a=this.get("horizontalScrollOffset");
-var d=k&&this.get("hasVerticalScroller")&&k<h;var c=e&&this.get("hasHorizontalScroller")&&e<a;
-if(d||c){this.forceDimensionsRecalculation(c,d,h,a)}},_scroll_horizontalScrollOffsetDidChange:function(){var b=this.get("horizontalScrollOffset");
-b=Math.max(0,Math.min(this.get("maximumHorizontalScrollOffset"),b));var a=this.get("contentView");
-if(a){a.adjust("left",0-b)}}.observes("horizontalScrollOffset"),_scroll_verticalScrollOffsetDidChange:function(){var c=this.get("verticalScrollOffset");
-c=Math.max(0,Math.min(this.get("maximumVerticalScrollOffset"),c));var b=this.get("contentView");
-var a=this.get("containerView");if(b){b.adjust("top",0-c)}}.observes("verticalScrollOffset"),forceDimensionsRecalculation:function(b,c,e,a){var f=a;
-var d=e;this.scrollTo(0,0);if(b&&c){this.scrollTo(this.get("maximumHorizontalScrollOffset"),this.get("maximumVerticalScrollOffset"))
-}if(b&&!c){this.scrollTo(this.get("maximumHorizontalScrollOffset"),d)}if(!b&&c){this.scrollTo(f,this.get("maximumVerticalScrollOffset"))
-}}});tiki.script("sproutcore/desktop:en/401f741f60c74ac80f68ac40328f274b54416791/javascript.js");
-tiki.register("sproutcore",{depends:["sproutcore/desktop"],packages:{"sproutcore/desktop":{}},scripts:[{url:"/static/sproutcore/en/1791a39f63c21d70c9e77714656c356b40642ed2/javascript.js",id:"sproutcore:en/1791a39f63c21d70c9e77714656c356b40642ed2/javascript.js"}]});
-tiki.global("sproutcore");
-/* @license
-==========================================================================
-SproutCore -- JavaScript Application Framework
-copyright 2006-2008, Sprout Systems, Inc. and contributors.
-
-Permission is hereby granted, free of charge, to any person obtaining a 
-copy of this software and associated documentation files (the "Software"), 
-to deal in the Software without restriction, including without limitation 
-the rights to use, copy, modify, merge, publish, distribute, sublicense, 
-and/or sell copies of the Software, and to permit persons to whom the 
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in 
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
-DEALINGS IN THE SOFTWARE.
-
-For more information about SproutCore, visit http://www.sproutcore.com
-
-
-==========================================================================
-@license */
-tiki.script("sproutcore:en/1791a39f63c21d70c9e77714656c356b40642ed2/javascript.js");
-tiki.register("sproutcore/empty_theme",{scripts:[{url:"/static/sproutcore/empty_theme/en/21c3b7b16d7ef39d60d2651975590828812f3ad9/javascript.js",id:"sproutcore/empty_theme:en/21c3b7b16d7ef39d60d2651975590828812f3ad9/javascript.js"}]});
-tiki.global("sproutcore/empty_theme");tiki.script("sproutcore/empty_theme:en/21c3b7b16d7ef39d60d2651975590828812f3ad9/javascript.js");
-tiki.register("sproutcore/standard_theme",{depends:["sproutcore/empty_theme"],packages:{"sproutcore/empty_theme":{}},scripts:[{url:"/static/sproutcore/standard_theme/en/897bb7af6f36da7f9944239957d9a0f238a5c4ed/javascript.js",id:"sproutcore/standard_theme:en/897bb7af6f36da7f9944239957d9a0f238a5c4ed/javascript.js"}]});
-tiki.global("sproutcore/standard_theme");tiki.script("sproutcore/standard_theme:en/897bb7af6f36da7f9944239957d9a0f238a5c4ed/javascript.js");
-tiki.register("browserup",{depends:["tiki","tiki/system"],packages:{"tiki/system":{},tiki:{}},scripts:[{url:"/static/browserup/en/c72f1c333efc19fa18133f6b37612c00da77d1a6/javascript.js",id:"browserup:en/c72f1c333efc19fa18133f6b37612c00da77d1a6/javascript.js"}]});
-tiki.module("browserup:array",'// Array additions.\n\n// ES5 draft:\n// http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf\n\n// ES5 15.4.3.2 \nif (!Array.isArray) {\n    Array.isArray = function(obj) {\n        return Object.prototype.toString.call(obj) == "[object Array]";\n    };\n}\n\n// ES5 15.4.4.18\nif (!Array.prototype.forEach) {\n    Array.prototype.forEach =  function(block, thisObject) {\n        var len = this.length >>> 0;\n        for (var i = 0; i < len; i++) {\n            if (i in this) {\n                block.call(thisObject, this[i], i, this);\n            }\n        }\n    };\n}\n\n// ES5 15.4.4.19\n// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map\nif (!Array.prototype.map) {\n    Array.prototype.map = function(fun /*, thisp*/) {\n        var len = this.length >>> 0;\n        if (typeof fun != "function")\n          throw new TypeError();\n\n        var res = new Array(len);\n        var thisp = arguments[1];\n        for (var i = 0; i < len; i++) {\n            if (i in this)\n                res[i] = fun.call(thisp, this[i], i, this);\n        }\n\n        return res;\n    };\n}\n;');
-tiki.module("browserup:function","// From Narwhal\nFunction.prototype.bind = function () {\n    var args = Array.prototype.slice.call(arguments);\n    var self = this;\n    var bound = function () {\n        return self.call.apply(\n            self,\n            args.concat(\n                Array.prototype.slice.call(arguments)\n            )\n        );\n    };\n    bound.name = this.name;\n    bound.displayName = this.displayName;\n    bound.length = this.length;\n    bound.unbound = self;\n    return bound;\n};\n\n;");
-tiki.module("browserup:package","require('function');\nrequire('array');\n;");tiki.script("browserup:en/c72f1c333efc19fa18133f6b37612c00da77d1a6/javascript.js");
-tiki.register("bespin",{depends:["tiki","tiki/system","sproutcore","sproutcore/empty_theme","sproutcore/standard_theme","browserup"],packages:{"sproutcore/empty_theme":{},"sproutcore/standard_theme":{},"tiki/system":{},sproutcore:{},browserup:{},tiki:{}},scripts:[{url:"/static/bespin/en/614012e975a60c9ae7e6ad329e6fe36808d1e2a7/javascript.js",id:"bespin:en/614012e975a60c9ae7e6ad329e6fe36808d1e2a7/javascript.js"}]});
-tiki.module("bespin:actions",function(c,a,d){var b=c("package");var g=c("sproutcore/runtime:package").SC;
-var f=c("cursor");var e=c("util/clipboard");a.Actions=g.Object.extend({editor:null,ignoreRepaints:false,currentEditItem:undefined,editDepth:0,beginEdit:function(h){if(this.editDepth==0){this.currentEditItem=a.ActionHistoryItem.create({name:h,editor:this.editor});
-this.currentEditItem.begin()}this.editDepth++},endEdit:function(){if(this.editDepth<=0){return
-}this.editDepth--;if(this.editDepth==0){this.currentEditItem.end();this.editor.historyManager.add(this.currentEditItem);
-this.currentEditItem=undefined}},handleCursorSelection:function(h){if(h.event.shiftKey){if(!this.editor.selection){this.editor.setSelection({startPos:f.copyPos(h.pos)})
-}this.editor.setSelection({startPos:this.editor.selection.startPos,endPos:f.copyPos(this.editor.cursorManager.getCursorPosition())})
-}else{this.editor.setSelection(undefined)}},moveCursor:function(i,h){var j=this.editor.cursorManager[i](h);
-this.handleCursorSelection(h);this.repaint();h.pos=j.newPos;return h},moveCursorLeft:function(h){return this.moveCursor("moveLeft",h)
-},moveCursorRight:function(h){return this.moveCursor("moveRight",h)},moveCursorUp:function(h){return this.moveCursor("moveUp",h)
-},moveCursorDown:function(h){return this.moveCursor("moveDown",h)},moveToLineStart:function(h){return this.moveCursor("moveToLineStart",h)
-},moveToLineEnd:function(h){return this.moveCursor("moveToLineEnd",h)},moveToFileTop:function(h){return this.moveCursor("moveToTop",h)
-},moveToFileBottom:function(h){return this.moveCursor("moveToBottom",h)},movePageUp:function(h){return this.moveCursor("movePageUp",h)
-},movePageDown:function(h){return this.moveCursor("movePageDown",h)},moveWordLeft:function(h){return this.moveCursor("smartMoveLeft",h)
-},moveWordRight:function(h){return this.moveCursor("smartMoveRight",h)},deleteWordLeft:function(h){this.beginEdit("deleteWordLeft");
-this.deleteChunk({endPos:h.pos,pos:this.moveCursor("smartMoveLeft",h).pos});this.endEdit();
-return h},deleteWordRight:function(h){this.beginEdit("deleteWordRight");this.deleteChunk({pos:h.pos,endPos:this.moveCursor("smartMoveRight",h).pos});
-this.endEdit();return h},applyState:function(k){if(this.testHistory.length==0){return
-}else{if(k<0){k=-1}else{if(k>=this.testHistory.length){return}}}this.testHistoryPosition=k;
-var j=this.testHistory[Math.max(0,this.testHistoryPosition)];var i=j.after;var h=j.uiAfter;
-if(k<0){i=j.before;h=j.uiBefore}this.editor.model.applyState(i);this.editor.setState(h)
-},undo:function(){this.editor.historyManager.undo()},redo:function(){this.editor.historyManager.redo()
-},selectAll:function(h){if(this.editor.model.isEmpty()){return}h.startPos={row:0,col:0};
-h.endPos={row:this.editor.model.getRowCount()-1,col:this.editor.editorView.getRowScreenLength(this.editor.model.getRowCount()-1)};
-this.select(h)},select:function(h){if(h.startPos){this.editor.setSelection({startPos:h.startPos,endPos:h.endPos});
-this.editor.cursorManager.moveCursor(h.endPos)}else{this.editor.setSelection(undefined)
-}},insertTab:function(i){if(this.editor.readonly){return}var k=b.get("settings");
-if(this.editor.getSelection()&&!i.undoInsertTab){this.indent(i);return}var j=i.tab;
-var h=this.editor.cursorManager.getCharacterLength("\t");if(!j||!h){if(k&&k.isSettingOn("tabmode")){j="\t"
-}else{j="";var l=h;while(l-->0){j+=" "}h=j.length}}this.beginEdit("insertTab");delete this.editor.selection;
-this.editor.model.insertCharacters(this.editor.cursorManager.getModelPosition({row:i.pos.row,col:i.pos.col}),j);
-this.editor.cursorManager.moveCursor({row:i.pos.row,col:i.pos.col+h});this.repaint();
-this.endEdit()},indent:function(r){this.beginEdit("indent");var o=b.get("settings");
-var t=this.editor.getSelection();var h=false;if(t===undefined){h=true;var p=this.editor.getCursorPos();
-var i=this.editor.getModelPos();t={startPos:{row:p.row,col:0},endPos:{row:p.row,col:this.editor.model.getRowMetadata(p.row).lineLength},startModelPos:{row:i.row,col:0},endModelPos:{row:i.row,col:this.editor.model.getRowMetadata(i.row).lineLengthWithoutTabExpansion}};
-this.editor.setSelection(t)}var v=t.startPos.row;var q=t.endPos.row;var l=this.editor.cursorManager.getStringLength(this.editor.model.getRowArray(q).join(""));
-var m=this.editor.cursorManager.getStringLength(this.editor.model.getRowArray(r.pos.row).join(""));
-var n;var k="";if(o&&o.isSettingOn("tabmode")){k="\t"}else{var j=this.editor.getTabSize();
-while(j-->0){k+=" "}}for(var s=v;s<=q;s++){if(k!="\t"){n=this.editor.cursorManager.getLeadingWhitespace(s);
-n=this.editor.cursorManager.getNextTablevelRight(n)-n;n=k.substring(0,n)}else{n="\t"
-}this.editor.model.insertCharacters(this.editor.cursorManager.getModelPosition({row:s,col:0}),n)
-}var u=this.editor.cursorManager.getStringLength(this.editor.model.getRowArray(r.pos.row).join(""))-m;
-t.endPos.col+=this.editor.cursorManager.getStringLength(this.editor.model.getRowArray(q).join(""))-l;
-this.editor.setSelection(t);this.editor.cursorManager.moveCursor({col:r.pos.col+u});
-if(h){this.editor.setSelection(undefined)}this.repaint();this.endEdit()},unindent:function(p){this.beginEdit("unindent");
-var r=this.editor.getSelection();var h=false;if(r===undefined){h=true;var n=this.editor.getCursorPos();
-var i=this.editor.getModelPos();r={startPos:{row:n.row,col:0},endPos:{row:n.row,col:this.editor.model.getRowMetadata(n.row).lineLength},startModelPos:{row:i.row,col:0},endModelPos:{row:i.row,col:this.editor.model.getRowMetadata(i.row).lineLengthWithoutTabExpansion}};
-this.editor.setSelection(r)}var t=r.startPos.row;var o=r.endPos.row;var l=this.editor.cursorManager.getStringLength(this.editor.model.getRowArray(o).join(""));
-var u=false;var m;var k;for(var q=t;q<=o;q++){u=this.editor.model.getRowArray(q);
-if(u.length>0&&u[0]=="\t"){m=1;k=this.editor.getTabSize()}else{var j=this.editor.cursorManager.getLeadingWhitespace(q);
-m=this.editor.cursorManager.getContinuousSpaceCount(0,this.editor.getTabSize(),q);
-k=m}if(m){this.editor.model.deleteCharacters(this.editor.cursorManager.getModelPosition({row:q,col:0}),m)
-}if(q==t){r.startPos.col=Math.max(0,r.startPos.col-k)}if(q==o){if(!u){u=this.editor.model.getRowArray(q)
-}var s=l-this.editor.cursorManager.getStringLength(u.join(""));r.endPos.col=Math.max(0,r.endPos.col-s);
-p.pos.col=Math.max(0,p.pos.col-s)}}this.editor.setSelection(r);this.editor.cursorManager.moveCursor({col:p.pos.col});
-if(h){this.editor.setSelection(undefined)}this.repaint();this.endEdit()},cutSelection:function(h){if(this.editor.readonly){return
-}this.beginEdit("cut");this.copySelection(h);this.deleteSelection(h);this.endEdit()
-},copySelection:function(h){var i=this.editor.getSelection();if(i){var j=this.editor.model.getChunk(i);
-if(j){e.manual.copy(j)}}},pasteFromClipboard:function(h){if(this.editor.readonly){return
-}var i=(h.clipboard)?h.clipboard:e.manual.data();if(i===undefined){return}h.chunk=i;
-this.beginEdit("paste");this.insertChunk(h);this.endEdit()},insertChunk:function(h){if(this.editor.readonly){return
-}this.beginEdit("insertChunk");if(this.editor.selection){this.deleteSelection()}var i=f.copyPos(this.editor.cursorManager.getCursorPosition());
-i=this.editor.model.insertChunk(this.editor.cursorManager.getModelPosition(i),h.chunk);
-i=this.editor.cursorManager.getCursorPosition(i);this.editor.cursorManager.moveCursor(i);
-this.repaint();this.endEdit();return i},deleteChunk:function(j){if(this.editor.readonly){return
-}this.beginEdit("deleteChunk");var i=(j.startPos!=undefined)?j.startPos:f.copyPos(j.pos);
-var k=this.editor.getSelection({startPos:i,endPos:j.endPos});var h=this.editor.model.deleteChunk(k);
-this.editor.cursorManager.moveCursor(k.startPos);this.editor.setSelection(undefined);
-this.repaint();this.endEdit();return k.startPos},joinLine:function(i){if(this.editor.readonly){return
-}this.beginEdit("joinLine");if(i.joinDirection=="up"){if(i.pos.row==0){return}var h=this.editor.editorView.getRowScreenLength(i.pos.row-1);
-this.editor.model.joinRow(i.pos.row-1);this.editor.cursorManager.moveCursor({row:i.pos.row-1,col:h})
-}else{if(i.pos.row>=this.editor.model.getRowCount()-1){return}this.editor.model.joinRow(i.pos.row)
-}this.endEdit();this.repaint()},killLine:function(h){if(this.editor.readonly){return
-}this.beginEdit("killLine");this.editor.setSelection({startPos:{row:h.pos.row,col:0},endPos:{row:h.pos.row+1,col:0}});
-this.cutSelection(h);this.endEdit()},deleteSelection:function(h){if(this.editor.readonly){return
-}var i=this.editor.getSelection();return this.deleteChunk({startPos:i.startPos,endPos:i.endPos,clearSelection:true})
-},backspace:function(j){if(this.editor.readonly){return}this.beginEdit("backspace");
-if(this.editor.selection){this.deleteSelection(j)}else{if(j.pos.col>0){var k=b.get("settings");
-if(k&&k.isSettingOn("smartmove")){var i=this.editor.getTabSize();var h=this.editor.cursorManager.getContinuousSpaceCount(j.pos.col,this.editor.cursorManager.getNextTablevelLeft(j.pos.col));
-if(h==i){var l=j.pos;this.editor.selection={startPos:{row:l.row,col:l.col-i},endPos:{row:l.row,col:l.col}};
-this.deleteSelection(j);this.endEdit();return}}this.editor.cursorManager.moveCursor({col:Math.max(0,j.pos.col-1)});
-j.pos.col-=1;this.deleteCharacter(j)}else{j.joinDirection="up";this.joinLine(j)}}this.endEdit()
-},deleteKey:function(j){if(this.editor.readonly){return}this.beginEdit("deleteKey");
-if(this.editor.selection){this.deleteSelection(j)}else{if(j.pos.col<this.editor.editorView.getRowScreenLength(j.pos.row)){var k=b.get("settings");
-if(k&&k.isSettingOn("smartmove")){var i=this.editor.getTabSize();var h=this.editor.cursorManager.getContinuousSpaceCount(j.pos.col,this.editor.cursorManager.getNextTablevelRight(j.pos.col));
-if(h==i){var l=j.pos;this.editor.selection={startPos:{row:l.row,col:l.col},endPos:{row:l.row,col:l.col+i}};
-this.deleteSelection(j);this.endEdit();return}}this.deleteCharacter(j)}else{j.joinDirection="down";
-this.joinLine(j)}}this.endEdit()},deleteCharacter:function(j){if(this.editor.readonly){return
-}if(j.pos.col<this.editor.editorView.getRowScreenLength(j.pos.row)){this.beginEdit("deleteCharacter");
-var i=this.editor.cursorManager.getModelPosition(j.pos);var k=1;var h=this.editor.model.deleteCharacters(i,k);
-this.repaint();this.endEdit()}},newline:function(h){if(this.editor.readonly){return
-}var i=b.get("settings");var j;if(i&&i.isSettingOn("autoindent")){j=b.util.leadingWhitespace(this.editor.model.getRowArray(h.pos.row))
-}else{j=[]}h.chunk="\n"+j.join("");this.insertChunk(h)},newlineBelow:function(h){this.newline(this.moveToLineEnd(h))
-},insertCharacter:function(h){if(this.editor.readonly){return}this.beginEdit("insertCharacter");
-var j=h.pos;if(this.editor.selection){j=this.deleteSelection(h)}this.editor.model.insertCharacters(this.editor.cursorManager.getModelPosition(j),h.newchar);
-this.editor.cursorManager.moveRight(true);var i=b.get("settings");if(i&&i.isSettingOn("closepairs")){switch(h.newchar){case"(":this.editor.model.insertCharacters(this.editor.cursorManager.getModelPosition(),")");
-break;case"[":this.editor.model.insertCharacters(this.editor.cursorManager.getModelPosition(),"]");
-break;case"{":this.editor.model.insertCharacters(this.editor.cursorManager.getModelPosition(),"}");
-break;case"<":break;case'"':break;case"'":break}}this.repaint();this.endEdit()},moveCursorRowToCenter:function(h){var j=this.editor.getCursorPos().row;
-var i=Math.floor(this.editor.ui.visibleRows/2);if(j>(this.editor.ui.firstVisibleRow+i)){this.editor.cursorManager.moveCursor({row:this.editor.getCursorPos().row+i})
-}else{this.editor.cursorManager.moveCursor({row:this.editor.getCursorPos().row-i})
-}this.editor.editorView.ensureCursorVisible();this.editor.cursorManager.moveCursor({row:j})
-},getOppositeCase:function(h){if(!h){return undefined}switch(h){case"u":return"l";
-case"l":return"u"}},selectionChangeCase:function(j){if(this.editor.readonly){return
-}if(this.editor.selection){this.beginEdit("selectionChangeCase");if(!j.selectionObject){j.selectionObject=this.editor.getSelection()
-}var l=this.editor.model.getChunk(j.selectionObject);var h=l.split("\n");for(var k in h){switch(j.stringCase){case"l":h[k]=h[k].toLowerCase();
-break;case"u":h[k]=h[k].toUpperCase();break}}var m=h.join("\n");this.editor.model.deleteChunk(j.selectionObject);
-this.editor.model.insertChunk(j.selectionObject.startModelPos,m);this.select(j.selectionObject);
-this.endEdit()}},startSearch:function(m,h,i){if(m==""){this.editor.ui.setSearchString(false);
-this.editor.paint(true);document.getElementById("searchresult").style.display="none";
-return false}if(m==this.editor.ui.searchString&&h=="toolbar"){if(!i){this.findNext()
-}else{this.findPrev()}document.getElementById("searchresult").style.display="block";
-return}this.editor.ui.setSearchString(m);var j=this.editor.model.getCountOfString(m);
-if(j!=0){var n=f.copyPos(this.editor.cursorManager.getCursorPosition());if(!this.editor.ui.actions.findNext(null,true)){this.editor.cursorManager.moveCursor({col:0,row:0});
-this.editor.ui.actions.findNext()}}var l;switch(h){case"commandLine":l="Found "+j+" match";
-if(j>1){l+="es"}l+=" for your search for <em>"+m+"</em>";b.get("commandLine").showHint(l);
-break;case"searchwindow":var k=b.get("filesearch");if(k){k.setMatchesCount(j)}break;
-case"toolbar":l=+j+" Match";if(j>1){l+="es"}document.getElementById("searchfeedback").innerHTML=l;
-document.getElementById("searchresult").style.display="block";break}this.editor.paint(true)
-},findNext:function(h,k){if(!this.editor.ui.searchString){return}var l=f.copyPos(this.editor.cursorManager.getModelPosition());
-var j=this.editor.getSelection();if(k&&j!==undefined){l.col-=j.endModelPos.col-j.startModelPos.col+1
-}var i=this.editor.model.findNext(l.row,l.col,this.editor.ui.searchString);if(!i){i=this.editor.model.findNext(0,0,this.editor.ui.searchString)
-}if(i){this.editor.setSelection({startPos:this.editor.cursorManager.getCursorPosition(i.startPos),endPos:this.editor.cursorManager.getCursorPosition(i.endPos)});
-this.editor.cursorManager.moveCursor(this.editor.cursorManager.getCursorPosition(i.endPos));
-this.editor.editorView.ensureCursorVisible(true);this.repaint();return true}else{return false
-}},findPrev:function(){if(!this.editor.ui.searchString){return}var j=this.editor.cursorManager.getModelPosition();
-var i=this.editor.model.findPrev(j.row,j.col,this.editor.ui.searchString);if(!i){var h=this.editor.model.getRowCount()-1;
-i=this.editor.model.findPrev(h,this.editor.model.getRowArray(h).length-1,this.editor.ui.searchString)
-}if(i){this.editor.setSelection({startPos:this.editor.cursorManager.getCursorPosition(i.startPos),endPos:this.editor.cursorManager.getCursorPosition(i.endPos)});
-this.editor.cursorManager.moveCursor(this.editor.cursorManager.getCursorPosition(i.endPos));
-this.editor.editorView.ensureCursorVisible(true);this.repaint();return true}else{return false
-}},escape:function(){b.publish("ui:escape");if(this.editor.ui.searchString){this.editor.ui.setSearchString(false)
-}},toggleQuickopen:function(){var h=b.get("quickopen");if(h){h.toggle()}},togglePieMenu:function(){b.getComponent("piemenu",function(h){h.toggle()
-})},focusCommandline:function(){b.getComponent("popup",function(h){h.show("output","Command Line")
-})},focusFileBrowser:function(){b.getComponent("popup",function(h){h.show("files","File Explorer")
-})},repaint:function(){if(!this.ignoreRepaints){this.editor.editorView.ensureCursorVisible();
-this.editor.paint()}},replace:function(h){this.beginEdit("replace");this.editor.model.replace(h.search,h.replace);
-this.repaint();this.endEdit()},gotoLine:function(){b.getComponent("commandLine",function(h){h.setCommandText("goto ");
-b.getComponent("popup",function(i){i.show("output")})})},cmdFilesearch:function(){b.getComponent("commandLine",function(h){h.setCommandText("search ");
-b.getComponent("popup",function(i){i.show("output")})})},previousFile:function(){b.get("editSession").goToPreviousFile()
-},nextFile:function(){b.get("editSession").goToNextFile()}});a.ActionHistoryItem=g.Object.extend({begin:function(i,h){this.startIndex=this.editor.historyManager.getCurrent();
-if(i){this.editorBefore=i}else{this.editorBefore=this.editor.getState()}if(h){this.modelBefore=h
-}else{this.modelBefore=this.editor.model.getState()}},end:function(i,h){this.editor.historyManager.truncate(this.startIndex);
-if(i){this.editorAfter=i}else{this.editorAfter=this.editor.getState()}if(h){this.modelAfter=h
-}else{this.modelAfter=this.editor.model.getState()}},undo:function(){this.editor.model.applyState(this.modelBefore);
-this.editor.setState(this.editorBefore);this.editor.editorView.ensureCursorVisible();
-this.editor.paint()},redo:function(){this.editor.model.applyState(this.modelAfter);
-this.editor.setState(this.editorAfter);this.editor.editorView.ensureCursorVisible();
-this.editor.paint()}})});tiki.module("bespin:boot",function(b,a,c){var e=b("sproutcore/runtime:package").SC;
-var d=tiki.require("bespin:embed");e.ready(function(){var f=document.querySelectorAll(".bespin");
-for(var j=0;j<f.length;j++){var k=f[j];var h=k.getAttribute("data-bespinoptions");
-var g=d.useBespin(k,JSON.parse(h));k.bespin=g}if(window.onBespinLoad){window.onBespinLoad()
-}});window.onload=e.didLoad});tiki.module("bespin:builtins",function(b,a,c){a.metadata={"Base Syntax":{provides:[{ep:"entrypoint",name:"syntax.engine",description:"Syntax highlighting engines"},{ep:"syntax.engine",name:"simple",pointer:"bespin/syntax/simple:Model"},{ep:"entrypoint",name:"syntax.simple.highlighter",description:"Highlighter code for the simple syntax highlighter."},{ep:"syntax.simple.highlighter",name:"JavaScript",extensions:["js","json","javascript","ecmascript","jsm","java"],pointer:"bespin/syntax/simple/javascript:JavaScript"},{ep:"syntax.simple.highlighter",name:"C",extensions:["c","h"],pointer:"bespin/syntax/simple/c:C"},{ep:"syntax.simple.highlighter",name:"CSharp",extensions:["cs"],pointer:"bespin/syntax/simple/csharp:CSharp"},{ep:"syntax.simple.highlighter",name:"CSS",extensions:["css"],pointer:"bespin/syntax/simple/css:CSS"},{ep:"syntax.simple.highlighter",name:"HTML",extensions:["html","htm","xml","xhtml","shtml"],pointer:"bespin/syntax/simple/html:HTML"},{ep:"syntax.simple.highlighter",name:"PHP",extensions:["php","php3","php4","php5"],pointer:"bespin/syntax/simple/php:PHP"},{ep:"syntax.simple.highlighter",name:"Python",extensions:["py","python"],pointer:"bespin/syntax/simple/python:Python"},{ep:"syntax.simple.highlighter",name:"Ruby",extensions:["rb","ruby"],pointer:"bespin/syntax/simple/ruby:Ruby"}]}}
-});tiki.module("bespin:command",function(d,b,e){var c=d("package");var f=d("sproutcore/runtime:package").SC;
-var a=d("util/tokenobject").TokenObject;b.Store=f.Object.extend({commands:{},aliases:{},command:null,parent:null,init:function(){if(this.parent){this.containerCommand=this.command;
-this.command.takes=["*"];this.command.subcommands=this;this.parent.addCommand(this.command)
-}},addCommand:function(g){if(!g){return}g.parent=this;this.commands[g.name]=g;if(g.takes&&Array.isArray(g.takes)){g=this.normalizeTakes(g)
-}if(g.withKey){c.getComponent("editor",function(h){h.bindCommand(g.name,g.withKey)
-})}if(g.aliases){g.aliases.forEach(function(h){this.aliases[h]=g.name},this)}g.getFullCommandName=function(){var h=this.name;
-if(this.parent){h=this.parent.getFullCommandName()+" "+h}return h.trim()};if(!g.findCompletions){g.findCompletions=function(h,i){h.hint=this.completeText;
-i(h)}}},removeCommand:function(g){if(!g){return}delete this.commands[g.name]},getFullCommandName:function(){var g=this.containerCommand?this.containerCommand.name:"";
-if(this.parent){g=this.parent.getFullCommandName()+" "+g}return g.trim()},filterOptionsByPrefix:function(g,h){return g.filter(function(i){return i.substr(0,h.length)===h
-})},findCommand:function(g){var h=g.trim().split(/\s+/);var j=h.shift();var i=this.commands[j]||this.commands[this.aliases[j]];
-if(!i){if(h.length>0){return null}else{return this}}if(i.subcommands){return i.subcommands.findCommand(h.join(" "))
-}else{return i}},findCompletions:function(i,m){if(i.action.length>1){i.error="No matches";
-m(i);return}var k=i.action[0];if(k.length==0&&this.parent==null){m(i);return}var h=[];
-for(var l in this.commands){if(l.indexOf(k)==0){h.push(l)}}for(var g in this.aliases){if(g.indexOf(k)==0){h.push(g)
-}}if(h.length==1){var j=h[0];l=this.commands[j]||this.commands[this.aliases[j]];if(this.commandTakesArgs(l)){j=j+" "
-}i.autofill=i.prefix+j;i.hint=l.preview}else{if(h.length==0){i.error="No matches"
-}else{h.sort(function(o,n){return o.localeCompare(n)});i.options=h}}m(i);return},commandTakesArgs:function(g){return g.takes!=undefined
-},getArgs:function(h,j){if(!j.takes){return undefined}var g;var i=h.join(" ");if(j.takes["*"]){g=new a({input:i});
-g.rawinput=i;g.varargs=g.pieces}else{if(j.takes&&j.takes.order.length<2){g=i}else{g=new a({input:i,options:{params:j.takes.order.join(" ")}});
-g.rawinput=i}}return g},normalizeTakes:function(h){var g=h.takes;h.takes={order:g};
-g.forEach(function(i){h.takes[i]={"short":i[0]}});return h},getHelp:function(n,s){var h=[];
-var k,g;if(this.commands[n]){k=this.commands[n];h.push(k.description?k.description:k.preview)
-}else{var p=false;var q="";if(this.containerCommand){q=" for "+this.containerCommand.name
-}if(n){if(n=="hidden"){n="";p=true}h.push("<h2>Commands starting with '"+n+"':</h2>")
-}else{h.push("<h2>Available Commands:</h2>")}var m=[];for(g in this.commands){m.push(g)
-}var o=m.sort();h.push("<table>");for(var l=0;l<o.length;l++){g=o[l];k=this.commands[g];
-if(!p&&k.hidden){continue}if(n&&g.indexOf(n)!=0){continue}var r=(k.takes)?" ["+k.takes.order.join("] [")+"]":"";
-h.push("<tr>");h.push("<th>"+g+"</th>");h.push("<td>"+k.preview+"</td>");h.push("<td>"+r+"</td>");
-h.push("</tr>")}h.push("</table>")}var j=h.join("");if(s&&s.prefix){j=s.prefix+"<br/>"+j
-}if(s&&s.suffix){j=j+"<br/>"+s.suffix}return j}});b.store=new b.Store();b.executeExtensionCommand=function(){var h=arguments;
-var g=this;this.load(function(i){i.apply(g,h)})};c.subscribe("extension:loaded:bespin.command",function(g){g.execute=b.command.executeExtensionCommand;
-b.store.addCommand(g)});c.subscribe("extension:removed:bespin.command",function(g){b.store.removeCommand(g)
-});b.store.addCommand({name:"help",takes:["search"],preview:"show commands",description:"The <u>help</u> gives you access to the various commands in the Bespin system.<br/><br/>You can narrow the search of a command by adding an optional search params.<br/><br/>If you pass in the magic <em>hidden</em> parameter, you will find subtle hidden commands.<br/><br/>Finally, pass in the full name of a command and you can get the full description, which you just did to see this!",completeText:"optionally, narrow down the search",execute:function(h,g){var i=this.parent.getHelp(g,{prefix:"<h2>Welcome to Bespin - Code in the Cloud</h2><ul><li><a href='http://labs.mozilla.com/projects/bespin' target='_blank'>Home Page</a><li><a href='https://wiki.mozilla.org/Labs/Bespin' target='_blank'>Wiki</a><li><a href='https://wiki.mozilla.org/Labs/Bespin/UserGuide' target='_blank'>User Guide</a><li><a href='https://wiki.mozilla.org/Labs/Bespin/Tips' target='_blank'>Tips and Tricks</a><li><a href='https://wiki.mozilla.org/Labs/Bespin/FAQ' target='_blank'>FAQ</a><li><a href='https://wiki.mozilla.org/Labs/Bespin/DeveloperGuide' target='_blank'>Developers Guide</a></ul>",suffix:"For more information, see the <a href='https://wiki.mozilla.org/Labs/Bespin'>Bespin Wiki</a>."});
-h.addOutput(i)}})});tiki.module("bespin:cursor",function(c,a,d){var b=c("package");
-var e=c("sproutcore/runtime:package").SC;a.CursorManager=e.Object.extend({editor:null,init:function(){this.position={row:0,col:0};
-this.virtualCol=0;b.subscribe("settings:set:strictlines",function(h){var g=b.get("settings");
-if(g.isValueOn(h.value)){var f=a.copyPos(this.position);this.checkPastEndOfLine(f)
-}}.bind(this));arguments.callee.base.apply(this,arguments)},getCursorPosition:function(g){if(g==undefined){return this.position
-}var m=a.copyPos(g);var h=[];if(this.editor.model.hasRow(m.row)){h=this.editor.model.getRowArray(m.row)
-}var f=this.editor.getTabSize();if(h.indexOf("\t")!=-1){var k=0,l=0;for(var j=0;j<g.col;
-j++){if(h[j]=="\t"){m.col+=f-1-(l%f);k++;l=0}else{l++;k=0}}}return m},getModelPosition:function(m){m=(m!=undefined)?m:this.position;
-var g=a.copyPos(m);var k=[];if(this.editor.model.hasRow(m.row)){k=this.editor.model.getRowArray(m.row)
-}var f=this.editor.getTabSize();if(k.indexOf("\t")!=-1){var j=0;for(var l=0;l<g.col;
-l++){var h=j;if(k[l]=="\t"){h=Math.floor((j+f)/f)*f}else{h+=1}if(h>g.col){break}j=h
-}g.col=l}return g},getCharacterLength:function(h,g){if(h.length>1){return}if(g==undefined){g=this.position.col
-}if(h=="\t"){var f=this.editor.getTabSize();return f-(g%f)}else{return 1}},getStringLength:function(h){if(!h||h.length==0){return 0
-}var g=0;h=h.split("");for(var f=0;f<h.length;f++){g+=this.getCharacterLength(h[f],g)
-}return g},getLeadingWhitespace:function(h){var g=this.editor.model.getRowArray(h).join("");
-var f=/^(\s+).*/.exec(g);return(f&&f.length==2?this.getStringLength(f[1]):0)},getContinuousSpaceCount:function(k,l,i){i=i||this.position.row;
-var g=b.get("settings");var n=this.editor.model.getRowArray(i);var m=(k<l?1:-1);var f=n.length;
-k=k+(m==1?0:-1);l=l+(m==1?0:-1);k=this.getModelPosition({col:k,row:i}).col;l=this.getModelPosition({col:l,row:i}).col;
-if(g&&g.isSettingOn("strictlines")){k=Math.min(k,f);l=Math.min(l,f)}var h=0;for(var j=k;
-j!=l;j+=m){if(j<f){if(n[j]!=" "){break}}h++}return h},getNextTablevelLeft:function(g){var f=this.editor.getTabSize();
-g=g||this.position.col;g--;return Math.floor(g/f)*f},getNextTablevelRight:function(g){var f=this.editor.getTabSize();
-g=g||this.position.col;g++;return Math.ceil(g/f)*f},moveToLineStart:function(){var g=a.copyPos(this.position);
-var f=this.getLeadingWhitespace(g.row);if(this.position.col==0){this.moveCursor({col:f})
-}else{if(this.position.col==f){this.moveCursor({col:0})}else{if(f!=this.editor.editorView.getRowScreenLength(this.editor.cursorManager.getCursorPosition().row)){this.moveCursor({col:f})
-}else{this.moveCursor({col:0})}}}return{oldPos:g,newPos:a.copyPos(this.position)}
-},moveToLineEnd:function(){var f=a.copyPos(this.position);this.moveCursor({col:this.editor.editorView.getRowScreenLength(f.row)});
-return{oldPos:f,newPos:a.copyPos(this.position)}},moveToTop:function(){var f=a.copyPos(this.position);
-this.editor.cursorManager.moveCursor({row:0,col:0});return{oldPos:f,newPos:a.copyPos(this.position)}
-},moveToBottom:function(){var f=a.copyPos(this.position);var g=this.editor.model.getRowCount()-1;
-this.editor.cursorManager.moveCursor({row:g,col:this.editor.editorView.getRowScreenLength(g)});
-return{oldPos:f,newPos:a.copyPos(this.position)}},moveUp:function(){var f=a.copyPos(this.position);
-this.moveCursor({row:f.row-1,col:Math.max(f.col,this.virtualCol)});this.checkPastEndOfLine(f);
-return{oldPos:f,newPos:a.copyPos(this.position)}},moveDown:function(){var f=a.copyPos(this.position);
-this.moveCursor({row:Math.max(0,f.row+1),col:Math.max(f.col,this.virtualCol)});this.checkPastEndOfLine(f);
-return{oldPos:f,newPos:a.copyPos(this.position)}},moveLeft:function(h){var j=b.get("settings");
-var g=a.copyPos(this.position);var i=(h.event?h.event.shiftKey:false);if(!this.editor.getSelection()||i){if(j&&j.isSettingOn("smartmove")){var f=this.getContinuousSpaceCount(g.col,this.getNextTablevelLeft());
-if(f==this.editor.getTabSize()){this.moveCursor({col:g.col-f});return{oldPos:g,newPos:a.copyPos(this.position)}
-}}if((j&&j.isSettingOn("strictlines"))&&(this.position.col==0)){this.moveUp();if(g.row>0){this.moveToLineEnd()
-}}else{this.moveCursor({row:g.row,col:Math.max(0,g.col-1)})}}else{this.moveCursor(this.editor.getSelection().startPos)
-}return{oldPos:g,newPos:a.copyPos(this.position)}},moveRight:function(h){var j=b.get("settings");
-var g=a.copyPos(this.position);var i=(h.event?h.event.shiftKey:false);if(!this.editor.getSelection()||i){if((j&&j.isSettingOn("smartmove"))&&h!=true){var f=this.getContinuousSpaceCount(g.col,this.getNextTablevelRight());
-if(f==this.editor.getTabSize()){this.moveCursor({col:g.col+f});return{oldPos:g,newPos:a.copyPos(this.position)}
-}}if((j&&j.isSettingOn("strictlines"))&&(this.position.col>=this.editor.editorView.getRowScreenLength(this.position.row))){this.moveDown();
-if(g.row<this.editor.model.getRowCount()-1){this.moveCursor({col:0})}}else{this.moveCursor({col:this.position.col+1})
-}}else{this.moveCursor(this.editor.getSelection().endPos)}return{oldPos:g,newPos:a.copyPos(this.position)}
-},movePageUp:function(){var f=a.copyPos(this.position);this.moveCursor({row:Math.max(this.editor.editorView.firstVisibleRow-this.editor.editorView.visibleRows,0)});
-this.checkPastEndOfLine(f);return{oldPos:f,newPos:a.copyPos(this.position)}},movePageDown:function(){var f=a.copyPos(this.position);
-this.moveCursor({row:Math.min(this.position.row+this.editor.editorView.visibleRows,this.editor.model.getRowCount()-1)});
-this.checkPastEndOfLine(f);return{oldPos:f,newPos:a.copyPos(this.position)}},checkPastEndOfLine:function(g){var i=b.get("settings");
-var f=i?i.isSettingOn("strictlines"):false;var h=this.editor.editorView.getRowScreenLength(this.position.row);
-if(f&&this.position.col>h){this.moveToLineEnd();this.virtualCol=Math.max(g.col,this.virtualCol)
-}},smartMoveLeft:function(){var h=a.copyPos(this.position);var i=this.editor.editorView.getRowString(h.row);
-var k,g;if(this.position.col==0){this.moveUp();this.moveToLineEnd()}else{if(i.length<this.position.col){this.moveToLineEnd()
-}var f=this.position.col;var j=false;while(f>0){f--;k=i.charAt(f);g=k.charCodeAt(0);
-if(g==32){j=true}else{f++;break}}if(!j){while(f>0){f--;k=i.charAt(f);g=k.charCodeAt(0);
-if((g<65)||(g>122)){if(f!=this.position.col-1){f++}break}}}this.moveCursor({col:f})
-}return{oldPos:h,newPos:a.copyPos(this.position)}},smartMoveRight:function(){var h=a.copyPos(this.position);
-var i=this.editor.editorView.getRowString(h.row);if(i.length<=this.position.col){this.moveDown();
-this.moveToLineStart()}else{var k,g;var f=this.position.col;var j=false;while(f<i.length){k=i[f];
-g=k.charCodeAt(0);if(g==32){j=true;f++}else{break}}if(!j){while(f<i.length){f++;if(i.length==f){this.moveToLineEnd();
-f=-1;break}k=i[f];g=k.charCodeAt(0);if((g<65)||(g>122)){break}}}if(f!=-1){this.moveCursor({col:f})
-}}return{oldPos:h,newPos:a.copyPos(this.position)}},moveCursor:function(i){if(!i){return
-}if(i.col===undefined){i.col=this.position.col}if(i.row===undefined){i.row=this.position.row
-}this.virtualCol=0;var h=this.position;var j=Math.min(i.row,this.editor.model.getRowCount()-1);
-if(j<0){j=0}var g=this.isInvalidCursorPosition(j,i.col);if(g){if(h.row!=i.row){i.col=g.right
-}else{if(h.col<i.col){i.col=g.right}else{if(h.col>i.col){i.col=g.left}else{i.col=g.right
-}}}}this.position={row:j,col:i.col};var f=b.get("editor").editorView;f.showCursor=true;
-f.toggleCursorAllowed=false;f.cursorDidMove(this,this.position)},isInvalidCursorPosition:function(l,g){var j=this.editor.model.getRowArray(l);
-var k=0;for(var h=0;h<j.length;h++){if(j[h].charCodeAt(0)==9){var f=this.editor.getTabSize()-(k%this.editor.getTabSize());
-if((g>k)&&(g<(k+f))){return{left:k,right:k+f,half:f/2}}k+=f-1}k++}return undefined
-}});a.buildArgs=function(f){return{pos:a.copyPos(f||b.get("editor").getCursorPos())}
-};a.changePos=function(f,g){return{pos:a.copyPos(g||b.get("editor").getCursorPos())}
-};a.copyPos=function(f){return{row:f.row,col:f.col}};a.posEquals=function(g,f){if(g==f){return true
-}if(!g||!f){return false}return(g.col==f.col)&&(g.row==f.row)}});tiki.module("bespin:editor",function(g,r,b){var o=g("sproutcore/runtime:package").SC;
-var m=g("bespin:package");var a=g("util/util");var k=g("util/keys");var c=g("util/canvas");
-var q=g("util/cookie");var l=g("util/mousewheelevent");var f=g("util/clipboard");
-var p=g("settings");var i=g("events");var n=g("syntax");var e=g("cursor");var h=g("actions");
-var d=g("model");var j=g("history")});tiki.module("bespin:editor/controller",function(h,s,c){var o=h("sproutcore/runtime:package").SC;
-var n=h("package");var a=h("util/util");var d=h("util/canvas");var q=h("util/cookie");
-var m=h("util/keys");var p=h("settings");var i=h("events");var f=h("cursor");var e=h("model");
-var l=h("history");var k=h("editor/views/editor");var b=h("editor/views/scroll");
-s.EditorController=o.Object.extend({containerBinding:".editorView.layer",requires:{settings:"settings",commandLine:"commandLine",session:"session",file:"file"},init:function(){this.debugMode=false;
-this.model=e.DocumentModel.create({editor:this});this.cursorManager=f.CursorManager.create({editor:this});
-this.ui=b.BespinScrollView.create({contentView:k.EditorView.extend({editor:this,content:this.model})});
-this.editorView=this.ui.contentView;console.log(this.ui);this.theme=h("theme")["default"];
-this.editorKeyListener=s.DefaultEditorKeyListener.create({editor:this});this.historyManager=l.HistoryManager.create({editor:this});
-i.subscribe();this.editorView.installKeyListener(this.editorKeyListener);var u={value:1};
-console.log(u.value==1);u.value=2;console.log(u.value==2);u.value++;console.log(u.value==3);
-var t={_value:1};t.__defineGetter__("value",function(){return this._value});t.__defineSetter__("value",function(v){this._value=v
-});console.log(t.value==1);t.value=2;console.log(t.value==2);t.value++;console.log(t.value==3);
-arguments.callee.base.apply(this,arguments)},getContent:function(){return this.model.getDocument()
-},setContent:function(t){return this.model.insertDocument(t)},setLineNumber:function(t){this.moveAndCenter(t)
-},setSetting:function(t,u){this.settings.setValue(t,u)},onchange:function(t){n.subscribe("editor:document:changed",t)
-},executeCommand:function(u){try{this.commandLine.executeCommand(u)}catch(t){}},getSelection:function(v){v=(v!=undefined)?v:this.selection;
-if(!v){return undefined}var u=v.startPos;var t=v.endPos;if((t.row<u.row)||((t.row==u.row)&&(t.col<u.col))){var w=u;
-u=t;t=w}return{startPos:f.copyPos(u),endPos:f.copyPos(t),startModelPos:this.getModelPos(u),endModelPos:this.getModelPos(t)}
-},getCursorPos:function(t){return this.cursorManager.getCursorPosition(t)},getModelPos:function(t){return this.cursorManager.getModelPosition(t)
-},computeLayout:function(){var u={left:0,top:0,width:this.container.clientWidth,height:this.container.clientHeight};
-var t=this.container;while(t!==null){if(!isNaN(t.offsetLeft)){u.left+=t.offsetLeft
-}if(!isNaN(t.offsetTop)){u.top+=t.offsetTop}t=t.parentNode}return u},moveCursor:function(t){this.cursorManager.moveCursor(t)
-},resetView:function(t){this.cursorManager.moveCursor(t.cursor);this.setSelection(t.selection);
-this.ui.horizontalScrollOffset=0;this.ui.verticalScrollOffset=0},basicView:function(){this.cursorManager.moveCursor({row:0,col:0});
-this.setSelection(undefined);this.ui.horizontalScrollOffset=0;this.ui.verticalScrollOffset=0
-},getCurrentView:function(){return{cursor:this.getCursorPos(),offset:{x:this.horizontalScrollOffset,y:this.verticalScrollOffset},selection:this.selection}
-},getState:function(){return{cursor:this.getCursorPos(),selection:this.getSelection()}
-},setState:function(t){this.cursorManager.moveCursor(t.cursor);this.setSelection(t.selection);
-this.editorView.ensureCursorVisible();this.paint(false)},defaultTabSize:4,getTabSize:function(){var u=this.defaultTabSize;
-var t=parseInt(this.settings.getValue("tabsize"),10);if(t>0){u=t}return u},getSelectionAsText:function(){var u="";
-var t=this.getSelection();if(t){u=this.model.getChunk(t)}return u},setSelection:function(t){this.selection=t
-},paint:function(v){var u=this.editorView.get("canvas");if(!u){return}var t=d.fix(u.getContext("2d"));
-this.editorView.paint(t,v)},changeKeyListener:function(t){this.editorView.installKeyListener(t);
-this.editorKeyListener=t},setFocus:function(t){this.editorView.setFocus(t)},setReadOnly:function(t){this.readonly=t
-},dispose:function(){this.ui.dispose()},bindKey:function(x,w,u){console.warn("Use of editor.bindKey(",x,w,u,") seems doomed to fail");
-var A=m.fillArguments(w);var v=A.key;var t=A.modifiers;if(!v){return}var y=m.toKeyCode(v);
-var z="Execute command: '"+x+"'";x=this.editorView.actions[x]||function(){n.commandLine.executeCommand(command,true)
-};if(y&&x){if(u){this.editorKeyListener.bindKeyStringSelectable(t,y,x,z)}else{this.editorKeyListener.bindKeyString(t,y,x,z)
-}}},bindCommand:function(x,t){var y=m.fillArguments(t);var v=m.toKeyCode(y.key);var u=function(){this.commandLine.executeCommand(x,true)
-};var w="Execute command: '"+x+"'";this.editorKeyListener.bindKeyString(y.modifiers,v,u,w)
-},moveAndCenter:function(u){if(!u){return}var t=u-1;this.cursorManager.moveCursor({row:t,col:0});
-if((t<this.editorView.firstVisibleRow)||(t>=this.editorView.firstVisibleRow+this.editorView.visibleRows)){this.editorView.actions.moveCursorRowToCenter()
-}},newFile:function(x,v,u){x=x||this.session.project;v=v||"new.txt";var t=this;var w=function(){if(this.settings.isSettingOff("collaborate")){t.model.insertDocument(u||"");
-t.cursorManager.moveCursor({row:0,col:0});t.setFocus(true)}n.publish("editor:openfile:opensuccess",{project:x,file:{name:v,content:u||"",timestamp:new Date().getTime()}});
-n.publish("editor:dirty")};this.file.newFile(x,v,w)},saveFile:function(A,t,z,w){A=A||this.session.project;
-t=t||this.session.path;var u="viewData_"+A+"_"+t.split("/").join("_");var B=JSON.stringify(this.getCurrentView());
-q.set(u,B,{expires:7});var x={name:t,content:this.model.getDocument(),timestamp:new Date().getTime()};
-var y=function(){document.title=t+" - editing with Bespin";this.commandLine.showHint("Saved file: "+x.name);
-n.publish("editor:clean");if(a.isFunction(z)){z()}};var v=function(C){this.commandLine.showHint("Save failed: "+C.responseText);
-if(a.isFunction(w)){w()}};n.publish("editor:savefile:before",{filename:t});this.file.saveFile(A,x,y,v)
-},openFile:function(z,u,v){var w,y;var t=this;z=z||this.session.project;u=u||this.session.path;
-v=v||{};var x=v.fromFileHistory||false;if(this.session.checkSameFile(z,u)&&!v.reload){if(v.line){this.commandLine.executeCommand("goto "+v.line,true)
-}return}if(this.dirty&&!this.session.shouldCollaborate()){w=function(A){this.commandLine.showHint("Trying to save current file. Failed: "+A.responseText)
-};y=function(){t.openFile(z,u,v)};this.saveFile(null,null,y,w);return}if(v.force){this.file.whenFileDoesNotExist(z,u,{execute:function(){t.newFile(z,u,v.content||"")
-},elseFailed:function(){v.force=false;t.openFile(z,u,v)}});return}w=function(){n.publish("editor:openfile:openfail",{project:z,filename:u})
-};y=function(A){if(!A){w();return}if(A.content!==undefined){t.model.insertDocument(A.content);
-t.cursorManager.moveCursor({row:0,col:0});t.setFocus(true)}this.session.setProjectPath(z,u);
-if(v.line){this.commandLine.executeCommand("goto "+v.line,true)}t._addHistoryItem(z,u,x);
-n.publish("editor:openfile:opensuccess",{project:z,file:A})};n.publish("editor:openfile:openbefore",{project:z,filename:u});
-this.file.editFile(z,u,y,w)},_addHistoryItem:function(y,t,x){var w=this.settings.getObject("_lastused");
-if(!w){w=[]}var u={project:y,filename:t};if(!x){this.session.addFileToHistory(u)}var v=[];
-w.forEach(function(z){if(z.project!=u.project||z.filename!=u.filename){v.unshift(z)
-}});v.unshift(u);w=v;if(w.length>10){w=w.slice(0,10)}this.settings.setObject("_lastused",w)
-}});s.DefaultEditorKeyListener=o.Object.extend({editor:null,skipKeypress:false,defaultKeyMap:{},keyMapDescriptions:{},init:function(){this.keyMap=this.defaultKeyMap
-},bindKey:function(x,z,y,w,u,v,t){this.defaultKeyMap[[x,z,y,w,u]]=(typeof v=="string")?function(){var A=A(v);
-n.publish(A.name,A.args)}:v.bind(this.editor.editorView.actions);if(t){this.keyMapDescriptions[[x,z,y,w,u]]=t
-}},bindKeyForPlatform:function(v,A,y,u){var t=a.getOS();var x=v[t]||v.WINDOWS;if(!x){return
-}var w=m.fillArguments(x);var z=(u)?"bindKeyStringSelectable":"bindKeyString";this[z](w.modifiers,m.toKeyCode(w.key),A,y)
-},bindKeyString:function(u,y,x,t){var A=(u.toUpperCase().indexOf("CTRL")!=-1);var w=(u.toUpperCase().indexOf("ALT")!=-1);
-var z=(u.toUpperCase().indexOf("META")!=-1)||(u.toUpperCase().indexOf("APPLE")!=-1);
-var v=(u.toUpperCase().indexOf("SHIFT")!=-1);if(u.toUpperCase().indexOf("CMD")!=-1){if(a.isMac){z=true
-}else{A=true}}return this.bindKey(y,z,A,w,v,x,t)},bindKeyStringSelectable:function(u,w,v,t){this.bindKeyString(u,w,v,t);
-this.bindKeyString("SHIFT "+u,w,v)},getPrintableChar:function(t){if(t.charCode>255){return false
-}if(t.charCode<32){return false}if((t.altKey||t.metaKey||t.ctrlKey)&&(t.charCode>65&&t.charCode<123)){return false
-}return String.fromCharCode(t.charCode)},onkeydown:function(x){if(!this.editor.editorView.hasFocus()){console.log("ignoring keyboard event, we don't have focus",x);
-return}var u={event:x,pos:f.copyPos(this.editor.cursorManager.getCursorPosition())};
-this.skipKeypress=false;this.returnValue=false;var w=this.keyMap[[x.keyCode,x.metaKey,x.ctrlKey,x.altKey,x.shiftKey]];
-var t=false;if(a.isFunction(w)){t=true;try{w(u)}catch(v){console.log("Action caused an error! ",v)
-}this.lastAction=w}if(x.metaKey||x.ctrlKey||x.altKey){this.skipKeypress=true;this.returnValue=true
-}if(t||!m.passThroughToBrowser(x)){a.stopEvent(x)}},onkeypress:function(w){if(!this.editor.editorView.hasFocus()){console.log("ignoring keyboard event, we don't have focus",w);
-return}if((w.metaKey||w.ctrlKey)&&w.charCode>=48&&w.charCode<=57){return}var t=this.getPrintableChar(w);
-if(t){this.skipKeypress=false}else{if(this.skipKeypress){if(!m.passThroughToBrowser(w)){a.stopEvent(w)
-}return this.returnValue}}var u={event:w,pos:f.copyPos(this.editor.cursorManager.getCursorPosition())};
-var x=this.editor.editorView.actions;if(t){u.newchar=String.fromCharCode(w.charCode);
-x.insertCharacter(u)}else{var v=this.keyMap[[w.keyCode,w.metaKey,w.ctrlKey,w.altKey,w.shiftKey]];
-if(this.lastAction==v){delete this.lastAction}else{if(typeof v=="function"){v(u)}}}a.stopEvent(w)
-}});var r=function(t){var v={};if(t.indexOf(";")<0){v.name=t}else{var u=t.split(";");
-v.name=u[0];v.args=a.queryToObject(u[1],",")}return v};n.subscribe("settings:set:trimonsave",function(u){var t=n.get("settings");
-if(t.isValueOn(u.value)){j=n.subscribe("editor:savefile:before",function(v){n.get("commandLine").executeCommand("trim",true)
-})}else{n.unsubscribe(j)}});var j;n.subscribe("editor:openfile:opensuccess",function(u){var z=n.get("editSession");
-var A=u.project||z.project;var t=u.file.name;try{var v="viewData_"+A+"_"+t.split("/").join("_");
-var w=q.get(v);if(w){n.get("editor").resetView(JSON.parse(w))}else{n.get("editor").basicView()
-}}catch(y){console.log("Error setting in the view: ",y)}document.title=t+" - editing with Bespin";
-n.publish("url:change",{project:A,path:t});if(u.file.name==null){console.error("event.file.name falsy")
-}if(u.project){z.project=u.project}z.path=u.file.name;var B=a.path.fileType(u.file.name);
-if(B){n.publish("settings:language",{language:B})}var x=A+"/"+t;if(g[x]){n.publish("settings:language",{language:g[x]})
-}});var g={"BespinSettings/config":"js"};n.subscribe("settings:set:keybindings",function(u){var t=n.get("editor");
-if(u.value=="emacs"){t.bindKey("moveCursorLeft","ctrl b");t.bindKey("moveCursorRight","ctrl f");
-t.bindKey("moveCursorUp","ctrl p");t.bindKey("moveCursorDown","ctrl n");t.bindKey("moveToLineStart","ctrl a");
-t.bindKey("moveToLineEnd","ctrl e")}})});tiki.module("bespin:editor/views/editor",function(require,exports,module){var SC=require("sproutcore/runtime:package").SC;
-var bespin=require("package");var syntax=require("syntax");var actions=require("actions");
-var keys=require("util/keys");var clipboard=require("util/clipboard");var cursor=require("cursor");
-var scroller=require("editor/views/scroller");var SelectionHelper=SC.Object.extend({editor:null,getRowSelectionPositions:function(rowIndex){var startCol;
-var endCol;var selection=this.editor.getSelection();if(!selection){return undefined
-}if((selection.endPos.row<rowIndex)||(selection.startPos.row>rowIndex)){return undefined
-}startCol=(selection.startPos.row<rowIndex)?0:selection.startPos.col;endCol=(selection.endPos.row>rowIndex)?-1:selection.endPos.col;
-return{startCol:startCol,endCol:endCol}}});exports.EditorView=SC.View.extend({classNames:"sc-canvas-view",displayProperties:["value","shouldAutoResize"],tagName:"canvas",rowLengthCache:[],searchString:null,toggleCursorFullRepaintCounter:0,toggleCursorFrequency:250,toggleCursorAllowed:true,horizontalScrollCanvas:null,verticalScrollCanvas:null,LINE_HEIGHT:23,BOTTOM_SCROLL_AFFORDANCE:30,GUTTER_INSETS:{top:0,left:6,right:10,bottom:6},LINE_INSETS:{top:0,left:5,right:0,bottom:6},FALLBACK_CHARACTER_WIDTH:10,DEBUG_GUTTER_WIDTH:18,DEBUG_GUTTER_INSETS:{top:2,left:2,right:2,bottom:2},showCursor:true,hasFocus:false,onInitActions:[],inited:false,lastLineCount:0,lastCursorPos:null,padding:{bottom:0,right:0},hasPadding:true,init:function(){var settings=bespin.get("settings");
-var pluginCatalog=bespin.get("plugins");var ep=pluginCatalog.getExtensionPoint("syntax.engine");
-this.syntaxModel=syntax.Model.create();if(ep.extensions.length>0){ep.extensions[0].load(function(model){this.syntaxModel=model.create()
-}.bind(this))}this.selectionHelper=SelectionHelper.create({editor:this.editor});this.actions=actions.Actions.create({editor:this.editor});
-var wheelEventName=(window.onmousewheel?"onmousewheel":"DOMMouseScroll");setTimeout(function(){this.toggleCursor()
-}.bind(this),this.toggleCursorFrequency);arguments.callee.base.apply(this,arguments)
-},render:function(context,firstTime){context.attr("moz-opaque","true");context.attr("tabindex","1");
-context.push("canvas tag not supported by your browser")},didCreateLayer:function(){var canvas=this.$()[0];
-this.set("canvas",canvas);SC.Event.add(canvas,"blur",this,function(ev){this.focus=true;
-return true});SC.Event.add(canvas,"focus",this,function(ev){this.focus=true;return true
-});var editorWrapper=EditorWrapper.create({editor:this.editor,ui:this});clipboard.setup(editorWrapper);
-this.onInitActions.forEach(function(action){action()});this.inited=true},onInit:function(action){if(this.inited){action();
-return}this.onInitActions.push(action)},convertClientPointToCursorPoint:function(pos){var settings=bespin.get("settings");
-var x,y;var content=this.get("content");var charWidth=this.get("charWidth");var lineHeight=this.get("lineHeight");
-if(pos.y<0){y=0}else{if(pos.y>=(lineHeight*content.getRowCount())){y=content.getRowCount()-1
-}else{var ty=pos.y;y=Math.floor(ty/lineHeight)}}if(pos.x<=(this.get("gutterWidth")+this.LINE_INSETS.left)){x=-1
-}else{var tx=pos.x-this.get("gutterWidth")-this.LINE_INSETS.left;x=Math.round(tx/charWidth);
-if((settings&&settings.isSettingOn("strictlines"))){var maxcol=this.getRowScreenLength(y);
-if(x>=maxcol){x=this.getRowScreenLength(y)}}}return{row:y,col:x}},absoluteCoordinatesForEvent:function(ev){return this.convertFrameFromView({x:ev.clientX,y:ev.clientY})
-},setSelection:function(e){var content=this.get("content");var absolutePoint=this.absoluteCoordinatesForEvent(e);
-var clientY=absolutePoint.y,clientX=absolutePoint.x;if(!this.selectMouseDownPos){return
-}var down=cursor.copyPos(this.selectMouseDownPos);var point={x:clientX,y:clientY};
-var up=this.convertClientPointToCursorPoint(point);if(down.col==-1){down.col=0;var lineMarker=bespin.get("parser").getLineMarkers()[down.row+1];
-if(lineMarker){bespin.get("commandLine").showHint(lineMarker.msg)}}if(up.col==-1){up.col=0
-}var modelstart=this.editor.getModelPos(down);var modelend=this.editor.getModelPos(up);
-var backwards=false;if(modelend.row<modelstart.row||(modelend.row==modelstart.row&&modelend.col<modelstart.col)){backwards=true;
-var temp=modelstart;modelstart=modelend;modelend=temp}if(!content.hasRow(modelstart.row)){modelstart.row=content.getRowCount()-1
-}if(!content.hasRow(modelend.row)){modelend.row=content.getRowCount()-1}var detail=this.selectMouseDetail;
-var startPos,endPos;if(detail==1){if(cursor.posEquals(modelstart,modelend)){this.editor.setSelection(undefined)
-}else{this.editor.setSelection({startPos:this.editor.getCursorPos(backwards?modelend:modelstart),endPos:this.editor.getCursorPos(backwards?modelstart:modelend)})
-}this.editor.moveCursor(this.editor.getCursorPos(backwards?modelstart:modelend))}else{if(detail==2){var row=content.rows[modelstart.row];
-var cursorAt=row[modelstart.col];var isDelimiter=function(item){var delimiters=["="," ","\t",">","<",".","(",")","{","}",":",'"',"'",";"];
-if(delimiters.indexOf(item)>-1){return true}return false};var comparator;if(!cursorAt){this.editor.setSelection({startPos:this.editor.getCursorPos({row:modelstart.row,col:0}),endPos:this.editor.getCursorPos({row:modelstart.row,col:row.length})})
-}else{if(isDelimiter(cursorAt.charAt(0))){comparator=function(letter){if(isDelimiter(letter)){return false
-}return true};startPos=content.findBefore(modelstart.row,modelstart.col,comparator);
-endPos=content.findAfter(modelend.row,modelend.col,comparator);this.editor.setSelection({startPos:this.editor.getCursorPos(backwards?endPos:startPos),endPos:this.editor.getCursorPos(backwards?startPos:endPos)});
-this.editor.moveCursor(this.editor.getCursorPos(backwards?startPos:endPos))}else{comparator=function(letter){if(isDelimiter(letter)){return true
-}return false};startPos=content.findBefore(modelstart.row,modelstart.col,comparator);
-endPos=content.findAfter(modelend.row,modelend.col,comparator);this.editor.setSelection({startPos:this.editor.getCursorPos(backwards?endPos:startPos),endPos:this.editor.getCursorPos(backwards?startPos:endPos)});
-this.editor.moveCursor(this.editor.getCursorPos(backwards?startPos:endPos))}}}else{if(detail>2){startPos={row:modelstart.row,col:0};
-endPos={row:modelend.row,col:0};if(this.editor.model.hasRow(endPos.row+1)){endPos.row=endPos.row+1
-}else{endPos.col=this.editor.model.getRowArray(endPos.row).length}startPos=this.editor.getCursorPos(startPos);
-endPos=this.editor.getCursorPos(endPos);this.editor.setSelection({startPos:backwards?endPos:startPos,endPos:backwards?startPos:endPos});
-this.editor.moveCursor(backwards?startPos:endPos)}}}if(clientY<0){}else{if(clientY>=this.getHeight()){}}this.editor.paint()
-},toggleCursor:function(){if(this.toggleCursorAllowed){this.showCursor=!this.showCursor
-}else{this.toggleCursorAllowed=true}if(++this.toggleCursorFullRepaintCounter>0){this.toggleCursorFullRepaintCounter=0;
-this.editor.paint(true)}else{this.editor.paint()}setTimeout(function(){this.toggleCursor()
-}.bind(this),this.toggleCursorFrequency)},ensureCursorVisible:function(softEnsure){},handleFocus:function(e){var content=this.get("content");
-content.clear();content.insertCharacters({row:0,col:0},e.type);return true},mouseDragged:function(e){if(this.selectMouseDownPos){this.setSelection(e)
-}return true},mouseDown:function(e){var absolutePoint=this.absoluteCoordinatesForEvent(e);
-var clientY=absolutePoint.y,clientX=absolutePoint.x;var point;if(this.editor.debugMode){if(clientX<this.DEBUG_GUTTER_WIDTH){console.log("Clicked in debug gutter");
-point={x:clientX,y:clientY};var p=this.convertClientPointToCursorPoint(point);var editSession=bespin.get("editSession");
-if(p&&editSession){bespin.getComponent("breakpoints",function(breakpoints){breakpoints.toggleBreakpoint({project:editSession.project,path:editSession.path,lineNumber:p.row});
-this.editor.paint(true)},this)}return true}}this.selectMouseDetail=e.detail;if(e.shiftKey){this.selectMouseDownPos=(this.editor.selection)?this.editor.selection.startPos:this.editor.getCursorPos();
-this.setSelection(e)}else{point={x:clientX,y:clientY};this.selectMouseDownPos=this.convertClientPointToCursorPoint(point)
-}this.get("canvas").focus();return this.handleMouse(e)},mouseUp:function(e){if(this.selectMouseDownPos){this.setSelection(e);
-this.selectMouseDownPos=undefined;this.selectMouseDetail=undefined;return false}return true
-},click:function(e){e.type="click";return this.handleMouse(e)},handleMouse:function(e){var absolutePoint=this.absoluteCoordinatesForEvent(e);
-var clientY=absolutePoint.y,clientX=absolutePoint.x;var scrolled=false;var w=this.editor.container.clientWidth;
-var h=this.editor.container.clientHeight;var p={x:clientX,y:clientY};return true},setFocus:function(focus){this.onInit(function(){if(this.focus!=focus){var canvas=this.get("canvas");
-if(focus){canvas.focus()}else{canvas.blur()}this.focus=focus}}.bind(this))},hasFocus:function(focus){return this.focus
-},_getFocusElement:function(){return this.get("canvas")},installKeyListener:function(listener){this.onInit(function(){this.realInstallKeyListener(listener)
-}.bind(this))},realInstallKeyListener:function(listener){var scope=this.get("canvas");
-if(this.oldkeydown){SC.Event.remove(scope,"keydown",this,this.oldkeydown)}if(this.oldkeypress){SC.Event.remove(scope,"keypress",this,this.oldkeypress)
-}this.oldkeydown=function(ev){listener.onkeydown(ev);return true};this.oldkeypress=function(ev){listener.onkeypress(ev);
-return true};SC.Event.add(scope,"keydown",this,this.oldkeydown);SC.Event.add(scope,"keypress",this,this.oldkeypress);
-var Key=keys.Key;listener.bindKeyStringSelectable("",keys.Key.LEFT_ARROW,this.actions.moveCursorLeft,"Move Cursor Left");
-listener.bindKeyStringSelectable("",keys.Key.RIGHT_ARROW,this.actions.moveCursorRight,"Move Cursor Right");
-listener.bindKeyStringSelectable("",keys.Key.UP_ARROW,this.actions.moveCursorUp,"Move Cursor Up");
-listener.bindKeyStringSelectable("",keys.Key.DOWN_ARROW,this.actions.moveCursorDown,"Move Cursor Down");
-listener.bindKeyForPlatform({MAC:"ALT LEFT_ARROW",WINDOWS:"CTRL LEFT_ARROW"},this.actions.moveWordLeft,"Move Word Left",true);
-listener.bindKeyForPlatform({MAC:"ALT RIGHT_ARROW",WINDOWS:"CTRL RIGHT_ARROW"},this.actions.moveWordRight,"Move Word Right",true);
-listener.bindKeyStringSelectable("",keys.Key.HOME,this.actions.moveToLineStart,"Move to start of line");
-listener.bindKeyForPlatform({MAC:"APPLE LEFT_ARROW",WINDOWS:"ALT LEFT_ARROW"},this.actions.moveToLineStart,"Move to start of line",true);
-listener.bindKeyStringSelectable("",keys.Key.END,this.actions.moveToLineEnd,"Move to end of line");
-listener.bindKeyForPlatform({MAC:"APPLE RIGHT_ARROW",WINDOWS:"ALT RIGHT_ARROW"},this.actions.moveToLineEnd,"Move to end of line",true);
-listener.bindKeyString("CTRL",keys.Key.K,this.actions.killLine,"Kill entire line");
-listener.bindKeyString("CMD",keys.Key.L,this.actions.gotoLine,"Goto Line");listener.bindKeyString("CTRL",keys.Key.L,this.actions.moveCursorRowToCenter,"Move cursor to center of page");
-listener.bindKeyStringSelectable("",keys.Key.BACKSPACE,this.actions.backspace,"Backspace");
-listener.bindKeyStringSelectable("CTRL",keys.Key.BACKSPACE,this.actions.deleteWordLeft,"Delete a word to the left");
-listener.bindKeyString("",keys.Key.DELETE,this.actions.deleteKey,"Delete");listener.bindKeyString("CTRL",keys.Key.DELETE,this.actions.deleteWordRight,"Delete a word to the right");
-listener.bindKeyString("",keys.Key.ENTER,this.actions.newline,"Insert newline");listener.bindKeyString("CMD",keys.Key.ENTER,this.actions.newlineBelow,"Insert newline at end of current line");
-listener.bindKeyString("",keys.Key.TAB,this.actions.insertTab,"Indent / insert tab");
-listener.bindKeyString("SHIFT",keys.Key.TAB,this.actions.unindent,"Unindent");listener.bindKeyString("CMD",keys.Key.SQUARE_BRACKET_CLOSE,this.actions.indent,"Indent");
-listener.bindKeyString("CMD",keys.Key.SQUARE_BRACKET_OPEN,this.actions.unindent,"Unindent");
-listener.bindKeyString("",keys.Key.ESCAPE,this.actions.escape,"Clear fields and dialogs");
-listener.bindKeyString("CMD",keys.Key.A,this.actions.selectAll,"Select All");listener.bindKeyString("CMD",keys.Key.I,this.actions.toggleQuickopen,"Toggle Quickopen");
-listener.bindKeyString("CMD",keys.Key.J,this.actions.focusCommandline,"Open Command line");
-listener.bindKeyString("CMD",keys.Key.O,this.actions.focusFileBrowser,"Open File Browser");
-listener.bindKeyString("CMD",keys.Key.F,this.actions.cmdFilesearch,"Search in this file");
-listener.bindKeyString("CMD",keys.Key.G,this.actions.findNext,"Find Next");listener.bindKeyString("SHIFT CMD",keys.Key.G,this.actions.findPrev,"Find Previous");
-listener.bindKeyString("CTRL",keys.Key.M,this.actions.togglePieMenu,"Open Pie Menu");
-listener.bindKeyString("CMD",keys.Key.Z,this.actions.undo,"Undo");listener.bindKeyString("SHIFT CMD",keys.Key.Z,this.actions.redo,"Redo");
-listener.bindKeyString("CMD",keys.Key.Y,this.actions.redo,"Redo");listener.bindKeyStringSelectable("CMD",keys.Key.UP_ARROW,this.actions.moveToFileTop,"Move to top of file");
-listener.bindKeyStringSelectable("CMD",keys.Key.DOWN_ARROW,this.actions.moveToFileBottom,"Move to bottom of file");
-listener.bindKeyStringSelectable("CMD",keys.Key.HOME,this.actions.moveToFileTop,"Move to top of file");
-listener.bindKeyStringSelectable("CMD",keys.Key.END,this.actions.moveToFileBottom,"Move to bottom of file");
-listener.bindKeyStringSelectable("",keys.Key.PAGE_UP,this.actions.movePageUp,"Move a page up");
-listener.bindKeyStringSelectable("",keys.Key.PAGE_DOWN,this.actions.movePageDown,"Move a page down");
-listener.bindKeyStringSelectable("ALT",keys.Key.UP_ARROW,this.actions.movePageUp,"Move up a block");
-listener.bindKeyStringSelectable("ALT",keys.Key.DOWN_ARROW,this.actions.movePageDown,"Move down a block");
-listener.bindKeyString("CMD ALT",keys.Key.LEFT_ARROW,this.actions.previousFile);listener.bindKeyString("CMD ALT",keys.Key.RIGHT_ARROW,this.actions.nextFile)
-},getWidth:function(){return this.get("gutterWidth")+this.get("textWidth")+this.get("padding").right
-},getHeight:function(){return this.get("lineHeight")*this.get("content").getRowCount()+this.get("padding").bottom
-},charWidth:function(key,value){var ctx=this.get("canvas").getContext("2d");if(ctx.measureText!==undefined){return ctx.measureText("M").width
-}return this.FALLBACK_CHARACTER_WIDTH}.property().cacheable(),lineHeight:function(key,value){var ctx=this.get("canvas").getContext("2d");
-if(ctx.measureText!==undefined){var t=ctx.measureText("M");if(!isNaN(t.ascent)){return Math.floor(t.ascent*2.8)
-}}return this.LINE_HEIGHT}.property().cacheable(),gutterWidth:function(){var width=this.GUTTER_INSETS.left+this.GUTTER_INSETS.right+this.get("content").getRowCount().toString().length*this.get("charWidth");
-if(this.editor.debugMode){width+=this.DEBUG_GUTTER_WIDTH}return width}.property("content","charWidth"),textWidth:function(key,value){return this.get("charWidth")*(this.getMaxCols(0,this.get("content").getRowCount()-1)+1)
-}.property("content","charWidth"),computeLayout:function(minimumSize){var frame=this.get("frame");
-return{left:frame.x,top:frame.y,width:minimumSize!=null?Math.max(this.getWidth(),minimumSize.width):this.getWidth(),height:minimumSize!=null?Math.max(this.getHeight(),minimumSize.height):this.getHeight()}
-},layoutStyle:function(key,value){return{}}.property().cacheable(),resetCanvas:function(){},fillText:function(ctx,text,x,y){ctx.fillText(text,x,y)
-},fillTextWithTransparency:function(ctx,text,x,y){ctx.globalAlpha=0.3;ctx.fillText(text,x,y);
-ctx.globalAlpha=1},resizeCanvasIfNeeded:function(){var canvas=this.get("canvas");
-var parentLayer=this.get("parentView").get("layer");if(parentLayer.clientWidth!==0&&parentLayer.clientHeight!==0){if(parentLayer.clientWidth!==canvas.width){canvas.width=parentLayer.clientWidth
-}if(parentLayer.clientHeight!==canvas.height){canvas.height=parentLayer.clientHeight
-}}},computeContainerSize:function(){var parentLayer=this.get("parentView").get("layer");
-var size={width:parentLayer.clientWidth,height:parentLayer.clientHeight};return size.width==0&&size.height==0?null:size
-},resizeCanvasToFit:function(size){var canvas=this.get("canvas");if(size.width!==canvas.width){canvas.width=size.width
-}if(size.height!==canvas.height){canvas.height=size.height}},paint:function(ctx,fullRefresh){var content=this.get("content");
-fullRefresh=true;var ed=this.editor;var c=this.get("canvas");var theme=ed.theme;var x,y;
-var cy;var currentLine;var lastLineToRender;var Rect=scroller.Rect;this.resizeCanvasIfNeeded();
-var refreshCanvas=fullRefresh;if(!refreshCanvas){refreshCanvas=(this.selectMouseDownPos)
-}if(!refreshCanvas){refreshCanvas=(this.lastLineCount!=content.getRowCount())}this.lastLineCount=content.getRowCount();
-var cwidth=this.getWidth();var cheight=this.getHeight();var lineHeight=this.get("lineHeight");
-this.visibleRows=Math.ceil(cheight/lineHeight);this.firstVisibleRow=0;lastLineToRender=this.firstVisibleRow+this.visibleRows;
-if(lastLineToRender>(content.getRowCount()-1)){lastLineToRender=content.getRowCount()-1
-}var virtualheight=this.getHeight();var virtualwidth=this.get("textWidth");if(this.editor.debugMode&&bespin.get("editSession")){bespin.getComponent("breakpoints",function(bpmanager){var points=bpmanager.getBreakpoints(bespin.get("editSession").project,bespin.get("editSession").path);
-points.forEach(function(point){breakpoints[point.lineNumber]=point})})}if(!refreshCanvas){var dirty=content.getDirtyRows();
-if((this.lastCursorPos)&&(this.lastCursorPos.row!=ed.cursorManager.getCursorPosition().row)){dirty[this.lastCursorPos.row]=true
-}dirty[ed.cursorManager.getCursorPosition().row]=true}this.lastCursorPos=cursor.copyPos(ed.cursorManager.getCursorPosition());
-ctx.save();var layout=this.get("layout");ctx.translate(layout.left,layout.top);var clippingFrame=this.get("clippingFrame");
-if(refreshCanvas){ctx.fillStyle=theme.backgroundStyle;ctx.fillRect(clippingFrame.x,clippingFrame.y,clippingFrame.width,clippingFrame.height);
-ctx.fillStyle=theme.gutterStyle;ctx.fillRect(0,clippingFrame.y,this.get("gutterWidth"),clippingFrame.height)
-}if(refreshCanvas){if(bespin.get("parser")){for(currentLine=this.firstVisibleRow;
-currentLine<=lastLineToRender;currentLine++){if(lineMarkers[currentLine]){y=lineHeight*(currentLine-1);
-cy=y+(lineHeight-this.LINE_INSETS.bottom);ctx.fillStyle=this.editor.theme["lineMarker"+lineMarkers[currentLine].type+"Color"];
-ctx.fillRect(0,y,this.get("gutterWidth"),lineHeight)}}}y=(lineHeight*this.firstVisibleRow);
-for(currentLine=this.firstVisibleRow;currentLine<=lastLineToRender;currentLine++){x=0;
-if(this.editor.debugMode){if(breakpoints[currentLine]){var bpx=x+this.DEBUG_GUTTER_INSETS.left;
-var bpy=y+this.DEBUG_GUTTER_INSETS.top;var bpw=this.DEBUG_GUTTER_WIDTH-this.DEBUG_GUTTER_INSETS.left-this.DEBUG_GUTTER_INSETS.right;
-var bph=lineHeight-this.DEBUG_GUTTER_INSETS.top-this.DEBUG_GUTTER_INSETS.bottom;var bpmidpointx=bpx+parseInt(bpw/2,10);
-var bpmidpointy=bpy+parseInt(bph/2,10);ctx.strokeStyle="rgb(128, 0, 0)";ctx.fillStyle="rgb(255, 102, 102)";
-ctx.beginPath();ctx.arc(bpmidpointx,bpmidpointy,bpw/2,0,Math.PI*2,true);ctx.closePath();
-ctx.fill();ctx.stroke()}x+=this.DEBUG_GUTTER_WIDTH}x+=this.GUTTER_INSETS.left;cy=y+(lineHeight-this.LINE_INSETS.bottom);
-ctx.fillStyle=theme.lineNumberColor;ctx.font=this.editor.theme.lineNumberFont;ctx.fillText(currentLine+1,x,cy);
-y+=lineHeight}}ctx.save();ctx.beginPath();ctx.rect(this.get("gutterWidth"),0,cwidth-this.get("gutterWidth"),cheight);
-ctx.closePath();ctx.clip();var charWidth=this.get("charWidth");var firstColumn=0;
-var lastColumn=firstColumn+(Math.ceil((cwidth-this.get("gutterWidth"))/charWidth));
-y=(lineHeight*this.firstVisibleRow);var cc;var ce;var ri;var regionlen;var tx,tw,tsel;
-var settings=bespin.get("settings");var searchStringLength=(this.searchString?this.searchString.length:-1);
-for(currentLine=this.firstVisibleRow;currentLine<=lastLineToRender;currentLine++){x=this.get("gutterWidth");
-if(!refreshCanvas){if(!dirty[currentLine]){y+=lineHeight;continue}ctx.save();ctx.beginPath();
-ctx.rect(x,y,cwidth,lineHeight);ctx.closePath();ctx.clip();if((currentLine%2)==1){ctx.fillStyle=theme.backgroundStyle;
-ctx.fillRect(x,y,cwidth,lineHeight)}}if((settings&&settings.isSettingOn("highlightline"))&&(currentLine==ed.cursorManager.getCursorPosition().row)){ctx.fillStyle=theme.highlightCurrentLineColor;
-ctx.fillRect(x,y,cwidth,lineHeight)}else{if((currentLine%2)==0){ctx.fillStyle=theme.zebraStripeColor;
-ctx.fillRect(x,y,cwidth,lineHeight)}}x+=this.LINE_INSETS.left;cy=y+(lineHeight-this.LINE_INSETS.bottom);
-var selections=this.selectionHelper.getRowSelectionPositions(currentLine);if(selections){tx=x+(selections.startCol*charWidth);
-tw=(selections.endCol==-1)?(lastColumn-firstColumn)*charWidth:(selections.endCol-selections.startCol)*charWidth;
-ctx.fillStyle=theme.editorSelectedTextBackground;ctx.fillRect(tx,y,tw,lineHeight)
-}var lineMetadata=content.getRowMetadata(currentLine);var lineText=lineMetadata.lineText;
-var searchIndices=lineMetadata.searchIndices;var lineInfo=this.syntaxModel.getSyntaxStylesPerLine(lineText,currentLine,this.editor.language);
-var readOnlyAwareFill=ed.readonly?this.fillTextWithTransparency:this.fillText;for(ri=0;
-ri<lineInfo.regions.length;ri++){var styleInfo=lineInfo.regions[ri];for(var style in styleInfo){if(!styleInfo.hasOwnProperty(style)){continue
-}var thisLine="";var styleArray=styleInfo[style];var currentColumn=0;for(var si=0;
-si<styleArray.length;si++){var range=styleArray[si];for(;currentColumn<range.start;
-currentColumn++){thisLine+=" "}thisLine+=lineInfo.text.substring(range.start,range.stop);
-currentColumn=range.stop}ctx.fillStyle=this.editor.theme[style]||"white";ctx.font=this.editor.theme.editorTextFont;
-readOnlyAwareFill(ctx,thisLine,x,cy)}}if(searchIndices){if(selections){tsel={startCol:0,endCol:lineText.length};
-if(selections.startCol!=-1){tsel.startCol=selections.startCol}if(selections.endCol!=-1){tsel.endCol=selections.endCol
-}}else{tsel=false}for(var i=0;i<searchIndices.length;i++){var index=ed.cursorManager.getCursorPosition({col:searchIndices[i],row:currentLine}).col;
-tx=x+index*charWidth;ctx.fillStyle=this.editor.theme.searchHighlight;ctx.fillRect(tx,y,searchStringLength*charWidth,lineHeight);
-if(tsel){var indexStart=index;var indexEnd=index+searchStringLength;if(tsel.startCol<indexEnd&&tsel.endCol>indexStart){indexStart=Math.max(indexStart,tsel.startCol);
-indexEnd=Math.min(indexEnd,tsel.endCol);ctx.fillStyle=this.editor.theme.searchHighlightSelected;
-ctx.fillRect(x+indexStart*charWidth,y,(indexEnd-indexStart)*charWidth,lineHeight)
-}}ctx.fillStyle=this.editor.theme.editorTextColor||"white";ctx.fillText(lineText.substring(index,index+searchStringLength),tx,cy)
-}}if(settings&&(settings.isSettingOn("tabarrow")||settings.isSettingOn("tabshowspace"))){if(lineMetadata.tabExpansions.length>0){for(i=0;
-i<lineMetadata.tabExpansions.length;i++){var expansion=lineMetadata.tabExpansions[i];
-var lx=x+(expansion.start*charWidth);var showTabSpace=settings&&settings.isSettingOn("tabshowspace");
-if(showTabSpace){var sw=(expansion.end-expansion.start)*charWidth;ctx.fillStyle=this.editor.theme.tabSpace||"white";
-ctx.fillRect(lx,y,sw,lineHeight)}var showTabNib=settings&&settings.isSettingOn("tabarrow");
-if(showTabNib){cy=y+(lineHeight/2);var cx=lx+(charWidth/2);tw=4;var th=6;tx=parseInt(cx-(tw/2),10);
-var ty=parseInt(cy-(th/2),10);ctx.globalAlpha=0.3;ctx.beginPath();ctx.fillStyle=this.editor.theme.plain||"white";
-ctx.moveTo(tx,ty);ctx.lineTo(tx,ty+th);ctx.lineTo(tx+tw,ty+parseInt(th/2,10));ctx.closePath();
-ctx.fill();ctx.globalAlpha=1}}}}y+=lineHeight}if(this.focus){if(this.showCursor){if(ed.theme.cursorType=="underline"){x=this.get("gutterWidth")+this.LINE_INSETS.left+ed.cursorManager.getCursorPosition().col*charWidth;
-y=(ed.getCursorPos().row*lineHeight)+(lineHeight-5);ctx.fillStyle=ed.theme.cursorStyle;
-ctx.fillRect(x,y,charWidth,3)}else{x=this.get("gutterWidth")+this.LINE_INSETS.left+ed.cursorManager.getCursorPosition().col*charWidth;
-y=(ed.cursorManager.getCursorPosition().row*lineHeight);ctx.fillStyle=ed.theme.cursorStyle;
-ctx.fillRect(x,y,1,lineHeight)}}}else{x=this.get("gutterWidth")+this.LINE_INSETS.left+ed.cursorManager.getCursorPosition().col*charWidth;
-y=(ed.cursorManager.getCursorPosition().row*lineHeight);ctx.fillStyle=ed.theme.unfocusedCursorFillStyle;
-ctx.strokeStyle=ed.theme.unfocusedCursorStrokeStyle;ctx.fillRect(x,y,charWidth,lineHeight);
-ctx.strokeRect(x,y,charWidth,lineHeight)}var session=bespin.get("editSession");if(session){var userEntries=session.getUserEntries();
-if(userEntries){userEntries.forEach(function(userEntry){if(!userEntry.clientData.isMe){x=this.gutterWidth+this.LINE_INSETS.left+userEntry.clientData.cursor.start.col*charWidth;
-y=userEntry.clientData.cursor.start.row*lineHeight;ctx.fillStyle="#ee8c00";ctx.fillRect(x,y,1,lineHeight);
-var prevFont=ctx.font;ctx.font="6pt Monaco, Lucida Console, monospace";ctx.fillText(userEntry.handle,x+3,y+lineHeight+4);
-ctx.font=prevFont}}.bind(this))}}if(this.changes){this.changes.forEach(function(change){ctx.strokeStyle="#211A16";
-ctx.beginPath();x=this.gutterWidth+this.LINE_INSETS.left+180*charWidth;y=change.start.row*lineHeight;
-ctx.moveTo(x,y);x=this.gutterWidth+this.LINE_INSETS.left+change.start.col*charWidth;
-ctx.lineTo(x,y);y+=lineHeight;ctx.lineTo(x,y);x=this.gutterWidth+this.LINE_INSETS.left;
-ctx.lineTo(x,y);y=(change.end.row+1)*lineHeight;ctx.lineTo(x,y);x=this.gutterWidth+this.LINE_INSETS.left+change.end.col*charWidth;
-ctx.lineTo(x,y);y=change.end.row*lineHeight;ctx.lineTo(x,y);x=this.gutterWidth+this.LINE_INSETS.left+180*charWidth;
-ctx.lineTo(x,y);y=change.start.row*lineHeight;ctx.lineTo(x,y);ctx.stroke()}.bind(this))
-}ctx.restore();ctx.restore()},getRowString:function(row){var content=this.get("content");
-return content.getRowMetadata(row).lineText},getRowScreenLength:function(row){return this.getRowString(row).length
-},getMaxCols:function(firstRow,lastRow){var cols=0;for(var i=firstRow;i<=lastRow;
-i++){cols=Math.max(cols,this.getRowScreenLength(i))}return cols},setSearchString:function(str){var content=this.get("content");
-if(str&&str!=""){this.searchString=str}else{delete this.searchString}content.searchStringChanged(this.searchString);
-this.editor.paint(true)},setChanges:function(changes){this.changes=changes;console.log("changes=",this.changes)
-},_scrollToFrameVisible:function(frame){var clippingFrame=this.get("clippingFrame");
-var padding=this.get("padding");var preferredFrame={x:clippingFrame.x,y:clippingFrame.y,width:clippingFrame.width-padding.right,height:clippingFrame.height-padding.bottom};
-var targetX;var frameRight=frame.x+frame.width;if(frame.x<preferredFrame.x){targetX=frame.x
-}else{if(frameRight>=preferredFrame.x+preferredFrame.width){targetX=frameRight-preferredFrame.width
-}else{targetX=preferredFrame.x}}var targetY;var frameBottom=frame.y+frame.height;
-if(frame.y<preferredFrame.y){targetY=frame.y}else{if(frameBottom>=preferredFrame.y+preferredFrame.height){targetY=frameBottom-preferredFrame.height
-}else{targetY=preferredFrame.y}}if(targetX===preferredFrame.x&&targetY===preferredFrame.y){return false
-}var scrollable=this;do{scrollable=scrollable.get("parentView");if(scrollable===null){return false
-}}while(scrollable.get("isScrollable")!==true);scrollable.scrollToVisible();return scrollable.scrollTo(targetX,targetY)
-},_scrollToCharVisible:function(pos){var charWidth=this.get("charWidth");var lineHeight=this.get("lineHeight");
-return this._scrollToFrameVisible({x:this.get("gutterWidth")+pos.col*charWidth,y:pos.row*lineHeight,width:charWidth,height:lineHeight})
-},_scrollToCursorVisible:function(){var cursorPos=this.editor.cursorManager.getCursorPosition();
-return this._scrollToCharVisible(cursorPos)},_updateCanvasSize:function(){var containerSize=this.computeContainerSize();
-if(containerSize!=null){this.resizeCanvasToFit(containerSize)}var layout=this.computeLayout(containerSize);
-this.adjust(layout)},cursorDidMove:function(sender,newPosition){this._updateCanvasSize();
-this._scrollToCursorVisible()},dispose:function(){}});bespin.subscribe("settings:set:cursorblink",function(event){var ms=parseInt(event.value,10);
-if(ms){var editor=bespin.get("editor");editor.ui.toggleCursorFrequency=ms}});bespin.subscribe("settings:set:fontsize",function(event){var editor=bespin.get("editor");
-var fontsize=parseInt(event.value,10);editor.theme.editorTextFont=editor.theme.editorTextFont.replace(/[0-9]{1,}pt/,fontsize+"pt");
-editor.theme.lineNumberFont=editor.theme.lineNumberFont.replace(/[0-9]{1,}pt/,fontsize+"pt")
-});bespin.subscribe("settings:set:theme",function(event){var editor=bespin.get("editor");
-var settings=bespin.get("settings");var theme=event.value;var checkSetAndExit=function(){var themeSettings=themes[theme];
-if(themeSettings){if(themeSettings!=editor.theme){editor.theme=themeSettings;bespin.publish("settings:set:fontsize",{value:settings.getValue("fontsize")})
-}return true}return false};if(theme){if(checkSetAndExit()){return true}try{var req=require;
-req.call(window,"themes."+theme);if(checkSetAndExit()){return true}}catch(e){console.log("Unable to load theme: "+theme,e)
-}var onSuccess=function(file){try{eval(file.content)}catch(e){console.log("Error with theme loading: ",e)
-}if(!checkSetAndExit()){bespin.get("commandLine").addErrorOutput("Sorry old chap. No theme called '"+theme+"'. Fancy making it?")
-}};var onFailure=function(){bespin.get("commandLine").addErrorOutput("Sorry old chap. No theme called '"+theme+"'. Fancy making it?")
-};bespin.get("files").loadContents(bespin.userSettingsProject,"/themes/"+theme+".js",onSuccess,onFailure)
-}});var EditorWrapper=SC.Object.extend({editor:null,ui:null,focus:function(){this.ui.setFocus(true)
-},hasFocus:function(){return this.ui.hasFocus()},getFocusElement:function(){return this.ui._getFocusElement()
-},removeSelection:function(){var selectionObject=this.editor.getSelection();var text=null;
-if(selectionObject){var text=this.editor.model.getChunk(selectionObject);if(text&&text!=""){this.ui.actions.beginEdit("cut");
-this.ui.actions.deleteSelection(selectionObject);this.ui.actions.endEdit()}}return text
-},getSelection:function(){return this.editor.getSelectionAsText()},replaceSelection:function(text){var args=cursor.buildArgs();
-args.chunk=text;if(args.chunk){this.ui.actions.beginEdit("paste");this.ui.actions.insertChunk(args);
-this.ui.actions.endEdit()}},installEditorOnly:function(){this.editor.bindKey("copySelection","CMD C");
-this.editor.bindKey("pasteFromClipboard","CMD V");this.editor.bindKey("cutSelection","CMD X")
-}})});tiki.module("bespin:editor/views/scroll",function(c,b,d){var e=c("sproutcore/runtime:package").SC;
-var a=c("editor/views/scroller");b.BespinScrollView=e.ScrollView.extend({hasHorizontalScroller:true,autohidesHorizontalScroller:false,horizontalScrollerView:a.BespinScrollerView,hasVerticalScroller:true,autohidesVerticalScroller:false,verticalScrollerView:a.BespinScrollerView,horizontalScrollerThickness:24,verticalScrollerThickness:24,tile:function(){var k=this.get("horizontalScrollerView");
-var l=this.get("verticalScrollerView");var g=this.get("isHorizontalScrollerVisible");
-var h=this.get("isVerticalScrollerVisible");var j=this.get("horizontalScrollerThickness");
-var f=this.get("verticalScrollerThickness");if(g){var k=this.get("horizontalScrollerView");
-k.set("scrollerThickness",j);k.set("padding",{top:0,bottom:6,left:6,right:6+f});k.set("layout",{left:0,bottom:0,right:0,height:j})
-}if(h){var l=this.get("verticalScrollerView");l.set("scrollerThickness",f);l.set("padding",{left:0,right:6,top:6,bottom:6+j});
-l.set("layout",{top:0,right:0,bottom:0,width:f})}this.get("containerView").set("layout",{left:0,bottom:0,top:0,right:0});
-var i=this.get("contentView");if(i.get("hasPadding")===true){this.get("contentView").set("padding",{bottom:j+6,right:f+6})
-}}})});tiki.module("bespin:editor/views/scroller",function(e,c,f){var h=e("sproutcore/runtime:package").SC;
-var d=3;var b=5;var g=15;var a=8;c.BespinScrollerView=h.View.extend({classNames:["bespin-scroller-view"],_mouseDownScreenPoint:null,_mouseDownValue:null,_isMouseOver:false,_value:0,_bespinScrollerView_valueDidChange:function(){h.RunLoop.begin();
-this.set("layerNeedsUpdate",true);h.RunLoop.end()}.observes("value"),_bespinScrollerView_maximumDidChange:function(){h.RunLoop.begin();
-this.set("layerNeedsUpdate",true);h.RunLoop.end()}.observes("maximum"),theme:{backgroundStyle:"#2A211C",partialNibStyle:"rgba(100, 100, 100, 0.3)",partialNibArrowStyle:"rgba(255, 255, 255, 0.3)",partialNibStrokeStyle:"rgba(150, 150, 150, 0.3)",fullNibStyle:"rgb(100, 100, 100)",fullNibArrowStyle:"rgb(255, 255, 255)",fullNibStrokeStyle:"rgb(150, 150, 150)",scrollTrackFillStyle:"rgba(50, 50, 50, 0.8)",scrollTrackStrokeStyle:"rgb(150, 150, 150)",scrollBarFillStyle:"rgba(0, 0, 0, %a)",scrollBarFillGradientTopStart:"rgba(90, 90, 90, %a)",scrollBarFillGradientTopStop:"rgba(40, 40, 40, %a)",scrollBarFillGradientBottomStart:"rgba(22, 22, 22, %a)",scrollBarFillGradientBottomStop:"rgba(44, 44, 44, %a)"},scrollerThickness:h.NATURAL_SCROLLER_THICKNESS,minimumHandleSize:20,lineHeight:15,layoutDirection:h.LAYOUT_VERTICAL,isEnabled:true,ownerScrollValueKey:function(){switch(this.get("layoutDirection")){case h.LAYOUT_VERTICAL:return"verticalScrollOffset";
-case h.LAYOUT_HORIZONTAL:return"horizontalScrollOffset"}return null}.property("layoutDirection").cacheable(),padding:{left:0,bottom:0,top:0,right:0},_clientFrame:function(){var j=this.get("frame"),i=this.get("padding");
-return{x:i.left,y:i.top,width:j.width-(i.left+i.right),height:j.height-(i.top+i.bottom)}
-}.property("frame","padding").cacheable(),_clientThickness:function(){var j=this.get("padding");
-var i=this.get("scrollerThickness");switch(this.get("layoutDirection")){case h.LAYOUT_VERTICAL:return i-(j.left+j.right);
-case h.LAYOUT_HORIZONTAL:return i-(j.top+j.bottom)}}.property("layoutDirection","padding","scrollerThickness").cacheable(),_gutterFrame:function(){var i=this.get("_clientFrame");
-var j=this.get("_clientThickness");switch(this.get("layoutDirection")){case h.LAYOUT_VERTICAL:return{x:i.x,y:i.y+g,width:j,height:Math.max(0,i.height-2*g)};
-case h.LAYOUT_HORIZONTAL:return{x:i.x+g,y:i.y,width:Math.max(0,i.width-2*g),height:j}
-}}.property("_clientFrame","_clientThickness","layoutDirection").cacheable(),_gutterLength:function(){var j=this.get("_gutterFrame");
-var i;switch(this.get("layoutDirection")){case h.LAYOUT_HORIZONTAL:i=j.width;break;
-case h.LAYOUT_VERTICAL:i=j.height;break}return i}.property("_gutterFrame","layoutDirection").cacheable(),_frameLength:function(){var i=this.get("frame");
-switch(this.get("layoutDirection")){case h.LAYOUT_HORIZONTAL:return i.width;case h.LAYOUT_VERTICAL:return i.height
-}}.property("frame","layoutDirection").cacheable(),_clientLength:function(){var i=this.get("_clientFrame");
-switch(this.get("layoutDirection")){case h.LAYOUT_HORIZONTAL:return i.width;case h.LAYOUT_VERTICAL:return i.height
-}}.property("_clientFrame","layoutDirection").cacheable(),_handleFrame:function(){var k=this.get("value");
-var n=this.get("maximum");var m=this.get("frame");var i=this.get("_clientFrame");
-var l=this.get("_gutterFrame");var j=this.get("_clientThickness");switch(this.get("layoutDirection")){case h.LAYOUT_VERTICAL:return{x:i.x,y:i.y+g+k*l.height/n,width:j,height:m.height*l.height/n};
-case h.LAYOUT_HORIZONTAL:return{x:i.x+g+k*l.width/n,y:i.y,width:m.width*l.width/n,height:j}
-}}.property("_clientFrame","_clientThickness","_gutterFrame","maximum","value").cacheable(),maximumValue:function(){return Math.max(this.get("maximum")-this.get("_frameLength"),0)
-}.property("_frameLength","maximum").cacheable(),value:function(j,k){var i=this.get("maximumValue");
-if(k!==undefined){if(k<0){k=0}else{if(k>i){k=i}}this._value=k}else{return Math.min(this._value||0,i)
-}}.property("maximumValue").cacheable(),maximum:0,_segmentForMouseEvent:function(j){var i=this.convertFrameFromView({x:j.pageX,y:j.pageY});
-var k=this.get("_clientFrame");if(!h.pointInRect(i,k)){return null}var m=this.get("layoutDirection");
-switch(m){case h.LAYOUT_HORIZONTAL:if(i.x<g){return"nib-start"}if(i.x>=k.width-g){return"nib-end"
-}break;case h.LAYOUT_VERTICAL:if(i.y<g){return"nib-start"}if(i.y>=k.height-g){return"nib-end"
-}break}var l=this.get("_handleFrame");if(h.pointInRect(i,l)){return"handle"}switch(m){case h.LAYOUT_HORIZONTAL:if(i.x<l.x){return"gutter-before"
-}else{if(i.x>=l.x+l.width){return"gutter-after"}}break;case h.LAYOUT_VERTICAL:if(i.y<l.y){return"gutter-before"
-}else{if(i.y>=l.y+l.height){return"gutter-after"}}break}console.assert(false,"_segmentForMouseEvent: point ",i," outside view with handle frame ",l," and client frame ",k)
-},mouseEntered:function(i){h.RunLoop.begin();this._isMouseOver=true;this.set("layerNeedsUpdate",true);
-h.RunLoop.end()},mouseExited:function(i){h.RunLoop.begin();this._isMouseOver=false;
-this.set("layerNeedsUpdate",true);h.RunLoop.end()},mouseWheel:function(i){h.RunLoop.begin();
-var j;switch(this.get("layoutDirection")){case h.LAYOUT_HORIZONTAL:j=i.wheelDeltaX;
-break;case h.LAYOUT_VERTICAL:j=i.wheelDeltaY;break}this.set("value",this.get("value")+2*j);
-h.RunLoop.end()},mouseDown:function(i){h.RunLoop.begin();var k=this.get("value");
-var j=this.get("_gutterLength");switch(this._segmentForMouseEvent(i)){case"nib-start":this.set("value",k-this.get("lineHeight"));
-break;case"nib-end":this.set("value",k+this.get("lineHeight"));break;case"gutter-before":this.set("value",k-j);
-break;case"gutter-after":this.set("value",k+j);break;case"handle":switch(this.get("layoutDirection")){case h.LAYOUT_HORIZONTAL:this._mouseDownScreenPoint=i.clientX;
-break;case h.LAYOUT_VERTICAL:this._mouseDownScreenPoint=i.clientY;break}break}h.RunLoop.end()
-},mouseUp:function(i){this._mouseDownScreenPoint=null;this._mouseDownValue=null},mouseMoved:function(j){h.RunLoop.begin();
-if(this._mouseDownScreenPoint!==null){var k;switch(this.get("layoutDirection")){case h.LAYOUT_HORIZONTAL:k=j.clientX;
-break;case h.LAYOUT_VERTICAL:k=j.clientY;break}var i=k-this._mouseDownScreenPoint;
-var m=this.get("maximum");var l=this.get("_gutterLength");this.set("value",this.get("value")+i*m/l);
-this._mouseDownScreenPoint=k}h.RunLoop.end()},_paintNib:function(i){var m=this.get("theme");
-var k,j,n;if(this._isMouseOver){k=m.fullNibStyle;j=m.fullNibArrowStyle;n=m.fullNibStrokeStyle
-}else{k=m.partialNibStyle;j=m.partialNibArrowStyle;n=m.partialNibStrokeStyle}var l=Math.floor(g/2);
-i.fillStyle=k;i.beginPath();i.arc(0,0,Math.floor(g/2),0,Math.PI*2,true);i.closePath();
-i.fill();i.strokeStyle=n;i.stroke();i.fillStyle=j;i.beginPath();i.moveTo(0,-l+d);
-i.lineTo(-l+d,l-b);i.lineTo(l-d,l-b);i.closePath();i.fill()},_paintNibs:function(j){var i=this._isMouseOver;
-var k=this.get("_clientThickness");var l=this.get("value");if(i||l!==0){j.save();
-j.translate(a,k/2);j.rotate(Math.PI*1.5);j.moveTo(0,0);this._paintNib(j);j.restore()
-}if(i||l!==this.get("maximumValue")){j.save();j.translate(this.get("_clientLength")-a,k/2);
-j.rotate(Math.PI*0.5);j.moveTo(0,0);this._paintNib(j);j.restore()}},_paint:function(){var j=this.$("canvas")[0];
-var i=this.get("frame");if(j.width!==i.width){j.width=i.width}if(j.height!==i.height){j.height=i.height
-}var w=j.getContext("2d");var k=(w.globalAlpha)?w.globalAlpha:1;var m=this.get("theme");
-w.clearRect(0,0,i.width,i.height);if(this.get("isEnabled")===false||o<=u){return}w.save();
-var t=this.get("padding");w.translate(t.left,t.top);var p=this.get("_handleFrame");
-var o=this.get("_gutterLength");var l=this.get("layoutDirection");var s=this.get("_clientThickness");
-var n=s/2;var v,u;switch(l){case h.LAYOUT_VERTICAL:v=p.y-t.top;u=p.height;w.translate(s+1,0);
-w.rotate(Math.PI*0.5);break;case h.LAYOUT_HORIZONTAL:v=p.x-t.left;u=p.width;break
-}if(this._isMouseOver===false){w.globalAlpha=0.3}else{var r=this.get("_clientLength");
-w.fillStyle=m.scrollTrackFillStyle;w.fillRect(a+0.5,0.5,r-2*a,s-1);w.strokeStyle=m.scrollTrackStrokeStyle;
-w.strokeRect(a+0.5,0.5,r-2*a,s-1)}var x=function(){w.beginPath();w.arc(v+n+0.5,n,n-0.5,Math.PI/2,3*Math.PI/2,false);
-w.arc(v+u-n-0.5,n,n-0.5,3*Math.PI/2,Math.PI/2,false);w.lineTo(v+n+0.5,s-0.5);w.closePath()
-};x();var q=w.createLinearGradient(v,0,v,s);q.addColorStop(0,m.scrollBarFillGradientTopStart.replace(/%a/,k));
-q.addColorStop(0.4,m.scrollBarFillGradientTopStop.replace(/%a/,k));q.addColorStop(0.41,m.scrollBarFillStyle.replace(/%a/,k));
-q.addColorStop(0.8,m.scrollBarFillGradientBottomStart.replace(/%a/,k));q.addColorStop(1,m.scrollBarFillGradientBottomStop.replace(/%a/,k));
-w.fillStyle=q;w.fill();w.save();w.clip();w.fillStyle=m.scrollBarFillStyle.replace(/%a/,k);
-w.beginPath();w.moveTo(v+n*0.4,n*0.6);w.lineTo(v+n*0.9,s*0.4);w.lineTo(v,s*0.4);w.closePath();
-w.fill();w.beginPath();w.moveTo(v+u-(n*0.4),0+(n*0.6));w.lineTo(v+u-(n*0.9),0+(s*0.4));
-w.lineTo(v+u,0+(s*0.4));w.closePath();w.fill();w.restore();w.save();x();w.strokeStyle=m.scrollTrackStrokeStyle;
-w.stroke();w.restore();if(this._isMouseOver===false){w.globalAlpha=1}this._paintNibs(w);
-w.restore()},didCreateLayer:function(){this._paint()},render:function(i,k){if(!k){this._paint();
-return}var j=this.get("frame");i.push('<canvas width="%@" height="%@">'.fmt(j.width,j.height))
-}})});tiki.module("bespin:embed",function(e,i,c){e("util/globals");var d=e("sproutcore/runtime:package").SC;
-var g=e("package");var j=e("util/util");var f=e("settings");var h=e("plugins");var a=e("builtins");
-var l=e("editor");var b=e("editor/controller").EditorController;var k=h.Catalog.create();
-k.load(a.metadata);g.register("plugins",k);i.useBespin=function(o,n){n=n||{};if(j.isString(o)){o=document.getElementById(o)
-}if(!o){throw new Error("useBespin requires a element parameter to attach to")}var p=o.innerHTML;
-var m=b.create({container:o});d.run(function(){g.register("editor",m);var r=d.Pane.create({layout:m.computeLayout(),layoutStyle:function(s,t){return{width:"100%",height:"100%"}
-}.property().cacheable()});r.appendChild(m.ui,null);d.$(o).css("position","relative");
-o.innerHTML="";r.appendTo(o);if(n.initialContent){p=n.initialContent}m.model.insertDocument(p);
-if(n.settings){for(var q in n.settings){if(n.settings.hasOwnProperty(q)){m.setSetting(q,n.settings[q])
-}}}if(n.stealFocus){m.setFocus(true)}if(n.lineNumber){m.setLineNumber(n.lineNumber)
-}});return m}});tiki.module("bespin:events",function(d,b,e){var c=d("package");var a=d("util/util");
-b.subscribe=function(){c.subscribe("url:change",function(g){var j=a.queryToObject(location.hash.substring(1));
-j.project=g.project;j.path=g.path;var i=[];for(var f in j){var h=j[f];i.push(f+"="+h)
-}window.location.hash=i.join("&")});c.subscribe("url:changed",function(f){c.get("editor").openFile(null,f.now.get("path"))
-});c.subscribe("cmdline:focus",function(f){c.get("editor").setFocus(false)});c.subscribe("cmdline:blur",function(f){c.get("editor").setFocus(true)
-});c.subscribe("editor:document:changed",function(f){c.publish("editor:dirty")});
-c.subscribe("editor:dirty",function(f){c.get("editor").dirty=true});c.subscribe("editor:clean",function(f){c.get("editor").dirty=false
-})}});tiki.module("bespin:history",function(c,a,d){var b=c("package");var e=c("sproutcore/runtime:package").SC;
-a.HistoryManager=e.Object.extend({history:[],historyPosition:-1,disableAdding:false,clear:function(){this.history=[];
-this.historyPosition=-1;this.disableAdding=false},getRange:function(g,f){},replaceRange:function(h,f,g){this.history.splice(h,f-h+1,g)
-},truncate:function(f){this.history.length=f+1;this.historyPosition=Math.min(this.historyPosition,this.history.length-1)
-},getCurrent:function(){return this.historyPosition},undo:function(){if(this.historyPosition<0){return
-}var g=this.history[this.historyPosition];this.disableAdding=true;try{g.undo()}catch(f){console.error("There was an error in an undo action: ");
-console.error(f)}this.disableAdding=false;this.historyPosition--},redo:function(){if(this.historyPosition>=this.history.length-1){return
-}var f=this.history[this.historyPosition+1];this.disableAdding=true;try{f.redo()}catch(g){console.error("There was an error in an undo action: ");
-console.error(g)}this.disableAdding=false;this.historyPosition++},add:function(f){if(this.disableAdding){return
-}this.history.length=this.historyPosition+1;this.history.push(f);this.historyPosition++
-},canUndo:function(){return this.historyPosition>-1},canRedo:function(){return this.historyPosition<this.history.length-1
-}});b.subscribe("editor:openfile:opensuccess",function(){b.get("editor").historyManager.clear()
-})});tiki.module("bespin:model",function(d,b,e){var g=d("sproutcore/runtime:package").SC;
-var c=d("package");var a=d("util/util");var f=d("cursor");b.DocumentModel=g.Object.extend({editor:null,init:function(){this.clear()
-},addHistoryItem:function(h,i){this.history.length=this.historyIndex+1;this.history.push({func:h,data:i});
-this.historyIndex++},performHistoryItem:function(i){var h=i.func;var j=i.data;switch(h){case"deleteCharacters":this.deleteCharacters(j.pos,j.characters.length,true);
-break;case"insertCharacters":this.insertCharacters(j.pos,j.characters,true);break;
-case"deleteChunk":this.deleteChunk(j.selection,j.chunk,true);break;case"insertChunk":this.insertChunk(j.selection.startModelPos,j.chunk,true);
-break;case"joinRow":this.joinRow(j.selection.startModelPos.row,true);break;case"replaceRow":this.replaceRow(j.row,i.undo?j.oldline:j.newline,true);
-break}},unperformHistoryItem:function(i){var h=i.func;var j=i.data;switch(h){case"deleteCharacters":h="insertCharacters";
-break;case"insertCharacters":h="deleteCharacters";break;case"deleteChunk":h="insertChunk";
-break;case"insertChunk":h="deleteChunk";break;case"joinRow":h="insertChunk";break
-}this.performHistoryItem({func:h,data:j,undo:true})},applyState:function(j){if(j>=this.history.length||j<-1){return
-}else{if(j==this.historyIndex){return}}var h,k;if(j>this.historyIndex){for(h=this.historyIndex+1;
-h<=j;h++){k=this.history[h];this.performHistoryItem(k)}}else{for(h=this.historyIndex;
-h>j;h--){k=this.history[h];this.unperformHistoryItem(k)}}this.historyIndex=j},getState:function(){return this.historyIndex
-},isEmpty:function(){if(this.rows.length>1){return false}if(this.rows.length==1&&this.rows[0].length>0){return false
-}return true},getDirtyRows:function(){var h=(this.dirtyRows)?this.dirtyRows:[];this.dirtyRows=null;
-return h},setRowDirty:function(h){if(!this.dirtyRows){this.dirtyRows=new Array(this.rows.length)
-}this.dirtyRows[h]=true},isRowDirty:function(h){if(!this.dirtyRows){return true}return this.dirtyRows[h]
-},setRowArray:function(i,h){if(!Array.isArray(h)){h=h.split("")}this.rows[i]=h},getRowArray:function(h){while(this.rows.length<=h){this.rows.push([])
-}return this.rows[h]},hasRow:function(h){return(this.rows[h])},insertCharacters:function(h,i,l){var k=this.getRowArray(h.row);
-while(k.length<h.col){k.push(" ")}var j=(h.col>0)?k.splice(0,h.col):[];j=j.concat(i.split(""));
-this.rows[h.row]=j.concat(k);this.setRowDirty(h.row);if(!l){this.addHistoryItem("insertCharacters",{pos:f.copyPos(h),characters:i})
-}},getDocument:function(){var i=[];for(var h=0;h<this.getRowCount();h++){i[h]=this.getRowArray(h).join("")
-}return i.join("\n")},insertDocument:function(i){this.clear();var j=i.split("\n");
-for(var h=0;h<j.length;h++){this.insertCharacters({row:h,col:0},j[h],true)}},changeEachRow:function(i){for(var h=0;
-h<this.getRowCount();h++){var j=this.getRowArray(h);j=i(j);this.setRowArray(h,j)}},replace:function(l,k){var m=new RegExp(l,"g");
-for(var h=0;h<this.getRowCount();h++){var i=this.getRowArray(h).join("");var j=i.replace(m,k);
-if(j!=i){this.replaceRow(h,j)}}},replaceRow:function(k,h,j){var i=this.getRowArray(k).join("");
-this.rows[k]=h.split("");if(!j){this.addHistoryItem("replaceRow",{row:k,oldline:i,newline:h})
-}},deleteCharacters:function(i,j,m){var l=this.getRowArray(i.row);var k=(i.col+j-1)-l.length;
-if(k>0){j-=k}if(j>0){this.setRowDirty(i.row);this.editor.editorView.syntaxModel.invalidateCache(i.row);
-var h=l.splice(i.col,j).join("");if(!m){this.addHistoryItem("deleteCharacters",{pos:f.copyPos(i),characters:h})
-}return h}return""},clear:function(){this.rows=[];this.cacheRowMetadata=[];this.history=[];
-this.historyIndex=-1},deleteRows:function(j,h){var i=(j+h-1)-this.rows.length;if(i>0){h-=i
-}if(h>0){this.rows.splice(j,h);this.cacheRowMetadata.splice(j,h)}},splitRow:function(h){this.editor.editorView.syntaxModel.invalidateCache(h.row);
-this.setRowDirty(h.row);var l=this.getRowArray(h.row);var i=[];if(h.col<l.length){i=i.concat(l.splice(h.col))
-}if(h.row==(this.rows.length-1)){this.rows.push(i)}else{var j=this.rows.splice(0,h.row+1);
-j.push(i);j=j.concat(this.rows);this.rows=j;var k=this.cacheRowMetadata.splice(0,h.row+1);
-k.push(undefined);this.cacheRowMetadata=k.concat(this.cacheRowMetadata)}},joinRow:function(m,k){this.editor.editorView.syntaxModel.invalidateCache(m);
-this.setRowDirty(m);if(m>=this.rows.length-1){return}var j=this.getRowArray(m);var i=this.rows[m+1];
-var h=j.length;this.rows[m]=j.concat(i);this.rows.splice(m+1,1);this.cacheRowMetadata.splice(m+1,1);
-if(!k){var l={row:m,col:h};this.addHistoryItem("joinRow",{selection:{startModelPos:l,endModelPos:l},chunk:"\n"})
-}},getRowCount:function(){return this.rows.length},getChunk:function(l){var k=l.startModelPos;
-var m=l.endModelPos;var o,p;var h="";o=k.col;var n=this.getRowArray(k.row);p=(m.row==k.row)?m.col:n.length;
-if(p>n.length){p=n.length}h+=n.join("").substring(o,p);for(var j=k.row+1;j<m.row;
-j++){h+="\n";h+=this.getRowArray(j).join("")}if(k.row!=m.row){o=0;p=m.col;n=this.getRowArray(m.row);
-if(p>n.length){p=n.length}h+="\n"+n.join("").substring(o,p)}return h},deleteChunk:function(o,n){var m=this.getChunk(o);
-var h=o.startModelPos;var l=o.endModelPos;this.editor.editorView.syntaxModel.invalidateCache(h.row);
-var j,i;j=h.col;var p=this.getRowArray(h.row);i=(l.row==h.row)?l.col:p.length;if(i>p.length){i=p.length
-}var k={row:h.row,col:j};this.deleteCharacters(k,i-j,true);if(h.row!=l.row){j=0;i=l.col;
-p=this.getRowArray(l.row);if(i>p.length){i=p.length}k={row:l.row,col:j};this.deleteCharacters(k,i-j,true)
-}if((l.row-h.row)>1){this.deleteRows(h.row+1,l.row-h.row-1)}if(l.row!=h.row){this.joinRow(h.row,true)
-}if(!n){this.addHistoryItem("deleteChunk",{selection:{startModelPos:f.copyPos(o.startModelPos),endModelPos:f.copyPos(o.endModelPos)},chunk:m})
-}return m},insertChunk:function(j,l,n){this.editor.editorView.syntaxModel.invalidateCache(j.row);
-var k=l.split("\n");var h=f.copyPos(j);for(var m=0;m<k.length;m++){this.insertCharacters(h,k[m],true);
-h.col=h.col+k[m].length;if(m<k.length-1){this.splitRow(h);h.col=0;h.row=h.row+1}}if(!n){this.addHistoryItem("insertChunk",{selection:{startModelPos:f.copyPos(j),endModelPos:f.copyPos(h)},chunk:l})
-}return h},getStringIndicesInRow:function(k,j){j=j.toLowerCase();k=this.getRowArray(k).join("").toLowerCase();
-if(k.indexOf(j)==-1){return false}var h=[];var l=0;var i=k.indexOf(j);do{h.push(i);
-i=k.indexOf(j,i+1)}while(i!=-1);return h},getCountOfString:function(l){var k=0;var i;
-var j;for(var h=0;h<this.getRowCount();h++){j=this.getStringIndicesInRow(h,l);if(j){k+=j.length
-}}return k},searchStringChanged:function(i){for(var h=0;h<this.cacheRowMetadata.length;
-h++){if(this.cacheRowMetadata[h]){if(i){this.cacheRowMetadata[h].searchIndices=this.getStringIndicesInRow(h,i)
-}else{this.cacheRowMetadata[h].searchIndices=false}}}},findPrev:function(m,i,l){var k;
-var j=l.length;for(var h=m;h>-1;h--){k=this.getStringIndicesInRow(h,l);if(!k){continue
-}for(var n=k.length-1;n>-1;n--){if(k[n]<(i-j)||m!=h){return{startPos:{col:k[n],row:h},endPos:{col:k[n]+j,row:h}}
-}}}return false},findNext:function(l,i,k){var j;for(var h=l;h<this.getRowCount();
-h++){j=this.getStringIndicesInRow(h,k);if(!j){continue}for(var m=0;m<j.length;m++){if(j[m]>i||l!=h){return{startPos:{col:j[m],row:h},endPos:{col:j[m]+k.length,row:h}}
-}}}return false},findBefore:function(l,j,i){var h=this.getRowArray(l);if(!a.isFunction(i)){i=function(n){if(n.charAt(0)==" "){return true
-}var m=n.charCodeAt(0);return(m<48)||(m>122)}}if(j>=h.length){j=Math.max(h.length-1,0)
-}while(j>0){var k=h[j];if(!k){continue}if(i(k)){j++;break}j--}return{row:l,col:j}
-},findAfter:function(l,j,i){var h=this.getRowArray(l);if(!a.isFunction(i)){i=function(n){if(n.charAt(0)==" "){return true
-}var m=n.charCodeAt(0);return(m<48)||(m>122)}}while(j<h.length){j++;var k=h[j];if(!k){continue
-}if(i(k)){break}}return{row:l,col:j}},getRowMetadata:function(r){if(!this.isRowDirty(r)&&this.cacheRowMetadata[r]){return this.cacheRowMetadata[r]
-}var q={tabExpansions:[]};var n=this.editor.model.getRowArray(r);var o=n.join("");
-var i=this.editor.getTabSize();q.lineTextWithoutTabExpansion=o;q.lineLengthWithoutTabExpansion=n.length;
-for(var h=0;h<o.length;h++){if(o.charCodeAt(h)==9){var l=i-(h%i);var m="";for(var k=1;
-k<l;k++){m+=" "}var j=(h==0)?"":o.substring(0,h);var p=(h<o.length-1)?o.substring(h+1):"";
-o=j+" "+m+p;q.tabExpansions.push({start:j.length,end:j.length+m.length+1});h+=l-1
-}}q.lineText=o;q.lineLength=q.lineText.length;if(this.editor.editorView.searchString){q.searchIndices=this.getStringIndicesInRow(r,this.editor.editorView.searchString)
-}else{q.searchIndices=false}this.cacheRowMetadata[r]=q;return q}})});tiki.module("bespin:package",function(c,b,d){var f=c("sproutcore/runtime:package").SC;
-c("browserup:package");f.mixin(b,{versionNumber:"tip",versionCodename:"DEVELOPMENT MODE",apiVersion:"dev",userSettingsProject:"BespinSettings"});
-b.displayVersion=function(g){g=document.getElementById(g)||document.getElementById("version");
-if(!g){return}g.innerHTML='<a href="https://wiki.mozilla.org/Labs/Bespin/ReleaseNotes" title="Read the release notes">Version <span class="versionnumber">'+this.versionNumber+'</span> "'+this.versionCodename+'"</a>'
-};var e=c("util/hub");b.publish=e.publish;b.subscribe=e.subscribe;b.unsubscribe=e.unsubscribe;
-b.fireAfter=e.fireAfter;var a=c("util/container");b.register=a.register;b.unregister=a.unregister;
-b.get=a.get;b.getComponent=a.getComponent});tiki.module("bespin:plugins",function(b,a,c){var d=b("sproutcore/runtime:package").SC;
-a.Extension=d.Object.extend({load:function(h,e){e=e||"pointer";var f=this.get(e).split(":");
-var g=f[0];tiki.async(g).then(function(i){if(h){if(f[1]){h(i[f[1]])}else{h(i)}}})
-}});a.ExtensionPoint=d.Object.extend({init:function(){this.extensions=[];this.handlers=[]
-},addExtension:function(e){this.extensions.push(e)},active:function(e){this.handlers.forEach(function(f){if(f.activate){f.load(function(g){g(e)
-},"activate")}})}});a.Plugin=d.Object.extend({activate:function(){var e=this.provides;
-self=this;this.provides.forEach(function(g){var f=self.get("catalog").getExtensionPoint(g.ep);
-f.active(g)})}});a.Catalog=d.Object.extend({init:function(){this.points={};this.plugins={}
-},getExtensionPoint:function(e){if(this.points[e]===undefined){this.points[e]=a.ExtensionPoint.create({name:e,catalog:this})
-}return this.points[e]},registerExtensionPoint:function(f){var e=this.getExtensionPoint(f.name);
-e.handlers.push(f)},load:function(l){for(var e in l){var k=l[e];if(k.active===undefined){k.active=true
-}k.catalog=this;if(k.provides){var j=k.provides;for(var g=0;g<j.length;g++){var m=a.Extension.create(j[g]);
-j[g]=m;var f=m.ep;if(f=="extensionpoint"){this.registerExtensionPoint(m)}else{var n=this.getExtensionPoint(m.ep);
-n.addExtension(m)}}}else{k.provides=[]}var h=a.Plugin.create(k);if(h.active){h.activate()
-}this.plugins[e]=h}}});a.thing1=function(e){print("Thing1")};a.thing2=function(e){print("Thing2")
-};a.thing3=function(e){print("Thing3: "+e)}});tiki.module("bespin:settings",function(e,c,f){var d=e("package");
-var b=e("util/util");var a=e("theme");var h=e("sproutcore/runtime:package").SC;c.factory=function(i){i(c.Core.create({store:c.InMemory}))
-};function g(){return{tabsize:"4",tabmode:"off",tabarrow:"on",fontsize:"10",consolefontsize:"11",autocomplete:"off",closepairs:"off",collaborate:"off",language:"auto",strictlines:"on",syntaxcheck:"off",syntaxengine:"simple",syntaxmarkers:"all",preview:"window",smartmove:"on",jslint:""}
-}d.subscribe("settings:set",function(j){var i=d.get("settings");i.setValue(j.key,j.value)
-});c.Core=h.Object.extend({store:null,init:function(){this.store=new (this.store||c.ServerFile)(this)
-},setValue:function(i,j){this.store.setValue(i,j);d.publish("settings:set:"+i,{value:j})
-},getValue:function(i){return this.store.getValue(i)},unsetValue:function(i){this.store.unsetValue(i)
-},list:function(){var j=[];var i=this.store.settings;for(var k in i){if(i.hasOwnProperty(k)){j.push({key:k,value:i[k]})
-}}return j},isValueOn:function(i){return i=="on"||i=="true"},isValueOff:function(i){return i=="off"||i=="false"||i===undefined
-},isSettingOn:function(i){return this.isValueOn(this.getValue(i))},isSettingOff:function(i){return this.isValueOff(this.getValue(i))
-},setObject:function(i,j){this.setValue(i,JSON.stringify(j))},getObject:function(i){try{return JSON.parse(this.getValue(i))
-}catch(j){console.log("Error in getObject: "+j);return{}}}});c.InMemory=h.Object.extend({init:function(i){this.parent=i;
-this.settings=g()},setValue:function(i,j){this.settings[i]=j},getValue:function(i){return this.settings[i]
-},unsetValue:function(i){delete this.settings[i]}});c.Cookie=h.Object.extend({init:function(j){var k=1;
-this.cookieSettings={expires:k/24,path:"/"};var i=JSON.parse(cookie.get("settings"));
-if(i){this.settings=i}else{this.settings={tabsize:"2",fontsize:"10",autocomplete:"off",collaborate:"off"};
-cookie.set("settings",JSON.stringify(this.settings),this.cookieSettings)}},setValue:function(i,j){this.settings[i]=j;
-cookie.set("settings",JSON.stringify(this.settings),this.cookieSettings)},getValue:function(i){return this.settings[i]
-},unsetValue:function(i){delete this.settings[i];cookie.set("settings",JSON.stringify(this.settings),this.cookieSettings)
-}});c.ServerAPI=h.Object.extend({init:function(i){this.self=this;this.parent=i;this.server=d.get("server");
-this.settings=g();this.server.listSettings(function(j){self.settings=j;if(j.tabsize===undefined){self.settings=g();
-self.server.setSettings(self.settings)}})},setValue:function(i,j){this.settings[i]=j;
-this.server.setSetting(i,j)},getValue:function(i){return this.settings[i]},unsetValue:function(i){delete this.settings[i];
-this.server.unsetSetting(i)}});c.ServerFile=h.Object.extend({init:function(i){this.parent=i;
-this.server=d.get("server");this.settings=g();this.loaded=false;this._load()},setValue:function(i,j){this.settings[i]=j;
-if(i[0]!="_"){this._save()}},getValue:function(i){return this.settings[i]},unsetValue:function(i){delete this.settings[i];
-this._save()},_save:function(){if(!this.loaded){return}var j="";for(var i in this.settings){if(this.settings.hasOwnProperty(i)){j+=i+" "+this.settings[i]+"\n"
-}}d.get("files").saveFile(d.userSettingsProject,{name:"settings",content:j,timestamp:new Date().getTime()})
-},_load:function(){var j=this;var i=function(){if(!j.loaded){j.loaded=true}};var k=function(m){m.content.split(/\n/).forEach(function(n){if(n.match(/^\s*#/)){return
-}if(n.match(/\S+\s+\S+/)){var o=n.split(/\s+/);j.settings[o[0].trim()]=o[1].trim()
-}});for(var l in j.settings){d.publish("settings:set:"+l,{value:j.settings[l]})}i()
-};d.fireAfter(["authenticated"],function(){d.get("files").loadContents(d.userSettingsProject,"settings",k,i)
-})}});c.URL=h.Object.extend({init:function(i){this.results=b.queryToObject(this.stripHash(i||window.location.hash))
-},getValue:function(i){return this.results[i]},setValue:function(i,j){this.results[i]=j
-},stripHash:function(i){var j=i.split("");j.shift();return j.join("")}})});tiki.module("bespin:syntax",function(d,a,e){var c=d("package");
-var h=d("sproutcore/runtime:package").SC;a.Model=h.Object.extend({language:"",lineCache:[],invalidateCache:function(i){delete this.lineCache[i]
-},invalidateEntireCache:function(){this.lineCache=[]},addToCache:function(i,j){this.lineCache[i]=j
-},getFromCache:function(i){return this.lineCache[i]},mergeSyntaxResults:function(m){var k=0;
-for(var j=0;j<m.length;j++){var l=l[j]}},getSyntaxStylesPerLine:function(j,i,k){return{text:j,regions:[{plain:[{start:0,stop:j.length}]}]}
-},getSyntaxStyles:function(m,l,o,n){var k={};for(var j=l;j<=o;j++){k[j]=this.getSyntaxStylesPerLine(m[j],j,n)
-}return k}});var g,b;var f={};a.Resolver={setEngine:function(i){var j=f[i];if(i==g){return this
-}if(j){g=i;if(b){delete b}if(j.worker){}else{b=new f[i].Model();b.workerEnabled=false
-}}else{console.log("no such engine: ",i)}return this},getModel:function(){return b
-}}});tiki.module("bespin:theme",function(b,a,c){var d=b("sproutcore/runtime:package").SC;
-a.coffee={backgroundStyle:"#2A211C",gutterStyle:"#4c4a41",lineNumberColor:"#e5c138",lineNumberFont:"10pt Monaco, Lucida Console, monospace",lineMarkerErrorColor:"#CC4444",lineMarkerWarningColor:"#B8860B",lineMarkerMessageColor:"green",zebraStripeColor:"#2A211C",highlightCurrentLineColor:"#3a312b",editorTextFont:"10pt Monaco, Lucida Console, monospace",editorTextColor:"rgb(230, 230, 230)",editorSelectedTextColor:"rgb(240, 240, 240)",editorSelectedTextBackground:"#526DA5",cursorStyle:"#879aff",cursorType:"ibeam",unfocusedCursorStrokeStyle:"#FF0033",unfocusedCursorFillStyle:"#73171E",partialNibStyle:"rgba(100, 100, 100, 0.3)",partialNibArrowStyle:"rgba(255, 255, 255, 0.3)",partialNibStrokeStyle:"rgba(150, 150, 150, 0.3)",fullNibStyle:"rgb(100, 100, 100)",fullNibArrowStyle:"rgb(255, 255, 255)",fullNibStrokeStyle:"rgb(150, 150, 150)",scrollTrackFillStyle:"rgba(50, 50, 50, 0.8)",scrollTrackStrokeStyle:"rgb(150, 150, 150)",scrollBarFillStyle:"rgba(0, 0, 0, %a)",scrollBarFillGradientTopStart:"rgba(90, 90, 90, %a)",scrollBarFillGradientTopStop:"rgba(40, 40, 40, %a)",scrollBarFillGradientBottomStart:"rgba(22, 22, 22, %a)",scrollBarFillGradientBottomStop:"rgba(44, 44, 44, %a)",tabSpace:"#392A25",searchHighlight:"#B55C00",searchHighlightSelected:"#FF9A00",plain:"#bdae9d",keyword:"#42a8ed",string:"#039a0a",comment:"#666666","c-comment":"#666666",punctuation:"#888888",attribute:"#BF9464",test:"rgb(255,0,0)",cdata:"#bdae9d","attribute-value":"#039a0a",tag:"#46a8ed",color:"#c4646b","tag-name":"#46a8ed",value:"#039a0a",important:"#990000",sizes:"#990000",cssclass:"#BF9464",cssid:"#46a8ed",atom:"#aa4444",variable:"#00cccc",variabledef:"#4422cc",localvariable:"#cc2277",property:"#66bb33",operator:"#88bbff",error:"#FF0000",processing:"#999999",entity:"#AA2222",text:"#00BB00","compile-time-constant":"#776088","predefined-constant":"#33CC33","reserved-language-construct":"#00FF00","predefined-function":"#22FF22","predefined-class":"#22FF22",literal:"#DD4411",identifier:"#22FF22",func:"#2200FF",type:"#8822FF",decorator:"#2222FF"};
-a.coffeezebra={};d.mixin(a.coffeezebra,a.coffee);a.coffeezebra.zebraStripeColor="#FFFFFF";
-a["default"]=a.coffee});tiki.module("bespin:util/bootstrap_worker",function(require,exports,module){var NATIVE_JSON=this.JSON?true:false;
-var __GLOBAL__=this;if(!__GLOBAL__.console){__GLOBAL__.console={log:function(msg){postMessage("log="+msg)
-}}}var loadDone=function(){if(theObject.initialize){theObject.initialize()}};var internalMessageIdentifier="__IMPORT_SCRIPT__";
-var SCRIPT_COUNT=0;var LOADED_SCRIPTS=0;var EMULATE_LOAD=false;if(typeof google!="undefined"&&google.gears&&google.gears.workerPool){var wp=google.gears.workerPool;
-wp.onmessage=function(a,b,message){var sender=message.sender;postMessage=function(data){wp.sendMessage(data,sender)
-};onmessage({data:message.body})};__GLOBAL__.importScripts=function(){var global=this;
-var src="";var i=0;var load=function(url,callback){var request=google.gears.factory.create("beta.httprequest");
-request.open("GET",url);request.onreadystatechange=function(){if(request.readyState==4){if(request.status>=200&&request.status<400){var res=request.responseText;
-src+=res+"\n";callback()}else{throw new Error("Error fetching script "+url+". Response code: "+request.status+" Response text: "+request.responseText)
-}}};request.send()};var urls=Array.prototype.splice.call(arguments,0);var loader=function(){var url=urls.shift();
-if(url){load(url,loader)}else{try{global.eval(src)}catch(e){console.log("Error evaluating source ",e)
-}loadDone()}};loader()}}if(typeof importScripts=="undefined"){EMULATE_LOAD=true;var loadCounter=0;
-__GLOBAL__.importScripts=function(){for(var i=0;i<arguments.length;++i){var script=arguments[i];
-postMessage(internalMessageIdentifier+"["+(SCRIPT_COUNT++)+", '"+script+"']");++loadCounter
-}};var loaded=[];var nextLoad=0;__GLOBAL__.__evalScriptFromImport=function(index,source){loaded[index]=source;
-for(var i=nextLoad;i<loaded.length;++i){if(loaded[i]){nextLoad=i+1;try{__GLOBAL__.eval(loaded[i])
-}catch(e){console.log("Error evaluating script from import: ",e)}if(loadCounter==i){loadDone()
-}}else{break}}}}if(!NATIVE_JSON){origPostMessage=postMessage;postMessage=function(data){if(typeof data!="string"){data=JSON.stringify(data)
-}origPostMessage(data)}}onmessage=function(event){var body=event.data;var dataIsString=false;
-if(typeof body=="string"){if(body.indexOf("// YOUcannotGuessMe")==0){if(EMULATE_LOAD){__GLOBAL__.__evalScriptFromImport(SCRIPT_COUNT++,body)
-}else{try{__GLOBAL__.eval(body)}catch(e){console.log("Unable to evaluate onmessage() "+e)
-}loadDone()}return}else{if(body.indexOf("__IMPORT_SCRIPT__")==0){var source=body.substr("__IMPORT_SCRIPT__".length);
-var match=source.match(/^\/\/(\d+)/);if(match){var index=parseInt(match[1],10);__evalScriptFromImport(index,source)
-}return}else{dataIsString=true;try{body=JSON.parse(body)}catch(e){throw e+""+body
-}}}}if(body.event){bespin.receive(body);return}var method=body.method;var o=theObject;
-var ret=o[body.method].apply(o,body.paras);var data={method:body.method,returnValue:ret,callIndex:body.callIndex};
-postMessage(data)};var eventIndex=0;var eventCallbacks=[];bespin={subscribe:function(name,callback){postMessage({type:"subscribe",name:name,index:eventIndex});
-eventCallbacks[eventIndex]=function(){callback.apply(this,arguments)};eventIndex++
-},publish:function(name,event){postMessage({type:"publish",name:name,event:event})
-},receive:function(info){eventCallbacks[info.index](info.event)}};if(!this.JSON){JSON=function(){function f(n){return n<10?"0"+n:n
-}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"
-};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
-function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];
-if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)
-})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);
-case"object":if(!value){return"null"}if(typeof value.toJSON==="function"){return stringify(value.toJSON())
-}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;
-for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||"null")}return"["+a.join(",")+"]"
-}if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==="string"){v=stringify(value[k],whitelist);
-if(v){a.push(stringify(k)+":"+v)}}}}else{for(k in value){if(typeof k==="string"){v=stringify(value[k],whitelist);
-if(v){a.push(stringify(k)+":"+v)}}}}return"{"+a.join(",")+"}"}}return{stringify:stringify,parse:function(text,filter){var j;
-function walk(k,v){var i,n;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);
-if(n!==undefined){v[i]=n}else{delete v[i]}}}}return filter(k,v)}if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");
-return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")
-}}}()}});tiki.module("bespin:util/canvas",function(b,a,c){a.fix=function(d){if(!d.fillText&&d.mozDrawText){d.fillText=function(g,e,h,f){d.translate(e,h);
-d.mozTextStyle=d.font;d.mozDrawText(g);d.translate(-e,-h)}}if(!d.measureText&&d.mozMeasureText){d.measureText=function(f){if(d.font){d.mozTextStyle=d.font
-}var e=d.mozMeasureText(f);return{width:e}}}if(d.measureText&&!d.html5MeasureText){d.html5MeasureText=d.measureText;
-d.measureText=function(f){var e=d.html5MeasureText(f);e.ascent=d.html5MeasureText("m").width;
-return e}}if(!d.fillText){d.fillText=function(){}}if(!d.measureText){d.measureText=function(){return 10
-}}return d}});tiki.module("bespin:util/clipboard",function(d,f,b){var c=d("sproutcore/runtime:package").SC;
-var h=d("util/util");var j=d("util/keys");var e=null;f.setup=function(k){if(e){e.uninstall()
-}if(false&&h.isWebKit){e=a.create({editorWrapper:k});e.install()}else{e=i.create({editorWrapper:k});
-e.install()}};var g=c.Object.extend({_hasFocus:false,init:function(){this.textarea=document.createElement("textarea");
-this.textarea.className="bespin-clipboardproxy";this.textarea.tabIndex=-1;this.textarea.style.position="absolute";
-this.textarea.style.zIndex="999";this.textarea.style.top="-10000px";this.textarea.style.width=0;
-this.textarea.style.height=0;document.body.appendChild(this.textarea)},takeFocus:function(k){k=k||"Hello";
-this.textarea.value=k;this.textarea.focus();this.textarea.select();this._hasFocus=true
-},hasFocus:function(k){return this._hasFocus},focusLost:function(){this._hasFocus=false
-},getValue:function(){return this.textarea.value},dispose:function(){document.body.removeChild(this.textarea)
-}});var a=c.Object.extend({editorWrapper:null,install:function(){var m=g.create();
-var l=document;var k=function(q){if(!this.editorWrapper.hasFocus()){return}q.preventDefault();
-m.takeFocus()}.bind(this);l.addEventListener("beforecopy",k,false);l.addEventListener("beforecut",k,false);
-var n=function(q){if(!m.hasFocus()){return}var r=this.editorWrapper.getSelection();
-if(r&&r!=""){q.clipboardData.setData("text/plain",r)}console.log("onCopy",q,r);this.editorWrapper.focus();
-m.focusLost();h.stopEvent(q)}.bind(this);l.addEventListener("copy",n);var o=function(q){if(!m.hasFocus()){return
-}var r=this.editorWrapper.removeSelection();if(r){q.clipboardData.setData("text/plain",r)
-}console.log("onCut",q,r);this.editorWrapper.focus();m.focusLost();h.stopEvent(q)
-}.bind(this);l.addEventListener("cut",o);var p=function(q){if(!this.editorWrapper.hasFocus()){return
-}var r=q.clipboardData.getData("text/plain");this.editorWrapper.replaceSelection(r);
-console.log("onPaste",q,r);this.editorWrapper.focus();m.focusLost();h.stopEvent(q)
-}.bind(this);l.addEventListener("paste",p);this.uninstall=function(){l.removeEventListener("beforecopy",k,false);
-l.removeEventListener("beforecut",k,false);l.removeEventListener("beforepaste",k,false);
-l.removeEventListener("copy",n,false);l.removeEventListener("cut",o,false);l.removeEventListener("paste",p,false);
-m.dispose()}},uninstall:function(){}});var i=c.Object.extend({editorWrapper:null,install:function(){this.proxy=g.create();
-var k=function(m){var n;if((h.isMac&&m.metaKey)||m.ctrlKey){if(m.keyCode==j.Key.C){n=this.editorWrapper.getSelection();
-if(n&&n!=""){this.copyToClipboard(n)}}else{if(m.keyCode==j.Key.X){n=this.editorWrapper.removeSelection();
-this.copyToClipboard(n)}else{if(m.keyCode==j.Key.V){this.pasteFromClipboard()}}}}}.bind(this);
-var l=this.editorWrapper.getFocusElement();l.addEventListener("keydown",k,false);
-this.uninstall=function(){l.removeEventListener("keydown",k,false);this.proxy.dispose()
-}},copyToClipboard:function(k){this.proxy.takeFocus(k);setTimeout(function(){this.editorWrapper.focus()
-}.bind(this),10)},pasteFromClipboard:function(){this.proxy.takeFocus();setTimeout(function(){var k=this.proxy.getValue();
-this.editorWrapper.replaceSelection(k);this.editorWrapper.focus()}.bind(this),0)},uninstall:function(){}});
-f.manual=function(){var l;var k=window.netscape?netscape.security.PrivilegeManager:null;
-return{copy:function(r){try{if(k.enablePrivilege){k.enablePrivilege("UniversalXPConnect")
-}else{l=r;return}}catch(n){l=r;return}var q=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
-q.data=r;var m=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
-if(!m){return false}m.addDataFlavor("text/unicode");m.setTransferData("text/unicode",q,r.length*2);
-var p=Components.interfaces.nsIClipboard;var o=Components.classes["@mozilla.org/widget/clipboard;1"].getService(p);
-if(!o){return false}o.setData(m,null,p.kGlobalClipboard)},data:function(){try{if(privilegeManager.enablePrivilege){privilegeManager.enablePrivilege("UniversalXPConnect")
-}else{return l}}catch(n){return l}var p=Components.classes["@mozilla.org/widget/clipboard;1"].getService(Components.interfaces.nsIClipboard);
-if(!p){return false}var m=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
-if(!m){return false}m.addDataFlavor("text/unicode");p.getData(m,p.kGlobalClipboard);
-var r={};var o={};var q="";m.getTransferData("text/unicode",r,o);if(r){r=r.value.QueryInterface(Components.interfaces.nsISupportsString)
-}if(r){q=r.data.substring(0,o.value/2)}return q}}}()});tiki.module("bespin:util/container",function(d,b,e){var a=d("util/util");
-var c={};b.register=function(j,m){c[j]=m;console.log("container.register",j,m);if(m.requires){var k={};
-for(var p in m.requires){if(m.requires.hasOwnProperty(p)){var i=m.requires[p];k[p]=i
-}}var n=function(){var r=0;for(var q in k){if(m.requires.hasOwnProperty(p)){r++}}if(r==0){if(m.afterContainerSetup){m.afterContainerSetup()
-}}};n();for(var p in k){if(m.requires.hasOwnProperty(p)){var i=k[p];var l=function(q){m[p]=q;
-b.register(i,q);delete k[p];n()};var h=m.requires[i];var o=b.get(h);if(o){l(o)}else{g(i,l)
-}}}}return m};b.unregister=function(h){delete c[h]};b.get=function(h){return c[h]
-};b.getComponent=function(l,k,i){i=i||window;var h=b.get(l);if(h){k.call(i,h)}else{var j=function(m){b.register(l,m);
-k.call(i,m)};g(l,j)}};b.dummyFactory=function(h){h({})};var f=d;function g(m,j){var h=b.factories[m];
-if(!h){console.error("No component ",m)}else{if(a.isFunction(h)){h(j)}else{var k=h.split(":");
-if(k.length!=2){console.error("Can't split ",h,"into 2 parts on ':'")}else{var i=f(k[0]);
-var l=i[k[1]];if(a.isFunction(l)){l(j)}else{j(l)}}}}}b.factories={settings:"settings:factory",session:"util/container:dummyFactory",file:"util/container:dummyFactory",popup:function(h){b.plugins.loadOne("popup",function(i){h(new i.Window())
-})},piemenu:function(h){b.plugins.loadOne("piemenu",function(j){var i=new j.Window();
-setTimeout(function(){h(i)},25)})},commandLine:function(h){h({})},debugbar:function(h){b.plugins.loadOne("debugbar",function(i){h(new i.EvalCommandLineInterface("debugbar_command",null,{idPrefix:"debugbar_",parentElement:document.getElementById("debugbar")}))
-})},breakpoints:function(h){b.plugins.loadOne("breakpoints",function(i){h(new i())
-})}}});tiki.module("bespin:util/cookie",function(c,b,d){var a=function(f,e){return f.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(g){if(e&&e.indexOf(g)!=-1){return g
-}return"\\"+g})};b.get=function(e){var g=new RegExp("(?:^|; )"+a(e)+"=([^;]*)");var f=document.cookie.match(g);
-return f?decodeURIComponent(f[1]):undefined};b.set=function(g,j,h){h=h||{};if(typeof h.expires=="number"){var f=new Date();
-f.setTime(f.getTime()+h.expires*24*60*60*1000);h.expires=f}if(h.expires&&h.expires.toUTCString){h.expires=h.expires.toUTCString()
-}j=encodeURIComponent(j);var e=g+"="+j,i;for(i in h){e+="; "+i;var k=h[i];if(k!==true){e+="="+k
-}}document.cookie=e};b.remove=function(e){b.set(e,"",{expires:-1})};b.isSupported=function(){if(!("cookieEnabled" in navigator)){b.set("__djCookieTest__","CookiesAllowed");
-navigator.cookieEnabled=b.get("__djCookieTest__")=="CookiesAllowed";if(navigator.cookieEnabled){b.remove("__djCookieTest__")
-}}return navigator.cookieEnabled}});tiki.module("bespin:util/globals",function(b,a,d){var e=b("sproutcore/runtime:package").SC;
-if(!Array.isArray){Array.isArray=function(f){return(f&&Object.prototype.toString.call(f)=="[object Array]")
-}}e.Object.prototype.sc_super=function c(){c.caller.base.apply(this,c.caller.arguments)
-}});tiki.module("bespin:util/hub",function(b,a,d){var e={};var c={};a.publish=function(g,f){if(window.globalStorage&&window.globalStorage[location.hostname]&&window.globalStorage[location.hostname].debug){console.log("Publish",g,f)
-}c[g]=true;var g="bespin:"+g;f=Array.isArray(f)?f:[f||{}];var h=e[g];if(h){h.apply(null,f)
-}};a.subscribe=function(f,l,h){var f="bespin:"+f;var g=l.bind(h);var j=e[f];if(!j||!j._listeners){var i=j;
-var j=function(){var n=arguments.callee._listeners;var p=arguments.callee.target;
-var o=p&&p.apply(this,arguments);var n=[].concat(n);for(var m in n){if(!(m in Array.prototype)){n[m].apply(this,arguments)
-}}return o};j.target=i;j._listeners=[];e[f]=j}var k=j._listeners.push(g);return[f,k]
-};a.unsubscribe=function(i){if(i){var f=i[0];var h=i[1];var g=e[f];if(g&&g._listeners&&h--){delete g._listeners[h]
-}}};a.fireAfter=function(l,k){if(!Array.isArray(l)){throw new Error("fireAfter() takes an array of topics. '"+l+"' is not an array.")
-}var j=l.length;var f=function(){if(j==0){k()}};for(var h=0;h<l.length;++h){var g=l[h];
-if(c[g]){--j}else{a.subscribe(g,function(){--j;f()})}f()}}});tiki.module("bespin:util/keys",function(d,c,f){var a=d("util/util");
-c.Key={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:a.isSafari?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:a.isMac&&!a.isAIR?(a.isSafari?91:224):17,FORWARD_SLASH:191,TILDE:192,SQUARE_BRACKET_OPEN:219,BACK_SLASH:220,SQUARE_BRACKET_CLOSE:221,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90};
-c.KeyCodeToName={};for(var e in c.Key){var g=c.Key[e];if(typeof g=="number"){c.KeyCodeToName[g]=e
-}}c.toKeyCode=function(h){return c.Key[h.toUpperCase()]};c.fillArguments=function(i,h){var j=i.split(" ");
-h=h||{};h.key=j.pop();if(j.length==0){h.modifiers="none"}else{h.modifiers=j.join(",")
-}return h};var b=["k","l","n","o","t","w","+","-","~","0","1","2","3","4","5","6","7","8","9"];
-c.PassThroughCharCodes=b.map(function(h){return h.charCodeAt(0)});c.PassThroughKeyCodes=(function(){return[c.Key.C,c.Key.X,c.Key.V,c.Key.K,c.Key.L,c.Key.N,c.Key.O,c.Key.T,c.Key.W,c.Key.NUMPAD_PLUS,c.Key.NUMPAD_MINUS,c.Key.TILDE,c.Key.ZERO,c.Key.ONE,c.Key.TWO,c.Key.THREE,c.Key.FOUR,c.Key.FIVE,c.Key.SIX,c.Key.SEVEN,c.Key.EIGHT,c.Key.NINE]
-})();c.passThroughToBrowser=function(i){if(!i.ctrlKey){return true}else{if(i.metaKey||i.altKey||i.ctrlKey){if(i.type=="keypress"){var h=c.PassThroughCharCodes.some(function(j){return(j==i.charCode)
-});if(h){return true}}else{var h=c.PassThroughKeyCodes.some(function(j){return(j==i.keyCode)
-});if(h){return true}}}}return false}});tiki.module("bespin:util/mousewheelevent",function(b,a,c){var d=b("sproutcore/runtime:package").SC;
-d.mixin(a,{wheel:function(e){var f=0;if(!e){e=window.event}if(e.wheelDelta){f=-e.wheelDelta/40;
-if(window.opera&&window.opera.version()<9.2){f=-f}}else{if(e.detail){f=e.detail}}return f
-},axis:function(f){var e="vertical";if(f.axis){if(f.axis==f.HORIZONTAL_AXIS){e="horizontal"
-}}else{if(f.wheelDeltaY||f.wheelDeltaX){if(f.wheelDeltaX==f.wheelDelta){e="horizontal"
-}}else{if(f.shiftKey){e="horizontal"}}}return e}})});tiki.module("bespin:util/path",function(b,a,c){a.combine=function(){var d=Array.prototype.slice.call(arguments);
-var e=d.join("/");e=e.replace(/\/\/+/g,"/");e=e.replace(/^\s+|\s+$/g,"");return e
-};a.directory=function(e){var d=e.split("/");if(d.length==1){return""}else{if((d.length==2)&&d[d.length-1]==""){return e
-}else{return d.slice(0,d.length-1).join("/")}}};a.makeDirectory=function(d){if(!/\/$/.test(d)){d+="/"
-}return d};a.combineAsDirectory=function(){return this.makeDirectory(this.combine.apply(this,arguments))
-};a.escape=function(){return escape(this.combine.apply(this,arguments))};a.trimLeadingSlash=function(d){if(d.indexOf("/")==0){d=d.substring(1,d.length)
-}return d},a.fileType=function(e){if(e.indexOf(".")>=0){var d=e.split(".");if(d.length>1){return d[d.length-1]
-}}}});tiki.module("bespin:util/tokenobject",function(c,a,d){var b=c("package");a.TokenObject=SC.Object.extend({input:null,options:{},init:function(){this._splitterRegex=new RegExp(this.options.splitBy||"\\s+");
-this.pieces=this.tokenize(this.input.split(this._splitterRegex));if(this.options.params){this._nametoindex={};
-var f=this.options.params.split(" ");for(var e=0;e<f.length;e++){this._nametoindex[f[e]]=e;
-if(!this.options.noshortcutvalues){this[f[e]]=this.pieces[e]}}}arguments.callee.base.apply(this,arguments)
-},tokenize:function(f){var i=[];var e;while(e=f.shift()){if(e[0]=='"'||e[0]=="'"){var h=[e.substring(1,e.length)];
-var g;while(g=f.shift()){if(g[g.length-1]=='"'||g[g.length-1]=="'"){h.push(g.substring(0,g.length-1));
-break}else{h.push(g)}}i.push(h.join(" "))}else{i.push(e)}}return i},param:function(e){return(typeof e=="number")?this.pieces[e]:this.pieces[this._nametoindex[e]]
-},length:function(){return this.pieces.length}})});tiki.module("bespin:util/util",function(d,b,f){b.queryToObject=function(l,k){var j={};
-var i=l.split(k||"&");var m=decodeURIComponent;i.forEach(function(o){if(o.length){var p=o.split("=");
-var n=m(p.shift());var q=m(p.join("="));if(b.isString(j[n])){j[n]=[j[n]]}if(Array.isArray(j[n])){j[n].push(q)
-}else{j[n]=q}}});return j};var g=0;var a={};b.rateLimit=function(i,j,k){if(i){var l=g++;
-return function(){if(a[l]){clearTimeout(a[l])}a[l]=setTimeout(function(){k.apply(j,arguments);
-delete a[l]},i)}}};b.isString=function(i){return(typeof i=="string"||i instanceof String)
-};b.isFunction=(function(){var i=function(k){var j=typeof k;return k&&(j=="function"||k instanceof Function)&&!k.nodeType
-};return b.isSafari?function(j){if(typeof j=="function"&&j=="[object NodeList]"){return false
-}return i(j)}:i})();b.endsWith=function(j,i){return j.match(new RegExp(i+"$"))};b.include=function(j,i){return j.indexOf(i)>-1
-};b.indexOfProperty=function(m,j,l){for(var k=0;k<m.length;k++){if(m[k][j]==l){return k
-}}return null};b.last=function(i){if(Array.isArray(i)){return i[i.length-1]}};b.shrinkArray=function(k){var i=[];
-var j=true;k.reverse().forEach(function(l){if(j&&l===undefined){return}j=false;i.push(l)
-});return i.reverse()};b.makeArray=function(l,m){if(l<1){return[]}if(!m){m=" "}var j=[];
-for(var k=0;k<l;k++){j.push(m)}return j};b.repeatString=function(j,m){var l="";for(var k=0;
-k<m;k++){l+=j}return l};b.leadingSpaces=function(l){var j=0;for(var k=0;k<l.length;
-k++){if(l[k]==" "||l[k]==""||l[k]===undefined){j++}else{return j}}return j};b.leadingTabs=function(l){var k=0;
-for(var j=0;j<l.length;j++){if(l[j]=="\t"||l[j]==""||l[j]===undefined){k++}else{return k
-}}return k};b.leadingWhitespace=function(l){var k=[];for(var j=0;j<l.length;j++){if(l[j]==" "||l[j]=="\t"||l[j]==""||l[j]===undefined){k.push(l[j])
-}else{return k}}return k};b.englishFromCamel=function(i){i.replace(/([A-Z])/g,function(j){return" "+j.toLowerCase()
-}).trim()};b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"};var e=navigator.userAgent;
-var h=navigator.appVersion;b.isLinux=h.indexOf("Linux")>=0;b.isWindows=h.indexOf("Win")>=0;
-b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined;b.isChrome=parseFloat(e.split("Chrome/")[1])||undefined;
-b.isMac=h.indexOf("Macintosh")>=0;if(e.indexOf("AdobeAIR")>=0){b.isAIR=1}var c=Math.max(h.indexOf("WebKit"),h.indexOf("Safari"),0);
-if(c&&!b.isChrome){b.isSafari=parseFloat(h.split("Version/")[1]);if(!b.isSafari||parseFloat(h.substr(c+7))<=419.3){b.isSafari=2
-}}if(e.indexOf("Gecko")>=0&&!b.isWebKit){b.isMozilla=parseFloat(h)}b.getOS=function(){if(b.isMac){return b.OS.MAC
-}else{if(b.isLinux){return b.OS.LINUX}else{return b.OS.WINDOWS}}};b.contains=document.compareDocumentPosition?function(j,i){return j.compareDocumentPosition(i)&16
-}:function(j,i){return j!==i&&(j.contains?j.contains(i):true)};b.stopEvent=function(i){i.preventDefault();
-i.stopPropagation()};b.randomPassword=function(l){l=l||16;var k="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
-var j="";for(var i=0;i<l;i++){var m=Math.floor(Math.random()*k.length);j+=k.charAt(m)
-}return j};b.isEmpty=function(j){for(var i in j){if(j.hasOwnProperty(i)){return false
-}}return true};b.isMyProject=function(i){return i.indexOf("+")==-1};b.formatDate=function(i){if(!i){return"Unknown"
-}return i.getDate()+" "+b.formatDate.shortMonths[i.getMonth()]+" "+i.getFullYear()
-};b.formatDate.shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
-});tiki.script("bespin:en/614012e975a60c9ae7e6ad329e6fe36808d1e2a7/javascript.js");tiki.require("bespin:boot");
+SC.BASE_KEY_BINDINGS={escape:"cancel",backspace:"deleteBackward","delete":"deleteForward","return":"insertNewline",tab:"insertTab",left:"moveLeft",right:"moveRight",up:"moveUp",down:"moveDown",home:"moveToBeginningOfDocument",end:"moveToEndOfDocument",pagedown:"pageDown",pageup:"pageUp"};SC.CAPTURE_BACKSPACE_KEY=NO;SC.PANEL_ORDER_LAYER=4096;SC.PALETTE_ORDER_LAYER=8192;SC.POPUP_ORDER_LAYER=12288;
+SC.RootResponder=SC.RootResponder.extend({platform:"desktop",focusedPane:function(){var a=this.get("orderedPanes");return a[a.length-1]}.property("orderedPanes"),orderedPanes:null,orderBefore:function(a,b){var c=this.get("focusedPane"),d=this.get("orderedPanes").without(a),e,f,g,h=a.get("orderLayer");if(b){e=d.length;f=d.indexOf(b);g=b.get("orderLayer");if(g<h){for(;b.get("orderLayer")<h&&++f<e;)b=d[f];if(f>=e)b=null}else if(g>h){for(;b.get("orderLayer")>h&&--f>=0;)b=d[f];b=f<0?d[0]:d[f+1]}}else{for(f=
+d.length;--f>=0&&!b;){b=d[f];if(b.get("orderLayer")>h)b=null}b=f<0?d[0]:d[f+1]}if(b){f=d.indexOf(b);d.insertAt(f,a)}else d.push(a);this.set("orderedPanes",d);a=this.get("focusedPane");if(a!==c){c&&c.blurTo(a);a&&a.focusFrom(c)}return this},orderOut:function(a){var b=this.get("focusedPane"),c=this.get("keyPane");this.set("orderedPanes",this.get("orderedPanes").without(a));if(b===a){var d=this.get("focusedPane");b&&b.blurTo(d);d&&d.focusFrom(b);c===a&&this.makeKeyPane(d)}else c===a&&this.makeKeyPane(null);
+return this},init:function(){arguments.callee.base.apply(this,arguments);this.orderedPanes=[]},setup:function(){this.listenFor("keydown keyup beforedeactivate mousedown mouseup click dblclick mouseout mouseover mousemove selectstart contextmenu".w(),document).listenFor("resize focus blur".w(),window);if(this.keypress)if(SC.CAPTURE_BACKSPACE_KEY&&SC.browser.mozilla){var a=this;document.onkeypress=function(b){b=SC.Event.normalizeEvent(b);return a.keypress.call(a,b)};SC.Event.add(window,"unload",this,
+function(){document.onkeypress=null})}else SC.Event.add(document,"keypress",this,this.keypress);"drag selectstart".w().forEach(function(b){var c=this[b];if(c)if(SC.browser.msie){var d=this;document.body["on"+b]=function(){return c.call(d,SC.Event.normalizeEvent(event||window.event))};SC.Event.add(window,"unload",this,function(){document.body["on"+b]=null})}else SC.Event.add(document,b,this,c)},this);SC.Event.add(document,SC.browser.mozilla?"DOMMouseScroll":"mousewheel",this,this.mousewheel);this.set("currentWindowSize",
+this.computeWindowSize());this.focus();arguments.callee.base.apply(this,arguments)},attemptKeyEquivalent:function(a){var b=null,c=a.commandCodes()[0];if(!c)return NO;var d=this.get("keyPane"),e=this.get("mainPane"),f=this.get("mainMenu");if(d)if((b=d.performKeyEquivalent(c,a))||d.get("isModal"))return b;if(!b&&e&&e!==d)if((b=e.performKeyEquivalent(c,a))||e.get("isModal"))return b;if(!b&&f)b=f.performKeyEquivalent(c,a);return b},currentWindowSize:null,computeWindowSize:function(){var a;if(window.innerHeight)a=
+{width:window.innerWidth,height:window.innerHeight};else if(document.documentElement&&document.documentElement.clientHeight)a={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight};else if(document.body)a={width:document.body.clientWidth,height:document.body.clientHeight};return a},resize:function(){this._resize();return YES},_resize:function(){var a=this.computeWindowSize(),b=this.get("currentWindowSize");this.set("currentWindowSize",a);if(!SC.rectsEqual(a,b))if(this.panes){SC.RunLoop.begin();
+this.panes.invoke("windowSizeDidChange",b,a);SC.RunLoop.end()}},hasFocus:NO,focus:function(){if(!this.get("hasFocus")){SC.$("body").addClass("sc-focus").removeClass("sc-blur");SC.RunLoop.begin();this.set("hasFocus",YES);SC.RunLoop.end()}return YES},blur:function(){if(this.get("hasFocus")){SC.$("body").addClass("sc-blur").removeClass("sc-focus");SC.RunLoop.begin();this.set("hasFocus",NO);SC.RunLoop.end()}return YES},dragDidStart:function(a){this._drag=this._mouseDownView=a},_lastModifiers:null,_handleModifierChanges:function(a){var b;
+b=this._lastModifiers=this._lastModifiers||{alt:false,ctrl:false,shift:false};var c=false;if(a.altKey!==b.alt){b.alt=a.altKey;c=true}if(a.ctrlKey!==b.ctrl){b.ctrl=a.ctrlKey;c=true}if(a.shiftKey!==b.shift){b.shift=a.shiftKey;c=true}a.modifiers=b;return c?this.sendEvent("flagsChanged",a)?!!a.hasCustomEventHandling:YES:YES},_isFunctionOrNonPrintableKey:function(a){return!!(a.altKey||a.ctrlKey||a.metaKey||a.charCode!==a.which&&SC.FUNCTION_KEYS[a.which])},_isModifierKey:function(a){return!!SC.MODIFIER_KEYS[a.charCode]},
+keydown:function(a){if(SC.none(a))return YES;if(a.keyCode===229)return this._IMEInputON=YES;if(SC.browser.mozilla)if(SC.FUNCTION_KEYS[a.keyCode])return true;else if((a.ctrlKey||a.metaKey)&&SC.PRINTABLE_KEYS[a.keyCode])return true;var b=this._handleModifierChanges(a),c=a.target||a.srcElement;c=a.which===8&&!SC.allowsBackspaceToPreviousPage&&c===document.body;if(this._isModifierKey(a))return c?NO:b;b=YES;if(this._isFunctionOrNonPrintableKey(a)){b=this.sendEvent("keyDown",a);if(!b&&!a.hasCustomEventHandling)b=
+!this.attemptKeyEquivalent(a);else if(b=!!a.hasCustomEventHandling)c=NO}return c?NO:b},keypress:function(a){var b;if(SC.browser.mozilla)if(SC.FUNCTION_KEYS[a.keyCode]){a.which=a.keyCode;b=this.sendEvent("keyDown",a);b=!b&&!a.hasCustomEventHandling?!this.attemptKeyEquivalent(a):!!a.hasCustomEventHandling;if(a.keyCode===8)if((a.target||a.srcElement)===document.body)b=b&&SC.allowsBackspaceToPreviousPage;return b}else if((a.ctrlKey||a.metaKey)&&SC.PRINTABLE_KEYS_CHARCODE[a.charCode]){a.keyCode=SC.PRINTABLE_KEYS_CHARCODE[a.charCode];
+a.charCode=0;return this.sendEvent("keyDown",a)?!!a.hasCustomEventHandling:YES}if(a.charCode!==undefined&&a.charCode===0)return YES;return this.sendEvent("keyDown",a)?!!a.hasCustomEventHandling:YES},keyup:function(a){if(this._ffevt)this._ffevt=null;var b=this._handleModifierChanges(a);if(this._isModifierKey(a))return b;if(this._IMEInputON&&a.keyCode===13){a.isIMEInput=YES;this.sendEvent("keyDown",a);this._IMEInputON=NO}return this.sendEvent("keyUp",a)?!!a.hasCustomEventHandling:YES},beforedeactivate:function(a){if(a=
+a.toElement)if((a=SC.$(a).view()[0])&&!a.get("acceptsKeyPane")&&!a.get("acceptsFirstResponder"))return NO;return YES},mousedown:function(a){try{if(SC.browser.mozilla){window.focus();this.focus()}this._clickCount+=1;if(!this._lastMouseUpAt||Date.now()-this._lastMouseUpAt>200)this._clickCount=1;else{var b=this._lastMouseDownX-a.clientX,c=this._lastMouseDownY-a.clientY;if(Math.sqrt(b*b+c*c)>8)this._clickCount=1}a.clickCount=this._clickCount;this._lastMouseDownX=a.clientX;this._lastMouseDownY=a.clientY;
+var d,e=this.targetViewForEvent(a);if(e===undefined)return YES;if(e)d=e.getPath("pane.firstResponder");d&&d.kindOf(SC.InlineTextFieldView)&&d!==e&&d.resignFirstResponder();if((e=this._mouseDownView=this.sendEvent("mouseDown",a,e))&&e.respondsTo("mouseDragged"))this._mouseCanDrag=YES}catch(f){SC.Logger.warn("Exception during mousedown: %@".fmt(f));this._mouseDownView=null;this._mouseCanDrag=NO;throw f;}return e?!!a.hasCustomEventHandling:YES},mouseup:function(a){this.targetViewForEvent(a);try{if(this._drag){this._drag.tryToPerform("mouseUp",
+a);this._drag=null}var b=null,c=this._mouseDownView,d=this.targetViewForEvent(a);this._lastMouseUpAt=Date.now();a.clickCount=this._clickCount;if(c){b=this.sendEvent("mouseUp",a,c);if(!b&&this._clickCount===2)b=this.sendEvent("doubleClick",a,c);b||(b=this.sendEvent("click",a,c))}if(!b){if(this._clickCount===2)b=this.sendEvent("doubleClick",a,d);b||(b=this.sendEvent("click",a,d))}this._mouseCanDrag=NO;this._mouseDownView=null}catch(e){this._drag=null;this._mouseCanDrag=NO;this._mouseDownView=null;throw e;
+}return b?!!a.hasCustomEventHandling:YES},dblclick:function(a){if(SC.browser.isIE){this._clickCount=2;this.mouseup(a)}},mousewheel:function(a){try{var b=this.targetViewForEvent(a);if(b===undefined)return YES;var c=this.sendEvent("mouseWheel",a,b)}catch(d){throw d;}return c?!!a.hasCustomEventHandling:YES},_lastHovered:null,mousemove:function(a){if(SC.browser.msie)if(this._lastMoveX===a.clientX&&this._lastMoveY===a.clientY)return;this._lastMoveX=a.clientX;this._lastMoveY=a.clientY;SC.RunLoop.begin();
+try{this.focus();if(this._drag)if(SC.browser.msie)this._lastMouseDownX!==a.clientX&&this._lastMouseDownY!==a.clientY&&this._drag.tryToPerform("mouseDragged",a);else this._drag.tryToPerform("mouseDragged",a);else{for(var b=this._lastHovered||[],c=[],d,e,f,g=this.targetViewForEvent(a);g&&g!==this;){b.indexOf(g)!==-1?g.tryToPerform("mouseMoved",a):g.tryToPerform("mouseEntered",a);c.push(g);g=g.get("nextResponder")}e=0;for(f=b.length;e<f;e++){g=b[e];(d=g.respondsTo("mouseExited"))&&c.indexOf(g)===-1&&
+g.tryToPerform("mouseExited",a)}this._lastHovered=c;if(this._mouseDownView)if(SC.browser.msie)this._lastMouseDownX!==a.clientX&&this._lastMouseDownY!==a.clientY&&this._mouseDownView.tryToPerform("mouseDragged",a);else this._mouseDownView.tryToPerform("mouseDragged",a)}}catch(h){throw h;}SC.RunLoop.end()},_mouseCanDrag:YES,selectstart:function(a){var b=this.targetViewForEvent(a);a=this.sendEvent("selectStart",a,b);return b&&b.respondsTo("mouseDragged")?(a!==null?YES:NO)&&!this._mouseCanDrag:a!==null?
+YES:NO},drag:function(){return false},contextmenu:function(a){var b=this.targetViewForEvent(a);return this.sendEvent("contextMenu",a,b)}});sc_require("core");
+SC.UndoManager=SC.Object.extend({undoActionName:function(){return this.undoStack?this.undoStack.name:null}.property("undoStack"),redoActionName:function(){return this.redoStack?this.redoStack.name:null}.property("redoStack"),canUndo:function(){return this.undoStack!=null}.property("undoStack"),canRedo:function(){return this.redoStack!=null}.property("redoStack"),undo:function(){this._undoOrRedo("undoStack","isUndoing")},redo:function(){this._undoOrRedo("redoStack","isRedoing")},isUndoing:false,isRedoing:false,
+groupingLevel:0,registerUndo:function(a,b){this.beginUndoGroup(b);this._activeGroup.actions.push(a);this.endUndoGroup(b)},beginUndoGroup:function(a){if(this._activeGroup)this.groupingLevel++;else{var b=this.isUndoing?"redoStack":"undoStack";this._activeGroup={name:a,actions:[],prev:this.get(b)};this.set(b,this._activeGroup);this.groupingLevel=1}},endUndoGroup:function(){this._activeGroup||raise("endUndoGroup() called outside group.");if(this.groupingLevel>1)this.groupingLevel--;else{this._activeGroup=
+null;this.groupingLevel=0}this.propertyDidChange(this.isUndoing?"redoStack":"undoStack")},setActionName:function(a){this._activeGroup||raise("setActionName() called outside group.");this._activeGroup.name=a},_activeGroup:null,undoStack:null,redoStack:null,_undoOrRedo:function(a,b){if(this._activeGroup)return false;if(this.get(a)==null)return true;this.set(b,true);var c=this.get(a);this.set(a,c.prev);var d=c.actions.length>1;for(d&&this.beginUndoGroup(c.name);a=c.actions.pop();)a();d&&this.endUndoGroup(c.name);
+this.set(b,false)}});
+SC.CheckboxView=SC.ButtonView.extend(SC.StaticLayout,SC.Button,{classNames:["sc-checkbox-view"],tagName:"label",needsEllipsis:NO,routeTouch:NO,render:function(a,b){var c=this.get("value");c=c===SC.MIXED_MODE?"mixed":c===this.get("toggleOnValue")?"true":"false";if(b){this.get("isEnabled");var d=SC.guidFor(this);a.attr("role","checkbox");b=this._field_currentDisplayTitle=this.get("displayTitle");SC.browser.msie&&a.attr("for",d);a.push('<span class="button" ></span>');this.get("needsEllipsis")?a.push('<span class="label ellipsis">',
+b,"</span>"):a.push('<span class="label">',b,"</span>");a.attr("name",d)}else{b=this.get("displayTitle");if(b!==this._field_currentDisplayTitle){this._field_currentDisplayTitle=b;this.$("span.label").text(b)}}a.attr("aria-checked",c)},acceptsFirstResponder:function(){return SC.SAFARI_FOCUS_BEHAVIOR?NO:this.get("isEnabled")}.property("isEnabled"),mouseDown:function(){if(!this.get("isEnabled"))return YES;this.set("isActive",YES);return this._field_isMouseDown=YES},mouseUp:function(){if(!this.get("isEnabled"))return YES;
+if(this.get("value")===this.get("toggleOnValue")){this.$().attr("aria-checked","false");this.set("value",this.get("toggleOffValue"))}else{this.$().attr("aria-checked","true");this.set("value",this.get("toggleOnValue"))}this.set("isActive",NO);this._field_isMouseDown=NO;return YES}});SC.LIST_ITEM_ACTION_CANCEL="sc-list-item-cancel-action";SC.LIST_ITEM_ACTION_REFRESH="sc-list-item-cancel-refresh";SC.LIST_ITEM_ACTION_EJECT="sc-list-item-cancel-eject";
+SC.ListItemView=SC.View.extend(SC.StaticLayout,SC.Control,{classNames:["sc-list-item-view"],content:null,hasContentIcon:NO,hasContentRightIcon:NO,hasContentBranch:NO,contentCheckboxKey:null,contentIconKey:null,contentRightIconKey:null,contentValueKey:null,escapeHTML:YES,contentUnreadCountKey:null,contentIsBranchKey:null,isEditing:NO,outlineIndent:16,outlineLevel:0,disclosureState:SC.LEAF_NODE,contentPropertyDidChange:function(){this.get("contentIsEditable")!==this.contentIsEditable()&&this.notifyPropertyChange("contentIsEditable");
+this.displayDidChange()},contentIsEditable:function(){var a=this.get("content");return a&&(a.get?a.get("isEditable")!==NO:NO)}.property("content").cacheable(),render:function(a){var b=this.get("content"),c=this.displayDelegate,d=this.get("outlineLevel"),e=this.get("outlineIndent"),f,g=[];g.push(this.get("contentIndex")%2===0?"even":"odd");a.setClass("disabled",!this.get("isEnabled"));f=a.begin("div").addClass("sc-outline");d>=0&&e>0&&f.addStyle("left",e*(d+1));e=this.get("disclosureState");if(e!==
+SC.LEAF_NODE){this.renderDisclosure(f,e);g.push("has-disclosure")}if(d=this.getDelegateProperty("contentCheckboxKey",c)){e=b?b.get?b.get(d):b[d]:NO;this.renderCheckbox(f,e);g.push("has-checkbox")}if(this.getDelegateProperty("hasContentIcon",c)){e=(d=this.getDelegateProperty("contentIconKey",c))&&b?b.get?b.get(d):b[d]:null;this.renderIcon(f,e);g.push("has-icon")}if((e=(d=this.getDelegateProperty("contentValueKey",c))&&b?b.get?b.get(d):b[d]:b)&&SC.typeOf(e)!==SC.T_STRING)e=e.toString();if(this.get("escapeHTML"))e=
+SC.RenderContext.escapeHTML(e);this.renderLabel(f,e);if(this.getDelegateProperty("hasContentRightIcon",c)){e=(d=this.getDelegateProperty("contentRightIconKey",c))&&b?b.get?b.get(d):b[d]:null;this.renderRightIcon(f,e);g.push("has-right-icon")}e=(d=this.getDelegateProperty("contentUnreadCountKey",c))&&b?b.get?b.get(d):b[d]:null;if(!SC.none(e)&&e!==0){this.renderCount(f,e);d=["zero","one","two","three","four","five"];e=e.toString().length;var h=d.length;g.push("has-count "+(e<h?d[e]:d[h-1])+"-digit")}if(e=
+(d=this.getDelegateProperty("listItemActionProperty",c))&&b?b.get?b.get(d):b[d]:null){this.renderAction(f,e);g.push("has-action")}if(this.getDelegateProperty("hasContentBranch",c)){e=(d=this.getDelegateProperty("contentIsBranchKey",c))&&b?b.get?b.get(d):b[d]:NO;this.renderBranch(f,e);g.push("has-branch")}a.addClass(g);f.end()},renderDisclosure:function(a,b){b=b===SC.BRANCH_OPEN?"open":"closed";var c=this._scli_disclosureHtml,d;if(!c)c=this.constructor.prototype._scli_disclosureHtml={};(d=c[b])||(d=
+c[b]='<img src="'+SC.BLANK_IMAGE_URL+'" class="disclosure button '+b+'" />');a.push(d)},renderCheckbox:function(a,b){var c=b===SC.MIXED_STATE?"mixed":b?"sel":"nosel",d=this._scli_checkboxHtml,e=this.get("contentIsEditable")&&this.get("isEnabled"),f,g=[];e||(c=SC.keyFor("disabled",c));if(!d)d=this.constructor.prototype._scli_checkboxHtml={};f=d[c];if(!f){f=SC.RenderContext("div").attr("role","button").classNames(SC.clone(SC.CheckboxView.prototype.classNames));if(b===SC.MIXED_STATE)g.push("mixed");
+else b&&g.push("sel");e||g.push("disabled");f.addClass(g);f.push('<span class="button"></span>');f=d[c]=f.join()}a.push(f)},renderIcon:function(a,b){var c=null,d=null,e=[];if(b&&SC.ImageView.valueIsUrl(b)){c=b;d=""}else{d=b;c=SC.BLANK_IMAGE_URL}e.push(d);e.push("icon");a.begin("img").addClass(e).attr("src",c).end()},renderLabel:function(a,b){a.push("<label>",b||"","</label>")},$label:function(){return this.$("label")},renderRightIcon:function(a,b){var c=null,d=null,e=[];if(b&&SC.ImageView.valueIsUrl(b)){c=
+b;d=""}else{d=b;c=SC.BLANK_IMAGE_URL}e.push("right-icon");e.push(d);a.begin("img").addClass(e).attr("src",c).end()},renderCount:function(a,b){a.push('<span class="count"><span class="inner">',b.toString(),"</span></span>")},renderAction:function(a){a.push('<img src="',SC.BLANK_IMAGE_URL,'" class="action" />')},renderBranch:function(a,b){var c=[];c.push("branch");c.push(b?"branch-visible":"branch-hidden");a.begin("span").addClass(c).push("&nbsp;").end()},_isInsideElementWithClassName:function(a,b){var c=
+this.get("layer");if(!c)return NO;b=SC.$(b.target);for(var d=NO;!d&&b.length>0&&b[0]!==c;){if(b.hasClass(a))d=YES;b=b.parent()}return d},_isInsideCheckbox:function(a){return this.getDelegateProperty("contentCheckboxKey",this.displayDelegate)&&this._isInsideElementWithClassName("sc-checkbox-view",a)},_isInsideDisclosure:function(a){if(this.get("disclosureState")===SC.LEAF_NODE)return NO;return this._isInsideElementWithClassName("disclosure",a)},_isInsideRightIcon:function(a){return this.getDelegateProperty("hasContentRightIcon",
+this.displayDelegate)&&this._isInsideElementWithClassName("right-icon",a)},mouseDown:function(a){if(!this.get("contentIsEditable"))return NO;if(this._isInsideCheckbox(a)){this._addCheckboxActiveState();return this._isMouseInsideCheckbox=this._isMouseDownOnCheckbox=YES}else if(this._isInsideDisclosure(a)){this._addDisclosureActiveState();return this._isMouseInsideDisclosure=this._isMouseDownOnDisclosure=YES}else if(this._isInsideRightIcon(a)){this._addRightIconActiveState();return this._isMouseInsideRightIcon=
+this._isMouseDownOnRightIcon=YES}return NO},mouseUp:function(a){var b=NO,c;if(this._isMouseDownOnCheckbox){if(this._isInsideCheckbox(a)){b=this.displayDelegate;a=this.getDelegateProperty("contentCheckboxKey",b);if((b=this.get("content"))&&b.get){c=b.get(a);c=c===SC.MIXED_STATE?YES:!c;b.set(a,c);this.displayDidChange()}}this._removeCheckboxActiveState();b=YES}else if(this._isMouseDownOnDisclosure){if(this._isInsideDisclosure(a)){a=this.get("disclosureState");b=this.get("contentIndex");c=!SC.none(b)?
+SC.IndexSet.create(b):null;b=this.get("displayDelegate");if(a===SC.BRANCH_OPEN){c&&b&&b.collapse?b.collapse(c):this.set("disclosureState",SC.BRANCH_CLOSED);this.displayDidChange()}else if(a===SC.BRANCH_CLOSED){c&&b&&b.expand?b.expand(c):this.set("disclosureState",SC.BRANCH_OPEN);this.displayDidChange()}}this._removeDisclosureActiveState();b=YES}else if(this._isMouseDownOnRightIcon){this._removeRightIconActiveState();b=YES}this._isMouseInsideRightIcon=this._isMouseDownOnRightIcon=this._isMouseDownOnDisclosure=
+this._isMouseInsideDisclosure=this._isMouseInsideCheckbox=this._isMouseDownOnCheckbox=NO;return b},mouseExited:function(){if(this._isMouseDownOnCheckbox){this._removeCheckboxActiveState();this._isMouseInsideCheckbox=NO}else if(this._isMouseDownOnDisclosure){this._removeDisclosureActiveState();this._isMouseInsideDisclosure=NO}else if(this._isMouseDownOnRightIcon){this._removeRightIconActiveState();this._isMouseInsideRightIcon=NO}return NO},mouseEntered:function(){if(this._isMouseDownOnCheckbox){this._addCheckboxActiveState();
+this._isMouseInsideCheckbox=YES}else if(this._isMouseDownOnDisclosure){this._addDisclosureActiveState();this._isMouseInsideDisclosure=YES}else if(this._isMouseDownOnRightIcon){this._addRightIconActiveState();this._isMouseInsideRightIcon=YES}return NO},_addCheckboxActiveState:function(){var a=this.get("isEnabled");this.$(".sc-checkbox-view").setClass("active",a)},_removeCheckboxActiveState:function(){this.$(".sc-checkbox-view").removeClass("active")},_addDisclosureActiveState:function(){var a=this.get("isEnabled");
+this.$("img.disclosure").setClass("active",a)},_removeDisclosureActiveState:function(){this.$("img.disclosure").removeClass("active")},_addRightIconActiveState:function(){this.$("img.right-icon").setClass("active",YES)},_removeRightIconActiveState:function(){this.$("img.right-icon").removeClass("active")},contentHitTest:function(a){if(!this.getDelegateProperty("contentValueKey",this.displayDelegate))return NO;var b=this.$label()[0];if(!b)return NO;a=a.target;for(var c=this.get("layer");a&&a!==c&&
+a!==window;){if(a===b)return YES;a=a.parentNode}return NO},beginEditing:function(){if(this.get("isEditing"))return YES;return this._beginEditing(YES)},_beginEditing:function(a){var b=this.get("content"),c=this.getDelegateProperty("contentValueKey",this.get("displayDelegate")),d=this.get("parentView");d&&d.get("frame");var e=this.$label(),f,g,h,j;if(a&&this.scrollToVisible()){var k=this.get("owner"),l=this.get("contentIndex");this.invokeLast(function(){var m=k.itemViewForContentIndex(l);m&&m._beginEditing&&
+m._beginEditing(NO)});return YES}if(!d||!e||e.get("length")===0)return NO;c=c&&b&&b.get?b.get(c):null;b=this.computeFrameWithParentFrame(null);d=SC.viewportOffset(e[0]);a=e.css("lineHeight");f=e.css("fontSize");g=(g=this.$().css("top"))?parseInt(g.substring(0,g.length-2),0):0;h=a;j=0;if(f&&h){f=f*1.5;if(f<h){e.css({lineHeight:"1.5"});j=(h-f)/2}else a=null}b.x=d.x;b.y=d.y+g+j;b.height=e[0].offsetHeight;b.width=e[0].offsetWidth;b=SC.InlineTextFieldView.beginEditing({frame:b,exampleElement:e,delegate:this,
+value:c,multiline:NO,isCollection:YES});a&&e.css({lineHeight:a});return b},commitEditing:function(){if(!this.get("isEditing"))return YES;return SC.InlineTextFieldView.commitEditing()},discardEditing:function(){if(!this.get("isEditing"))return YES;return SC.InlineTextFieldView.discardEditing()},inlineEditorShouldBeginEditing:function(){return YES},inlineEditorWillBeginEditing:function(){this.set("isEditing",YES)},inlineEditorDidBeginEditing:function(){var a=this.$label();this._oldOpacity=a.css("opacity");
+a.css("opacity",0)},inlineEditorShouldEndEditing:function(){return YES},inlineEditorDidEndEditing:function(a,b){this.set("isEditing",NO);a=this.get("content");var c=this.getDelegateProperty("contentValueKey",this.displayDelegate);c&&a&&a.set&&a.set(c,b);this.displayDidChange()}});sc_require("mixins/collection_view_delegate");sc_require("views/list_item");SC.DRAG_REORDER=16;SC.HORIZONTAL_ORIENTATION="horizontal";SC.VERTICAL_ORIENTATION="vertical";SC.BENCHMARK_RELOAD=NO;
+SC.CollectionView=SC.View.extend(SC.CollectionViewDelegate,SC.CollectionContent,{classNames:["sc-collection-view"],ACTION_DELAY:200,content:null,contentBindingDefault:SC.Binding.multiple(),length:0,nowShowing:function(){return this.computeNowShowing()}.property("length","clippingFrame").cacheable(),selection:null,isSelectable:YES,isSelectableBindingDefault:SC.Binding.bool(),isEnabled:YES,isEnabledBindingDefault:SC.Binding.bool(),isEditable:YES,isEditableBindingDefault:SC.Binding.bool(),canReorderContent:NO,
+canReorderContentBindingDefault:SC.Binding.bool(),canDeleteContent:NO,canDeleteContentBindingDefault:SC.Binding.bool(),canEditContent:NO,canEditContentBindingDefault:SC.Binding.bool(),isDropTarget:NO,useToggleSelection:NO,actOnSelect:NO,selectOnMouseDown:YES,exampleView:SC.ListItemView,contentExampleViewKey:null,groupExampleView:null,contentGroupExampleViewKey:null,action:null,target:null,contentValueKey:null,acceptsFirstResponder:NO,isActive:NO,calculatedHeight:0,calculatedWidth:0,computeLayout:function(){return null},
+layoutForContentIndex:function(){return null},allContentIndexes:function(){return SC.IndexSet.create(0,this.get("length")).freeze()}.property("length").cacheable(),contentIndexesInRect:function(){return null},computeNowShowing:function(){var a=this.contentIndexesInRect(this.get("clippingFrame"));if(a){var b=this.get("length"),c=a.get("max");if(c>b)a=a.copy().remove(b,c-b).freeze()}else a=this.get("allContentIndexes");return a},showInsertionPoint:function(){},hideInsertionPoint:function(){},delegate:null,
+selectionDelegate:function(){var a=this.get("delegate"),b=this.get("content");return this.delegateFor("isCollectionViewDelegate",a,b)}.property("delegate","content").cacheable(),contentDelegate:function(){var a=this.get("delegate"),b=this.get("content");return this.delegateFor("isCollectionContent",a,b)}.property("delegate","content").cacheable(),_contentGroupIndexes:function(){return this.get("contentDelegate").contentGroupIndexes(this,this.get("content"))}.property("contentDelegate","content").cacheable(),
+contentRangeDidChange:function(a,b,c,d){!b&&c==="[]"?this.reload(d):this.contentPropertyDidChange(b,c,d)},contentPropertyDidChange:function(){},updateContentRangeObserver:function(){var a=this.get("nowShowing"),b=this._cv_contentRangeObserver,c=this.get("content");if(c)if(b)c.updateRangeObserver(b,a);else this._cv_contentRangeObserver=b=c.addRangeObserver(a,this,this.contentRangeDidChange,null)},removeContentRangeObserver:function(){var a=this.get("content"),b=this._cv_contentRangeObserver;if(b){a&&
+a.removeRangeObserver(b);this._cv_contentRangeObserver=null}},contentLengthDidChange:function(){var a=this.get("content");this.set("length",a?a.get("length"):0)},_cv_contentDidChange:function(){var a=this.get("content"),b=this.contentLengthDidChange;if(a!==this._content){this.removeContentRangeObserver();this._content&&this._content.removeObserver("length",this,b);(this._content=a)&&a.addObserver("length",this,b);this.contentLengthDidChange();this.contentRangeDidChange(a,null,"[]",null)}}.observes("content"),
+_invalidIndexes:NO,reload:function(a){var b=this._invalidIndexes;if(a&&b!==YES)if(b)b.add(a);else this._invalidIndexes=a.clone();else this._invalidIndexes=YES;this.get("isVisibleInWindow")&&this.invokeOnce(this.reloadIfNeeded);return this},reloadIfNeeded:function(){var a=this._invalidIndexes;if(!a||!this.get("isVisibleInWindow"))return this;this._invalidIndexes=NO;var b=this.get("content"),c,d,e,f=this.computeLayout(),g=SC.BENCHMARK_RELOAD,h=this.get("nowShowing"),j=this._sc_itemViews,k=this.get("containerView")||
+this,l,m,n,o,q,t,r,s,v;if(a.isIndexSet&&a.contains(h))a=YES;if(this.willReload)this.willReload(a===YES?null:a);l=(l=this.get("exampleView"))?l.isReusableInCollections:NO;m=(c=this.get("exampleGroupView"))?c.isReusableInCollections:NO;if(a.isIndexSet){if(g)SC.Benchmark.start(g="%@#reloadIfNeeded (Partial)".fmt(this),YES);o=[];q=[];t=[];a.forEach(function(w){e=j?j[w]:null;if(h.contains(w))e&&e.parentView===k?q.push(w):t.push(w);else e&&e.parentView===k&&o.push(w)},this);c=0;for(d=o.length;c<d;++c){n=
+o[c];e=j?j[n]:null;delete j[n];v=this.get("contentDelegate");if(s=(s=this.get("_contentGroupIndexes"))&&s.contains(n))s=v.contentIndexIsGroup(this,b,n);if(n=s?m:l){s=s?this._GROUP_VIEW_POOL:this._VIEW_POOL;s.push(e);e.destroyLayer()}k.removeChild(e)}c=0;for(d=q.length;c<d;++c){n=q[c];e=j?j[n]:null;b=this.itemViewForContentIndex(n,YES);e.destroyLayer();k.replaceChild(b,e)}c=0;for(d=t.length;c<d;++c){n=t[c];b=this.itemViewForContentIndex(n,YES);k.insertBefore(b,null)}}else{if(g)SC.Benchmark.start(g=
+"%@#reloadIfNeeded (Full)".fmt(this),YES);if(j)j.length=0;if(r=k.get("childViews"))r=r.copy();k.beginPropertyChanges();k.destroyLayer().removeAllChildren();if(r){c=0;for(d=r.length;c<d;++c){b=r[c];if(n=(s=b.get("isGroupView"))?m:l){s=s?this._GROUP_VIEW_POOL:this._VIEW_POOL;s.push(b);b.destroyLayer()}}}r=[];h.forEach(function(w){r.push(this.itemViewForContentIndex(w,YES))},this);k.set("childViews",r);k.replaceLayer();k.endPropertyChanges()}g&&SC.Benchmark.end(g);f&&this.adjust(f);if(this.didReload)this.didReload(a===
+YES?null:a);return this},displayProperties:"isFirstResponder isEnabled isActive".w(),render:function(a,b){b&&this._needsReload&&this.reloadIfNeeded();a.setClass("focus",this.get("isFirstResponder"));a.setClass("disabled",!this.get("isEnabled"));a.setClass("active",this.get("isActive"));return arguments.callee.base.apply(this,arguments)},_TMP_ATTRS:{},_COLLECTION_CLASS_NAMES:"sc-collection-item".w(),_GROUP_COLLECTION_CLASS_NAMES:"sc-collection-item sc-group-item".w(),_VIEW_POOL:null,_GROUP_VIEW_POOL:null,
+itemViewForContentIndex:function(a,b){var c,d=this._sc_itemViews;if(d){if(!b&&(c=d[a]))return c}else d=this._sc_itemViews=[];var e=this.get("content");b=e.objectAt(a);var f=this.get("contentDelegate"),g=this.get("_contentGroupIndexes"),h=NO,j,k,l,m,n,o,q,t;if(h=g&&g.contains(a))h=f.contentIndexIsGroup(this,e,a);if(h){if((g=this.get("contentGroupExampleViewKey"))&&b)j=b.get(g);j||(j=this.get("groupExampleView")||this.get("exampleView"));k="_GROUP_VIEW_POOL"}else{if((g=this.get("contentExampleViewKey"))&&
+b)j=b.get(g);j||(j=this.get("exampleView"));k="_VIEW_POOL"}m=this.get("containerView")||this;g=this.layerIdFor(a);n=f.contentIndexIsEnabled(this,e,a);o=f.contentIndexIsSelected(this,e,a);q=f.contentIndexOutlineLevel(this,e,a);f=f.contentIndexDisclosureState(this,e,a);t=this.isVisibleInWindow;e=this.layoutForContentIndex(a);if(j&&j.isReusableInCollections){(l=this[k])||(l=this[k]=[]);if(l.length>0){c=l.pop();(k=c.prepareForReuse)&&k.call(c);c.beginPropertyChanges();c.set("contentIndex",a);c.set("layerId",
+g);c.set("isEnabled",n);c.set("isSelected",o);c.set("outlineLevel",q);c.set("disclosureState",f);c.set("isVisibleInWindow",t);c.set("parentView",m);SC.View.views[g]=c;e?c.set("layout",e):c.set("layout",j.prototype.layout);c.set("content",b);c.endPropertyChanges()}}if(!c){c=this._TMP_ATTRS;c.contentIndex=a;c.content=b;c.owner=c.displayDelegate=this;c.parentView=m;c.page=this.page;c.layerId=g;c.isEnabled=n;c.isSelected=o;c.outlineLevel=q;c.disclosureState=f;c.isGroupView=h;c.isVisibleInWindow=t;c.classNames=
+h?this._GROUP_COLLECTION_CLASS_NAMES:this._COLLECTION_CLASS_NAMES;if(e)c.layout=e;else delete c.layout;c=this.createItemView(j,a,c)}return d[a]=c},itemViewForContentObject:function(a){return this.itemViewForContentIndex(this.get("content").indexOf(a))},_TMP_LAYERID:[],createItemView:function(a,b,c){return a.create(c)},layerIdFor:function(a){var b=this._TMP_LAYERID;b[0]=SC.guidFor(this);b[1]=a;return b.join("-")},contentIndexForLayerId:function(a){if(!a||!(a=a.toString()))return null;var b=this._baseLayerId;
+if(!b)b=this._baseLayerId=SC.guidFor(this)+"-";if(a.length<=b.length||a.indexOf(b)!==0)return null;a=Number(a.slice(a.lastIndexOf("-")+1));return isNaN(a)?null:a},itemViewForEvent:function(a){if(!this.getPath("pane.rootResponder"))return null;SC.guidFor(this);a=a.target;for(var b=this.get("layer"),c=null,d;a&&a!==document&&a!==b;){if((d=a?SC.$(a).attr("id"):null)&&(c=this.contentIndexForLayerId(d))!==null)break;a=a.parentNode}if(c===null||a===b)return null;if(c>=this.get("length"))throw"layout for item view %@ was found when item view does not exist (%@)".fmt(d,
+this);return this.itemViewForContentIndex(c)},expand:function(a){if(!a)return this;var b=this.get("contentDelegate"),c=this.get("content");a.forEach(function(d){b.contentIndexDisclosureState(this,c,d)===SC.BRANCH_CLOSED&&b.contentIndexExpand(this,c,d)},this);return this},collapse:function(a){if(!a)return this;var b=this.get("contentDelegate"),c=this.get("content");a.forEach(function(d){b.contentIndexDisclosureState(this,c,d)===SC.BRANCH_OPEN&&b.contentIndexCollapse(this,c,d)},this);return this},_cv_selectionDidChange:function(){var a=
+this.get("selection"),b=this._cv_selection,c=this._cv_selectionContentDidChange;if(a!==b){b&&b.removeObserver("[]",this,c);a&&a.addObserver("[]",this,c);this._cv_selection=a;this._cv_selectionContentDidChange()}}.observes("selection"),_cv_selectionContentDidChange:function(){var a=this.get("selection"),b=this._cv_selindexes,c=this.get("content");this._cv_selindexes=a?a.frozenCopy():null;if(b)b=b.indexSetForSource(c);if(a)a=a.indexSetForSource(c);(a=a&&b?a.without(b).add(b.without(a)):a||b)&&a.get("length")>
+0&&this.reloadSelectionIndexes(a)},_invalidSelection:NO,reloadSelectionIndexes:function(a){var b=this._invalidSelection;if(a&&b!==YES)if(b)b.add(a);else this._invalidSelection=a.copy();else this._invalidSelection=YES;this.get("isVisibleInWindow")&&this.invokeOnce(this.reloadSelectionIndexesIfNeeded);return this},reloadSelectionIndexesIfNeeded:function(){var a=this._invalidSelection;if(!a||!this.get("isVisibleInWindow"))return this;var b=this.get("nowShowing"),c=this._invalidIndexes,d=this.get("content"),
+e=this.get("selection");this._invalidSelection=NO;if(c===YES||!b)return this;if(a===YES)a=b;if(c&&c.isIndexSet)a=a.without(c);a.forEach(function(f){if(b.contains(f)){var g=this.itemViewForContentIndex(f,NO);if(g)g.set("isSelected",e?e.contains(d,f):NO)}},this);return this},select:function(a,b){var c=this.get("content"),d=this.get("selectionDelegate"),e=this.get("_contentGroupIndexes"),f;if(!this.get("isSelectable"))return this;if(SC.typeOf(a)===SC.T_NUMBER)a=SC.IndexSet.create(a,1);if(a&&a.get("length")>
+0){if(e&&e.get("length")>0)a=a.copy().remove(e);a=d.collectionViewShouldSelectIndexes(this,a,b);if(!a||a.get("length")===0)return this}else a=null;f=b&&(f=this.get("selection"))?f.copy():SC.SelectionSet.create();if(a&&a.get("length")>0)a.get("length")===1?f.addObject(c.objectAt(a.get("firstObject"))):f.add(c,a);(f=d.collectionViewSelectionForProposedSelection(this,f))||(f=SC.SelectionSet.create());this._selectionAnchor=null;this.set("selection",f.freeze());return this},deselect:function(a){var b=
+this.get("selection"),c=this.get("content"),d=this.get("selectionDelegate");if(!this.get("isSelectable"))return this;if(!b||b.get("length")===0)return this;if(SC.typeOf(a)===SC.T_NUMBER)a=SC.IndexSet.create(a,1);a=d.collectionViewShouldDeselectIndexes(this,a);if(!a||a.get("length")===0)return this;b=b.copy().remove(c,a);(b=d.collectionViewSelectionForProposedSelection(this,b))||(b=SC.SelectionSet.create());this.set("selection",b.freeze());return this},_findNextSelectableItemFromIndex:function(a,b){var c=
+this.get("length"),d=SC.IndexSet.create();this.get("content");var e=this.get("selectionDelegate"),f=this.get("_contentGroupIndexes"),g;if(!f&&e.collectionViewShouldSelectIndexes===this.collectionViewShouldSelectIndexes)return a;for(;a<c;){if(!f||!f.contains(a)){d.add(a);if((g=e.collectionViewShouldSelectIndexes(this,d))&&g.get("length")>=1)return a;d.remove(a)}a++}if(b===undefined)b=(a=this.get("selection"))?a.get("max"):-1;return b},_findPreviousSelectableItemFromIndex:function(a,b){var c=SC.IndexSet.create();
+this.get("content");var d=this.get("selectionDelegate"),e=this.get("_contentGroupIndexes"),f;if(SC.none(a))a=-1;if(!e&&d.collectionViewShouldSelectIndexes===this.collectionViewShouldSelectIndexes)return a;for(;a>=0;){if(!e||!e.contains(a)){c.add(a);if((f=d.collectionViewShouldSelectIndexes(this,c))&&f.get("length")>=1)return a;c.remove(a)}a--}if(b===undefined)b=(a=this.get("selection"))?a.get("min"):-1;if(SC.none(b))b=-1;return b},selectPreviousItem:function(a,b){if(SC.none(b))b=1;if(SC.none(a))a=
+false;var c=this.get("selection"),d=this.get("content");if(c)c=c.indexSetForSource(d);d=c?c.get("min"):-1;c=c?c.get("max")-1:-1;var e=this._selectionAnchor;if(SC.none(e))e=d;if(a){if(c>e)c-=b;else d=this._findPreviousSelectableItemFromIndex(d-b);if(SC.none(d)||d<0)d=0;if(c<d)c=d}else{d=this._findPreviousSelectableItemFromIndex(d-b);if(SC.none(d)||d<0)d=0;c=d;e=null}a=d;c=SC.IndexSet.create(d,c+1-d);this.scrollToContentIndex(a);this.select(c);this._selectionAnchor=e;return this},selectNextItem:function(a,
+b){if(SC.none(b))b=1;if(SC.none(a))a=false;var c=this.get("selection"),d=this.get("content");if(c)c=c.indexSetForSource(d);d=c?c.get("min"):-1;c=c?c.get("max")-1:-1;var e=this._selectionAnchor,f=this.get("length");if(SC.none(e))e=d;if(a){if(d<e)d+=b;else c=this._findNextSelectableItemFromIndex(c+b,c);if(c>=f)c=f-1;if(d>c)d=c}else{c=this._findNextSelectableItemFromIndex(c+b,c);if(c>=f)c=f-1;d=c;e=null}a=c;c=SC.IndexSet.create(d,c-d+1);this.scrollToContentIndex(a);this.select(c);this._selectionAnchor=
+e;return this},deleteSelection:function(){if(!this.get("canDeleteContent"))return NO;var a=this.get("selection"),b=this.get("content"),c=this.get("selectionDelegate");a=a&&b?a.indexSetForSource(b):null;if(!b||!a||a.get("length")===0)return NO;a=c.collectionViewShouldDeleteIndexes(this,a);if(!a||a.get("length")===0)return NO;c.collectionViewDeleteContent(this,this.get("content"),a);return YES},scrollToContentIndex:function(a){(a=this.itemViewForContentIndex(a))&&this.scrollToItemView(a);return this},
+scrollToItemView:function(a){a&&a.scrollToVisible();return this},keyDown:function(a){a=this.interpretKeyEvents(a);return!a?NO:a},keyUp:function(){return true},insertText:function(a,b){if(a===" "){(a=this.get("selection"))&&a.get("length")>0&&this.invokeLater(this._cv_action,0,null,b);return YES}else return NO},selectAll:function(){var a=this.get("content");this.select(a?SC.IndexSet.create(0,a.get("length")):null,NO);return YES},deleteBackward:function(){return this.deleteSelection()},deleteForward:function(){return this.deleteSelection()},
+moveDown:function(a,b){this.selectNextItem(false,this.get("itemsPerRow")||1);this._cv_performSelectAction(null,b,this.ACTION_DELAY);return true},moveUp:function(a,b){this.selectPreviousItem(false,this.get("itemsPerRow")||1);this._cv_performSelectAction(null,b,this.ACTION_DELAY);return true},moveLeft:function(a,b){if((this.get("itemsPerRow")||1)>1){this.selectPreviousItem(false,1);this._cv_performSelectAction(null,b,this.ACTION_DELAY)}else{b=this.get("selection");a=this.get("content");var c=b?b.indexSetForSource(a):
+null;if(c){b=undefined;var d=false,e=undefined;if(c.get("length")===1){e=c.get("firstObject");b=this.get("contentDelegate");if(b.contentIndexDisclosureState(this,a,e)!==SC.BRANCH_OPEN)d=true}if(d){c=b.contentIndexOutlineLevel(this,a,e)-1;if(c>=0){for(d=-1;d<0;){var f=this._findPreviousSelectableItemFromIndex(e-1);if(f<0)return false;e=f;if(b.contentIndexOutlineLevel(this,a,e)===c)d=f}d!==-1&&this.select(e)}}else this.collapse(c)}}return true},moveRight:function(a,b){if((this.get("itemsPerRow")||1)>
+1){this.selectNextItem(false,1);this._cv_performSelectAction(null,b,this.ACTION_DELAY)}else{a=this.get("selection");b=this.get("content");(a=a?a.indexSetForSource(b):null)&&this.expand(a)}return true},moveDownAndModifySelection:function(a,b){this.selectNextItem(true,this.get("itemsPerRow")||1);this._cv_performSelectAction(null,b,this.ACTION_DELAY);return true},moveUpAndModifySelection:function(a,b){this.selectPreviousItem(true,this.get("itemsPerRow")||1);this._cv_performSelectAction(null,b,this.ACTION_DELAY);
+return true},moveLeftAndModifySelection:function(a,b){if((this.get("itemsPerRow")||1)>1){this.selectPreviousItem(true,1);this._cv_performSelectAction(null,b,this.ACTION_DELAY)}return true},moveRightAndModifySelection:function(a,b){if((this.get("itemsPerRow")||1)>1){this.selectNextItem(true,1);this._cv_performSelectAction(null,b,this.ACTION_DELAY)}return true},insertNewline:function(){var a=this.get("isEditable")&&this.get("canEditContent"),b,c,d,e;if(a){b=this.get("selection");c=this.get("content");
+if(b&&b.get("length")===1){d=(a=b.indexSetForSource(c))?a.get("min"):-1;a=d>=0}}if(a)a=(e=this.itemViewForContentIndex(d))&&SC.typeOf(e.beginEditing)===SC.T_FUNCTION;if(a){this.scrollToContentIndex(d);e=this.itemViewForContentIndex(d);e.beginEditing()}else this.invokeLater(this._cv_action,0,e,null);return YES},mouseDown:function(a){if(this.get("useToggleSelection"))return true;var b=this.itemViewForEvent(a),c=this.get("content"),d=b?b.get("contentIndex"):-1,e;e=this.mouseDownInfo={event:a,itemView:b,
+contentIndex:d,at:Date.now()};this.becomeFirstResponder();if(!b){this.get("allowDeselectAll")&&this.select(null,false);return YES}b=this.get("selection");var f;if(b)b=b.indexSetForSource(c);c=b?b.contains(d):NO;if((e.modifierKeyPressed=f=a.ctrlKey||a.metaKey)&&c)e.shouldDeselect=d>=0;else if(a.shiftKey&&b&&b.get("length")>0){b=this._findSelectionExtendedByShift(b,d);a=this._selectionAnchor;this.select(b);this._selectionAnchor=a}else if(!f&&c)e.shouldReselect=d>=0;else if(this.get("selectOnMouseDown"))this.select(d,
+f);else e.shouldSelect=d>=0;e.previousContentIndex=d;return YES},mouseUp:function(a){var b=this.itemViewForEvent(a),c=this.mouseDownInfo,d,e;if(this.get("useToggleSelection")){if(!b)return;c=this.get("selection");d=b?b.get("contentIndex"):-1;(c=c&&c.include(d))?this.deselect(d):this.select(d,YES)}else if(c){d=c.contentIndex;b&&b.get("contentIndex");c.shouldSelect&&this.select(d,c.modifierKeyPressed);c.shouldDeselect&&this.deselect(d);if(c.shouldReselect){if(c=this.get("isEditable")&&this.get("canEditContent"))c=
+(c=this.get("selection"))&&c.get("length")===1;if(c)c=(c=(e=this.itemViewForContentIndex(d))&&(!e.contentHitTest||e.contentHitTest(a)))&&e.beginEditing?e.beginEditing():NO;if(!c){this._cv_reselectTimer&&this._cv_reselectTimer.invalidate();this._cv_reselectTimer=this.invokeLater(this.select,300,d,false)}}this._cleanupMouseDown()}this._cv_performSelectAction(b,a,0,a.clickCount);return NO},_cleanupMouseDown:function(){var a=this.mouseDownInfo,b;if(a)for(b in a)a.hasOwnProperty(b)&&delete a[b];this.mouseDownInfo=
+null},mouseMoved:function(a){var b=this.itemViewForEvent(a),c=this._lastHoveredItem;if(b!==c){c&&c.mouseOut&&c.mouseOut(a);b&&b.mouseOver&&b.mouseOver(a)}(this._lastHoveredItem=b)&&b.mouseMoved&&b.mouseMoved(a);return YES},mouseOut:function(a){var b=this._lastHoveredItem;this._lastHoveredItem=null;b&&b.mouseOut&&b.mouseOut(a);return YES},touchStart:function(a){if(this.get("useToggleSelection"))return true;a=this.itemViewForEvent(a);this.get("content");a=a?a.get("contentIndex"):-1;this.becomeFirstResponder();
+this.select(a,NO);return SC.MIXED_STATE},touchDragged:function(){this.select(null,NO);return SC.MIXED_STATE},touchCancelled:function(){this.select(null,NO)},_findSelectionExtendedByShift:function(a,b){if(!a||a.get("length")===0)return SC.IndexSet.create(b);this.get("content").get("length");var c=a.get("min");a=a.get("max")-1;var d=this._selectionAnchor;if(SC.none(d))d=-1;if(b<c){c=b;if(d<0)this._selectionAnchor=a}else if(b>a){a=b;if(d<0)this._selectionAnchor=c}else if(b>=c&&b<=a){if(d<0)this._selectionAnchor=
+d=c;if(b===d)c=a=b;else if(b>d){c=d;a=b}else if(b<d){c=b;a=d}}return SC.IndexSet.create(c,a-c+1)},reorderDataType:function(){return"SC.CollectionView.Reorder."+SC.guidFor(this)}.property().cacheable(),dragContent:null,proposedInsertionIndex:null,proposedDropOperation:null,mouseDragged:function(){var a=this.get("selectionDelegate"),b=this.get("content"),c=this.get("selection"),d=this.mouseDownInfo,e=this.get("_contentGroupIndexes");if(!d||d.contentIndex<0)return YES;if(Date.now()-d.at<123)return YES;
+if(a.collectionViewShouldBeginDrag(this)){if((c=this.get("selectOnMouseDown")?c?c.indexSetForSource(b):null:SC.IndexSet.create(d.contentIndex))&&e&&e.get("length")>0){c=c.copy().remove(e);if(c.get("length")===0)c=null;else c.freeze()}if(c)c=c.frozenCopy();else return YES;c={content:b,indexes:c};this.set("dragContent",c);if((b=this.get("dragDataTypes"))&&b.get("length")>0){(b=a.collectionViewDragViewFor(this,c.indexes))||(b=this._cv_dragViewFor(c.indexes));b.createLayer();SC.Drag.start({event:d.event,
+source:this,dragView:b,ghost:NO,ghostActsLikeCursor:a.ghostActsLikeCursor,slideBack:YES,dataSource:this});this._cleanupMouseDown();this._lastInsertionIndex=null}else this.set("dragContent",null);return YES}},_cv_dragViewFor:function(a){a=this.get("nowShowing").without(a);a=this.get("nowShowing").without(a);var b=this.get("layer").cloneNode(false),c=SC.View.create({layer:b,parentView:this});SC.$(b).css("backgroundColor","transparent").css("border","none").css("top",0).css("left",0);a.forEach(function(d){d=
+this.itemViewForContentIndex(d);var e,f;if(d){e=d.get("isSelected");d.set("isSelected",NO);d.updateLayerIfNeeded();if(f=d.get("layer"))f=f.cloneNode(true);d.set("isSelected",e);d.updateLayerIfNeeded()}f&&b.appendChild(f)},this);b=null;return c},dragDataTypes:function(){var a=this.get("selectionDelegate").collectionViewDragDataTypes(this),b;if(this.get("canReorderContent")){a=a?a.copy():[];b=this.get("reorderDataType");a.indexOf(b)<0&&a.push(b)}return a?a:[]}.property(),dragDataForType:function(a,
+b){if(this.get("canReorderContent"))if(b===this.get("reorderDataType"))return this.get("dragContent");return this.get("selectionDelegate").collectionViewDragDataForType(this,a,b)},computeDragOperations:function(a){var b=SC.DRAG_NONE,c=this.get("selectionDelegate");if(this.get("canReorderContent"))if(a.get("dataTypes").indexOf(this.get("reorderDataType"))>=0)b=SC.DRAG_REORDER;b=c.collectionViewComputeDragOperations(this,a,b);if(b&SC.DRAG_REORDER)b=SC.DRAG_MOVE;return b},_computeDropOperationState:function(a,
+b,c){var d=this.convertFrameFromView(a.get("location"),null);b=SC.DROP_BEFORE;var e=this.get("selectionDelegate"),f=this.get("canReorderContent"),g,h,j=this.insertionIndexForLocation(d,SC.DROP_ON);if(SC.typeOf(j)===SC.T_ARRAY){b=j[1];j=j[0]}if(b===SC.DROP_ON){this.set("proposedInsertionIndex",j);this.set("proposedDropOperation",b);g=e.collectionViewValidateDragOperation(this,a,c,j,b);j=this.get("proposedInsertionIndex");b=this.get("proposedDropOperation");this._dropInsertionIndex=this._dropOperation=
+null;if(g!==SC.DRAG_NONE)return[j,b,g];else{b=SC.DROP_BEFORE;j=this.insertionIndexForLocation(d,SC.DROP_BEFORE);if(SC.typeOf(j)===SC.T_ARRAY){b=j[1];j=j[0]}}}if(j>=0&&f&&b!==SC.DROP_ON)if(d=a.dataForType(this.get("reorderDataType"))){f=this.get("content");if(b===SC.DROP_BEFORE){g=d.indexes.contains(j-1);h=d.indexes.contains(j)}else{g=d.indexes.contains(j);h=d.indexes.contains(j-1)}if(g&&h)if(SC.none(this._lastInsertionIndex))if(b===SC.DROP_BEFORE)for(;j>=0&&d.indexes.contains(j);)j--;else for(f=f?
+f.get("length"):0;j<f&&d.indexes.contains(j);)j++;else j=this._lastInsertionIndex;if(j>=0)c=SC.DRAG_REORDER}this.set("proposedInsertionIndex",j);this.set("proposedDropOperation",b);c=e.collectionViewValidateDragOperation(this,a,c,j,b);j=this.get("proposedInsertionIndex");b=this.get("proposedDropOperation");this._dropInsertionIndex=this._dropOperation=null;return[j,b,c]},dragUpdated:function(a,b){var c=a.get("allowedDragOperations");c=this._computeDropOperationState(a,b,c);a=c[0];b=c[1];c=c[2];if(c!==
+SC.DRAG_NONE){if(this._lastInsertionIndex!==a||this._lastDropOperation!==b)this.showInsertionPoint(this.itemViewForContentIndex(a),b);this._lastInsertionIndex=a;this._lastDropOperation=b}else{this.hideInsertionPoint();this._lastInsertionIndex=this._lastDropOperation=null}return c&SC.DRAG_REORDER?SC.DRAG_MOVE:c},dragExited:function(){this.hideInsertionPoint();this._lastInsertionIndex=this._lastDropOperation=null},acceptDragOperation:function(){return YES},performDragOperation:function(a,b){var c=this._computeDropOperationState(a,
+null,b),d=c[0],e=c[1];c=c[2];var f=this.get("selectionDelegate"),g,h,j;if(c&SC.DRAG_REORDER)b=b&SC.DRAG_MOVE?SC.DRAG_REORDER:SC.DRAG_NONE;else b&=c;if(b===SC.DRAG_NONE)return b;if(f.collectionViewPerformDragOperation(this,a,b,d,e)===SC.DRAG_NONE&&b&SC.DRAG_REORDER){a=a.dataForType(this.get("reorderDataType"));if(!a)return SC.DRAG_NONE;h=this.get("content");b=a.indexes;if(b.get("length")===1)if((e===SC.DROP_BEFORE||e===SC.DROP_AFTER)&&b.get("min")===d)return SC.DRAG_MOVE;h.beginPropertyChanges();g=
+[];j=0;a.indexes.forEach(function(k){g.push(h.objectAt(k-j));h.removeAt(k-j);j++;k<d&&d--},this);e===SC.DROP_AFTER&&d++;h.replace(d,0,g,e);this.select(SC.IndexSet.create(d,g.length));h.endPropertyChanges();b=SC.DRAG_MOVE}return b},collectionViewShouldBeginDrag:function(){return this.get("canReorderContent")},insertionIndexForLocation:function(){return-1},_cv_isVisibleInWindowDidChange:function(){if(this.get("isVisibleInWindow")){this._invalidIndexes&&this.invokeOnce(this.reloadIfNeeded);this._invalidSelection&&
+this.invokeOnce(this.reloadSelectionIndexesIfNeeded)}}.observes("isVisibleInWindow"),collectionViewShouldSelectItem:function(){return this.get("isSelectable")},_TMP_DIFF1:SC.IndexSet.create(),_TMP_DIFF2:SC.IndexSet.create(),_cv_nowShowingDidChange:function(){var a=this.get("nowShowing"),b=this._sccv_lastNowShowing,c,d,e;if(b!==a)if(b&&a){d=this._TMP_DIFF1.add(b).remove(a);e=this._TMP_DIFF2.add(a).remove(b);c=d.add(e)}else c=b||a;if(c&&c.get("length")>0){this._sccv_lastNowShowing=a?a.frozenCopy():
+null;this.updateContentRangeObserver();this.reload(c)}d&&d.clear();e&&e.clear()}.observes("nowShowing"),init:function(){arguments.callee.base.apply(this,arguments);this.get("canReorderContent")&&this._cv_canReorderContentDidChange();this._sccv_lastNowShowing=this.get("nowShowing").clone();this.content&&this._cv_contentDidChange();this.selection&&this._cv_selectionDidChange()},_cv_canReorderContentDidChange:function(){if(this.get("canReorderContent")){this.get("isDropTarget")||this.set("isDropTarget",
+YES);SC.Drag.addDropTarget(this)}}.observes("canReorderContent"),_cv_performSelectAction:function(a,b,c,d){if(c===undefined)c=0;if(d===undefined)d=1;if(d>1||this.get("actOnSelect")){this._cv_reselectTimer&&this._cv_reselectTimer.invalidate();d=(d=this.get("selection"))?d.toArray():[];this._cv_actionTimer&&this._cv_actionTimer.invalidate();this._cv_actionTimer=this.invokeLater(this._cv_action,c,a,b,d)}},_cv_action:function(a,b,c){var d=this.get("action"),e=this.get("target")||null;this._cv_actionTimer=
+null;if(d){if(SC.typeOf(d)===SC.T_FUNCTION)return this.action(a,b);(a=this.get("pane"))&&a.rootResponder.sendAction(d,e,this,a,c)}else if(a)if(SC.typeOf(a._action)==SC.T_FUNCTION)return a._action(b);else if(SC.typeOf(a.action)==SC.T_FUNCTION)return a.action(b)}});
+SC.DisclosureView=SC.ButtonView.extend({classNames:["sc-disclosure-view"],theme:"disclosure",buttonBehavior:SC.TOGGLE_BEHAVIOR,toggleOnValue:YES,toggleOffValue:NO,valueBindingDefault:SC.Binding.bool(),render:function(a,b){var c=this.get("displayTitle");if(b){a.push('<img src="',SC.BLANK_IMAGE_URL,'" class="button" alt="" />');this.get("needsEllipsis")?a.push('<span class="ellipsis sc-button-label">',c,"</span>"):a.push('<span class="sc-button-label">',c,"</span>")}else this.$("label").text(c)},keyDown:function(a){if(a.which===
+37||a.which===38){this.set("value",this.get("toggleOffValue"));return YES}if(a.which===39||a.which===40){this.set("value",this.get("toggleOnValue"));return YES}arguments.callee.base.apply(this,arguments)}});sc_require("views/collection");sc_require("mixins/collection_row_delegate");
+SC.ListView=SC.CollectionView.extend(SC.CollectionRowDelegate,{classNames:["sc-list-view"],acceptsFirstResponder:YES,showAlternatingRows:NO,render:function(a){a.setClass("alternating",this.get("showAlternatingRows"));return arguments.callee.base.apply(this,arguments)},rowDelegate:function(){var a=this.delegate,b=this.get("content");return this.delegateFor("isCollectionRowDelegate",a,b)}.property("delegate","content").cacheable(),_sclv_rowDelegateDidChange:function(){var a=this._sclv_rowDelegate,b=
+this.get("rowDelegate"),c=this._sclv_rowHeightDidChange,d=this._sclv_customRowHeightIndexesDidChange;if(a===b)return this;this._sclv_rowDelegate=b;if(a){a.removeObserver("rowHeight",this,c);a.removeObserver("customRowHeightIndexes",this,d)}if(!b)throw"Internal Inconsistancy: ListView must always have CollectionRowDelegate";b.addObserver("rowHeight",this,c);b.addObserver("customRowHeightIndexes",this,d);this._sclv_rowHeightDidChange()._sclv_customRowHeightIndexesDidChange();return this}.observes("rowDelegate"),
+_sclv_rowHeightDidChange:function(){var a=this.get("rowDelegate").get("rowHeight");if(a===this._sclv_rowHeight)return this;this._sclv_rowHeight=a;this.rowHeightDidChangeForIndexes(SC.IndexSet.create(0,this.get("length")));return this},_sclv_customRowHeightIndexesDidChange:function(){var a=this.get("rowDelegate").get("customRowHeightIndexes"),b=this._sclv_customRowHeightIndexes,c=this._sclv_customRowHeightIndexesContentDidChange;if(a===b||b&&b.isEqual(a))return this;b&&this._sclv_isObservingCustomRowHeightIndexes&&
+b.removeObserver("[]",this,c);if(this._sclv_isObservingCustomRowHeightIndexes=a&&!a.get("isFrozen"))a.addObserver("[]",this,c);this._sclv_customRowHeightIndexesContentDidChange();return this},_sclv_customRowHeightIndexesContentDidChange:function(){var a=this.get("rowDelegate").get("customRowHeightIndexes"),b=this._sclv_customRowHeightIndexes;b=a&&b?a.copy().add(b):a||b;this._sclv_customRowHeightIndexes=a?a.frozenCopy():null;this.rowHeightDidChangeForIndexes(b);return this},rowOffsetForContentIndex:function(a){if(a===
+0)return 0;var b=this.get("rowDelegate"),c=b.get("rowHeight"),d,e,f,g,h,j;e=a*c;if(d=this.get("rowSpacing"))e+=a*d;if(b.customRowHeightIndexes&&(f=b.get("customRowHeightIndexes"))){g=this._sclv_offsetCache;if(!g){g=this._sclv_offsetCache=[];h=j=0;f.forEach(function(k){h+=this.rowHeightForContentIndex(k)-c;g[k+1]=h;j=k},this);this._sclv_max=j+1}h=g[a];if(h===undefined){h=g[a]=g[a-1];if(h===undefined){j=this._sclv_max;if(a<j)j=f.indexBefore(a)+1;h=g[a]=g[j]||0}}e+=h}return e},rowHeightForContentIndex:function(a){var b=
+this.get("rowDelegate"),c,d,e;if(b.customRowHeightIndexes&&(e=b.get("customRowHeightIndexes"))){c=this._sclv_heightCache;if(!c){c=this._sclv_heightCache=[];d=this.get("content");e.forEach(function(f){c[f]=b.contentIndexRowHeight(this,d,f)},this)}a=c[a];if(a===undefined)a=b.get("rowHeight")}else a=b.get("rowHeight");return a},rowHeightDidChangeForIndexes:function(a){var b=this.get("length");this._sclv_heightCache=this._sclv_offsetCache=null;if(a&&a.isIndexSet)a=a.get("min");this.reload(SC.IndexSet.create(a,
+b-a));return this},computeLayout:function(){var a=this._sclv_layout;if(!a)a=this._sclv_layout={};a.minHeight=this.rowOffsetForContentIndex(this.get("length"))+4;this.set("calculatedHeight",a.minHeight);return a},layoutForContentIndex:function(a){return{top:this.rowOffsetForContentIndex(a),height:this.rowHeightForContentIndex(a),left:0,right:0}},contentIndexesInRect:function(a){var b=this.get("rowDelegate").get("rowHeight"),c=SC.minY(a),d=SC.maxY(a),e=a.height||0;a=this.get("length");var f,g;g=(c-
+c%b)/b;for(f=this.rowOffsetForContentIndex(g);g>0&&f>=c;){g--;f-=this.rowHeightForContentIndex(g)}for(f+=this.rowHeightForContentIndex(g);g<a&&f<c;){f+=this.rowHeightForContentIndex(g);g++}if(g<0)g=0;if(g>=a)g=a;b=g+(e-e%b)/b;if(b>a)b=a;for(f=this.rowOffsetForContentIndex(b);b>=g&&f>=d;){b--;f-=this.rowHeightForContentIndex(b)}for(f+=this.rowHeightForContentIndex(b);b<a&&f<=d;){f+=this.rowHeightForContentIndex(b);b++}b++;if(b<g)b=g;if(b>a)b=a;return SC.IndexSet.create(g,b-g)},insertionPointView:SC.View.extend({classNames:"sc-list-insertion-point",
+render:function(a,b){b&&a.push('<div class="anchor"></div>')}}),showInsertionPoint:function(a,b){var c=this._insertionPointView;if(!c)c=this._insertionPointView=this.get("insertionPointView").create();var d=a.get("contentIndex"),e=this.get("length"),f=SC.clone(a.get("layout")),g=a.get("outlineLevel"),h=a.get("outlineIndent")||0;if(d>=e&&d>0){d=this.itemViewForContentIndex(e-1);if(d.get("isGroupView")){g=1;h=d.get("outlineIndent")}}if(SC.none(g))g=-1;if(b&SC.DROP_ON){this.hideInsertionPoint();a.set("isSelected",
+YES);this._lastDropOnView=a}else{if(this._lastDropOnView){this._lastDropOnView.set("isSelected",NO);this._lastDropOnView=null}if(b&SC.DROP_AFTER)f.top+=f.height;f.height=2;f.right=0;f.left=(g+1)*h+12;delete f.width;c.set("layout",f);this.appendChild(c)}},hideInsertionPoint:function(){if(this._lastDropOnView){this._lastDropOnView.set("isSelected",NO);this._lastDropOnView=null}var a=this._insertionPointView;a&&a.removeFromParent().destroy();this._insertionPointView=null},insertionIndexForLocation:function(a,
+b){var c=this.contentIndexesInRect(a).get("min"),d=this.get("length"),e,f,g;if(SC.none(c)||c<0)if(d===0||a.y<=this.rowOffsetForContentIndex(0))c=0;else if(a.y>=this.rowOffsetForContentIndex(d))c=d;e=this.rowOffsetForContentIndex(c);f=e+this.rowHeightForContentIndex(c);if(b==SC.DROP_ON){g=this.get("isEditable")?Math.min(Math.floor((f-e)*0.2),5):0;if(a.y>=e+g||a.y<=f+g)return[c,SC.DROP_ON]}c<d&&a.y>=f-10&&c++;if(c>0){f=((g=this.itemViewForContentIndex(c-1))?g.get("outlineIndent"):0)||0;e=g?g.get("outlineLevel"):
+0;if(c<d){a=(g=this.itemViewForContentIndex(c))?g.get("outlineLevel"):0;g=(g?g.get("outlineIndent"):0)||0;g*=a}else{a=g.get("isGroupView")?1:0;g=f*a}f*=e;if(a!==e&&g!==f)if(f>g){c--;b=SC.DROP_AFTER}}if(b===SC.DROP_BEFORE){g=c<d?this.itemViewForContentIndex(c):null;if(!g||g.get("isGroupView"))if(c>0){g=this.itemViewForContentIndex(c-1);if(!g.get("isGroupView")||g.get("disclosureState")===SC.BRANCH_OPEN){c-=1;b=SC.DROP_AFTER}else c=-1}else c=-1;if(c<0)b=SC.DRAG_NONE}return[c,b]},mouseWheel:function(){var a=
+SC.InlineTextFieldView.editor;a&&a.get("isEditing")&&a.get("delegate").get("displayDelegate")===this&&SC.InlineTextFieldView.commitEditing();return NO},init:function(){arguments.callee.base.apply(this,arguments);this._sclv_rowDelegateDidChange()}});sc_require("views/list");
+SC.GridView=SC.ListView.extend({classNames:["sc-grid-view"],layout:{left:0,right:0,top:0,bottom:0},rowHeight:48,columnWidth:64,exampleView:SC.LabelView,insertionOrientation:SC.HORIZONTAL_ORIENTATION,itemsPerRow:function(){var a=this.get("frame"),b=this.get("columnWidth")||0;return b<=0?1:Math.floor(a.width/b)}.property("clippingFrame","columnWidth").cacheable(),contentIndexesInRect:function(a){var b=this.get("rowHeight")||48,c=this.get("itemsPerRow"),d=Math.floor(SC.minY(a)/b)*c;a=Math.ceil(SC.maxY(a)/
+b)*c;return SC.IndexSet.create(d,a-d)},layoutForContentIndex:function(a){var b=this.get("rowHeight")||48,c=this.get("clippingFrame").width,d=this.get("itemsPerRow");c=Math.floor(c/d);var e=Math.floor(a/d);return{left:(a-d*e)*c,top:e*b,height:b,width:c}},computeLayout:function(){var a=this.get("content"),b=a?a.get("length"):0;a=this.get("rowHeight")||48;var c=this.get("itemsPerRow");b=Math.ceil(b/c);c=this._cachedLayoutHash;if(!c)c=this._cachedLayoutHash={};c.minHeight=b*a;this.calculatedHeight=c.minHeight;
+return c},insertionPointClass:SC.View.extend({classNames:["grid-insertion-point"],render:function(a,b){b&&a.push('<span class="anchor"></span>')}}),showInsertionPoint:function(a,b){if(a)if(b===SC.DROP_ON){if(a!==this._dropOnInsertionPoint){this.hideInsertionPoint();a.addClassName("drop-target");this._dropOnInsertionPoint=a}}else{if(this._dropOnInsertionPoint){this._dropOnInsertionPoint.removeClassName("drop-target");this._dropOnInsertionPoint=null}if(!this._insertionPointView)this._insertionPointView=
+this.insertionPointClass.create();b=this._insertionPointView;var c=a.get("frame");c={height:c.height-6,x:c.x,y:c.y+6,width:0};SC.rectsEqual(b.get("frame"),c)||b.set("frame",c);b.parentNode!=a.parentNode&&a.parentNode.appendChild(b)}},hideInsertionPoint:function(){var a=this._insertionPointView;a&&a.removeFromParent();if(this._dropOnInsertionPoint){this._dropOnInsertionPoint.removeClassName("drop-target");this._dropOnInsertionPoint=null}},insertionIndexForLocation:function(a,b){var c=this.get("frame"),
+d=this.get("scrollFrame"),e=this.get("itemsPerRow"),f=Math.floor(c.width/e),g=Math.floor((a.y-c.y-d.y)/this.get("rowHeight")),h=SC.DROP_BEFORE;c=a.x-c.x-d.x;a=Math.floor(c/f);f=c/f-a;if(b===SC.DROP_ON){f>0.8&&a++;if(f>=0.2&&f<=0.8)h=SC.DROP_ON}else f>0.45&&a++;return[g*e+a,h]},_gv_clippingFrameDidChange:function(){var a=this.get("nowShowing"),b,c;this.notifyPropertyChange("itemsPerRow");c=a.get("length");for(b=0;b<c;b++){a=this.itemViewForContentIndex(b);a.adjust(this.layoutForContentIndex(b))}}.observes("clippingFrame")});
+SC.ScrollerView=SC.View.extend({classNames:["sc-scroller-view"],value:function(a,b){a=this.get("minimum");if(b!==undefined)this._scs_value=b;b=this._scs_value||a;return Math.max(Math.min(b,this.get("maximum")),a)}.property("maximum","minimum").cacheable(),proportion:0,maximum:100,minimum:0,isEnabled:YES,layoutDirection:SC.LAYOUT_VERTICAL,hasButtons:YES,scrollbarThickness:14,capLength:18,capOverlap:14,buttonLength:41,buttonOverlap:11,displayProperties:"thumbPosition thumbLength isEnabled controlsHidden".w(),
+render:function(a,b){var c=[],d="";switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:c.push("sc-vertical");break;case SC.LAYOUT_HORIZONTAL:c.push("sc-horizontal");break}this.get("isEnabled")||c.push("disabled");this.get("controlsHidden")&&c.push("controls-hidden");a.addClass(c);c=this.get("thumbLength");d=this.get("thumbPosition");if(b){d=this.get("hasButtons")?'<div class="button-bottom"></div><div class="button-top"></div>':'<div class="endcap"></div>';switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:a.push('<div class="track"></div>',
+'<div class="cap"></div>',d,'<div class="thumb" style="height: '+c+'px;">','<div class="thumb-center"></div>','<div class="thumb-top"></div>','<div class="thumb-bottom"></div></div>');break;case SC.LAYOUT_HORIZONTAL:a.push('<div class="track"></div>','<div class="cap"></div>',d,'<div class="thumb" style="width: '+c+'px;">','<div class="thumb-center"></div>','<div class="thumb-top"></div>','<div class="thumb-bottom"></div></div>')}}else if(!this.get("controlsHidden")){a=this.$(".thumb");this.adjustThumbSize(a,
+c);this.adjustThumbPosition(a,d)}},adjustThumbPosition:function(a,b){if(this._thumbPosition!==b){switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:a.css("top",b);break;case SC.LAYOUT_HORIZONTAL:a.css("left",b);break}this._thumbPosition=b}},adjustThumbSize:function(a,b){if(this._thumbSize!==b){switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:a.css("height",Math.max(b,20));break;case SC.LAYOUT_HORIZONTAL:a.css("width",Math.max(b,20));break}this._thumbSize=b}},trackLength:function(){var a=
+this.get("scrollerLength");a-=this.capLength-this.capOverlap;a-=this.buttonLength-this.buttonOverlap;return a}.property("scrollerLength").cacheable(),scrollerLength:function(){switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:return this.get("frame").height;case SC.LAYOUT_HORIZONTAL:return this.get("frame").width}return 0}.property("frame").cacheable(),thumbLength:function(){return Math.max(Math.floor(this.get("trackLength")*this.get("proportion")),20)}.property("trackLength","proportion").cacheable(),
+thumbPosition:function(){var a=this.get("value"),b=this.get("maximum"),c=this.get("trackLength"),d=this.get("thumbLength"),e=this.get("capLength"),f=this.get("capOverlap");a=a/b*(c-d);a+=e-f;return Math.floor(a)}.property("value","maximum","trackLength","thumbLength").cacheable(),controlsHidden:function(){return this.get("proportion")>=1}.property("proportion").cacheable(),mouseDown:function(a){if(!this.get("isEnabled"))return NO;var b=a.target,c=this.get("thumbPosition"),d;if(b.className.indexOf("thumb")>=
+0){d=this.convertFrameFromView({x:a.pageX,y:a.pageY});d.x-=c;d.y-=c;this._thumbDragging=YES;this._thumbOffset=d;this._mouseDownLocation={x:a.pageX,y:a.pageY};this._thumbPositionAtDragStart=this.get("thumbPosition")}else if(b.className.indexOf("button-top")>=0){this.decrementProperty("value",30);this.makeButtonActive(".button-top");this.startMouseDownTimer("scrollUp")}else if(b.className.indexOf("button-bottom")>=0){this.incrementProperty("value",30);this.makeButtonActive(".button-bottom");this.startMouseDownTimer("scrollDown")}else{b=
+this.get("scrollerLength");a=this.convertFrameFromView({x:a.pageX,y:a.pageY});switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:this._mouseDownLocation=d=a.y;break;case SC.LAYOUT_HORIZONTAL:this._mouseDownLocation=d=a.x;break}if(d<c){this.decrementProperty("value",b);this.startMouseDownTimer("pageUp")}else{this.incrementProperty("value",b);this.startMouseDownTimer("pageDown")}}return YES},mouseUp:function(){var a=this._scs_buttonActive,b=NO;if(a){a.removeClass("active");b=YES}if(a=this._mouseDownTimer){a.invalidate();
+this._mouseDownTimer=null}this._thumbDragging=NO;return b},mouseDragged:function(a){var b,c=this._thumbPositionAtDragStart;if(!this._thumbDragging)return NO;switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:b=a.pageY-this._mouseDownLocation.y;break;case SC.LAYOUT_HORIZONTAL:b=a.pageX-this._mouseDownLocation.x;break}b=c+b;a=this.get("trackLength")-this.get("thumbLength");this.set("value",Math.round(b/a*this.get("maximum")));return YES},startMouseDownTimer:function(a){this._mouseDownTimerAction=
+a;this._mouseDownTimer=SC.Timer.schedule({target:this,action:this.mouseDownTimerDidFire,interval:300})},mouseDownTimerDidFire:function(){var a=this.get("scrollerLength"),b=this._mouseDownLocation,c;switch(this._mouseDownTimerAction){case "scrollDown":this.incrementProperty("value",30);break;case "scrollUp":this.decrementProperty("value",30);break;case "pageDown":c=this._scs_thumbPosition+this._scs_thumbSize;if(b<c)return;this.incrementProperty("value",a);break;case "pageUp":c=this._scs_thumbPosition;
+if(b>c)return;this.decrementProperty("value",a);break}this._mouseDownTimer=SC.Timer.schedule({target:this,action:this.mouseDownTimerDidFire,interval:50})},makeButtonActive:function(a){this._scs_buttonActive=this.$(a).addClass("active")}});sc_require("views/scroller");sc_require("mixins/border");
+SC.ScrollView=SC.View.extend(SC.Border,{classNames:["sc-scroll-view"],isScrollable:YES,contentView:null,horizontalScrollOffset:function(a,b){if(b!==undefined)this._scroll_horizontalScrollOffset=Math.max(0,Math.min(this.get("maximumHorizontalScrollOffset"),b));return this._scroll_horizontalScrollOffset||0}.property().cacheable(),verticalScrollOffset:function(a,b){if(b!==undefined)this._scroll_verticalScrollOffset=Math.max(0,Math.min(this.get("maximumVerticalScrollOffset"),b));return this._scroll_verticalScrollOffset||
+0}.property().cacheable(),maximumHorizontalScrollOffset:function(){if(!this.get("canScrollHorizontal"))return 0;var a=this.get("contentView"),b=a?a.get("frame").width:0;if(a.calculatedWidth&&a.calculatedWidth!==0)b=a.calculatedWidth;a=this.get("containerView").get("frame").width;return Math.max(0,b-a)}.property(),maximumVerticalScrollOffset:function(){if(!this.get("canScrollVertical"))return 0;var a=this.get("contentView"),b=a&&a.get("frame")?a.get("frame").height:0;if(a.calculatedHeight&&a.calculatedHeight!==
+0)b=a.calculatedHeight;a=this.get("containerView").get("frame").height;return Math.max(0,b-a)}.property(),verticalLineScroll:20,horizontalLineScroll:20,verticalPageScroll:function(){return this.get("frame").height}.property("frame"),horizontalPageScroll:function(){return this.get("frame").width}.property("frame"),hasHorizontalScroller:YES,horizontalScrollerView:SC.ScrollerView,isHorizontalScrollerVisible:YES,canScrollHorizontal:function(){return!!(this.get("hasHorizontalScroller")&&this.get("horizontalScrollerView")&&
+this.get("isHorizontalScrollerVisible"))}.property("isHorizontalScrollerVisible").cacheable(),autohidesHorizontalScroller:YES,hasVerticalScroller:YES,verticalScrollerView:SC.ScrollerView,isVerticalScrollerVisible:YES,canScrollVertical:function(){return!!(this.get("hasVerticalScroller")&&this.get("verticalScrollerView")&&this.get("isVerticalScrollerVisible"))}.property("isVerticalScrollerVisible").cacheable(),autohidesVerticalScroller:YES,verticalScrollerBottom:0,verticalOverlay:NO,horizontalOverlay:NO,
+verticalScrollerLayout:null,horizontalScrollerLayout:null,containerView:SC.ContainerView,scrollTo:function(a,b){if(b===undefined&&SC.typeOf(a)===SC.T_HASH){b=a.y;a=a.x}if(!SC.none(a)){a=Math.max(0,Math.min(this.get("maximumHorizontalScrollOffset"),a));this.set("horizontalScrollOffset",a)}if(!SC.none(b)){b=Math.max(0,Math.min(this.get("maximumVerticalScrollOffset"),b));this.set("verticalScrollOffset",b)}return this},scrollBy:function(a,b){if(b===undefined&&SC.typeOf(a)===SC.T_HASH){b=a.y;a=a.x}a=a?
+this.get("horizontalScrollOffset")+a:null;b=b?this.get("verticalScrollOffset")+b:null;return this.scrollTo(a,b)},scrollToVisible:function(a){if(arguments.length===0)return arguments.callee.base.apply(this,arguments);var b=this.get("contentView");if(!b)return NO;var c=a.get("frame");if(!c)return NO;c=b.convertFrameFromView(c,a.get("parentView"));b=SC.cloneRect(this.get("containerView").get("frame"));b.x=this.get("horizontalScrollOffset");b.y=this.get("verticalScrollOffset");var d=b.x,e=b.y;b.y-=Math.max(0,
+SC.minY(b)-SC.minY(c));b.x-=Math.max(0,SC.minX(b)-SC.minX(c));b.y+=Math.max(0,SC.maxY(c)-SC.maxY(b));b.x+=Math.max(0,SC.maxX(c)-SC.maxX(b));if(d!==b.x||e!==b.y){this.scrollTo(b.x,b.y);return YES}else return NO},scrollDownLine:function(a){if(a===undefined)a=1;return this.scrollBy(null,this.get("verticalLineScroll")*a)},scrollUpLine:function(a){if(a===undefined)a=1;return this.scrollBy(null,0-this.get("verticalLineScroll")*a)},scrollRightLine:function(a){if(a===undefined)a=1;return this.scrollTo(this.get("horizontalLineScroll")*
+a,null)},scrollLeftLine:function(a){if(a===undefined)a=1;return this.scrollTo(0-this.get("horizontalLineScroll")*a,null)},scrollDownPage:function(a){if(a===undefined)a=1;return this.scrollBy(null,this.get("verticalPageScroll")*a)},scrollUpPage:function(a){if(a===undefined)a=1;return this.scrollBy(null,0-this.get("verticalPageScroll")*a)},scrollRightPage:function(a){if(a===undefined)a=1;return this.scrollBy(this.get("horizontalPageScroll")*a,null)},scrollLeftPage:function(a){if(a===undefined)a=1;return this.scrollBy(0-
+this.get("horizontalPageScroll")*a,null)},tile:function(){var a=this.get("hasHorizontalScroller")?this.get("horizontalScrollerView"):null,b=a&&this.get("isHorizontalScrollerVisible"),c=this.get("hasVerticalScroller")?this.get("verticalScrollerView"):null,d=c&&this.get("isVerticalScrollerVisible"),e=this.get("containerView"),f={left:0,top:0},g,h,j;h=b?a.get("scrollbarThickness"):0;var k=d?c.get("scrollbarThickness"):0;if(b){g=this.get("horizontalScrollerLayout");g={left:g?g.left:0,bottom:g?g.bottom:
+0,right:g?g.right+k-1:k-1,height:h};a.set("layout",g);j=this.get("horizontalOverlay");f.bottom=j?0:g.bottom+h}else f.bottom=0;a&&a.set("isVisible",b);if(d){h+=this.get("verticalScrollerBottom");a=this.get("verticalScrollerLayout");g={top:a?a.top:0,bottom:a?a.bottom+h:h,right:a?a.right:0,width:k};c.set("layout",g);h=this.get("verticalOverlay");f.right=h?0:g.right+k}else f.right=0;c&&c.set("isVisible",d);e.set("layout",f)},scrollerVisibilityDidChange:function(){this.tile()}.observes("isVerticalScrollerVisible",
+"isHorizontalScrollerVisible"),_scroll_wheelDeltaX:0,_scroll_wheelDeltaY:0,mouseWheel:function(a){this._scroll_wheelDeltaX+=a.wheelDeltaX;this._scroll_wheelDeltaY+=a.wheelDeltaY;this.invokeLater(this._scroll_mouseWheel,10);return this.get("canScrollHorizontal")||this.get("canScrollVertical")},_scroll_mouseWheel:function(){this.scrollBy(this._scroll_wheelDeltaX,this._scroll_wheelDeltaY);if(SC.WHEEL_MOMENTUM&&this._scroll_wheelDeltaY>0){this._scroll_wheelDeltaY=Math.floor(this._scroll_wheelDeltaY*0.95);
+this._scroll_wheelDeltaY=Math.max(this._scroll_wheelDeltaY,0);this.invokeLater(this._scroll_mouseWheel,10)}else if(SC.WHEEL_MOMENTUM&&this._scroll_wheelDeltaY<0){this._scroll_wheelDeltaY=Math.ceil(this._scroll_wheelDeltaY*0.95);this._scroll_wheelDeltaY=Math.min(this._scroll_wheelDeltaY,0);this.invokeLater(this._scroll_mouseWheel,10)}else this._scroll_wheelDeltaX=this._scroll_wheelDeltaY=0},touchStart:function(a){this.beginTouchTracking(a);this.invokeLater(this.beginTouchesInContent,150);return SC.MIXED_STATE},
+beginTouchesInContent:function(){var a=this.touch;if(a.tracking&&!a.dragging){a=a.originalEvent;a.manufactured=YES;this.contentView.mouseDown(a)}},beginTouchTracking:function(a){var b=this.get("verticalScrollOffset");this.touch={startScrollOffset:{x:this.horizontalScrollOffset,y:b},startTime:a.timeStamp,startTimePosition:b,startTouchOffset:{x:a.pageX,y:a.pageY},decelerationVelocity:{y:0},originalTarget:SC.RootResponder.responder.targetViewForEvent(a),originalPane:this.get("pane"),originalEvent:SC.copy(a),
+tracking:YES,dragging:NO,decelerating:NO};this.tracking=YES;this.dragging=NO},touchDragged:function(a){var b=this.touch,c=a.pageY,d=b.startScrollOffset.y,e=this.get("maximumVerticalScrollOffset");c=c-b.startTouchOffset.y;if(!b.dragging)if(Math.abs(c)>5){b.dragging=YES;b.firstDrag=YES}if(b.dragging){d-=c;if(b.firstDrag){b.firstDrag=NO;return}}this.set("verticalScrollOffset",Math.max(0,Math.min(d,e)));if(a.timeStamp-b.lastEventTime>50){b.startTime=a.timeStamp;b.startTimePosition=this.get("verticalScrollOffset")}b.lastEventTime=
+a.timeStamp},touchEnd:function(a){var b=this.touch;this.tracking=NO;this.dragging=b.tracking=NO;if(b.dragging){b.dragging=NO;if(a.timeStamp-b.lastEventTime<=100){b.offsetBeforeDeceleration={y:this.get("verticalScrollOffset")};this.startDecelerationAnimation(a)}}},startDecelerationAnimation:function(a){var b=this.touch,c=this.get("verticalScrollOffset")-b.startTimePosition;b.decelerationVelocity={y:c/((a.timeStamp-b.startTime)/15)};this.decelerateAnimation()},decelerateAnimation:function(){var a=this.touch,
+b=this.get("maximumVerticalScrollOffset"),c=this.get("verticalScrollOffset")+a.decelerationVelocity.y;this.set("verticalScrollOffset",Math.max(0,Math.min(Math.round(c),b)));a.decelerationVelocity.y*=0.95;if(Math.abs(a.decelerationVelocity.y)<1){a.decelerationVelocity.y=0;a.decelerating=NO}else this.invokeLater(this.decelerateAnimation,16)},createChildViews:function(){var a=[],b;if(SC.none(b=this.containerView))b=SC.ContainerView;a.push(this.containerView=this.createChildView(b,{contentView:this.contentView,
+isScrollContainer:YES}));this.contentView=this.containerView.get("contentView");if(b=this.horizontalScrollerView)if(this.get("hasHorizontalScroller")){b=this.horizontalScrollerView=this.createChildView(b,{layoutDirection:SC.LAYOUT_HORIZONTAL,valueBinding:"*owner.horizontalScrollOffset"});a.push(b)}else this.horizontalScrollerView=null;if(b=this.verticalScrollerView)if(this.get("hasVerticalScroller")){b=this.verticalScrollerView=this.createChildView(b,{layoutDirection:SC.LAYOUT_VERTICAL,valueBinding:"*owner.verticalScrollOffset"});
+a.push(b)}else this.verticalScrollerView=null;this.childViews=a;this.contentViewDidChange();this.tile()},init:function(){arguments.callee.base.apply(this,arguments);var a=this._scroll_contentView=this.get("contentView");a&&a.addObserver("frame",this,this.contentViewFrameDidChange);this.get("isVisibleInWindow")&&this._scsv_registerAutoscroll()},_scsv_registerAutoscroll:function(){this.get("isVisibleInWindow")?SC.Drag.addScrollableView(this):SC.Drag.removeScrollableView(this)}.observes("isVisibleInWindow"),
+contentViewDidChange:function(){var a=this.get("contentView"),b=this._scroll_contentView,c=this.contentViewFrameDidChange;if(a!==b){b&&b.removeObserver("frame",this,c);(this._scroll_contentView=a)&&a.addObserver("frame",this,c);this.containerView.set("contentView",a);this.contentViewFrameDidChange()}}.observes("contentView"),render:function(a,b){this.invokeLast(this.adjustElementScroll);b&&a.push('<div class="corner"></div>');return arguments.callee.base.apply(this,arguments)},oldMaxHOffset:0,oldMaxVOffset:0,
+contentViewFrameDidChange:function(){var a=this.get("contentView"),b=a?a.get("frame"):null,c=b?b.width:0;b=b?b.height:0;var d=this.get("frame");this._scroll_contentWidth=c;this._scroll_contentHeight=b;if(this.get("hasHorizontalScroller")&&(a=this.get("horizontalScrollerView"))){this.get("autohidesHorizontalScroller")&&this.set("isHorizontalScrollerVisible",c>d.width);a.setIfChanged("maximum",c-d.width);a.setIfChanged("proportion",d.width/c)}if(this.get("hasVerticalScroller")&&(a=this.get("verticalScrollerView"))){this.get("autohidesVerticalScroller")&&
+this.set("isVerticalScrollerVisible",b>d.height);b-=this.get("verticalScrollerBottom");a.setIfChanged("maximum",b-d.height);a.setIfChanged("proportion",d.height/b)}!this.get("isVerticalScrollerVisible")&&this.get("verticalScrollOffset")!==0&&this.get("autohidesVerticalScroller")&&this.set("verticalScrollOffset",0);!this.get("isHorizontalScrollerVisible")&&this.get("horizontalScrollOffset")!==0&&this.get("autohidesHorizontalScroller")&&this.set("horizontalScrollOffset",0);d=this.get("maximumVerticalScrollOffset");
+a=this.get("verticalScrollOffset");b=this.get("maximumHorizontalScrollOffset");c=this.get("horizontalScrollOffset");d=d<a;b=b<c;if(d||b)this.forceDimensionsRecalculation(b,d,a,c)},_scroll_horizontalScrollOffsetDidChange:function(){this.invokeLast(this.adjustElementScroll)}.observes("horizontalScrollOffset"),_scroll_verticalScrollOffsetDidChange:function(){this.invokeLast(this.adjustElementScroll)}.observes("verticalScrollOffset"),adjustElementScroll:function(){var a=this.get("containerView"),b=this.get("contentView"),
+c=this.get("verticalScrollOffset"),d=this.get("horizontalScrollOffset");if(b){SC.RunLoop.begin();b.notifyPropertyChange("frame");SC.RunLoop.end();if(SC.browser.touch){var e="translate3d(-"+d+"px, -"+c+"px, 0)";b.get("layer").style.webkitTransform=e}}if(a&&!SC.browser.touch){b=a.get("hasCustomScrolling");e=a.get("layer");if(a){if(c!==this._verticalScrollOffset){if(!b)e.scrollTop=c;this._verticalScrollOffset=c}if(d!==this._horizontalScrollOffset){if(!b)e.scrollLeft=d;this._horizontalScrollOffset=d}}}},
+forceDimensionsRecalculation:function(a,b,c,d){this.scrollTo(0,0);a&&b&&this.scrollTo(this.get("maximumHorizontalScrollOffset"),this.get("maximumVerticalScrollOffset"));a&&!b&&this.scrollTo(this.get("maximumHorizontalScrollOffset"),c);!a&&b&&this.scrollTo(d,this.get("maximumVerticalScrollOffset"))},_verticalScrollOffset:0,_horizontalScrollOffset:0});sc_require("views/scroll");
+SC.MenuScrollerView=SC.ScrollerView.extend({classNames:["sc-menu-scroller-view"],scrollDown:NO,value:function(a,b){if(b!==undefined)this._value=b;else return Math.min(this._value||0,this.get("maximum"))}.property("maximum").cacheable(),maximum:0,isEnabled:YES,layoutDirection:SC.LAYOUT_VERTICAL,verticalLineScroll:20,ownerScrollValueKey:function(){return"verticalScrollOffset"}.property("layoutDirection").cacheable(),render:function(a,b){a.addClass("sc-vertical");if(b){b=this.get("scrollDown")?"arrowDown":
+"arrowUp";a.push('<span class="'+b+'">&nbsp;</span>')}a.setClass("disabled",!this.get("isEnabled"))},didCreateLayer:function(){},willDestroyLayer:function(){var a=this._sc_scroller_scrollDidChange;SC.Event.remove(this.$(),"scroll",this,a)},mouseEntered:function(){this.set("isMouseOver",YES);this._invokeScrollOnMouseOver()},mouseExited:function(){this.set("isMouseOver",NO)},_sc_scroller_valueDidChange:function(){}.observes("value"),_sc_scroller_armScrollTimer:function(){if(!this._sc_scrollTimer){SC.RunLoop.begin();
+this._sc_scrollTimer=this.invokeLater(this._sc_scroller_scrollDidChange,50);SC.RunLoop.end()}},_sc_scroller_scrollDidChange:function(){var a=Date.now(),b=this._sc_lastScroll,c=this.get("layer"),d=0;if(b&&a-b<50)return this._sc_scroller_armScrollTimer();this._sc_scrollTimer=null;this._sc_lastScroll=a;SC.RunLoop.begin();if(this.get("isEnabled")){this._sc_scrollValue=d=c.scrollTop;this.set("value",d);SC.RunLoop.end()}},_scrollMenu:function(){var a=this.get("value"),b;if(this.get("scrollDown")){b=a+this.verticalLineScroll;
+b<=this.get("maximum")&&this.set("value",b)}else{b=a-this.verticalLineScroll;if(b>=0)this.set("value",b);else a<=this.verticalLineScroll&&a>0&&this.set("value",0)}return YES},_invokeScrollOnMouseOver:function(){this._scrollMenu();this.get("isMouseOver")&&this.invokeLater(this._invokeScrollOnMouseOver,100)}});
+SC.MenuScrollView=SC.ScrollView.extend({classNames:["sc-menu-scroll-view"],maximumHorizontalScrollOffset:0,hasHorizontalScroller:NO,horizontalScrollerView:SC.MenuScrollerView,isHorizontalScrollerVisible:NO,canScrollHorizontal:NO,autohidesHorizontalScroller:NO,hasVerticalScroller:YES,verticalScrollerView:SC.MenuScrollerView,verticalScrollerView2:SC.MenuScrollerView,isVerticalScrollerVisible:YES,canScrollVertical:YES,autohidesVerticalScroller:YES,verticalScrollerBottom:0,controlSize:SC.REGULAR_CONTROL_SIZE,
+containerView:SC.ContainerView,tile:function(){var a,b,c,d,e,f;b=(a=this.get("hasVerticalScroller"))?this.get("verticalScrollerView"):null;a=a?this.get("verticalScrollerView2"):null;c=b&&this.get("isVerticalScrollerVisible");d=this.get("containerView");e={left:0,top:0};if(c){f=0;var g=b.get("scrollerThickness")||a.get("scrollerThickness"),h=this.get("contentView");h=(h=h?h.get("frame"):null)?h.height:0;var j=this.containerView.$()[0],k=this.get("verticalScrollOffset"),l={height:0,top:0,right:0,left:0},
+m={height:g,top:0,right:0,left:0},n={height:g,bottom:0,right:0,left:0},o={height:0,bottom:0,right:0,left:0};if(j)f=j.offsetHeight;if(k===0){e.top=0;e.bottom=g;b.set("layout",l);a.set("layout",n)}else if(k>=h-f-g){e.top=g;e.bottom=0;b.set("layout",m);a.set("layout",o)}else{e.top=g;e.bottom=g;b.set("layout",m);a.set("layout",n)}}if(b){b.set("isVisible",c);a.set("isVisible",c)}d.set("layout",e)},scrollerVisibilityDidChange:function(){this.tile()}.observes("isVerticalScrollerVisible","isHorizontalScrollerVisible",
+"verticalScrollOffset"),createChildViews:function(){var a=[],b,c;if(SC.none(b=this.containerView))b=SC.ContainerView;a.push(this.containerView=this.createChildView(b,{contentView:this.contentView}));this.contentView=this.containerView.get("contentView");if((b=this.verticalScrollerView)&&(c=this.verticalScrollerView2))if(this.get("hasVerticalScroller")){var d=this.get("controlSize")===SC.SMALL_CONTROL_SIZE?14:16;b=this.verticalScrollerView=this.createChildView(b,{layout:{top:0,left:0,right:0,height:d},
+scrollerThickness:d,valueBinding:"*owner.verticalScrollOffset"});a.push(b);c=this.verticalScrollerView2=this.createChildView(c,{scrollDown:YES,layout:{bottom:0,left:0,right:0,height:d},scrollerThickness:d,valueBinding:"*owner.verticalScrollOffset"});a.push(c)}else this.verticalScrollerView2=this.verticalScrollerView=null;this.childViews=a;this.contentViewFrameDidChange();this.tile()},init:function(){arguments.callee.base.apply(this,arguments);var a=this._scroll_contentView=this.get("contentView");
+a&&a.addObserver("frame",this,this.contentViewFrameDidChange);this.get("isVisibleInWindow")&&this._scsv_registerAutoscroll()},_scsv_registerAutoscroll:function(){this.get("isVisibleInWindow")?SC.Drag.addScrollableView(this):SC.Drag.removeScrollableView(this)}.observes("isVisibleInWindow"),contentViewFrameDidChange:function(){var a=this.get("contentView"),b,c=a?a.get("frame"):null,d=c?c.width:0;c=c?c.height:0;var e=this.get("frame");this._scroll_contentWidth=d;this._scroll_contentHeight=c;if(this.get("hasVerticalScroller")&&
+(a=this.get("verticalScrollerView"))&&(b=this.get("verticalScrollerView2"))){c-=1;this.get("autohidesVerticalScroller")&&this.set("isVerticalScrollerVisible",c>e.height);c-=this.get("verticalScrollerBottom");d=0;if(e=this.containerView.$()[0])d=e.offsetHeight;c-=d;a.setIfChanged("maximum",c);b.setIfChanged("maximum",c)}},_scroll_horizontalScrollOffsetDidChange:function(){},_scroll_verticalScrollOffsetDidChange:function(){var a=this.get("verticalScrollOffset"),b=this.get("contentView");b&&b.adjust("top",
+0-a)}.observes("verticalScrollOffset")});sc_require("views/button");
+SC.PopupButtonView=SC.ButtonView.extend({keyEquivalent:null,classNames:["sc-popup-button"],preferMatrix:null,acceptsFirstResponder:function(){return SC.SAFARI_FOCUS_BEHAVIOR?NO:this.get("isEnabled")}.property("isEnabled"),isSelected:NO,performKeyEquivalent:function(a,b){if(!this.get("isEnabled"))return NO;var c=this.get("menu");return!!c&&c.performKeyEquivalent(a,b)},menu:null,isSelectedBinding:"*menu.isVisibleInWindow",action:function(){var a=this.get("menu");if(!a)return NO;a.popup(this,this.preferMatrix);
+return YES},mouseDown:function(){if(!this.get("isEnabled"))return YES;this.set("isActive",YES);this._isMouseDown=YES;this._action();return YES}});
+SC.ProgressView=SC.View.extend(SC.Control,{value:0.5,valueBindingDefault:SC.Binding.single().notEmpty(),minimum:0,minimumBindingDefault:SC.Binding.single().notEmpty(),contentMinimumKey:null,maximum:1,maximumBindingDefault:SC.Binding.single().notEmpty(),offsetRange:24,contentMaximumKey:null,isIndeterminate:NO,isIndeterminateBindingDefault:SC.Binding.bool(),isRunning:NO,isRunningBindingDefault:SC.Binding.bool(),animatedBackgroundMatrix:[],contentIsIndeterminateKey:null,classNames:"sc-progress-view",
+_backgroundOffset:0,_currentBackground:1,_nextBackground:1,init:function(){arguments.callee.base.apply(this,arguments);this.animateProgressBar()},animateProgressBar:function(){this.get("isRunning")&&this.get("isVisibleInWindow")&&this._animateProgressBar(500)}.observes("isRunning","isVisibleInWindow"),_animateProgressBar:function(a){if(a===0)a=1E3/30;if(this.get("isRunning")&&this.get("isVisibleInWindow")){this.displayDidChange();this.invokeLater(this._animateProgressBar,a,30)}},displayProperties:"value minimum maximum isIndeterminate".w(),
+render:function(a,b){var c,d=this.get("isIndeterminate"),e=this.get("isRunning");c=this.get("isEnabled");var f=this.get("offsetRange");e=d&&e?Math.floor(Date.now()/75)%f-f:0;if(c)if(d)c="120%";else{f=this.get("minimum")||0;var g=this.get("maximum")||1;c=this.get("value")||0;c=(c-f)/(g-f);if(c>1)c=1;if(isNaN(c))c=0;if(c<f)c=0;if(c>g)c=1;c=c*100+"%"}else c="0%";d={"sc-indeterminate":d,"sc-empty":c<=0,"sc-complete":c>=100};if(b){b=this._createClassNameString(d);a.push('<div class="sc-inner ',b,'" style="width: ',
+c,";left: ",e,'px;">','<div class="sc-inner-head">',"</div>",'<div class="sc-inner-tail"></div></div>','<div class="sc-outer-head"></div>','<div class="sc-outer-tail"></div>')}else{a.setClass(d);a=this.$(".sc-inner");b=this.get("animatedBackgroundMatrix");c="width: "+c+"; ";c=c+"left: "+e+"px; ";if(b.length===3){a.css("backgroundPosition","0px -"+(b[0]+b[1]*this._currentBackground)+"px");if(this._currentBackground===b[2]-1||this._currentBackground===0)this._nextBackground*=-1;this._currentBackground+=
+this._nextBackground;c+="backgroundPosition: undefinedpx; "}a.attr("style",c)}},contentPropertyDidChange:function(a,b){a=this.get("content");this.beginPropertyChanges().updatePropertyFromContent("value",b,"contentValueKey",a).updatePropertyFromContent("minimum",b,"contentMinimumKey",a).updatePropertyFromContent("maximum",b,"contentMaximumKey",a).updatePropertyFromContent("isIndeterminate",b,"contentIsIndeterminateKey",a).endPropertyChanges()},_createClassNameString:function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&
+a[c]&&b.push(c);return b.join(" ")}});
+SC.RadioView=SC.View.extend(SC.Control,{classNames:["sc-radio-view"],value:null,layoutDirection:SC.LAYOUT_VERTICAL,escapeHTML:YES,items:[],itemTitleKey:null,itemValueKey:null,itemIsEnabledKey:null,itemIconKey:null,routeTouch:YES,itemsDidChange:function(){this._items&&this._items.removeObserver("[]",this,this.itemContentDidChange);(this._items=this.get("items"))&&this._items.addObserver("[]",this,this.itemContentDidChange);this.itemContentDidChange()}.observes("items"),itemContentDidChange:function(){this.notifyPropertyChange("_displayItems")},
+displayProperties:["value","_displayItems"],render:function(a,b){var c,d,e,f,g,h,j,k=this.get("_displayItems"),l=this.get("value"),m=SC.isArray(l);a.addClass(this.get("layoutDirection"));if(m&&l.length<=0){l=l[0];m=NO}if(b){a.attr("role","radiogroup");SC.guidFor(this);b=k.length;for(d=0;d<b;d++){c=k[d];if(e=c[3]){f=e.indexOf("/")>=0?e:SC.BLANK_IMAGE_URL;e=f===e?"":e;e='<img src="'+f+'" class="icon '+e+'" alt="" />'}else e="";g=c?m?l.indexOf(c[1])>=0:l===c[1]:NO;j=this._getSelectionStateClassNames(c,
+g,l,m,false);f=this.escapeHTML?SC.RenderContext.escapeHTML(c[0]):c[0];a.push('<div class="sc-radio-button ',j,'" ','aria-checked="',g?"true":"false",'" ','role="radio"',' index="',d,'">','<span class="button"></span>','<span class="sc-button-label">',e,f,"</span></div>")}}else this.$(".sc-radio-button").forEach(function(n){n=this.$(n);d=parseInt(n.attr("index"),0);g=(c=d>=0?k[d]:null)?m?l.indexOf(c[1])>=0:l===c[1]:NO;h=this._getSelectionStateClassNames(c,g,l,m,true);n.attr("aria-checked",g?"true":
+"false");n.setClass(h);d=h=null},this)},_displayItems:function(){var a=this.get("items"),b=this.get("localize"),c=this.get("itemTitleKey"),d=this.get("itemValueKey"),e=this.get("itemIsEnabledKey"),f=this.get("itemIconKey"),g=[],h=a?a.get("length"):0,j,k,l,m,n,o;for(m=0;m<h;m++){j=a.objectAt(m);if(SC.typeOf(j)===SC.T_ARRAY){k=j[0];l=j[1]}else if(j){k=c?j.get?j.get(c):j[c]:j.toString?j.toString():null;l=d?j.get?j.get(d):j[d]:j;n=e?j.get?j.get(e):j[e]:YES;o=f?j.get?j.get(f):j[f]:null}else{k=l=o=null;
+n=NO}if(b)k=k.loc();g.push([k,l,n,o])}return g}.property("items","itemTitleKey","itemValueKey","itemIsEnabledKey","localize","itemIconKey").cacheable(),_getSelectionStateClassNames:function(a,b,c,d,e){var f;a={sel:b&&!d,mixed:b&&d,disabled:!a[2]};if(e)return a;else{e=[];for(f in a)a.hasOwnProperty(f)&&a[f]&&e.push(f);return e.join(" ")}},mouseDown:function(a){if(!this.get("isEnabled"))return YES;for(a=a.target;a;){if(a.className&&a.className.indexOf("sc-radio-button")>-1)break;a=a.parentNode}if(!a)return NO;
+a=this.$(a);if(a.hasClass("disabled"))return YES;a.addClass("active");this._activeRadioButton=a;return YES},mouseUp:function(a){if(!this.get("isEnabled"))return YES;var b=this._activeRadioButton,c=a.target;a=this.get("_displayItems");if(b){b.removeClass("active");this._activeRadioButton=null}else return YES;for(;c;){if(c.className&&c.className.indexOf("sc-radio-button")>-1)break;c=c.parentNode}c=this.$(c);if(c[0]!==b[0]||c.hasClass("disabled"))return YES;b=parseInt(c.attr("index"),0);this.set("value",
+a[b][1])}});
+SC.SceneView=SC.ContainerView.extend({scenes:["master","detail"],nowShowing:null,transitionDuration:200,_state:"NO_VIEW",replaceContent:function(a){a&&this._state===this.READY?this.animateScene(a):this.replaceScene(a);return this},replaceScene:function(a){var b=this._targetView,c=this.STANDARD_LAYOUT,d=this.get("scenes");d=d?d.indexOf(this.get("nowShowing")):-1;this._targetView=a;this._targetIndex=d;this._timer&&this._timer.invalidate();this._timer=this._leftView=this._rightView=this._start=this._end=
+null;this.removeAllChildren();b&&b.set("layout",c);a&&a.set("layout",c);a&&this.appendChild(a);this._state=a?this.READY:this.NO_VIEW},animateScene:function(a){var b=this._targetView,c=this._targetIndex,d=this.get("scenes");d=d?d.indexOf(this.get("nowShowing")):-1;if(c<0||d<0||c===d)return this.replaceScene(a);this._targetView=a;this._targetIndex=d;if(d>c){this._leftView=b;this._rightView=a;this._target=-1}else{this._leftView=a;this._rightView=b;this._target=1}this.removeAllChildren();b&&this.appendChild(b);
+a&&this.appendChild(a);this._start=Date.now();this._end=this._start+this.get("transitionDuration");this._state=this.ANIMATING;this.tick()},tick:function(){this._timer=null;var a=(Date.now()-this._start)/(this._end-this._start),b=this._target,c=this._leftView,d=this._rightView,e;if(a<0)a=0;if(!this.get("isVisibleInWindow")||a>=1)return this.replaceScene(this._targetView);e=SC.clone(this.get("frame"));a=Math.floor(e.width*a);if(b>0){e.left=0-(e.width-a);c.set("layout",e);e=SC.clone(e);e.left=a}else{e.left=
+0-a;c.set("layout",e);e=SC.clone(e);e.left=e.width-a}d.set("layout",e);this._timer=this.invokeLater(this.tick,20);return this},NO_VIEW:"NO_VIEW",ANIMATING:"ANIMATING",READY:"READY",STANDARD_LAYOUT:{top:0,left:0,bottom:0,right:0}});
+SC.SegmentedView=SC.View.extend(SC.Control,{classNames:["sc-segmented-view"],theme:"square",value:null,isEnabled:YES,allowsEmptySelection:NO,allowsMultipleSelection:NO,localize:YES,align:SC.ALIGN_CENTER,layoutDirection:SC.LAYOUT_HORIZONTAL,items:[],itemTitleKey:null,itemValueKey:null,itemIsEnabledKey:null,itemIconKey:null,itemWidthKey:null,itemActionKey:null,itemTargetKey:null,itemKeyEquivalentKey:null,itemKeys:"itemTitleKey itemValueKey itemIsEnabledKey itemIconKey itemWidthKey itemToolTipKey".w(),
+displayItems:function(){var a=this.get("items"),b=this.get("localize"),c=null,d,e,f=[],g=a.get("length"),h,j,k=SC._segmented_fetchKeys,l=SC._segmented_fetchItem;for(h=0;h<g;h++){j=a.objectAt(h);if(!SC.none(j)){d=SC.typeOf(j);if(d===SC.T_STRING)e=[j.humanize().titleize(),j,YES,null,null,null,h];else if(d!==SC.T_ARRAY){if(c===null)c=this.itemKeys.map(k,this);e=c.map(l,j);e[e.length]=h;if(!c[0]&&j.toString)e[0]=j.toString();c[1]||(e[1]=j);c[2]||(e[2]=YES)}if(b&&e[0])e[0]=e[0].loc();if(b&&e[5]&&SC.typeOf(e[5])===
+SC.T_STRING)e[5]=e[5].loc();f[f.length]=e}}return f}.property("items","itemTitleKey","itemValueKey","itemIsEnabledKey","localize","itemIconKey","itemWidthKey","itemToolTipKey"),itemsDidChange:function(){this._items&&this._items.removeObserver("[]",this,this.itemContentDidChange);(this._items=this.get("items"))&&this._items.addObserver("[]",this,this.itemContentDidChange);this.itemContentDidChange()}.observes("items"),itemContentDidChange:function(){this.notifyPropertyChange("displayItems")},init:function(){arguments.callee.base.apply(this,
+arguments);this.itemsDidChange()},displayProperties:["displayItems","value","activeIndex"],render:function(a,b){var c=this.get("displayItems"),d=this._seg_displayItems,e=this.get("theme");e&&a.addClass(e);if(b||c!==d){this._seg_displayItems=c;this.renderDisplayItems(a,c);a.addStyle("text-align",this.get("align"))}else{a=this.get("activeIndex");b=this.get("value");if((d=SC.isArray(b))&&b.get("length")===1){b=b.objectAt(0);d=NO}e={};for(var f=c.length,g=this.$(".sc-segment"),h;--f>=0;){h=c[f];e.sel=
+d?b.indexOf(h[1])>=0:h[1]===b;e.active=a===f;e.disabled=!h[2];SC.$(g[f]).setClass(e)}}},renderDisplayItems:function(a,b){var c=this.get("value"),d=SC.isArray(c),e=this.get("activeIndex"),f=b.length,g,h,j,k,l,m,n,o;for(m=0;m<f;m++){k=a.begin("a").attr("role","button");l=b[m];g=l[0];h=l[3];j=l[5];n={};o=[];if(this.get("layoutDirection")==SC.LAYOUT_HORIZONTAL)n.display="inline-block";o.push("sc-segment");l[2]||o.push("disabled");m===0&&o.push("sc-first-segment");m===f-1&&o.push("sc-last-segment");m!==
+0&&m!==f-1&&o.push("sc-middle-segment");if(d?c.indexOf(l[1])>=0:l[1]===c)o.push("sel");e===m&&o.push("active");if(l[4]){l=l[4];n.width=l+"px"}k.addClass(o);k.addStyle(n);j&&k.attr("title",j);if(h){j=h.indexOf("/")>=0?h:SC.BLANK_IMAGE_URL;h=j===h?"":h;h='<img src="'+j+'" alt="" class="icon '+h+'" />'}else h="";k.push('<span class="sc-button-inner"><label class="sc-button-label">',h+g,"</label></span>");k.end()}},displayItemIndexForEvent:function(a){a=SC.$(a.target);if(!a||a===document)return-1;for(var b=
+this.$(),c=null;!c&&a.length>0&&a[0]!==b[0];)if(a.hasClass("sc-segment"))c=a;else a=a.parent();return c?this.$(".sc-segment").index(c):-1},keyDown:function(a){var b,c,d,e,f;if(a.which===9){(c=a.shiftKey?this.get("previousValidKeyView"):this.get("nextValidKeyView"))?c.becomeFirstResponder():a.allowDefault();return YES}if(!this.get("allowsMultipleSelection")&&!this.get("allowsEmptySelection")){c=this.get("displayItems");d=c.length;e=this.get("value");f=SC.isArray(e);if(a.which===39||a.which===40){for(a=
+0;a<d-1;a++){b=c[a];if(f?e.indexOf(b[1])>=0:b[1]===e)this.triggerItemAtIndex(a+1)}return YES}else if(a.which===37||a.which===38){for(a=1;a<d;a++){b=c[a];if(f?e.indexOf(b[1])>=0:b[1]===e)this.triggerItemAtIndex(a-1)}return YES}}return YES},mouseDown:function(a){if(!this.get("isEnabled"))return YES;a=this.displayItemIndexForEvent(a);if(a>=0){this._isMouseDown=YES;this.set("activeIndex",a)}return YES},mouseUp:function(a){a=this.displayItemIndexForEvent(a);this._isMouseDown&&a>=0&&this.triggerItemAtIndex(a);
+this._isMouseDown=NO;this.set("activeIndex",-1);return YES},mouseMoved:function(a){a=this.displayItemIndexForEvent(a);this._isMouseDown&&this.set("activeIndex",a);return YES},mouseOver:function(a){a=this.displayItemIndexForEvent(a);this._isMouseDown&&this.set("activeIndex",a);return YES},mouseOut:function(){this._isMouseDown&&this.set("activeIndex",-1);return YES},triggerItemAtIndex:function(a){a=this.get("displayItems").objectAt(a);var b,c,d,e,f;if(!a[2])return this;e=this.get("allowsEmptySelection");
+f=this.get("allowsMultipleSelection");b=a[1];c=d=this.get("value");SC.isArray(c)||(c=[c]);if(f)if(c.indexOf(b)>=0){if(c.get("length")>1||c.objectAt(0)!==b||e)c=c.without(b)}else c=c.concat([b]);else c=e&&c.get("length")===1&&c.objectAt(0)===b?[]:[b];switch(c.get("length")){case 0:c=null;break;case 1:c=c.objectAt(0);break;default:break}b=this.get("itemActionKey");e=this.get("itemTargetKey");var g;f=null;var h=this.getPath("pane.rootResponder");if(b&&(a=this.get("items").objectAt(a[6]))){g=a.get?a.get(b):
+a[b];if(e)f=a.get?a.get(e):a[e];h&&h.sendAction(g,f,this,this.get("pane"))}!g&&d!==undefined&&this.set("value",c);(g=this.get("action"))&&h&&h.sendAction(g,this.get("target"),this,this.get("pane"))},acceptsFirstResponder:function(){return SC.SAFARI_FOCUS_BEHAVIOR?NO:this.get("isEnabled")}.property("isEnabled"),willBecomeKeyResponderFrom:function(){if(!this._isFocused){this._isFocused=YES;this.becomeFirstResponder();this.get("isVisibleInWindow")&&this.$()[0].focus()}},willLoseKeyResponderTo:function(){if(this._isFocused)this._isFocused=
+NO}});SC._segmented_fetchKeys=function(a){return this.get(a)};SC._segmented_fetchItem=function(a){if(!a)return null;return this.get?this.get(a):this[a]};sc_require("views/button");
+SC.SelectView=SC.ButtonView.extend({items:[],itemsBindingDefault:SC.Binding.multiple(),itemTitleKey:null,itemSortKey:null,itemValueKey:null,itemIconKey:null,itemSeparatorKey:"separator",localize:YES,disableSort:YES,classNames:["sc-select-view"],_itemList:[],_currentSelItem:null,_itemIdx:null,value:null,showCheckbox:YES,_defaultVal:null,_defaultTitle:null,_defaultIcon:null,theme:"popup",displayProperties:["icon","value","controlSize","items"],preferMatrix:null,CUSTOM_MENU_ITEM_HEIGHT:20,isSelectedBinding:"*menu.isVisibleInWindow",
+positionMenuBelow:NO,lastMenuWidth:null,exampleView:null,customViewMenuOffsetWidth:0,needsEllipsis:YES,menuPaneHeightPadding:0,menuItemPadding:35,leftAlign:function(){var a=0,b=this.get("controlSize");if(b===SC.SMALL_CONTROL_SIZE)a=-14;if(b===SC.REGULAR_CONTROL_SIZE)a=-16;return a}.property("controlSize"),sortObjects:function(a){if(!this.get("disableSort")){var b=this.get("itemSortKey")||this.get("itemTitleKey");a=a.sort(function(c,d){if(b){c=c.get?c.get(b):c[b];d=d.get?d.get(b):d[b]}return c<d?-1:
+c>d?1:0})}return a},render:function(a,b){arguments.callee.base.apply(this,arguments);var c,d,e,f,g,h,j,k,l,m,n,o,q,t,r;c=this.get("items");c=this.sortObjects(c);d=this.get("itemTitleKey");e=this.get("itemIconKey");f=this.get("itemValueKey");g=this.get("itemSeparatorKey");h=this.get("showCheckbox");j=this.get("value");k=this.get("localize");m=[];n=YES;o=0;c.forEach(function(s){if(s){q=d?s.get?s.get(d):s[d]:s.toString();q=k?q.loc():q;t=e?s.get?s.get(e):s[e]:null;if(SC.none(s[e]))t=null;r=f?s.get?s.get(f):
+s[f]:s;if(!SC.none(j)&&!SC.none(r))if(j===r){this.set("title",q);this.set("icon",t)}if(r===this.get("value")){this.set("_itemIdx",o);n=!h?NO:YES}else n=NO;l=g?s.get?s.get(g):s[g]:NO;if(o===0){this._defaultVal=r;this._defaultTitle=q;this._defaultIcon=t}s=SC.Object.create({separator:l,title:q,icon:t,value:r,isEnabled:YES,checkbox:n,action:this.displaySelectedItem});m.push(s)}o+=1;this.set("_itemList",m)},this);b&&this.invokeLast(function(){var s=this.get("value");if(SC.none(s)){this.set("value",this._defaultVal);
+this.set("title",this._defaultTitle);this.set("icon",this._defaultIcon)}});this.changeSelectButtonPreferMatrix(this._itemIdx)},_action:function(){var a,b,c,d,e,f;a=this.$(".sc-button-label")[0];b=this.get("layer").offsetWidth;c=a.scrollWidth;d=this.get("lastMenuWidth");if(c){a=a.offsetWidth;if(c&&a)b=b+c-a}if(!d||b>d)d=b;b=this.get("_itemList");c=this.get("customViewClassName");this.get("customViewMenuOffsetWidth");a="sc-view sc-pane sc-panel sc-palette sc-picker sc-menu select-button sc-scroll-view sc-menu-scroll-view sc-container-view menuContainer sc-button-view sc-menu-item sc-regular-size";
+a=c?a+" "+c:a;SC.prepareStringMeasurement("",a);c=0;for(a=b.length;c<a;++c){e=b.objectAt(c);e=SC.measureString(e.title).width;if(!f||e>f)f=e}SC.teardownStringMeasurement();d=f+this.menuItemPadding>d?f+this.menuItemPadding:d;f=SC.RootResponder.responder.get("currentWindowSize").width;if(d>f)d=f-25;this.set("lastMenuWidth",d);f=this.get("_currentSelItem");b=this.get("_itemList");c=this.get("controlSize");a=this.get("menuPaneHeightPadding");e=this.get("exampleView");d=SC.MenuPane.create({classNames:["select-button"],
+items:b,exampleView:e?e:SC.MenuItemView,isEnabled:YES,menuHeightPadding:a,preferType:SC.PICKER_MENU,itemHeightKey:"height",layout:{width:d},controlSize:c,itemWidth:d,contentView:SC.View.extend({})});if(!d)return NO;d.popup(this,this.preferMatrix);d.set("currentSelectedMenuItem",f);return YES},displaySelectedItem:function(){var a,b,c,d,e=0,f,g,h=null;a=this.parentMenu();b=a.get("currentSelectedMenuItem");c=a.menuItemViews;if(b&&c)e=c.indexOf(b);c=a.get("anchor");f=a.get("items");for(g=f.length;!h&&
+--g>=0;){d=f[g];a=!SC.none(d.title)?d.title:f.toString();d=!SC.none(d.value)?d.value:a;if(a===this.get("value")&&e===g){h=f;c.set("value",d);c.set("title",a)}}c.set("icon",this.get("icon")).set("_currentSelItem",b).set("_itemIdx",e)},changeSelectButtonPreferMatrix:function(){var a=0,b=this.get("_itemIdx"),c=this.get("leftAlign");if(this.get("positionMenuBelow")){a=[c,4,3];this.set("preferMatrix",a)}else{if(b)a=b*this.CUSTOM_MENU_ITEM_HEIGHT;a=[c,-a,2];this.set("preferMatrix",a)}},mouseDown:function(){if(!this.get("isEnabled"))return YES;
+this.set("isActive",YES);this._isMouseDown=YES;this.becomeFirstResponder();this._action();return YES},keyDown:function(a){if(this.interpretKeyEvents(a))return YES;else arguments.callee.base.apply(this,arguments)},interpretKeyEvents:function(a){if(a)if(a.keyCode===38||a.keyCode===40)this._action();else a.keyCode===27&&this.resignFirstResponder();return arguments.callee.base.apply(this,arguments)}});
+SC.SelectFieldView=SC.FieldView.extend({tagName:"select",classNames:["sc-select-field-view"],objects:[],objectsBindingDefault:SC.Binding.multiple(),nameKey:null,sortKey:null,valueKey:null,emptyName:null,localize:false,cpDidChange:YES,disableSort:NO,validateMenuItem:function(){return true},sortObjects:function(a){if(!this.get("disableSort")){var b=this.get("sortKey")||this.get("nameKey");a=a.sort(function(c,d){if(b){c=c.get?c.get(b):c[b];d=d.get?d.get(b):d[b]}return c<d?-1:c>d?1:0})}return a},render:function(a,
+b){if(this.get("cpDidChange")){this.set("cpDidChange",NO);var c=this.get("nameKey"),d=this.get("valueKey"),e=this.get("objects"),f=this.get("value"),g,h,j=this.get("localize");if(!d&&f)f=SC.guidFor(f);if(f===null||f==="")f="***";if(e){e=this.sortObjects(e);if(!b){h=this.$input()[0];h.innerHTML=""}var k=this.get("emptyName");if(k){if(j)k=k.loc();if(b)a.push('<option value="***">'+k+"</option>",'<option disabled="disabled"></option>');else{g=document.createElement("option");g.value="***";g.innerHTML=
+k;h.appendChild(g);g=document.createElement("option");g.disabled="disabled";h.appendChild(g)}}e.forEach(function(l){if(l){var m=c?l.get?l.get(c):l[c]:l.toString();if(j)m=m.loc();if(l=d?l.get?l.get(d):l[d]:l)l=SC.guidFor(l)?SC.guidFor(l):l.toString();var n=this.validateMenuItem&&this.validateMenuItem(l,m)?"":'disabled="disabled" ';if(b)a.push("<option "+n+'value="'+l+'">'+m+"</option>");else{g=document.createElement("option");g.value=l;g.innerHTML=m;if(n.length>0)g.disable="disabled";h.appendChild(g)}}else if(b)a.push('<option disabled="disabled"></option>');
+else{g=document.createElement("option");g.disabled="disabled";h.appendChild(g)}},this);this.setFieldValue(f)}else this.set("value",null)}},displayProperties:["objects","nameKey","valueKey"],_objectsObserver:function(){this.set("cpDidChange",YES)}.observes("objects"),_nameKeyObserver:function(){this.set("cpDidChange",YES)}.observes("nameKey"),_valueKeyObserver:function(){this.set("cpDidChange",YES)}.observes("valueKey"),$input:function(){return this.$()},mouseDown:function(a){if(this.get("isEnabled"))return arguments.callee.base.apply(this,
+arguments);else{a.stop();return YES}},getFieldValue:function(){var a=arguments.callee.base.apply(this,arguments),b=this.get("valueKey"),c=this.get("objects"),d,e;if(a=="***")a=null;else if(a&&c){var f=SC.typeOf(c.length)===SC.T_FUNCTION?c.length():c.length;for(d=null;!d&&--f>=0;){e=c.objectAt?c.objectAt(f):c[f];if(b)e=e.get?e.get(b):e[b];var g=e?SC.guidFor(e)?SC.guidFor(e):e.toString():null;if(a==g)d=e}}return b||d?d:a},setFieldValue:function(a){a=SC.none(a)?"":a?SC.guidFor(a)?SC.guidFor(a):a.toString():
+null;this.$input().val(a);return this},fieldDidFocus:function(){this.get("isFocused")||this.set("isFocused",true)},fieldDidBlur:function(){this.get("isFocused")&&this.set("isFocused",false)},_isFocusedObserver:function(){this.$().setClass("focus",this.get("isFocused"))}.observes("isFocused"),didCreateLayer:function(){var a=this.$input();if(this.get("isEnabled")===false)this.$()[0].disabled=true;SC.Event.add(a,"blur",this,this.fieldDidBlur);SC.Event.add(a,"focus",this,this.fieldDidFocus);return arguments.callee.base.apply(this,
+arguments)},willDestroyLayer:function(){var a=this.$input();SC.Event.remove(a,"focus",this,this.fieldDidFocus);SC.Event.remove(a,"blur",this,this.fieldDidBlur);return arguments.callee.base.apply(this,arguments)}});
+SC.SliderView=SC.View.extend(SC.Control,{classNames:"sc-slider-view",handleSelector:"img.sc-handle",value:0.5,valueBindingDefault:SC.Binding.single().notEmpty(),minimum:0,minimumBindingDefault:SC.Binding.single().notEmpty(),contentMinimumKey:null,maximum:1,maximumBindingDefault:SC.Binding.single().notEmpty(),contentMaximumKey:null,step:0.1,displayProperties:"value minimum maximum".w(),render:function(a,b){arguments.callee.base.apply(this,arguments);var c=this.get("minimum"),d=this.get("maximum"),
+e=this.get("value"),f=this.get("step");e=Math.min(Math.max(e,c),d);if(!SC.none(f)&&f!==0)e=Math.round(e/f)*f;if(e!==0)e=Math.floor((e-c)/(d-c)*100);b?a.push('<span class="sc-inner">','<span class="sc-leftcap"></span>','<span class="sc-rightcap"></span>','<img src="',SC.BLANK_IMAGE_URL,'" class="sc-handle" style="left: ',e,'%" />',"</span>"):this.$(this.get("handleSelector")).css("left",e+"%")},_isMouseDown:NO,mouseDown:function(a){if(!this.get("isEnabled"))return YES;this.set("isActive",YES);this._isMouseDown=
+YES;return this._triggerHandle(a)},mouseDragged:function(a){return this._isMouseDown?this._triggerHandle(a):YES},mouseUp:function(a){this._isMouseDown&&this.set("isActive",NO);a=this._isMouseDown?this._triggerHandle(a):YES;this._isMouseDown=NO;return a},_triggerHandle:function(a){var b=this.get("frame").width,c=this.get("minimum"),d=this.get("maximum"),e=this.get("step"),f=this.get("value");a=this.convertFrameFromView({x:a.pageX}).x;a=Math.max(Math.min(a,b-8),8)-8;b-=16;a/=b;a=c+(d-c)*a;if(e!==0)a=
+Math.round(a/e)*e;Math.abs(f-a)>=0.01&&this.set("value",a);return YES},acceptsFirstResponder:function(){return SC.SAFARI_FOCUS_BEHAVIOR?NO:this.get("isEnabled")}.property("isEnabled"),willBecomeKeyResponderFrom:function(){if(!this._isFocused){this._isFocused=YES;this.becomeFirstResponder();this.get("isVisibleInWindow")&&this.$()[0].focus()}},willLoseKeyResponderTo:function(){if(this._isFocused)this._isFocused=NO},keyDown:function(a){if(a.which===9){var b=a.shiftKey?this.get("previousValidKeyView"):
+this.get("nextValidKeyView");b?b.becomeFirstResponder():a.allowDefault();return YES}if(a.which===37||a.which===38||a.which===39||a.which===40){b=this.get("minimum");var c=this.get("maximum"),d=this.get("step"),e=c-b,f=0;if(a.which===37||a.which===38)if(d===0)if(e<100)f=this.get("value")-1;else{Math.abs(e/100);f=this.get("value")-Math.abs(e/100)}else f=this.get("value")-d;if(a.which===39||a.which===40)if(d===0)if(e<100)f=this.get("value")+2;else{a=Math.abs(e/100);if(a<2)a=2;f=this.get("value")+a}else f=
+this.get("value")+d;f>=b&&f<=c&&this.set("value",f)}SC.RunLoop.begin().end();return YES},contentPropertyDidChange:function(a,b){a=this.get("content");this.beginPropertyChanges().updatePropertyFromContent("value",b,"contentValueKey",a).updatePropertyFromContent("minimum",b,"contentMinimumKey",a).updatePropertyFromContent("maximum",b,"contentMaximumKey",a).updatePropertyFromContent("isIndeterminate",b,"contentIsIndeterminateKey",a).endPropertyChanges()}});sc_require("mixins/collection_group");sc_require("views/disclosure");
+SC.SourceListGroupView=SC.View.extend(SC.Control,SC.CollectionGroup,{classNames:["sc-source-list-group"],content:null,isGroupVisible:YES,hasGroupTitle:YES,groupTitleKey:null,groupVisibleKey:null,render:function(a){a.push('<div role="button" class="sc-source-list-label sc-disclosure-view sc-button-view button disclosure no-disclosure">','<img src="'+SC.BLANK_IMAGE_URL+'" class="button" />','<span class="label"></span></div>')},createChildViews:function(){},contentPropertyDidChange:function(a,b){var c=
+this.get("content");a=this.outlet("labelView");if(c===null){a.setIfChanged("isVisible",NO);this.setIfChanged("hasGroupTitle",NO)}else{a.setIfChanged("isVisible",YES);this.setIfChanged("hasGroupTitle",YES);var d=this.getDelegateProperty("groupTitleKey",this.displayDelegate);if(b=="*"||d&&b==d){d=c&&c.get&&d?c.get(d):c;if(d!=this._title){if(this._title=d)d=d.capitalize();a.set("title",d)}}d=this.getDelegateProperty("groupVisibleKey",this.displayDelegate);if(b=="*"||d&&b==d)if(d){a.removeClassName("no-disclosure");
+b=c&&c.get?!!c.get(d):YES;if(b!=this.get("isGroupVisible")){this.set("isGroupVisible",b);a.set("value",b)}}else a.addClassName("no-disclosure")}},disclosureValueDidChange:function(a){if(a!=this.get("isGroupVisible")){var b=this.get("content"),c=this.getDelegateProperty("groupVisibleKey",this.displayDelegate);b&&b.set&&c&&b.set(c,a);this.set("isGroupVisible",a);this.owner&&this.owner.updateChildren&&this.owner.updateChildren(true)}},labelView:SC.DisclosureView.extend({value:YES,_valueObserver:function(){this.owner&&
+this.owner.disclosureValueDidChange(this.get("value"))}.observes("value")})});sc_require("views/list");sc_require("views/source_list_group");SC.BENCHMARK_SOURCE_LIST_VIEW=YES;SC.SourceListView=SC.ListView.extend({classNames:["sc-source-list"],rowHeight:32,selectOnMouseDown:NO,actOnSelect:YES});sc_require("views/split");
+SC.SplitDividerView=SC.View.extend({classNames:["sc-split-divider-view"],prepareContext:function(){var a=this.get("splitView");a&&this.set("cursor",a.get("thumbViewCursor"));return arguments.callee.base.apply(this,arguments)},mouseDown:function(a){var b=this.get("splitView");return b?b.mouseDownInThumbView(a,this):arguments.callee.base.apply(this,arguments)},doubleClick:function(a){var b=this.get("splitView");return b?b.doubleClickInThumbView(a,this):arguments.callee.base.apply(this,arguments)}});
+sc_require("views/split_divider");SC.RESIZE_BOTH="resize-both";SC.RESIZE_TOP_LEFT="resize-top-left";SC.RESIZE_BOTTOM_RIGHT="resize-bottom-right";
+SC.SplitView=SC.View.extend({classNames:["sc-split-view"],displayProperties:["layoutDirection"],delegate:null,layoutDirection:SC.LAYOUT_HORIZONTAL,canCollapseViews:YES,autoresizeBehavior:SC.RESIZE_BOTTOM_RIGHT,defaultThickness:0.5,isSplitView:YES,topLeftView:SC.View,dividerView:SC.SplitDividerView,bottomRightView:SC.View,topLeftThickness:function(){var a=this.get("topLeftView");return a?this.thicknessForView(a):0}.property("topLeftView").cacheable(),bottomRightThickness:function(){var a=this.get("bottomRightView");
+return a?this.thicknessForView(a):0}.property("bottomRightView").cacheable(),thumbViewCursor:null,canCollapseView:function(a){return this.invokeDelegateMethod(this.delegate,"splitViewCanCollapse",this,a)},thicknessForView:function(a){var b=this.get("layoutDirection");a=a.get("frame");return b===SC.LAYOUT_HORIZONTAL?a.width:a.height},createChildViews:function(){var a=[],b=["topLeftView","dividerView","bottomRightView"],c,d,e;d=0;for(e=b.length;d<e;++d)if(c=this.get(b[d])){c=this[b[d]]=this.createChildView(c,
+{layoutView:this,rootElementPath:[d]});a.push(c)}this.set("childViews",a);return this},updateChildLayout:function(){var a=this.get("topLeftView"),b=this.get("bottomRightView"),c=this.get("dividerView"),d=this.get("layoutDirection"),e=this._desiredTopLeftThickness,f=this.get("dividerThickness");f=!SC.none(f)?f:7;var g=(d===SC.LAYOUT_HORIZONTAL?this.get("frame").width:this.get("frame").height)-f-e,h=this.get("autoresizeBehavior"),j;j=a.get("isCollapsed")||NO;a.setIfChanged("isVisible",!j);j=SC.clone(a.get("layout"));
+if(d===SC.LAYOUT_HORIZONTAL){j.top=0;j.left=0;j.bottom=0;switch(h){case SC.RESIZE_BOTH:throw"SC.RESIZE_BOTH is currently unsupported.";case SC.RESIZE_TOP_LEFT:j.right=g+f;delete j.width;break;case SC.RESIZE_BOTTOM_RIGHT:delete j.right;delete j.height;j.width=e;break}}else{j.top=0;j.left=0;j.right=0;switch(h){case SC.RESIZE_BOTH:throw"SC.RESIZE_BOTH is currently unsupported.";case SC.RESIZE_TOP_LEFT:j.bottom=g+f;delete j.height;break;case SC.RESIZE_BOTTOM_RIGHT:delete j.bottom;delete j.width;j.height=
+e;break}}a.set("layout",j);if(c){j=SC.clone(c.get("layout"));if(d===SC.LAYOUT_HORIZONTAL){j.width=f;delete j.height;j.top=0;j.bottom=0;switch(h){case SC.RESIZE_BOTH:throw"SC.RESIZE_BOTH is currently unsupported.";case SC.RESIZE_TOP_LEFT:delete j.left;j.right=g;delete j.centerX;delete j.centerY;break;case SC.RESIZE_BOTTOM_RIGHT:j.left=e;delete j.right;delete j.centerX;delete j.centerY;break}}else{delete j.width;j.height=f;j.left=0;j.right=0;switch(h){case SC.RESIZE_BOTH:throw"SC.RESIZE_BOTH is currently unsupported.";
+case SC.RESIZE_TOP_LEFT:delete j.top;j.bottom=g;delete j.centerX;delete j.centerY;break;case SC.RESIZE_BOTTOM_RIGHT:j.top=e;delete j.bottom;delete j.centerX;delete j.centerY;break}}c.set("layout",j)}j=b.get("isCollapsed")||NO;b.setIfChanged("isVisible",!j);j=SC.clone(b.get("layout"));if(d===SC.LAYOUT_HORIZONTAL){j.top=0;j.bottom=0;j.right=0;switch(h){case SC.RESIZE_BOTH:throw"SC.RESIZE_BOTH is currently unsupported.";case SC.RESIZE_BOTTOM_RIGHT:j.left=e+f;delete j.width;break;case SC.RESIZE_TOP_LEFT:delete j.left;
+j.width=g;break}}else{j.left=0;j.right=0;j.bottom=0;switch(h){case SC.RESIZE_BOTH:throw"SC.RESIZE_BOTH is currently unsupported.";case SC.RESIZE_BOTTOM_RIGHT:j.top=e+f;delete j.height;break;case SC.RESIZE_TOP_LEFT:delete j.top;j.height=g;break}}b.set("layout",j);this.notifyPropertyChange("topLeftThickness").notifyPropertyChange("bottomRightThickness")},renderLayout:function(a,b){if(b||this._recalculateDivider){this.get("thumbViewCursor")||this.set("thumbViewCursor",SC.Cursor.create());var c=this.get("layoutDirection"),
+d=this.get("frame"),e=this.$(),f=this.get("defaultThickness"),g=this.get("autoresizeBehavior"),h=this.get("dividerThickness");h=!SC.none(h)?h:7;if(this._recalculateDivider===undefined&&f<1)this._recalculateDivider=YES;else if(this._recalculateDivider)this._recalculateDivider=NO;c=e[0]?c===SC.LAYOUT_HORIZONTAL?e[0].offsetWidth:e[0].offsetHeight:c===SC.LAYOUT_HORIZONTAL?d.width:d.height;if(SC.none(f)||f>0&&f<1)f=Math.floor((c-h)*(f||0.5));this._desiredTopLeftThickness=g===SC.RESIZE_BOTTOM_RIGHT?f:c-
+h-f;this._topLeftView=this.get("topLeftView");this._bottomRightView=this.get("bottomRightView");this._topLeftViewThickness=this.thicknessForView(this.get("topLeftView"));this._bottomRightThickness=this.thicknessForView(this.get("bottomRightView"));this._dividerThickness=this.get("dividerThickness");this._layoutDirection=this.get("layoutDirection");this._updateTopLeftThickness(0);this._setCursorStyle();this.updateChildLayout()}arguments.callee.base.apply(this,arguments)},render:function(a){arguments.callee.base.apply(this,
+arguments);this._inLiveResize&&this._setCursorStyle();this.get("layoutDirection")===SC.LAYOUT_HORIZONTAL?a.addClass("sc-horizontal"):a.addClass("sc-vertical")},mouseDownInThumbView:function(a,b){var c=this.getPath("pane.rootResponder");if(!c)return NO;c.dragDidStart(this);this._mouseDownX=a.pageX;this._mouseDownY=a.pageY;this._thumbView=b;this._topLeftView=this.get("topLeftView");this._bottomRightView=this.get("bottomRightView");this._topLeftViewThickness=this.thicknessForView(this.get("topLeftView"));
+this._bottomRightThickness=this.thicknessForView(this.get("bottomRightView"));this._dividerThickness=this.get("dividerThickness");this._layoutDirection=this.get("layoutDirection");this.beginLiveResize();return this._inLiveResize=YES},mouseDragged:function(a){this._updateTopLeftThickness(this._layoutDirection===SC.LAYOUT_HORIZONTAL?a.pageX-this._mouseDownX:a.pageY-this._mouseDownY);return YES},mouseUp:function(){if(this._inLiveResize===YES){this._thumbView=null;this._inLiveResize=NO;this.endLiveResize();
+return YES}return NO},doubleClickInThumbView:function(){var a=this._topLeftView,b=a.get("isCollapsed")||NO;if(!b&&!this.canCollapseView(a)){a=this._bottomRightView;b=a.get("isCollapsed")||NO;if(!b&&!this.canCollapseView(a))return NO}if(b){a===this._topLeftView?this._updateTopLeftThickness(this._uncollapsedThickness):this._updateBottomRightThickness(this._uncollapsedThickness);a._uncollapsedThickness=null}else{this._uncollapsedThickness=this.thicknessForView(a);a===this._topLeftView?this._updateTopLeftThickness(this.topLeftThickness()*
+-1):this._updateBottomRightThickness(this.bottomRightThickness()*-1);if(!a.get("isCollapsed"))this._uncollapsedThickness=null}this._setCursorStyle();return true},_updateTopLeftThickness:function(a){var b=this._topLeftView,c=this._bottomRightView,d=this.thicknessForView(b),e=this.thicknessForView(c),f=this._dividerThickness,g=0;a=this._topLeftViewThickness+a;this.canCollapseView(c);var h=a,j=this.get("topLeftMaxThickness"),k=this.get("topLeftMinThickness");b.get("isCollapsed")||(g+=d);c.get("isCollapsed")||
+(g+=e);SC.none(j)||(h=Math.min(j,h));SC.none(k)||(h=Math.max(k,h));j=this.get("bottomRightMaxThickness");k=this.get("bottomRightMinThickness");h=g-h;SC.none(j)||(h=Math.min(j,h));SC.none(k)||(h=Math.max(k,h));h=g-h;h=this.invokeDelegateMethod(this.delegate,"splitViewConstrainThickness",this,b,h);h=Math.min(h,g);h=Math.max(0,h);(d=b.get("collapseAtThickness"))||(d=0);e=c.get("collapseAtThickness");e=SC.none(e)?g:g-e;if(a<=d&&this.canCollapseView(b)){j=c.get("maxThickness");if(!j||f+g<=j)h=0}else if(a>=
+e&&this.canCollapseView(c)){j=b.get("maxThickness");if(!j||f+g<=j)h=g}if(h!=this.thicknessForView(b)){this._desiredTopLeftThickness=h;b.set("isCollapsed",h===0);c.set("isCollapsed",h>=g);this.updateChildLayout();this.displayDidChange()}},_updateBottomRightThickness:function(a){var b=this._topLeftView,c=this._bottomRightView,d=this.thicknessForView(b),e=this.thicknessForView(c),f=this._dividerThickness,g=0;a=this._topLeftViewThickness+a;this.canCollapseView(c);var h=a,j=this.get("topLeftMaxThickness"),
+k=this.get("topLeftMinThickness");b.get("isCollapsed")||(g+=d);c.get("isCollapsed")||(g+=e);SC.none(j)||(h=Math.min(j,h));SC.none(k)||(h=Math.max(k,h));j=this.get("bottomRightMaxThickness");k=this.get("bottomRightMinThickness");h=g-h;SC.none(j)||(h=Math.min(j,h));SC.none(k)||(h=Math.max(k,h));h=g-h;h=this.invokeDelegateMethod(this.delegate,"splitViewConstrainThickness",this,b,h);h=Math.min(h,g);h=Math.max(0,h);(d=b.get("collapseAtThickness"))||(d=0);e=c.get("collapseAtThickness");e=SC.none(e)?g:g-
+e;if(a<=d&&this.canCollapseView(b)){j=c.get("maxThickness");if(!j||f+g<=j)h=0}else if(a>=e&&this.canCollapseView(c)){j=b.get("maxThickness");if(!j||f+g<=j)h=g}if(h!=this.thicknessForView(b)){this._desiredTopLeftThickness=h;b.set("isCollapsed",h===0);c.set("isCollapsed",h>=g);this.updateChildLayout();this.displayDidChange()}},_setCursorStyle:function(){var a=this._topLeftView,b=this._bottomRightView,c=this.get("thumbViewCursor"),d=this.thicknessForView(a),e=this.thicknessForView(b);this._layoutDirection=
+this.get("layoutDirection");if(a.get("isCollapsed")||d===this.get("topLeftMinThickness")||e==this.get("bottomRightMaxThickness"))c.set("cursorStyle",this._layoutDirection===SC.LAYOUT_HORIZONTAL?"e-resize":"s-resize");else if(b.get("isCollapsed")||d===this.get("topLeftMaxThickness")||e==this.get("bottomRightMinThickness"))c.set("cursorStyle",this._layoutDirection===SC.LAYOUT_HORIZONTAL?"w-resize":"n-resize");else SC.browser.msie?c.set("cursorStyle",this._layoutDirection===SC.LAYOUT_HORIZONTAL?"e-resize":
+"n-resize"):c.set("cursorStyle",this._layoutDirection===SC.LAYOUT_HORIZONTAL?"ew-resize":"ns-resize")}.observes("layoutDirection"),splitViewCanCollapse:function(a,b){if(a.get("canCollapseViews")===NO)return NO;if(b.get("canCollapse")===NO)return NO;return YES},splitViewConstrainThickness:function(a,b,c){return c},_forceSplitCalculation:function(){this.updateLayout()}.observes("*pane.isPaneAttached"),viewDidResize:function(){arguments.callee.base.apply(this,arguments);this.notifyPropertyChange("topLeftThickness").notifyPropertyChange("bottomRightThickness")}.observes("layout")});
+sc_require("views/collection");
+SC.StackedView=SC.CollectionView.extend({classNames:["sc-stacked-view"],layout:{top:0,left:0,right:0,height:1},computeNowShowing:function(){return this.get("allContentIndexes")},updateHeight:function(a){a?this._updateHeight():this.invokeLast(this._updateHeight);return this},_updateHeight:function(){var a=this.get("childViews"),b=a.get("length");if(b===0)a=1;else a=(a=(a=a.objectAt(b-1))?a.get("layer"):null)?a.offsetTop+a.offsetHeight:1;this.adjust("height",a)},didReload:function(){return this.updateHeight()},didCreateLayer:function(){return this.updateHeight()}});
+sc_require("views/segmented");SC.TOP_LOCATION="top";SC.TOP_TOOLBAR_LOCATION="top-toolbar";SC.BOTTOM_LOCATION="bottom";
+SC.TabView=SC.View.extend({classNames:["sc-tab-view"],displayProperties:["nowShowing"],nowShowing:null,items:[],isEnabled:YES,itemTitleKey:null,itemValueKey:null,itemIsEnabledKey:null,itemIconKey:null,itemWidthKey:null,itemToolTipKey:null,tabHeight:SC.REGULAR_BUTTON_HEIGHT,tabLocation:SC.TOP_LOCATION,userDefaultKey:null,_tab_nowShowingDidChange:function(){var a=this.get("nowShowing");this.get("containerView").set("nowShowing",a);this.get("segmentedView").set("value",a);return this}.observes("nowShowing"),
+_tab_saveUserDefault:function(){var a=this.get("nowShowing"),b=this.get("userDefaultKey");b&&SC.userDefaults.set([b,"nowShowing"].join(":"),a)}.observes("nowShowing"),_tab_itemsDidChange:function(){this.get("segmentedView").set("items",this.get("items"));return this}.observes("items"),init:function(){arguments.callee.base.apply(this,arguments);this._tab_nowShowingDidChange()._tab_itemsDidChange()},awake:function(){arguments.callee.base.apply(this,arguments);var a=this.get("userDefaultKey");if(a){a=
+[a,"nowShowing"].join(":");a=SC.userDefaults.get(a);SC.none(a)||this.set("nowShowing",a)}},createChildViews:function(){var a=[],b,c=this.get("tabLocation"),d=this.get("tabHeight");b=c===SC.TOP_LOCATION?{top:d/2+1,left:0,right:0,bottom:0}:c===SC.TOP_TOOLBAR_LOCATION?{top:d+1,left:0,right:0,bottom:0}:{top:0,left:0,right:0,bottom:d-1};b=this.containerView=this.createChildView(this.containerView.extend(SC.Border,{layout:b,borderStyle:SC.BORDER_BLACK}));a.push(b);b=c===SC.TOP_LOCATION||c===SC.TOP_TOOLBAR_LOCATION?
+{height:d,left:0,right:0,top:0}:{height:d,left:0,right:0,bottom:0};this.segmentedView=this.get("segmentedView").extend({layout:b,_sc_tab_segmented_valueDidChange:function(){var e=this.get("parentView");e&&e.set("nowShowing",this.get("value"));this.set("layerNeedsUpdate",YES);this.invokeOnce(this.updateLayerIfNeeded)}.observes("value"),init:function(){var e=this.get("parentView");e&&SC._TAB_ITEM_KEYS.forEach(function(f){this[f]=e.get(f)},this);return arguments.callee.base.apply(this,arguments)}});
+b=this.segmentedView=this.createChildView(this.segmentedView);a.push(b);this.set("childViews",a);return this},containerView:SC.ContainerView,segmentedView:SC.SegmentedView});SC._TAB_ITEM_KEYS="itemTitleKey itemValueKey itemIsEnabledKey itemIconKey itemWidthKey itemToolTipKey".w();
+SC.ThumbView=SC.View.extend({classNames:["sc-thumb-view"],isEnabled:YES,isEnabledBindingDefault:SC.Binding.bool(),prepareContext:function(){var a=this.get("splitView");a&&this.set("cursor",a.get("thumbViewCursor"));return arguments.callee.base.apply(this,arguments)},mouseDown:function(a){if(!this.get("isEnabled"))return NO;var b=this.get("splitView");return b?b.mouseDownInThumbView(a,this):arguments.callee.base.apply(this,arguments)}});
+SC.ToolbarView=SC.View.extend({classNames:["sc-toolbar-view"],anchorLocation:null,layout:{left:0,height:32,right:0},init:function(){if(this.anchorLocation)this.layout=SC.merge(this.layout,this.anchorLocation);arguments.callee.base.apply(this,arguments)}});
+SC.WebView=SC.View.extend(SC.Control,{classNames:"sc-web-view",displayProperties:["value","shouldAutoResize"],shouldAutoResize:NO,render:function(a,b){var c=this.get("value");if(b)a.push('<iframe src="'+c+'" style="position: absolute; width: 100%; height: 100%; border: 0px; margin: 0px; padding: 0p;"></iframe>');else{a=this.$("iframe");a.attr("src","javascript:;");a.attr("src",c)}},didCreateLayer:function(){var a=this.$("iframe");SC.Event.add(a,"load",this,this.iframeDidLoad)},iframeDidLoad:function(){if(this.get("shouldAutoResize")===
+YES){var a;if((a=this.$("iframe")[0])&&a.contentWindow)if((a=a.contentWindow)&&a.document&&a.document.documentElement){a=a.document.documentElement;if(SC.browser.isIE){this.$().width(a.scrollWidth+12);this.$().height(a.scrollHeight+5)}else{this.$().width(a.scrollWidth);this.$().height(a.scrollHeight)}}}}});SC.WELL_CONTAINER_PADDING=15;
+SC.WellView=SC.ContainerView.extend({classNames:"sc-well-view",contentLayout:{top:SC.WELL_CONTAINER_PADDING,bottom:SC.WELL_CONTAINER_PADDING,left:SC.WELL_CONTAINER_PADDING,right:SC.WELL_CONTAINER_PADDING},createChildViews:function(){var a=this.get("contentView");if(a){a=this.contentView=this.createChildView(a);a.set("layout",this.contentLayout);this.childViews=[a]}},render:function(a,b){b&&a.push("<div class='top-left-edge'></div>","<div class='top-edge'></div>","<div class='top-right-edge'></div>",
+"<div class='right-edge'></div>","<div class='bottom-right-edge'></div>","<div class='bottom-edge'></div>","<div class='bottom-left-edge'></div>","<div class='left-edge'></div>","<div class='content-background'></div>");arguments.callee.base.apply(this,arguments)},contentViewDidChange:function(){var a=this.get("contentView");a.set("layout",this.contentLayout);this.replaceContent(a)}.observes("contentView")});tiki.script("sproutcore/desktop:en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/javascript.js");
+tiki.register("sproutcore/empty_theme",{scripts:[{url:"/static/sproutcore/empty_theme/en/21c3b7b16d7ef39d60d2651975590828812f3ad9/javascript.js",id:"sproutcore/empty_theme:en/21c3b7b16d7ef39d60d2651975590828812f3ad9/javascript.js"}]});tiki.module("sproutcore/empty_theme:index",function(){});tiki.script("sproutcore/empty_theme:en/21c3b7b16d7ef39d60d2651975590828812f3ad9/javascript.js");
+tiki.register("sproutcore",{packages:{"sproutcore/runtime":{scripts:[{url:"/static/sproutcore/runtime/en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js",id:"sproutcore/runtime:en/4e45a795ad83e4f4a267451bf706cc3fc2658096/javascript.js"}]},"sproutcore/datastore":{scripts:[{url:"/static/sproutcore/datastore/en/eb43c56c9a551db9bba1cd04f29ca1dfb2e47e4c/javascript.js",id:"sproutcore/datastore:en/eb43c56c9a551db9bba1cd04f29ca1dfb2e47e4c/javascript.js"}]},"sproutcore/foundation":{stylesheets:[{url:"/static/sproutcore/foundation/en/a04970954a917ede9918ca06897bc0e1406986d5/stylesheet.css",
+id:"sproutcore/foundation:en/a04970954a917ede9918ca06897bc0e1406986d5/stylesheet.css"}],scripts:[{url:"/static/sproutcore/foundation/en/a04970954a917ede9918ca06897bc0e1406986d5/javascript.js",id:"sproutcore/foundation:en/a04970954a917ede9918ca06897bc0e1406986d5/javascript.js"}]},"sproutcore/desktop":{stylesheets:[{url:"/static/sproutcore/desktop/en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/stylesheet.css",id:"sproutcore/desktop:en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/stylesheet.css"}],scripts:[{url:"/static/sproutcore/desktop/en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/javascript.js",
+id:"sproutcore/desktop:en/ecf7ecda0e8421fbcfcc4ebb8aafd0ff1cc97343/javascript.js"}]},tiki:{scripts:[{url:"/static/tiki/en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js",id:"tiki:en/f190e4e36f88857b033c419907d4b704109b7815/javascript.js"}]}},depends:["tiki","sproutcore/runtime","sproutcore/datastore","sproutcore/foundation","sproutcore/desktop"],scripts:[{url:"/static/sproutcore/en/b787d076ea5a03a72f4c0bdc1d1b432a40401c0b/javascript.js",id:"sproutcore:en/b787d076ea5a03a72f4c0bdc1d1b432a40401c0b/javascript.js"}]});
+tiki.module("sproutcore:index",function(a,b,c){c.exports=a("sproutcore/runtime");a("sproutcore/datastore")});tiki.module("sproutcore:license",function(){});tiki.script("sproutcore:en/b787d076ea5a03a72f4c0bdc1d1b432a40401c0b/javascript.js");tiki.register("bespin",{});
+tiki.module("bespin:builtins",function(a,b){b.metadata={bespin:{provides:[{ep:"extensionpoint",name:"extensionpoint",description:"Use the 'extensionpoint' extension point to define new extension points. You can provide an 'indexOn' property to name a property of extensions through which you'd like to be able to easily look up the extension. You can also provide a 'register' and 'unregister' properties which are pointers to functions that are called whenever a new extension is discovered or removed, respectively. 'register' and 'unregister' should be used sparingly, because your plugin will be loaded whenever a matching plugin is available."},{ep:"extensionpoint",
+name:"extensionhandler",description:"extensionhandlers are able to have 'register' and 'unregister' pointers to functions that are called with each extension as it is discovered or unregistered. Use 'register' sparingly as your plugin will be loaded automatically if there is a matching extension (and not just when your extension's functionality is required)."},{ep:"extensionpoint",name:"startup",description:"A function that should be called at startup. This should be used sparingly, as these plugins will be eagerly loaded at the beginning. All that's needed for this extension point is a pointer to a function that takes no arguments.",
+register:"plugins#startupHandler"},{ep:"extensionpoint",name:"factory",description:"Provides a factory for singleton components. Each extension needs to provide a name, a pointer and an action. The action can be 'call' (if the pointer refers to a function), 'create' (if the pointer refers to an SC.Object), 'new' (if the pointer refers to a traditional JS object) or 'value' (if the pointer refers to the object itself that is the component).",indexOn:"name"},{ep:"factory",name:"hub",action:"create",
+pointer:"util/hub#Hub"},{ep:"extensionpoint",name:"command",description:"Editor commands/actions. TODO: list parameters here."}]}}});
+tiki.module("bespin:console",function(a,b){function c(){this._error(arguments)}function d(g){return function(){window.console[g].apply(window.console,arguments)}}a=a("sproutcore/runtime").SC;var e=["log","debug","info","warn","error","assert","dir","dirxml","trace","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","count"],f={_error:function(){}};window.console&&e.forEach(function(g){if(window.console[g])f[g]=d(g)});e.forEach(function(g){f[g]||(f[g]=c)});if(!window.console)window.console=
+b.console;b.console=a.Object.create(f)});
+tiki.module("bespin:globals",function(a){var b=a("sproutcore/runtime").SC;(function(){if(!Array.isArray)Array.isArray=function(c){return c&&Object.prototype.toString.call(c)=="[object Array]"};if(!Function.prototype.bind)Function.prototype.bind=function(){var c=Array.prototype.slice.call(arguments),d=this,e=function(){return d.call.apply(d,c.concat(Array.prototype.slice.call(arguments)))};e.name=this.name;e.displayName=this.displayName;e.length=this.length;e.unbound=d;return e};b.Object.prototype.sc_super=
+function c(){c.caller.base.apply(this,c.caller.arguments)};b.objectForPropertyPathOriginal=b.objectForPropertyPath;b.objectForPropertyPath=function(c,d,e){e=e==undefined?c.length:e;var f=c.split("#");if(f.length==1)return b.objectForPropertyPathOriginal(c,d,e);c=a(f[0]);if(c!==undefined){e-=f[0].length;return b.objectForPropertyPathOriginal(f[1],c,e)}}})()});
+tiki.module("bespin:plugins",function(a,b){var c=a("sproutcore/runtime").SC;a("globals");var d=a("promise").Promise,e=a("builtins"),f=a("console").console,g=a.loader,h=Object.keys;h||(h=function(n){var o,q=[];for(o in n)n.hasOwnProperty(o)&&q.push(o);return q});var j=function(n,o){if(o){o=o.split("#");return{modName:o[0]?n+":"+o[0]:n,objName:o[1]}}},k=function(n){var o=a(n.modName);if(n.objName)return o[n.objName];return o};b.Extension=c.Object.extend({_getPointer:function(n){n=n||"pointer";return j(this._pluginName,
+this.get(n))},init:function(){this._observers=[]},load:function(n,o){var q=this._getPointer(o);if(!q){f.error("Extension cannot be loaded because it has no 'pointer'");f.log(this);return null}var t=new d;g.async(this._pluginName).then(function(){c.run(function(){var r=a(q.modName);r=q.objName?r[q.objName]:r;n&&n(r);t.resolve(r)})});return t},observe:function(n,o,q){this._observers.push({plugin:n,callback:o,property:q});this.load(o,q)},getPluginName:function(){return this._pluginName},_getLoaded:function(n){n=
+this._getPointer(n);return k(n)}});b.ExtensionPoint=c.Object.extend({init:function(){this.extensions=[];this.handlers=[]},getByKey:function(n){var o=this.get("indexOn");if(o)for(var q=0;q<this.extensions.length;q++)if(this.extensions[q][o]==n)return this.extensions[q]},register:function(n){this.extensions.push(n);this.handlers.forEach(function(o){o.register&&o.load(function(q){q(n)},"register")})},unregister:function(n){this.extensions.removeObject(n);this.handlers.forEach(function(o){o.unregister&&
+o.load(function(q){q(n)},"unregister")})}});b.Plugin=c.Object.extend({register:function(){var n=this;this.provides.forEach(function(o){n.get("catalog").getExtensionPoint(o.ep).register(o)})},unregister:function(){var n=this;this.provides.forEach(function(o){n.get("catalog").getExtensionPoint(o.ep).unregister(o)})},_getObservers:function(){var n={};this.provides.forEach(function(o){f.log("ep: ",o.ep);f.log(o._observers);n[o.ep]=o._observers});return n},_findDependents:function(n,o){var q=this.name,
+t=this;n.forEach(function(r){if(r!=q){var s=t.catalog.plugins[r];if(s&&s.dependencies)for(dependName in s.dependencies)if(dependName==q&&!o[r]){o[r]={keepModule:false};s._findDependents(n,o)}}})},_cleanup:function(){var n=this.get("name"),o=new RegExp("^"+n+":");l(o,g.scripts);l(o,g.modules,function(t){delete g._factories[t]});l(o,g.stylesheets);l(new RegExp("^"+n+"$"),g.packages);var q=g._promises;delete q.catalog[n];delete q.loads[n];m(o,q.modules);m(o,q.scripts);m(o,q.stylesheets);delete g._catalog[n]},
+reload:function(n){var o,q;if(this.get("reloadURL")){var t=this.name,r=this.get("reloadPointer");if(r){r=j(t,r);if(o=k(r))o();else{f.error("Reload function could not be loaded. Aborting reload.");return}}var s={},v=this;this._findDependents(h(this.catalog.plugins),s);var w={pluginName:t,dependents:s};for(q in s){r=this.catalog.plugins[q];if(r.preRefresh){r=j(q,r.preRefresh);if(o=k(r))s[q]=o(w)}}this.unregister();for(q in s)this.catalog.plugins[q].unregister();this._cleanup(t);r=[];var y=g.sandbox,
+x=y.modules.length,D=[];for(q in s)s[q].keepModule||D.push(new RegExp("^"+q+":"));for(var E=new RegExp("^"+t+":");--x>=0;){var z=y.modules[x];if(E.exec(z))r.push(z);else for(var p=D.length;--p>=0;)if(D[p].exec(z)){r.push(z);break}}r.length>0&&y.clear.apply(y,r);this.catalog.loadMetadata(this.reloadURL).then(function(){g.async(t).then(function(){c.run(function(){for(q in s)v.catalog.plugins[q].register();for(q in s)if(s[q].callPointer){var u=j(q,s[q].callPointer);(o=k(u))&&o(w)}n&&n()})})})}}});b.Catalog=
+c.Object.extend({init:function(){this.points={};this.plugins={};this.getExtensionPoint("extensionpoint").set("indexOn","name");this.load(e.metadata)},getObject:function(n){n=this.getExtensionByKey("factory",n);if(n!==undefined){var o=n.get("instance");if(o)return o;o=n._getLoaded();var q=n.action;if(q=="call")o=o();else if(q=="create")o=o.create();else if(q=="new")o=new o;else if(q=="value")o=o;else throw new Error("Create action must be call|create|new|value. Found"+q);n.set("instance",o);return o}},
+getExtensionPoint:function(n){if(this.points[n]===undefined)this.points[n]=b.ExtensionPoint.create({name:n,catalog:this});return this.points[n]},getExtensions:function(n){n=this.getExtensionPoint(n);if(n===undefined)return[];return n.extensions},getExtensionByKey:function(n,o){n=this.getExtensionPoint(n);if(n!==undefined)return n.getByKey(o)},_registerExtensionPoint:function(n){var o=this.getExtensionPoint(n.name);o.handlers.push(n);n.indexOn&&o.set("indexOn",n.indexOn)},_registerExtensionHandler:function(n){var o=
+this.getExtensionPoint(n.name);o.handlers.push(n);n.register&&n.load(function(q){if(!q)throw n.name+" is not ready";o.extensions.forEach(function(t){q(t)})},"register")},_toposort:function(n){var o=[],q={},t=function(s){if(!(s in q||!(s in n))){q[s]=true;var v=n[s].dependencies;if(!c.none(v))for(var w in v)t(w);o.push(s)}};for(var r in n)t(r);return o},load:function(n){this._toposort(n).forEach(function(o){var q=n[o];q.catalog=this;if(q.provides)for(var t=q.provides,r=0;r<t.length;r++){var s=b.Extension.create(t[r]);
+s._pluginName=o;t[r]=s;var v=s.ep;if(v=="extensionpoint")this._registerExtensionPoint(s);else v=="extensionhandler"&&this._registerExtensionHandler(s);this.getExtensionPoint(s.ep).register(s)}else q.provides=[];q.name=o;q=b.Plugin.create(q);this.plugins[o]=q},this)},loadPlugin:function(n,o){n=g.async(n);o&&n.then(o,function(q){f.error("Plugin loading canceled: ",q)})},loadMetadata:function(n){var o=new d;c.Request.create({address:n}).notify(0,this,this._metadataFinishedLoading,{callback:function(q,
+t){o.resolve({catalog:q,response:t})}}).send("");return o},removePlugin:function(n){var o=this.get("plugins"),q=o[n];if(q==undefined)throw new Error("Attempted to remove plugin "+n+" which does not exist.");q.unregister();q._cleanup();delete o[n]},getResourceURL:function(n){n=this.plugins[n];if(n!=undefined)return n.resourceURL},_metadataFinishedLoading:function(n,o){var q;if(!n.isError){var t=n.body();t=JSON.parse(t);for(q in t){var r=t[q];if(r.errors){f.error("Plugin ",q," has errors:");r.errors.forEach(function(s){f.error(s)});
+delete t[q]}else{if(r.dependencies)r.depends=h(r.dependencies);g.register(q,r)}}this.load(t);r=this.plugins;for(q in t)this._checkLoops(q,r,[])}o.callback&&o.callback(this,n)},_checkLoops:function(n,o,q){var t=false;q.forEach(function(v){if(n===v){f.error("Circular dependency",n,q);t=true}});if(!t){q.push(n);if(o[n]){if(o[n].dependencies)for(var r in o[n].dependencies){var s=q.slice();this._checkLoops(r,o,s)}}else f.error("Missing metadata for ",n)}},getPlugins:function(n){var o=[],q=n.onlyType,t=
+this.get("plugins");for(var r in t){var s=t[r];q&&s.type&&s.type!=q||s.name=="bespin"||o.push(s)}var v=n.sortBy;v||(v=["name"]);o.sort(function(w,y){for(var x=0;x<v.length;x++){var D=v[x];if(w[D]<y[D])return-1;else if(y[D]<w[D])return 1}return 0});return o},loadObjectForPropertyPath:function(n,o){var q=new d,t=/^([^:]+):([^#]+)#(.*)$/.exec(n);if(t===null)throw new Error("loadObjectForPropertyPath: malformed path: '"+n+"'");t=t[1];if(t===""){if(c.none(o))throw new Error("loadObjectForPropertyPath: no plugin name supplied and no context is present");
+t=o}g.async(t).then(function(){q.resolve(c.objectForPropertyPath(n))});return q}});var l=function(n,o,q){for(var t=0;t<o.length;)if(n.exec(o[t])){var r=o.splice(t,1);q&&q(r)}else t++},m=function(n,o){for(var q=h(o),t=q.length;--t>0;)n.exec(q[t])&&delete o[q[t]]};b.catalog=b.Catalog.create();b.startupHandler=function(n){n.load(function(o){o()})};b.getUserPlugins=function(){return b.catalog.getPlugins({onlyType:"user"})}});
+tiki.module("bespin:promise",function(a,b){function c(){return new d}function d(m,n){function o(E){if(r)throw new Error("This deferred has already been resolved");t=E;r=true;if(n&&s&&v.length===0)throw t;for(E=0;E<v.length;E++)q(v[E])}function q(E){var z=s?E.error:E.resolved;if(z){w=true;h(function(){x&&x.resume();try{var p=z(t);p&&typeof p.then==="function"?p.then(E.deferred.resolve,E.deferred.reject):E.deferred.resolve(p)}catch(u){E.deferred.reject(u)}finally{x&&x.suspend()}})}else E.deferred[s?
+"reject":"resolve"](t)}var t,r,s,v=[],w,y=this.promise=new k,x=l.getHandler&&l.getHandler();this.resolve=this.callback=this.emitSuccess=function(E){o(E)};var D=function(E){s=true;o(E)};this.reject=this.errback=this.emitError=n?D:function(E){return h(function(){D(E)})};this.progress=function(E){for(var z=0;z<v.length;z++){var p=v[z].progress;p&&p(E)}};this.then=y.then=function(E,z,p){var u=new d(y.cancel,true);E={resolved:E,error:z,progress:p,deferred:u};r?q(E):v.push(E);return u.promise};if(m)this.cancel=
+y.cancel=function(){var E=m();E instanceof Error||(E=new Error(E));D(E)};this.valueIfResolved=function(){return r?t:null}}function e(m,n,o){try{if((m=m&&typeof m.then==="function"?n(m):o(m))&&typeof m.then==="function")return m;var q=new d;q.resolve(m);return q.promise}catch(t){f.error("promise caught exception: ",t);f.log(g({e:t}));q=new d;q.reject(t);return q.promise}}var f=a("console").console,g=a("bespin:util/stacktrace").printStackTrace;try{var h=a("event-queue").enqueue}catch(j){}h||(h=function(m){m()});
+var k=function(){};k.prototype.then=function(){throw new TypeError("The Promise base class is abstract, this function must be implemented by the Promise implementation");};k.prototype.get=function(m){return this.then(function(n){return n[m]})};k.prototype.put=function(m,n){return this.then(function(o){return o[m]=n})};k.prototype.call=function(){return this.then(function(m){return m[propertyName].apply(m,Array.prototype.slice.call(arguments,1))})};k.prototype.addCallback=function(m){return this.then(m)};
+k.prototype.addErrback=function(m){return this.then(function(){},m)};k.prototype.addBoth=function(m){return this.then(m,m)};k.prototype.addCallbacks=function(m,n){return this.then(m,n)};k.prototype.wait=function(){return b.wait(this)};d.prototype=k.prototype;b.Promise=b.Deferred=b.defer=c;var l=b.contextHandler={};b.whenPromise=function(m,n,o,q){return e(m,function(t){return t.then(n,o,q)},function(t){return n(t)})};b.when=function(m,n,o,q){if(m&&typeof m.then==="function")return b.whenPromise(m,
+n,o,q);return n(m)};b.get=function(m,n){return e(m,function(o){return o.get(n)},function(o){return o[n]})};b.post=function(m,n,o){return e(m,function(q){return q.call(property,o)},function(q){return q[n].apply(q,o)})};b.put=function(m,n,o){return e(m,function(q){return q.put(n,o)},function(q){return q[n]=o})};b.wait=function(m){if(!queue)throw new Error("Can not wait, the event-queue module is not available");if(m&&typeof m.then==="function"){var n,o,q;for(m.then(function(t){n=true;q=t},function(t){o=
+n=true;q=t});!n;)queue.processNextEvent(true);if(o)throw q;return q}else return m};b.group=function(m){var n=c();m instanceof Array||(m=Array.prototype.slice.call(arguments));var o=0,q=m.length;if(!q){n.resolve([]);return n.promise}var t=[];m.forEach(function(r,s){b.when(r,function(v){t[s]=v;o++;o===q&&n.resolve(t)},n.reject)});return n.promise}});
+tiki.module("bespin:theme",function(a,b){a=a("sproutcore/runtime").SC;b.coffee={backgroundStyle:"#2A211C",gutterStyle:"#4c4a41",lineNumberColor:"#e5c138",lineNumberFont:"10pt Monaco, Lucida Console, monospace",lineMarkerErrorColor:"#CC4444",lineMarkerWarningColor:"#B8860B",lineMarkerMessageColor:"green",zebraStripeColor:"#2A211C",highlightCurrentLineColor:"#3a312b",editorTextFont:"10pt Monaco, Lucida Console, monospace",editorTextColor:"rgb(230, 230, 230)",editorSelectedTextColor:"rgb(240, 240, 240)",
+editorSelectedTextBackground:"#526DA5",cursorStyle:"#879aff",cursorType:"ibeam",unfocusedCursorStrokeStyle:"#FF0033",unfocusedCursorFillStyle:"#73171E",partialNibStyle:"rgba(100, 100, 100, 0.3)",partialNibArrowStyle:"rgba(255, 255, 255, 0.3)",partialNibStrokeStyle:"rgba(150, 150, 150, 0.3)",fullNibStyle:"rgb(100, 100, 100)",fullNibArrowStyle:"rgb(255, 255, 255)",fullNibStrokeStyle:"rgb(150, 150, 150)",scrollTrackFillStyle:"rgba(50, 50, 50, 0.8)",scrollTrackStrokeStyle:"rgb(150, 150, 150)",scrollBarFillStyle:"rgba(0, 0, 0, %a)",
+scrollBarFillGradientTopStart:"rgba(90, 90, 90, %a)",scrollBarFillGradientTopStop:"rgba(40, 40, 40, %a)",scrollBarFillGradientBottomStart:"rgba(22, 22, 22, %a)",scrollBarFillGradientBottomStop:"rgba(44, 44, 44, %a)",tabSpace:"#392A25",searchHighlight:"#B55C00",searchHighlightSelected:"#FF9A00",plain:"#bdae9d",keyword:"#42a8ed",string:"#039a0a",comment:"#666666","c-comment":"#666666",punctuation:"#888888",attribute:"#BF9464",test:"rgb(255,0,0)",cdata:"#bdae9d","attribute-value":"#039a0a",tag:"#46a8ed",
+color:"#c4646b","tag-name":"#46a8ed",value:"#039a0a",important:"#990000",sizes:"#990000",cssclass:"#BF9464",cssid:"#46a8ed",atom:"#aa4444",variable:"#00cccc",variabledef:"#4422cc",localvariable:"#cc2277",property:"#66bb33",operator:"#88bbff",error:"#FF0000",processing:"#999999",entity:"#AA2222",text:"#00BB00","compile-time-constant":"#776088","predefined-constant":"#33CC33","reserved-language-construct":"#00FF00","predefined-function":"#22FF22","predefined-class":"#22FF22",literal:"#DD4411",identifier:"#22FF22",
+func:"#2200FF",type:"#8822FF",decorator:"#2222FF"};b.coffeezebra={};a.mixin(b.coffeezebra,b.coffee);b.coffeezebra.zebraStripeColor="#FFFFFF";b["default"]=b.coffee});
+tiki.module("bespin:util/cookie",function(a,b){var c=function(d,e){return d.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(f){if(e&&e.indexOf(f)!=-1)return f;return"\\"+f})};b.get=function(d){d=new RegExp("(?:^|; )"+c(d)+"=([^;]*)");return(d=document.cookie.match(d))?decodeURIComponent(d[1]):undefined};b.set=function(d,e,f){f=f||{};if(typeof f.expires=="number"){var g=new Date;g.setTime(g.getTime()+f.expires*24*60*60*1E3);f.expires=g}if(f.expires&&f.expires.toUTCString)f.expires=f.expires.toUTCString();
+e=encodeURIComponent(e);d=d+"="+e;var h;for(h in f){d+="; "+h;e=f[h];if(e!==true)d+="="+e}document.cookie=d};b.remove=function(d){b.set(d,"",{expires:-1})};b.isSupported=function(){if(!("cookieEnabled"in navigator)){b.set("__djCookieTest__","CookiesAllowed");navigator.cookieEnabled=b.get("__djCookieTest__")=="CookiesAllowed";navigator.cookieEnabled&&b.remove("__djCookieTest__")}return navigator.cookieEnabled}});
+tiki.module("bespin:util/scratchcanvas",function(a,b){var c=a("sproutcore/runtime").SC,d=c.Object.extend({getContext:function(){return document.getElementById("bespin-scratch-canvas").getContext("2d")},init:function(){if(c.none(document.getElementById("bespin-scratch-canvas"))){var f=document.createElement("canvas");f.id="bespin-scratch-canvas";f.width=400;f.height=300;f.style.position="absolute";f.style.top="-10000px";f.style.left="-10000px";document.body.appendChild(f)}},measureStringWidth:function(f,
+g){if(c.none(g))g="M";var h=this.getContext();h.save();h.font=f;f=h.measureText(g).width;h.restore();return f}}),e=null;b.get=function(){if(e===null)e=d.create();return e}});
+tiki.module("bespin:util/stacktrace",function(a,b){function c(k){for(var l=0;l<k.length;++l){var m=k[l];if(typeof m=="object")k[l]="#object";else if(typeof m=="function")k[l]="#function";else if(typeof m=="string")k[l]='"'+m+'"'}return k.join(",")}function d(){}var e=a("bespin:util/util"),f=function(){if(e.isMozilla)return"firefox";else if(e.isOpera)return"opera";else if(e.isSafari)return"other";try{0()}catch(k){if(k.arguments)return"chrome";if(k.stack)return"firefox";if(window.opera&&!("stacktrace"in
+k))return"opera"}return"other"}(),g={chrome:function(k){return k.stack.replace(/^.*?\n/,"").replace(/^.*?\n/,"").replace(/^.*?\n/,"").replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(k){var l=k.stack;if(!l){console.log(k);return[]}l=l.replace(/(?:\n@:0)?\s+$/m,"");l=l.replace(/^\(/gm,"{anonymous}(");return l.split("\n")},opera:function(k){k=k.message.split("\n");var l=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,
+m,n,o;m=4;n=0;for(o=k.length;m<o;m+=2)if(l.test(k[m]))k[n++]=(RegExp.$3?RegExp.$3+"()@"+RegExp.$2+RegExp.$1:"{anonymous}()@"+RegExp.$2+":"+RegExp.$1)+" -- "+k[m+1].replace(/^\s+/,"");k.splice(n,k.length-n);return k},other:function(k){for(var l=/function\s*([\w\-$]+)?\s*\(/i,m=[],n=0,o,q;k&&m.length<10;){o=l.test(k.toString())?RegExp.$1||"{anonymous}":"{anonymous}";q=Array.prototype.slice.call(k.arguments);m[n++]=o+"("+c(q)+")";if(k===k.caller&&window.opera)break;k=k.caller}return m}};d.prototype=
+{sourceCache:{},ajax:function(k){var l=this.createXMLHTTPObject();if(l){l.open("GET",k,false);l.setRequestHeader("User-Agent","XMLHTTP/1.0");l.send("");return l.responseText}},createXMLHTTPObject:function(){for(var k,l=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],m=0;m<l.length;m++)try{k=l[m]();this.createXMLHTTPObject=l[m];return k}catch(n){}},
+getSource:function(k){k in this.sourceCache||(this.sourceCache[k]=this.ajax(k).split("\n"));return this.sourceCache[k]},guessFunctions:function(k){for(var l=0;l<k.length;++l){var m=k[l],n=/{anonymous}\(.*\)@(\w+:\/\/([-\w\.]+)+(:\d+)?[^:]+):(\d+):?(\d+)?/.exec(m);if(n){var o=n[1];n=n[4];if(o&&n){o=this.guessFunctionName(o,n);k[l]=m.replace("{anonymous}",o)}}}return k},guessFunctionName:function(k,l){try{return this.guessFunctionNameFromLines(l,this.getSource(k))}catch(m){return"getSource failed with url: "+
+k+", exception: "+m.toString()}},guessFunctionNameFromLines:function(k,l){for(var m=/function ([^(]*)\(([^)]*)\)/,n=/['"]?([0-9A-Za-z_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,o="",q=0;q<10;++q){o=l[k-q]+o;if(o!==undefined){var t=n.exec(o);if(t)return t[1];else t=m.exec(o);if(t&&t[1])return t[1]}}return"(?)"}};var h=new d,j=[/http:\/\/localhost:4020\/sproutcore.js:/];b.ignoreFramesMatching=function(k){j.push(k)};b.Trace=function(k,l){this._ex=k;this._stack=g[f](k);if(l)this._stack=h.guessFunctions(this._stack)};
+b.Trace.prototype.log=function(k){if(k<=0)k=999999999;for(var l=0,m=0;m<this._stack.length&&l<k;m++){var n=this._stack[m],o=true;j.forEach(function(q){if(q.test(n))o=false});if(o){console.debug(n);l++}}}});
+tiki.module("bespin:util/util",function(a,b){b.queryToObject=function(g,h){var j={};g=g.split(h||"&");var k=decodeURIComponent;g.forEach(function(l){if(l.length){var m=l.split("=");l=k(m.shift());m=k(m.join("="));if(b.isString(j[l]))j[l]=[j[l]];if(Array.isArray(j[l]))j[l].push(m);else j[l]=m}});return j};b.objectToQuery=function(g){var h=encodeURIComponent,j=[],k={};for(var l in g){var m=g[l];if(m!=k[l]){var n=h(l)+"=";if(m.isArray)for(var o=0;o<m.length;o++)j.push(n+h(m[o]));else j.push(n+h(m))}}return j.join("&")};
+var c=0,d={};b.rateLimit=function(g,h,j){if(g){var k=c++;return function(){d[k]&&clearTimeout(d[k]);d[k]=setTimeout(function(){j.apply(h,arguments);delete d[k]},g)}}};b.isString=function(g){return typeof g=="string"||g instanceof String};b.isObject=function(g){return g!==undefined&&(g===null||typeof g=="object"||Array.isArray(g)||b.isFunction(g))};b.isFunction=function(){var g=function(h){var j=typeof h;return h&&(j=="function"||h instanceof Function)&&!h.nodeType};return b.isSafari?function(h){if(typeof h==
+"function"&&h=="[object NodeList]")return false;return g(h)}:g}();b.endsWith=function(g,h){if(!g)return false;return g.match(new RegExp(h+"$"))};b.include=function(g,h){return g.indexOf(h)>-1};b.indexOfProperty=function(g,h,j){for(var k=0;k<g.length;k++)if(g[k][h]==j)return k;return null};b.last=function(g){if(Array.isArray(g))return g[g.length-1]};b.shrinkArray=function(g){var h=[],j=true;g.reverse().forEach(function(k){if(!(j&&k===undefined)){j=false;h.push(k)}});return h.reverse()};b.makeArray=
+function(g,h){if(g<1)return[];h||(h=" ");for(var j=[],k=0;k<g;k++)j.push(h);return j};b.repeatString=function(g,h){for(var j="",k=0;k<h;k++)j+=g;return j};b.leadingSpaces=function(g){for(var h=0,j=0;j<g.length;j++)if(g[j]==" "||g[j]==""||g[j]===undefined)h++;else return h;return h};b.leadingTabs=function(g){for(var h=0,j=0;j<g.length;j++)if(g[j]=="\t"||g[j]==""||g[j]===undefined)h++;else return h;return h};b.leadingWhitespace=function(g){for(var h=[],j=0;j<g.length;j++)if(g[j]==" "||g[j]=="\t"||g[j]==
+""||g[j]===undefined)h.push(g[j]);else return h;return h};b.englishFromCamel=function(g){g.replace(/([A-Z])/g,function(h){return" "+h.toLowerCase()}).trim()};b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"};a=navigator.userAgent;var e=navigator.appVersion;b.isLinux=e.indexOf("Linux")>=0;b.isWindows=e.indexOf("Win")>=0;b.isWebKit=parseFloat(a.split("WebKit/")[1])||undefined;b.isChrome=parseFloat(a.split("Chrome/")[1])||undefined;b.isMac=e.indexOf("Macintosh")>=0;if(a.indexOf("AdobeAIR")>=0)b.isAIR=
+1;var f=Math.max(e.indexOf("WebKit"),e.indexOf("Safari"),0);if(f&&!b.isChrome){b.isSafari=parseFloat(e.split("Version/")[1]);if(!b.isSafari||parseFloat(e.substr(f+7))<=419.3)b.isSafari=2}if(a.indexOf("Gecko")>=0&&!b.isWebKit)b.isMozilla=parseFloat(e);b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS};b.contains=document.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,h){return g!==h&&(g.contains?g.contains(h):true)};b.stopEvent=function(g){g.preventDefault();
+g.stopPropagation()};b.randomPassword=function(g){g=g||16;for(var h="",j=0;j<g;j++){var k=Math.floor(Math.random()*62);h+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".charAt(k)}return h};b.isEmpty=function(g){for(var h in g)if(g.hasOwnProperty(h))return false;return true};b.isMyProject=function(g){return g.indexOf("+")==-1};b.formatDate=function(g){if(!g)return"Unknown";return g.getDate()+" "+b.formatDate.shortMonths[g.getMonth()]+" "+g.getFullYear()};b.formatDate.shortMonths=
+["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});tiki.module("bespin:index",function(){});tiki.register("types",{});
+tiki.module("types:basic",function(a,b){var c=a("bespin:plugins").catalog,d=a("bespin:console").console,e=a("bespin:promise").Promise;b.text={isValid:function(f){return typeof f=="string"},toString:function(f){return f},fromString:function(f){return f}};b.number={isValid:function(f){if(isNaN(f))return false;if(f===null)return false;if(f===undefined)return false;if(f===Infinity)return false;return typeof f=="number"},toString:function(f){if(!f)return null;return""+f},fromString:function(f){if(!f)return null;
+var g=parseInt(f,10);if(isNaN(g))throw new Error("Can't convert '"+f+"' to a number.");return g}};b.bool={isValid:function(f){return typeof f=="boolean"},toString:function(f){return""+f},fromString:function(f){if(f===null)return null;if(!f.toLowerCase)return!!f;var g=f.toLowerCase();if(g=="true")return true;else if(g=="false")return false;return!!f}};b.object={isValid:function(f){return typeof f=="object"},toString:function(f){return JSON.stringify(f)},fromString:function(f){return JSON.parse(f)}};
+b.selection={isValid:function(f,g){if(typeof f!="string")return false;if(!g.data){d.error("Missing data on selection type extension. Skipping");return true}var h=false;g.data.forEach(function(j){if(f==j)h=true});return h},toString:function(f){return f},fromString:function(f){return f},resolveTypeSpec:function(f,g){var h=new e;if(g.data){f.data=g.data;h.resolve()}else if(g.pointer)c.loadObjectForPropertyPath(g.pointer).then(function(j){j=j(g);if(typeof j.then==="function")j.then(function(k){f.data=
+k;h.resolve()});else{f.data=j;h.resolve()}},function(j){h.reject(j)});else{d.warn("Missing data/pointer for selection",g);h.resolve()}return h}}});
+tiki.module("types:types",function(a,b){function c(g){var h=new f,j=e.getExtensionByKey("type",g.name);j?h.resolve({ext:j,typeSpec:g}):h.reject(new Error("Unknown type: "+g.name));return h}function d(g){if(typeof g==="string")return c({name:g});if(typeof g==="object")if(g.name==="deferred"){var h=new f;b.undeferTypeSpec(g).then(function(j){d(j).then(function(k){h.resolve(k)},function(k){h.reject(k)})});return h}else return c(g);throw new Error("Unknown typeSpec type: "+typeof g);}var e=a("bespin:plugins").catalog;
+a("bespin:console");var f=a("bespin:promise").Promise;b.getSimpleName=function(g){if(!g)throw new Error("null|undefined is not a valid typeSpec");if(typeof g=="string")return g;if(typeof g=="object"){if(!g.name)throw new Error("Missing name member to typeSpec");return g.name}throw new Error("Not a typeSpec: "+g);};b.equals=function(g,h){return b.getSimpleName(g)==b.getSimpleName(h)};b.undeferTypeSpec=function(g){var h=new f;if(!g.pointer){h.reject(new Error("Missing deferred pointer"));return h}e.loadObjectForPropertyPath(g.pointer).then(function(j){j=
+j(g);typeof j.then==="function"?j.then(function(k){h.resolve(k)},function(k){h.reject(k)}):h.resolve(j)},function(j){h.reject(j)});return h};b.resolveType=function(g){var h=new f;d(g).then(function(j){j.ext.load(function(k){typeof k.resolveTypeSpec==="function"?k.resolveTypeSpec(j.ext,j.typeSpec).then(function(){h.resolve({type:k,ext:j.ext})},function(l){h.reject(l)}):h.resolve({type:k,ext:j.ext})})},function(j){h.reject(j)});return h};b.fromString=function(g,h){var j=new f;b.resolveType(h).then(function(k){j.resolve(k.type.fromString(g,
+k.ext))});return j};b.toString=function(g,h){var j=new f;b.resolveType(h).then(function(k){j.resolve(k.type.toString(g,k.ext))});return j};b.isValid=function(g,h){var j=new f;b.resolveType(h).then(function(k){j.resolve(k.type.isValid(g,k.ext))});return j}});tiki.module("types:index",function(){});tiki.register("settings",{});
+tiki.module("settings:commands",function(a,b){a("bespin:plugins");var c=a("settings").settings;b.setCommand=function(d,e,f){var g;if(e.setting)if(e.value===undefined)g="<strong>"+e.setting+"</strong> = "+c.get(e.setting);else{g="Setting: <strong>"+e.setting+"</strong> = "+e.value;c.set(e.setting,e.value)}else{d=c._list();g="";d.sort(function(h,j){return h.key<j.key?-1:h.key==j.key?0:1});d.forEach(function(h){g+="<a class='setting' href='https://wiki.mozilla.org/Labs/Bespin/Settings#"+h.key+"' title='View external documentation on setting: "+
+h.key+"' target='_blank'>"+h.key+"</a> = "+h.value+"<br/>"})}f.done(g)};b.unsetCommand=function(d,e,f){c.resetValue(e.setting);f.done("Reset "+e.setting+" to default: "+c.get(e.setting))}});
+tiki.module("settings:cookie",function(a,b){var c=a("bespin:util/cookie");b.CookiePersister=SC.Object.create({loadInitialValues:function(d){d._loadDefaultValues().then(function(){var e=c.get("settings");d._loadFromObject(JSON.parse(e))}.bind(this))},persistValue:function(d){try{var e={};d._getSettingNames().forEach(function(h){e[h]=d.get(h)});var f=JSON.stringify(e);c.set("settings",f)}catch(g){console.error("Unable to JSONify the settings! "+g)}}})});
+tiki.module("settings:index",function(a,b){a=a("memory").MemorySettings;b.settings=a.create()});
+tiki.module("settings:memory",function(a,b){var c=a("bespin:plugins").catalog,d=a("bespin:console").console,e=a("bespin:promise").Promise,f=a("bespin:promise").group,g=a("sproutcore/runtime").SC,h=a("types:types");b.addSetting=function(j){a("settings").settings.addSetting(j)};b.getSettings=function(){return c.getExtensions("setting")};b.getTypeSpecFromAssignment=function(j){var k=j.assignments;j="text";if(k){var l=null;k.forEach(function(m){if(m.param.name==="setting")l=m});if(l)if((k=l.value)&&k!==
+"")if(k=c.getExtensionByKey("setting",k))j=k.type}return j};b.MemorySettings=g.Object.extend({setPersister:function(j){(this._persister=j)&&j.loadInitialValues(this)},set:function(j,k){var l=c.getExtensionByKey("setting",j);if(!l)throw new Error("Unknown setting: ",j,k);if(typeof k=="string"&&l.type=="string")return this.superclass(j,k);else{var m=arguments.callee.base,n=false;h.fromString(k,l.type).then(function(o){n=true;m.apply(this,[j,o])}.bind(this),function(o){d.error("Error setting",j,": ",
+o)});if(!n){d.warn("About to set string version of ",j,"delaying typed set.");this.superclass(j,k)}}return this},addSetting:function(j){if(j.name){!j.defaultValue===undefined&&d.error("Setting.defaultValue == undefined",j);h.isValid(j.defaultValue,j.type).then(function(k){k||d.warn("!Setting.isValid(Setting.defaultValue)",j);this.set(j.name,j.defaultValue);this.addObserver(j.name,this,function(){this._persistValue(j.name,this.get(j.name))}.bind(this))}.bind(this),function(k){d.error("Type error ",
+k," ignoring setting ",j)})}else d.error("Setting.name == undefined. Ignoring.",j)},resetValue:function(j){var k=c.getExtensionByKey("setting",j);k?this.set(j,k.defaultValue):d.log("ignore resetValue on ",j)},_getSettingNames:function(){var j=[];c.getExtensions("setting").forEach(function(k){j.push(k.name)});return j},_list:function(){var j=[];this._getSettingNames().forEach(function(k){j.push({key:k,value:this.get(k)})}.bind(this));return j},_persistValue:function(j,k){var l=this._persister;l&&l.persistValue(this,
+j,k)},_loadInitialValues:function(){var j=this._persister;j?j.loadInitialValues(this):this._loadDefaultValues()},_loadDefaultValues:function(){return this._loadFromObject(this._defaultValues())},_loadFromObject:function(j){var k=[],l=function(t){return function(r){this.set(t,r)}};for(var m in j)if(j.hasOwnProperty(m)){var n=j[m],o=c.getExtensionByKey("setting",m);if(o){n=h.fromString(n,o.type);o=l(m);n.then(o);k.push(n)}}var q=new e;f(k).then(function(){q.resolve()});return q},_saveToObject:function(){var j=
+[],k={};this._getSettingNames().forEach(function(m){var n=this.get(m),o=c.getExtensionByKey("setting",m);if(o){n=h.toString(n,o.type);n.then(function(q){k[m]=q});j.push(n)}}.bind(this));var l=new e;f(j).then(function(){l.resolve(k)});return l},_defaultValues:function(){var j={};c.getExtensions("setting").forEach(function(k){j[k.name]=k.defaultValue});return j}})});tiki.register("canon",{});
+tiki.module("canon:environment",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:plugins").catalog,e=a("bespin:console").console;b.Environment=c.Object.extend({session:function(){return d.getObject("session")}.property(),view:function(){var f=this.get("session");if(!f)return null;return f.get("currentView")}.property(),model:function(){var f=this.get("session");if(f)if(f=f.get("currentBuffer"))return f.get("model");else e.error("Session has no current buffer");else e.error("command attempted to get model but there's no session")}.property(),
+contexts:function(){var f=this.get("view");if(!f)return[];var g=f.getPath("layoutManager.syntaxManager");f=f.getSelectedRange().start;return g.contextsAtPosition(f)}.property(),file:function(){var f=this.get("session");if(f)if(f=f.get("currentBuffer"))return f.get("file");else e.error("Session has no current buffer");else e.error("command attempted to get file but there's no session")}.property(),buffer:function(){var f=this.get("session");if(f)return f.get("currentBuffer");else e.error("command attempted to get buffer but there's no session")}.property(),
+files:function(){return d.getObject("files")}.property().cacheable()});b.global=b.Environment.create()});
+tiki.module("canon:keyboard",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:plugins").catalog,e=a("bespin:console").console,f=a("settings").settings,g=a("canon:request").Request,h=a("canon:environment"),j=a("bespin:util/stacktrace").Trace;b.buildFlags=function(k,l){l.context=k.get("contexts")[0];return l};a=c.Object.extend({_customKeymappingCache:{},_commandCodes:function(){var k=this.originalEvent,l=true,m=this.keyCode,n=null,o=null,q="";if(this.keyCode===0&&this.which===0)return false;
+if(m){n=c.FUNCTION_KEYS[m];if(!n&&(k.altKey||k.ctrlKey||k.metaKey)){n=c.PRINTABLE_KEYS[m];if(m>47&&m<58)l=k.altKey}if(n){if(k.altKey)q+="alt_";if(k.ctrlKey)q+="ctrl_";if(k.metaKey)q+="meta_"}else if(k.ctrlKey||k.metaKey)return false}if(!n){m=this.which;o=n=String.fromCharCode(m);m=n.toLowerCase();if(k.metaKey){q="meta_";n=m}else n=null}if(this.shiftKey&&n&&l)q+="shift_";if(n)n=q+n;return[n,o]},processKeyEvent:function(k,l,m){k=this._commandCodes.call(k)[0];if(c.none(k))return false;b.buildFlags(h.global,
+m);m.isCommandKey=true;return this._matchCommand(k,l,m)},processKeyInput:function(k,l,m){m.isCommandKey=false;return this._matchCommand(k,l,m)},_matchCommand:function(k,l,m){var n=this._findCommandExtension(k,l,m);if(n&&n.commandExt!=="no command"){m.isTextView&&l.resetKeyBuffers();var o=n.commandExt;o.load(function(q){var t=g.create({command:q,commandExt:o});try{q(h.global,n.args,t);return true}catch(r){q=new j(r,true);e.group("Error calling command");e.log("command=",o);e.log("args=",n.args);e.error(r);
+q.log(3);e.groupEnd();return false}});return true}return n&&n.commandExt==="no command"?true:false},_buildBindingsRegex:function(k){k.forEach(function(l){if(c.none(l.key))if(c.isArray(l.regex)){l.key=new RegExp("^"+l.regex[1]+"$");l.regex=new RegExp(l.regex.join("")+"$")}else l.regex=new RegExp(l.regex+"$");else l.key=new RegExp("^"+l.key+"$")})},_buildKeymappingRegex:function(k){for(state in k.states)this._buildBindingsRegex(k.states[state]);k._convertedRegExp=true},_findCommandExtension:function(k,
+l,m){if(m.isTextView){var n=l._keyState,o=[],q=f.get("keymapping");if(!c.none(q)&&q!=="standard"){var t=null;d.getExtensions("keymapping").some(function(v){if(v.name==q){c.none(v._convertedRegExp)&&this._buildKeymappingRegex(v);t=v;return true}return false}.bind(this));if(c.none(t))throw new Error("There is no keymapping named "+q);}if(!m.isCommandKey||k.indexOf("alt_")===-1){l._keyBuffer+=k.replace(/ctrl_meta|meta/,"ctrl");l._keyMetaBuffer+=k}var r=this._customKeymappingCache;r[q]&&r[q].states&&
+r[q].states[n]&&o.push(r[q]);t&&t.states[n]&&o.push(t);for(n=0;n<o.length;n++){r=this._bindingsMatch(k,m,l,o[n]);if(!c.none(r))return r}}l=d.getExtensions("command");var s=null;o={};k=k.replace(/ctrl_meta|meta/,"ctrl");l.some(function(v){if(this._commandMatches(v,k,m)){s=v;return true}return false}.bind(this));return c.none(s)?null:{commandExt:s,args:o}},_bindingsMatch:function(k,l,m,n){var o,q=null,t={},r;r=c.none(n.hasMetaKey)?m._keyMetaBuffer:m._keyBuffer;if(k.indexOf("alt_")===0&&l.isCommandKey)r+=
+k;n.states[m._keyState].some(function(s){if(s.key&&!s.key.test(k))return false;if(s.regex&&!(o=s.regex.exec(r)))return false;if(s.disallowMatches)for(var v=0;v<s.disallowMatches.length;v++)if(o[s.disallowMatches[v]])return true;if(!b.flagsMatch(s.predicates,l))return false;if(s.exec){q=d.getExtensionByKey("command",s.exec);if(c.none(q))throw new Error("Can't find command "+s.exec+" in state="+m._keyState+", symbolicName="+k);if(s.params){var w;s.params.forEach(function(y){w=c.none(y.match)?y.defaultValue:
+o[y.match]||y.defaultValue;if(y.type==="number")w=parseInt(w);t[y.name]=w})}m.resetKeyBuffers()}if(s.then){m._keyState=s.then;m.resetKeyBuffers()}if(c.none(q))q="no command";return true});if(c.none(q))return null;return{commandExt:q,args:t}},_commandMatches:function(k,l,m){if(!b.flagsMatch(k.predicates,m))return false;var n=k.key;if(!n)return false;if(typeof n==="string"){if(n!=l)return false;return true}if(!n.isArray){n=[n];k.key=n}for(k=0;k<n.length;k++){var o=n[k];if(typeof o==="string"){if(o==
+l)return true}else if(o.key==l)return b.flagsMatch(o.predicates,m)}return false},_customKeymappingChanged:function(){var k=this._customKeymappingCache=JSON.parse(f.get("customKeymapping"));for(mapping in k)for(state in k[mapping].states)this._buildBindingsRegex(k[mapping].states[state])}.observes("settings:index#settings.customKeymapping")});b.flagsMatch=function(k,l){if(c.none(k))return true;if(!l)return false;for(var m in k)if(l[m]!==k[m])return false;return true};b.keyboardManager=a.create()});
+tiki.module("canon:request",function(a,b){var c=a("sproutcore/runtime").SC,d=a("settings").settings;b.history=c.Object.create({requests:[],trim:function(){for(var e=d.get("historyLength");this.requests.length>e;)this.requests.shiftObject()}.observes(".requests")});b.Request=c.Object.extend({command:undefined,commandExt:undefined,args:undefined,typed:undefined,outputs:undefined,start:undefined,end:undefined,duration:undefined,completed:undefined,error:undefined,_inited:undefined,_init:function(){this.set("_inited",
+true);this.outputs=[];this.start=new Date;this.error=this.completed=false;b.history.requests.pushObject(this)},doneWithError:function(e){this.set("error",true).done(e)},async:function(){this.get("_inited")||this._init()},output:function(e){this.get("_inited")||this._init();this.outputs.pushObject(e);return this},done:function(e){e&&this.output(e);this.set("completed",true);this.set("end",new Date);this.set("duration",this.get("end").getTime()-this.get("start").getTime())}})});
+tiki.module("canon:index",function(){});tiki.register("appsupport",{});
+tiki.module("appsupport:controllers/undomanager",function(a,b){a=a("sproutcore/runtime").SC;b.undoManager=a.Object.create({_redoStack:null,_undoStack:null,_undoOrRedo:function(c,d,e){if(d.length===0)return false;d=d.pop();if(!d.target[c](d.context)){this._redoStack=[];this._undoStack=[];return false}e.push(d);return true},init:function(){this._redoStack=[];this._undoStack=[]},redo:function(){return this._undoOrRedo("redo",this._redoStack,this._undoStack)},registerUndo:function(c,d){this._redoStack=
+[];this._undoStack.push({target:c,context:d})},undo:function(){return this._undoOrRedo("undo",this._undoStack,this._redoStack)}});b.undoManagerCommand=function(c,d,e){b.undoManager[e.commandExt.name]()}});tiki.module("appsupport:views/keylistener",function(a,b){var c=a("sproutcore/runtime").SC,d=a("canon:keyboard").keyboardManager;b.KeyListener=c.Responder.extend({performKeyEquivalent:function(e,f){d.processKeyEvent(f,this,{isApplication:true})}})});tiki.module("appsupport:index",function(){});
+tiki.register("delegate_support",{});tiki.module("delegate_support:index",function(a,b){a("sproutcore/runtime");b.MultiDelegateSupport={delegates:[],addDelegate:function(c){this.set("delegates",this.get("delegates").concat(c))},notifyDelegates:function(c){for(var d=[this],e=1;e<arguments.length;e++)d.push(arguments[e]);this.get("delegates").forEach(function(f){f.respondsTo(c)&&f[c].apply(f,d)})}}});tiki.register("rangeutils",{});
+tiki.module("rangeutils:utils/range",function(a,b){var c=a("sproutcore/runtime").SC;b.addPositions=function(d,e){return{row:d.row+e.row,column:d.column+e.column}};b.comparePositions=function(d,e){var f=d.row-e.row;return f===0?d.column-e.column:f};b.equal=function(d,e){return b.comparePositions(d.start,e.start)===0&&b.comparePositions(d.end,e.end)===0};b.extendRange=function(d,e){var f=d.end;return{start:d.start,end:{row:f.row+e.row,column:f.column+e.column}}};b.intersectRangeSets=function(d,e){d=
+c.clone(d);e=c.clone(e);for(var f=[];d.length>0&&e.length>0;){var g=d.shift(),h=e.shift(),j=b.comparePositions(g.start,h.start),k=b.comparePositions(g.end,h.end);if(b.comparePositions(g.end,h.start)<0){f.push(g);e.unshift(h)}else if(b.comparePositions(h.end,g.start)<0){f.push(h);d.unshift(g)}else if(j<0){f.push({start:g.start,end:h.start});d.unshift({start:h.start,end:g.end});e.unshift(h)}else if(j===0)if(k<0)e.unshift({start:g.end,end:h.end});else k>0&&d.unshift({start:h.end,end:g.end});else if(j>
+0){f.push({start:h.start,end:g.start});d.unshift(g);e.unshift({start:g.start,end:h.end})}}return f.concat(d,e)};b.isZeroLength=function(d){return d.start.row===d.end.row&&d.start.column===d.end.column};b.maxPosition=function(d,e){return b.comparePositions(d,e)>0?d:e};b.normalizeRange=function(d){return this.comparePositions(d.start,d.end)<0?d:{start:d.end,end:d.start}};b.rangeSetBoundaries=function(d){return{start:d[0].start,end:d[d.length-1].end}};b.toString=function(d){var e=d.start;d=d.end;return"[ %@,%@ %@,%@ ]".fmt(e.row,
+e.column,d.row,d.column)};b.unionRanges=function(d,e){return{start:d.start.row<e.start.row||d.start.row===e.start.row&&d.start.column<e.start.column?d.start:e.start,end:d.end.row>e.end.row||d.end.row===e.end.row&&d.end.column>e.end.column?d.end:e.end}}});tiki.module("rangeutils:index",function(){});tiki.register("syntax_manager",{});
+tiki.module("syntax_manager:controllers/standardsyntax",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:promise").Promise;b.StandardSyntax=c.Object.extend({_stickySupported:null,_parseActions:function(e){if(c.none(e))return[];return e.split(" ").map(function(f){f=f.split(":");return f.length===1?["transition",f[0]]:f})},_transition:function(e,f){var g=f;e.actions.forEach(function(h){if(h[0]==="transition")g=h[1]});return g},states:null,init:function(){for(var e=null,f=this.get("states"),
+g=f.length,h=0;h<g;h++)for(var j=f[h],k=j.length,l=0;l<k;l++){var m=j[l].regex;if(e===null)e=m.sticky!==undefined;if(e)m.sticky=true}this._stickySupported=e},syntaxInfoForLineFragment:function(e,f,g,h,j){var k=new d,l=[],m=this._stickySupported,n=this.get("states");if(j!==null&&j<g.length)g=g.substring(0,j);var o=g.length;for(h=h;h!==o;){var q=m?g:g.substring(h);if(n[f]===undefined)throw new Error("StandardSyntax: no such states '%@'".fmt(f));for(var t={start:h,state:f},r,s=n[f],v=s.length,w=0;w<
+v;w++){r=s[w];var y=r.regex;if(m)y.lastIndex=h;var x=y.exec(q);if(x!==null){q=x[0].length;t.end=h+q;t.tag=r.tag;t.actions=this._parseActions(r.then);r=this._transition(t,f);if(q===0&&r===f)throw new Error("Syntax regex matches the empty string and the state didn't change: "+y.toSource());f=r;break}}if(t.tag===undefined){t.end=h+1;t.tag="plain";t.actions=[]}h!==t.end&&l.push(t);h=t.end}j===null&&l.push({start:h,end:null,state:f,tag:"plain",actions:[]});k.resolve({attrs:l,next:{context:e,state:f}});
+return k}})});
+tiki.module("syntax_manager:controllers/syntaxdirectory",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:promise").Promise;b.discoveredNewSyntax=function(f){b.syntaxDirectory.registerExtension(f)};var e=c.Object.extend({extension:null,name:null,init:function(){this.set("name",this.get("extension").name)}});b.syntaxDirectory=c.Object.create({_syntaxInfo:{},loadSyntax:function(f){f=this._syntaxInfo[f];if(f===undefined)return null;var g=new d;f.get("extension").load(function(h){g.resolve(h)});return g},
+registerExtension:function(f){f=e.create({extension:f});this._syntaxInfo[f.get("name")]=f}})});
+tiki.module("syntax_manager:controllers/syntaxmanager",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:promise"),e=a("utils/array"),f=a("delegate_support").MultiDelegateSupport,g=d.Promise,h=a("rangeutils:utils/range");a("utils/yield");var j=a("bespin:plugins").catalog,k=a("bespin:console").console,l=a("controllers/syntaxdirectory").syntaxDirectory;b.SyntaxManager=c.Object.extend(f,{_invalidRows:[],_lineAttrInfo:null,_adjustInvalidRowsForDeletion:function(m,n){var o=[];this._invalidRows.forEach(function(q){if(q<=
+m)o.push(q);else q>m||q<n||q>=n&&o.push(q-(n-m))});this._invalidRows=o},_adjustInvalidRowsForInsertion:function(m,n){this._invalidRows=this._invalidRows.map(function(o){return o<m?o:o+n-m})},_attrIndexForColumn:function(m,n){m=e.binarySearch(m,n,function(o,q){if(o<q.start)return-1;q=q.end;if(q!==null&&o>=q)return 1;return 0});m===null&&k.error("position not found",position);return m},_attrsToString:function(m){return m.map(function(n){return"%@.%@.%@@%@-%@".fmt(n.context,n.state,n.tag,n.start,n.end)}.bind(this)).join(", ")},
+_clearAttrsAtRow:function(m){for(var n=[],o=0;o<2;o++)n.push(this._defaultAttrs());this._lineAttrInfo[m].attrs=n},_deepSyntaxInfoForLine:function(m,n){var o=new g,q=m[0],t=q.context;this._shallowSyntaxInfoForLineFragment(t,q.state,n,0,null).then(function(r){var s=r.attrs;s.forEach(function(y){y.context=t});var v=[{attrs:s,next:r.next}],w=this._innerRangesFromAttrs(s,m[1]);if(w.length===0){v.push({attrs:[{context:null,start:0,end:null}],next:{context:null}});o.resolve(v)}else{r=w.map(function(y){return this._shallowSyntaxInfoForLineFragment(y.context,
+y.state,n,y.start,y.end)}.bind(this));d.group(r).then(function(y){var x=y.map(function(E){return E.attrs});for(y=0;y<x.length;y++){var D=w[y].context;x[y].forEach(function(E){E.context=D})}y=this._flattenAttrGroups(x);x=x[x.length-1];x=x[x.length-1];v.push({attrs:y,next:x.end===null?{context:x.context,state:x.state}:{context:null}});o.resolve(v)}.bind(this))}}.bind(this));return o},_defaultAttrs:function(){return[{start:0,end:null,tag:"plain",actions:[]}]},_deleteAttrsInRange:function(m){var n=m.start.row;
+m=m.end.row;this._clearAttrsAtRow(n);this._lineAttrInfo.splice(n+1,m-n)},_deleteRange:function(m){if(!h.isZeroLength(m)){this._deleteAttrsInRange(m);var n=m.start.row;this._adjustInvalidRowsForDeletion(n,m.end.row);this._invalidateRow(n)}},_flattenAttrGroups:function(m){var n=[],o=0;m.forEach(function(q){var t=q[0].start;o!==t&&n.push({start:o,end:t,context:null});n.pushObjects(q);o=q[q.length-1].end});o!==null&&n.push({start:o,end:null,context:null});return n},_initialContextChanged:function(){this._reset();
+this.notifyDelegates("syntaxManagerInvalidatedSyntax")}.observes("initialContext"),_innerRangesFromAttrs:function(m,n){var o=n.context,q=n.state,t=0,r=[];m.forEach(function(s){s.actions.forEach(function(v){switch(v[0]){case "start":if(o!==null)break;o=v[1];q="start";t=s.end;break;case "stop":if(o!==v[1])break;v=s.start;t!==v&&r.push({context:o,state:q,start:t,end:v});o=null;break}})});o!==null&&r.push({context:o,state:q,start:t,end:null});return r},_insertAttrsIntoRange:function(m){var n=m.start.row,
+o=m.end.row;this._clearAttrsAtRow(n);m=this._lineAttrInfo;o=o-n;for(var q=0;q<o;q++){for(var t=[],r=[],s=0;s<2;s++){t.push({context:null});r.push(this._defaultAttrs())}m.splice(n+1,0,{snapshot:t,attrs:r})}},_insertRange:function(m){if(!h.isZeroLength(m)){this._insertAttrsIntoRange(m);var n=m.start.row;this._adjustInvalidRowsForInsertion(n,m.end.row);this._invalidateRow(n)}},_invalidateRow:function(m){var n=this._invalidRows;n.push(m);n.sort(function(o,q){return o-q});this._invalidRows=n.uniq()},_mergeAttrGroups:function(m){var n=
+[],o=m[0];m=m[1];for(var q=0,t=0,r=0;r!==null;){var s=o[q],v=m[t];if(v.context!==null){n.push(v);r=v.end;t++;s.end===r&&q++}else{n.push(s);r=s.end;q++;v.end===r&&t++}}return n},_recomputeAttrInfoForRows:function(m,n,o){var q=new g,t=this._lineAttrInfo;if(m===n){q.resolve(m===t.length?m:false);return q}if(c.none(o))o=0;var r=t[m],s=this.getPath("textStorage.lines")[m];this._deepSyntaxInfoForLine(r.snapshot,s).then(function(v){r.attrs=v.map(function(x){return x.attrs});if(m!==t.length-1){var w=t[m+
+1],y=w.snapshot;v=v.map(function(x){return x.next});if(this._snapshotsEqual(y,v)){q.resolve(m+1);return}w.snapshot=v}o===50?window.setTimeout(function(){c.run(function(){this._recomputeAttrInfoForRows(m+1,n,0).then(function(x){q.resolve(x)})}.bind(this))}.bind(this),0):this._recomputeAttrInfoForRows(m+1,n,o+1).then(function(x){q.resolve(x)})}.bind(this));return q},_reset:function(){for(var m=[],n=this.getPath("textStorage.lines").length,o=this.get("initialContext"),q=0;q<n;q++)m.push({snapshot:[q===
+0?{context:o,state:"start"}:{context:null},{context:null}],attrs:[this._defaultAttrs(),[{context:null,start:0,end:null}]]});this._invalidRows=[0];this._lineAttrInfo=m},_shallowSyntaxInfoForLineFragment:function(m,n,o,q,t){var r=new g;m==="plain"?r.resolve({attrs:this._defaultAttrs(),next:{context:"plain",state:"start"}}):l.loadSyntax(m).then(function(s){try{s.syntaxInfoForLineFragment(m,n,o,q,t).then(function(w){r.resolve(w)})}catch(v){k.log("Syntax highlighter ",m," caused an exception:",v);r.resolve({attrs:this._defaultAttrs(),
+next:{context:"plain",state:"start"}})}}.bind(this));return r},_snapshotsEqual:function(m,n){if(m.length!==n.length)return false;for(var o=0;o<m.length;o++){var q=m[o],t=n[o];if(q.context!==t.context||q.state!==t.state)return false}return true},initialContext:"plain",textStorage:null,attrsForRows:function(m,n){return this._lineAttrInfo.slice(m,n).map(function(o){return this._mergeAttrGroups(o.attrs)},this)},contextsAtPosition:function(m){var n=[];this._lineAttrInfo[m.row].attrs.forEach(function(o){var q=
+this._attrIndexForColumn(o,m.column);o=o[q].context;o!==null&&n.push(o)},this);return n},init:function(){this._reset()},layoutManagerReplacedText:function(m,n){this._deleteRange(m);this._insertRange(n)},setInitialContextFromExt:function(m){m=m.toLowerCase();m=j.getExtensionByKey("fileextension",m);this.set("initialContext",c.none(m)||c.none(m.syntax)?"plain":m.syntax)},toString:function(){return"{ lineAttrInfo: [ %@ ], invalidRows: [ %@ ] }".fmt(this._lineAttrInfo.map(function(m){return"{ (%@) -> (%@) }".fmt(m.snapshot.map(function(n){return n.context+
+": "+n.state}).join(", "),m.attrs.map(this._attrsToString.bind(this)).join(", "))}.bind(this)).join(", "),this._invalidRows.join(", "))},updateSyntaxForRows:function(m,n){var o=this._invalidRows,q=o.length,t;for(t=0;t<q;t++){var r=o[t];if(r<n)break}var s=new g;if(t===q)s.resolve({startRow:m,endRow:m});else{for(r=o[t];t<o.length&&o[t]<n;)o.splice(t,1);this._recomputeAttrInfoForRows(r,n).then(function(v){if(v===false){this._invalidateRow(n);v=n}s.resolve({startRow:m,endRow:v})}.bind(this))}return s}})});
+tiki.module("syntax_manager:utils/array",function(a,b){a("sproutcore/runtime");b.binarySearch=function(c,d,e){for(var f=0,g=c.length;f<g;){var h=f+(g-f)/2>>0,j=e(d,c[h]);if(j<0)g=h;else if(j>0)f=h+1;else return h}return null}});
+tiki.module("syntax_manager:utils/yield",function(a,b){a("sproutcore/runtime");var c=a("bespin:promise").Promise;b.loop=function(d,e,f){for(var g=new c;d(g);){var h=e(),j=h.valueIfResolved();if(j===null){h.then(function(k){f(k,g)&&b.loop(d,e,f).then(function(l){g.resolve(l)})});return g}if(!f(j,g))return g}return g}});tiki.module("syntax_manager:index",function(){});tiki.register("text_editor",{});
+tiki.module("text_editor:commands/editing",function(a,b){var c=a("settings").settings;a("rangeutils:utils/range");b.backspace=function(e){e.get("view").performBackspaceOrDelete(true)};b.deleteCommand=function(e){e.get("view").performBackspaceOrDelete(false)};b.deleteLines=function(e){var f=e.get("view"),g=f.getSelectedRange();f.groupChanges(function(){var h={column:0,row:g.start.row};f.replaceCharacters({start:h,end:{column:0,row:g.end.row+1}},"");f.moveCursorTo(h)})};var d=function(e,f){var g=f.getSelectedRange().start,
+h=g.row;g=g.column;e=/^\s*/.exec(e.get("lines")[h].substring(0,g));f.insertText("\n"+e)};b.insertText=function(e,f){e.get("view").insertText(f.text)};b.newline=function(e){var f=e.get("model");e=e.get("view");d(f,e)};b.openLine=function(e){var f=e.get("model");e=e.get("view");var g=e.getSelectedRange().end.row,h=f.get("lines");e.moveCursorTo({row:g,column:h[g].length});d(f,e)};b.tab=function(e){e=e.get("view");var f=c.get("tabstop"),g=e.getSelectedRange();f=f-g.start.column%f;g="";for(var h=0;h<f;h++)g+=
+" ";e.insertText(g)}});
+tiki.module("text_editor:commands/editor",function(a,b){var c=a("bespin:plugins").catalog,d=a("settings").settings;b.findCommand=function(f,g,h){if("value"in g){f=f.get("view");var j=f.get("searchController"),k=f.getSelectedRange(),l="";j.setSearchText(g.value,false);if(j=j.findNext(k.end,true)){f.setSelection(j,true);f.focus()}else l+="<i>No matches found</i><br>";l+='Searching for "'+g.value+'"';h.done(l)}else{g=c.getObject("clicontroller");SC.none(g)||g.prompt("find ")}};b.findNextCommand=function(f){f=
+f.get("view");var g=f.get("searchController"),h=f.getSelectedRange();if(g=g.findNext(h.end,true)){f.setSelection(g,true);f.focus()}};b.findPrevCommand=function(f){f=f.get("view");var g=f.get("searchController"),h=f.getSelectedRange();if(g=g.findPrevious(h.start,true)){f.setSelection(g,true);f.focus()}};b.gotoCommand=function(f,g){if("line"in g){f=f.get("view");f.moveCursorTo({row:g.line-1,column:0});f.focus()}else{g=c.getObject("clicontroller");SC.none(g)||g.prompt("goto ")}};var e=function(f,g){var h=
+f.get("view"),j=h.getSelectedCharacters();g=g(j);h=h.getSelectedRange();f.get("model").replaceCharacters(h,g)};b.replaceCommand=function(f,g){e(f,function(h){return h.replace(g.search+"/g",g.replace)})};b.entabCommand=function(f){tabstop=d.get("tabstop");e(f,function(g){return g.replace(" {"+tabstop+"}","\t")})};b.detabCommand=function(f){tabstop=d.get("tabstop");e(f,function(g){return g.replace("\t",(new Array(tabstop+1)).join(" "))})};b.trimCommand=function(f,g){e(f,function(h){h=h.split("\n");
+h=h.map(function(j){if(g.side==="left"||g.side==="both")j=j.replace(/^\s+/,"");if(g.side==="right"||g.side==="both")j=j.replace(/\s+$/,"");return j});return h.join("\n")})};b.ucCommand=function(f){e(f,function(g){return g.toUpperCase()})};b.lcCommand=function(f){e(f,function(g){return g.toLowerCase()})}});
+tiki.module("text_editor:commands/movement",function(a,b){a("rangeutils:utils/range");b.moveDown=function(h){h.get("view").moveDown()};b.moveLeft=function(h){h.get("view").moveLeft()};b.moveRight=function(h){h.get("view").moveRight()};b.moveUp=function(h){h.get("view").moveUp()};b.selectDown=function(h){h.get("view").selectDown()};b.selectLeft=function(h){h.get("view").selectLeft()};b.selectRight=function(h){h.get("view").selectRight()};b.selectUp=function(h){h.get("view").selectUp()};var c=function(h,
+j,k){var l=h.get("view");h=h.get("model").get("lines");var m=l.getSelectedRange();k=k?m.end.row:h.length-1;l.moveCursorTo({row:k,column:h[k].length},j)};b.moveLineEnd=function(h){c(h,false,true)};b.selectLineEnd=function(h){c(h,true,true)};b.moveDocEnd=function(h){c(h,false,false)};b.selectDocEnd=function(h){c(h,true,false)};var d=function(h,j,k){h=h.get("view");var l=h.getSelectedRange();h.moveCursorTo({row:k?l.end.row:0,column:0},j)};b.moveLineStart=function(h){d(h,false,true)};b.selectLineStart=
+function(h){d(h,true,true)};b.moveDocStart=function(h){d(h,false,false)};b.selectDocStart=function(h){d(h,true,false)};var e=function(h,j,k,l,m){var n=0,o=false;if(l<0){k--;if(m)n=1}for(;k<j.length&&k>-1;){if(m=h.isDelimiter(j[k]))n++;else o=true;if((m||n>1)&&o)break;k+=l}l<0&&k++;return k},f=function(h,j){var k=h.get("view");h=h.get("model").get("lines");var l=k.getSelectedRange(true).end,m=l.row;l=l.column;var n=h[m],o=false;if(l>=n.length){m++;o=true;if(m<h.length){l=0;n=h[m]}else n=""}l=e(k,n,
+l,1,o);k.moveCursorTo({row:m,column:l},j)},g=function(h,j){var k=h.get("view");h=h.get("model").get("lines");var l=k.getSelectedRange(true).end,m=l.row;l=l.column;var n=h[m],o=false;if(l>n.length)l=n.length;else if(l==0){m--;o=true;if(m>-1){n=h[m];l=n.length}else n=""}l=e(k,n,l,-1,o);k.moveCursorTo({row:m,column:l},j)};b.moveNextWord=function(h){f(h,false)};b.selectNextWord=function(h){f(h,true)};b.movePreviousWord=function(h){g(h,false)};b.selectPreviousWord=function(h){g(h,true)};b.selectAll=function(h){h.get("view").selectAll()}});
+tiki.module("text_editor:commands/scrolling",function(a,b){b.scrollDocStart=function(c){c.get("view").scrollToPosition({column:0,row:0})};b.scrollDocEnd=function(c){c.get("view").scrollToPosition(c.get("model").range().end)};b.scrollPageDown=function(c){c.get("view").scrollPageDown()};b.scrollPageUp=function(c){c.get("view").scrollPageUp()}});
+tiki.module("text_editor:controllers/layoutmanager",function(a,b){var c=a("sproutcore/runtime").SC,d=a("delegate_support").MultiDelegateSupport;a("rangeutils:utils/range");var e=a("syntax_manager:controllers/syntaxmanager").SyntaxManager,f=a("models/textstorage").TextStorage;a=a("bespin:plugins").catalog;b.LayoutManager=c.Object.extend(d,{_maximumWidth:0,characterWidth:8,lineAscent:16,lineHeight:20,margin:{left:5,bottom:6,top:0,right:12},pluginCatalog:a,syntaxManager:e,textLines:null,textStorage:f,
+theme:{editorTextColor:"rgb(230, 230, 230)",editorTextColor_comment:"rgb(102, 102, 102)",editorTextColor_directive:"rgb(153, 153, 153)",editorTextColor_error:"rgb(255, 0, 0)",editorTextColor_identifier:"rgb(230, 230, 230)",editorTextColor_keyword:"rgb(66, 168, 237)",editorTextColor_operator:"rgb(136, 187, 255)",editorTextColor_plain:"rgb(230, 230, 230)",editorTextColor_string:"rgb(3, 154, 10)"},_computeInvalidRects:function(g,h){var j=this.characterRectForPosition(g.start),k={x:j.x,y:j.y,width:Number.MAX_VALUE,
+height:j.height};return g.end.row===h.end.row?[k]:[k,{x:0,y:j.y+this.get("lineHeight"),width:Number.MAX_VALUE,height:Number.MAX_VALUE}]},_lastCharacterPosition:function(){return{row:this.get("textLines").length-1,column:this._maximumWidth}},_recalculateMaximumWidth:function(){var g=0;this.get("textLines").forEach(function(h){h=h.characters.length;if(g<h)g=h});this._maximumWidth=g},_recomputeEntireLayout:function(){var g=this.get("textStorage").range();this._recomputeLayoutForRanges(g,g)},_recomputeLayoutForRanges:function(g,
+h){for(var j=g.start.row,k=g.end.row,l=h.end.row,m=l-j+1,n=this.getPath("textStorage.lines"),o=this.get("theme").editorTextColor_plain,q=[],t=0;t<m;t++)q[t]={characters:n[j+t],colors:[{start:0,end:null,color:o}]};this.textLines.replace(j,k-j+1,q);this._recalculateMaximumWidth();this.updateTextRows(j,l+1);this.notifyDelegates("layoutManagerChangedTextAtRow",j);this.notifyDelegates("layoutManagerInvalidatedRects",this._computeInvalidRects(g,h))},boundingRect:function(){return this.rectsForRange({start:{row:0,
+column:0},end:{row:this.get("textLines").length-1,column:this._maximumWidth}})[0]},characterAtPoint:function(g){var h=this.get("margin"),j=g.x-h.left,k=g.y-h.top;g=this.get("characterWidth");h=this.get("textStorage");k=h.clampPosition({row:Math.floor(k/this.get("lineHeight")),column:Math.floor(j/g)});h=h.get("lines")[k.row].length;return c.mixin(k,{partialFraction:j<0||k.column===h?0:j%g/g})},characterRangeForBoundingRect:function(g){var h=this.get("lineHeight"),j=this.get("characterWidth"),k=this.get("margin"),
+l=g.x-k.left;k=g.y-k.top;return{start:{row:Math.max(Math.floor(k/h),0),column:Math.max(Math.floor(l/j),0)},end:{row:Math.floor((k+g.height-1)/h),column:Math.floor((l+g.width-1)/j)+1}}},characterRectForPosition:function(g){return this.rectsForRange({start:g,end:{row:g.row,column:g.column+1}})[0]},createSyntaxManager:function(){this.set("syntaxManager",this.get("syntaxManager").create({delegates:[this],textStorage:this.get("textStorage")}))},createTextStorage:function(){this.set("textStorage",this.get("textStorage").create())},
+init:function(){this.set("textLines",[{characters:"",colors:[{start:0,end:0,color:this.get("theme").editorTextColor}]}]);this.createTextStorage();this.get("textStorage").addDelegate(this);this.createSyntaxManager();this._recomputeEntireLayout()},lineRectForRow:function(g){return this.rectsForRange({start:{row:g,column:0},end:{row:g,column:this._maximumWidth}})[0]},rectForPosition:function(g){var h=this.get("margin"),j=this.get("characterWidth"),k=this.get("lineHeight");return{x:h.left+j*g.column,
+y:h.top+k*g.row,width:j,height:k}},rectsForRange:function(g){var h=this.get("characterWidth"),j=this.get("lineHeight"),k=this._maximumWidth,l=this.get("margin"),m=g.start,n=g.end;g=m.row;var o=m.column;m=n.row;n=n.column;if(g===m)return[{x:l.left+h*o,y:l.top+j*g,width:h*(n-o),height:j}];var q=[],t;if(o===0)t=g;else{t=g+1;q.push({x:l.left+h*o,y:l.top+j*g,width:h*(k-o),height:j})}if(n===0)g=m-1;else if(n===k)g=m;else{g=m-1;q.push({x:l.left,y:l.top+j*m,width:h*n,height:j})}q.push({x:l.left,y:l.top+j*
+t,width:h*k,height:j*(g-t+1)});return q},syntaxManagerInvalidatedSyntax:function(){this._recomputeEntireLayout()},textStorageEdited:function(g,h,j){this.get("syntaxManager").layoutManagerReplacedText(h,j);this._recomputeLayoutForRanges(h,j)},updateTextRows:function(g,h){var j=this.get("textLines");h=this.get("syntaxManager").attrsForRows(g,h);for(var k=this.get("theme"),l=0;l<h.length;l++)j[g+l].colors=h[l].map(function(m){var n=k["editorTextColor_"+m.tag];if(c.none(n))n=k.editorTextColor_plain;return{start:m.start,
+end:m.end,color:n}})}})});
+tiki.module("text_editor:controllers/search",function(a,b){var c=a("sproutcore/runtime").SC;a("rangeutils:utils/range");a("bespin:console");b.EditorSearchController=c.Object.extend({_escapeString:/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g,_findMatchesInString:function(d){var e=[],f=this.get("searchRegExp"),g;for(f.lastIndex=0;;){g=f.exec(d);if(g===null)break;e.push(g);f.lastIndex=g.index+g[0].length}return e},_makeRange:function(d,e){return{start:{row:e,column:d.index},end:{row:e,column:d.index+
+d[0].length}}},isRegExp:null,searchRegExp:null,searchText:null,textView:null,setSearchText:function(d,e){this.set("searchRegExp",e?new RegExp(d):new RegExp(d.replace(this._escapeString,"\\$1"),"gi"));this.set("isRegExp",e);this.set("searchText",d)},findNext:function(d,e){var f=this.get("searchRegExp");if(c.none(f))return null;var g=this.get("textView");d=d||g.getSelectedRange().end;g=g.getPath("layoutManager.textStorage.lines");var h;f.lastIndex=d.column;var j;for(j=d.row;j<g.length;j++){h=f.exec(g[j]);
+if(!c.none(h))return this._makeRange(h,j)}if(!e)return null;for(j=0;j<=d.row;j++){h=f.exec(g[j]);if(!c.none(h))return this._makeRange(h,j)}return null},findPrevious:function(d,e){var f=this.get("searchRegExp");if(c.none(f))return null;f=this.get("textView");d=d||f.getSelectedRange().start;f=f.getPath("layoutManager.textStorage.lines");var g;g=this._findMatchesInString(f[d.row].substring(0,d.column));if(g.length!==0)return this._makeRange(g[g.length-1],d.row);var h;for(h=d.row-1;h!==-1;h--){g=this._findMatchesInString(f[h]);
+if(g.length!==0)return this._makeRange(g[g.length-1],h)}if(!e)return null;for(h=f.length-1;h>=d.row;h--){g=this._findMatchesInString(f[h]);if(g.length!==0)return this._makeRange(g[g.length-1],h)}return null}})});
+tiki.module("text_editor:controllers/undo",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:console").console,e=a("appsupport:controllers/undomanager").undoManager;b.EditorUndoController=c.Object.extend({_inTransaction:false,_record:null,textView:null,_beginTransaction:function(){if(this._inTransaction){d.trace();throw new Error("UndoController._beginTransaction() called with a transaction already in place");}this._inTransaction=true;this._record={patches:[]}},_endTransaction:function(){if(!this._inTransaction)throw new Error("UndoController._endTransaction() called without a transaction in place");
+e.registerUndo(this,this._record);this._record=null;this._inTransaction=false},_tryApplyingPatches:function(f){var g=this.getPath("textView.layoutManager.textStorage");f.forEach(function(h){g.replaceCharacters(h.oldRange,h.newCharacters)});return true},_undoOrRedo:function(f,g){if(this._inTransaction)throw new Error("UndoController._undoOrRedo() called while in a transaction");if(!this._tryApplyingPatches(f))return false;this.get("textView").setSelection(g,true);return true},init:function(){this._redoStack=
+[];this._undoStack=[];this.get("textView").addDelegate(this)},redo:function(f){var g=f.patches.concat();g.reverse();return this._undoOrRedo(g,f.selectionAfter)},textViewBeganChangeGroup:function(f,g){this._beginTransaction();this._record.selectionBefore=g},textViewEndedChangeGroup:function(f,g){this._record.selectionAfter=g;this._endTransaction()},textViewReplacedCharacters:function(f,g,h){if(!this._inTransaction)throw new Error("UndoController.textViewReplacedCharacters() called outside a transaction");
+this._record.patches.push({oldCharacters:this._deletedCharacters,oldRange:g,newCharacters:h,newRange:this.getPath("textView.layoutManager.textStorage").resultingRangeForReplacement(g,h.split("\n"))});this._deletedCharacters=null},textViewWillReplaceRange:function(f,g){if(!this._inTransaction)throw new Error("UndoController.textViewWillReplaceRange() called outside a transaction");this._deletedCharacters=this.getPath("textView.layoutManager.textStorage").getCharacters(g)},undo:function(f){return this._undoOrRedo(f.patches.map(function(g){return{oldCharacters:g.newCharacters,
+oldRange:g.newRange,newCharacters:g.oldCharacters,newRange:g.oldRange}}),f.selectionBefore)}})});tiki.module("text_editor:mixins/textbuffer",function(a,b){a("sproutcore/runtime");b.TextBuffer={deleteCharacters:function(c){this.replaceCharacters(c,"")},insertCharacters:function(c,d){this.replaceCharacters({start:c,end:c},d)},resultingRangeForReplacement:function(c,d){var e=d.length;c=c.start;return{start:c,end:{row:c.row+e-1,column:(e===1?c.column:0)+d[e-1].length}}}}});
+tiki.module("text_editor:mixins/textinput",function(a,b){var c=a("sproutcore/runtime").SC;b.TextInput={_TextInput_composing:false,_TextInput_ignore:false,_TextInput_ignoreBlur:false,_TextInput_textFieldId:undefined,_TextInput_textFieldDom:undefined,_TextInput_wantsFocus:false,_isChrome:!!parseFloat(navigator.userAgent.split("Chrome/")[1]),_TextInput_textFieldChanged:function(){if(!(this._TextInput_composing||this._TextInput_ignore)){var d=this._TextInput_textFieldDom,e=d.value;if(e!=""){d.value="";
+this._TextInput_textInserted(e)}}},_TextInput_copy:function(){var d=false;if(this.respondsTo("copy")){c.RunLoop.begin();d=this.copy();c.RunLoop.end()}return d},_TextInput_cut:function(){var d=false;if(this.respondsTo("cut")){c.RunLoop.begin();d=this.cut();c.RunLoop.end()}return d},_TextInput_textInserted:function(d){if(this.respondsTo("textInserted")){c.RunLoop.begin();this.textInserted(d);c.RunLoop.end()}},_TextInput_setValueAndSelect:function(d){var e=this._TextInput_textFieldDom;e.value=d;e.select()},
+focusTextInput:function(){if(c.none(this._TextInput_textFieldDom))this._TextInput_wantsFocus=true;else this._TextInput_textFieldDom.focus()},unfocusTextInput:function(){this._TextInput_textFieldDom.blur()},render:function(d,e){arguments.callee.base.apply(this,arguments);if(e){this.get("frame");var f=d.begin("textarea");this._TextInput_textFieldId=c.guidFor(f);f.id(this._TextInput_textFieldId);f.attr("style","position: absolute; z-index: -99999; top: 0px; left: 0px; width: 0px; height: 0px");f.end()}},
+didCreateLayer:function(){arguments.callee.base.apply(this,arguments);var d=this.$("#"+this._TextInput_textFieldId)[0];this._TextInput_textFieldDom=d;var e=this;this._TextInput_wantsFocus&&window.setTimeout(this.becomeFirstResponder.bind(this),0);if(c.browser.safari){this._isChrome||d.addEventListener("compositionend",function(k){e._TextInput_textInserted(k.data)},false);d.addEventListener("textInput",function(k){e._TextInput_textInserted(k.data)},false);d.addEventListener("paste",function(k){e._TextInput_textInserted(k.clipboardData.getData("text/plain"));
+k.preventDefault()},false)}else{var f=function(){e._TextInput_textFieldChanged()};d.addEventListener("keydown",function(){window.setTimeout(function(){c.run(f)},0)},false);d.addEventListener("keypress",f,false);d.addEventListener("keyup",f,false);d.addEventListener("compositionstart",function(){e._TextInput_composing=true},false);d.addEventListener("compositionend",function(){e._TextInput_composing=false;e._TextInput_textFieldChanged()},false);d.addEventListener("paste",function(){e._TextInput_setValueAndSelect("");
+window.setTimeout(function(){e._TextInput_textFieldChanged()},0)},false)}var g=function(k){k=k.type.indexOf("copy")!=-1?e._TextInput_copy():e._TextInput_cut();e._TextInput_setValueAndSelect(k)};if(c.browser.isSafari&&!this._isChrome&&c.browser.isMac){var h=(new Date).getTime(),j=function(k){var l=k.type.indexOf("cut")!=-1;if(!(l&&(new Date).getTime()-h<10)){g(k);if(l)h=(new Date).getTime()}};d.addEventListener("beforecopy",j,false);d.addEventListener("beforecut",j,false)}else{j=false;if(c.browser.isMozilla)j=
+function(k){g(k);if(c.browser.isMozilla){e._TextInput_ignore=true;window.setTimeout(function(){e._TextInput_setValueAndSelect("");e._TextInput_ignore=false},0)}};d.addEventListener("copy",j||g,false);d.addEventListener("cut",j||g,false)}d.addEventListener("blur",function(){c.run(function(){e._TextInput_ignoreBlur=true;e.resignFirstResponder();e._TextInput_ignoreBlur=false})},false);d.addEventListener("focus",function(){c.run(function(){e.becomeFirstResponder()})},false)},mouseDown:function(){arguments.callee.base.apply(this,
+arguments);window.setTimeout(this.becomeFirstResponder.bind(this),0);return true},willBecomeKeyResponderFrom:function(){arguments.callee.base.apply(this,arguments);this.focusTextInput()},willLoseKeyResponderTo:function(){arguments.callee.base.apply(this,arguments);this._TextInput_ignoreBlur||this.unfocusTextInput()}}});
+tiki.module("text_editor:models/textstorage",function(a,b){var c=a("sproutcore/runtime").SC,d=a("delegate_support").MultiDelegateSupport;a=a("mixins/textbuffer").TextBuffer;b.TextStorage=c.Object.extend(d,a,{lines:null,value:function(e,f){f!==undefined&&this.replaceCharacters(this.range(),f);return this.get("lines").join("\n")}.property("lines.[]"),clampPosition:function(e){var f=this.get("lines"),g=e.row;if(g<0)return{row:0,column:0};else if(g>=f.length)return this.range().end;return{row:g,column:Math.max(0,
+Math.min(e.column,f[g].length))}},clampRange:function(e){return{start:this.clampPosition(e.start),end:this.clampPosition(e.end)}},displacePosition:function(e,f){var g=f>0,h=this.get("lines"),j=h.length;for(f=Math.abs(f);f!==0;f--)if(g){var k=h[e.row].length;if(e.row===j-1&&e.column===k)return e;e=e.column===k?{row:e.row+1,column:0}:{row:e.row,column:e.column+1}}else{if(e.row===0&&e.column==0)return e;if(e.column===0){h=this.get("lines");e={row:e.row-1,column:h[e.row-1].length}}else e={row:e.row,column:e.column-
+1}}return e},getCharacters:function(e){var f=this.get("lines"),g=e.start,h=e.end;e=g.row;var j=h.row;g=g.column;h=h.column;if(e===j)return f[e].substring(g,h);return[f[e].substring(g)].concat(f.slice(e+1,j),f[j].substring(0,h)).join("\n")},init:function(){this.superclass();this.set("delegates",[]);this.set("lines",[""])},range:function(){var e=this.get("lines");return{start:{row:0,column:0},end:{row:e.length-1,column:e[e.length-1].length}}},replaceCharacters:function(e,f){f=f.split("\n");var g=f.length,
+h=this.resultingRangeForReplacement(e,f),j=e.start,k=e.end,l=j.row,m=k.row;j=j.column;var n=this.get("lines");f[0]=n[l].substring(0,j)+f[0];f[g-1]+=n[m].substring(k.column);n.replace(l,m-l+1,f);this.notifyDelegates("textStorageEdited",e,h)}})});
+tiki.module("text_editor:utils/rect",function(a,b){var c=a("sproutcore/runtime").SC;b._distanceFromBounds=function(d,e,f){if(d<e)return d-e;if(d>=f)return d-f;return 0};b.merge=function(d){var e;do{e=false;for(var f=[],g=0;g<d.length;g++){var h=d[g];f.push(h);for(var j=g+1;j<d.length;j++){var k=d[j];if(b.rectsSideBySide(h,k)||b.rectsIntersect(h,k)){d.removeAt(j,1);f[f.length-1]=c.unionRects(h,k);e=true;break}}}d=f}while(e);return d};b.offsetFromRect=function(d,e){return{x:b._distanceFromBounds(e.x,
+d.x,c.maxX(d)),y:b._distanceFromBounds(e.y,d.y,c.maxY(d))}};b.rectsIntersect=function(d,e){d=c.intersectRects(d,e);return d.width!==0&&d.height!==0};b.rectsSideBySide=function(d,e){if(d.x==e.x&&d.width==e.width)return d.y<e.y?d.y+d.height==e.y:e.y+e.height==d.y;else if(d.y==e.y&&d.height==e.height)return d.x<e.x?d.x+d.width==e.x:e.x+e.width==d.x;return false}});
+tiki.module("text_editor:views/canvas",function(a,b){var c=a("sproutcore/runtime").SC,d=a("utils/rect");b.CanvasView=c.View.extend({_cvCanvasContext:null,_cvCanvasDom:null,_cvCanvasId:null,_cvInvalidRects:null,_cvLastRedrawTime:null,_cvPreviousClippingFrame:null,_cvRedrawTimer:null,_cvClippingFrameChanged:function(){var e=this._cvPreviousClippingFrame,f=this.get("clippingFrame");if(e===null||!c.rectsEqual(f,e)){this._cvPreviousClippingFrame=f;this.clippingFrameChanged()}}.observes("clippingFrame"),
+_cvGetContext:function(){if(this._cvCanvasContext===null)this._cvCanvasContext=this._cvCanvasDom.getContext("2d");return this._cvCanvasContext},_cvResizeCanvas:function(){var e=this.getPath("parentView.frame"),f=this._cvCanvasDom;if(!c.none(f)){var g=f.width<e.width,h=f.height<e.height;if(g)f.width=e.width;if(h)f.height=e.height;if(g||h)this.setNeedsDisplay()}},layoutStyle:{left:"0px",top:"0px"},minimumRedrawDelay:1E3/30,clippingFrameChanged:function(){this.setNeedsDisplay()},didCreateLayer:function(){arguments.callee.base.apply(this,
+arguments);this._cvCanvasDom=this.$("#"+this._cvCanvasId)[0];this.redraw()},drawRect:function(){},init:function(){arguments.callee.base.apply(this,arguments);this._cvInvalidRects=[];this.get("parentView").addObserver("frame",this,this.parentViewFrameChanged)},parentViewFrameChanged:function(){this._cvResizeCanvas()},redraw:function(){var e=this.get("frame");e.x<0&&this.computeFrameWithParentFrame(null);var f=this._cvGetContext();f.save();f.translate(Math.round(e.x),Math.round(e.y));var g=this.get("clippingFrame");
+g={x:Math.round(g.x),y:Math.round(g.y),width:g.width,height:g.height};e=this._cvInvalidRects;e==="all"?this.drawRect(g,f):d.merge(e).forEach(function(h){f.save();h=c.intersectRects(h,g);if(h.width!==0&&h.height!==0){var j=h.x,k=h.y,l=h.width,m=h.height;f.beginPath();f.moveTo(j,k);f.lineTo(j+l,k);f.lineTo(j+l,k+m);f.lineTo(j,k+m);f.closePath();f.clip();this.drawRect(h,f)}f.restore()},this);f.restore();this._cvInvalidRects=[];this._cvLastRedrawTime=(new Date).getTime();return true},render:function(e,
+f){arguments.callee.base.apply(this,arguments);if(f){var g=this.getPath("parentView.frame"),h=e.begin("canvas");this._cvCanvasId=c.guidFor(h);h.id(this._cvCanvasId);h.attr("width",""+g.width);h.attr("height",""+g.height);h.push("canvas tag not supported by your browser");h.end()}else this.invokeLater(this.tryRedraw,0)},renderLayout:function(e,f){arguments.callee.base.apply(this,arguments);var g=this.getPath("parentView.frame");if(f){e.attr("width",g.width);e.attr("height",g.height)}},setNeedsDisplay:function(){this._cvInvalidRects=
+"all";this.set("layerNeedsUpdate",true)},setNeedsDisplayInRect:function(e){var f=this._cvInvalidRects;f!=="all"&&f.push(e);this.set("layerNeedsUpdate",true)},tryRedraw:function(){var e=(new Date).getTime(),f=this._cvLastRedrawTime,g=this.get("minimumRedrawDelay");if(f===null||e-f>=g)this.redraw();else{e=this._cvRedrawTimer;if(!(e!==null&&e.get("isValid")))this._cvRedrawTimer=c.Timer.schedule({target:this,action:this.redraw,interval:g,repeats:false})}}})});
+tiki.module("text_editor:views/editor",function(a,b){var c=a("sproutcore/runtime").SC,d=a("views/gutter").GutterView,e=a("controllers/layoutmanager").LayoutManager,f=a("views/scroll").ScrollView,g=a("syntax_manager:controllers/syntaxmanager").SyntaxManager,h=a("views/text").TextView,j=a("controllers/undo").EditorUndoController,k=a("controllers/search").EditorSearchController,l=a("settings").settings,m=a("bespin:util/scratchcanvas");b.EditorView=c.View.extend(c.Border,{_fontChanged:function(){for(var n=
+l.get("fontsize"),o=m.get(),q=this.layoutManager,t="",r=0;r<100;r++)t+="M";o=o.measureStringWidth(this.font,t)/100;q.set("characterWidth",o);q.set("lineHeight",Math.floor(n*1.6));q.set("lineAscent",Math.floor(n*1.3));this.layoutManager._recomputeEntireLayout();this.gutterView._recomputeLayout();this.textView.setNeedsDisplay()}.observes("font"),_fontSizeChanged:function(){var n=l.get("fontsize"),o=l.get("fontface");this.set("font",n+"px "+o)}.observes("settings:index#settings.fontsize","settings:index#settings.fontface"),
+borderStyle:c.BORDER_GRAY,font:"10pt Monaco, Lucida Console, monospace",gutterView:d,layoutManager:e,scrollView:f,searchController:k,syntaxManager:g,textView:h,undoController:j,_gutterViewFrameChanged:function(){this.get("scrollView").adjust({left:this.getPath("gutterView.frame").width})},_scrollViewVerticalScrollOffsetChanged:function(){this.setPath("gutterView.verticalScrollOffset",this.getPath("scrollView.verticalScrollOffset"))},createChildViews:function(){var n=this.get("layoutManager"),o=this.get("scrollView"),
+q=this.createChildView(this.get("gutterView"),{editor:this,layoutManager:n});this.set("gutterView",q);q.addObserver("frame",this,this._gutterViewFrameChanged);var t=this.get("textView");n=this.createChildView(o,{containerView:c.ContainerView.extend({hasCustomScrolling:true}),contentView:t.extend({editor:this,layoutManager:n,searchController:this.get("searchController")}),layout:{left:q.get("frame").width,bottom:0,top:0,right:0}});this.set("scrollView",n);n.addObserver("verticalScrollOffset",this,
+this._scrollViewVerticalScrollOffsetChanged);o=n.get("contentView");this.set("textView",o);this.set("undoController",this.get("undoController").create({textView:o}));this.get("searchController").set("textView",o);this.set("childViews",[q,n])},init:function(){this.set("layoutManager",this.get("layoutManager").create());this.set("searchController",this.get("searchController").create());return arguments.callee.base.apply(this,arguments)}})});
+tiki.module("text_editor:views/gutter",function(a,b){var c=a("sproutcore/runtime").SC,d=a("views/canvas").CanvasView;a("bespin:util/scratchcanvas");var e=d.extend({theme:{gutterStyle:"#4c4a41",lineNumberColor:"#e5c138",lineNumberFont:"10pt Monaco, Lucida Console, monospace",editorTextFont:"10pt Monaco, Lucida Console, monospace"},_frameChanged:function(){this.setNeedsDisplay()}.observes("frame"),drawRect:function(f,g){var h=this.get("theme");g.fillStyle=h.gutterStyle;g.fillRect(f.x,f.y,f.width,f.height);
+g.save();var j=this.get("parentView"),k=j.get("padding");g.translate(k.left,0);k=j.get("layoutManager");var l=k.characterRangeForBoundingRect(f);f=Math.min(l.end.row,k.get("textLines").length-1);var m=k.get("lineAscent");g.fillStyle=h.lineNumberColor;g.font=j.get("editor").font;for(h=l.start.row;h<=f;h++)g.fillText(""+(h+1),-0.5,k.lineRectForRow(h).y+m-0.5);g.restore()}});b.GutterView=c.View.extend({_interiorView:null,_computeWidth:function(){var f=this.get("padding");f=f.left+f.right;this.get("theme");
+var g=this.get("layoutManager"),h=""+g.get("textLines").length;return g.get("characterWidth")*h.length+f},_frameChanged:function(){this._recomputeLayout()}.observes("frame"),_recomputeLayout:function(){var f=this.get("layoutManager"),g=this.get("padding"),h=this._computeWidth(),j=c.clone(this.get("layout"));if(j.width!==h){j.width=h;this.set("layout",j)}else{j=this.get("frame");this._interiorView.set("layout",{left:0,top:-this.get("verticalScrollOffset"),width:h,height:Math.max(j.height,f.boundingRect().height+
+g.bottom)})}},_verticalScrollOffsetChanged:function(){this._recomputeLayout()}.observes("verticalScrollOffset"),layout:{left:0,top:0,bottom:0,width:32},layoutManager:null,padding:{bottom:30,left:5,right:10},theme:{lineNumberFont:"10pt Monaco, Lucida Console, monospace"},verticalScrollOffset:0,createChildViews:function(){var f=this.createChildView(e);this._interiorView=f;this.get("frame");this._recomputeLayout();this.set("childViews",[f])},init:function(){arguments.callee.base.apply(this,arguments);
+this.get("layoutManager").addDelegate(this)},layoutManagerInvalidatedRects:function(){this._recomputeLayout()}})});
+tiki.module("text_editor:views/scroll",function(a,b){var c=a("sproutcore/runtime").SC;a=a("views/scroller").BespinScrollerView;b.ScrollView=c.ScrollView.extend({_containerViewLaidOut:false,autohidesHorizontalScroller:false,autohidesVerticalScroller:false,borderStyle:c.BORDER_NONE,hasHorizontalScroller:true,hasVerticalScroller:true,horizontalScrollerThickness:24,horizontalScrollerView:a,verticalScrollerThickness:24,verticalScrollerView:a,tile:function(){if(!this._containerViewLaidOut){var d=this.get("containerView");
+d.adjust({left:0,bottom:0,top:0,right:0});d.updateLayout();this._containerViewLaidOut=true}var e=this.get("horizontalScrollerView"),f=this.get("verticalScrollerView");e=this.get("isHorizontalScrollerVisible");f=this.get("isVerticalScrollerVisible");d=this.get("horizontalScrollerThickness");var g=this.get("verticalScrollerThickness");if(e){e=this.get("horizontalScrollerView");e.set("scrollerThickness",d);e.set("padding",{top:0,bottom:6,left:6,right:6+g});e.set("layout",{left:0,bottom:0,right:0,height:d})}if(f){f=
+this.get("verticalScrollerView");f.set("scrollerThickness",g);f.set("padding",{left:0,right:6,top:6,bottom:6+d});f.set("layout",{top:0,right:0,bottom:0,width:g})}this.get("contentView").get("hasPadding")===true&&this.get("contentView").set("padding",{bottom:d+6,right:g+6})}})});
+tiki.module("text_editor:views/scroller",function(a,b){var c=a("sproutcore/runtime").SC,d=a("views/canvas").CanvasView,e=a("bespin:console").console,f=d.extend({classNames:["bespin-scroller-view"],lineHeight:20,_mouseDownScreenPoint:null,_mouseDownValue:null,_isMouseOver:false,_scrollTimer:null,_mouseEventPosition:null,_mouseOverHandle:false,theme:{backgroundStyle:"#2A211C",partialNibStyle:"rgba(100, 100, 100, 0.3)",partialNibArrowStyle:"rgba(255, 255, 255, 0.3)",partialNibStrokeStyle:"rgba(150, 150, 150, 0.3)",
+fullNibStyle:"rgb(100, 100, 100)",fullNibArrowStyle:"rgb(255, 255, 255)",fullNibStrokeStyle:"rgb(150, 150, 150)",scrollTrackFillStyle:"rgba(50, 50, 50, 0.8)",scrollTrackStrokeStyle:"rgb(150, 150, 150)",scrollBarFillStyle:"rgba(0, 0, 0, %a)",scrollBarFillGradientTopStart:"rgba(90, 90, 90, %a)",scrollBarFillGradientTopStop:"rgba(40, 40, 40, %a)",scrollBarFillGradientBottomStart:"rgba(22, 22, 22, %a)",scrollBarFillGradientBottomStop:"rgba(44, 44, 44, %a)"},_drawNib:function(g){var h=this.get("theme"),
+j,k;if(this._isHighlighted()){j=h.fullNibStyle;k=h.fullNibArrowStyle;h=h.fullNibStrokeStyle}else{j=h.partialNibStyle;k=h.partialNibArrowStyle;h=h.partialNibStrokeStyle}var l=Math.floor(7.5);g.fillStyle=j;g.beginPath();g.arc(0,0,Math.floor(7.5),0,Math.PI*2,true);g.closePath();g.fill();g.strokeStyle=h;g.stroke();g.fillStyle=k;g.beginPath();g.moveTo(0,-l+3);g.lineTo(-l+3,l-5);g.lineTo(l-3,l-5);g.closePath();g.fill()},_drawNibs:function(g){var h=this._getClientThickness(),j=this.get("parentView"),k=j.get("value");
+j=j.get("maximum");var l=this._isHighlighted();if(l||k!==0){g.save();g.translate(8,h/2);g.rotate(Math.PI*1.5);g.moveTo(0,0);this._drawNib(g);g.restore()}if(l||k!==j){g.save();g.translate(this._getClientLength()-8,h/2);g.rotate(Math.PI*0.5);g.moveTo(0,0);this._drawNib(g);g.restore()}},_getClientFrame:function(){var g=this.get("frame"),h=this.getPath("parentView.padding");return{x:h.left,y:h.top,width:g.width-(h.left+h.right),height:g.height-(h.top+h.bottom)}},_getClientLength:function(){var g=this._getClientFrame();
+switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_HORIZONTAL:return g.width;case c.LAYOUT_VERTICAL:return g.height;default:e.error("unknown layout direction");return null}},_getClientThickness:function(){var g=this.get("parentView"),h=g.get("padding"),j=g.get("scrollerThickness");switch(g.get("layoutDirection")){case c.LAYOUT_VERTICAL:return j-(h.left+h.right);case c.LAYOUT_HORIZONTAL:return j-(h.top+h.bottom);default:e.error("unknown layout direction");return null}}.property(),_getFrameLength:function(){var g=
+this.get("frame");switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_HORIZONTAL:return g.width;case c.LAYOUT_VERTICAL:return g.height;default:e.error("unknown layout direction");return null}},_getGutterFrame:function(){var g=this._getClientFrame(),h=this._getClientThickness();switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_VERTICAL:return{x:g.x,y:g.y+15,width:h,height:Math.max(0,g.height-30)};case c.LAYOUT_HORIZONTAL:return{x:g.x+15,y:g.y,width:Math.max(0,g.width-30),
+height:h};default:e.error("unknown layout direction");return null}},_getGutterLength:function(){var g=this._getGutterFrame(),h;switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_HORIZONTAL:h=g.width;break;case c.LAYOUT_VERTICAL:h=g.height;break;default:e.error("unknown layout direction");break}return h},_getHandleFrame:function(){var g=this._getGutterFrame(),h=this._getHandleOffset(),j=this._getHandleLength();switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_VERTICAL:return{x:g.x,
+y:g.y+h,width:g.width,height:j};case c.LAYOUT_HORIZONTAL:return{x:g.x+h,y:g.y,width:j,height:g.height}}},_getHandleLength:function(){var g=this._getGutterLength(),h=this.getPath("parentView.proportion");return Math.max(g*h,20)},_getHandleOffset:function(){var g=this.get("parentView"),h=g.get("maximum");if(h===0)return 0;var j=this._getGutterLength(),k=this._getHandleLength();j=j-k;g=g.get("value");return j*g/h},_isHighlighted:function(){return this._isMouseOver===true||this._mouseDownScreenPoint!==
+null},_segmentForMouseEvent:function(g){g=this.convertFrameFromView({x:g.pageX,y:g.pageY});var h=this._getClientFrame(),j=this.getPath("parentView.padding");if(!c.pointInRect(g,h))return null;var k=this.getPath("parentView.layoutDirection");switch(k){case c.LAYOUT_HORIZONTAL:if(g.x-j.left<15)return"nib-start";else if(g.x>=h.width-15)return"nib-end";break;case c.LAYOUT_VERTICAL:if(g.y-j.top<15)return"nib-start";else if(g.y>=h.height-15)return"nib-end";break;default:e.error("unknown layout direction");
+break}j=this._getHandleFrame();if(c.pointInRect(g,j))return"handle";switch(k){case c.LAYOUT_HORIZONTAL:if(g.x<j.x)return"gutter-before";else if(g.x>=j.x+j.width)return"gutter-after";break;case c.LAYOUT_VERTICAL:if(g.y<j.y)return"gutter-before";else if(g.y>=j.y+j.height)return"gutter-after";break;default:e.error("unknown layout direction");break}e.error("_segmentForMouseEvent: point ",g," outside view with handle frame ",j," and client frame ",h);return null},adjustFrame:function(){var g=this.getPath("parentView.frame");
+this.set("layout",{left:0,top:0,width:g.width,height:g.height})},drawRect:function(g,h){g=h.globalAlpha?h.globalAlpha:1;var j=this.get("theme"),k=this._isHighlighted(),l=this.get("frame");h.clearRect(0,0,l.width,l.height);h.save();l=this.get("parentView");var m=l.get("padding");h.translate(m.left,m.top);this._getHandleFrame();m=this._getGutterLength();var n=this._getClientThickness(),o=n/2;l=l.get("layoutDirection");var q=this._getHandleOffset()+15,t=this._getHandleLength();if(l===c.LAYOUT_VERTICAL){h.translate(n+
+1,0);h.rotate(Math.PI*0.5)}if(!(m<=t)){if(k){l=this._getClientLength();h.fillStyle=j.scrollTrackFillStyle;h.fillRect(8.5,0.5,l-16,n-1);h.strokeStyle=j.scrollTrackStrokeStyle;h.strokeRect(8.5,0.5,l-16,n-1)}else h.globalAlpha=0.3;l=function(){h.beginPath();h.arc(q+o+0.5,o,o-0.5,Math.PI/2,3*Math.PI/2,false);h.arc(q+t-o-0.5,o,o-0.5,3*Math.PI/2,Math.PI/2,false);h.lineTo(q+o+0.5,n-0.5);h.closePath()};l();m=h.createLinearGradient(q,0,q,n);m.addColorStop(0,j.scrollBarFillGradientTopStart.replace(/%a/,g));
+m.addColorStop(0.4,j.scrollBarFillGradientTopStop.replace(/%a/,g));m.addColorStop(0.41,j.scrollBarFillStyle.replace(/%a/,g));m.addColorStop(0.8,j.scrollBarFillGradientBottomStart.replace(/%a/,g));m.addColorStop(1,j.scrollBarFillGradientBottomStop.replace(/%a/,g));h.fillStyle=m;h.fill();h.save();h.clip();h.fillStyle=j.scrollBarFillStyle.replace(/%a/,g);h.beginPath();h.moveTo(q+o*0.4,o*0.6);h.lineTo(q+o*0.9,n*0.4);h.lineTo(q,n*0.4);h.closePath();h.fill();h.beginPath();h.moveTo(q+t-o*0.4,0+o*0.6);h.lineTo(q+
+t-o*0.9,0+n*0.4);h.lineTo(q+t,0+n*0.4);h.closePath();h.fill();h.restore();h.save();l();h.strokeStyle=j.scrollTrackStrokeStyle;h.stroke();h.restore();if(!k)h.globalAlpha=1;this._drawNibs(h);h.restore()}},_repeatAction:function(g,h){if(g()!==false)this._scrollTimer=c.Timer.schedule({target:this,action:function(){this._repeatAction(g,100)},interval:h})},_scrollByDelta:function(g){var h=this.get("parentView"),j=h.get("value");h.set("value",j+g)},_scrollUpOneLine:function(){this._scrollByDelta(-this.get("lineHeight"));
+return true},_scrollDownOneLine:function(){this._scrollByDelta(this.get("lineHeight"));return true},_scrollPage:function(){switch(this._segmentForMouseEvent(this._mouseEventPosition)){case "gutter-before":this._scrollByDelta(this._getGutterLength()*-1);break;case "gutter-after":this._scrollByDelta(this._getGutterLength());break;case null:break;default:return false}return true},mouseDown:function(g){this._mouseEventPosition=g;this._mouseOverHandle=false;var h=this.get("parentView");h.get("value");
+this._getGutterLength();switch(this._segmentForMouseEvent(g)){case "nib-start":this._repeatAction(this._scrollUpOneLine.bind(this),500);break;case "nib-end":this._repeatAction(this._scrollDownOneLine.bind(this),500);break;case "gutter-before":this._repeatAction(this._scrollPage.bind(this),500);break;case "gutter-after":this._repeatAction(this._scrollPage.bind(this),500);break;case "handle":break;default:e.error("_segmentForMouseEvent returned an unknown value");break}switch(h.get("layoutDirection")){case c.LAYOUT_HORIZONTAL:this._mouseDownScreenPoint=
+g.pageX;break;case c.LAYOUT_VERTICAL:this._mouseDownScreenPoint=g.pageY;break;default:e.error("unknown layout direction");break}},mouseDragged:function(g){var h=this.get("parentView");if(this._segmentForMouseEvent(g)=="handle"||this._mouseOverHandle===true){this._mouseOverHandle=true;if(this._scrollTimer!==null){this._scrollTimer.invalidate();this._scrollTimer=null}var j;switch(h.get("layoutDirection")){case c.LAYOUT_HORIZONTAL:j=g.pageX;break;case c.LAYOUT_VERTICAL:j=g.pageY;break;default:e.error("unknown layout direction");
+break}var k=j-this._mouseDownScreenPoint,l=h.get("maximum"),m=h.get("value"),n=this._getGutterLength(),o=this._getHandleLength();h.set("value",m+l*k/(n-o));this._mouseDownScreenPoint=j}this._mouseEventPosition=g},mouseEntered:function(){this._isMouseOver=true;this.setNeedsDisplay()},mouseExited:function(){this._isMouseOver=false;this.setNeedsDisplay()},mouseUp:function(){this._mouseDownValue=this._mouseDownScreenPoint=null;if(this._scrollTimer){this._scrollTimer.invalidate();this._scrollTimer=null}this.setNeedsDisplay()},
+mouseWheel:function(g){var h=this.get("parentView");switch(h.get("layoutDirection")){case c.LAYOUT_HORIZONTAL:g=g.wheelDeltaX;break;case c.LAYOUT_VERTICAL:g=g.wheelDeltaY;break;default:e.error("unknown layout direction");return}h.set("value",h.get("value")+2*g)}});b.BespinScrollerView=c.View.extend({_scrollerCanvasView:null,_frameChanged:function(){this._scrollerCanvasView.adjustFrame()}.observes("frame"),_maximumChanged:function(){this._scrollerCanvasView.adjustFrame()}.observes("maximum"),_valueChanged:function(){var g=
+this._scrollerCanvasView,h=this.get("maximum"),j=this.get("value");if(j<0)this.set("value",0);else j>h&&this.set("value",h);g.setNeedsDisplay()}.observes("value"),layoutDirection:c.LAYOUT_VERTICAL,maximum:0,padding:{left:0,bottom:0,top:0,right:0},scrollerThickness:c.NATURAL_SCROLLER_THICKNESS,value:0,createChildViews:function(){var g=this.createChildView(f);g.adjustFrame();this._scrollerCanvasView=g;this.set("childViews",[g])}})});
+tiki.module("text_editor:views/text",function(a,b){var c=a("sproutcore/runtime").SC,d=a("views/canvas").CanvasView;a("controllers/layoutmanager");var e=a("delegate_support").MultiDelegateSupport,f=a("rangeutils:utils/range"),g=a("utils/rect"),h=a("mixins/textinput").TextInput,j=a("canon:keyboard").keyboardManager,k=a("settings").settings;b.TextView=d.extend(e,h,{_dragPoint:null,_dragTimer:null,_inChangeGroup:false,_insertionPointBlinkTimer:null,_insertionPointVisible:true,_keyBuffer:"",_keyMetaBuffer:"",
+_keyState:"start",_lineAscent:16,_selectedRange:null,_selectedRangeEndVirtual:null,_drag:function(){var l=this.convertFrameFromView(this._dragPoint),m=g.offsetFromRect(this.get("clippingFrame"),l);this.moveCursorTo(this._selectionPositionForPoint({x:l.x-m.x,y:l.y-m.y}),true);this.becomeFirstResponder()},_drawInsertionPoint:function(l,m){if(this._insertionPointVisible){l=this._selectedRange;var n=this.get("layoutManager").characterRectForPosition(l.start);l=Math.floor(n.x);var o=n.y,q=Math.ceil(n.width);
+n=n.height;m.save();var t=this.get("theme");if(this.get("isFirstResponder")){m.strokeStyle=t.cursorStyle;m.beginPath();m.moveTo(l+0.5,o);m.lineTo(l+0.5,o+n);m.closePath();m.stroke()}else{m.fillStyle=t.unfocusedCursorFillStyle;m.fillRect(l+0.5,o,q,n);m.strokeStyle=t.unfocusedCursorStrokeStyle;m.strokeRect(l+0.5,o+0.5,q-1,n-1)}m.restore()}},_drawLines:function(l,m){var n=this.get("layoutManager"),o=n.get("textLines"),q=n.get("lineAscent");this.get("theme");m.save();m.font=this.getPath("editor.font");
+var t=n.characterRangeForBoundingRect(l);l=t.start;t=t.end;for(var r=t.row,s=l.row;s<=r;s++){var v=o[s];if(!c.none(v)){var w=v.characters,y=w.length,x=Math.min(t.column,y),D=l.column;if(!(D>=y)){v=v.colors;for(y=0;D<v[y].start;)y++;for(var E=v[y].start;E!==null&&E<x;){var z=v[y];D=z.end;m.fillStyle=z.color;z=n.characterRectForPosition({row:s,column:E});E=D===null?w.substring(E):w.substring(E,D);m.fillText(E,z.x,z.y+q);E=D;y++}}}}m.restore()},_drawSelectionHighlight:function(l,m){l=this.get("theme");
+l=this.get("isFirstResponder")?l.editorSelectedTextBackground:l.unfocusedCursorFillStyle;var n=this.get("layoutManager");m.save();var o=f.normalizeRange(this._selectedRange);m.fillStyle=l;n.rectsForRange(o).forEach(function(q){m.fillRect(q.x,q.y,q.width,q.height)});m.restore()},_drawSelection:function(l,m){this._rangeIsInsertionPoint(this._selectedRange)?this._drawInsertionPoint(l,m):this._drawSelectionHighlight(l,m)},_getVirtualSelection:function(l){return{start:l&&this._selectedRangeEndVirtual?
+this._selectedRangeEndVirtual:this._selectedRange.start,end:this._selectedRangeEndVirtual||this._selectedRange.end}},_invalidateSelection:function(){var l=function(o){return{x:o.x-1,y:o.y,width:o.width+2,height:o.height}},m=this.get("layoutManager"),n=f.normalizeRange(this._selectedRange);if(this._rangeIsInsertionPoint(n)){m=m.characterRectForPosition(n.start);this.setNeedsDisplayInRect(l(m))}else m.rectsForRange(n).forEach(function(o){this.setNeedsDisplayInRect(l(o))},this)},_keymappingChanged:function(){this._keyBuffer=
+"";this._keyState="start"},_performVerticalKeyboardSelection:function(l){this.getPath("layoutManager.textStorage");this.moveCursorTo(f.addPositions(this._selectedRangeEndVirtual!==null?this._selectedRangeEndVirtual:this._selectedRange.end,{row:l,column:0}),true,true)},_rangeIsInsertionPoint:function(l){return f.isZeroLength(l)},_rearmInsertionPointBlinkTimer:function(){this._insertionPointVisible||this.blinkInsertionPoint();this._insertionPointBlinkTimer!==null&&this._insertionPointBlinkTimer.invalidate();
+this._insertionPointBlinkTimer=c.Timer.schedule({target:this,action:"blinkInsertionPoint",interval:750,repeats:true})},_repositionSelection:function(){var l=this.getPath("layoutManager.textLines"),m=l.length,n=this._selectedRange,o=Math.min(n.start.row,m-1);m=Math.min(n.end.row,m-1);var q=l[m];this.setSelection({start:{row:o,column:Math.min(n.start.column,l[o].characters.length)},end:{row:m,column:Math.min(n.end.column,q.characters.length)}})},_resize:function(){var l=this.get("layoutManager").boundingRect(),
+m=this.get("padding"),n=this.getPath("parentView.frame");this.set("layout",c.mixin(c.clone(this.get("layout")),{width:Math.max(n.width,l.width+m.right),height:Math.max(n.height,l.height+m.bottom)}))},_scrollPage:function(l){var m=this._scrollView(),n=this.get("clippingFrame");m.scrollTo(n.x,n.y+(n.height+this._lineAscent)*(l?-1:1))},_scrollView:function(){for(var l=this.get("parentView");!c.none(l)&&!l.get("isScrollable");)l=l.get("parentView");return l},_scrollWhileDragging:function(){var l=this._scrollView();
+if(!c.none(l)){var m=g.offsetFromRect(this.get("clippingFrame"),this.convertFrameFromView(this._dragPoint));if(!(m.x===0&&m.y===0)){l.scrollBy(m.x,m.y);this._drag()}}},_selectionPositionForPoint:function(l){l=this.get("layoutManager").characterAtPoint(l);return l.partialFraction<0.5?l:f.addPositions(l,{row:0,column:1})},_syntaxManagerUpdatedSyntaxForRows:function(l,m){if(l!==m){var n=this.get("layoutManager");n.updateTextRows(l,m);n.rectsForRange({start:{row:l,column:0},end:{row:m,column:0}}).forEach(this.setNeedsDisplayInRect,
+this)}},_updateSyntax:function(l){var m=this.get("layoutManager"),n=m.characterRangeForBoundingRect(this.get("clippingFrame")),o=n.start.row;n=n.end.row;if(l!==null){if(l<o||l>n)return;o=l}var q=this;l=m.getPath("textStorage.lines");m=m.get("syntaxManager");n=Math.min(l.length,n+1);m.updateSyntaxForRows(o,n).then(function(t){q._syntaxManagerUpdatedSyntaxForRows(t.startRow,t.endRow)})},acceptsFirstResponder:true,hasPadding:true,layoutManager:null,padding:{bottom:0,right:0},theme:{backgroundStyle:"#2a211c",
+cursorStyle:"#879aff",editorSelectedTextColor:"rgb(240, 240, 240)",editorSelectedTextBackground:"#526da5",unfocusedCursorStrokeStyle:"#ff0033",unfocusedCursorFillStyle:"#73171e"},blinkInsertionPoint:function(){this._insertionPointVisible=!this._insertionPointVisible;this._invalidateSelection()},clippingFrameChanged:function(){arguments.callee.base.apply(this,arguments);this._updateSyntax(null)},copy:function(){return this.getSelectedCharacters()},cut:function(){var l=this.getSelectedCharacters();
+l!=""&&this.performBackspaceOrDelete(false);return l},drawRect:function(l,m){m.fillStyle=this.get("theme").backgroundStyle;m.fillRect(l.x,l.y,l.width,l.height);this._drawSelection(l,m);this._drawLines(l,m)},focus:function(){this.focusTextInput()},getSelectedCharacters:function(){return this._rangeIsInsertionPoint(this._selectedRange)?"":this.getPath("layoutManager.textStorage").getCharacters(f.normalizeRange(this._selectedRange))},getSelectedRange:function(l){return l?this._selectedRange:f.normalizeRange(this._selectedRange)},
+groupChanges:function(l){if(this._inChangeGroup)l();else{this._inChangeGroup=true;this.notifyDelegates("textViewBeganChangeGroup",this._selectedRange);try{l()}finally{this._inChangeGroup=false;this.notifyDelegates("textViewEndedChangeGroup",this._selectedRange)}}},init:function(){arguments.callee.base.apply(this,arguments);this._invalidRange=null;this._selectedRange={start:{row:0,column:0},end:{row:0,column:0}};this.set("padding",c.clone(this.get("padding")));this.get("layoutManager").addDelegate(this);
+this._resize()},insertText:function(l){this.groupChanges(function(){this.getPath("layoutManager.textStorage");var m=f.normalizeRange(this._selectedRange);this.replaceCharacters(m,l);var n=l.split("\n");this.moveCursorTo(n.length>1?{row:m.start.row+n.length-1,column:n[n.length-1].length}:f.addPositions(m.start,{row:0,column:l.length}))}.bind(this))},isDelimiter:function(l){return"\"',;.!~@#$%^&*?[]<>:/\\-+ \t".indexOf(l)!==-1},keyDown:function(l){if(l.charCode===0)return j.processKeyEvent(l,this,{isTextView:true});
+else if(l.keyCode===9)l.preventDefault();else return false},layoutManagerChangedTextAtRow:function(l,m){this._updateSyntax(m);this._repositionSelection()},layoutManagerInvalidatedRects:function(l,m){m.forEach(this.setNeedsDisplayInRect,this);this._resize()},mouseDown:function(l){arguments.callee.base.apply(this,arguments);var m={x:l.pageX,y:l.pageY};switch(l.clickCount){case 1:var n=this._selectionPositionForPoint(this.convertFrameFromView(m));this.moveCursorTo(n,l.shiftKey);break;case 2:n=this._selectionPositionForPoint(this.convertFrameFromView(m));
+var o=this.getPath("layoutManager.textStorage").lines[n.row];if(o.length===0)return true;n.column-=n.column==o.length?1:0;var q=!this.isDelimiter(o[n.column]),t=this,r=function(v,w){for(;v>-1&&v<o.length;v+=w)if(t.isDelimiter(o[v])===q)break;return v+(w==1?0:1)},s=r(n.column,-1);r=r(n.column,1);this.moveCursorTo({row:n.row,column:s});this.moveCursorTo({row:n.row,column:r},true);break;case 3:s=this.getPath("layoutManager.textStorage").lines;n=this._selectionPositionForPoint(this.convertFrameFromView(m));
+this.setSelection({start:{row:n.row,column:0},end:{row:n.row,column:s[n.row].length}});break}this._dragPoint=m;this._dragTimer=c.Timer.schedule({target:this,action:"_scrollWhileDragging",interval:100,repeats:true});return true},mouseDragged:function(l){this._dragPoint={x:l.pageX,y:l.pageY};this._drag();return true},mouseUp:function(){this._dragTimer!==null&&this._dragTimer.invalidate()},moveCursorTo:function(l,m,n){var o=this.getPath("layoutManager.textStorage"),q=o.clampPosition(l);this.setSelection({start:m?
+this._selectedRange.start:q,end:q});if(n){m=o.get("lines").length;n=l.row;o=l.column;this._selectedRangeEndVirtual=n>0&&n<m?l:{row:n<1?0:m-1,column:o}}else this._selectedRangeEndVirtual=null;this.scrollToPosition(this._selectedRange.end)},moveDown:function(){var l=this._getVirtualSelection();l=f.normalizeRange(l);l=this._rangeIsInsertionPoint(this._selectedRange)?l.end:{row:l.end.row,column:l.start.column};l=f.addPositions(l,{row:1,column:0});this.moveCursorTo(l,false,true)},moveLeft:function(){var l=
+f.normalizeRange(this._selectedRange);this._rangeIsInsertionPoint(l)?this.moveCursorTo(this.getPath("layoutManager.textStorage").displacePosition(l.start,-1)):this.moveCursorTo(l.start)},moveRight:function(){var l=f.normalizeRange(this._selectedRange);this._rangeIsInsertionPoint(l)?this.moveCursorTo(this.getPath("layoutManager.textStorage").displacePosition(l.end,1)):this.moveCursorTo(l.end)},moveUp:function(){var l=f.normalizeRange(this._getVirtualSelection(true));position=f.addPositions({row:l.start.row,
+column:this._getVirtualSelection().end.column},{row:-1,column:0});this.moveCursorTo(position,false,true)},parentViewFrameChanged:function(){arguments.callee.base.apply(this,arguments);this._resize()},replaceCharacters:function(l,m){this.groupChanges(function(){l=f.normalizeRange(l);this.notifyDelegates("textViewWillReplaceRange",l);this.getPath("layoutManager.textStorage").replaceCharacters(l,m);this.notifyDelegates("textViewReplacedCharacters",l,m)}.bind(this))},performBackspaceOrDelete:function(l){var m=
+this.getPath("layoutManager.textStorage"),n=m.get("lines"),o=this.getSelectedRange();if(f.isZeroLength(o))if(l){var q=o.start;l=k.get("tabstop");var t=q.row;q=q.column;n=n[t];o=q>0&&q%l===0&&(new RegExp("^\\s{"+q+"}")).test(n)?{start:{row:t,column:q-l},end:o.end}:{start:m.displacePosition(o.start,-1),end:o.end}}else o={start:o.start,end:m.displacePosition(o.end,1)};this.groupChanges(function(){this.replaceCharacters(o,"");this.moveCursorTo(o.start)}.bind(this))},resetKeyBuffers:function(){this._keyMetaBuffer=
+this._keyBuffer=""},scrollPageDown:function(){this._scrollPage(false)},scrollPageUp:function(){this._scrollPage(true)},scrollToPosition:function(l){var m=this._scrollView();if(!c.none(m)){var n=this.get("layoutManager").characterRectForPosition(l);l=n.x;var o=n.y,q=n.width;n=n.height;var t=this.get("clippingFrame"),r=t.x,s=t.y,v=this.get("padding"),w=t.width-v.right;t=t.height-v.bottom;m.scrollTo(l>=r&&l+q<r+w?r:l-w/2+q/2,o>=s&&o+n<s+t?s:o-t/2+n/2)}},selectAll:function(){var l=this.getPath("layoutManager.textStorage.lines"),
+m=l.length-1;this.setSelection({start:{row:0,column:0},end:{row:m,column:l[m].length}})},selectDown:function(){this._performVerticalKeyboardSelection(1)},selectLeft:function(){this.moveCursorTo(this.getPath("layoutManager.textStorage").displacePosition(this._selectedRange.end,-1),true)},selectRight:function(){this.moveCursorTo(this.getPath("layoutManager.textStorage").displacePosition(this._selectedRange.end,1),true)},selectUp:function(){this._performVerticalKeyboardSelection(-1)},setSelection:function(l,
+m){var n=this.getPath("layoutManager.textStorage");l=n.clampRange(l);if(!f.equal(l,this._selectedRange)){this._invalidateSelection();this._selectedRange=n.clampRange(l);this._invalidateSelection();this._rearmInsertionPointBlinkTimer();m&&this.scrollToPosition(this._selectedRange.end)}},textInserted:function(l){if(!j.processKeyInput(l,this,{isTextView:true,isCommandKey:false})){this.insertText(l);this.resetKeyBuffers()}},willBecomeKeyResponderFrom:function(){arguments.callee.base.apply(this,arguments);
+this._invalidateSelection();this._rearmInsertionPointBlinkTimer()},willLoseKeyResponderTo:function(){arguments.callee.base.apply(this,arguments);this._invalidateSelection();this._insertionPointBlinkTimer.invalidate();this._insertionPointVisible=true}})});tiki.module("text_editor:index",function(){});tiki.register("dock_view",{});
+tiki.module("dock_view:index",function(a,b){var c=a("sproutcore/runtime").SC;b.DOCK_LEFT="left";b.DOCK_BOTTOM="bottom";b.DOCK_TOP="top";b.DOCK_RIGHT="right";b.DockView=c.View.extend({classNames:["bespin-dock-view"],centerView:c.View,dockedViews:[],addDockedView:function(d,e){var f=this.get("dockedViews"),g=f.length;if(c.none(e))e=b.DOCK_BOTTOM;var h=this;d=this.createChildView(d,{dock:e,layoutView:this,rootElementPath:[g],_bespin_dockView_frameDidChange:function(){h._updateChildLayout()}.observes("frame")});
+return f[g]=d},removeDockedView:function(d){this.get("dockedViews").removeObject(d);this.removeChild(d);this._updateChildLayout()},createChildViews:function(){var d=this.createChildView(this.get("centerView"),{layoutView:this});this.set("centerView",d);d=[d];for(var e=this.get("dockedViews"),f=0;f<e.length;f++)d.push(this.addDockedView(e[f],f));this.set("childViews",d);return this},_updateChildLayout:function(){var d=0,e=0,f=0,g=0;this.get("dockedViews").forEach(function(j){var k=j.get("frame"),l=
+j.get("dock");switch(l){case b.DOCK_LEFT:d+=k.width;j.adjust("top",f);j.adjust("bottom",e);break;case b.DOCK_BOTTOM:e+=k.height;j.adjust("left",d);j.adjust("right",g);break;case b.DOCK_TOP:f+=k.height;j.adjust("left",d);j.adjust("right",g);break;case b.DOCK_RIGHT:g+=k.width;j.adjust("top",f);j.adjust("bottom",e);break;default:throw new Error("invalid 'dock' property: "+l);}});var h={left:d,bottom:e,top:f,right:g};this.get("centerView").adjust(h)},renderLayout:function(){this._updateChildLayout();
+arguments.callee.base.apply(this,arguments)}})});tiki.register("filesystem",{});
+tiki.module("filesystem:index",function(a,b){var c=a("sproutcore/runtime").SC;a("bespin:console");a("bespin:util/util");var d=a("bespin:promise"),e=a("filesystem:path"),f=d.Promise;b._prefixSearch=function(g,h){for(var j=0,k=g.length-1,l=h.length,m,n=null,o;j<=k;){m=parseInt((j+k)/2,10);o=g[m].substring(0,l);if(m==n)return m;if(o==h){n=m;k=m-1}else if(o<h)j=m+1;else k=m-1}return n};b._binarySearch=function(g,h){for(var j=0,k=g.length-1,l,m;j<=k;){l=parseInt((j+k)/2,10);m=g[l];if(m<h)j=l+1;else if(m>
+h)k=l-1;else return l}return null};b.NEW={name:"NEW"};b.LOADING={name:"LOADING"};b.READY={name:"READY"};b.Filesystem=c.Object.extend({source:null,_files:null,status:b.NEW,_loadingPromises:null,init:function(){var g=this.get("source");typeof g=="string"&&this.set("source",c.objectForPropertyPath(g));if(!this.get("source"))throw new Error("Directory must have a source.");this._loadingPromises=[]},_load:function(){var g=new f;if(this.status===b.READY)g.resolve();else if(this.status===b.LOADING)this._loadingPromises.push(g);
+else{this.set("status",b.LOADING);this._loadingPromises.push(g);this.get("source").loadAll().then(this._fileListReceived.bind(this))}return g},_fileListReceived:function(g){g.sort();this._files=g;this.set("status",b.READY);for(g=this._loadingPromises;g.length>0;)g.pop().resolve()},invalidate:function(){this._files=[];this.set("status",b.NEW)},listAll:function(){return this._load().then(function(){return this._files}.bind(this))},loadContents:function(g){g=e.trimLeadingSlash(g);return this.get("source").loadContents(g)},
+saveContents:function(g,h){var j=new f;g=e.trimLeadingSlash(g);var k=this;this.get("source").saveContents(g,h).then(function(){k.exists(g).then(function(l){if(!l){k._files.push(g);k._files.sort()}j.resolve()})});return j},getFile:function(g){return new b.File(this,g)},exists:function(g){g=e.trimLeadingSlash(g);var h=new f;this._load().then(function(){var j=b._binarySearch(this._files,g);h.resolve(j!==null)}.bind(this));return h},remove:function(g){g=e.trimLeadingSlash(g);var h=new f,j=this;this.get("source").remove(g).then(function(){j._load().then(function(){var k=
+b._binarySearch(j._files,g);if(k===null)h.reject(new Error("Cannot find path "+g+" to remove"));else{j._files.splice(k,1);h.resolve()}},function(k){h.reject(k)})},function(k){h.reject(k)});return h},listDirectory:function(g){g=e.trimLeadingSlash(g);var h=new f;this._load().then(function(){var j=this._files,k=b._prefixSearch(j,g);if(k===null)h.reject(new Error("Path "+g+" not found."));else{var l=[],m=j.length,n=g.length,o=null;for(k=k;k<m;k++){var q=j[k];if(q.substring(0,n)!=g)break;var t=q.indexOf("/",
+n)+1;if(t==0)t=q.length;q=q.substring(n,t);if(q!="")if(q!=o){o=q;l.push(q)}}h.resolve(l)}}.bind(this));return h},makeDirectory:function(g){g=e.trimLeadingSlash(g);e.isDir(g)||(g+="/");var h=this,j=new f;this._load().then(function(){h.get("source").makeDirectory(g).then(function(){h._files.push(g);h._files.sort();j.resolve()})});return j}});b.File=function(g,h){this.fs=g;this.path=h};b.File.prototype={parentdir:function(){return e.parentdir(this.path)},loadContents:function(){return this.fs.loadContents(this.path)},
+saveContents:function(g){return this.fs.saveContents(this.path,g)},exists:function(){return this.fs.exists(this.path)},remove:function(){return this.fs.remove(this.path)},extension:function(){return e.fileType(this.path)}}});
+tiki.module("filesystem:path",function(a,b){var c=a("bespin:util/util");b.combine=function(){var d=Array.prototype.slice.call(arguments).join("/");d=d.replace(/\/\/+/g,"/");return d=d.replace(/^\s+|\s+$/g,"")};b.directory=function(d){d=/^(.*?\/)[^\/]*$/.exec(d);return d===null?"":d[1]};b.makeDirectory=function(d){/\/$/.test(d)||(d+="/");return d};b.combineAsDirectory=function(){return this.makeDirectory(this.combine.apply(this,arguments))};b.escape=function(){return escape(this.combine.apply(this,
+arguments))};b.trimLeadingSlash=function(d){if(d.indexOf("/")==0)d=d.substring(1,d.length);return d};b.hasLeadingSlash=function(d){return d.indexOf("/")==0};b.fileType=function(d){if(d.indexOf(".")>=0){d=d.split(".");if(d.length>1)return d[d.length-1]}return null};b.isDir=function(d){return c.endsWith(d,"/")};b.basename=function(d){var e=d.lastIndexOf("/");if(e==-1)return d;return d.substring(e+1)};b.splitext=function(d){var e=d.lastIndexOf(".");if(e==-1)return[d,""];var f=d.substring(0,e);d=d.substring(e+
+1);return[f,d]};b.parentdir=function(d){if(d==""||d=="/")return"";if(b.isDir(d))d=d.substring(0,d.length-1);slash=d.lastIndexOf("/");return d=d.substring(0,slash+1)}});tiki.module("filesystem:types",function(a,b){b.existingFile={isValid:function(){return true},toString:function(c){return c},fromString:function(c){return c}}});tiki.register("edit_session",{});
+tiki.module("edit_session:history",function(a,b){var c=a("sproutcore/runtime").SC;b.History=c.Object.extend({storage:window.localStorage,addPath:function(d){var e=this.get("storage"),f=e.history;f=c.none(f)?[]:JSON.parse(f);f.push(d);e.history=JSON.stringify(f)},getRecent:function(d){var e=this.get("storage").history;e=c.none(e)?[]:JSON.parse(e);for(var f={},g=[],h=0,j=e.length-1;j>=0;j--){var k=e[j];if(!(k in f)){f[k]=true;g.push(k);h++;if(h===d)break}}return g}})});
+tiki.module("edit_session:index",function(a,b){var c=a("sproutcore/runtime").SC;a("filesystem:index");var d=a("edit_session:history").History,e=a("delegate_support").MultiDelegateSupport,f=a("text_editor:models/textstorage").TextStorage,g=a("bespin:plugins").catalog;a("filesystem:path");b.Buffer=c.Object.extend(e,{_file:null,_fileChanged:function(){this._refreshSyntaxManager();this.notifyDelegates("bufferFileChanged",this._file)}.observes("file"),_refreshSyntaxManager:function(){var h=this.get("syntaxManager");
+if(!c.none(h)){var j=this._file;if(!c.none(j)){j=j.extension();if(j===null)j="";h.setInitialContextFromExt(j)}}},model:null,syntaxManager:null,file:function(h,j){var k=this;if(j!==undefined){this._file=j;if(c.none(j)){h=k.get("model");h.replaceCharacters(h.range(),"")}else j.loadContents().then(function(l){console.log("SET FILE CONTENTS: ",l);c.run(function(){var m=k.get("model");m.replaceCharacters(m.range(),l)})})}return this._file}.property(),init:function(){this.get("model")==null&&this.set("model",
+f.create());this._refreshSyntaxManager()},changeFile:function(h){var j=this;this.changeFileOnly(h);if(c.none(h)){h=j.get("model");h.replaceCharacters(h.range(),"");h=new Promise;h.resolve(this);return h}return h.loadContents().then(function(k){c.run(function(){var l=j.get("model");l.replaceCharacters(l.range(),k)});return j})},changeFileOnly:function(h){this._file=h;this.propertyDidChange("file")},reload:function(){var h=this;return this.get("file").loadContents().then(function(j){var k=h.get("model");
+k.replaceCharacters(k.range(),j)})},save:function(){return this._file.saveContents(this.getPath("model.value"))},saveAs:function(h){var j=new Promise;h.saveContents(this.getPath("model.value")).then(function(){this.changeFileOnly(h);j.resolve()}.bind(this),function(k){j.reject(k)});return j},untitled:function(){return c.none(this._file)}});b.EditSession=c.Object.extend({_currentBufferChanged:function(){this.get("currentBuffer").addDelegate(this)}.observes("currentBuffer"),currentView:null,currentBuffer:null,
+currentUser:null,history:null,bufferFileChanged:function(h,j){c.none(j)||this.get("history").addPath(j.path);g.getExtensions("bufferFileChanged").forEach(function(k){k.load(function(l){l(j)})})},getCompletePath:function(h){if(h==null)h="";if(h==null||h.substring(0,1)!="/"){var j=this.get("currentBuffer"),k;if(j)k=j.get("file");h=k?k.parentdir()+h:"/"+h}return h},loadMostRecentOrNew:function(){var h=this.get("history").getRecent(1);if(h.length!==0){h=g.getObject("files").getFile(h[0]);this.get("currentBuffer").changeFile(h)}},
+init:function(){this.set("history",d.create())}})});tiki.register("embedded",{});
+tiki.module("embedded:index",function(a,b){var c=a("sproutcore/runtime").SC,d=a("dock_view").DockView,e=a("text_editor:views/editor").EditorView,f=a("appsupport:views/keylistener").KeyListener;a("bespin:index");var g=a("edit_session"),h=a("settings").settings;a("bespin:util/util");var j=false;b.EmbeddedEditor=c.Object.extend({_editorView:null,_focused:false,_attachPane:function(){typeof this.get("element")==="string"&&this.set("element",document.getElementById("element"));var k=this.get("element");
+if(c.none("element"))throw new Error("No element was specified to attach Bespin Embedded to");var l=this.get("options");if(c.none(l.initialContent))l.initialContent=k.innerHTML;c.$(k).css("position","relative");k.innerHTML="";this.get("pane").appendTo(k)},_computeLayout:function(){for(var k=this.get("element"),l={top:0,left:0,width:k.clientWidth,height:k.clientHeight};!c.none(k);){l.top+=k.offsetTop+k.clientTop;l.left+=k.offsetLeft+k.clientLeft;k=k.offsetParent}return l},_createValueProperty:function(){this.__defineGetter__("value",
+function(){return this._editorView.getPath("layoutManager.textStorage.value")});this.__defineSetter__("value",function(k){c.run(function(){this._editorView.setPath("layoutManager.textStorage.value",k)}.bind(this))})},_hookWindowResizeEvent:function(){window.addEventListener("resize",this.dimensionsChanged.bind(this),false)},_setOptions:function(){var k=this._editorView.get("layoutManager"),l=this.get("options"),m=l.initialContent;c.none(m)||k.setPath("textStorage.value",m);m=l.noAutoresize;if(c.none(m))m=
+l.dontHookWindowResizeEvent;if(c.none(m)||!m)this._hookWindowResizeEvent();m=l.settings;if(!c.none(m))for(key in m)h.set(key,m[key]);m=l.stealFocus;!c.none(m)&&m&&window.setTimeout(function(){this.setFocus(true)}.bind(this),1);k=k.get("syntaxManager");l=l.syntax;c.none(l)||k.set("initialContext",l)},element:null,options:null,pane:c.Pane.extend({_layoutChanged:function(){this._recomputeLayoutStyle()}.observes("layout"),_recomputeLayoutStyle:function(){var k=this.get("layout");this.set("layoutStyle",
+{width:"%@px".fmt(k.width),height:"%@px".fmt(k.height)})},applicationView:d.extend({centerView:e.extend(),dockedViews:[]}),childViews:"applicationView".w(),layoutStyle:{},init:function(){arguments.callee.base.apply(this,arguments);this.set("defaultResponder",f.create());this._recomputeLayoutStyle()}}),dimensionsChanged:function(){c.run(function(){var k=this.get("pane"),l=k.get("layout"),m=this._computeLayout(this.get("element"));if(!c.rectsEqual(l,m)){k.adjust(m);k.updateLayout()}}.bind(this))},init:function(){if(j===
+true)throw new Error("Attempt to instantiate multiple instances of Bespin");j=true;var k=g.EditSession.create();b.session=k;var l=this.get("pane").create({layout:this._computeLayout()});this.set("pane",l);this._attachPane();var m=l.getPath("applicationView.centerView");this._editorView=m;l=m.getPath("layoutManager.textStorage");m=m.get("textView");b.model=l;b.view=m;l=g.Buffer.create({model:l});k.set("currentBuffer",l);k.set("currentView",m);c.run(function(){this._createValueProperty();this._setOptions()}.bind(this))},
+setFocus:function(k){var l=this.get("pane");if(this._focused!==k)if(this._focused=k){l.becomeKeyPane();this._editorView.get("textView").focus()}else l.resignKeyPane()},setLineNumber:function(k){c.RunLoop.begin();var l=this.getPath("pane.editorView.textView");k={row:k-1,column:0,partialFraction:0};l.setSelection([{start:k,end:k}]);c.RunLoop.end()},setSetting:function(k,l){if(c.none(k))throw new Error("setSetting: key must be supplied");if(c.none(l))throw new Error("setSetting: value must be supplied");
+c.run(function(){h.set(k,l)})},setSyntax:function(k){if(c.none(k))throw new Error("setSyntax: syntax must be supplied");c.run(function(){this._editorView.setPath("layoutManager.syntaxManager.initialContext",k)}.bind(this))}});b.session=null;b.useBespin=function(k,l){return b.EmbeddedEditor.create({element:k,options:c.none(l)?{}:l})}});tiki.register("html",{});
+tiki.module("html:index",function(a,b){a("sproutcore/runtime");a=a("syntax_manager:controllers/standardsyntax").StandardSyntax;var c={},d=function(e,f){c[e+"_beforeAttrName"]=[{regex:/^\s+/,tag:"plain"},{regex:/^\//,tag:"operator",then:e+"_selfClosingStartTag"},{regex:/^>/,tag:"operator",then:f},{regex:/^./,tag:"keyword",then:e+"_attrName"}];c[e+"_attrName"]=[{regex:/^\s+/,tag:"plain",then:e+"_afterAttrName"},{regex:/^\//,tag:"operator",then:e+"_selfClosingStartTag"},{regex:/^=/,tag:"operator",then:e+
+"_beforeAttrValue"},{regex:/^>/,tag:"operator",then:f},{regex:/^["'<]+/,tag:"error"},{regex:/^[^ \t\n\/=>"'<]+/,tag:"keyword"}];c[e+"_afterAttrName"]=[{regex:/^\s+/,tag:"plain"},{regex:/^\//,tag:"operator",then:e+"_selfClosingStartTag"},{regex:/^=/,tag:"operator",then:e+"_beforeAttrValue"},{regex:/^>/,tag:"operator",then:f},{regex:/^./,tag:"keyword",then:e+"_attrName"}];c[e+"_beforeAttrValue"]=[{regex:/^\s+/,tag:"plain"},{regex:/^"/,tag:"string",then:e+"_attrValueQQ"},{regex:/^(?=&)/,tag:"plain",
+then:e+"_attrValueU"},{regex:/^'/,tag:"string",then:e+"_attrValueQ"},{regex:/^>/,tag:"error",then:f},{regex:/^./,tag:"string",then:e+"_attrValueU"}];c[e+"_attrValueQQ"]=[{regex:/^"/,tag:"string",then:e+"_afterAttrValueQ"},{regex:/^[^"]+/,tag:"string"}];c[e+"_attrValueQ"]=[{regex:/^'/,tag:"string",then:e+"_afterAttrValueQ"},{regex:/^[^']+/,tag:"string"}];c[e+"_attrValueU"]=[{regex:/^\s/,tag:"string",then:e+"_beforeAttrName"},{regex:/^>/,tag:"operator",then:f},{regex:/[^ \t\n>]+/,tag:"string"}];c[e+
+"_afterAttrValueQ"]=[{regex:/^\s/,tag:"plain",then:e+"_beforeAttrName"},{regex:/^\//,tag:"operator",then:e+"_selfClosingStartTag"},{regex:/^>/,tag:"operator",then:f},{regex:/^(?=.)/,tag:"operator",then:e+"_beforeAttrName"}];c[e+"_selfClosingStartTag"]=[{regex:/^>/,tag:"operator",then:"start"},{regex:/^./,tag:"error",then:e+"_beforeAttrName"}]};c={start:[{regex:/^[^<]+/,tag:"plain"},{regex:/^<!--/,tag:"comment",then:"commentStart"},{regex:/^<!/,tag:"directive",then:"markupDeclarationOpen"},{regex:/^<\?/,
+tag:"comment",then:"bogusComment"},{regex:/^</,tag:"operator",then:"tagOpen"}],tagOpen:[{regex:/^\//,tag:"operator",then:"endTagOpen"},{regex:/^script/i,tag:"keyword",then:"script_beforeAttrName"},{regex:/^[a-zA-Z]/,tag:"keyword",then:"tagName"},{regex:/^(?=.)/,tag:"plain",then:"start"}],scriptData:[{regex:/^<(?=\/script>)/i,tag:"operator",then:"tagOpen stop:js"},{regex:/^[^<]+/,tag:"plain"}],endTagOpen:[{regex:/^[a-zA-Z]/,tag:"keyword",then:"tagName"},{regex:/^>/,tag:"error",then:"start"},{regex:/^./,
+tag:"error",then:"bogusComment"}],tagName:[{regex:/^\s+/,tag:"plain",then:"normal_beforeAttrName"},{regex:/^\//,tag:"operator",then:"normal_selfClosingStartTag"},{regex:/^>/,tag:"operator",then:"start"},{regex:/^[^ \t\n\/>]+/,tag:"keyword"}],bogusComment:[{regex:/^[^>]+/,tag:"comment"},{regex:/^>/,tag:"comment",then:"start"}],markupDeclarationOpen:[{regex:/^doctype/i,tag:"directive",then:"doctype"},{regex:/^(?=.)/,tag:"comment",then:"bogusComment"}],commentStart:[{regex:/^--\>/,tag:"comment",then:"start"},
+{regex:/^[^-]+/,tag:"comment"}],doctype:[{regex:/^\s/,tag:"plain",then:"beforeDoctypeName"},{regex:/^./,tag:"error",then:"beforeDoctypeName"}],beforeDoctypeName:[{regex:/^\s+/,tag:"plain"},{regex:/^>/,tag:"error",then:"start"},{regex:/^./,tag:"directive",then:"doctypeName"}],doctypeName:[{regex:/^\s/,tag:"plain",then:"afterDoctypeName"},{regex:/^>/,tag:"directive",then:"start"},{regex:/^[^ \t\n>]+/,tag:"directive"}],afterDoctypeName:[{regex:/^\s+/,tag:"directive"},{regex:/^>/,tag:"directive",then:"start"},
+{regex:/^public/i,tag:"directive",then:"afterDoctypePublicKeyword"},{regex:/^system/i,tag:"directive",then:"afterDoctypeSystemKeyword"},{regex:/^./,tag:"error",then:"bogusDoctype"}],afterDoctypePublicKeyword:[{regex:/^\s+/,tag:"plain",then:"beforeDoctypePublicId"},{regex:/^"/,tag:"error",then:"doctypePublicIdQQ"},{regex:/^'/,tag:"error",then:"doctypePublicIdQ"},{regex:/^>/,tag:"error",then:"start"},{regex:/^./,tag:"error",then:"bogusDoctype"}],beforeDoctypePublicId:[{regex:/^\s+/,tag:"plain"},{regex:/^"/,
+tag:"string",then:"doctypePublicIdQQ"},{regex:/^'/,tag:"string",then:"doctypePublicIdQ"},{regex:/^>/,tag:"error",then:"start"},{regex:/^./,tag:"error",then:"bogusDoctype"}],doctypePublicIdQQ:[{regex:/^"/,tag:"string",then:"afterDoctypePublicId"},{regex:/^>/,tag:"error",then:"start"},{regex:/^[^>"]+/,tag:"string"}],doctypePublicIdQ:[{regex:/^'/,tag:"string",then:"afterDoctypePublicId"},{regex:/^>/,tag:"error",then:"start"},{regex:/^[^>']+/,tag:"string"}],afterDoctypePublicId:[{regex:/^\s/,tag:"plain",
+then:"betweenDoctypePublicAndSystemIds"},{regex:/^>/,tag:"directive",then:"start"},{regex:/^"/,tag:"error",then:"doctypeSystemIdQQ"},{regex:/^'/,tag:"error",then:"doctypeSystemIdQ"},{regex:/^./,tag:"error",then:"bogusDoctype"}],betweenDoctypePublicAndSystemIds:[{regex:/^\s+/,tag:"plain",then:"betweenDoctypePublicAndSystemIds"},{regex:/^>/,tag:"directive",then:"start"},{regex:/^"/,tag:"string",then:"doctypeSystemIdQQ"},{regex:/^'/,tag:"string",then:"doctypeSystemIdQ"},{regex:/^./,tag:"error",then:"bogusDoctype"}],
+afterDoctypeSystemKeyword:[{regex:/^\s/,tag:"plain",then:"beforeDoctypeSystemId"},{regex:/^"/,tag:"error",then:"doctypeSystemIdQQ"},{regex:/^'/,tag:"error",then:"doctypeSystemIdQ"},{regex:/^>/,tag:"error",then:"start"},{regex:/^./,tag:"error",then:"bogusDoctype"}],beforeDoctypeSystemId:[{regex:/^\s+/,tag:"plain",then:"beforeDoctypeSystemId"},{regex:/^"/,tag:"string",then:"doctypeSystemIdQQ"},{regex:/^'/,tag:"string",then:"doctypeSystemIdQ"},{regex:/^>/,tag:"error",then:"start"},{regex:/./,tag:"error",
+then:"bogusDoctype"}],doctypeSystemIdQQ:[{regex:/^"/,tag:"string",then:"afterDoctypeSystemId"},{regex:/^>/,tag:"error",then:"start"},{regex:/^[^">]+/,tag:"string"}],doctypeSystemIdQ:[{regex:/^'/,tag:"string",then:"afterDoctypeSystemId"},{regex:/^>/,tag:"error",then:"start"},{regex:/^[^'>]+/,tag:"string"}],afterDoctypeSystemId:[{regex:/^\s+/,tag:"plain"},{regex:/^>/,tag:"directive",then:"start"},{regex:/^./,tag:"error",then:"bogusDoctype"}],bogusDoctype:[{regex:/^>/,tag:"directive",then:"start"},{regex:/^[^>]+/,
+tag:"directive"}]};d("normal","start");d("script","scriptData start:js");b.HTMLSyntax=a.create({states:c})});tiki.register("javascript",{});
+tiki.module("javascript:index",function(a,b){a("sproutcore/runtime");a("bespin:promise");a=a("syntax_manager:controllers/standardsyntax").StandardSyntax;b.JSSyntax=a.create({states:{start:[{regex:/^(?:break|case|catch|continue|default|delete|do|else|false|finally|for|function|if|in|instanceof|let|new|null|return|switch|this|throw|true|try|typeof|var|void|while|with)(?![a-zA-Z0-9_])/,tag:"keyword"},{regex:/^[A-Za-z_][A-Za-z0-9_]*/,tag:"identifier"},{regex:/^[^'"\/ \tA-Za-z0-9_]+/,tag:"plain"},{regex:/^[ \t]+/,
+tag:"plain"},{regex:/^'/,tag:"string",then:"qstring"},{regex:/^"/,tag:"string",then:"qqstring"},{regex:/^\/\/.*/,tag:"comment"},{regex:/^\/\*/,tag:"comment",then:"comment"},{regex:/^./,tag:"plain"}],qstring:[{regex:/^'/,tag:"string",then:"start"},{regex:/^(?:\\.|[^'\\])+/,tag:"string"}],qqstring:[{regex:/^"/,tag:"string",then:"start"},{regex:/^(?:\\.|[^"\\])+/,tag:"string"}],comment:[{regex:/^[^*\/]+/,tag:"comment"},{regex:/^\*\//,tag:"comment",then:"start"},{regex:/^[*\/]/,tag:"comment"}]}})});
+tiki.require("bespin:plugins").catalog.load({text_editor:{resourceURL:"resources/text_editor/",description:"Canvas-based text editor component and many common editing commands",dependencies:{delegate_support:"0.0",settings:"0.0",canon:"0.0",rangeutils:"0.0",appsupport:"0.0",syntax_manager:"0.0"},testmodules:[],provides:[{predicates:{isTextView:true},pointer:"commands/editing#backspace",ep:"command",key:"backspace",name:"backspace"},{predicates:{isTextView:true},pointer:"commands/editing#deleteCommand",
+ep:"command",key:"delete",name:"delete"},{description:"Delete all lines currently selected",key:"ctrl_d",predicates:{isTextView:true},pointer:"commands/editing#deleteLines",ep:"command",name:"deletelines"},{description:"Create a new, empty line below the current one",key:"ctrl_return",predicates:{isTextView:true},pointer:"commands/editing#openLine",ep:"command",name:"openline"},{params:[{defaultValue:"",type:"text",name:"text",description:"The text to insert"}],pointer:"commands/editing#insertText",
+ep:"command",name:"insertText"},{predicates:{isTextView:true},pointer:"commands/editing#newline",ep:"command",key:"return",name:"newline"},{predicates:{isTextView:true},pointer:"commands/editing#tab",ep:"command",key:"tab",name:"tab"},{predicates:{isTextView:true},ep:"command",name:"move"},{description:"Search for text within this buffer",params:[{type:"text",name:"value",description:"string to search for"}],key:"ctrl_f",pointer:"commands/editor#findCommand",ep:"command",name:"find"},{description:"Repeat the last search (forward)",
+pointer:"commands/editor#findNextCommand",ep:"command",key:"ctrl_g",name:"findnext"},{description:"Repeat the last search (backward)",pointer:"commands/editor#findPrevCommand",ep:"command",key:"ctrl_shift_g",name:"findprev"},{predicates:{isTextView:true},pointer:"commands/movement#moveDown",ep:"command",key:"down",name:"move down"},{predicates:{isTextView:true},pointer:"commands/movement#moveLeft",ep:"command",key:"left",name:"move left"},{predicates:{isTextView:true},pointer:"commands/movement#moveRight",
+ep:"command",key:"right",name:"move right"},{predicates:{isTextView:true},pointer:"commands/movement#moveUp",ep:"command",key:"up",name:"move up"},{predicates:{isTextView:true},ep:"command",name:"select"},{predicates:{isTextView:true},pointer:"commands/movement#selectDown",ep:"command",key:"shift_down",name:"select down"},{predicates:{isTextView:true},pointer:"commands/movement#selectLeft",ep:"command",key:"shift_left",name:"select left"},{predicates:{isTextView:true},pointer:"commands/movement#selectRight",
+ep:"command",key:"shift_right",name:"select right"},{predicates:{isTextView:true},pointer:"commands/movement#selectUp",ep:"command",key:"shift_up",name:"select up"},{predicates:{isTextView:true},pointer:"commands/movement#moveLineEnd",ep:"command",key:["end","ctrl_right"],name:"move lineend"},{predicates:{isTextView:true},pointer:"commands/movement#selectLineEnd",ep:"command",key:["shift_end","ctrl_shift_right"],name:"select lineend"},{predicates:{isTextView:true},pointer:"commands/movement#moveDocEnd",
+ep:"command",key:"ctrl_down",name:"move docend"},{predicates:{isTextView:true},pointer:"commands/movement#selectDocEnd",ep:"command",key:"ctrl_shift_down",name:"select docend"},{predicates:{isTextView:true},pointer:"commands/movement#moveLineStart",ep:"command",key:["home","ctrl_left"],name:"move linestart"},{predicates:{isTextView:true},pointer:"commands/movement#selectLineStart",ep:"command",key:["shift_home","ctrl_shift_left"],name:"select linestart"},{predicates:{isTextView:true},pointer:"commands/movement#moveDocStart",
+ep:"command",key:"ctrl_up",name:"move docstart"},{predicates:{isTextView:true},pointer:"commands/movement#selectDocStart",ep:"command",key:"ctrl_shift_up",name:"select docstart"},{predicates:{isTextView:true},pointer:"commands/movement#moveNextWord",ep:"command",key:["alt_right"],name:"move nextword"},{predicates:{isTextView:true},pointer:"commands/movement#selectNextWord",ep:"command",key:["alt_shift_right"],name:"select nextword"},{predicates:{isTextView:true},pointer:"commands/movement#movePreviousWord",
+ep:"command",key:["alt_left"],name:"move prevword"},{predicates:{isTextView:true},pointer:"commands/movement#selectPreviousWord",ep:"command",key:["alt_shift_left"],name:"select prevword"},{predicates:{isTextView:true},pointer:"commands/movement#selectAll",ep:"command",key:["ctrl_a","meta_a"],name:"select all"},{predicates:{isTextView:true},ep:"command",name:"scroll"},{predicates:{isTextView:true},pointer:"commands/scrolling#scrollDocStart",ep:"command",key:"ctrl_home",name:"scroll start"},{predicates:{isTextView:true},
+pointer:"commands/scrolling#scrollDocEnd",ep:"command",key:"ctrl_end",name:"scroll end"},{predicates:{isTextView:true},pointer:"commands/scrolling#scrollPageDown",ep:"command",key:"pagedown",name:"scroll down"},{predicates:{isTextView:true},pointer:"commands/scrolling#scrollPageUp",ep:"command",key:"pageup",name:"scroll up"},{pointer:"commands/editor#lcCommand",description:"Change all selected text to lowercase",withKey:"CMD SHIFT L",ep:"command",name:"lc"},{pointer:"commands/editor#detabCommand",
+description:"Convert tabs to spaces.",params:[{defaultValue:null,type:"text",name:"tabsize",description:"Optionally, specify a tab size. (Defaults to setting.)"}],ep:"command",name:"detab"},{pointer:"commands/editor#entabCommand",description:"Convert spaces to tabs.",params:[{defaultValue:null,type:"text",name:"tabsize",description:"Optionally, specify a tab size. (Defaults to setting.)"}],ep:"command",name:"entab"},{description:"move it! make the editor head to a line number.",params:[{type:"text",
+name:"line",description:"add the line number to move to in the file"}],key:"ctrl_l",pointer:"commands/editor#gotoCommand",ep:"command",name:"goto"},{pointer:"commands/editor#trimCommand",description:"trim trailing or leading whitespace from each line in selection",params:[{defaultValue:"both",type:{data:[{name:"left"},{name:"right"},{name:"both"}],name:"selection"},name:"side",description:"Do we trim from the left, right or both"}],ep:"command",name:"trim"},{pointer:"commands/editor#ucCommand",description:"Change all selected text to uppercase",
+withKey:"CMD SHIFT U",ep:"command",name:"uc"},{description:"The distance in characters between each tab",defaultValue:8,type:"number",ep:"setting",name:"tabstop"},{description:"Customize the keymapping",defaultValue:"{}",type:"text",ep:"setting",name:"customKeymapping"},{description:"The keymapping to use",defaultValue:"standard",type:"text",ep:"setting",name:"keymapping"},{description:"The editor font size in pixels",defaultValue:14,type:"number",ep:"setting",name:"fontsize"},{description:"The editor font face",
+defaultValue:"Monaco, Lucida Console, monospace",type:"text",ep:"setting",name:"fontface"}],type:"plugins/supported",name:"text_editor"},delegate_support:{testmodules:[],type:"plugins/supported",resourceURL:"resources/delegate_support/",description:"Simple support for multiple delegates on an object",name:"delegate_support"},embedded:{resourceURL:"resources/embedded/",name:"embedded",dependencies:{appsupport:"0.0",text_editor:"0.0",dock_view:"0.0",edit_session:"0.0",settings:"0.0"},testmodules:[],
+provides:[{action:"value",pointer:"#session",ep:"factory",name:"session"}],type:"plugins/embedded"},settings:{resourceURL:"resources/settings/",description:"Infrastructure and commands for managing user preferences",dependencies:{types:"0.0"},testmodules:[],provides:[{indexOn:"name",register:"memory#addSetting",ep:"extensionpoint",name:"setting",description:"A Choice is something that the application offers as a way to customize how it works"},{description:"A test setting",defaultValue:"bb",type:{data:["aa",
+"bb","cc"],name:"selection"},ep:"setting",name:"test"},{pointer:"commands#setCommand",description:"define and show settings",params:[{defaultValue:null,type:{pointer:"settings:memory#getSettings",name:"selection"},name:"setting",description:"The name of the setting to display or alter"},{defaultValue:null,type:{pointer:"settings:memory#getTypeSpecFromAssignment",name:"deferred"},name:"value",description:"The new value for the chosen setting"}],ep:"command",name:"set"},{pointer:"commands#unsetCommand",
+description:"unset a setting entirely",params:[{type:{pointer:"settings:memory#getSettings",name:"selection"},name:"setting",description:"The name of the setting to return to defaults"}],ep:"command",name:"unset"}],type:"plugins/supported",name:"settings"},javascript:{resourceURL:"resources/javascript/",description:"JavaScript syntax highlighter",dependencies:{syntax_manager:"0.0"},testmodules:[],provides:[{syntax:"js",ep:"fileextension",name:"js"},{pointer:"#JSSyntax",ep:"syntax",name:"js"}],type:"plugins/supported",
+name:"javascript"},canon:{resourceURL:"resources/canon/",description:"Manages commands and their keyboard shortcuts",dependencies:{types:"0.0",settings:"0.0"},testmodules:["tests/testKeyboard"],provides:[{indexOn:"name",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",ep:"extensionpoint",name:"command"},{description:"How many typed commands do we recall for reference?",
+defaultValue:50,type:"number",ep:"setting",name:"historyLength"}],type:"plugins/supported",name:"canon"},rangeutils:{testmodules:[],type:"plugins/supported",resourceURL:"resources/rangeutils/",description:"Utility functions for dealing with ranges of text",name:"rangeutils"},dock_view:{testmodules:[],type:"plugins/supported",resourceURL:"resources/dock_view/",description:"A view that supports docked panels on the sides",name:"dock_view"},html:{resourceURL:"resources/html/",description:"HTML syntax highlighter",
+dependencies:{syntax_manager:"0.0"},testmodules:[],provides:[{syntax:"html",ep:"fileextension",name:"htm"},{syntax:"html",ep:"fileextension",name:"html"},{pointer:"#HTMLSyntax",ep:"syntax",name:"html"}],type:"plugins/supported",name:"html"},filesystem:{resourceURL:"resources/filesystem/",description:"Provides the file and directory model used within Bespin",dependencies:{types:"0.0"},testmodules:["tests/testFileManagement","tests/testPathUtils"],provides:[{description:"A pointer to a file which we believe to already exist",
+pointer:"types#existingFile",ep:"type",name:"existingFile"}],type:"plugins/supported",name:"filesystem"},appsupport:{resourceURL:"resources/appsupport/",description:"Common services used in the editor application",dependencies:{canon:"0.0"},testmodules:[],provides:[{pointer:"controllers/undomanager#undoManagerCommand",ep:"command",key:["ctrl_shift_z"],name:"redo"},{pointer:"controllers/undomanager#undoManagerCommand",ep:"command",key:["ctrl_z"],name:"undo"}],type:"plugins/supported",name:"appsupport"},
+edit_session:{resourceURL:"resources/edit_session/",description:"Ties together the files being edited with the views on screen",dependencies:{text_editor:"0.0",delegate_support:"0.0",filesystem:"0.0"},testmodules:["tests/testHistory","tests/testSession"],provides:[{ep:"extensionpoint",name:"bufferFileChanged",description:"Notifies that the current file is changed."}],type:"plugins/supported",name:"edit_session"},types:{resourceURL:"resources/types/",description:"Defines parameter types for commands",
+testmodules:["tests/testBasic","tests/testTypes"],provides:[{indexOn:"name",description:"Commands can accept various arguments that the user enters or that are automatically supplied by the environment. Those arguments have types that define how they are supplied or completed. The pointer points to an object with methods convert(str value) and getDefault(). Both functions have `this` set to the command's `takes` parameter. If getDefault is not defined, the default on the command's `takes` is used, if there is one. The object can have a noInput property that is set to true to reflect that this type is provided directly by the system. getDefault must be defined in that case.",
+ep:"extensionpoint",name:"type"},{description:"Text that the user needs to enter.",pointer:"basic#text",ep:"type",name:"text"},{description:"A JavaScript number",pointer:"basic#number",ep:"type",name:"number"},{description:"A true/false value",pointer:"basic#bool",ep:"type",name:"boolean"},{description:"An object that converts via JavaScript",pointer:"basic#object",ep:"type",name:"object"},{description:"A string that is constrained to be one of a number of pre-defined values",pointer:"basic#selection",
+ep:"type",name:"selection"},{description:"A type which we don't understand from the outset, but which we hope context can help us with",ep:"type",name:"deferred"}],type:"plugins/supported",name:"types"},syntax_manager:{resourceURL:"resources/syntax_manager/",description:"Provides syntax highlighting services for the editor",dependencies:{rangeutils:"0.0",delegate_support:"0.0"},testmodules:[],provides:[{register:"controllers/syntaxdirectory#discoveredNewSyntax",ep:"extensionhandler",name:"syntax"},
+{indexOn:"name",ep:"extensionpoint",name:"fileextension"}],type:"plugins/supported",name:"syntax_manager"}});SC.ready(function(){for(var a=tiki.require("embedded"),b=document.querySelectorAll(".bespin"),c=0;c<b.length;c++){var d=b[c],e=d.getAttribute("data-bespinoptions");d.bespin=a.useBespin(d,JSON.parse(e))}window.onBespinLoad&&window.onBespinLoad()});document.addEventListener("DOMContentLoaded",SC.didLoad,false);window.tiki=tiki;
Index: /CKEditor/branches/features/bespin/_source/plugins/bespin/plugin.js
===================================================================
--- /CKEditor/branches/features/bespin/_source/plugins/bespin/plugin.js	(revision 5393)
+++ /CKEditor/branches/features/bespin/_source/plugins/bespin/plugin.js	(revision 5394)
@@ -217,9 +217,10 @@
 										'</' + 'script>' +
 										'<style type="text/css">' +
-											'.bespin { visibility: hidden; overflow: hidden; margin: 0px; ' +
-											' height: ' + editor.config.height + 'px; }' +
+											'html, body { height: 100% }' +
+											'.bespin { visibility: hidden; overflow: hidden; margin: 0px; }' +
 										'</style>'+
 									'</head>' +
-									'<body id="editor" class="bespin">' +
+									'<body id="editor" class="bespin"' +
+									' data-bespinoptions=\'{ "settings": { "tabstop": 4 },"stealFocus": true, "syntax": "html" }\'>' +
 										data +
 									'</body>' +
@@ -242,10 +243,10 @@
 							getData : function()
 							{
-								return bespin.getContent();
+								return bespin.value;
 							},
 
 							getSnapshotData : function()
 							{
-								return bespin.getContent();
+								return bespin.value;
 							},
 
