diff --git a/ubiquity/chrome/content/BespinEmbedded.compressed.css b/ubiquity/chrome/content/BespinEmbedded.compressed.css index 77296dbc..31606005 100644 --- a/ubiquity/chrome/content/BespinEmbedded.compressed.css +++ b/ubiquity/chrome/content/BespinEmbedded.compressed.css @@ -1 +1 @@ -.sc-view.handles{border:1px rgba(185,192,255,0.5) dashed;overflow:visible;}.sc-view.handles .handle{background-color:#ffdfb2;width:7px;height:7px;position:absolute;top:50%;left:50%;display:block;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:rgba(0,0,0,0.2) 0 1px 0;opacity:.9;margin-left:-4px;margin-top:-4px;}.sc-view.handles .handle.top{margin-top:0;top:-4px;cursor:row-resize;}.sc-view.handles .handle.bottom{margin-top:0;top:auto;bottom:-4px;cursor:row-resize;}.sc-view.handles .handle.left{margin-left:0;left:-4px;cursor:col-resize;}.sc-view.handles .handle.right{margin-left:0;left:auto;right:-4px;cursor:col-resize;}.sc-view.handles .handle.top.left,.sc-view.handles .handle.bottom.right{cursor:default;}.sc-view.handles .handle.top.right,.sc-view.handles .handle.bottom.left{cursor:default;}.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 img.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 label{text-align:left;margin-left:16px;}.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;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/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/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>.sc-view{border:0 #444 solid;background-color:#eaeaea;}.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-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-segmented-view{display:block;text-align:center;}.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: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:18px;width:18px;margin-left:-9px;top:-6px;position:absolute;background:black;border-radius:9px;-moz-border-radius:9px;}.sc-split-divider-view{background-color:#ddd;}.sc-tab-view>.sc-container-view{border:1px #888 solid;-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;}.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:1em 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 .sc-text-field-view{border:none;z-index:100;overflow:visible;background:white;}.safari .sc-view .sc-text-field-view.focus{outline:auto 7px -webkit-focus-ring-color;outline-offset:-2px;}.mozilla .sc-view .sc-text-field-view.focus{outline-color:-moz-mac-focusring;outline-offset:-5px;outline-style:solid;outline-width:3px;}.msie .sc-view .sc-text-field-view.focus{outline:1px dotted;}.sc-text-field-view .border{position:absolute;top:0;left:0;bottom:0;right:0;}.mozilla .sc-view .sc-text-field-view .border{-moz-appearance:textfield;}.msie .sc-view .sc-text-field-view .border{border:1px inset;}.safari .sc-text-field-view .border{-webkit-appearance:textfield;}.sc-view .sc-text-field-view .padding{top:0;left:3px;bottom:0;right:3px;position:absolute;}.sc-view .sc-text-field-view.text-area .padding{right:0;}.sc-view .sc-text-field-view .sc-text-field-accessory-view{z-index:2;}.sc-text-field-view input{position:absolute;top:0;left:0;width:100%;height:100%;line-height:100%;bottom:0;right:0;display:block;background:transparent;vertical-align:middle;}.msie .sc-text-field-view input{line-height:1.8em;}.mozilla .sc-text-field-view input{top:3px;}.sc-text-field-view input{border:none;outline:none;}.sc-text-field-view textarea{border:none;outline:none;}.sc-text-field-view textarea{position:absolute;top:0;left:0;width:100%;bottom:0;right:0;height:100%;display:block;background:transparent;vertical-align:middle;resize:none;line-height:1.8em;overflow:auto;}.sc-text-field-view .sc-hint{z-index:1;position:absolute;top:3px;left:1px;right:1px;bottom:3px;padding:0;color:#aaa;font-size:12px;}.sc-text-field-view.text-area .sc-hint{top:2px;left:3px;right:3px;bottom:2px;}.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:-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;}.sc-theme .sc-button-view{text-decoration:none;border:none;padding:0;}.sc-theme .sc-button-view.icon img.icon{position:relative;vertical-align:middle;top:-2px;margin-right:2px;height:16px;width:16px;}.sc-theme .sc-button-view.sc-regular-size.square{text-shadow:#fff 0 1px 0;color:black;}.sc-theme .sc-button-view.sc-regular-size.square .sc-button-inner{display:block;}.sc-theme .sc-button-view.sc-regular-size.square .sc-button-label{display:block;text-align:center;padding:0 0 7px 0;}.sc-theme .sc-button-view.sc-regular-size.square.active .sc-button-label{text-shadow:black 0 -1px 0;color:white;}.sc-theme .sc-button-view.square.disabled .sc-button-label{color:#999;text-shadow:none;}.sc-theme .sc-button-view.sc-regular-size.square.def .sc-button-label,.sc-theme .sc-button-view.sc-regular-size.square.sel .sc-button-label{color:white;text-shadow:#2a569e 0 -1px 0;}.sc-theme .sc-button-view.sc-regular-size.square.def.disabled .sc-button-label,.sc-theme .sc-button-view.sc-regular-size.square.sel.disabled .sc-button-label{color:#ddd;text-shadow:none;}.sc-theme .sc-button-view.sc-regular-size.square{font-size:12px;max-height:24px;background:url("images/sc-theme-repeat-x.png") no-repeat right -814px;}.sc-theme .sc-button-view.sc-regular-size.square .sc-button-inner{height:24px;max-height:24px;background:url("images/sc-theme-repeat-x.png") no-repeat left -789px;}.sc-theme .sc-button-view.sc-regular-size.square .sc-button-label{height:18px;line-height:24px;margin-left:11px;margin-right:11px;background:url("images/sc-theme-repeat-x.png") repeat-x -15px -764px;}.sc-theme .sc-button-view.sc-regular-size.square.active{background:url("images/sc-theme-repeat-x.png") no-repeat left -913px;}.sc-theme .sc-button-view.sc-regular-size.square.active .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -939px;}.sc-theme .sc-button-view.sc-regular-size.square.active .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x right -889px;}.sc-theme .sc-button-view.sc-regular-size.square.disabled{background:url("images/sc-theme-repeat-x.png") no-repeat right -1064px;}.sc-theme .sc-button-view.sc-regular-size.square.disabled .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat left -1038px;}.sc-theme .sc-button-view.sc-regular-size.square.disabled .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x left -1014px;}.sc-theme .sc-button-view.sc-regular-size.square.def,.sc-theme .sc-button-view.sc-regular-size.square.sel{background:url("images/sc-theme-repeat-x.png") no-repeat right -1190px;}.sc-theme .sc-button-view.sc-regular-size.square.def .sc-button-inner,.sc-theme .sc-button-view.sc-regular-size.square.sel .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat left -1164px;}.sc-theme .sc-button-view.sc-regular-size.square.def .sc-button-label,.sc-theme .sc-button-view.sc-regular-size.square.sel .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x left -1140px;}.sc-theme .sc-button-view.sc-regular-size.square.def.active,.sc-theme .sc-button-view.sc-regular-size.square.sel.active{background:url("images/sc-theme-repeat-x.png") no-repeat right -1316px;}.sc-theme .sc-button-view.sc-regular-size.square.def.active .sc-button-inner,.sc-theme .sc-button-view.sc-regular-size.square.sel.active .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat left -1290px;}.sc-theme .sc-button-view.sc-regular-size.square.def.active .sc-button-label,.sc-theme .sc-button-view.sc-regular-size.square.sel.active .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x left -1266px;}.sc-theme .sc-button-view.sc-regular-size.square.def.disabled,.sc-theme .sc-button-view.sc-regular-size.square.sel.disabled{background:url("images/sc-theme-repeat-x.png") no-repeat right -1442px;}.sc-theme .sc-button-view.sc-regular-size.square.def.disabled .sc-button-inner,.sc-theme .sc-button-view.sc-regular-size.square.sel.disabled .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat left -1416px;}.sc-theme .sc-button-view.sc-regular-size.square.def.disabled .sc-button-label,.sc-theme .sc-button-view.sc-regular-size.square.sel.disabled .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x left -1392px;}.sc-theme .sc-button-view.capsule{font-size:12px;height:24px;max-height:24px;text-shadow:#fff 0 1px 0;text-align:center;background:transparent url("images/sc-theme-repeat-x.png") no-repeat right -224px;color:black;}.sc-theme .sc-button-view.capsule .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -197px;display:block;height:24px;max-height:24px;}.sc-theme .sc-button-view.capsule .sc-button-label{background:transparent url("images/sc-theme-repeat-x.png") repeat-x left -764px;display:block;text-align:center;padding:0 0 7px 0;height:24px;margin-left:12px;margin-right:12px;line-height:24px;text-shadow:none;}.sc-theme .sc-button-view.capsule.sel,.sc-theme .sc-button-view.capsule.def{background:transparent url("images/sc-theme-repeat-x.png") no-repeat scroll right -304px;}.sc-theme .sc-button-view.capsule.sel .sc-button-inner,.sc-theme .sc-button-view.capsule.def .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -277px;}.sc-theme .sc-button-view.capsule.sel .sc-button-label,.sc-theme .sc-button-view.capsule.def .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x 0 -1140px;color:white;text-shadow:#2a569e 0 -1px 0;}.sc-theme .sc-button-view.capsule.disabled{background:transparent url("images/sc-theme-repeat-x.png") no-repeat scroll right -544px;}.sc-theme .sc-button-view.capsule.disabled .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -517px;}.sc-theme .sc-button-view.capsule.disabled .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x 0 -1014px;color:#999;text-shadow:none;}.sc-theme .sc-button-view.capsule.sel.disabled,.sc-theme .sc-button-view.capsule.def.disabled{background:transparent url("images/sc-theme-repeat-x.png") no-repeat scroll right -544px;}.sc-theme .sc-button-view.capsule.sel.disabled .sc-button-inner,.sc-theme .sc-button-view.capsule.def.disabled .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -517px;}.sc-theme .sc-button-view.capsule.sel.disabled .sc-button-label,.sc-theme .sc-button-view.capsule.def.disabled .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x 0 -1014px;color:#999;text-shadow:none;}.sc-theme .sc-button-view.capsule.sel.active,.sc-theme .sc-button-view.capsule.def.active{background:transparent url("images/sc-theme-repeat-x.png") no-repeat scroll right -464px;}.sc-theme .sc-button-view.capsule.sel.active .sc-button-inner,.sc-theme .sc-button-view.capsule.def.active .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -437px;}.sc-theme .sc-button-view.capsule.sel.active .sc-button-label,.sc-theme .sc-button-view.capsule.def.active .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x 0 -1266px;color:white;}.sc-theme .sc-button-view.capsule.active{background:transparent url("images/sc-theme-repeat-x.png") no-repeat scroll right -384px;}.sc-theme .sc-button-view.capsule.active .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -357px;}.sc-theme .sc-button-view.capsule.active .sc-button-label{background:url("images/sc-theme-repeat-x.png") repeat-x 0 -889px;color:white;}.sc-theme .sc-button-view.focus{overflow:visible;}.sc-theme .sc-button-view div.focus-ring{visibility:hidden;}.sc-theme .sc-button-view.focus div.focus-ring{visibility:visible;right:0;top:0;left:0;bottom:0;position:absolute;}.sc-theme .sc-button-view.focus div.focus-ring div{top:-3px;bottom:-3px;position:absolute;}.sc-theme .sc-button-view.square.focus .focus-ring .focus-left,.sc-theme .sc-button-view.dropdown.focus .focus-ring .focus-left,.sc-theme .sc-button-view.popup.focus .focus-ring .focus-left{left:-2px;width:10px;background:transparent url("images/sc-theme-repeat-x.png") no-repeat 0 -1685px;}.sc-theme .sc-button-view.square.focus .focus-ring .focus-right,.sc-theme .sc-button-view.dropdown.focus .focus-ring .focus-right,.sc-theme .sc-button-view.popup.focus .focus-ring .focus-right{right:-2px;width:10px;background:transparent url("images/sc-theme-repeat-x.png") no-repeat scroll right -1717px;}.sc-theme .sc-button-view.square.focus .focus-ring .focus-middle,.sc-theme .sc-button-view.dropdown.focus .focus-ring .focus-middle,.sc-theme .sc-button-view.popup.focus .focus-ring .focus-middle{left:7px;right:7px;background:transparent url("images/sc-theme-repeat-x.png") repeat-x 0 -1749px;}.sc-theme .sc-button-view.capsule div.focus-ring .focus-left{left:-3px;width:16px;background:transparent url("images/sc-theme-repeat-x.png") no-repeat 0 -1783px;}.sc-theme .sc-button-view.capsule div.focus-ring .focus-right{right:-3px;width:16px;background:transparent url("images/sc-theme-repeat-x.png") no-repeat -16px -1815px;}.sc-theme .sc-button-view.capsule div.focus-ring .focus-middle{left:13px;right:13px;background:transparent url("images/sc-theme-repeat-x.png") repeat-x 0 -1847px;}.sc-theme .sc-checkbox-view{line-height:18px;vertical-align:middle;}.sc-theme .sc-checkbox-view .label{position:absolute;left:20px;top:0;right:0;bottom:0;line-height:18px;}.sc-theme .sc-checkbox-view.icon img.icon{position:relative;vertical-align:middle;top:-2px;margin-left:2px;margin-right:4px;height:16px;width:16px;}.sc-theme .sc-checkbox-view.disabled{color:#666;color:rgba(0,0,0,0.5);}.sc-theme .sc-checkbox-view input{width:1px;height:1px;top:1px;left:1px;position:relative;opacity:0;vertical-align:top;margin:0;margin-right:3px;outline:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);-moz-opacity:0;}.sc-theme .sc-checkbox-view span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -468px;width:16px;height:16px;position:absolute;line-height:16px;left:1px;top:0;}.sc-theme .sc-checkbox-view.sel span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -32px -495px;}.sc-theme .sc-checkbox-view.mixed span.button{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -468px;}.sc-theme .sc-checkbox-view.disabled span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -27px -411px;}.sc-theme .sc-checkbox-view.sel.disabled span.button{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -495px;}.sc-theme .sc-checkbox-view.mixed.disabled span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -32px -441px;}.sc-checkbox-view.active span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -441px;}.sc-theme .sc-checkbox-view.sel.active span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -495px;}.sc-theme .sc-checkbox-view.mixed.active span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -388px;}.sc-theme .sc-collection-view{text-decoration:none;color:#000;}.sc-theme .sc-collection-view.alternating .sc-collection-item.even{background-color:#e4e4e4;}.sc-theme .sc-collection-view .sc-collection-item.sel{background-color:#ddd;color:#333;}.sc-theme.focus .sc-collection-view.alternating .sc-collection-item.even{background-color:#f4f7fb;}.sc-theme.focus .sc-collection-view.focus .sc-collection-item.sel{background-color:#2370d8;color:white;}.sc-theme .sc-list-view{background-color:white;}.sc-theme .sc-list-view .sc-collection-item{display:block;line-height:22px;}.sc-theme .sc-list-insertion-point{overflow:visible;background-color:#4e4977;z-index:1000;}.sc-theme .sc-list-insertion-point .anchor{position:absolute;width:8px;top:-2px;left:-4px;height:8px;background:url("images/sc-theme-repeat-x.png") no-repeat -32px -1630px;}.sc-theme .sc-list-view.sc-source-list{background-color:#f0f0f0;background-color:rgba(255,255,255,0.8);border:none;color:#363636;}.sc-theme.focus .sc-list-view.sc-source-list{background-color:#d4d7e0;background-color:rgba(250,250,255,0.7);color:black;}.sc-theme .sc-list-view.sc-source-list .sc-collection-item.sel{background-color:#ddd;border-top:1px solid #eee;font-weight:bold;}.sc-theme.focus .sc-list-view.sc-source-list .sc-collection-item.sel{background:transparent url("images/sc-theme-repeat-x.png") repeat-x 0 -16px;color:white;border-top:1px solid #1f4f9b;border-bottom:1px solid #1f4f9b;border-right:0;z-index:1;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view label{left:12px;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view.has-icon label,.sc-theme .sc-list-view.sc-source-list .sc-list-item-view.has-checkbox label{left:32px;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view.has-checkbox.has-icon label{left:56px;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view img.icon{position:absolute;left:10px;top:50%;margin-top:-9px;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view.sel img.icon{margin-top:-10px;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view.has-checkbox img.icon{left:30px;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view.sc-group-item{text-transform:uppercase;color:#2e2f30;font-weight:bold;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view.sc-group-item img.icon{display:none;}.sc-theme .sc-list-view.sc-source-list .sc-list-item-view.sc-group-item.has-icon label{left:8px;}.sc-theme{font:12px/18px "Lucida Grande","Lucida Sans",Verdana,Arial,sans-serif;padding:0;}.sc-main.sc-theme,body.sc-theme{background-color:#57647f;}.sc-theme .sc-view.invalid{outline:2px red solid;}.sc-theme .sc-view.sc-bezel-border{border-left:1px #999 solid;border-top:1px #666 solid;border-bottom:1px #fff solid;border-right:1px #fff solid;}.sc-theme .sc-view.sc-black-border{border:1px black solid;}.sc-theme .sc-view.sc-gray-border{border:1px #888 solid;}.sc-theme .sc-view.sc-bottom-border{border-bottom:1px #888 solid;}.sc-theme .sc-view.sc-top-border{border-top:1px #888 solid;}.sc-theme div.sc-web-view{background-color:white;}.sc-theme .sc-pane.sc-main{background:-webkit-gradient(linear,left top,left bottom,from(#57647f),to(#848ea2));color:white;}.sc-theme #loading{position:absolute;top:0;left:0;bottom:0;right:0;background:-webkit-gradient(linear,left top,left bottom,from(#57647f),to(#848ea2));color:white;}.sc-theme #loading p.loading{position:absolute;padding:4px 12px;bottom:0;left:0;right:0;margin:0;background-color:#b1baca;color:black;border-top:1px #b1baca solid;text-align:right;}.sc-theme .sc-button-view.sc-disclosure-view img.button{width:12px;height:12px;left:0;top:3px;background-image:url("images/sc-theme-repeat-x.png");}.sc-theme .sc-button-view.sc-disclosure-view.sel img.button{background-position:0 -1597px;}.sc-theme .sc-button-view.sc-disclosure-view img.button{background-position:-16px -1614px;}.sc-theme .sc-button-view.sc-disclosure-view{background:transparent;}.sc-theme .sc-button-view.sc-disclosure-view.sel.disabled img.button{background-position:0 -1613px;}.sc-theme .sc-button-view.sc-disclosure-view.disabled img.button{background-position:-16px -1630px;}.sc-theme .sc-button-view.sc-disclosure-view.sel.active img.button{background-position:-16px -1597px;}.sc-theme .sc-button-view.sc-disclosure-view.active img.button{background-position:-0px -1630px;}.sc-theme .sc-label-view img.icon{top:-2px;margin-left:2px;margin-right:4px;height:16px;width:16px;}.sc-theme .sc-list-item-view .sc-checkbox-view{position:absolute;display:block;border:none;width:17px;height:16px;left:5px;top:50%;margin-top:-8px;background:none;}.sc-theme .sc-list-item-view.sel .sc-checkbox-view{background:none;border:none;}.sc-theme .sc-list-item-view .sc-checkbox-view.sel{background:none;border:none;}.sc-theme .sc-list-item-view .sc-checkbox-view.active{background:none;border:none;}.sc-theme .sc-list-item-view img.disclosure{position:absolute;left:-11px;top:50%;margin-top:-6px;width:14px;height:14px;background-image:url("images/sc-theme-repeat-x.png");background-position:-16px -1614px;}.sc-theme .sc-list-item-view img.disclosure.open{background-position:0 -1597px;}.sc-theme .sc-list-item-view img.disclosure.active{background-position:-0px -1630px;}.sc-theme .sc-list-item-view img.disclosure.open.active{background-position:-16px -1597px;}.sc-theme .sc-list-item-view.disabled img.disclosure,.sc-theme .sc-list-item-view.disabled img.disclosure.active{background-position:-16px -1630px;}.sc-theme .sc-list-item-view.disabled img.disclosure.open,.sc-theme .sc-list-item-view.disabled img.disclosure.open.active{background-position:0 -1613px;}.sc-theme .sc-list-item-view .branch{background-image:url("images/icons/mini_454545.png");background-position:-32px 0;}.sc-theme .sc-list-item-view.sel .branch,.sc-theme .sc-list-item-view.active .branch{background-image:url("images/icons/mini_ffffff.png");}.sc-theme .sc-menu-scroller-view.sc-vertical .arrowDown{border:none;width:14px;height:14px;text-align:center;background:url("images/sc-theme-repeat-x.png") no-repeat 0 -1598px;display:inline-block;vertical-align:bottom;}.sc-theme .sc-menu-scroller-view.sc-vertical .arrowUp{border:none;width:14px;height:14px;text-align:center;background:url("images/sc-theme-repeat-x.png") no-repeat 0 -1585px;display:inline-block;vertical-align:bottom;}.sc-theme .sc-menu-item.focus a{color:#fff;background-color:#5A8EC6;}.sc-theme .sc-menu-item div.checkbox{background-image:url("images/icons/mini_454545.png");background-position:-66px -147px;}.sc-theme .sc-menu-item.focus div.checkbox{background-image:url("images/icons/mini_ffffff.png");}.sc-theme .sc-menu-item .separator{margin:3px 1px 3px 1px;}.sc-menu-item span.has-branch{position:absolute;display:block;width:16px;height:16px;text-align:center;right:5px;top:2px;background:transparent url("images/icons/mini_222222.png");background-position-x:0;background-position-y:-160px;}.sc-menu-item.focus span.has-branch{background:transparent url("images/icons/mini_ffffff.png");background-position-x:0;background-position-y:-160px;}.sc-theme.sc-dialog-pane{z-index:2000;background:#494949;}div.sc-ghost-view{background-image:url(data:image/gif;base64,R0lGODlhAQABAJAAAP///wAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw==) top left no-repeat;*background-image:url('') top left no-repeat;}.sc-theme.sc-pane.sc-panel>.top-right-edge{background:url("images/panels/sprite-x.png") no-repeat -40px -120px;}.sc-theme.sc-pane.sc-panel>.top-left-edge{background:url("images/panels/sprite-x.png") no-repeat 0 -120px;}.sc-theme.sc-pane.sc-panel>.bottom-left-edge{background:url("images/panels/sprite-x.png") no-repeat 0 -160px;}.sc-theme.sc-pane.sc-panel>.bottom-right-edge{background:url("images/panels/sprite-x.png") no-repeat -40px -160px;}.sc-theme.sc-pane.sc-panel>.top-edge{background:url("images/panels/sprite-x.png") repeat-x 0 -230px;}.sc-theme.sc-pane.sc-panel>.bottom-edge{background:url("images/panels/sprite-x.png") repeat-x 0 -210px;}.sc-theme.sc-pane.sc-panel>.left-edge{background:url("images/panels/sprite-y.png") repeat-y 0 0;}.sc-theme.sc-pane.sc-panel>.right-edge{background:url("images/panels/sprite-y.png") repeat-y -20px 0;}.sc-theme.sc-pane.sc-panel.sc-picker .perfectRight{background:url("images/panels/sprite-x.png") no-repeat 0 -30px;}.sc-theme.sc-pane.sc-panel.sc-picker .perfectLeft{background:url("images/panels/sprite-x.png") no-repeat -30px -30px;}.sc-theme.sc-pane.sc-panel.sc-picker .perfectTop{background:url("images/panels/sprite-x.png") no-repeat 0 -90px;}.sc-theme.sc-pane.sc-panel.sc-picker .perfectBottom{background:url("images/panels/sprite-x.png") no-repeat 0 0;}.sc-theme .sc-progress-view{background:transparent url("images/sc-theme-repeat-x.png") repeat-x 0 -1540px;border:none;border-left:1px solid #666;border-right:1px solid #666;}.sc-theme .sc-progress-view.disabled{opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50);-moz-opacity:.5;}.sc-theme .sc-progress-view .sc-inner{background:transparent url("images/sc-theme-repeat-x.png") repeat-x 0 -1518px;border-right:1px solid #625560;}.sc-theme .sc-progress-view.sc-indeterminate .sc-inner{background:transparent url("images/sc-theme-repeat-x.png") repeat-x 0 -1562px;}.sc-theme .sc-radio-view .sc-radio-button .sc-button-label{position:relative;vertical-align:bottom;padding-left:2px;}.sc-theme .sc-radio-view .sc-radio-button span.button{width:16px;height:16px;vertical-align:middle;position:relative;margin-right:4px;margin-top:-2px;background:url("images/sc-theme-repeat-x.png") no-repeat 0 -776px;}.sc-theme .sc-radio-view .sc-radio-button input{width:10px;height:10px;position:absolute;margin-left:-20px;opacity:0;outline:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);-moz-opacity:0;}.sc-theme .sc-radio-view.sc-layout-vertical .sc-radio-button{padding-left:18px;position:relative;margin-bottom:3px;}.sc-theme .sc-radio-view.sc-layout-horizontal .sc-radio-button{padding-right:8px;}.sc-theme .sc-radio-view.sc-layout-vertical .sc-radio-button span.button{position:absolute;margin:0;left:0;top:0;}.sc-theme .sc-radio-view.sc-layout-vertical .sc-radio-button input{position:absolute;margin:0;left:2px;top:1px;}.sc-theme .sc-radio-view.sc-layout-horizontal .sc-radio-button span.button{position:relative;margin:0;left:0;top:0;display:inline-block;}.sc-theme .sc-radio-view.sc-layout-horizontal .sc-radio-button input{position:relative;left:2px;top:1px;display:block;width:0;height:0;padding:0;}.sc-theme .sc-radio-view.disabled .sc-radio-button,.sc-theme .sc-radio-view .sc-radio-button.disabled{color:#666;color:rgba(0,0,0,0.5);}.sc-theme .sc-radio-view img.icon{position:relative;vertical-align:middle;top:-2px;margin-left:2px;margin-right:4px;height:16px;width:16px;}.sc-theme .sc-radio-view.disabled img.icon,.sc-theme .sc-radio-view .sc-radio-button.disabled img.icon{opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50);-moz-opacity:.5;}.sc-theme .sc-radio-view .sc-radio-button span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -200px;}.sc-theme .sc-radio-view .sc-radio-button.sel span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -32px -280px;}.sc-theme .sc-radio-view .sc-radio-button.mixed span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -360px;}.sc-theme .sc-radio-view .sc-radio-button.disabled span.button,.sc-theme .sc-radio-view.disabled .sc-radio-button span.button,.sc-theme .sc-radio-view.disabled .sc-radio-button.active:hover span.button,.sc-theme .sc-radio-view .sc-radio-button.disabled.active:hover span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -226px;}.sc-theme .sc-radio-view.disabled .sc-radio-button.sel span.button,.sc-theme .sc-radio-view.disabled .sc-radio-button.sel.active:hover span.button,.sc-theme .sc-radio-view .sc-radio-button.sel.disabled span.button,.sc-theme .sc-radio-view .sc-radio-button.sel.disabled.active:hover span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -280px;}.sc-theme .sc-radio-view.disabled .sc-radio-button.mixed span.button,.sc-theme .sc-radio-view .sc-radio-button.mixed.disabled span.button,.sc-theme .sc-radio-view.disabled .sc-radio-button.mixed.active:hover span.button,.sc-theme .sc-radio-view .sc-radio-button.mixed.disabled span.button{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -308px;}.sc-theme .sc-radio-view .sc-radio-button.active:hover span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -32px -200px;}.sc-theme .sc-radio-view .sc-radio-button.active.sel:hover span.button{background:url("images/sc-theme-repeat-x.png") no-repeat 0 -226px;}.sc-theme .sc-radio-view .sc-radio-button.mixed.active:hover span.button{background:url("images/sc-theme-repeat-x.png") no-repeat -16px -308px;}.sc-theme .sc-segmented-view{display:block;}.sc-theme .sc-segmented-view a.sc-segment{text-decoration:none;color:black;text-align:center;}.sc-theme a.sc-segment:active,a.sc-segment:focus{outline:none;}.sc-theme a.sc-segment img.icon{position:relative;vertical-align:middle;top:-2px;margin-right:2px;height:16px;width:16px;}.sc-theme .sc-segmented-view.disabled a.sc-segment img.icon{opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50);-moz-opacity:.5;}.sc-theme .sc-segmented-view a.sc-segment{display:block;top:0;height:24px;line-height:24px;text-shadow:#fff 0 1px 0;margin-left:-1px;}.sc-theme .sc-segmented-view .sc-button-inner{display:block;min-width:20px;min-height:24px;border:none;}.sc-theme .sc-segmented-view a.sc-segment{padding-left:11px;padding-right:0;border:none;background:transparent;}.sc-theme .sc-segmented-view a.sc-segment .sc-button-inner{padding-left:0;padding-right:11px;background:transparent;}.sc-theme .sc-segmented-view a.sc-segment label{display:block;line-height:24px;height:24px;text-align:center;background:transparent;}.sc-theme .sc-segmented-view a.sc-segment.sc-last-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -814px;}.sc-theme .sc-segmented-view a.sc-segment.sc-first-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -789px;}.sc-theme .sc-segmented-view a.sc-segment label{background:url("images/sc-theme-repeat-x.png") repeat-x left -764px;text-shadow:#fff 0 1px 0;}.sc-theme .sc-segmented-view a.sc-segment.sc-middle-segment,.sc-theme .sc-segmented-view a.sc-segment.sc-last-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -839px;}.sc-theme .sc-segmented-view a.sc-segment.sc-middle-segment .sc-button-inner,.sc-theme .sc-segmented-view a.sc-segment.sc-first-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -864px;}.sc-theme .sc-segmented-view a.sc-segment.active.sc-last-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -939px;}.sc-theme .sc-segmented-view a.sc-segment.active.sc-first-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -913px;}.sc-theme .sc-segmented-view a.sc-segment.active label{background:url("images/sc-theme-repeat-x.png") repeat-x left -889px;text-shadow:#fff 0 1px 0;text-shadow:black 0 -1px 0;color:white;}.sc-theme .sc-segmented-view a.sc-segment.active.sc-middle-segment,.sc-theme .sc-segmented-view a.sc-segment.active.sc-last-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -964px;}.sc-theme .sc-segmented-view a.sc-segment.active.sc-middle-segment .sc-button-inner,.sc-theme .sc-segmented-view a.sc-segment.active.sc-first-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -989px;}.sc-theme .sc-segmented-view a.sc-segment.sc-last-segment.disabled .sc-button-inner,.sc-theme .sc-segmented-view.disabled a.sc-segment.sc-last-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -1064px;}.sc-theme .sc-segmented-view a.sc-segment.sc-first-segment.disabled,.sc-theme .sc-segmented-view.disabled a.sc-segment.sc-first-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -1038px;}.sc-theme .sc-segmented-view a.sc-segment.disabled label,.sc-theme .sc-segmented-view.disabled a.sc-segment label{background:url("images/sc-theme-repeat-x.png") repeat-x left -1014px;color:#999;text-shadow:none;}.sc-theme .sc-segmented-view a.sc-segment.sc-middle-segment.disabled,.sc-theme .sc-segmented-view a.sc-segment.sc-last-segment.disabled,.sc-theme .sc-segmented-view.disabled a.sc-segment.sc-middle-segment,.sc-theme .sc-segmented-view.disabled a.sc-segment.sc-last-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -1089px;}.sc-theme .sc-segmented-view a.sc-segment.sc-middle-segment.disabled .sc-button-inner,.sc-theme .sc-segmented-view a.sc-segment.sc-first-segment.disabled .sc-button-inner,.sc-theme .sc-segmented-view.disabled a.sc-segment.sc-middle-segment .sc-button-inner,.sc-theme .sc-segmented-view.disabled a.sc-segment.sc-first-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -1114px;}.sc-theme .sc-segmented-view a.sc-segment.sc-last-segment.sel .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -1190px;}.sc-theme .sc-segmented-view a.sc-segment.sc-first-segment.sel{background:url("images/sc-theme-repeat-x.png") no-repeat left -1164px;}.sc-theme .sc-segmented-view a.sc-segment.sel label{background:url("images/sc-theme-repeat-x.png") repeat-x left -1140px;text-shadow:black 0 -1px 0;color:white;}.sc-theme .sc-segmented-view a.sc-segment.sc-middle-segment.sel,.sc-theme .sc-segmented-view a.sc-segment.sc-last-segment.sel{background:url("images/sc-theme-repeat-x.png") no-repeat left -1215px;}.sc-theme .sc-segmented-view a.sc-segment.sc-middle-segment.sel .sc-button-inner,.sc-theme .sc-segmented-view a.sc-segment.sc-first-segment.sel .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -1240px;}.sc-theme .sc-segmented-view a.sc-segment.sel.sc-last-segment.disabled .sc-button-inner,.sc-theme .sc-segmented-view.disabled a.sc-segment.sel.sc-last-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -1442px;}.sc-theme .sc-segmented-view a.sc-segment.sel.sc-first-segment.disabled,.sc-theme .sc-segmented-view.disabled a.sc-segment.sel.sc-first-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -1416px;}.sc-theme .sc-segmented-view a.sc-segment.sel.disabled label,.sc-theme .sc-segmented-view.disabled a.sc-segment.sel label{background:url("images/sc-theme-repeat-x.png") repeat-x left -1392px;color:white;text-shadow:none;}.sc-theme .sc-segmented-view a.sc-segment.sel.sc-middle-segment.disabled,.sc-theme .sc-segmented-view a.sc-segment.sel.sc-last-segment.disabled,.sc-theme .sc-segmented-view.disabled a.sc-segment.sel.sc-middle-segment,.sc-theme .sc-segmented-view.disabled a.sc-segment.sel.sc-last-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -1467px;}.sc-theme .sc-segmented-view a.sc-segment.sel.sc-middle-segment.disabled .sc-button-inner,.sc-theme .sc-segmented-view a.sc-segment.sel.sc-first-segment.disabled .sc-button-inner,.sc-theme .sc-segmented-view.disabled a.sc-segment.sel.sc-middle-segment .sc-button-inner,.sc-theme .sc-segmented-view.disabled a.sc-segment.sel.sc-first-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -1492px;}.sc-theme .sc-segmented-view a.sc-segment.active.sel.sc-last-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -1316px;}.sc-theme .sc-segmented-view a.sc-segment.active.sel.sc-first-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -1290px;}.sc-theme .sc-segmented-view a.sc-segment.active.sel label{background:url("images/sc-theme-repeat-x.png") repeat-x left -1266px;text-shadow:black 0 -1px 0;color:white;}.sc-theme .sc-segmented-view a.sc-segment.active.sel.sc-middle-segment,.sc-theme .sc-segmented-view a.sc-segment.active.sel.sc-last-segment{background:url("images/sc-theme-repeat-x.png") no-repeat left -1341px;}.sc-theme .sc-segmented-view a.sc-segment.active.sel.sc-middle-segment .sc-button-inner,.sc-theme .sc-segmented-view a.sc-segment.active.sel.sc-first-segment .sc-button-inner{background:url("images/sc-theme-repeat-x.png") no-repeat right -1366px;}.sc-theme .sc-slider-view.sc-regular-size{height:21px;}.sc-theme .sc-slider-view .sc-inner{display:block;position:absolute;left:8px;right:12px;height:8px;top:5px;background:url("images/sc-theme-repeat-x.png") no-repeat left -170px;border:none;}.sc-theme .sc-slider-view .sc-inner .sc-leftcap{display:block;position:absolute;left:7px;right:1px;top:0;bottom:0;background:url("images/sc-theme-repeat-x.png") repeat-x left -179px;}.sc-theme .sc-slider-view .sc-inner .sc-rightcap{display:block;position:absolute;right:0;margin-right:-6px;width:7px;top:0;bottom:0;background:url("images/sc-theme-repeat-x.png") no-repeat right -188px;}.sc-theme.focus .sc-slider-view.disabled .sc-inner,.sc-theme.blur .sc-slider-view .sc-inner{background:url("images/sc-theme-repeat-x.png") no-repeat left -251px;border:none;}.sc-theme.focus .sc-slider-view.disabled .sc-inner .sc-leftcap,.sc-theme.blur .sc-slider-view .sc-inner .sc-leftcap{background:url("images/sc-theme-repeat-x.png") repeat-x left -260px;}.sc-theme.focus .sc-slider-view.disabled .sc-inner .sc-rightcap,.sc-theme.blur .sc-slider-view .sc-inner .sc-rightcap{background:url("images/sc-theme-repeat-x.png") no-repeat right -269px;}.sc-theme .sc-slider-view .sc-handle{height:21px;width:21px;margin-left:-6px;top:-5px;position:absolute;background:url("images/sc-theme-repeat-x.png") no-repeat -25px -333px;}.sc-theme .sc-slider-view.active .sc-handle{background-position:-2px -410px;}.sc-theme.blur .sc-slider-view .sc-handle,.sc-theme.focus .sc-slider-view.disabled .sc-handle{background-position:-2px -333px;}.sc-theme.focus .sc-slider-view.active .sc-handle{background-position:-2px -410px;}.sc-theme .sc-horizontal .sc-split-divider-view{background:url("images/sc-theme-ysprite.png") repeat-y 0 top;}.sc-theme .sc-vertical .sc-split-divider-view{background:url("images/sc-theme-repeat-x.png") repeat-x 0 -1397px;}.sc-theme .sc-tab-view>.sc-container-view{border:1px #333 solid;border-radius:5px;-webkit-border-radius:5px;background-color:#8991a2;background-color:rgba(205,205,205,0.25);overflow:hidden;}.sc-theme .sc-tab-view .sc-tab-view{background-color:transparent;}.sc-theme .sc-table-header{background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e6e6e6));-webkit-background-clip:content-box;font-size:11px;font-weight:bold;color:#666;line-height:18px;}.sc-theme .sc-table-header-sort-active{background:#eee;}.sc-theme .sc-toolbar-view{background:url("images/sc-theme-repeat-x.png") repeat-x 0 -650px;border:none;border-top:1px solid #4d5567;-webkit-box-shadow:0 -1px 2px rgba(0,0,0,0.3);-moz-box-shadow:0 -1px 2px rgba(0,0,0,0.3);}.sc-theme .sc-well-view .top-right-edge{background:url("images/sc-theme-repeat-x.png") no-repeat right -1646px;}.sc-theme .sc-well-view .top-left-edge{background:url("images/sc-theme-repeat-x.png") no-repeat left -1646px;}.sc-theme .sc-well-view .bottom-left-edge{background:url("images/sc-theme-repeat-x.png") no-repeat left -1657px;}.sc-theme .sc-well-view .bottom-right-edge{background:url("images/sc-theme-repeat-x.png") no-repeat right -1657px;}.sc-theme .sc-well-view .top-edge{background:url("images/sc-theme-repeat-x.png") repeat-x right -1668px;}.sc-theme .sc-well-view .bottom-edge{background:url("images/sc-theme-repeat-x.png") repeat-x right -1680px;}.sc-theme .sc-well-view .left-edge{background:url("images/sc-theme-ysprite.png") repeat-y -16px top;}.sc-theme .sc-well-view .right-edge{background:url("images/sc-theme-ysprite.png") repeat-y -28px top;}.sc-theme .sc-well-view .content-background{background:#57647f;opacity:.4;}#testresult{position:absolute;top:19px;right:10px;text-align:right;font-weight:bold;}.core-test{font:12px/16px "Helvetica",Verdana,Arial,sans-serif;margin:0;padding:0;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#f0f0f0;overflow:auto;}.core-test .useragent{border-bottom:1px solid #000;font:10pt "Helvetica",Verdana,Arial,sans-serif;height:15px;}.core-test .testresult{background:#eee;border-bottom:1px solid #bbb;font-weight:bold;margin:0;padding:6px;text-align:right;position:relative;}.testresult label.hide-passed{position:absolute;display:block;margin:0;padding:0;left:20px;height:14px;top:50%;margin-top:-8px;}.testresult label.hide-passed.disabled{color:#aaa;}.testresult em{display:block;font-weight:normal;font-style:normal;}.testresult em span{border:1px solid #666;display:inline-block;font-weight:bold;padding:2px 4px;}.core-test tbody th{text-align:left;min-width:300px;}.core-test .detail{padding:20px;}.core-test table{background:#000;border-spacing:1px;width:100%;}.core-test .hide-clean tr.clean{display:none;}.core-test table td,.core-test table th{background:#fff;padding:4px;}.core-test tbody td{text-align:center;padding:8px;}.core-test th em{display:block;font-weight:normal;font-size:10px;font-style:normal;}.core-test thead th:first-child{text-align:left;}.core-test .warnings{background:#E49723;}.core-test .passed{background:#80D175;}.core-test .failed{background:#ea4d44;}.core-test .errors{background:red;color:#fff;}.core-test tr.test th{background:#454545;color:#fff;font-size:12px;padding:2px 4px;text-align:right;}.core-test td.desc,.core-test th.desc{text-align:left;width:90%;}#qunit,#qunit div,#qunit h1{font-family:'Helvetica Neue','Helvetica','Arial',verdana,sans-serif;margin:0;padding:0;}#qunit{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;font-size:10pt;}#qunit h1{padding:15px;font-size:large;background-color:#06b;color:white;}#qunit h1 a{color:white;}#qunit h2{padding:10px;background-color:#eee;color:black;margin:0;font-size:small;font-weight:normal;}#qunit .pass{color:green;}#qunit .fail{color:red;}#qunit p.result{margin-left:1em;}#qunit #banner{height:2em;border-bottom:1px solid white;}#qunit h2.pass{background-color:green;}#qunit h2.fail{background-color:red;}#qunit div.testrunner-toolbar{background:#eee;border-top:1px solid black;padding:10px;}#qunit ol#tests>li>strong{cursor:pointer;}#qunit div#fx-tests h4{background:red;}#qunit div#fx-tests h4.pass{background:green;}#qunit div#fx-tests div.box{background:red url(data/cow.jpg) no-repeat;overflow:hidden;border:2px solid #000;}#qunit div#fx-tests div.overflow{overflow:visible;}#qunit div.inline{display:inline;}#qunit div.autoheight{height:auto;}#qunit div.autowidth{width:auto;}#qunit div.autoopacity{opacity:auto;}#qunit div.largewidth{width:100px;}#qunit div.largeheight{height:100px;}#qunit div.largeopacity{filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);}#qunit div.medwidth{width:50px;}#qunit div.medheight{height:50px;}#qunit div.medopacity{opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";-moz-opacity:.5;}#qunit div.nowidth{width:0;}#qunit div.noheight{height:0;}#qunit div.noopacity{opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";-moz-opacity:0;}#qunit div.hidden{display:none;}div#fx-tests div.widewidth{background-repeat:repeat-x;}div#fx-tests div.wideheight{background-repeat:repeat-y;}div#fx-tests div.widewidth.wideheight{background-repeat:repeat;}div#fx-tests div.noback{background-image:none;}div.chain,div.chain div{width:100px;height:20px;position:relative;float:left;}div.chain div{position:absolute;top:0;left:0;}div.chain.test{background:red;}div.chain.test div{background:green;}div.chain.out{background:green;}div.chain.out div{background:red;display:none;}div#show-tests *{display:none;} \ No newline at end of file +.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;}body.sc-theme{background:#706f63;}.bespin-screen{font-family:'Lucida Grande','Lucida Sans Unicode',Lucida,Arial,Helvetica,sans-serif;background:transparent;padding:0;color:rgba(218,212,186,1);font-size:14px;line-height:1.8em;}.bespin-screen.sc-pane{color:rgba(255,255,255,1);text-shadow:1px 1px rgba(0,0,0,0.4);-moz-transition-property:all;-moz-transition-duration:.5s;-webkit-transition-property:all;-webkit-transition-duration:.5s;}.bespin-screen.sc-pane a{color:rgba(255,255,255,1);}.bespin-screen .sc-button-view{background:transparent -moz-linear-gradient(top,rgba(62,108,185,1),rgba(56,50,146,1));background:transparent -webkit-gradient(linear,50% 0,50% 100%,from(rgba(62,108,185,1)),to(rgba(56,50,146,1)));font-size:14px;text-shadow:1px 1px rgba(0,0,0,0.4);border:1px solid rgba(37,34,91,1);-moz-border-radius:.25em;-webkit-border-radius:.25em;-moz-box-shadow:inset rgba(255,255,255,0.2) 0 1px 0,inset rgba(0,0,0,0.2) 0 -1px 0,rgba(0,0,0,0.1) 0 1px 2px;-webkit-box-shadow:inset rgba(255,255,255,0.2) 0 1px 0,inset rgba(0,0,0,0.2) 0 -1px 0,rgba(0,0,0,0.1) 0 1px 2px;box-shadow:inset rgba(255,255,255,0.2) 0 1px 0,inset rgba(0,0,0,0.2) 0 -1px 0,rgba(0,0,0,0.1) 0 1px 2px;}.bespin-screen .sc-button-inner{margin:8px 12px;}.bespin-screen .bespin-color-field{background:transparent url(resources/screen_theme/images/lines.png) no-repeat top right #45443c;border-top:1px solid rgba(255,255,255,0.1);border-left:1px solid rgba(0,0,0,0.1);border-right:1px solid rgba(0,0,0,0.1);border-bottom:2px solid rgba(0,0,0,0.1);background-color:rgba(69,68,60,1);overflow:visible;-moz-border-radius:.5em;-webkit-border-radius:.5em;-moz-box-shadow:rgba(0,0,0,0.1) 0 1px 2px;-webkit-box-shadow:rgba(0,0,0,0.1) 0 1px 2px;}.bespin-screen .title{font-family:'DroidSans';text-transform:uppercase;color:rgba(218,212,186,1);text-align:center;}.bespin-screen .arrow{vertical-align:middle;}.bespin-screen .sc-text-field-view{overflow:visible;}.bespin-screen .sc-text-field-view .padding{display:block;position:absolute;left:0;top:0;bottom:0;right:0;overflow:visible;}.bespin-screen .sc-text-field-view input{display:block;position:absolute;left:0;top:0;width:190px;height:14px;border:0;padding:4px;color:rgba(225,180,31,1);background:rgba(0,0,0,0.2);border:1px solid rgba(0,0,0,0.2);font-size:8pt;-moz-border-radius:.25em;-webkit-border-radius:.25em;box-shadow:rgba(255,255,255,0.3) 0 0 2px,inset rgba(0,0,0,0.3) 0 0 4px;-moz-box-shadow:rgba(255,255,255,0.3) 0 0 2px,inset rgba(0,0,0,0.3) 0 0 4px;-webkit-box-shadow:rgba(255,255,255,0.3) 0 0 2px,inset rgba(0,0,0,0.3) 0 0 4px;}.bespin-screen .sc-text-field-view input:focus,.bespin-screen .sc-button-view.active{color:rgba(255,150,0,1);border:1px solid rgba(225,180,31,1);outline:none;box-shadow:rgba(255,150,0,0.6) 0 0 2px,inset rgba(255,150,0,0.3) 0 0 6px;-moz-box-shadow:rgba(255,150,0,0.6) 0 0 2px,inset rgba(255,150,0,0.3) 0 0 6px;-webkit-box-shadow:rgba(255,150,0,0.6) 0 0 2px,inset rgba(255,150,0,0.3) 0 0 6px;}.bespin-screen textarea{border:0;padding:4px;width:100%;height:100%;color:rgba(225,180,31,1);background:rgba(0,0,0,0.2);border:1px solid rgba(0,0,0,0.2);-moz-border-radius:.25em;-webkit-border-radius:.25em;-moz-box-shadow:rgba(255,255,255,0.3) 0 0 2px,inset rgba(0,0,0,0.3) 0 0 4px;-webkit-box-shadow:rgba(255,255,255,0.3) 0 0 2px,inset rgba(0,0,0,0.3) 0 0 4px;}.bespin-screen textarea:focus{color:rgba(255,150,0,1);border:1px solid rgba(225,180,31,1);-moz-box-shadow:rgba(255,150,0,0.6) 0 0 2px,inset rgba(255,150,0,0.3) 0 0 6px;-webkit-box-shadow:rgba(255,150,0,0.6) 0 0 2px,inset rgba(255,150,0,0.3) 0 0 6px;}.bespin-screen .button{width:200px;}.bespin-screen .sc-radio-view{line-height:24px;}.bespin-screen .sc-radio-button input{height:1px;width:1px;opacity:0;}.bespin-screen .sc-radio-button{position:relative;margin:0 0 6px 0;height:24px;font-size:11pt;}.bespin-screen .sc-radio-button .button{display:block;position:absolute;top:0;left:0;width:24px;height:24px;background-image:url(resources/screen_theme/images/radio-unselected.png);background-repeat:no-repeat;}.bespin-screen .sc-radio-button .sc-button-label{display:block;position:absolute;top:0;left:27px;}.bespin-screen .sc-radio-button.sel .button,.bespin-screen .sc-radio-button.active .button{background-image:url(resources/screen_theme/images/radio-selected.png);}.bespin-screen .bespin-form{position:absolute;background:transparent url(resources/screen_theme/images/lines.png) no-repeat top right;color:rgba(255,255,255,1);border:solid 2px rgba(255,255,255,0.1);-moz-border-radius:.5em;-webkit-border-radius:.5em;-moz-border-top-colors:rgba(0,0,0,0.2) rgba(255,255,255,0.1);-moz-border-right-colors:rgba(0,0,0,0.2) rgba(255,255,255,0.1);-moz-border-left-colors:rgba(0,0,0,0.2) rgba(255,255,255,0.1);-moz-border-bottom-colors:rgba(0,0,0,0.2) rgba(255,255,255,0.1);-moz-transition-property:height;-moz-transition-duration:.5s;-webkit-transition-property:height;-webkit-transition-duration:.5s;}.bespin-screen .sc-huge-size{font-family:MuseoSans,Helvetica;font-size:29pt;letter-spacing:-1.25px;line-height:1;text-shadow:1px 1px rgba(0,0,0,0.4);}.bespin-screen .bespin-informational.sc-regular-size{font-family:Arial,Lucida,Helvetica,sans-serif;font-size:14px;color:#dad4ba;line-height:24px;text-shadow:1px 1px rgba(0,0,0,0.4);}.bespin-logo{background-image:url(resources/screen_theme/images/bespin-s.png);}.bespin-screen .sc-text-field-view.cmd_input{border:none;background:transparent;}.bespin-screen .sc-text-field-view.cmd_input input{border:none;margin-top:3px;margin-left:4px;height:18px;padding:0;-moz-box-shadow:none;}.bespin-screen .sc-button-view.cmd_prompt,.bespin-screen .sc-button-view.sc-pin-view{border:none;background:transparent;-moz-box-shadow:none;}.bespin-screen .sc-button-view.cmd_prompt .sc-button-inner,.bespin-screen .sc-button-view.sc-pin-view .sc-button-inner{border:none;background:transparent;margin:0;}.bespin-screen .sc-scroller-view.controls-hidden{display:none;}.bespin-screen .sc-scroller-view .track,.bespin-screen .sc-scroller-view .thumb,.bespin-screen .sc-scroller-view .button-bottom,.bespin-screen .sc-scroller-view .button-top{position:absolute;}.bespin-screen .sc-scroller-view:hover .track{background-color:rgba(50,50,50,0.8);border:solid #969696 1px;}.bespin-screen .sc-scroller-view .thumb,.bespin-screen .sc-scroller-view .button-bottom,.bespin-screen .sc-scroller-view .button-top{border:solid #969696 1px;-moz-border-radius:12px;-webkit-border-radius:12px;opacity:.3;}.bespin-screen .sc-scroller-view:hover .thumb,.bespin-screen .sc-scroller-view:hover .button-bottom,.bespin-screen .sc-scroller-view:hover .button-top{opacity:1.0;}.bespin-screen .sc-scroller-view .thumb{background-color:black;-moz-border-radius:12px;-webkit-border-radius:12px;}.bespin-screen .sc-scroller-view .button-bottom,.bespin-screen .sc-scroller-view .button-top{background-color:#646464;opacity:.3;}.bespin-screen .sc-scroller-view.sc-vertical .track{left:0;right:0;top:15px;bottom:15px;}.bespin-screen .sc-scroller-view.sc-horizontal .track{left:15px;right:15px;top:0;bottom:0;}.bespin-screen .sc-scroller-view.sc-vertical .thumb{left:0;right:0;}.bespin-screen .sc-scroller-view.sc-horizontal .thumb{top:0;bottom:0;}.bespin-screen .sc-scroller-view.sc-vertical .button-bottom,.bespin-screen .sc-scroller-view.sc-vertical .button-top{left:1px;right:1px;height:13px;}.bespin-screen .sc-scroller-view.sc-horizontal .button-bottom,.bespin-screen .sc-scroller-view.sc-horizontal .button-top{top:1px;bottom:1px;width:13px;}.bespin-screen .sc-scroller-view.sc-vertical .button-bottom{bottom:7px;background:url(resources/screen_theme/images/scroll-down.png) no-repeat center center #646464;}.bespin-screen .sc-scroller-view.sc-horizontal .button-bottom{right:7px;background:url(resources/screen_theme/images/scroll-right.png) no-repeat center center #646464;}.bespin-screen .sc-scroller-view.sc-vertical .button-top{top:7px;background:url(resources/screen_theme/images/scroll-up.png) no-repeat center center #646464;}.bespin-screen .sc-scroller-view.sc-horizontal .button-top{left:7px;background:url(resources/screen_theme/images/scroll-left.png) no-repeat center center #646464;}.bespin-screen .disabled{opacity:.3;}.sc-view .text_editor{cursor:text;} \ No newline at end of file diff --git a/ubiquity/chrome/content/BespinEmbedded.compressed.js b/ubiquity/chrome/content/BespinEmbedded.compressed.js index 7e151c85..27229a89 100644 --- a/ubiquity/chrome/content/BespinEmbedded.compressed.js +++ b/ubiquity/chrome/content/BespinEmbedded.compressed.js @@ -5,67 +5,65 @@ SC.setupBodyClassNames=function(){var a=document.body;if(a){var b,c,d,e,f;b=SC.b 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/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js",id:"tiki:en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js"}]}); -tiki.module("tiki:index",function(a,b){function c(x,B,F){var y=B.length;x=x||{};var p,s,z;for(F=F;F=0;)B[F]=x[F];return B};b.typeOf=function(x){if(x===undefined)return"undefined";if(x===null)return"null";var B=typeof x;if(B=="object")B=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(B==="function")B=x.isClass?"class":"function";return B};var j="_tk_guid_"+(new Date).getTime(),l=0,k=[],m=[],n=function(x){var B="tk"+l++;if(x)x[j]=B;return B};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 k[x]= -k[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(){},r=o.prototype,u=function(x){var B;if("object"!==typeof x)return x;o.prototype=x;B=new o;o.prototype=r;return c(B,arguments,1)};b.beget=u;var q=function(x){var B;if(B=this.init)B.apply(this,x)};b.extend=function(x){var B=d(),F;if("function"===typeof x){F=B.prototype=u(x.prototype);if(!F.__init)F.__init=q;c(F,arguments,1)}else F= -B.prototype=c({__init:q},arguments,0);return F.constructor=B};var t=function(x,B){g[0]=B;var F;for(F in x)if(x.hasOwnProperty(F)){B=x[F];if("function"===typeof B){g[1]=F;B.displayName=g.join(".")}}g.length=0;return x};b.setupDisplayNames=t;t(b,"tiki");b.Retainable=a("retainable");b.Invocation=a("invocation");b.Promise=a("promise");var w=a("invocation"),v,A;v=function(x,B){e(v,"isReady","queue",x,B,arguments)};b.ready=v;v.main=function(x,B){e(v,"isReady","mqueue",x,B,arguments)};v.isReady=false;v.fire= -function(){if(!v.isReady){v.isReady=true;if(a.loader)a.loader.isReady=true;v.cleanup&&v.cleanup();v.cleanup=null;f(v,"queue");f(v,"mqueue");var x=a.loader?a.loader.nextReady:null;x&&x!==v&&x.fire()}};v.fire.displayName="ready.fire()";v.schedule=function(){};if("undefined"!==typeof document)if(document.addEventListener){v.cleanup=function(){document.removeEventListener("DOMContentLoaded",v.fire,false);document.removeEventListener("load",v.fire,false)};document.addEventListener("DOMContentLoaded",v.fire, -false);document.addEventListener("load",v.fire,false)}else if(document.attachEvent){v.cleanup=function(){document.detachEvent("onreadystatechange",v.fire);document.detachEvent("onload",v.fire);v.ieHandler=null};document.attachEvent("onreadystatechange",v.fire);document.attachEvent("onload",v.fire);if(document.documentElement.doScroll&&window==window.top){v.ieHandler=function(){if(v.ieHandler&&!v.isReady)try{document.documentElement.doScroll("left")}catch(x){setTimeout(v.ieHandler,0);return}v.fire()}; -v.ieHandler()}}if(a.loader&&a.loader.previousLoader){if(a.loader.previousLoader.isReady)v.fire();else a.loader.previousLoader.nextReady=v;a.loader.previousLoder=null}A=function(x,B){e(A,"isUnloading","queue",x,B,arguments)};b.unload=A;A.isUnloading=false;A.fire=function(){if(!A.isUnloading){A.isUnloading=true;A.cleanup&&A.cleanup();A.cleanup=null;var x=A.queue,B=x?x.length:0,F,y;for(F=0;Fk?f.call(l,k):null;this.recycled++;this.inPool=this.isDestroyed=false;this.target=h;this.method=j;this.args=l;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,l,k){return g.length>0?g.pop().init(h,j,l,k):new e(h,j,l,k)};e.invoke=function(h,j,l,k,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(k!==undefined&&l)l=l.length>k?f.call(l,k):null;if(m&&m.length>0)l=l?l.concat(m):m;return l?j.apply(h,l):j.call(h)};b=c.exports=e;b.Invocation=e}); -tiki.module("tiki:loader",function(a,b,c,d){function e(q,t){n[0]=q;n[1]=t;return n.join("::")}function f(q){var t=r[q];if(t)return t;return r[q]="tiki/"+q}function g(q,t){var w=u[q],v;w||(w=u[q]={});(v=w[t])||(v=w[t]=q+":"+t);return v}var h=a("promise"),j=a("sandbox"),l,k=["(function(require, exports, module, tiki) {",null,"\n});\n//@ sourceURL=",null,"\n"],m={},n=[],o=Object.keys;o||(o=function(q){var t,w=[];for(t in q)q.hasOwnProperty(t)&&w.push(t);return w});var r={},u={};l=function(q,t,w){this.id= -q;this.scripts=[];this.packages=[];this.stylesheets=[];this.modules=[];this.ENV=w;this.sandbox=j.create(q,this);this.register("default",{});this.register("tiki",{});q=t?t.length:0;var v;for(w=0;w=0){w=q.slice(0,A); -q=q.slice(A+1);t=[]}else if(q.match(/^\.\.?\//)){if(!t)throw"base required to resolve relative: "+q;A=t.indexOf(":");w||(w=t.slice(0,A));if(A>=0)t=t.slice(A+1);t=t.split("/");t.pop()}else t=[];B=q.split("/");v=B.length;for(A=0;A0)return this.module(q,t);var w=this._catalog,v;if(!w)w=this._catalog={};if(t=(w[q]=t)?t.packages:null)for(v in t)!t.hasOwnProperty(v)||w[v]||(w[v]=t[v]);this._resolved("catalog",q)||this.packages.push(q);this._promiseFor("catalog",q).resolve(q)},script:function(q){this._resolved("scripts",q)||this.scripts.push(q);this._promiseFor("scripts",q).resolve(q); -return this},stylesheet:function(q){this._resolved("stylesheets",q)||this.stylesheets.push(q);this._promiseFor("stylesheets",q).resolve(q);return this},module:function(q,t){var w=this._factories;if(!w)w=this._factories={};w[q]=t;this._resolved("modules",q)||this.modules.push(q);this._promiseFor("modules",q).resolve(q)},async:function(q){return this._async(q,null)},_async:function(q,t){var w=this._promiseFor("loads",q);if(w.isPending)if(this.ready(q))w.resolve();else{var v=this;w.action(function(A){v._promiseFor("catalog", -q).then(A,function(){v._loadPackage(q,A,t||{});A.resolve()},function(x){A.cancel(x)});v._loadPackage(q,A,t||{})}).run()}return w},require:function(q,t){return this.sandbox.require(q,t)},ready:function(q){return this._ready(q,null)},_ready:function(q,t){if(t)if(t[q])return true;else t[q]=true;var w,v,A,x,B;w=q.indexOf(":");w=w>=0?q.slice(0,w):q;if(!this._resolved("catalog",w))return false;v=this._catalog[w];for(x=(A=v.depends)?A.length:0;--x>=0;){t||(t={});B=A[x];if(!this._ready(B,t)){this.logLoadFailures&& -console.log("Can't load ",q," - Dependency is not loaded: ",B);return false}}for(x=(A=v.stylesheets)?A.length:0;--x>=0;){t=A[x];if("string"!==typeof t)t=t.id;if(!this._resolved("stylesheets",t)){this.logLoadFailures&&console.log("Can't load ",q," - Stylesheet is not loaded: ",t);return false}}for(x=(A=v.scripts)?A.length:0;--x>=0;){t=A[x];if("string"!==typeof t)t=t.id;if(!this._resolved("scripts",t)){this.logLoadFailures&&console.log("Can't load ",q," - Script is not loaded: ",t);return false}}if(q!== -w)if(!this._resolved("modules",q)){this.logLoadFailures&&console.log("Can't load ",q," - Module is not loaded: ",q);return false}return true},main:function(q,t){var w=this.require("index","tiki").ready;if(!w)throw"cannot register main because system.ready does not exist";w.main(this,function(){this.async(q).then(this,function(){this.require(q)[t]()})});return this},_loadScript:function(q){var t,w;if("string"!==typeof q){t=q.id;w=q.url}else t=w=q;q=this._promiseFor("scripts",t);q.isPending&&q.action(function(){var v= -document.body,A;v||promise.cancel("no document to append script");A=document.createElement("script");A.setAttribute("src",w);v.appendChild(A)});return q},_loadStylesheet:function(q){var t,w;if("string"!==typeof q){t=q.id;w=q.url}else t=w=q;q=this._promiseFor("stylesheets",t);if(q.isPending){var v=this;q.action(function(A){var x=document.body;x||A.cancel("no document to append stylesheet");A=document.createElement("link");A.setAttribute("rel","stylesheet");A.setAttribute("href",w);x.appendChild(A); -v.stylesheet(t)})}return q},_loadPackage:function(q,t,w){if(w)if(w[q]){console.warn("detected cyclical reference to "+q+" seen="+o(w).join(", "));return}else w[q]=true;var v=this._catalog?this._catalog[q]:null,A,x,B,F;if(!v)return this;x=(A=v.depends)?A.length:0;for(F=h.create(e("load-package",q));--x>=0;){q=A[x];q!=="tiki"&&F.depends(this._async(q,w))}t.depends(F);F.resolve();x=(A=v.scripts)?A.length:0;B=null;for(w=v.ordered!==false;--x>=0;){q=this._loadScript(A[x]);t.depends(q);if(w)B&&q.then(B, -B.run,B.cancel);else q.run();B=q}B&&w&&F.then(B,B.run,B.cancel);x=(A=v.stylesheets)?A.length:0;for(B=null;--x>=0;){q=this._loadStylesheet(A[x]);t.depends(q);B&&q.then(B,B.run,B.cancel);B=q}B&&F.then(B,B.run,B.cancel)},_promiseFor:function(q,t,w){var v=this._promises,A;if(!v)v=this._promises={};(A=v[q])||(A=v[q]={});if(w===undefined){v=A;w=t}else(v=A[t])||(v=A[t]={});(A=v[w])||(A=v[w]=h.create(e(q,t)));return A},_discoveredStylesheets:false,discoverStylesheets:function(){this._discoveredStylesheets= -true;if("undefined"===typeof document)return this;for(var q=document.getElementsByTagName("link"),t=q?q.length:0,w,v;--t>=0;){w=q[t];if(!(!w||w.rel!=="stylesheet")){(v=w.getAttribute("loadid")||w.getAttribute("LOADID"))&&this.stylesheet(v.toString());(v=w.href)&&this.stylesheet(v.toString())}}return this},_resolved:function(q,t,w){q==="stylesheets"&&!this._discoveredStylesheets&&this.discoverStylesheets();var v=this._promises;if(v)v=v[q];if(v)v=v[t];if(v&&w)v=v[w];return v?v.isResolved:false},_inspectLoader:function(){var q= -[],t,w;q.push("Loader:");if(this.packages.length>0){q.push(" packages: "+this.packages.join(","));q.push("")}if(this.scripts.length>0){q.push(" scripts:");t=this.scripts.length;for(w=0;w0){q.push(" stylesheets:");t=this.scripts.length;for(w=0;w0){q.push(" modules: ");t=this.modules.length;for(w=0;w0){x=[];for(q=0;q0){t.push("\n scripts:");for(q=0;q0){t.push("\n stylesheets:");for(q= -0;q"}};d.setupDisplayNames(l.prototype,"Loader");l.setup=function(q,t){if(q&&!q.isBootstrap)return q;t=new l(q?q.id:"default",q?q.queue:null,t);(t.previousLoader= -q)&&q.destroy&&q.destroy();return t};b=c.exports=l;b.Loader=l;b.setup=l.setup}); -tiki.module("tiki:promise",function(a,b,c,d){function e(j,l,k){j=d.guidFor(j)+":"+j.id+"."+l+"() dep="+j.holds+" status="+h[j._status]+" handlers="+(j._handlers?j._handlers.length:"null");if(k)j+=" pr="+k.toString();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,l,k,m){var n=typeof j,o=this.values;if(arguments.length<4&&("function"===n||"string"===n)){m=k;k=l;l=j;j=this}n=f.create();switch(this._status){case 16386:if(l)o=l.call(j,this.value,this);n.resolve(o);break;case 16388:if(k)o=k.call(j,this.value,this);n.cancel(o);break;default:n.__resolved=l;n.__cancel=k;n.__progress=m;n.__target=j;if(!this._handlers)this._handlers=[];this._handlers.push(n)}return n},_invoke:function(j,l,k){var m=this._handlers,n=m?m.length: -0,o,r,u;if(n<=0)return this;for(o=0;o=0;)D[K]=y[K];return D};b.typeOf=function(y){if(y===undefined)return"undefined";if(y===null)return"null";var D=typeof y;if(D=="object")D=h(y)?"array":y instanceof Function?y.isClass?"class":"function":y instanceof Error||y.isError?"error":y.isObject?"object":y.isClass? +"class":y.constructor===Object?"hash":y.constructor===Number?"number":y.constructor===String?"string":"object";else if(D==="function")D=y.isClass?"class":"function";return D};var j="_tk_guid_"+(new Date).getTime(),k=0,l=[],m=[],n=function(y){var D="tk"+k++;if(y)y[j]=D;return D};b.generateGuid=n;b.guidFor=function(y){if(y===undefined)return"(undefined)";if(y===null)return"(null)";if(y===Object)return"(Object)";if(y===Array)return"(Array)";if(y[j])return y[j];switch(typeof y){case "number":return l[y]= +l[y]||"nu"+y;case "string":return m[y]=m[y]||"st"+y;case "boolean":return y?"(true)":"(false)";default:return n(y)}};b.mixin=function(y){return c(y,arguments,1)};var o=function(){},r=o.prototype,u=function(y){var D;if("object"!==typeof y)return y;o.prototype=y;D=new o;o.prototype=r;return c(D,arguments,1)};b.beget=u;var q=function(y){var D;if(D=this.init)D.apply(this,y)};b.extend=function(y){var D=d(),K;if("function"===typeof y){K=D.prototype=u(y.prototype);if(!K.__init)K.__init=q;c(K,arguments,1)}else K= +D.prototype=c({__init:q},arguments,0);return K.constructor=D};var s=function(y,D){g[0]=D;var K;for(K in y)if(y.hasOwnProperty(K)){D=y[K];if("function"===typeof D){g[1]=K;D.displayName=g.join(".")}}g.length=0;return y};b.setupDisplayNames=s;s(b,"tiki");b.Retainable=a("retainable");b.Invocation=a("invocation");b.Promise=a("promise");var w=a("invocation"),v,x;v=function(y,D){e(v,"isReady","queue",y,D,arguments)};b.ready=v;v.main=function(y,D){e(v,"isReady","mqueue",y,D,arguments)};v.isReady=false;v.fire= +function(){if(!v.isReady){v.isReady=true;if(a.loader)a.loader.isReady=true;v.cleanup&&v.cleanup();v.cleanup=null;f(v,"queue");f(v,"mqueue");var y=a.loader?a.loader.nextReady:null;y&&y!==v&&y.fire()}};v.fire.displayName="ready.fire()";v.schedule=function(){};if("undefined"!==typeof document)if(document.addEventListener){v.cleanup=function(){document.removeEventListener("DOMContentLoaded",v.fire,false);document.removeEventListener("load",v.fire,false)};document.addEventListener("DOMContentLoaded",v.fire, +false);document.addEventListener("load",v.fire,false)}else if(document.attachEvent){v.cleanup=function(){document.detachEvent("onreadystatechange",v.fire);document.detachEvent("onload",v.fire);v.ieHandler=null};document.attachEvent("onreadystatechange",v.fire);document.attachEvent("onload",v.fire);if(document.documentElement.doScroll&&window==window.top){v.ieHandler=function(){if(v.ieHandler&&!v.isReady)try{document.documentElement.doScroll("left")}catch(y){setTimeout(v.ieHandler,0);return}v.fire()}; +v.ieHandler()}}if(a.loader&&a.loader.previousLoader){if(a.loader.previousLoader.isReady)v.fire();else a.loader.previousLoader.nextReady=v;a.loader.previousLoder=null}x=function(y,D){e(x,"isUnloading","queue",y,D,arguments)};b.unload=x;x.isUnloading=false;x.fire=function(){if(!x.isUnloading){x.isUnloading=true;x.cleanup&&x.cleanup();x.cleanup=null;var y=x.queue,D=y?y.length:0,K,z;for(K=0;Kl?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(q,s){n[0]=q;n[1]=s;return n.join("::")}function f(q){var s=r[q];if(s)return s;return r[q]="tiki/"+q}function g(q,s){var w=u[q],v;w||(w=u[q]={});(v=w[s])||(v=w[s]=q+":"+s);return v}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(q){var s,w=[];for(s in q)q.hasOwnProperty(s)&&w.push(s);return w});var r={},u={};k=function(q,s,w){this.id= +q;this.scripts=[];this.packages=[];this.stylesheets=[];this.modules=[];this.ENV=w;this.sandbox=j.create(q,this);this.register("default",{});this.register("tiki",{});q=s?s.length:0;var v;for(w=0;w=0){w=q.slice(0,x);q=q.slice(x+1);s=[]}else if(q.match(/^\.\.?\//)){if(!s)throw"base required to resolve relative: "+ +q;x=s.indexOf(":");w||(w=s.slice(0,x));if(x>=0)s=s.slice(x+1);s=s.split("/");s.pop()}else s=[];D=q.split("/");v=D.length;for(x=0;x0)return this.module(q,s);var w=this._catalog,v;if(!w)w=this._catalog={};if(s=(w[q]=s)?s.packages:null)for(v in s)!s.hasOwnProperty(v)||w[v]||(w[v]=s[v]);this._resolved("catalog",q)||this.packages.push(q);this._promiseFor("catalog",q).resolve(q)},script:function(q){this._resolved("scripts",q)||this.scripts.push(q);this._promiseFor("scripts",q).resolve(q);return this},stylesheet:function(q){this._resolved("stylesheets",q)||this.stylesheets.push(q); +this._promiseFor("stylesheets",q).resolve(q);return this},module:function(q,s){var w=this._factories;if(!w)w=this._factories={};w[q]=s;this._resolved("modules",q)||this.modules.push(q);this._promiseFor("modules",q).resolve(q)},async:function(q){return this._async(q,null)},_async:function(q,s){var w=this._promiseFor("loads",q);if(w.isPending)if(this.ready(q))w.resolve();else{var v=this;w.action(function(x){v._promiseFor("catalog",q).then(x,function(){v._loadPackage(q,x,s||{});x.resolve()},function(y){x.cancel(y)}); +v._loadPackage(q,x,s||{})}).run()}return w},require:function(q,s){return this.sandbox.require(q,s)},ready:function(q){return this._ready(q,null)},_ready:function(q,s){if(s)if(s[q])return true;else s[q]=true;var w,v,x,y,D;w=q.indexOf(":");w=w>=0?q.slice(0,w):q;if(!this._resolved("catalog",w))return false;v=this._catalog[w];for(y=(x=v.depends)?x.length:0;--y>=0;){s||(s={});D=x[y];if(!this._ready(D,s))return false}for(y=(x=v.stylesheets)?x.length:0;--y>=0;){s=x[y];if("string"!==typeof s)s=s.id;if(!this._resolved("stylesheets", +s))return false}for(y=(x=v.scripts)?x.length:0;--y>=0;){s=x[y];if("string"!==typeof s)s=s.id;if(!this._resolved("scripts",s))return false}if(q!==w)if(!this._resolved("modules",q))return false;return true},main:function(q,s){var w=this.require("index","tiki").ready;if(!w)throw"cannot register main because system.ready does not exist";w.main(this,function(){this.async(q).then(this,function(){this.require(q)[s]()})});return this},_loadScript:function(q){var s,w;if("string"!==typeof q){s=q.id;w=q.url}else s= +w=q;q=this._promiseFor("scripts",s);q.isPending&&q.action(function(){var v=document.body,x;v||promise.cancel("no document to append script");x=document.createElement("script");x.setAttribute("src",w);v.appendChild(x)});return q},_loadStylesheet:function(q){var s,w;if("string"!==typeof q){s=q.id;w=q.url}else s=w=q;q=this._promiseFor("stylesheets",s);if(q.isPending){var v=this;q.action(function(x){var y=document.body;y||x.cancel("no document to append stylesheet");x=document.createElement("link");x.setAttribute("rel", +"stylesheet");x.setAttribute("href",w);y.appendChild(x);v.stylesheet(s)})}return q},_loadPackage:function(q,s,w){if(w)if(w[q]){console&&console.warn&&console.warn("detected cyclical reference to "+q+" seen="+o(w).join(", "));return}else w[q]=true;var v=this._catalog?this._catalog[q]:null,x,y,D,K;if(!v)return this;y=(x=v.depends)?x.length:0;for(K=h.create(e("load-package",q));--y>=0;){q=x[y];q!=="tiki"&&K.depends(this._async(q,w))}s.depends(K);K.resolve();y=(x=v.scripts)?x.length:0;D=null;for(w=v.ordered!== +false;--y>=0;){q=this._loadScript(x[y]);s.depends(q);if(w)D&&q.then(D,D.run,D.cancel);else q.run();D=q}D&&w&&K.then(D,D.run,D.cancel);y=(x=v.stylesheets)?x.length:0;for(D=null;--y>=0;){q=this._loadStylesheet(x[y]);s.depends(q);D&&q.then(D,D.run,D.cancel);D=q}D&&K.then(D,D.run,D.cancel)},_promiseFor:function(q,s,w){var v=this._promises,x;if(!v)v=this._promises={};(x=v[q])||(x=v[q]={});if(w===undefined){v=x;w=s}else(v=x[s])||(v=x[s]={});(x=v[w])||(x=v[w]=h.create(e(q,s)));return x},_discoveredStylesheets:false, +discoverStylesheets:function(){this._discoveredStylesheets=true;if("undefined"===typeof document)return this;for(var q=document.getElementsByTagName("link"),s=q?q.length:0,w,v;--s>=0;){w=q[s];if(!(!w||w.rel!=="stylesheet")){(v=w.getAttribute("loadid")||w.getAttribute("LOADID"))&&this.stylesheet(v.toString());(v=w.href)&&this.stylesheet(v.toString())}}return this},_resolved:function(q,s,w){q==="stylesheets"&&!this._discoveredStylesheets&&this.discoverStylesheets();var v=this._promises;if(v)v=v[q]; +if(v)v=v[s];if(v&&w)v=v[w];return v?v.isResolved:false},_inspectLoader:function(){var q=[],s,w;q.push("Loader:");if(this.packages.length>0){q.push(" packages: "+this.packages.join(","));q.push("")}if(this.scripts.length>0){q.push(" scripts:");s=this.scripts.length;for(w=0;w0){q.push(" stylesheets:");s=this.scripts.length;for(w=0;w0){q.push(" modules: "); +s=this.modules.length;for(w=0;w0){y=[];for(q=0;q0){s.push("\n scripts:");for(q=0;q0){s.push("\n stylesheets:");for(q=0;q"}};d.setupDisplayNames(k.prototype,"Loader");k.setup=function(q,s){if(q&&!q.isBootstrap)return q; +s=new k(q?q.id:"default",q?q.queue:null,s);(s.previousLoader=q)&&q.destroy&&q.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,r,u;if(n<=0)return this;for(o=0;o"}});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 l[n];k.splice(k.indexOf(n),1)}}else{j={};l={};k.length=0}}function h(m,n,o){var r,u,q;if(n){r=m.indexOf(":");if(r>=0)m=m.slice(0,r);m=n+":"+m}m=f.canonical(m,o);if(o=j[m]){o=o.exports;l[m]||(l[m]=o);return o||{}}k.push(m);n={};j[m]=r={id:m,exports:n};o=function(t,w){return h(t,w,m)};o.displayName="Sandbox.require";o.loader=f;o.clear= -g;o.sandbox=this;u=f.load(m);q=h("tiki:index");if(!u)throw"could not load function for "+m;u.call(n,o,n,r,q);n=r.exports;if((o=l[m])&&o!==n)throw"circular require in "+m;return l[m]=n}var j={},l={},k=[];this.id=e;this.modules=k;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.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,l){var k,m;if(arguments.length>2){m=e.create(l,h,arguments,3);h=d(m,true)}k=setTimeout(h,j);if(m){m.timerKey=k;f[k]=m}return k};b.clearTimeout=function(h){c(f[h]);clearTimeout(h)};b.setInterval=function(h,j,l){var k,m;if(arguments.length>2){m=e.create(l,h,arguments,3);h=d(m,false)}k= -setInterval(h,j);if(m)g[k]=m;return k};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/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js");tiki.stylesheet("sproutcore/designer:en/1f37990cd851db9a2ee5c44d115f110d9ee2d4aa/stylesheet.css");tiki.stylesheet("sproutcore/testing:en/1e0d6dc675d3d9adb05a01b524dd7fc8fb2ad475/stylesheet.css"); -tiki.stylesheet("sproutcore/standard_theme:en/77378d526943ec81407cd7fc4d1ebdcc0eda3df4/stylesheet.css");tiki.stylesheet("sproutcore/desktop:en/a130a04e21382c6564992d11ba7de6cd3635b4ba/stylesheet.css");tiki.stylesheet("sproutcore/foundation:en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/stylesheet.css"); -tiki.register("sproutcore/runtime",{packages:{tiki:{scripts:[{url:"/static/tiki/en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js",id:"tiki:en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js"}]}},depends:["tiki"],scripts:[{url:"/static/sproutcore/runtime/en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js",id:"sproutcore/runtime:en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js"}]}); +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 r,u,q;if(n){r=m.indexOf(":");if(r>=0)m=m.slice(0,r);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]=r={id:m,exports:n};o=function(s,w){return h(s,w,m)};o.displayName="Sandbox.require";o.loader=f;o.clear= +g;o.sandbox=this;u=f.load(m);q=h("tiki:index");if(!u)throw"could not load function for "+m;u.call(n,o,n,r,q);n=r.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, -l,k,m;if(j===1){g=this||{};h=0}for(;h=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,l=this._keyCache[g]; -l||(l=this._keyCache[g]={});(j=l[h])||(j=l[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),l=e.typeOf(h),k=e.ORDER_DEFINITION_MAPPING;if(!k){var m=e.ORDER_DEFINITION;k=e.ORDER_DEFINITION_MAPPING= -{};var n,o;n=0;for(o=m.length;nl)return 1;switch(j){case e.T_BOOL:case e.T_NUMBER:if(gh)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;l=h.length;k=Math.min(j,l);n=m=0;for(o=arguments.callee;m===0&&nl)return 1;return 0;case e.T_OBJECT:if(g.constructor.isComparable===true)return g.constructor.compare(g, +_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;nk)return 1;switch(j){case e.T_BOOL:case e.T_NUMBER:if(gh)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&&nk)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=0?g.slice(l+1):g;return(g=this.objectForPropertyPath(g,h,l))&&j?[g,j]:null},objectForPropertyPath:function(g,h,j){var l,k,m;if(!h)h=d.global;if(e.typeOf(g)===e.T_STRING){if(j===undefined)j=g.length;for(l=0;h&&lj)k=j;m=g.slice(l,k);h=h.get?h.get(m):h[m];l=k+1}if(l=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&&kj)l=j;m=g.slice(k,l);h=h.get?h.get(m):h[m];k=l+1}if(k=0;){var l=arguments[g];if(l.indexOf(".")<0&&l.indexOf("*")<0){if(!h)h=this.localPropertyPaths=[];h.push(l)}else{if(!j)j=this.propertyPaths=[];j.push(l)}}return this}});String.prototype.fmt=function(){var g=arguments,h=0;return this.replace(/%@([0-9]+)?/g,function(j,l){l=l?parseInt(l, -0)-1:h++;j=g[l];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,l,k=0;for(k=0;k=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=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; @@ -85,46 +83,46 @@ 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;h1)for(e=1;e2)for(f=2;f1)for(e=1;e2)for(f=2;fc?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=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;j1)for(h=1;h2)for(j=2;j1)for(h=1;h2)for(j=2;j=0;){k=h[l];j[k.cacheKey]=j[k.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);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&&console.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,l;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];(l=e[j])||(l=e[j]=[]);l.push(c)}},_kvo_addCachedDependents:function(c,d,e,f){for(var g=d.length,h,j,l;--g>=0;){j=d[g];f.add(j);if((h=this[j])&&h instanceof Function&&h.isProperty){h.isCacheable&&c.push(h);if((l=e[j])&&l.length>0)this._kvo_addCachedDependents(c,l,e,f)}}},_kvo_computeCachedDependentsFor:function(c){var d=this._kvo_cachedep, +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,l,k,m;if(d=this._observers){f=d.length;for(c=0;c0&&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,l,k,m,n,o,r,u;if(d){u=b.KVO_SPACES=(b.KVO_SPACES|| -"")+" ";console.log('%@%@: notifying observers after change to key "%@"'.fmt(u,this,c))}g=this["_kvo_observers_*"];for(this._kvo_changeLevel=(this._kvo_changeLevel||0)+1;(f=this._kvo_changes)&&f.length>0||c;){l=++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=0;){f.add(c=j[o]);if(c=this[c]){this[c.cacheKey]=undefined;k[c.cacheKey]=k[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(k=0;k=1;){k=arguments[l];if(g[k]!=j){m=this.get(k);if(f[k]!==m){h=true;f[k]=m}}g[k]=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; +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;c0&&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,r,u;if(d){u=b.KVO_SPACES=(b.KVO_SPACES|| +"")+" ";b.Logger.log('%@%@: notifying observers after change to key "%@"'.fmt(u,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=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=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 %@".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,l=d.length,k=1;k %@".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=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= @@ -140,16 +138,17 @@ d,e=b.BENCHMARK_BINDING_SETUP;e&&b.Benchmark.start("SC.Binding.connect()");c=thi 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;d0;){this._connectQueue=this._alternateConnectQueue;for(this._alternateConnectQueue=e;f=e.pop();)f._connect()}for(;(e=this._changeQueue).length>0;){d&&console.log("Begin: Trigger changed bindings");c=true;this._changeQueue=this._alternateChangeQueue;for(this._alternateChangeQueue=e;f=e.pop();)f.applyBindingValue();d&&console.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&&console.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&&console.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, +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})},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)}}); +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 l;if(b.typeOf(e)===b.T_NUMBER){l=new Date;l.setTime(l.getTime()+e*24*60*60*1E3)}else if(b.DateTime&&e.get&&e.get("milliseconds"))l=new Date(e.get("milliseconds"));else if(b.typeOf(e.toUTCString)===b.T_FUNCTION)l=e;if(l)j="; expires="+l.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&& +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)){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); @@ -162,14 +161,14 @@ f;for(f=Math.abs(d[e]);f=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;f0&&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,l;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;l=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;fh){e[h]=d;g=h}if(d<0)l+=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")+l);d=h-c}this._hint(c,d);l!==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- +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;fh){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;ej){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;h0&&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".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 l=this.source,k=g[h];if(f===undefined)f=null;for(;k!==0;){if(h=d)h=k=0;else{h=Math.abs(k);k=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,l){e+=this.lengthIn(j,l)},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;g0)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".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=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;g0)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=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=0&&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=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= @@ -182,11 +181,11 @@ groupEnd:function(){var a=this.get("reporter");if(this.get("exists")&&typeof a.g 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=0)){d.push(g);for(var j in g)if(j!="__scope__")if(j!="superclass")if(j.match(/^[A-Z0-9]/)){var l=f?[f,j].join("."):j,k=g[j];switch(c.typeOf(k)){case c.T_CLASS:if(!k._object_className)k._object_className=l;h>=0&&e(l,k,h);break;case c.T_OBJECT:h>=0&&e(l,k,h);break;case c.T_HASH:if((f||l==="SC")&&h>=0)e(l,k, -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,l=c.K,k,m;g=j?j.length:0;for(var n=g>0?{}:null;--g>=0;){f=j[g];k=d[f];m=e[f];if(k){k instanceof Array|| -(k=c.$A(k));n[f]=m?k.concat(m):m}else{m instanceof Array||(m=c.$A(m));n[f]=m}}g=d._bindings;j=false;k=d._observers;m=false;var o=d._properties,r=false,u,q,t,w=d.outlets,v=false;if(e.outlets){w=(w||c.EMPTY_ARRAY).concat(e.outlets);v=true}for(f in e)if(f!=="_kvo_cloned")if(e.hasOwnProperty(f)){var A=(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(A&&A instanceof Function){if(!A.superclass&& -A!==(h=d[f]))A.superclass=A.base=h||l;if(A.propertyPaths){if(!m){k=(k||c.EMPTY_ARRAY).slice();m=true}k[k.length]=f}else if(u=A.localPropertyPaths)for(q=u.length;--q>=0;){t=d._kvo_for(c.keyFor("_kvo_local",u[q]),c.Set);t.add(f);d._kvo_for("_kvo_observed_keys",c.CoreSet).add(u[q])}else if(A.dependentKeys){if(!r){o=(o||c.EMPTY_ARRAY).slice();r=true}o[o.length]=f}else if(A.autoconfiguredOutlet){if(!v){w=(w||c.EMPTY_ARRAY).slice();v=true}w[w.length]=f}}d[f]=A}if(e.hasOwnProperty("toString")){f="toString"; -A=(n.hasOwnProperty(f)?n[f]:null)||e[f];if(!A.superclass&&A!==(h=d[f]))A.superclass=A.base=h||l;d[f]=A}d._bindings=g||[];d._observers=k||[];d._properties=o||[];d.outlets=w||[];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=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,r=false,u,q,s,w=d.outlets,v=false;if(e.outlets){w=(w||c.EMPTY_ARRAY).concat(e.outlets);v=true}for(f in e)if(f!=="_kvo_cloned")if(e.hasOwnProperty(f)){var x=(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(x&&x instanceof Function){if(!x.superclass&& +x!==(h=d[f]))x.superclass=x.base=h||k;if(x.propertyPaths){if(!m){l=(l||c.EMPTY_ARRAY).slice();m=true}l[l.length]=f}else if(u=x.localPropertyPaths)for(q=u.length;--q>=0;){s=d._kvo_for(c.keyFor("_kvo_local",u[q]),c.Set);s.add(f);d._kvo_for("_kvo_observed_keys",c.CoreSet).add(u[q])}else if(x.dependentKeys){if(!r){o=(o||c.EMPTY_ARRAY).slice();r=true}o[o.length]=f}else if(x.autoconfiguredOutlet){if(!v){w=(w||c.EMPTY_ARRAY).slice();v=true}w[w.length]=f}}d[f]=x}if(e.hasOwnProperty("toString")){f="toString"; +x=(n.hasOwnProperty(f)?n[f]:null)||e[f];if(!x.superclass&&x!==(h=d[f]))x.superclass=x.base=h||k;d[f]=x}d._bindings=g||[];d._observers=l||[];d._properties=o||[];d.outlets=w||[];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;e0){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(); +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;f0&&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;f0&&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,l;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;l=c._objects;e=f?f.length:0;this.beginPropertyChanges();for(g=0;g0&&this.remove(h.source,h);l&&this.removeObjects(l);this.endPropertyChanges(); -return this}}h=this._indexSetForSource(c,true);f=this.get("length");j=f-h.get("length");if(h&&(l=this._objects)){if(e!==undefined){d=b.IndexSet.create(d,e);e=undefined}l.forEach(function(k){g=c.indexOf(k);if(d.contains(g)){l.remove(k);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); +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;g0&&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=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}, @@ -229,11 +228,11 @@ undefined&&d.add(g)});else{f=e.length;for(c=0;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/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js"); -tiki.register("sproutcore/datastore",{packages:{"sproutcore/runtime":{scripts:[{url:"/static/sproutcore/runtime/en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js",id:"sproutcore/runtime:en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js"}]},tiki:{scripts:[{url:"/static/tiki/en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js",id:"tiki:en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js"}]}},depends:["tiki","sproutcore/runtime"],scripts:[{url:"/static/sproutcore/datastore/en/24fcfdc3a4d561b8c1fe714e5331b2f2fda8e205/javascript.js", -id:"sproutcore/datastore:en/24fcfdc3a4d561b8c1fe714e5331b2f2fda8e205/javascript.js"}]});tiki.module("sproutcore/datastore:index",function(){});tiki.script("sproutcore/datastore:en/24fcfdc3a4d561b8c1fe714e5331b2f2fda8e205/javascript.js"); -tiki.register("sproutcore/foundation",{packages:{"sproutcore/runtime":{scripts:[{url:"/static/sproutcore/runtime/en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js",id:"sproutcore/runtime:en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js"}]},tiki:{scripts:[{url:"/static/tiki/en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js",id:"tiki:en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js"}]}},stylesheets:[{url:"/static/sproutcore/foundation/en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/stylesheet.css", -id:"sproutcore/foundation:en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/stylesheet.css"}],depends:["tiki","sproutcore/runtime"],scripts:[{url:"/static/sproutcore/foundation/en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/javascript.js",id:"sproutcore/foundation:en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/javascript.js"}]});tiki.global("sproutcore/foundation"); +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= @@ -252,8 +251,8 @@ this.get("isEditable")&&!this.get("orderBy")&&!!a.isSCArray}.property("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 --1)l=l.split("ASC ")[1];else if(l.indexOf("DESC")>-1){l=l.split("DESC ")[1];k=YES}j=f?f.isObservable?f.get(l):f[l]:f;l=g?g.isObservable?g.get(l):g[l]:g;j=SC.compare(j,l);if(k)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, +[];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 +-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"); @@ -265,8 +264,8 @@ a.removeObserver("*",this,c);if(b)if(b.isEnumerable)b.addObserver("[]",this,d);e 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){console.log("contentIndexExpand(%@, %@, %@)".fmt(a,b,c))},contentIndexCollapse:function(a, -b,c){console.log("contentIndexCollapse(%@, %@, %@)".fmt(a,b,c))}};sc_require("mixins/tree_item_content");sc_require("mixins/collection_content"); +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;d0?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|| @@ -290,8 +289,8 @@ SC.TreeController=SC.ObjectController.extend(SC.SelectionSupport,{treeItemIsGrou 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?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");this._firing=YES;var b=this.TIMER_ARRAY;this._timerQueue=this._timerQueue.collectExpiredTimers(b,a);var c=b.length;for(a=0;a0;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(); +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;a0;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?'':'';f=YES}c=d+e;if(b){this.get("needsEllipsis")?a.push('"):a.push('");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", @@ -323,78 +322,80 @@ this.get(c):this.getDelegateProperty(c,this.displayDelegate))&&(e||b===c)){b=d?d 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]};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=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,s){return p[0]&&parseInt(y.curCSS(p[0],s,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,l=/href|src|style/,k=/(button|input|object|select|textarea)/i,m=/alpha\([^)]*\)/,n=/opacity=([^)]*)/,o=SC.browser.msie?"styleFloat":"cssFloat",r=SC.browser.safari&&parseInt(SC.browser.version,0)<417?"(?:[\\w*_-]|\\\\.)": -"(?:[\\w\u0128-\uffff*_-]|\\\\.)",u=new RegExp("^([#.]?)("+r+"*)"),q=new RegExp("([#.]?)("+r+"*)","g"),t=["Left","Right"],w=["Top","Bottom"],v={position:"absolute",visibility:"hidden",display:"block"},A=function(p,s,z){s=s==="width"?p.offsetWidth:p.offsetHeight;for(var D=0,C=0,E=z.length,G;--E>=0;){G=z[E];D+=parseFloat(y.curCSS(p,"padding"+G,true))||0;C+=parseFloat(y.curCSS(p,"border"+G+"Width",true))||0}s-=Math.round(D+C);return s},x=/z-?index|font-?weight|opacity|zoom|line-?height/i,B=document.defaultView|| -{},F=function(p){if(!SC.browser.safari)return false;p=B.getComputedStyle(p,null);return!p||p.getPropertyValue("color")===""},y;y=r=SC.Builder.create({jquery:"SC.CoreQuery",init:function(p,s){p=p||document;if(p.nodeType){this[0]=p;this.length=1;return this}else if(typeof p==="string"){var z=b.exec(p);if(z&&(z[1]||!s))if(z[1])p=y.clean([z[1]],s);else{if(s=document.getElementById(z[3])){if(s.id!=z[3])return y().find(p);return y(s)}p=[]}else return y(s).find(p)}else if(SC.typeOf(p)===SC.T_FUNCTION)return SC.ready(p); -return this.setArray(y.makeArray(p))},size:function(){return this.length},get:function(p){return p===undefined?y.makeArray(this):this[p]},find:function(p){return this.pushStack(y.map(this,function(s){return y.find(p,s)}))},filter:function(p){return this.pushStack(SC.typeOf(p)===SC.T_FUNCTION&&y.grep(this,function(s,z){return p.call(s,z)})||y.multiFilter(p,this))},not:function(p){if(typeof p==="string")if(c.test(p))return this.pushStack(y.multiFilter(p,this,true));else p=y.multiFilter(p,this);var s= -p.length&&p[p.length-1]!==undefined&&!p.nodeType;return this.filter(function(){return s?y.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(y.map(this,function(s,z){return p.call(s,z,s)}))},each:function(p,s){return y.each(this,p,s)},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(y.merge(this.get(),typeof p==="string"?y(p):y.makeArray(p)).uniq())},attr:function(p,s,z){var D=p;if(typeof p==="string")if(s===undefined)return this[0]&&y[z||"attr"](this[0],p);else{D={};D[p]=s}return this.each(function(C){for(p in D)y.attr(z?this.style:this,p,y.prop(this,D[p],z,C,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&&y.multiFilter(p,this).length>0},hasClass:function(p){return Array.prototype.every.call(this,function(s){return s.nodeType===1&&y.className.has(s,p)})},val:function(p){if(p===undefined){var s=this[0];if(s){if(y.nodeName(s,"option"))return(s.attributes.value||{}).specified?s.value:s.text;if(y.nodeName(s,"select")){var z=s.selectedIndex,D=[],C=s.options;s=s.type==="select-one";if(z<0)return null;var E,G=s?z+1:C.length;for(E=s?z:0;E=0||y.inArray(this.name,p)>=0;else if(y.nodeName(this,"select")){var K=y.makeArray(p);y("option",this).each(function(){this.selected=y.inArray(this.value,K)>=0||y.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&&!y.isXMLDoc(this)){var s=this.cloneNode(true),z=document.createElement("div");z.appendChild(s);return y.clean([z.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,s){if((p==="width"||p==="height")&&parseFloat(s,0)<0)s=undefined;return this.attr(p,s,"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 s="";y.each(p||this,function(){y.each(this.childNodes,function(){if(this.nodeType!==8)s+=this.nodeType!==1?this.nodeValue:y.fn.text([this])})});return s},show:function(){var p=SC.$.isVisible;this.each(function(){if(!p(this)){this.style.display=this.oldblock||"";if(y.css(this,"display")==="none"){var s=y("<"+this.tagName+"/>");y("body").append(s);this.style.display=s.css("display");if(this.style.display=== -"none")this.style.display="block";s.remove()}}});return this},hide:function(){var p=SC.$.isVisible;this.each(function(){if(p(this)){this.oldblock=this.oldblock||y.css(this,"display");this.style.display="none"}});return this},domManip:function(p,s,z,D){var C=this.length>1,E;return this.each(function(){if(!E){E=y.clean(p,this.ownerDocument);z&&E.reverse()}var G=this;if(s&&y.nodeName(this,"table")&&y.nodeName(E[0],"tr"))G=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody")); -y.each(E,function(){var K=C?y(this).clone(true)[0]:this;D.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)})}});r.mixin({nodeName:function(p,s){return p.nodeName&&p.nodeName.toUpperCase()===s.toUpperCase()},map:function(p,s){var z=[],D,C,E;C=0;for(E=p.length;C"});var E=C.replace(h,"").substring(0,10).toLowerCase();D=s.createElement("div");var G=!E.indexOf("",""]||!E.indexOf("",""]||E.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!E.indexOf("",""]||(!E.indexOf("",""]||!E.indexOf("", -""]||SC.browser.msie&&[1,"div
","
"]||[0,"",""];for(D.innerHTML=G[1]+C+G[2];G[0]--;)D=D.lastChild;if(SC.browser.msie){E=!E.indexOf(""&&E.indexOf("=0;--G)y.nodeName(E[G],"tbody")&&!E[G].childNodes.length&&E[G].parentNode.removeChild(E[G]);/^\s/.test(C)&&D.insertBefore(s.createTextNode(C.match(/^\s*/)[0]),D.firstChild)}C=y.makeArray(D.childNodes)}if(!(C.length=== -0&&!y.nodeName(C,"form")&&!y.nodeName(C,"select")))if(C[0]===undefined||y.nodeName(C,"form")||C.options)z.push(C);else z=y.merge(z,C)}});return z},find:function(p,s){var z;if(typeof p!=="string")return[p];if(p.indexOf(",")>=0){z=p.split(",").map(function(M){return y.find(M,s)});return z.concat.apply([],z).uniq()}if(s&&s.nodeType!==1&&s.nodeType!==9)return[];s=s||document;z=[s];for(var D=YES,C=p.match(q),E=C.length,G=0;G=0;if(!z&&C||z&&!C)D.push(p[E])}return D},filter:function(p,s,z){p=u.exec(p);var D=p[2];p=p[1];if(p===".")return y.classFilter(y.makeArray(s),D,z); -else{p=p==="#"?function(C){C=C&&C.getAttribute&&C.getAttribute("id")===D;return z?!C:C}:function(C){C=y.nodeName(C,D);return z?!C:C};return Array.prototype.filter.call(y.makeArray(s),p)}},multiFilter:function(p,s,z){p=p.indexOf(",")?p.split(","):[p];for(var D=p.length,C,E=[];--D>=0;){C=y.filter(p[D].trim(),s,z);E=z?(s=C):y.merge(C,E)}return E},merge:function(p,s){var z=0,D,C=p.length;if(SC.browser.msie)for(;D=s[z++];){if(D.nodeType!==8)p[C++]=D}else for(;D=s[z++];)p[C++]=D;return p},makeArray:function(p){var s= -[];if(p!==undefined||p!=null){var z=p.length;if(z==null||typeof p==="string"||p.setInterval)s[0]=p;else for(;z;)s[--z]=p[z]}return s},inArray:function(p,s){return s.indexOf?s.indexOf(p):Array.prototype.indexOf.call(s,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,s,z,D,C){if(SC.typeOf(s)===SC.T_FUNCTION)s= -s.call(p,D);return s&&typeof s==="number"&&z==="curCSS"&&!x.test(C)?s+"px":s},grep:function(p,s,z){for(var D=[],C=0,E=p.length;C-1}},swap:function(p,s,z,D,C){var E={},G;for(G in s){E[G]=p.style[G];p.style[G]=s[G]}z=z(p,D,C);for(G in s)p.style[G]=E[G];return z},css:function(p,s,z){if(s==="width"||s==="height"){z=s==="width"?t:w;p=SC.$.isVisible(p)?A(p,s,z):y.swap(p,v,A,s,z);return Math.max(0,p)}return y.curCSS(p,s,z)},curCSS:function(p,s,z){var D,C=p.style;if(s==="opacity"&&SC.browser.msie){D=y.attr(C,"opacity");return D===""?"1":D}if(SC.browser.opera&&s==="display"){var E= -C.outline;C.outline="0 solid black";C.outline=E}if(E=s.match(/float/i))s=o;if(!z&&C&&C[s])D=C[s];else if(B.getComputedStyle){if(E)s="float";s=s.replace(/([A-Z])/g,"-$1").toLowerCase();if((D=B.getComputedStyle(p,null))&&!F(p,B))D=D.getPropertyValue(s);else{C=[];z=[];E=p;for(p=0;E&&F(E);E=E.parentNode)z.unshift(E);for(E=z.length;p)[^>]*$|^#([\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",r=SC.browser.safari&&parseInt(SC.browser.version,0)<417?"(?:[\\w*_-]|\\\\.)": +"(?:[\\w\u0128-\uffff*_-]|\\\\.)",u=new RegExp("^([#.]?)("+r+"*)"),q=new RegExp("([#.]?)("+r+"*)","g"),s=["Left","Right"],w=["Top","Bottom"],v={position:"absolute",visibility:"hidden",display:"block"},x=function(p,t,A){t=t==="width"?p.offsetWidth:p.offsetHeight;for(var C=0,B=0,G=A.length,J;--G>=0;){J=A[G];C+=parseFloat(z.curCSS(p,"padding"+J,true))||0;B+=parseFloat(z.curCSS(p,"border"+J+"Width",true))||0}t-=Math.round(C+B);return t},y=/z-?index|font-?weight|opacity|zoom|line-?height/i,D=document.defaultView|| +{},K=function(p){if(!SC.browser.safari)return false;p=D.getComputedStyle(p,null);return!p||p.getPropertyValue("color")===""},z;z=r=SC.Builder.create({jquery:"SC.CoreQuery",init:function(p,t){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]||!t))if(A[1])p=z.clean([A[1]],t);else{if(t=document.getElementById(A[3])){if(t.id!=A[3])return z().find(p);return z(t)}p=[]}else return z(t).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(t){return z.find(p,t)}))},filter:function(p){return this.pushStack(SC.typeOf(p)===SC.T_FUNCTION&&z.grep(this,function(t,A){return p.call(t,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 t= +p.length&&p[p.length-1]!==undefined&&!p.nodeType;return this.filter(function(){return t?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(t,A){return p.call(t,A,t)}))},each:function(p,t){return z.each(this,p,t)},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,t,A){var C=p;if(typeof p==="string")if(t===undefined)return this[0]&&z[A||"attr"](this[0],p);else{C={};C[p]=t}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(t){return t.nodeType===1&&z.className.has(t,p)})},val:function(p){if(p===undefined){var t=this[0];if(t){if(z.nodeName(t,"option"))return(t.attributes.value||{}).specified?t.value:t.text;if(z.nodeName(t,"select")){var A=t.selectedIndex,C=[],B=t.options;t=t.type==="select-one";if(A<0)return null;var G,J=t?A+1:B.length;for(G=t?A:0;G=0||z.inArray(this.name,p)>=0;else if(z.nodeName(this,"select")){var F=z.makeArray(p);z("option",this).each(function(){this.selected=z.inArray(this.value,F)>=0||z.inArray(this.text,F)>=0});if(!F.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 t=this.cloneNode(true),A=document.createElement("div");A.appendChild(t);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,t){if((p==="width"||p==="height")&&parseFloat(t,0)<0)t=undefined;return this.attr(p,t,"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 t="";z.each(p||this,function(){z.each(this.childNodes,function(){if(this.nodeType!==8)t+=this.nodeType!==1?this.nodeValue:z.fn.text([this])})});return t},show:function(){var p=SC.$.isVisible;this.each(function(){if(!p(this)){this.style.display=this.oldblock||"";if(z.css(this,"display")==="none"){var t=z("<"+this.tagName+"/>");z("body").append(t);this.style.display=t.css("display");if(this.style.display=== +"none")this.style.display="block";t.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,t,A,C){var B=this.length>1,G;return this.each(function(){if(!G){G=z.clean(p,this.ownerDocument);A&&G.reverse()}var J=this;if(t&&z.nodeName(this,"table")&&z.nodeName(G[0],"tr"))J=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody")); +z.each(G,function(){var F=B?z(this).clone(true)[0]:this;C.call(J,F)})})},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)})}});r.mixin({nodeName:function(p,t){return p.nodeName&&p.nodeName.toUpperCase()===t.toUpperCase()},map:function(p,t){var A=[],C,B,G;B=0;for(G=p.length;B"});var G=B.replace(h,"").substring(0,10).toLowerCase();C=t.createElement("div");var J=!G.indexOf("",""]||!G.indexOf("",""]||G.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!G.indexOf("",""]||(!G.indexOf("",""]||!G.indexOf("", +""]||SC.browser.msie&&[1,"div
","
"]||[0,"",""];for(C.innerHTML=J[1]+B+J[2];J[0]--;)C=C.lastChild;if(SC.browser.msie){G=!G.indexOf(""&&G.indexOf("=0;--J)z.nodeName(G[J],"tbody")&&!G[J].childNodes.length&&G[J].parentNode.removeChild(G[J]);/^\s/.test(B)&&C.insertBefore(t.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,t){var A;if(typeof p!=="string")return[p];if(p.indexOf(",")>=0){A=p.split(",").map(function(M){return z.find(M,t)});return A.concat.apply([],A).uniq()}if(t&&t.nodeType!==1&&t.nodeType!==9)return[];t=t||document;A=[t];for(var C=YES,B=p.match(q),G=B.length,J=0;J=0;if(!A&&B||A&&!B)C.push(p[G])}return C},filter:function(p,t,A){p=u.exec(p);var C=p[2];p=p[1];if(p===".")return z.classFilter(z.makeArray(t),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(t),p)}},multiFilter:function(p,t,A){p=p.indexOf(",")?p.split(","):[p];for(var C=p.length,B,G=[];--C>=0;){B=z.filter(p[C].trim(),t,A);G=A?(t=B):z.merge(B,G)}return G},merge:function(p,t){var A=0,C,B=p.length;if(SC.browser.msie)for(;C=t[A++];){if(C.nodeType!==8)p[B++]=C}else for(;C=t[A++];)p[B++]=C;return p},makeArray:function(p){var t= +[];if(p!==undefined||p!=null){var A=p.length;if(A==null||typeof p==="string"||p.setInterval)t[0]=p;else for(;A;)t[--A]=p[A]}return t},inArray:function(p,t){return t.indexOf?t.indexOf(p):Array.prototype.indexOf.call(t,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,t,A,C,B){if(SC.typeOf(t)===SC.T_FUNCTION)t= +t.call(p,C);return t&&typeof t==="number"&&A==="curCSS"&&!y.test(B)?t+"px":t},grep:function(p,t,A){for(var C=[],B=0,G=p.length;B-1}},swap:function(p,t,A,C,B){var G={},J;for(J in t){G[J]=p.style[J];p.style[J]=t[J]}A=A(p,C,B);for(J in t)p.style[J]=G[J];return A},css:function(p,t,A){if(t==="width"||t==="height"){A=t==="width"?s:w;p=SC.$.isVisible(p)?x(p,t,A):z.swap(p,v,x,t,A);return Math.max(0,p)}return z.curCSS(p,t,A)},curCSS:function(p,t,A){var C,B=p.style;if(t==="opacity"&&SC.browser.msie){C=z.attr(B,"opacity");return C===""?"1":C}if(SC.browser.opera&&t==="display"){var G= +B.outline;B.outline="0 solid black";B.outline=G}if(G=t.match(/float/i))t=o;if(!A&&B&&B[t])C=B[t];else if(D.getComputedStyle){if(G)t="float";t=t.replace(/([A-Z])/g,"-$1").toLowerCase();if((C=D.getComputedStyle(p,null))&&!K(p,D))C=C.getPropertyValue(t);else{B=[];A=[];G=p;for(p=0;G&&K(G);G=G.parentNode)A.unshift(G);for(G=A.length;p(%@)".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=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=this.wheelDeltaY=0-(a.wheelDeltaY|| -a.wheelDelta);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*2);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}}return this}; +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(l){this.trigger(l,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&& +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 keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view which touches targetTouches changedTouches".split(" ")}); +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(this.shiftKey)d+= -"shift_"}}if(!b){a=this.which;c=b=String.fromCharCode(a);a=b.toLowerCase();if(this.metaKey){d="meta_";b=a}else b=null}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"}; +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.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.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=0;)this.addObserver(b[a],this,this.displayDidChange);this.get("isDropTarget")&&SC.Drag.addDropTarget(this);this.get("isScrollable")&&SC.Drag.addScrollableView(this)},awake:function(){arguments.callee.base.apply(this,arguments);var a=this.get("childViews"),b=a.length,c;for(c=0;cb.maxHeight)c.height= -b.maxHeight;if(!SC.none(b.minHeight)&&c.heightb.maxWidth)c.width=b.maxWidth;if(!SC.none(b.minWidth)&&c.width=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,l=a.bottom,k=a.width,m=a.height,n=a.centerX,o=a.centerY;if(k!==undefined&&k=== -SC.LAYOUT_AUTO&&!f){b=SC.Error.desc("%@.layout() you cannot use width:auto if "+"staticLayout is disabled".fmt(this),"%@".fmt(this),-1);console.error(b.toString());throw b;}if(m!==undefined&&m===SC.LAYOUT_AUTO&&!f){b=SC.Error.desc("%@.layout() you cannot use height:auto if "+"staticLayout is disabled".fmt(this),"%@".fmt(this),-1);console.error(b.toString());throw b;}if(SC.none(h))if(SC.none(g))if(SC.none(n)){if(SC.none(k)){b.left=0;b.right=0;b.width=null}else{b.left=0;b.right=null;b.width=k===SC.LAYOUT_AUTO? -SC.LAYOUT_AUTO:SC.isPercentage(k)?k*100+"%":Math.floor(k)}b.marginLeft=0}else{b.left="50%";b.width=k&&SC.isPercentage(k)?k*100+"%":Math.floor(k||0);b.marginLeft=k&&SC.isPercentage(k)&&n>=0&&n<1?Math.floor((n-k/2)*100)+"%":k&&k>1&&(n>=1||n<=0)?Math.floor(n-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(k)){b.left=0;b.width=null}else{b.left=null;b.width=k===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:k&&SC.isPercentage(k)?k*100+"%":Math.floor(k|| -0)}}else{b.left=SC.isPercentage(h)?h*100+"%":Math.floor(h);b.marginLeft=0;if(k!==undefined){b.width=k===SC.LAYOUT_AUTO?SC.LAYOUT_AUTO:SC.isPercentage(k)?k*100+"%":Math.floor(k);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(l))if(SC.none(o)){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)&&o>=0&&o<1)b.marginTop=Math.floor((o-m/2)*100)+"%";else if(m&&m>1&&(o>=1||o<=0))b.marginTop=Math.floor(o-b.height/2);else{console.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(l)?l*100+"%":Math.floor(l);if(SC.none(m)){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=l&&SC.isPercentage(l)?l*100+"%":Math.floor(l||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,d;for(c=0;c=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;cb.maxHeight)c.height=b.maxHeight;if(!SC.none(b.minHeight)&& +c.heightb.maxWidth)c.width=b.maxWidth;if(!SC.none(b.minWidth)&&c.width=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,r=a.centerX,u=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(r)){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)&&r>=0&&r<1?Math.floor((r-l/2)*100)+"%":l&&l>1&&(r>=1||r<=0)?Math.floor(r-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(u)){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)&&u>=0&&u<1)b.marginTop=Math.floor((u-m/2)*100)+"%";else if(m&&m>1&&(u>=1||u<=0))b.marginTop=Math.floor(u-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=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"),updateLayerMixin: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("value");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("value"),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)},updateLayer:function(){arguments.callee.base.apply(this,arguments)},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}}); +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"))},clippingFrame:null,parentViewDidResize:null,beginLiveResize:null,endLiveResize:null,viewDidResize: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,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){b=d=null;if(a.value){if("selectionStart"in a)d=a.selectionStart;if("selectionEnd"in a)b=a.selectionEnd; -if(d===null||b===null)if(c=document.selection){var e=c.type;if(e&&(e==="None"||e==="Text")){c=c.createRange();if(this.get("isTextArea")){d=c.duplicate();d.moveToElementText(a);d.setEndPoint("EndToStart",c);d=d.text.length;b=d+c.text.length}else{b=c.text.length;d=Math.abs(c.moveStart("character",0-(a.value.length+1)));b=d+b}}}}else d=b=0;return SC.TextSelection.create({start:d,end:b})}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("selectionStart"in a){a.selectionStart=b.get("start");d=YES}if("selectionEnd"in a){a.selectionEnd=b.get("end");c=YES}if(!d||!c){c=a.createTextRange();d=b.get("start");c.move("character",d);c.moveEnd("character",b.get("end")-d);c.select()}}}}.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;d0);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('');h="";if(d||e){h='style="';if(d)h+="left: "+d+"; ";if(e)h+="right: "+e+";";h+='"'}a.push(''.fmt(h));a.push('',f,"");c=this.get("escapeHTML")?SC.RenderContext.escapeHTML(c):c;if(this.get("isTextArea"))a.push('");else{d=this.get("isPassword")?"password":"text";a.push('')}}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;d0);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('');h="";if(d||e){h='style="';if(d)h+="left: "+d+"; ";if(e)h+="right: "+e+";";h+='"'}a.push('",'',f,"");c=this.get("escapeHTML")?SC.RenderContext.escapeHTML(c):c;if(this.get("isTextArea"))a.push('");else{d=this.get("isPassword")?"password":"text";a.push('')}}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;d0)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},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},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);c||(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(){if(SC.userDefaults.get("ready"))return this.appendTo(document.body);else SC.userDefaults.readyCallback(this,this.append)},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; +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;d0&&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&&console.log("%@: AFTER ACTION: makeFirstResponder => %@".fmt(this,this.responderNameFor(a))); -this._pendingResponder=a}else{d&&console.log("%@: makeFirstResponder => %@".fmt(this,this.responderNameFor(a)));a.set("becomingFirstResponder",YES);this._locked=YES;this._pendingResponder=null;for(d=a?this.nextResponderFor(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&&console.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?console.log("%@: action '%@' handled by %@".fmt(this,a,this.responderNameFor(d))):console.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"); +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 console.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;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;cHide Chart]';l.className="sc-benchmark-title";j.appendChild(l);b=document.createElement("div");b.className="sc-benchmark-top";b.style.width=h+"px";j.appendChild(b);for(b=0;b"+l+"ms");f.className="sc-benchmark-bar";f.style.cssText="left:"+(g-e)/4+"px; width: "+l/4+"px; top: "+(53+b*30)+"px;";f.title="start: "+(g-e)+" ms, end: "+(a-e)+" ms, duration: "+l+" ms";j.appendChild(f)}this._graph= -j}},hideChart:function(){if(this._graph)try{document.body.removeChild(this._graph)}catch(a){}},log:function(a){console.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;f1?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],l=0;l1?l+1+" - "+h:h;b.push([c,k.start,k.end,k.dur,true])}}}b.sort(function(m,n){if(m[1]0?Math.floor(b.amt*1E3/b.runs)/1E3:0,b.name||a,b.runs)},_timelineGenReport:function(a){return this.globalStartTime? +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)+' [Hide Chart]';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"+k+"ms");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;f1?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;k1?k+1+" - "+h:h;b.push([c,l.start,l.end,l.dur,true])}}}b.sort(function(m,n){if(m[1]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._unscheduleEntry(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_QUEUE&&!b&&a.isBackground){c[c.indexOf(a)]=null;a.status=this.IMAGE_WAITING}if(a.status!==this.IMAGE_QUEUE){(b? -c:d).push(a);a.status=this.IMAGE_QUEUE;a.isBackground=b}this.isLoading||this.invokeLater(this.loadNextImage,100);this.set("isLoading",YES);return this},_unscheduleImageEntry:function(a){if(a.status!==this.IMAGE_QUEUE)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)}, +!!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;b0);SC.isReady=YES;SC._readyQueue=null;SC.Event.trigger("ready",null,document,NO);SC.removeLoading&&SC.$("#loading").remove();SC.mode===SC.APP_MODE&&typeof main!="undefined"&&main instanceof Function&& -!SC.suppressMain&&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"; +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;b0);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); @@ -538,8 +544,8 @@ this._attrs))for(c in d)if(d.hasOwnProperty(c))d[c]===null?a.removeAttribute(c): 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]="";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){console.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=0){if(this._cloneClassNames){b=this._classNames=b.slice();this._cloneClassNames=NO}b[c]=null;this._classNamesDidChange=YES}return this},resetClassNames:function(){this._classNames= +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=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= @@ -557,8 +563,8 @@ var g=c.finishRequest();if(g)c=null;return g};b.onreadystatechange=d}else SC.Eve 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},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"; +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(); @@ -568,14 +574,16 @@ SC.RootResponder=SC.Object.extend({panes:null,init:function(){arguments.callee.b 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},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)},touchstart:function(a){try{var b=this.targetViewForEvent(a);if((b=this._touchView=this.sendEvent("touchStart",a,b))&&b.respondsTo("touchDragged"))this._touchCanDrag=YES}catch(c){console.log("Exception during touchStart: %@".fmt(c));this._touchView=null;return this._touchCanDrag=NO}return b?a.hasCustomEventHandling:YES},touchmove:function(a){SC.RunLoop.begin();try{for(var b=this._lastHovered||[],c=[],d=this.targetViewForEvent(a);d&&d!==this;){b.indexOf(d)!==-1?d.tryToPerform("touchMoved", -a):d.tryToPerform("touchEntered",a);c.push(d);d=d.get("nextResponder")}for(var e=0;e0){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&&console.log("historyDidChange");if(b)if(b< +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;a0?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)}, @@ -586,15 +594,15 @@ SC.time=function(){var a=SC.beget(fn);a.value=timeOffset;return a};(function(){v "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,l=j.getFullYear(),k=j.getMonth()+1,m=1,n=j.getHours(),o=j.getMinutes();j=j.getSeconds();for(var r="";d70?1900+(l-0):2E3+(l-0)}else if(f=="MMM"||f=="NNN"){for(e=k=0;e11){k=e+1;if(k>12)k-=12;c+=u.length;break}}if(k<1||k>12)return 0}else if(f=="EE"||f=="E")for(e=0;e12)return 0;c+=k.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"|| +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 r="";d70?1900+(k-0):2E3+(k-0)}else if(f=="MMM"||f=="NNN"){for(e=l=0;e11){l=e+1;if(l>12)l-=12;c+=u.length;break}}if(l<1||l>12)return 0}else if(f=="EE"||f=="E")for(e=0;e12)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")r="AM";else if(a.substring(c,c+2).toLowerCase()=="pm")r="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(k==2)if(l%4==0&&l%100!=0||l%400==0){if(m>29)return 0}else if(m>28)return 0;if(k==4||k==6||k==9||k==11)if(m>30)return 0;if(n<12&&r=="PM")n=n-0+12;else if(n>11&&r=="AM")n-=12;return(new Date(l,k-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", +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&&r=="PM")n=n-0+12;else if(n>11&&r=="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=c;d--){var e=a.substring(b,b+d);if(e.length12?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=l;b.mm=LZ(l);b.s=k;for(b.ss=LZ(k);d12?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);d0&&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, @@ -602,33 +610,33 @@ window);if((a=b.get?b.get(a):b[a])&&SC.typeOf(a)==SC.T_FUNCTION)a.call(b,this);e 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._timerQueueRunTimeb)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){console.err("Couldn't load userDefaults in IE7: "+f.description)}}else if(this.HTML5DB_noLocalStorage)e=this._safari3DB; +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(k){k.executeSql("delete from SCLocalStorage where key = ?", -[f],function(){k.executeSql("insert into SCLocalStorage(key, value) VALUES ('"+f+"', '"+h+"');",[],j._nullDataHandler,j.killTransaction)})});this.dataHash[f]=h}else try{e[f]=h}catch(l){console.error("Failed using localStorage. "+l)}}(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]; +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);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{console.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){console.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,l=f.rows.length;j523&&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 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"{"+a.x+", "+a.y+", "+a.width+", "+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=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&&a0){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; +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=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&&a0){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= @@ -646,22 +654,24 @@ SC.Validator.PositiveInteger=SC.Validator.extend({defaultValue:null,fieldValueFo 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/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/blank.gif":SC.BLANK_IMAGE_DATAURL; +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=0?d:SC.BLANK_IMAGE_URL;d='';if(d!==this._iconCache){this._iconCache=d;f=true}}c=e&&(!c||c==="")?''+e+"":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/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/javascript.js"); -tiki.register("sproutcore/desktop",{packages:{"sproutcore/runtime":{scripts:[{url:"/static/sproutcore/runtime/en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js",id:"sproutcore/runtime:en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js"}]},"sproutcore/datastore":{scripts:[{url:"/static/sproutcore/datastore/en/24fcfdc3a4d561b8c1fe714e5331b2f2fda8e205/javascript.js",id:"sproutcore/datastore:en/24fcfdc3a4d561b8c1fe714e5331b2f2fda8e205/javascript.js"}]},"sproutcore/foundation":{stylesheets:[{url:"/static/sproutcore/foundation/en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/stylesheet.css", -id:"sproutcore/foundation:en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/stylesheet.css"}],scripts:[{url:"/static/sproutcore/foundation/en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/javascript.js",id:"sproutcore/foundation:en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/javascript.js"}]}},stylesheets:[{url:"/static/sproutcore/desktop/en/a130a04e21382c6564992d11ba7de6cd3635b4ba/stylesheet.css",id:"sproutcore/desktop:en/a130a04e21382c6564992d11ba7de6cd3635b4ba/stylesheet.css"}],depends:["sproutcore/runtime", -"sproutcore/datastore","sproutcore/foundation"],scripts:[{url:"/static/sproutcore/desktop/en/a130a04e21382c6564992d11ba7de6cd3635b4ba/javascript.js",id:"sproutcore/desktop:en/a130a04e21382c6564992d11ba7de6cd3635b4ba/javascript.js"}]});tiki.global("sproutcore/desktop"); +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='';if(d!==this._iconCache){this._iconCache=d;f=true}}c=e&&(!c||c==="")?''+e+"":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={borderStyle:SC.BORDER_GRAY,_BORDER_REGEXP:/-border$/,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.CollectionGroup={classNames:["sc-collection-group"]};SC.CollectionRowDelegate={isCollectionRowDelegate:YES,rowHeight:18,customRowHeightIndexes:null,contentIndexRowHeight:function(){return this.get("rowHeight")}}; +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"), @@ -669,21 +679,22 @@ scrollBy:function(a){var b=this.get("scrollFrame"),c=this.get("innerFrame");if(! 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)}});sc_require("panes/modal"); +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("
","
","
","
","
","
", "
","
")}},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.ButtonView=SC.View.extend(SC.Control,SC.Button,SC.StaticLayout,{tagName:"a",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"],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)}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);if(b){a=a.push("");this.renderTitle(a,b);a.push("");this.get("supportFocusRing")&&a.push('
','
','
', -'
')}else this.renderTitle(a,b)},_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}});sc_require("panes/panel");sc_require("views/button");SC.BUTTON1_STATUS="button1";SC.BUTTON2_STATUS="button2";SC.BUTTON3_STATUS="button3"; +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("");this.renderTitle(a,b);a.push("");this.get("supportFocusRing")&& +a.push('
','
','
','
')}else this.renderTitle(a,b)},renderImage:function(a){var b=this.get("icon");b?a.push("
"):a.push("
")},_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'

'+a.split("\n").join('

')+"

"}.property("description").cacheable(),caption:"",displayCaption:function(){var a=this.get("caption");if(!a||a.length===0)return a;a=SC.RenderContext.escapeHTML(a);return'

'+ a.split("\n").join('

')+"

"}.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('');a.begin("h1").text(b.get("message")||"").end();a.push(b.get("displayDescription")||"");a.push(b.get("displayCaption")||"");a.push('
')}}),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, @@ -706,158 +717,166 @@ b.y=f[e][1];this.set("pointerPosY",0);this.set("pointerPos",SC.POINTER_LAYOUT[e] 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('
');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("");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,init:function(){var a=this.getPath("parentMenu.rootMenu");this.set("contentDisplayProperties",a.menuItemKeys.map(SC._menu_fetchKeys,a));return arguments.callee.base.apply(this,arguments)},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")||20;this.set("itemWidth",d);this.set("itemHeight",e);a=a.begin("a");if(b.get(c.itemSeparatorKey)){a.push(''); -a.addClass("disabled")}else{if(b=b.get(c.itemIconKey)){this.renderImage(a,b);a.addClass("has-icon")}b=this.getContentProperty("itemTitleKey")||"";if(SC.typeOf(b)!==SC.T_STRING)b=b.toString();this.renderLabel(a,b.loc());this.getContentProperty("itemCheckboxKey")&&a.push('
');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){a.push(""+b+"")},renderBranch:function(a){a.push('')},renderShortcut:function(a,b){a.push(''+b+"")},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(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))},isAnchorMouseDown:NO,mouseUp:function(){var a;(a=this.getPath("parentMenu.rootMenu.targetMenuItem"))&& -a.performAction();return YES},performAction:function(){if(this.get("isEnabled")){var a=this.getContentProperty("itemActionKey"),b=this.getContentProperty("itemTargetKey"),c=this.getPath("parentMenu.rootMenu");if(!this.get("hasSubMenu")){a=a===undefined?c.get("action"):a;b=b===undefined?c.get("target"):b;this._flashCounter=0;c.set("selectedItem",this.get("content"));if(SC.typeOf(a)===SC.T_FUNCTION)a.apply(b,[c]);else(c=this.getPath("pane.rootResponder")||SC.RootResponder.responder)&&c.sendAction(a, -b,this,this.get("pane"));this.invokeLater(this.flashHighlight,25)}}},flashHighlight:function(){var a=this._flashCounter,b=this.$();a%2===0?b.addClass("focus"):b.removeClass("focus");if(a>2)this.getPath("parentMenu.rootMenu").remove();else{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.loseFocus();var a=this.get("parentMenu");a&&a.remove();(a=a.getPath("anchor.pane"))&&a.becomeKeyPane();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"); -SC.MenuPane=SC.PickerPane.extend({classNames:["sc-menu"],items:[],itemHeight:20,itemSeparatorHeight:9,menuHeight:0,menuHeightPadding:0,selectedItem:null,exampleView:SC.MenuItemView,anchor:null,isSubMenu:NO,localize:YES,popup:function(a,b){var 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.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",menuItemKeys:"itemTitleKey itemValueKey itemIsEnabledKey itemIconKey itemSeparatorKey itemActionKey itemCheckboxKey itemShortCutKey itemBranchKey itemHeightKey subMenuKey itemKeyEquivalentKey itemTargetKey".w(), -preferType:SC.PICKER_MENU,isModal:YES,_menuView:null,init:function(){var a=arguments.callee.base.apply(this,arguments);this.set("defaultResponder",this);return a},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,l,k,m,n,o,r,u;if(!b)return a;g=this.get("itemHeightKey");h=this.get("itemSeparatorKey");j=this.get("itemHeight");n=this.get("itemKeyEquivalentKey");l=this.get("itemSeparatorHeight");k=m=Math.floor(this.get("menuHeightPadding")/2);o=this.menuItemKeys.map(SC._menu_fetchKeys,this);u=b.get("length");for(r=0;r=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');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('
');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(""+b+"")},renderBranch:function(a){a.push('')},renderShortcut:function(a,b){a.push(''+b+"")},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,r,u;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);u=b.get("length");for(r=0;r=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(;ad?1:0})}return a},render:function(a,b){arguments.callee.base.apply(this,arguments);var c,d,e,f,g,h,j,l,k,m,n,o,r,u,q,t,w;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");w=this.get("isEnabledKey");h=this.get("checkboxEnabled");j=this.get("value");l=this.get("localize");k=this.get("separatorPostion"); -m=[];n=YES;o=0;c.forEach(function(v){if(v){r=e?v.get?v.get(e):v[e]:v.toString();r=l?r.loc():r;u=f?v.get?v.get(f):v[f]:null;if(SC.none(v[f]))u=null;q=g?v.get?v.get(g):v[g]:v;if(!SC.none(j)&&!SC.none(q))if(j===q){this.set("title",r);this.set("icon",u)}if(q===this.get("value")){this.set("itemIdx",o);n=!h?NO:YES}else n=NO;t=v[w];if(NO!==t)t=YES;if(o===0){this._defaultVal=q;this._defaultTitle=r;this._defaultIcon=u}v=SC.Object.create({title:r,icon:u,value:q,isEnabled:t,checkbox:n,target:this,action:this.displaySelectedItem}); -m.push(v)}o+=1;if(k&&o===d-k){v=SC.Object.create({separator:YES});m.push(v)}this.set("itemList",m)},this);b&&this.invokeLast(function(){var v=this.get("value");if(SC.none(v)){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= +c.get?c.get(b):c[b];d=d.get?d.get(b):d[b]}return cd?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,r,u,q,s,w;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");w=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(v){if(v){r=e?v.get?v.get(e):v[e]:v.toString();r=k?r.loc():r;u=f?v.get?v.get(f):v[f]:null;if(SC.none(v[f]))u=null;q=g?v.get?v.get(g):v[g]:v;if(!SC.none(j)&&!SC.none(q))if(j===q){this.set("title",r);this.set("icon",u)}if(q===this.get("value")){this.set("itemIdx",o);n=!h?NO:YES}else n=NO;s=v[w];if(NO!==s)s=YES;if(o===0){this._defaultVal=q;this._defaultTitle=r;this._defaultIcon=u}v=SC.Object.create({title:r,icon:u,value:q,isEnabled:s,checkbox:n,target:this,action:this.displaySelectedItem}); +m.push(v)}o+=1;if(l&&o===d-l){v=SC.Object.create({separator:YES});m.push(v)}this.set("itemList",m)},this);b&&this.invokeLast(function(){var v=this.get("value");if(SC.none(v)){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;hf)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);f=this.get("value");b=this.get("itemList");c=this.get("controlSize");a=this.get("menuPaneHeightPadding");g=this.get("customView");d=SC.MenuPane.create({classNames:["select-button"],items:b,exampleView:g?g:SC.MenuItemView, -isEnabled:YES,menuHeightPadding:a,preferType:SC.PICKER_MENU,itemHeightKey:"height",layout:{width:d},controlSize:c,itemWidth:d,itemHeight:this.get("itemHeight")||20,contentView:SC.View.extend({})});if(!d)return NO;d.set("defaultSelectedItemValue",f);d.popup(this,this.preferMatrix);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= +"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,NO_VIEW:"NO_VIEW",ANIMATING:"ANIMATING",READY:"READY",SLIDE_DOWN:"SLIDEDOWN",SLIDE_UP:"SLIDEUP",_state:"NO_VIEW",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.adjust(a);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._start=Date.now();this._end=this._start+this.get("transitionDuration");this._state=this.ANIMATING;this._direction=this.SLIDE_DOWN;this.tick()},slideUp:function(){this._start=Date.now();this._end=this._start+this.get("transitionDuration");this._state=this.ANIMATING;this._direction=this.SLIDE_UP;this.tick()},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){if(c===this.SLIDE_DOWN){b.adjust("top",0);SC.browser.mozilla&&this.parentViewDidChange()}else b.adjust("top",-1*d.height);this._state=SC.SheetPane.READY;this.updateLayout();return this}a=Math.floor(d.height*a);if(c==this.SLIDE_DOWN)b.adjust("top",0-(d.height-a));else c==this.SLIDE_UP&&b.adjust("top",0-a);this._timer=this.invokeLater(this.tick,20); -b.updateLayout();return this}});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.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,startDrag:function(){this._createGhostView();var a=this.event,b={x:a.pageX,y:a.pageY};this.set("location",b);var c=this.dragView,d=c.get("pane"),e=c.get("parentView");c.get("clippingFrame"); -e=e?e.convertFrameToView(c.get("frame"),null):c.get("frame");d=d?d.get("frame"):{x:0,y:0};c.adjust({top:e.y+d.y,left:e.x+d.x,width:e.width,height:e.height});c.get("frame");this.ghostOffset=this.ghostActsLikeCursor?{x:14,y:14}:{x:b.x-e.x,y:b.y-e.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;ch?-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=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;fh?-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=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=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 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(); +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&&a.which===8)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)){if(a.keyCode>=37&&a.keyCode<=40&&SC.browser.mozilla)return YES;if(b=this.sendEvent("keyDown",a)){if(b=a.hasCustomEventHandling)c=NO}else b=!this.attemptKeyEquivalent(a)}return c? -NO:b},keypress:function(a){var b;if(SC.browser.mozilla&&a.which===8){a.which=a.keyCode;return(b=this.sendEvent("keyDown",a))?SC.allowsBackspaceToPreviousPage||a.hasCustomEventHandling:YES}else{b=a.keyCode>=37&&a.keyCode<=40&&SC.browser.mozilla;if(a.charCode!==undefined&&a.charCode===0&&!b)return YES;if(b)a.which=a.keyCode;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},mousedown:function(a){try{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)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){console.warn("Exception during mousedown: %@".fmt(f));this._mouseDownView=null;this._mouseCanDrag=NO;throw f;}return e?a.hasCustomEventHandling:YES},mouseup:function(a){try{if(this._drag){this._drag.tryToPerform("mouseUp",a);this._drag= -null}var b=null,c=this._mouseDownView;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){c=this.targetViewForEvent(a);if(this._clickCount===2)b=this.sendEvent("doubleClick",a,c);b||(b=this.sendEvent("click",a,c))}this._mouseCanDrag=NO;this._mouseDownView=null}catch(d){this._drag=null;this._mouseCanDrag=NO;this._mouseDownView=null;throw d;}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),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;e200)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;e1)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.FieldView.extend(SC.StaticLayout,SC.Button,{classNames:["sc-checkbox-view"],tagName:"label",needsEllipsis:NO,render:function(a,b){if(b){var c=this.get("isEnabled")?"":'disabled="disabled"',d=SC.guidFor(this);b=this._field_currentDisplayTitle=this.get("displayTitle");SC.browser.msie&&a.attr("for",d);a.push('');a.push('");this.get("needsEllipsis")?a.push('',b,""): -a.push('',b,"");a.attr("name",d)}else{if(a=this.$input()[0])a.disabled=this.get("isEnabled")?NO:YES;b=this.get("displayTitle");if(b!==this._field_currentDisplayTitle){this._field_currentDisplayTitle=b;this.$("span.label").text(b)}}},$input:function(){return this.$("input")},getFieldValue:function(){var a=this.$input().attr("checked");if(a)this._lastFieldValue=null;else if(this._lastFieldValue===SC.MIXED_STATE)a=SC.MIXED_STATE;return a},setFieldValue:function(a){this._lastFieldValue= -a;this.$input().attr("checked",a===SC.MIXED_STATE?NO:!!a)},fieldValueForObject:function(a){return this.computeIsSelectedForValue(a)},objectForFieldValue:function(a){return a===SC.MIXED_STATE?this.get("value"):a?this.get("toggleOnValue"):this.get("toggleOffValue")},didCreateLayer:function(){this.setFieldValue(this.get("fieldValue"));SC.Event.add(this.$input()[0],"click",this,this._field_fieldValueDidChange);SC.Event.add(this.$(".label")[0],"click",this,this._field_fieldValueDidChange)},willDestroyLayer:function(){SC.Event.remove(this.$input()[0], -"click",this,this._field_fieldValueDidChange);SC.Event.remove(this.$(".label")[0],"click",this,this._field_fieldValueDidChange)},mouseDown:function(){this.set("isActive",YES);return this._field_isMouseDown=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.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('');this.get("needsEllipsis")?a.push('', +b,""):a.push('',b,"");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');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("a").attr("href","javascript:;").classNames(SC.clone(SC.CheckboxView.prototype.classNames));if(b===SC.MIXED_STATE)g.push("mixed"); +c[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('');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: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('').push(b.toString()).push("")},renderAction:function(a){a.push('')},renderBranch:function(a,b){var c=[];c.push("branch");c.push(b?"branch-visible":"branch-hidden");a.begin("span").addClass(c).push(" ").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", +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('',b.toString(),"")},renderAction:function(a){a.push('')},renderBranch:function(a,b){var c=[];c.push("branch");c.push(b?"branch-visible":"branch-hidden");a.begin("span").addClass(c).push(" ").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 l=this.get("owner"),k=this.get("contentIndex");this.invokeLast(function(){var m=l.itemViewForContentIndex(k);m&&m._beginEditing&& +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(fb)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(),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)return this;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");b&&b.get("length");b=this.computeLayout();var c=SC.BENCHMARK_RELOAD,d=this.get("nowShowing"),e=this._sc_itemViews,f=this.get("containerView")||this,g,h,j;if(a.isIndexSet&&a.contains(d))a=YES;if(this.willReload)this.willReload(a===YES?null:a);if(a.isIndexSet){if(c)SC.Benchmark.start(c="%@#reloadIfNeeded (Partial)".fmt(this), -YES);a.forEach(function(l){var k=e?e[l]:null;if(d.contains(l)){h=this.itemViewForContentIndex(l,YES);if(k&&k.parentView===f){(j=k.get("layer"))&&j.parentNode&&j.parentNode.removeChild(j);j=null;f.replaceChild(h,k)}else f.appendChild(h)}else if(k&&k.parentView===f){delete e[l];(j=k.get("layer"))&&j.parentNode&&j.parentNode.removeChild(j);j=null;f.removeChild(k)}},this)}else{if(c)SC.Benchmark.start(c="%@#reloadIfNeeded (Full)".fmt(this),YES);if(e)e.length=0;g=[];d.forEach(function(l){g.push(this.itemViewForContentIndex(l, -YES))},this);f.beginPropertyChanges();f.destroyLayer().removeAllChildren();f.set("childViews",g);f.replaceLayer();f.endPropertyChanges()}c&&SC.Benchmark.end(c);b&&this.adjust(b);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(),itemViewForContentIndex:function(a,b){var c=this.get("content"),d=this._sc_itemViews,e=c.objectAt(a),f=this.get("contentDelegate"),g=f.contentGroupIndexes(this,c),h=NO,j,l;if(!d)d=this._sc_itemViews=[];if(!b&&(j=d[a]))return j;if(h=g&&g.contains(a))h=f.contentIndexIsGroup(this,c,a);if(h){if((b=this.get("contentGroupExampleViewKey"))&& -e)l=e.get(b);l||(l=this.get("groupExampleView")||this.get("exampleView"))}else{if((b=this.get("contentExampleViewKey"))&&e)l=e.get(b);l||(l=this.get("exampleView"))}b=this._TMP_ATTRS;b.contentIndex=a;b.content=e;b.owner=b.displayDelegate=this;b.parentView=this.get("containerView")||this;b.page=this.page;b.layerId=this.layerIdFor(a,e);b.isEnabled=f.contentIndexIsEnabled(this,c,a);b.isSelected=f.contentIndexIsSelected(this,c,a);b.outlineLevel=f.contentIndexOutlineLevel(this,c,a);b.disclosureState=f.contentIndexDisclosureState(this, -c,a);b.isGroupView=h;b.isVisibleInWindow=this.isVisibleInWindow;b.classNames=h?this._GROUP_COLLECTION_CLASS_NAMES:this._COLLECTION_CLASS_NAMES;if(c=this.layoutForContentIndex(a))b.layout=c;else delete b.layout;j=this.createItemView(l,a,b);return d[a]=j},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)return this;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("contentDelegate").contentGroupIndexes(this,c),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(),e=this.get("content"),f=this.get("selectionDelegate");e=this.get("contentDelegate").contentGroupIndexes(this,e);var g;if(!e&&f.collectionViewShouldSelectIndexes===this.collectionViewShouldSelectIndexes)return a;for(;a=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(),d=this.get("content"),e=this.get("selectionDelegate");d=this.get("contentDelegate").contentGroupIndexes(this,d);var f;if(SC.none(a))a=-1;if(!d&&e.collectionViewShouldSelectIndexes===this.collectionViewShouldSelectIndexes)return a;for(;a>=0;){if(!d||!d.contains(a)){c.add(a);if((f=e.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=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},_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(ba){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(b0){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=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(l){g.push(h.objectAt(l-j));h.removeAt(l-j);j++;l0){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('');this.get("needsEllipsis")?a.push('"):a.push("")}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"); +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,r,u,q,s,w;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=[];r=[];u=[];a.forEach(function(v){e=j?j[v]:null;if(h.contains(v))e&&e.parentView===k?r.push(v):u.push(v);else e&&e.parentView===k&&o.push(v)},this);c=0;for(d=o.length;c0){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",r);c.set("disclosureState",f);c.set("isVisibleInWindow",u);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=r;c.disclosureState=f;c.isGroupView=h;c.isVisibleInWindow=u;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=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=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(ba){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(b0){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=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++;k0){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('');this.get("needsEllipsis")?a.push('',c,""):a.push('',c,"")}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(l){h+=this.rowHeightForContentIndex(l)-c;g[l+1]=h;j=l},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(a0&&f>=c;){g--;f-=this.rowHeightForContentIndex(g)}for(f+=this.rowHeightForContentIndex(g);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);ba)b=a;return SC.IndexSet.create(g,b-g)},insertionPointView:SC.View.extend({classNames:"sc-list-insertion-point", @@ -871,98 +890,108 @@ b)*c;return SC.IndexSet.create(d,a-d)},layoutForContentIndex:function(a){var b=t return c},insertionPointClass:SC.View.extend({classNames:["grid-insertion-point"],render:function(a,b){b&&a.push('')}}),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=0)this._value=b}else return Math.min(this._value||0,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(a,b){var c=this.get("maximum");switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:a.addClass("sc-vertical");if(b)a.push('
 
');else this.$("div")[0].style.height=c+"px";break;case SC.LAYOUT_HORIZONTAL:a.addClass("sc-horizontal");if(b)a.push('
 
');else this.$("div")[0].style.width=c+"px";break;default:throw"You must set a layoutDirection for your scroller class.";}a.setClass("disabled",!this.get("isEnabled"))},didCreateLayer:function(){var a=this._sc_scroller_scrollDidChange;SC.Event.add(this.$(),"scroll",this,a);a=this.get("value");var b=this.get("layer"); -switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:b.scrollTop=a;break;case SC.LAYOUT_HORIZONTAL:b.scrollLeft=a;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();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;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")){a=this.get("layer");b=0;switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:this._sc_scrollValue=b=a.scrollTop;break;case SC.LAYOUT_HORIZONTAL:this._sc_scrollValue=b=a.scrollLeft;break}this.set("value",b);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 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,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")* +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")?'
':'
';switch(this.get("layoutDirection")){case SC.LAYOUT_VERTICAL:a.push('
', +'
',d,'
','
','
','
');break;case SC.LAYOUT_HORIZONTAL:a.push('
','
',d,'
','
','
','
')}}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(dc)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=b?a.get("scrollerThickness"):0,h=d?c.get("scrollerThickness"):0;if(b){a.set("layout",{left:0,bottom:0,right:h-1,height:g});f.bottom=g-1}else f.bottom=0;a&&a.set("isVisible", -b);if(d){g+=this.get("verticalScrollerBottom");c.set("layout",{top:0,bottom:g,right:0,width:h});f.right=h-1}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);this._scroll_wheelDeltaX=this._scroll_wheelDeltaY=0},createChildViews:function(){var a=[],b;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.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"),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"))){c-=1;this.get("autohidesHorizontalScroller")&& -this.set("isHorizontalScrollerVisible",c>d.width);a.setIfChanged("maximum",c)}if(this.get("hasVerticalScroller")&&(a=this.get("verticalScrollerView"))){b-=1;this.get("autohidesVerticalScroller")&&this.set("isVerticalScrollerVisible",b>d.height);b-=this.get("verticalScrollerBottom");a.setIfChanged("maximum",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=db,f=c>d;if(e&&f)this.scrollTo(d,b);else if(e)this.scrollTo(c,b);else f&&this.scrollTo(d,a)})}.observes("frame"),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"))}});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)this.get("scrollDown")?a.push(' '): -a.push(' ');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.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('
');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.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:function(){}.property(),hasHorizontalScroller:NO,horizontalScrollerView:SC.MenuScrollerView,isHorizontalScrollerVisible:NO,canScrollHorizontal:function(){return false}.property("isHorizontalScrollerVisible").cacheable(),autohidesHorizontalScroller:NO,hasVerticalScroller:YES,verticalScrollerView:SC.MenuScrollerView,verticalScrollerView2:SC.MenuScrollerView,isVerticalScrollerVisible:YES,canScrollVertical:function(){return YES}.property("isVerticalScrollerVisible").cacheable(), -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],l=this.get("verticalScrollOffset"),k={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(l===0){e.top=0;e.bottom=g;b.set("layout",k);a.set("layout",n)}else if(l>=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(){}.observes("horizontalScrollOffset"),_scroll_verticalScrollOffsetDidChange:function(){var a= -this.get("verticalScrollOffset")+1,b=this.get("contentView");b&&b.adjust("top",0-a)}.observes("verticalScrollOffset")});sc_require("views/button"); +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,10)}},displayProperties:"value minimum maximum isIndeterminate".w(), +_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(cg)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('
');a.push('
')}else{a.setClass(d);a=this.$(".sc-inner");b=this.get("animatedBackgroundMatrix");a.css("width",c).css("left",e);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}}}, -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.FieldView.extend({classNames:["sc-radio-view"],value:null,layoutDirection:SC.LAYOUT_VERTICAL,escapeHTML:YES,items:[],itemTitleKey:null,itemValueKey:null,itemIsEnabledKey:null,itemIconKey:null,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,l,k,m,n,o;for(m=0;m=0?e:SC.BLANK_IMAGE_URL;e=g===e? -"":e;e=''}else e="";l=this._getSelectionState(c,m,n,false);g=!c[2]||!this.get("isEnabled")?'disabled="disabled" ':"";h=this.escapeHTML?SC.RenderContext.escapeHTML(c[0]):c[0];a.push('")}this._field_setFieldValue(this.get("value"))}else this.$input().forEach(function(o){o=this.$(o); -d=parseInt(o.val(),0);c=d>=0?k[d]:null;o.attr("disabled",!c[2]||!this.get("isEnabled")?"disabled":null);j=this._getSelectionState(c,m,n,true);o.parent().setClass(j);d=j=null},this)},_getSelectionState:function(a,b,c,d){var e;b=a?c?b.indexOf(a[1])>=0:b===a[1]:NO;a={sel:b&&!c,mixed:b&&c,disabled:!a[2]};if(d)return a;else{d=[];for(e in a)a.hasOwnProperty(e)&&a[e]&&d.push(e);return d.join(" ")}},getFieldValue:function(){var a=this.$input().filter(function(){return this.checked}).val();return(a=this.get("displayItems")[parseInt(a, -0)])?a[1]:this._mixedValue},setFieldValue:function(a){if(SC.isArray(a))if(a.get("length")>1){this._mixedValue=a;a=undefined}else a=a.objectAt(0);var b,c;if(a===undefined)c=-1;else{b=this.get("displayItems");c=b.indexOf(b.find(function(d){return d[1]===a}))}this.$input().forEach(function(d){d=SC.$(d);d.attr("checked",parseInt(d.val(),0)===c)});return this},didCreateLayer:function(){this.setFieldValue(this.get("fieldValue"));for(var a=this.$input(),b=0,c=a.length;b --1)break;a=a.parentNode}if(!a)return NO;a=this.$(a);a.addClass("active");this._activeRadioButton=a;return this._field_isMouseDown=YES},mouseUp:function(){var a=this._activeRadioButton;if(a){a.removeClass("active");this._activeRadioButton=null}}}); +c,";left: ",e,'px;">','
',"
",'
','
','
')}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=0?e:SC.BLANK_IMAGE_URL;e=f===e?"":e;e=''}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('
','','',e,f,"
")}}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-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"],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,l=SC._segmented_fetchKeys,k=SC._segmented_fetchItem;for(h=0;h=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,l,k,m,n,o;for(m=0;m=0:k[1]===c)o.push("sel");e===m&&o.push("active");if(k[4]){k=k[4];n.width=k+"px"}l.addClass(o);l.addStyle(n);j&&l.attr("title",j);if(h){j=h.indexOf("/")>=0?h:SC.BLANK_IMAGE_URL;h=j===h?"":h;h=''}else h="";l.push('");l.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")&&a.attr("tagName")==="A")c=a;else a=a.parent();return c?this.$("a.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=0:b[1]===e)this.triggerItemAtIndex(a+1)}return YES}else if(a.which===37||a.which===38){for(a=1;a=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= +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=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=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=''}else h="";k.push('");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=0:b[1]===e)this.triggerItemAtIndex(a+1)}return YES}else if(a.which===37||a.which===38){for(a=1;a=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 cd?1:0})}return a},render:function(a,b){arguments.callee.base.apply(this,arguments);var c,d,e,f,g,h,j,l,k,m,n,o,r,u,q;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");l=this.get("localize");m=[];n=YES;o=0;c.forEach(function(t){if(t){r=d?t.get?t.get(d):t[d]:t.toString();r=l?r.loc():r;u=e?t.get?t.get(e):t[e]:null;if(SC.none(t[e]))u=null;q=f?t.get?t.get(f): -t[f]:t;if(!SC.none(j)&&!SC.none(q))if(j===q){this.set("title",r);this.set("icon",u)}if(q===this.get("value")){this.set("_itemIdx",o);n=!h?NO:YES}else n=NO;k=g?t.get?t.get(g):t[g]:NO;if(o===0){this._defaultVal=q;this._defaultTitle=r;this._defaultIcon=u}t=SC.Object.create({separator:k,title:r,icon:u,value:q,isEnabled:YES,checkbox:n,action:this.displaySelectedItem});m.push(t)}o+=1;this.set("_itemList",m)},this);b&&this.invokeLast(function(){var t=this.get("value");if(SC.none(t)){this.set("value",this._defaultVal); +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,r,u,q;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){r=d?s.get?s.get(d):s[d]:s.toString();r=k?r.loc():r;u=e?s.get?s.get(e):s[e]:null;if(SC.none(s[e]))u=null;q=f?s.get?s.get(f): +s[f]:s;if(!SC.none(j)&&!SC.none(q))if(j===q){this.set("title",r);this.set("icon",u)}if(q===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=q;this._defaultTitle=r;this._defaultIcon=u}s=SC.Object.create({separator:l,title:r,icon:u,value:q,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;cf)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 cd?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 l=this.get("emptyName");if(l){if(j)l=l.loc();if(b){a.push('");a.push('')}else{g=document.createElement("option");g.value="***";g.innerHTML= -l;h.appendChild(g);g=document.createElement("option");g.disabled="disabled";h.appendChild(g)}}e.forEach(function(k){if(k){var m=c?k.get?k.get(c):k[c]:k.toString();if(j)m=m.loc();if(k=d?k.get?k.get(d):k[d]:k)k=SC.guidFor(k)?SC.guidFor(k):k.toString();var n=this.validateMenuItem&&this.validateMenuItem(k,m)?"":'disabled="disabled" ';if(b)a.push("");else{g=document.createElement("option");g.value=k;g.innerHTML=m;if(n.length>0)g.disable="disabled";h.appendChild(g)}}else if(b)a.push(''); +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('",'');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("");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(''); 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, +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('','','','',""):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},touchStart:function(a){this.mouseDown(a)},touchMoved:function(a){this.mouseDragged(a)},touchEnd:function(a){this.mouseUp(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");if(a.changedTouches&&a.changedTouches.length>0)a=this.convertFrameFromView({x:a.changedTouches[0].pageX}).x;else{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('');a.push('');a.push('')},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"); +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('
','','
')},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)}}); @@ -979,131 +1008,63 @@ h-f;this._topLeftView=this.get("topLeftView");this._bottomRightView=this.get("bo 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"),l=this.get("topLeftMinThickness");b.get("isCollapsed")||(g+=d);c.get("isCollapsed")|| -(g+=e);SC.none(j)||(h=Math.min(j,h));SC.none(l)||(h=Math.max(l,h));j=this.get("bottomRightMaxThickness");l=this.get("bottomRightMinThickness");h=g-h;SC.none(j)||(h=Math.min(j,h));SC.none(l)||(h=Math.max(l,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>= +-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"), -l=this.get("topLeftMinThickness");b.get("isCollapsed")||(g+=d);c.get("isCollapsed")||(g+=e);SC.none(j)||(h=Math.min(j,h));SC.none(l)||(h=Math.max(l,h));j=this.get("bottomRightMaxThickness");l=this.get("bottomRightMinThickness");h=g-h;SC.none(j)||(h=Math.min(j,h));SC.none(l)||(h=Math.max(l,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- +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.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,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;b=this.containerView=this.createChildView(this.containerView.extend({layout:this.get("tabLocation")===SC.TOP_LOCATION?{top:12,left:0,right:0,bottom:0}:{top:0,left:0,right:0,bottom:12}}));a.push(b);b=this.segmentedView=this.createChildView(this.segmentedView);a.push(b);this.set("childViews",a);return this},containerView:SC.ContainerView,segmentedView:SC.SegmentedView.extend({layout:{left:0,right:0,height:24},_sc_tab_segmented_valueDidChange:function(){var a= -this.get("parentView");a&&a.set("nowShowing",this.get("value"));this.set("layerNeedsUpdate",YES);this.invokeOnce(this.updateLayerIfNeeded)}.observes("value"),render:function(a){arguments.callee.base.apply(this,arguments);var b=this.get("parentView");(b?b.get("tabLocation"):SC.TOP_LOCATION)===SC.TOP_LOCATION?a.addStyle("top","0px"):a.addStyle("bottom","0px")},init:function(){var a=this.get("parentView");a&&SC._TAB_ITEM_KEYS.forEach(function(b){this[b]=a.get(b)},this);return arguments.callee.base.apply(this, -arguments)}})});SC._TAB_ITEM_KEYS="itemTitleKey itemValueKey itemIsEnabledKey itemIconKey itemWidthKey itemToolTipKey".w(); +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('');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.WellView=SC.ContainerView.extend({classNames:"sc-well-view",contentLayout:{top:10,bottom:10,left:10,right:10},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("
","
","
","
","
","
", -"
","
","
");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/a130a04e21382c6564992d11ba7de6cd3635b4ba/javascript.js"); -tiki.register("sproutcore",{packages:{"sproutcore/runtime":{scripts:[{url:"/static/sproutcore/runtime/en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js",id:"sproutcore/runtime:en/34ff3816b07f9f4cb5fb6b5e5ce2f15b5362e711/javascript.js"}]},"sproutcore/datastore":{scripts:[{url:"/static/sproutcore/datastore/en/24fcfdc3a4d561b8c1fe714e5331b2f2fda8e205/javascript.js",id:"sproutcore/datastore:en/24fcfdc3a4d561b8c1fe714e5331b2f2fda8e205/javascript.js"}]},"sproutcore/foundation":{stylesheets:[{url:"/static/sproutcore/foundation/en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/stylesheet.css", -id:"sproutcore/foundation:en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/stylesheet.css"}],scripts:[{url:"/static/sproutcore/foundation/en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/javascript.js",id:"sproutcore/foundation:en/3bfaa54e342a11ea46fb06655b8fb1351c2ad19f/javascript.js"}]},"sproutcore/desktop":{stylesheets:[{url:"/static/sproutcore/desktop/en/a130a04e21382c6564992d11ba7de6cd3635b4ba/stylesheet.css",id:"sproutcore/desktop:en/a130a04e21382c6564992d11ba7de6cd3635b4ba/stylesheet.css"}],scripts:[{url:"/static/sproutcore/desktop/en/a130a04e21382c6564992d11ba7de6cd3635b4ba/javascript.js", -id:"sproutcore/desktop:en/a130a04e21382c6564992d11ba7de6cd3635b4ba/javascript.js"}]},tiki:{scripts:[{url:"/static/tiki/en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js",id:"tiki:en/9f76cda2d7e44b7acc4c94bb51f3277709b0cb56/javascript.js"}]}},depends:["tiki","sproutcore/runtime","sproutcore/datastore","sproutcore/foundation","sproutcore/desktop"],scripts:[{url:"/static/sproutcore/en/38a77176a1ba19e822801725ce96a7c78ad809b8/javascript.js",id:"sproutcore:en/38a77176a1ba19e822801725ce96a7c78ad809b8/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/38a77176a1ba19e822801725ce96a7c78ad809b8/javascript.js"); -tiki.register("sproutcore/animation",{packages:{sproutcore:{scripts:[{url:"/static/sproutcore/en/38a77176a1ba19e822801725ce96a7c78ad809b8/javascript.js",id:"sproutcore:en/38a77176a1ba19e822801725ce96a7c78ad809b8/javascript.js"}]}},depends:["sproutcore"],scripts:[{url:"/static/sproutcore/animation/en/e88bac9dc7d0dabf706f4b845c32e0090984f5cb/javascript.js",id:"sproutcore/animation:en/e88bac9dc7d0dabf706f4b845c32e0090984f5cb/javascript.js"}]});tiki.global("sproutcore/animation"); -SC.Animatable={isAnimatable:YES,transitions:{},concatenatedProperties:["transitions"],style:{},_cssTransitionFor:{left:"left",top:"top",right:"right",bottom:"bottom",width:"width",height:"height",opacity:"opacity"},_styleProperties:["opacity","display"],_layoutStyles:"width height top bottom marginLeft marginTop left right zIndex minWidth maxWidth minHeight maxHeight centerX centerY".w(),_animationsToStart:{},_animationOrder:["top","left","bottom","right","width","height","centerX","centerY","opacity", -"display"],_transitionCallbacks:{},initMixin:function(){this._animatable_original_didCreateLayer=this.didCreateLayer||function(){};this.didCreateLayer=this._animatable_didCreateLayer;this._animatable_original_did_update_layer=this.didUpdateLayer||function(){};this.didUpdateLayer=this._animatable_did_update_layer;this._animatable_original_willDestroyLayer=this.willDestroyLayer||function(){};this.willDestroyLayer=this._animatable_willDestroyLayer;this._animatable_original_willRemoveFromParent=this.willRemoveFromParent|| -function(){};this.willRemoveFromParent=this._animatable_will_remove_from_parent;this._animateTickPixel.displayName="animate-tick";var a;if(SC.isArray(this.transitions)){var b={};for(a=0;a=0?b:d,l=j[g],k=a[g];if(k!==undefined&&l!==k)if(k===null){if(l!==undefined)h=YES;delete j[g]}else{j[g]=k;h=YES}if(h)if(j===b)c=YES; -else e=YES}c&&this.set("style",b);e&&this.set("layout",d);return this},transitionEnd:function(a){(a=this._transitionCallbacks[a.originalEvent.propertyName])&&SC.Animatable.runCallback(a)},getCurrentJavaScriptStyles:function(){return this._animatableCurrentStyle},resetAnimation:function(){this._animatableCurrentStyle=null;this._stopJavaScriptAnimations();this.disableAnimation();this.updateStyle();this.enableAnimation()},_stopJavaScriptAnimations:function(){for(var a in this._animators)this._animators[a]&& -this._animators[a].isQueued&&SC.Animatable.removeTimer(this._animators[a])},_getStartStyleHash:function(a,b){var c=this.layout;this.layout=a;this.notifyPropertyChange("layout");var d=this.get("frame"),e=this.computeParentDimensions();this.layout=c;c={};for(var f in b){if(d)if(f=="left"){c[f]=d.x;continue}else if(f=="top"){c[f]=d.y;continue}else if(f=="right"){c[f]=e.width-d.x-d.width;continue}else if(f=="bottom"){c[f]=e.height-d.y-d.height;continue}else if(f=="width"){c[f]=d.width;continue}else if(f== -"height"){c[f]=d.height;continue}else if(f=="centerX"){c[f]=d.x+d.width/2-e.width/2;continue}else if(f=="centerY"){c[f]=d.y+d.height/2-e.height/2;continue}c[f]=SC.none(a[f])?b[f]:a[f]}return c},_TMP_CSS_TRANSITIONS:[],updateStyle:function(){var a=this.get("layer"),b=this.get("style"),c;if(!this._animatableCurrentStyle||this._disableAnimation>0||!a){this._animatableCurrentStyle={};for(c in b)if(c[0]!="_")this._animatableCurrentStyle[c]=b[c];a&&this._animatableApplyStyles(a,b);return this}if(a){var d= -true;for(c in b)if(c[0]!="_")if(b[c]!=this._animatableCurrentStyle[c]){d=false;break}if(d)return this;d=this._getStartStyleHash(this._animatableCurrentStyle,b);var e,f=this._TMP_CSS_TRANSITIONS;if(SC.Animatable.enableCSSTransitions)for(c in this.transitions)if(this._cssTransitionFor[c]){var g="linear";if(this.transitions[c].timing||SC.Animatable.defaultTimingFunction){e=this.transitions[c].timing||SC.Animatable.defaultTimingFunction;g=SC.typeOf(e)!=SC.T_STRING?"cubic-bezier("+e[0]+", "+e[1]+", "+ -e[2]+", "+e[3]+")":e}f.push(this._cssTransitionFor[c]+" "+this.transitions[c].duration+"s "+g)}for(c in b)if(c[0]!="_"){g=!this.transitions[c]||b[c]==d[c];if(c=="display"&&b[c]!="none")g=true;if(g){d[c]=b[c];if(g=this._animators[c]){g.endValue=b[c];g.end=0}}else if(SC.Animatable.enableCSSTransitions&&this._cssTransitionFor[c]){d[c]=b[c];if(this.transitions[c].action)this._transitionCallbacks[c]={source:this,target:this.transitions[c].target||this,action:this.transitions[c].action}}else{e=this._animateTickPixel; -var h=c,j=d[c],l=b[c];if(h=="centerX"||h=="centerY")e=this._animateTickCenter;else if(h=="opacity")e=this._animateTickNumber;else if(h=="display")e=this._animateTickDisplay;this._animators[c]||(this._animators[c]={});g=this._animators[c];g.start=null;g.duration=Math.floor(this.transitions[c].duration*1E3);g.startValue=j;g.endValue=l;g.layer=a;g.property=h;g.action=e;g.style=a.style;g.holder=this;if(this.transitions[c].action)g.callback={source:this,target:this.transitions[c].target||this,action:this.transitions[c].action}; -if((e=this.transitions[c].timing||SC.Animatable.defaultTimingFunction)&&SC.typeOf(e)!=SC.T_STRING)g.timingFunction=e;g.going||(this._animationsToStart[c]=g)}}b=this._animationOrder;g=this._animationOrder.length;for(c=0;c=0){d[g]=b[g];e=YES}else c[g]&&c[g](f,g,b);if(e){b=this.holder.layout;this.holder.layout=d;this.holder.notifyPropertyChange("layoutStyle");d=this.holder.get("layoutStyle");for(var h in d)if(SC.none(d[h]))f[h]= -"";else if(f[h]!=d[h])f[h]=d[h];this.holder.layout=b}a.end()},_animatable_did_update_layer:function(){this._animatable_original_did_update_layer();var a=this._animatableCurrentStyle,b=this.get("layer");if(!a){a={};var c=this.get("style"),d=this.get("layout");SC.mixin(a,c,d)}this._animatableApplyStyles(b,a)},updateLayout:function(){var a=SC.clone(this.get("style")),b=this.get("layout"),c=0,d=this._layoutStyles,e=d.length,f=NO;for(c=0;cj)return j;for(;hf)h=d;else j=d;d=(j-h)*0.5+h}return d},_solveBezier:function(a,b,c,d,e,f){var g=3*a;c=3*(c-a)-g;a=3*b;b=3*(d-b)-a;d=1-a-b;e=this._solveBezierForT(1-g- -c,d,c,b,g,a,e,f);return((d*e+b)*e+a)*e},_animateTickPixel:function(a){if(SC.none(this.start)){this.start=a;this.end=this.start+this.duration}var b=this.start,c=this.end,d=this.startValue,e=c-b,f=this.endValue-d;b=Math.min((a-b)/e,1);if(this.timingFunction){var g=this.timingFunction;b=this.holder._solveBezier(g[0],g[1],g[2],g[3],b,e)}d=Math.floor(d+f*b);this.holder._animatableCurrentStyle[this.property]=d;this.style[this.property]=d+"px";if(a=0){var c=a.action.split(".");b=c.pop();c=SC.objectForPropertyPath(c,window);if((b=c.get?c.get(b):c[b])&&SC.typeOf(b)==SC.T_FUNCTION)b.call(c);else throw"SC.Animator could not find a function at %@".fmt(a.action);}else SC.RootResponder.responder.sendAction(a.action, -a.target)}});(function(){if(function(){var a=document.createElement("div"),b=["-webkit"],c=["moz","Moz","o","ms","webkit"],d="",e=null;for(e=0;e5)){f=!!SC._mapDisplayNamesUseHashForSeenTypesHash[SC.typeOf(a)];var l;if(f){l=SC.hashFor(a);g=d[l]}else g=e;if(!(g&&g.indexOf(a)!==-1)){if(g)g.push(a); -else if(f)d[l]=[a];l=c.length;c[l]="";for(var k in a)if(!(a.hasOwnProperty&&!a.hasOwnProperty(k)))if(isNaN(Number(k)))if(k!=="constructor")if(k!=="superclass")if(k!=="document"){f=a[k];if(k==="SproutCore")k="SC";g=SC.typeOf(f);if(g===SC.T_FUNCTION){if(!f.displayName){c[l]=k;g=c.join(".").replace(".prototype.","#");f.displayName=g}if(f.prototype){c.push("prototype");SC.mapDisplayNames(f.prototype,b+1,c,d,e);c.pop()}}else if(g===SC.T_CLASS){c[l]=k;SC.mapDisplayNames(f,b+1,c,d,e)}else if(k.indexOf("_")!== -0&&(g===SC.T_OBJECT||g===SC.T_HASH)){c[l]=k;SC.mapDisplayNames(f,b+1,c,d,e)}}c.pop()}}}};SC=SC||{}; -SC.addInvokeOnceLastDebuggingInfo=function(){SC.ObserverSet.add=function(a,b,c,d,e,f){var g=a?SC.guidFor(a):"__this__",h=this[g];if(!h){h=this[g]=SC.CoreSet.create();h.target=a;h.isTargetSet=YES;this.targets++}h.add(b);if(c!==undefined){a=h.contexts;c||(a={});a[SC.guidFor(b)]=c}if(e!==undefined){c=h.originatingTargets;a=h.originatingMethods;g=h.originatingStacks;if(!c)c=h.originatingTargets={};if(!a)a=h.originatingMethods={};if(!g)g=h.originatingStacks={};b=SC.guidFor(b);if((h=a[b])&&SC.typeOf(h)!== -SC.T_ARRAY){var j=g[b];c[b]=[c[b],d];a[b]=[h,e];g[b]=[j,f]}else{c[b]=d;a[b]=e;g[b]=f}}this._membersCacheIsValid=NO};SC.ObserverSet.invokeMethods=function(){for(var a in this)if(this.hasOwnProperty(a)){var b=this[a];if(b&&b.isTargetSet)for(var c=b.length,d=b.target,e,f=SC.LOG_RUNLOOP_INVOCATIONS;--c>=0;){e=b[c];if(f){var g=e.displayName||e,h=SC.guidFor(e),j=b.originatingTargets[h],l=b.originatingMethods[h];h=b.originatingStacks[h];if(l&&SC.typeOf(l)===SC.T_ARRAY){console.log("Invoking runloop-scheduled method %@ on %@, which was scheduled by multiple target/method pairs:".fmt(g, -d));var k,m,n,o;g=0;for(k=l.length;g'.fmt(b);a.push(b)}else a.push(this.get("label"));a.end()},init:function(){var a=this.get("column");a.addObserver("width",this,"_scthv_layoutDidChange");a.addObserver("maxWidth",this,"_scthv_layoutDidChange");a.addObserver("minWidth",this,"_scthv_layoutDidChange");a.addObserver("sortState",this,"_scthv_sortStateDidChange");a.addObserver("tableContent",this,"_scthv_tableContentDidChange");return arguments.callee.base.apply(this,arguments)},sortState:function(){return this.get("column").get("sortState")}.property(), -mouseDown:function(a){var b=this.get("tableView");return b?b.mouseDownInTableHeaderView(a,this):arguments.callee.base.apply(this,arguments)},mouseUp:function(a){var b=this.get("tableView");return b?b.mouseUpInTableHeaderView(a,this):arguments.callee.base.apply(this,arguments)},mouseDragged:function(a){var b=this.get("tableView");return b?b.mouseDraggedInTableHeaderView(a,this):arguments.callee.base.apply(this,arguments)},_scthv_dragViewForHeader:function(){var a=this.get("layer").cloneNode(true), -b=SC.View.create({layer:a,parentView:this});SC.$(a).css("backgroundColor","transparent").css("border","none").css("top",0).css("left",0);return b},_scthv_enterDragMode:function(){this.set("isInDragMode",YES)},_scthv_exitDragMode:function(){this.set("isInDragMode",NO)},_scthv_dragModeViewDidChange:function(){var a=this.get("dragModeView");if(a&&a.set){a.set("tableHeadView",this);a.set("tableView",this.get("tableView"))}}.observes("dragModeView"),_scthv_layoutDidChange:function(){var a=this.get("parentView"); -a.invokeOnce(a.layoutChildViews);this.get("layout")},_scthv_tableContentDidChange:function(){var a=this.get("column").get("tableContent");this.set("content",this.get("parentView")._scthv_columnContentFromTableContent(a,this.get("columnIndex")))},_scthv_sortStateDidChange:function(){SC.RunLoop.begin();var a=this.get("column").get("sortState"),b=this.get("classNames");b.removeObject("sc-table-header-sort-asc");b.removeObject("sc-table-header-sort-desc");b.removeObject("sc-table-header-sort-active"); -a!==null&&b.push("sc-table-header-sort-active");a===SC.SORT_ASCENDING&&b.push("sc-table-header-sort-asc");a===SC.SORT_DESCENDING&&b.push("sc-table-header-sort-desc");this.displayDidChange();this.invokeOnce("updateLayer");SC.RunLoop.end()}});sc_require("views/table");sc_require("views/table_header"); -SC.TableHeadView=SC.View.extend({layout:{height:18,left:0,right:0,top:0},classNames:["sc-table-head"],cells:[],acceptsFirstResponder:YES,dragOrder:null,init:function(){this._scthv_handleChildren()},columns:function(){return this.get("parentView").get("columns")}.property(),renderChildViews:function(a,b){var c=this.get("cells"),d,e;for(e=0;e0&&this.replaceAllChildren(f)},_scthv_createTableHeader:function(a,b,c,d){var e=this.get("parentView");return SC.TableHeaderView.create({column:a,label:b,content:c,tableView:e,columnIndex:d})}});sc_require("views/list");sc_require("views/table_row");sc_require("views/table_head");sc_require("mixins/table_delegate"); -SC.TableView=SC.ListView.extend(SC.TableDelegate,{classNames:["sc-table-view"],childViews:"tableHeadView scrollView".w(),scrollView:SC.ScrollView.design({isVisible:YES,layout:{left:-1,right:0,bottom:0,top:19},hasHorizontalScroller:NO,borderStyle:SC.BORDER_NONE,contentView:SC.View.design({}),_sv_offsetDidChange:function(){this.get("parentView")._sctv_scrollOffsetDidChange()}.observes("verticalScrollOffset","horizontalScrollOffset")}),hasHorizontalScroller:NO,hasVerticalScroller:NO,selectOnMouseDown:NO, -containerView:function(){var a=this.get("scrollView");return a&&a.get?a.get("contentView"):null}.property("scrollView"),layout:{left:0,right:0,top:0,bottom:0},init:function(){window.table=this;return arguments.callee.base.apply(this,arguments)},canReorderContent:NO,isInDragMode:NO,mouseDownInTableHeaderView:function(a,b){b=b.get("column");if(!b.get("isReorderable")&&!b.get("isSortable"))return NO;this._mouseDownEvent=a;this._mouseDownTimer=SC.Timer.schedule({target:this,action:"_scthv_enterDragMode", -interval:300});return YES},mouseUpInTableHeaderView:function(a,b){if(!this.get("isInDragMode")){a=b.get("column");this.set("sortedColumn",a);b=a.get("sortState")===SC.SORT_ASCENDING?SC.SORT_DESCENDING:SC.SORT_ASCENDING;a.set("sortState",b)}this._dragging=false;this._mouseDownTimer&&this._mouseDownTimer.invalidate()},mouseDraggedInTableHeaderView:function(a,b){SC.RunLoop.begin();if(!this.get("isInDragMode"))return NO;if(!this._dragging){SC.Drag.start({event:this._mouseDownEvent,source:b,dragView:this._scthv_dragViewForHeader(), -ghost:YES});this._dragging=true}return arguments.callee.base.apply(this,arguments)},columns:[],flexibleColumn:null,sortedColumn:null,hasTableHead:YES,tableHeadView:SC.TableHeadView.design({layout:{top:0,left:0,right:0}}),tableHeadHeight:18,hasUniformRowHeights:YES,rowHeight:18,exampleView:SC.TableRowView,isInColumnDragMode:NO,filterKey:null,rowOffsetForContentIndex:function(a){var b=0;if(this.get("hasUniformRowHeights"))return b+this.get("rowHeight")*a;else{for(;0","
","
", +"
","
","
","
","
","
");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:"Defines a new extension point",params:[{name:"name",type:"string",description:"the extension point's name",required:true},{name:"description",type:"string",description:"description of what the extension point is for"},{name:"params",type:"array of objects",description:"parameters that provide the metadata for a given extension. Each object should have name and description, minimally. It can also have a 'type' (eg string, pointer, or array) and required to denote whether or not this parameter must be present on the extension."}, +{name:"indexOn",type:"string",description:"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."},{name:"register",type:"pointer",description:"function that is called when a new extension is discovered. Note that this should be used sparingly, because it will cause your plugin to be loaded whenever a matching plugin appears."},{name:"unregister",type:"pointer",description:"function that is called when an extension is removed. Note that this should be used sparingly, because it will cause your plugin to be loaded whenever a matching plugin appears."}]}, +{ep:"extensionpoint",name:"extensionhandler",description:"Used to attach listeners ",params:[{name:"name",type:"string",description:"name of the extension point to listen to",required:true},{name:"register",type:"pointer",description:"function that is called when a new extension is discovered. Note that this should be used sparingly, because it will cause your plugin to be loaded whenever a matching plugin appears."},{name:"unregister",type:"pointer",description:"function that is called when an extension is removed. Note that this should be used sparingly, because it will cause your plugin to be loaded whenever a matching plugin appears."}]}, +{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",params:[{name:"pointer",description:"Pointer to a function that takes no parameters",required:true}]},{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.loader,g=Object.keys;g||(g=function(m){var n,o=[];for(n in m)m.hasOwnProperty(n)&&o.push(n);return o});var h=function(m,n){if(n){n=n.split("#");return{modName:n[0]?m+":"+n[0]:m,objName:n[1]}}},j=function(m){var n=a(m.modName);if(m.objName)return n[m.objName];return n};b.Extension=c.Object.extend({_getPointer:function(m){m=m||"pointer";return h(this._pluginName,this.get(m))}, -init:function(){this._observers=[]},load:function(m,n){var o=this._getPointer(n);if(!o){console.error("Extension cannot be loaded because it has no 'pointer'");console.log(this);return null}var r=new d;f.async(this._pluginName).then(function(){c.run(function(){var u=a(o.modName);u=o.objName?u[o.objName]:u;m&&m(u);r.resolve(u)})});return r},observe:function(m,n,o){this._observers.push({plugin:m,callback:n,property:o});this.load(n,o)},_getLoaded:function(m){m=this._getPointer(m);return j(m)}});b.ExtensionPoint= -c.Object.extend({init:function(){this.extensions=[];this.handlers=[]},getByKey:function(m){var n=this.get("indexOn");if(n)for(var o=0;o=0;){var B=v.modules[A];if(nameMatch.exec(B))u.push(B);else for(var F=x.length;--F>=0;)if(x[F].exec(B)){u.push(B);break}}u.length>0&&v.clear.apply(v,u);this.catalog.loadMetadata(this.reloadURL).then(function(){f.async(r).then(function(){c.run(function(){for(o in q)t.catalog.plugins[o].register();for(o in q)if(q[o].callPointer){var y=h(o,q[o].callPointer);(n=j(y))&&n(w)}m&&m()})})})}}});b.Catalog=c.Object.extend({init:function(){this.points={};this.plugins={}; -this.getExtensionPoint("extensionpoint").set("indexOn","name");this.load(e.metadata)},getObject:function(m){m=this.getExtensionByKey("factory",m);if(m!==undefined){var n=m.get("instance");if(n)return n;n=m._getLoaded();var o=m.action;if(o=="call")n=n();else if(o=="create")n=n.create();else if(o=="new")n=new n;else if(o=="value")n=n;else throw new Error("Create action must be call|create|new|value. Found"+o);m.set("instance",n);return n}},getExtensionPoint:function(m){if(this.points[m]===undefined)this.points[m]= -b.ExtensionPoint.create({name:m,catalog:this});return this.points[m]},getExtensions:function(m){m=this.getExtensionPoint(m);if(m===undefined)return[];return m.extensions},getExtensionByKey:function(m,n){m=this.getExtensionPoint(m);if(m!==undefined)return m.getByKey(n)},_registerExtensionPoint:function(m){var n=this.getExtensionPoint(m.name);n.handlers.push(m);m.indexOn&&n.set("indexOn",m.indexOn)},_registerExtensionHandler:function(m){var n=this.getExtensionPoint(m.name);n.handlers.push(m);m.register&& -m.load(function(o){if(!o)throw m.name+" is not ready";n.extensions.forEach(function(r){o(r)})},"register")},_toposort:function(m){var n=[],o={},r=function(q){if(!(q in o||!(q in m))){o[q]=true;var t=m[q].depends;c.none(t)||t.forEach(r);n.push(q)}};for(var u in m)r(u);return n},load:function(m){this._toposort(m).forEach(function(n){var o=m[n];o.catalog=this;if(o.provides)for(var r=o.provides,u=0;u0;)m.exec(o[r])&&delete n[o[r]]}; -b.catalog=b.Catalog.create();b.startupHandler=function(m){m.load(function(n){n()})};b.getUserPlugins=function(){return b.catalog.getPlugins({onlyType:"user"})}}); -tiki.module("bespin:promise",function(a,b){function c(){return new d}function d(k,m){function n(B){if(u)throw new Error("This deferred has already been resolved");r=B;u=true;if(m&&q&&t.length===0)throw r;for(B=0;B=0;){var z=x.modules[y];if(K.exec(z))q.push(z);else for(var p=D.length;--p>=0;)if(D[p].exec(z)){q.push(z);break}}q.length>0&&x.clear.apply(x,q);this.catalog.loadMetadataFromURL(this.reloadURL).then(function(){h.async(u).then(function(){c.run(function(){for(r in s)w.catalog.plugins[r].register();for(r in s)if(s[r].callPointer){var t=j(r,s[r].callPointer);(o=k(t))&&o(v)}n&&n()})})},function(){f.error("Failed to load metadata from "+w.reloadURL)})}}});b.Catalog= +c.Object.extend({init:function(){this.points={};this.plugins={};this.deactivatedPlugins={};this._extensionsOrdering=[];this.getExtensionPoint("extensionpoint",true).set("indexOn","name");this.loadMetadata(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 r=n.action;if(r=="call")o=o();else if(r=="create")o=o.create();else if(r=="new")o=new o;else if(r=="value")o=o;else throw new Error("Create action must be call|create|new|value. Found"+ +r);n.set("instance",o);return o}},getExtensionPoint:function(n,o){if(o&&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},orderExtensions:function(n){n=n||this._extensionsOrdering;for(name in this.points)this.points[name].orderExtensions(n);this._extensionsOrdering=n},getExtensionsOrdering:function(){return this._extensionsOrdering},getExtensionByKey:function(n, +o){n=this.getExtensionPoint(n);if(n!==undefined)return n.getByKey(o)},_registerExtensionPoint:function(n){var o=this.getExtensionPoint(n.name,true);o.description=n.description;o._pluginName=n._pluginName;o.params=n.params;o.handlers.push(n);n.indexOn&&o.set("indexOn",n.indexOn)},_registerExtensionHandler:function(n){var o=this.getExtensionPoint(n.name,true);o.handlers.push(n);n.register&&n.load(function(r){if(!r)throw n.name+" is not ready";o.extensions.forEach(function(u){r(u)})},"register")},_toposort:function(n){var o= +[],r={},u=function(s){if(!(s in r||!(s in n))){r[s]=true;var w=n[s].dependencies;if(!c.none(w))for(var v in w)u(v);o.push(s)}};for(var q in n)u(q);return o},loadMetadata:function(n){var o=this.plugins;for(pluginName in n)if(!this.deactivatedPlugins[pluginName]){var r=n[pluginName];if(r.errors){f.error("Plugin ",pluginName," has errors:");r.errors.forEach(function(u){f.error(u)});delete n[pluginName]}else{if(r.dependencies)r.depends=g(r.dependencies);h.register(pluginName,r)}}this._toposort(n).forEach(function(u){var q= +n[u],s=!this.deactivatedPlugins[u];q.catalog=this;if(q.provides&&s){s=q.provides;for(var w=0;w0;)n.exec(r[u])&&delete o[r[u]]}; +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(f){delete b._outstanding[f._id];for(b._recent.push(f);b._recent.length>20;)b._recent.shift()}var d=a("bespin:console").console;a("bespin:util/stacktrace");var e=0;b._outstanding=[];b._recent=[];b.Promise=function(){this._status=0;this._value=undefined;this._onSuccessHandlers=[];this._onErrorHandlers=[];this._id=e++;b._outstanding[this._id]=this};b.Promise.prototype.isPromise=true;b.Promise.prototype.then=function(f,g){f!==null&&f!==undefined&& +this._onSuccessHandlers.push(f);g!==null&&g!==undefined&&this._onErrorHandlers.push(g);this._status!==0&&this._callHandlers();return this};b.Promise.prototype.chainPromise=function(f){var g=new b.Promise;g._chainedFrom=this;this.then(function(h){try{g.resolve(f(h))}catch(j){g.reject(j)}},function(h){g.reject(h)});return g};b.Promise.prototype.resolve=function(f){if(this._status!=0){d.groupCollapsed("Promise already closed");d.error("Attempted resolve() with ",f);d.error("Previous status = ",this._status, +", previous value = ",this._value);d.trace();d.groupEnd()}this._status=1;this._value=f;this._callHandlers();c(this);return this};b.Promise.prototype.reject=function(f){if(this._status!=0){d.group("Promise already closed");d.error("Attempted reject() with ",f);d.error("Previous status = ",this._status,", previous value = ",this._value);d.trace();d.groupEnd()}this._status=-1;this._value=f;this._callHandlers();c(this);return this};b.Promise.prototype._callHandlers=function(){if(this._status===0)throw new Error("call handlers in pending"); +(this._status===1?this._onSuccessHandlers:this._onErrorHandlers).forEach(function(f){f.call(null,this._value)},this);this._onSuccessHandlers.length=0;this._onErrorHandlers.length=0};b.group=function(f){f instanceof Array||(f=Array.prototype.slice.call(arguments));if(f.length===0)return(new b.Promise).resolve([]);var g=new b.Promise,h=[],j=0,k=function(l){return function(m){h[l]=m;j++;j===f.length&&g.resolve(h)}};f.forEach(function(l,m){l.then(k(m),l.reject)});return g}}); 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", @@ -1113,205 +1074,234 @@ tiki.module("bespin:util/cookie",function(a,b){var c=function(d,e){return d.repl 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){var c=b.printStackTrace=function(d){var e=d&&d.e?d.e:null;d=d&&d.guess?d.guess:false;var f=new c.implementation;e=f.run(e);return d?f.guessFunctions(e):e};c.implementation=function(){};c.implementation.prototype={run:function(d){var e=this._mode||this.mode();if(e==="other")return this.other(arguments.callee);else{d=d||function(){try{0()}catch(f){return f}}();return this[e](d)}},mode:function(){try{0()}catch(d){if(d.arguments)return this._mode="chrome"; -if(d.stack)return this._mode="firefox";if(window.opera&&!("stacktrace"in d))return this._mode="opera"}return this._mode="other"},chrome:function(d){return d.stack.replace(/^.*?\n/,"").replace(/^.*?\n/,"").replace(/^.*?\n/,"").replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(d){return d.stack.replace(/^.*?\n/,"").replace(/(?:\n@:0)?\s+$/m,"").replace(/^\(/gm,"{anonymous}(").split("\n")},opera:function(d){d= -d.message.split("\n");var e=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,f,g,h;f=4;g=0;for(h=d.length;f-1};b.indexOfProperty=function(g,h,j){for(var l=0;l\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-1};b.indexOfProperty=function(g,h,j){for(var k=0;k=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"+e.setting+" = "+c.get(e.setting);else{g="Setting: "+e.setting+" = "+e.value;c.set(e.setting,e.value)}else{d=c._list();g="";d.sort(function(h,j){return h.key"+h.key+" = "+h.value+"
"})}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){d._saveToObject(stringData).then(function(){var e=JSON.stringify(stringData);c.set("settings",e)})}})});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("sproutcore/runtime").SC,d=a("bespin:plugins").catalog,e=a("bespin:promise").Promise,f=a("bespin:promise").group,g=a("Types:types");b.addSetting=function(h){a("Settings").settings.addSetting(h)};b.getSettings=function(){return d.getExtensions("setting")};b.getTypeExtFromAssignment=function(h){h="text";try{var j=h.assignments.setting.value;if(j&&j!=="")h=d.getExtensionByKey("setting",j).type}catch(l){}console.log("getType",h,"=",h);return g.getTypeExtNow(h)}; -b.MemorySettings=c.Object.extend({setPersister:function(h){(this._persister=h)&&h.loadInitialValues(this)},set:function(h,j){var l=d.getExtensionByKey("setting",h);if(!l)throw new Error("Unknown setting: ",h,j);if(typeof j=="string"&&l.type=="string")return this.superclass(h,j);else{var k=arguments.callee.base,m=false,n=null;g.fromString(j,l.type).then(function(o){m=true;k.apply(this,[h,o])}.bind(this),function(o){n=o});if(n)throw n;if(!m){console.warn("About to set string version of ",h,"delaying typed set."); -this.superclass(h,j)}}return this},addSetting:function(h){if(h.name){!h.defaultValue===undefined&&console.error("Setting.defaultValue == undefined",h);g.getTypeExt(h.type).then(function(j){j||console.error("Setting.type is invalid",h);j.load().then(function(l){l||console.error("type == null",h);l.isValid(h.defaultValue,j)||console.error("Setting.isValid(Setting.defaultValue) == false",h);this.set(h.name,h.defaultValue);this.addObserver(h.name,this,function(){this._persistValue(h.name,this.get(h.name))}.bind(this))}.bind(this))}.bind(this))}else console.error("Setting.name == undefined. Ignoring.", -h)},resetValue:function(h){var j=d.getExtensionByKey("setting",h);j?this.set(h,j.defaultValue):console.log("ignore resetValue on ",h)},_getSettingNames:function(){var h=[];d.getExtensions("setting").forEach(function(j){h.push(j.name)});return h},_list:function(){var h=[];this._getSettingNames().forEach(function(j){h.push({key:j,value:this.get(j)})}.bind(this));return h},_persistValue:function(h,j){var l=this._persister;l&&l.persistValue(this,h,j)},_loadInitialValues:function(){var h=this._persister; -h?h.loadInitialValues(this):this._loadDefaultValues()},_loadDefaultValues:function(){return this._loadFromObject(this._defaultValues())},_loadFromObject:function(h){var j=[];for(var l in h)if(h.hasOwnProperty(l)){var k=h[l],m=d.getExtensionByKey("setting",l);if(m){k=g.fromString(k,m.type);k.then(function(o){this.set(l,o)});j.push(k)}}var n=new e;f(j).then(function(){n.resolve()});return n},_saveToObject:function(){var h=[],j={};this._getSettingNames().forEach(function(k){var m=this.get(k),n=d.getExtensionByKey("setting", -k);if(n){m=g.toString(m,n.type);m.then(function(o){j[k]=o});h.push(m)}}.bind(this));var l=new e;f(h).then(function(){l.resolve(j)});return l},_defaultValues:function(){var h={};d.getExtensions("setting").forEach(function(j){h[j.name]=j.defaultValue});return h}})});tiki.register("Canon",{}); -tiki.module("Canon:commands",function(a,b){var c=a("bespin:util/util");a=a("plugins").catalog;var d=a.getObject("files"),e=a.getObject("editor"),f=a.getObject("editSession"),g=a.getObject("server");b.loadCommand=function(h,j,l){d.loadContents(d.userSettingsProject,"commands/"+j.commandname+".js",function(k){try{eval(k.content)}catch(m){l.doneWithError("Something is wrong about the command:

"+m)}},true)};b.editCommand=function(h,j){e.openFile(d.userSettingsProject,"commands/"+j.commandname+ -".js",{content:"{\n name: '"+j.commandname+"',\n takes: [YOUR_ARGUMENTS_HERE],\n preview: 'execute any editor action',\n execute: function(self, args) {\n\n }\n}",force:true})};b.listCommand=function(h,j,l){g.list(d.userSettingsProject,"commands/",function(k){if(!k||k.length<1)l.done("You haven't installed any custom commands.
Want to learn how?");else{var m="Your Custom Commands

";k=k.filter(function(n){return c.endsWith(n.name, -"\\.js")});m+=k.map(function(n){return n.name.replace(/\.js$/,"")}).join("
");l.done(m)}})};b.deleteCommand=function(h,j,l){var k=d.userSettingsProject,m="commands/"+j.commandname+".js";d.removeFile(k,m,function(){f.checkSameFile(k,m)&&e.model.clear();l.done("Removed command: "+j.commandname)},function(n){l.done("Wasn't able to remove the command "+j.commandname+"
Error (probably doesn't exist): "+n.responseText)})}}); -tiki.module("Canon:environment",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:plugins").catalog;b.Environment=c.Object.extend({session:function(){return d.getObject("session")}.property(),view:function(){var e=this.get("session");if(e)return e.get("currentView");else console.error("command attempted to get view but there's no session")}.property(),model:function(){var e=this.get("session");if(e)if(e=e.get("currentBuffer"))return e.get("model");else console.error("Session has no current buffer"); -else console.error("command attempted to get model but there's no session")}.property(),file:function(){var e=this.get("session");if(e)if(e=e.get("currentBuffer"))return e.get("file");else console.error("Session has no current buffer");else console.error("command attempted to get file but there's no session")}.property(),buffer:function(){var e=this.get("session");if(e)return e.get("currentBuffer");else console.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("Canon:request").Request,f=a("Canon:environment"),g=a("bespin:util/stacktrace").printStackTrace;a=c.Object.extend({processKeyEvent:function(h,j,l){var k=this._findCommandExtension(h.commandCodes()[0],l);if(k!=null){k.load(function(m){var n=e.create({command:m,commandExt:k});try{m(f.global,{},n);return true}catch(o){console.group("Error calling command: "+k.name);console.error(o);console.log(g(o)); -console.groupEnd();return false}});return true}return false},_findCommandExtension:function(h,j){var l=null;d.getExtensions("command").some(function(k){if(this._commandMatches(k,h,j)){l=k;return true}return false}.bind(this));return l},_commandMatches:function(h,j,l){var k=h.predicates;if(!c.none(k)){if(c.none(l))return false;for(var m in k)if(l[m]!==k[m])return false}k=h.key;if(!k)return false;if(typeof k=="string"){if(k!=j)return false;return true}if(!k.isArray){k=[k];h.key=k}for(h=0;he;)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:false,_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("DelegateSupport",{});tiki.module("DelegateSupport: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;e0&&e.length>0;){var g=d.shift(),h=e.shift(),j=b.comparePositions(g.start, -h.start),l=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(l<0)e.unshift({start:g.end,end:h.end});else l>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.rowe.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("SyntaxManager",{}); -tiki.module("SyntaxManager: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;hl||n=k&&m.push(n- -(k-l))});this._invalidRows=m},_adjustInvalidRowsForInsertion:function(l,k){this._invalidRows=this._invalidRows.map(function(m){return m=n)return 1;return 0});l===null&&console.error("position not found",position);return l},_attrsToString:function(l){return l.map(function(k){return"%@.%@.%@@%@-%@".fmt(k.context,k.state,k.tag,k.start,k.end)}.bind(this)).join(", ")},_clearAttrsAtRow:function(l){for(var k= -[],m=0;m<2;m++)k.push(this._defaultAttrs());this._lineAttrInfo[l].attrs=k},_deepSyntaxInfoForLine:function(l,k){var m=new g,n=l[0],o=n.context;this._shallowSyntaxInfoForLineFragment(o,n.state,k,0,null).then(function(r){var u=r.attrs;u.forEach(function(w){w.context=o});var q=[{attrs:u,next:r.next}],t=this._innerRangesFromAttrs(u,l[1]);if(t.length===0){q.push({attrs:[{context:null,start:0,end:null}],next:{context:null}});m.resolve(q)}else{r=t.map(function(w){return this._shallowSyntaxInfoForLineFragment(w.context, -w.state,k,w.start,w.end)}.bind(this));d.group(r).then(function(w){var v=w.map(function(x){return x.attrs});for(w=0;w (%@) }".fmt(l.snapshot.map(function(k){return k.context+ -": "+k.state}).join(", "),l.attrs.map(this._attrsToString.bind(this)).join(", "))}.bind(this)).join(", "),this._invalidRows.join(", "))},updateSyntaxForRows:function(l,k){var m=this._invalidRows,n=m.length,o;for(o=0;o>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("SyntaxManager: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(l){f(l,g)&&b.loop(d,e,f).then(function(k){g.resolve(k)})});return g}if(!f(j,g))return g}return g}});tiki.module("SyntaxManager:index",function(){});tiki.register("Editor",{}); -tiki.module("Editor:commands/editor",function(a,b){var c=a("bespin:util/util"),d=a("Settings").settings;b.gotoCommand=function(e,f){if(f.value){e=e.get("view");e._moveCursorTo({row:f.value-1,column:0});e.focus()}};b.replaceCommand=function(e,f){editor.replace(f)};b.sortCommand=function(e,f){e=editor.getDocument().split(/\n/);e.sort();direction&&/^desc/.test(f.direction.toLowerCase())&&e.reverse();editor.insertDocument(e.join("\n"))};b.entabCommand=function(e,f){(e=f.tabsize)||(e=d.get("tabsize")); -editor.replace({search:" {"+e+"}",replace:"\t"})};b.detabCommand=function(e,f){(e=f.tabsize)||(e=d.get("tabsize"));editor.replace({search:"\t",replace:c.repeatString(" ",e)})};b.trimCommand=function(e,f){e={replace:""};if(c.include(["left","both"],f.side)){e.search="^\\s+";editor.replace(e)}if(c.include(["right","both"],f.side)){e.search="\\s+$";editor.replace(e)}};b.ucCommand=function(){editor.selectionChangeCase({stringCase:"u"})};b.lcCommand=function(){editor.selectionChangeCase({stringCase:"l"})}}); -tiki.module("Editor:controllers/layoutmanager",function(a,b){var c=a("sproutcore/runtime").SC,d=a("DelegateSupport").MultiDelegateSupport;a("RangeUtils:utils/range");var e=a("SyntaxManager:controllers/syntaxmanager").SyntaxManager,f=a("models/textstorage").TextStorage;a=a("bespin:plugins").catalog;b.LayoutManager=c.Object.extend(d,{_characterWidth:8,_lineHeight:20,_maximumWidth:0,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),l={x:j.x,y:j.y,width:Number.MAX_VALUE,height:j.height};return g.end.row=== -h.end.row?[l]:[l,{x:0,y:j.y+this._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=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=e.row,h=e.column;switch(f){case -1:if(g===0&&h==0)return e;return h===0?{row:g-1,column:this.get("lines")[g-1].length}:{row:g,column:h-1};case 1:f=this.get("lines");var j=f[g].length;if(g===f.length-1&&h===j)return e;return h===j?{row:g+1,column:0}:{row:g,column:h+1};default:throw new Error("TextStorage.displacePosition(): count must be 1 or -1"); -}},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,l=e.end,k=j.row,m=l.row;j=j.column;var n=this.get("lines");f[0]=n[k].substring(0,j)+f[0];f[g-1]+=n[m].substring(l.column);n.replace(k,m-k+1,f);this.notifyDelegates("textStorageEdited",e,h)}})}); -tiki.module("Editor:utils/rect",function(a,b){var c=a("sproutcore/runtime").SC;b._distanceFromBounds=function(d,e,f){if(d=f)return d-f;return 0};b.merge=function(d){var e;do{e=false;for(var f=[],g=0;g=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("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("SyntaxManager:controllers/syntaxmanager").SyntaxManager,h=a("views/text").TextView;a=a("controllers/undo").EditorUndoController;b.EditorView=c.View.extend(c.Border,{borderStyle:c.BORDER_GRAY,gutterView:d,layoutManager:e,scrollView:f,syntaxManager:g,textView:h,undoController:a,_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 j=this.get("layoutManager"),l=this.get("scrollView"),k=this.createChildView(this.get("gutterView"),{layoutManager:j});this.set("gutterView",k);k.addObserver("frame",this,this._gutterViewFrameChanged);var m=this.get("textView");j=this.createChildView(l,{contentView:m.extend({layoutManager:j,undoController:this.get("undoController")}), -layout:{left:k.get("frame").width,bottom:0,top:0,right:0}});this.set("scrollView",j);j.addObserver("verticalScrollOffset",this,this._scrollViewVerticalScrollOffsetChanged);l=j.get("contentView");this.set("textView",l);this.set("undoController",this.get("undoController").create({textView:l}));this.set("childViews",[k,j])},init:function(){this.set("layoutManager",this.get("layoutManager").create());return arguments.callee.base.apply(this,arguments)}})}); -tiki.module("Editor:views/gutter",function(a,b){var c=a("sproutcore/runtime").SC,d=a("views/canvas").CanvasView,e=a("bespin:util/scratchcanvas"),f=d.extend({_lineAscent:16,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(g,h){var j=this.get("theme");h.fillStyle=j.gutterStyle;h.fillRect(g.x,g.y,g.width, -g.height);h.save();var l=this.get("parentView"),k=l.get("padding");h.translate(k.left,0);h.fillStyle=j.lineNumberColor;h.font=j.lineNumberFont;j=l.get("layoutManager");k=j.characterRangeForBoundingRect(g);g=Math.min(k.end.row,j.get("textLines").length-1);l=this._lineAscent;for(k=k.start.row;k<=g;k++)h.fillText(""+(k+1),-0.5,j.lineRectForRow(k).y+l-0.5);h.restore()}});b.GutterView=c.View.extend({_interiorView:null,_computeWidth:function(){var g=this.get("padding");g=g.left+g.right;var h=this.get("theme").lineNumberFont, -j=""+this.getPath("layoutManager.textLines").length;return e.get().measureStringWidth(h,j)+g},_recomputeLayout:function(){var g=this.get("layoutManager"),h=this.get("padding"),j=this._computeWidth(),l=c.clone(this.get("layout"));l.width=j;this.set("layout",l);l=this.get("frame");this._interiorView.set("layout",{left:0,top:-this.get("verticalScrollOffset"),width:j,height:Math.max(l.height,g.boundingRect().height+h.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 g=this.createChildView(f);this._interiorView=g;this.get("frame");this._recomputeLayout();this.set("childViews",[g])},init:function(){arguments.callee.base.apply(this,arguments);this.get("layoutManager").addDelegate(this)},layoutManagerInvalidatedRects:function(){this._recomputeLayout()}})}); -tiki.module("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("Editor:views/scroller",function(a,b){var c=a("sproutcore/runtime").SC,d=a("views/canvas").CanvasView.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(e){var f=this.get("theme"),g,h;if(this._isHighlighted()){g= -f.fullNibStyle;h=f.fullNibArrowStyle;f=f.fullNibStrokeStyle}else{g=f.partialNibStyle;h=f.partialNibArrowStyle;f=f.partialNibStrokeStyle}var j=Math.floor(7.5);e.fillStyle=g;e.beginPath();e.arc(0,0,Math.floor(7.5),0,Math.PI*2,true);e.closePath();e.fill();e.strokeStyle=f;e.stroke();e.fillStyle=h;e.beginPath();e.moveTo(0,-j+3);e.lineTo(-j+3,j-5);e.lineTo(j-3,j-5);e.closePath();e.fill()},_drawNibs:function(e){var f=this._getClientThickness(),g=this.getPath("parentView.value"),h=this._isHighlighted();if(h|| -g!==0){e.save();e.translate(8,f/2);e.rotate(Math.PI*1.5);e.moveTo(0,0);this._drawNib(e);e.restore()}if(h||g!==this.getMaximumValue()){e.save();e.translate(this._getClientLength()-8,f/2);e.rotate(Math.PI*0.5);e.moveTo(0,0);this._drawNib(e);e.restore()}},_getClientFrame:function(){var e=this.get("frame"),f=this.getPath("parentView.padding");return{x:f.left,y:f.top,width:e.width-(f.left+f.right),height:e.height-(f.top+f.bottom)}},_getClientLength:function(){var e=this._getClientFrame();switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_HORIZONTAL:return e.width; -case c.LAYOUT_VERTICAL:return e.height;default:console.assert(false,"unknown layout direction");return null}},_getClientThickness:function(){var e=this.get("parentView"),f=e.get("padding"),g=e.get("scrollerThickness");switch(e.get("layoutDirection")){case c.LAYOUT_VERTICAL:return g-(f.left+f.right);case c.LAYOUT_HORIZONTAL:return g-(f.top+f.bottom);default:console.assert(false,"unknown layout direction");return null}}.property(),_getFrameLength:function(){var e=this.get("frame");switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_HORIZONTAL:return e.width; -case c.LAYOUT_VERTICAL:return e.height;default:console.assert(false,"unknown layout direction");return null}},_getGutterFrame:function(){var e=this._getClientFrame(),f=this._getClientThickness();switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_VERTICAL:return{x:e.x,y:e.y+15,width:f,height:Math.max(0,e.height-30)};case c.LAYOUT_HORIZONTAL:return{x:e.x+15,y:e.y,width:Math.max(0,e.width-30),height:f};default:console.assert(false,"unknown layout direction");return null}},_getGutterLength:function(){var e= -this._getGutterFrame(),f;switch(this.getPath("parentView.layoutDirection")){case c.LAYOUT_HORIZONTAL:f=e.width;break;case c.LAYOUT_VERTICAL:f=e.height;break;default:console.assert(false,"unknown layout direction");break}return f},_getHandleFrame:function(){var e=this.get("parentView"),f=e.get("value"),g=e.get("maximum");this.get("frame");var h=this._getClientFrame();this._getGutterFrame();var j=this._getClientThickness(),l=this._getGutterLength(),k=this._getFrameLength(),m=Math.min(k,g)*l/g;if(m< -50){m=50;l-=50;f*=g/(g-k)}switch(e.get("layoutDirection")){case c.LAYOUT_VERTICAL:return{x:h.x,y:h.y+15+f*l/g,width:j,height:m};case c.LAYOUT_HORIZONTAL:return{x:h.x+15+f*l/g,y:h.y,width:m,height:j};default:console.assert(false,"unknown layout direction");return null}},_isHighlighted:function(){return this._isMouseOver===true||this._mouseDownScreenPoint!==null},_segmentForMouseEvent:function(e){e=this.convertFrameFromView({x:e.pageX,y:e.pageY});var f=this._getClientFrame(),g=this.getPath("parentView.padding"); -if(!c.pointInRect(e,f))return null;var h=this.getPath("parentView.layoutDirection");switch(h){case c.LAYOUT_HORIZONTAL:if(e.x-g.left<15)return"nib-start";else if(e.x>=f.width-15)return"nib-end";break;case c.LAYOUT_VERTICAL:if(e.y-g.top<15)return"nib-start";else if(e.y>=f.height-15)return"nib-end";break;default:console.assert(false,"unknown layout direction");break}g=this._getHandleFrame();if(c.pointInRect(e,g))return"handle";switch(h){case c.LAYOUT_HORIZONTAL:if(e.x= -g.x+g.width)return"gutter-after";break;case c.LAYOUT_VERTICAL:if(e.y=g.y+g.height)return"gutter-after";break;default:console.assert(false,"unknown layout direction");break}console.assert(false,"_segmentForMouseEvent: point ",e," outside view with handle frame ",g," and client frame ",f);return null},adjustFrame:function(){var e=this.getPath("parentView.frame");this.set("layout",{left:0,top:0,width:e.width,height:e.height})},drawRect:function(e,f){e=f.globalAlpha? -f.globalAlpha:1;var g=this.get("theme"),h=this._isHighlighted(),j=this.get("frame");f.clearRect(0,0,j.width,j.height);f.save();j=this.get("parentView");var l=j.get("padding");f.translate(l.left,l.top);var k=this._getHandleFrame(),m=this._getGutterLength(),n=this._getClientThickness(),o=n/2,r,u;switch(j.get("layoutDirection")){case c.LAYOUT_VERTICAL:r=k.y-l.top;u=k.height;f.translate(n+1,0);f.rotate(Math.PI*0.5);break;case c.LAYOUT_HORIZONTAL:r=k.x-l.left;u=k.width;break;default:console.assert(false, -"unknown layout direction");break}if(!(m<=u)){if(h){j=this._getClientLength();f.fillStyle=g.scrollTrackFillStyle;f.fillRect(8.5,0.5,j-16,n-1);f.strokeStyle=g.scrollTrackStrokeStyle;f.strokeRect(8.5,0.5,j-16,n-1)}else f.globalAlpha=0.3;j=function(){f.beginPath();f.arc(r+o+0.5,o,o-0.5,Math.PI/2,3*Math.PI/2,false);f.arc(r+u-o-0.5,o,o-0.5,3*Math.PI/2,Math.PI/2,false);f.lineTo(r+o+0.5,n-0.5);f.closePath()};j();l=f.createLinearGradient(r,0,r,n);l.addColorStop(0,g.scrollBarFillGradientTopStart.replace(/%a/, -e));l.addColorStop(0.4,g.scrollBarFillGradientTopStop.replace(/%a/,e));l.addColorStop(0.41,g.scrollBarFillStyle.replace(/%a/,e));l.addColorStop(0.8,g.scrollBarFillGradientBottomStart.replace(/%a/,e));l.addColorStop(1,g.scrollBarFillGradientBottomStop.replace(/%a/,e));f.fillStyle=l;f.fill();f.save();f.clip();f.fillStyle=g.scrollBarFillStyle.replace(/%a/,e);f.beginPath();f.moveTo(r+o*0.4,o*0.6);f.lineTo(r+o*0.9,n*0.4);f.lineTo(r,n*0.4);f.closePath();f.fill();f.beginPath();f.moveTo(r+u-o*0.4,0+o*0.6); -f.lineTo(r+u-o*0.9,0+n*0.4);f.lineTo(r+u,0+n*0.4);f.closePath();f.fill();f.restore();f.save();j();f.strokeStyle=g.scrollTrackStrokeStyle;f.stroke();f.restore();if(!h)f.globalAlpha=1;this._drawNibs(f);f.restore()}},getMaximumValue:function(){return Math.max(this.getPath("parentView.maximum")-this._getFrameLength(),0)},_repeatAction:function(e,f){if(e()!==false)this._scrollTimer=c.Timer.schedule({target:this,action:function(){this._repeatAction(e,100)},interval:f})},_scrollByDelta:function(e){var f= -this.get("parentView"),g=f.get("value");f.set("value",g+e)},_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(e){this._mouseEventPosition=e;this._mouseOverHandle=false;var f=this.get("parentView");f.get("value");this._getGutterLength();switch(this._segmentForMouseEvent(e)){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:console.assert("_segmentForMouseEvent returned an unknown value");break}switch(f.get("layoutDirection")){case c.LAYOUT_HORIZONTAL:this._mouseDownScreenPoint=e.pageX;break;case c.LAYOUT_VERTICAL:this._mouseDownScreenPoint=e.pageY;break;default:console.assert(false,"unknown layout direction");break}},mouseDragged:function(e){var f=this.get("parentView");if(this._segmentForMouseEvent(e)=="handle"||this._mouseOverHandle===true){this._mouseOverHandle=true;if(this._scrollTimer!==null){this._scrollTimer.invalidate(); -this._scrollTimer=null}var g;switch(f.get("layoutDirection")){case c.LAYOUT_HORIZONTAL:g=e.pageX;break;case c.LAYOUT_VERTICAL:g=e.pageY;break;default:console.assert(false,"unknown layout direction");break}var h=g-this._mouseDownScreenPoint,j=f.get("maximum"),l=f.get("value"),k=this._getGutterLength(),m=this._getFrameLength();if(Math.min(m,j)*k/j<50)h*=j/(j-m);f.set("value",l+h*j/k);this._mouseDownScreenPoint=g}this._mouseEventPosition=e},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(e){var f=this.get("parentView");switch(f.get("layoutDirection")){case c.LAYOUT_HORIZONTAL:e=e.wheelDeltaX;break;case c.LAYOUT_VERTICAL:e=e.wheelDeltaY;break;default:console.assert(false,"unknown layout direction");return}f.set("value",f.get("value")+ -2*e)}});b.BespinScrollerView=c.View.extend({_scrollerCanvasView:null,_frameChanged:function(){this._scrollerCanvasView.adjustFrame()}.observes("frame"),_maximumChanged:function(){this._scrollerCanvasView.adjustFrame()}.observes("maximum"),_valueChanged:function(){var e=this._scrollerCanvasView,f=e.getMaximumValue(),g=this.get("value");if(g<0)this.set("value",0);else g>f&&this.set("value",f);e.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 e=this.createChildView(d);e.adjustFrame();this._scrollerCanvasView=e;this.set("childViews",[e])}})}); -tiki.module("Editor:views/text",function(a,b){var c=a("sproutcore/runtime").SC,d=a("views/canvas").CanvasView;a("controllers/layoutmanager");var e=a("DelegateSupport").MultiDelegateSupport,f=a("RangeUtils:utils/range"),g=a("utils/rect"),h=a("mixins/textinput").TextInput,j=a("Canon:keyboard").keyboardManager,l=a("Settings").settings;b.TextView=d.extend(e,h,{_dragPoint:null,_dragTimer:null,_inChangeGroup:false,_insertionPointBlinkTimer:null,_insertionPointVisible:true,_lineAscent:16,_selectedRange:null, -_selectedRangeEndVirtual:null,_beginChangeGroup:function(){if(this._inChangeGroup)throw new Error("TextView._beginChangeGroup() called while already in a change group");this._inChangeGroup=true;this.notifyDelegates("textViewBeganChangeGroup",this._selectedRange)},_drag:function(){var k=this.convertFrameFromView(this._dragPoint),m=g.offsetFromRect(this.get("clippingFrame"),k);this.moveCursorTo(this._selectionPositionForPoint({x:k.x-m.x,y:k.y-m.y}),true);this.becomeFirstResponder()},_drawInsertionPoint:function(k, -m){if(this._insertionPointVisible){k=this._selectedRange;var n=this.get("layoutManager").characterRectForPosition(k.start);k=n.x;var o=n.y,r=n.width;n=n.height;m.save();var u=this.get("theme");if(this.get("isFirstResponder")){m.strokeStyle=u.cursorStyle;m.beginPath();m.moveTo(k+0.5,o);m.lineTo(k+0.5,o+n);m.closePath();m.stroke()}else{m.fillStyle=u.unfocusedCursorFillStyle;m.fillRect(k+0.5,o,r,n);m.strokeStyle=u.unfocusedCursorStrokeStyle;m.strokeRect(k+0.5,o+0.5,r-1,n-1)}m.restore()}},_drawLines:function(k, -m){var n=this.get("layoutManager"),o=n.get("textLines"),r=this.get("theme"),u=this._lineAscent;m.save();m.font=r.editorTextFont;r=n.characterRangeForBoundingRect(k);k=r.start;r=r.end;for(var q=r.row,t=k.row;t<=q;t++){var w=o[t];if(!c.none(w)){var v=w.characters,A=v.length,x=Math.min(r.column,A),B=k.column;if(!(B>=A)){w=w.colors;for(A=0;B1?{row:m.start.row+n.length-1,column:n[n.length-1].length}:f.addPositions(m.start,{row:0,column:k.length}));this._endChangeGroup()},_invalidateInsertionPointIfNecessary:function(k){this._rangeIsInsertionPoint(k)&&this.setNeedsDisplayInRect(this.get("layoutManager").characterRectForPosition(k.start))},_invalidateSelection:function(){var k= -this.get("layoutManager"),m=f.normalizeRange(this._selectedRange);k.rectsForRange(m).forEach(this.setNeedsDisplayInRect,this)},_isDelimiter:function(k){return"\"',;.!~@#$%^&*?[]<>:/\\-+ \t".indexOf(k)!==-1},_moveOrSelectEnd:function(k,m){var n=this.getPath("layoutManager.textStorage.lines");m=m?this._selectedRange.end.row:n.length-1;this.moveCursorTo({row:m,column:n[m].length},k)},_moveOrSelectNextWord:function(k){var m=this.getPath("layoutManager.textStorage.lines"),n=this._selectedRange.end,o=n.row; -n=n.column;var r=m[o],u=false;if(n>=r.length){o++;u=true;if(or.length)n=r.length;else if(n==0){o--;u=true;if(o>-1){r=m[o];n=r.length}else r=""}n=this._seekNextStop(r,n,-1,u);this.moveCursorTo({row:o,column:n},k)},_moveOrSelectStart:function(k, -m){var n=this._selectedRange;this.moveCursorTo({row:m?n.end.row:0,column:0},k)},_performBackspaceOrDelete:function(k){this._beginChangeGroup();var m=this.getPath("layoutManager.textStorage");m.get("lines");var n=f.normalizeRange(this._selectedRange);if(this._rangeIsInsertionPoint(n))n=k?{start:m.displacePosition(n.start,-1),end:n.end}:{start:n.start,end:m.displacePosition(n.end,1)};this._replaceCharacters(n,"");this.moveCursorTo(n.start);this._endChangeGroup()},_performVerticalKeyboardSelection:function(k){this.getPath("layoutManager.textStorage"); -this.moveCursorTo(f.addPositions(this._selectedRangeEndVirtual!==null?this._selectedRangeEndVirtual:this._selectedRange.end,{row:k,column:0}),true,true)},_rangeIsInsertionPoint:function(k){return f.isZeroLength(k)},_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})}, -_replaceCharacters:function(k,m){if(!this._inChangeGroup)throw new Error("TextView._replaceCharacters() called without a change group");k=f.normalizeRange(k);this.notifyDelegates("textViewWillReplaceRange",k);this.getPath("layoutManager.textStorage").replaceCharacters(k,m);this.notifyDelegates("textViewReplacedCharacters",k,m)},_repositionSelection:function(){var k=this.getPath("layoutManager.textLines"),m=k.length,n=this._selectedRange,o=Math.min(n.start.row,m-1);m=Math.min(n.end.row,m-1);var r= -k[m];this.setSelection({start:{row:o,column:Math.min(n.start.column,k[o].characters.length)},end:{row:m,column:Math.min(n.end.column,r.characters.length)}})},_resize:function(){var k=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,k.width+m.right),height:Math.max(n.height,k.height+m.bottom)}))},_scrollPage:function(k){var m=this._scrollView(),n=this.get("clippingFrame"); -m.scrollTo(n.x,n.y+(n.height+this._lineAscent)*(k?-1:1))},_scrollToPosition:function(k){var m=this._scrollView();if(!c.none(m)){var n=this.get("layoutManager").characterRectForPosition(k);k=n.x;var o=n.y,r=n.width;n=n.height;var u=this.get("clippingFrame"),q=u.x,t=u.y,w=this.get("padding"),v=u.width-w.right;u=u.height-w.bottom;m.scrollTo(k>=q&&k+r=t&&o+n-1;){if(o=this._isDelimiter(k[m]))r++;else u=true;if((o||r>1)&&u)break;m+=n}n<0&&m++;return m},_selectionPositionForPoint:function(k){k=this.get("layoutManager").characterAtPoint(k); -return k.partialFraction<0.5?k:f.addPositions(k,{row:0,column:1})},_syntaxManagerUpdatedSyntaxForRows:function(k,m){if(k!==m){var n=this.get("layoutManager");n.updateTextRows(k,m);n.rectsForRange({start:{row:k,column:0},end:{row:m,column:0}}).forEach(this.setNeedsDisplayInRect,this)}},_updateSyntax:function(k){var m=this.get("layoutManager"),n=m.characterRangeForBoundingRect(this.get("clippingFrame")),o=n.start.row;n=n.end.row;if(k!==null){if(kn)return;o=k}var r=this;k=m.getPath("textStorage.lines"); -m=m.get("syntaxManager");n=Math.min(k.length,n+1);m.updateSyntaxForRows(o,n).then(function(u){r._syntaxManagerUpdatedSyntaxForRows(u.startRow,u.endRow)})},acceptsFirstResponder:true,blinkInsertionPoint:function(){this._insertionPointVisible=!this._insertionPointVisible;this._invalidateInsertionPointIfNecessary(this._selectedRange)},clippingFrameChanged:function(){arguments.callee.base.apply(this,arguments);this._updateSyntax(null)},hasPadding:true,layoutManager:null,padding:{bottom:0,right:0},parentViewFrameChanged:function(){arguments.callee.base.apply(this, -arguments);this._resize()},theme:{backgroundStyle:"#2a211c",cursorStyle:"#879aff",editorTextFont:"10pt Monaco, Lucida Console, monospace",editorSelectedTextColor:"rgb(240, 240, 240)",editorSelectedTextBackground:"#526da5",unfocusedCursorStrokeStyle:"#ff0033",unfocusedCursorFillStyle:"#73171e"},backspace:function(){this._performBackspaceOrDelete(true)},copy:function(){return this.getSelectedCharacters()},cut:function(){var k=this.getSelectedCharacters();k!=""&&this.deleteSelectionOrNextCharacter(); -return k},deleteSelectionOrNextCharacter:function(){this._performBackspaceOrDelete(false)},drawRect:function(k,m){m.fillStyle=this.get("theme").backgroundStyle;m.fillRect(k.x,k.y,k.width,k.height);this._drawSelection(k,m);this._drawLines(k,m)},getSelectedCharacters:function(){return this._rangeIsInsertionPoint(this._selectedRange)?"":this.getPath("layoutManager.textStorage").getCharacters(f.normalizeRange(this._selectedRange))},getSelectedRange:function(){return f.normalizeRange(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();this._rearmInsertionPointBlinkTimer()},keyDown:function(k){if(c.browser.mozilla){var m=k.commandCodes()[0];if(m==="ctrl_z"||m==="ctrl_shift_z")return true;if(m==="meta_z"){k.keyCode=90;k.charCode=0}}if(k.charCode===0)return j.processKeyEvent(k, -this,{isTextView:true});else if(k.keyCode===9)k.preventDefault();else return false},layoutManagerChangedTextAtRow:function(k,m){this._updateSyntax(m);this._repositionSelection()},layoutManagerInvalidatedRects:function(k,m){m.forEach(this.setNeedsDisplayInRect,this);this._resize()},mouseDown:function(k){arguments.callee.base.apply(this,arguments);var m={x:k.pageX,y:k.pageY};switch(k.clickCount){case 1:var n=this._selectionPositionForPoint(this.convertFrameFromView(m));this.moveCursorTo(n,k.shiftKey); -break;case 2:n=this._selectionPositionForPoint(this.convertFrameFromView(m));var o=this.getPath("layoutManager.textStorage").lines[n.row];if(o.length===0)return;n.column-=n.column==o.length?1:0;var r=!this._isDelimiter(o[n.column]),u=this,q=function(w,v){for(;w>-1&&w0&&n0&&o[w].subpaths.push({name:v})}}else console.error("Bad data, no directory/file name: ", -t)}.bind(this));m=[];for(dirName in o){var u=o[dirName],q=b.Directory.create(u.item);q.populateDirectory(u.subpaths);m.push(q)}this.set("directories",m);this.set("files",n)},sendToMatcher:function(m,n){if(this.get("status")!==l)throw new Error("Attempt to send a directory to a matcher before the directory was ready");if(c.none(n))n=this.get("name");var o=this.get("directories"),r=this.get("files").concat(o).map(function(q){return n+q.get("name")});m.addStrings(r);var u=new g;if(o.length===0){u.resolve(); -return u}o=o.map(function(q){return q.sendToMatcher(m,n+q.get("name"))});f.group(o).then(function(){u.resolve()});return u}});b.File=c.Object.extend({directory:null,name:null,source:function(){return this.get("directory").get("source")}.property(),path:function(){return e.combine(this.get("directory").get("path"),this.get("name"))}.property().cacheable(),dirname:function(){return this.get("directory").get("path")}.property().cacheable(),ext:function(){return e.fileType(this.get("name"))}.property(), -originPath:function(){return this.get("path")}.property().cacheable(),loadContents:function(){return this.get("source").loadContents(this)},saveContents:function(m){return this.get("source").saveContents(this,m)}});b.FileSystemOld=c.Object.extend({userSettingsProject:"BespinSettings",newFile:function(m,n,o,r){this.whenFileDoesNotExist(m,n,{execute:function(){if(editSession.shouldCollaborate())editSession.startSession(m,n||"new.txt",o,r);else{hub.publish("path:changed",{project:m,path:n});editSession.setReadOnlyIfNotMyProject(m); -o({name:n,content:"",timestamp:(new Date).getTime()})}},elseFailed:function(){d.isFunction(r)&&r({responseText:"The file "+n+" already exists my friend."});throw new Error("The file "+n+" already exists my friend.");}})},loadContents:function(m,n,o,r){server.loadFile(m,n,function(u){if(/\n$/.test(u))u=u.substr(0,u.length-1);o({name:n,content:u,timestamp:(new Date).getTime()})},r)},editFile:function(m,n,o,r){editSession.shouldCollaborate()?editSession.startSession(m,n,o,r):this.loadContents(m,n,function(){editSession.setReadOnlyIfNotMyProject(m); -o.apply(null,arguments)},r)},evalFile:function(m,n,o){o=o||k();if(!m||!n)throw new Error("Please, I need a project and filename to evaulate");this.loadContents(m,n,function(r){with(o)try{eval(r.content)}catch(u){throw new Error("There is a error trying to run "+n+" in project "+m+": "+u);}},true)},projects:function(m){server.projects(m)},fileNames:function(m,n){server.list(m,"",n)},saveFile:function(m,n,o,r){if(/\n$/.test(n.content))n.content+="\n";server.saveFile(m,n.name,n.content,n.lastOp,{onSuccess:function(){console.log("File saved: "+ -m+" "+n.name);hub.publish("file:saved",{project:m,path:n.name});d.isFunction(o)&&o()},onFailure:r})},makeDirectory:function(m,n,o,r){server.makeDirectory(m,n,function(u){hub.publish("directory:created",{project:m,path:n});o(u)},r)},removeDirectory:function(m,n,o,r){server.removeFile(m,n,function(u){hub.publish("directory:removed",{project:m,path:n});o(u)},r)},removeFile:function(m,n,o,r){server.removeFile(m,n,function(u){hub.publish("file:removed",{project:m,path:n});o(u)},r)},closeFile:function(m, -n,o){server.closeFile(m,n,o)},whenFileExists:function(m,n,o){server.list(m,n.directory(n),function(r){var u=r.some(function(q){return q.name==n});if(r&&u)o.execute();else o.elseFailed&&o.elseFailed()},function(r){o.elseFailed&&o.elseFailed(r)})},whenFileDoesNotExist:function(m,n,o){server.list(m,n.directory(n),function(r){var u=r.some(function(q){return q.name==n});if(!r||!u)o.execute();else o.elseFailed&&o.elseFailed()},function(){o.execute()})}});var k=function(){if(m)return m;var m={include:function(n){files.evalFile(files.userSettingsProject, -n)},require:a,execute:function(n){cliController.executeCommand(n)}};["editor","files","server"].forEach(function(n){m.id=this[n]});return m}}); -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){var e=d.split("/");return e.length==1?"":e.length==2&&e[e.length-1]==""?d:e.slice(0,e.length-1).join("/")};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]}};b.isDir=function(d){return c.endsWith(d,"/")};b.basename=function(d){var e=d.lastIndexOf("/");if(e==-1)return"";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]}});tiki.register("EditSession",{}); -tiki.module("EditSession:index",function(a,b){var c=a("sproutcore/runtime").SC,d=a("Editor:models/textstorage").TextStorage;b.Buffer=c.Object.extend({model:null,_file:null,file:function(e,f){var g=this;if(f!=undefined){this._file=f;f.loadContents().then(function(h){g.get("model").set("value",h.contents)})}return this._file}.property(),init:function(){this.get("model")==null&&this.set("model",d.create())},changeFile:function(e){var f=this;this.changeFileOnly(e);return e.loadContents().then(function(g){f.get("model").set("value", -g.contents);return f})},changeFileOnly:function(e){this._file=e;this.propertyDidChange("file")},save:function(){return this._file.saveContents(this.model.get("value"))}});b.EditSession=c.Object.extend({currentView:null,currentBuffer:null,getCompletePath:function(e){if(e==null)e="";if(e==null||e.substring(0,1)!="/"){var f=this.get("currentBuffer"),g;if(f)g=f.get("file");e=g?g.get("dirname")+e:"/"+e}return e}})});tiki.register("Embedded",{}); -tiki.module("Embedded:index",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:views/dock").DockView,e=a("Editor:views/editor").EditorView,f=a("AppSupport:views/keylistener").KeyListener;a("bespin:index");var g=a("EditSession"),h=a("Settings").settings;a("bespin:util/util");b.EmbeddedEditor=c.Object.extend({_editorView:null,_focused:false,_attachEmbeddedEvents:function(){this.getPath("pane.layer").addEventListener("mousedown",function(){this.setFocus(true)}.bind(this),true);document.body.addEventListener("mousedown", -function(){this.setFocus(false)}.bind(this),true)},_attachPane:function(){typeof this.get("element")==="string"&&this.set("element",document.getElementById("element"));var j=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=j.innerHTML;c.$(j).css("position","relative");j.innerHTML="";this.get("pane").appendTo(j)},_computeLayout:function(){for(var j=this.get("element"), -l={top:0,left:0,width:j.clientWidth,height:j.clientHeight};!c.none(j);){l.top+=j.offsetTop+j.clientTop;l.left+=j.offsetLeft+j.clientLeft;j=j.offsetParent}return l},_createValueProperty:function(){this.__defineGetter__("value",function(){return this._editorView.getPath("layoutManager.textStorage.value")});this.__defineSetter__("value",function(j){c.run(function(){this._editorView.setPath("layoutManager.textStorage.value",j)}.bind(this))})},_hookWindowResizeEvent:function(){window.addEventListener("resize", -this.dimensionsChanged.bind(this),false)},_setOptions:function(){var j=this._editorView.get("layoutManager"),l=this.get("options"),k=l.initialContent;c.none(k)||j.setPath("textStorage.value",k);k=l.noAutoresize;if(c.none(k))k=l.dontHookWindowResizeEvent;if(c.none(k)||!k)this._hookWindowResizeEvent();k=l.settings;if(!c.none(k))for(key in k)h.set(key,k[key]);k=l.stealFocus;!c.none(k)&&k&&window.setTimeout(function(){this.setFocus(true)}.bind(this),1);j=j.get("syntaxManager");l=l.syntax;c.none(l)||j.set("initialContext", -l)},element:null,options:null,pane:c.Pane.extend({_layoutChanged:function(){this._recomputeLayoutStyle()}.observes("layout"),_recomputeLayoutStyle:function(){var j=this.get("layout");this.set("layoutStyle",{width:"%@px".fmt(j.width),height:"%@px".fmt(j.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 j=this.get("pane"),l=j.get("layout"),k=this._computeLayout(this.get("element"));if(!c.rectsEqual(l,k)){j.adjust(k);j.updateLayout()}}.bind(this))},init:function(){var j=g.EditSession.create();b.session=j;var l=this.get("pane").create({layout:this._computeLayout()});this.set("pane",l);this._attachPane();var k=l.getPath("applicationView.centerView");this._editorView=k;l=k.get("textStorage");k=k.get("textView");b.model=l;b.view=k;l=g.Buffer.create({model:l}); -j.set("currentBuffer",l);j.set("currentView",k);c.run(function(){this._attachEmbeddedEvents();this._createValueProperty();this._setOptions()}.bind(this))},setFocus:function(j){var l=this.get("pane");if(this._focused!==j)(this._focused=j)?l.becomeKeyPane():l.resignKeyPane()},setLineNumber:function(j){c.RunLoop.begin();var l=this.getPath("pane.editorView.textView");j={row:j-1,column:0,partialFraction:0};l.setSelection([{start:j,end:j}]);c.RunLoop.end()}});b.session=null;b.useBespin=function(j,l){return b.EmbeddedEditor.create({element:j, -options:c.none(l)?{}:l})}});tiki.register("HTML",{}); -tiki.module("HTML:index",function(a,b){a("sproutcore/runtime");a=a("SyntaxManager: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+ +g.stopPropagation()};b.randomPassword=function(g){g=g||16;for(var h="",j=0;j"+e.setting+" = "+c.get(e.setting);else{g="Setting: "+e.setting+" = "+e.value;c.set(e.setting,e.value)}else{d=c._list();g="";d.sort(function(h,j){return h.key'+h.key+" = "+h.value+"
"})}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("bespin:plugins");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){d.warn("Setting not defined: ",j,k);return this.superclass("__deactivated__"+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);k=this.get("__deactivated__"+j.name)||j.defaultValue;this.set(j.name,k);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)},resetAll:function(){this._getSettingNames().forEach(function(j){this.resetValue(j)}.bind(this))},_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(u){return function(q){this.set(u,q)}};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 r=new e;f(k).then(function(){r.resolve()});return r},_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(r){k[m]=r});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("traits",{}); +tiki.module("traits:index",function(a,b){b.Trait=function(){function c(F){var E=function(){throw new Error("Conflicting property: "+F);};p(E.prototype);return p(E)}function d(){return p({value:undefined,enumerable:false,required:true})}function e(F){F=c(F);return v?p({get:F,set:F,enumerable:false,conflict:true}):p({value:F,enumerable:false,conflict:true})}function f(F,E){return F===E?F!==0||1/F===1/E:F!==F&&E!==E}function g(F,E){return F.conflict&&E.conflict?true:F.get===E.get&&F.set===E.set&&f(F.value, +E.value)&&F.enumerable===E.enumerable&&F.required===E.required&&F.conflict===E.conflict}function h(F,E){return p(y(F,E))}function j(F){var E={};z(F,function(H){E[H]=true});return p(E)}function k(F){var E={};z(t(F),function(H){var I=A(F,H);if(I.value===J)I=d(H);else if(typeof I.value==="function"){I.method=true;"prototype"in I.value&&p(I.value.prototype)}else{I.get&&I.get.prototype&&p(I.get.prototype);I.set&&I.set.prototype&&p(I.set.prototype)}E[H]=I});return E}function l(){var F=K(arguments,0),E= +{};z(F,function(H){z(t(H),function(I){var L=H[I];if(D(E,I)&&!E[I].required)L.required||g(E[I],L)||(E[I]=e(I));else E[I]=L})});return p(E)}function m(F,E){var H=j(F),I={};z(t(E),function(L){I[L]=!D(H,L)||E[L].required?E[L]:d(L)});return p(I)}function n(){var F=K(arguments,0),E={};z(F,function(H){z(t(H),function(I){var L=H[I];if(!D(E,I)||E[I].required)E[I]=L})});return p(E)}function o(F,E){var H={};z(t(E),function(I){if(D(F,I)&&!E[I].required){var L=F[I];H[L]=D(H,L)&&!H[L].required?e(L):E[I];D(H,I)|| +(H[I]=d(I))}else if(D(H,I))E[I].required||(H[I]=e(I));else H[I]=E[I]});return p(H)}function r(F,E){var H={},I=[];for(var L in F)if(D(F,L))if(F[L])H[L]=F[L];else I.push(L);return o(H,m(I,E))}function u(F,E){var H=G(F),I={};z(t(E),function(L){var M=E[L];if(M.required&&!(L in F))throw new Error("Missing required property: "+L);else if(M.conflict)throw new Error("Remaining conflicting property: "+L);else I[L]="value"in M?M.method?{value:h(M.value,H),enumerable:M.enumerable,configurable:M.configurable, +writable:M.writable}:M:{get:M.get?h(M.get,H):undefined,set:M.set?h(M.set,H):undefined,enumerable:M.enumerable,configurable:M.configurable,writable:M.writable}});B(H,I);return p(H)}function q(F,E){return u(Object.prototype,k(F),E)}function s(F,E){var H=t(F),I=t(E);if(H.length!==I.length)return false;for(var L=0;L"}});if(!Object.create)Object.create=G;if(!Object.getOwnProperties)Object.getOwnProperties= +x;w.required=p(J);w.compose=p(l);w.resolve=p(r);w.override=p(n);w.create=p(u);w.eqv=p(s);w.object=p(q);return p(w)}()});tiki.register("appsupport",{}); +tiki.module("appsupport:controllers/bespin",function(a,b){var c=a("sproutcore/runtime").SC,d=a("traits").Trait,e=a("bespin:promise").Promise,f=d({attach:d.required,detach:function(){}}),g;g=Object.create(Object.prototype,d({_components:null,_componentOrder:null,_loadedComponents:null,_registeredComponents:null,_state:0,_dockView:null,_editorView:null,_environment:null,_themeManager:null,_username:null,_registrationHandlers:{environment:d.create(Object.prototype,d.override(d({attach:function(h){g._environment= +h;g._componentOrder=h.componentOrder;h.paneClass=g.paneClass;var j=new e;h.createPane().then(function(k){g.pane=k;j.resolve()});return j},detach:function(){g.pane=null;g._environment=null}}),f)),theme_manager:d.create(Object.prototype,d.override(d({attach:function(h){g._themeManager=h;h.addPane(g.pane);return h.loadTheme()},detach:function(){_themeManager.removePane(g.pane);g._themeManager=null}}),f)),login_controller:d.create(Object.prototype,d.override(d({_loginController:null,_loginPane:null,_promise:null, +attach:function(h){this._loginController=h;var j=h.get("accepted"),k=h.get("loggedOut");j.add(this.loginControllerAcceptedLogin);k.add(this.loginControllerLoggedOut);this._loginPane=j=a("userident").userIdentPage.get("mainPane");g._themeManager.addPane(j);this._promise=j=new e;c.run(h.showIfNotLoggedIn.bind(h));return j},detach:function(){g._themeManager.removePane(this._loginPane);var h=this._loginController,j=h.get("loggedOut");h=h.get("accepted");j.remove(this.loginControllerLoggedOut);h.remove(this.loginControllerAcceptedLogin); +this._loginController=this._loginPane=null},loginControllerAcceptedLogin:function(h){g._username=h;a("userident").registerUserPlugins();this._promise.resolve();this._promise=null},loginControllerLoggedOut:function(){g._rollback("login_controller");g._username=null;var h=this._loginController;c.run(h.show.bind(h))}}),f)),file_source:d.create(Object.prototype,d.override(d({attach:function(h){var j=a("filesystem").Filesystem;g.files=j.create({source:h.create()});return(new e).resolve()},detach:function(){g.files= +null}}),f)),settings:d.create(Object.prototype,d.override(d({attach:function(){return(new e).resolve()},detach:function(){}}),f)),key_listener:d.create(Object.prototype,d.override(d({_keyListener:null,attach:function(h){var j=g.pane;h=h.create();j.set("defaultResponder",h);this._keyListener=h;return(new e).resolve()},detach:function(){g.pane.set("defaultResponder",null);this._keyListener=null}}),f)),dock_view:d.create(Object.prototype,d.override(d({attach:function(h){h=h.create();g.pane.appendChild(h); +g._dockView=h;return(new e).resolve()},detach:function(){g._dockView.removeFromParent();g._dockView=null}}),f)),command_line:d.create(Object.prototype,d.override(d({_cliView:null,attach:function(h){var j=g._dockView;h=j.addDockedView(h,"bottom");j.appendChild(h);this._cliView=h;return(new e).resolve()},detach:function(){this._cliView.removeFromParent();this._cliView=null}}),f)),social_view:d.create(Object.prototype,d.override(d({_socialView:null,attach:function(h){var j=g._dockView;h=j.addDockedView(h, +"right");j.appendChild(h);this._socialView=h;return(new e).resolve()},detach:function(){this._socialView.removeFromParent();this._socialView=null}}),f)),editor_view:d.create(Object.prototype,d.override(d({attach:function(h){var j=g._dockView;h=j.createCenterView(h);j.set("centerView",h);j.appendChild(h);g._editorView=h;return(new e).resolve()},detach:function(){g._editorView.removeFromParent();g._editorView=null}}),f)),edit_session:d.create(Object.prototype,d.override(d({attach:function(h){var j= +g._editorView,k=j.get("textView"),l=j.get("layoutManager");j=l.get("textStorage");l=l.get("syntaxManager");j=h.Buffer.create({model:j,syntaxManager:l});h=h.EditSession.create();g.session=h;h.set("currentUser",g._username);h.set("currentView",k);h.set("currentBuffer",j);g.loadFile&&h.loadMostRecentOrNew();g._environment.sessionInitialized(h);return(new e).resolve()},detach:function(){g.session=null}}),f))},_attach:function(h){var j=this._registrationHandlers[h].attach;j(this._components[h]).then(this._attached.bind(this))}, +_attached:function(){this._state++;var h=this._componentOrder[this._state];h in this._components&&this._attach(h)},_rollback:function(h){for(var j=this._componentOrder.indexOf(h);this._state>j;){this._state--;this._registrationHandlers[this._componentOrder[this._state]].detach()}this._attach(h)},files:null,loadFile:true,pane:null,session:null,paneClass:c.MainPane.extend({layout:{left:0,bottom:0,top:0,right:0}}),init:function(){this._componentOrder=["environment"];this._components={};this._loadedComponents= +{};this._registeredComponents={}},registerAppComponent:function(h){var j=this._registeredComponents,k=h.name;if(!(k in j)){j[k]=true;h.load(function(l){this._loadedComponents[k]=true;this._components[k]=l;this._componentOrder[this._state]===k&&this._attach(k)}.bind(this))}},unregisterAppComponent:function(h){var j=h.name;this._rollback(this._componentOrder[this._componentOrder.indexOf(h.name)-1]);delete this._registeredComponents[j];delete this._components[j]}}));g.init();b.bespinController=g;d=b.bespinController; +b.registerAppComponent=d.registerAppComponent.bind(d);b.unregisterAppComponent=d.unregisterAppComponent.bind(d)}); +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:index",function(){});tiki.register("canon",{}); +tiki.module("canon:environment",function(a,b){var c=a("sproutcore/runtime").SC,d=a("bespin:console").console,e=a("appsupport:controllers/bespin").bespinController;b.Environment=c.Object.extend({session:function(){return e.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 d.error("Session has no current buffer");else d.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 d.error("Session has no current buffer");else d.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 d.error("command attempted to get buffer but there's no session")}.property(), +files:function(){return e.files}.property()});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:{states:{}},_commandCodes:function(){var k=this.originalEvent,l=true,m=this.keyCode,n=null,o=null,r="";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)r+="alt_";if(k.ctrlKey)r+="ctrl_";if(k.metaKey)r+="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){r="meta_";n=m}else n=null}if(this.shiftKey&&n&&l)r+="shift_";if(n)n=r+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(r){var u=g.create({command:r,commandExt:o});try{r(h.global,n.args,u);return true}catch(q){r=new j(q,true);e.group("Error calling command");e.log("command=",o);e.log("args=",n.args);e.error(q); +r.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;if(!m.isCommandKey||k.indexOf("alt_")===-1){l._keyBuffer+=k.replace(/ctrl_meta|meta/,"ctrl");l._keyMetaBuffer+=k}var o=[this._customKeymappingCache];o=o.concat(d.getExtensions("keymapping"));for(var r=0;re;)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();if(typeof e!=="string")e=e.toString();c.run(function(){this.outputs.pushObject(e)}.bind(this));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("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,col:d.col+e.col}};b.cloneRange=function(d){var e=d.start;d=d.end;return{start:{row:e.row,col:e.col},end:{row:d.row,col:d.col}}};b.comparePositions=function(d,e){var f=d.row-e.row;return f===0?d.col-e.col: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,col:f.col+e.col}}};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.col===d.end.col};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.col,d.row,d.col)};b.unionRanges=function(d,e){return{start:d.start.rowe.end.row||d.end.row===e.end.row&&d.end.col>e.end.col?d.end:e.end}};b.isPosition=function(d){return!c.none(d)&&!c.none(d.row)&&!c.none(d.col)};b.isRange=function(d){return!c.none(d)&&b.isPosition(d.start)&&b.isPosition(d.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;hl||o=m&&n.push(o-(m-l))});this._invalidRows=n},_adjustInvalidRowsForInsertion:function(l,m){this._invalidRows=this._invalidRows.map(function(n){return n=o)return 1;return 0});l===null&&j.error("position not found",position);return l},_attrsToString:function(l){return l.map(function(m){return"%@.%@.%@@%@-%@".fmt(m.context,m.state,m.tag,m.start,m.end)}.bind(this)).join(", ")}, +_clearAttrsAtRow:function(l){for(var m=[],n=0;n<2;n++)m.push(this._defaultAttrs());this._lineAttrInfo[l].attrs=m},_deepSyntaxInfoForLine:function(l,m){var n=new g,o=l[0],r=o.context;this._shallowSyntaxInfoForLineFragment(r,o.state,m,0,null).then(function(u){var q=u.attrs;q.forEach(function(v){v.context=r});var s=[{attrs:q,next:u.next}],w=this._innerRangesFromAttrs(q,l[1]);if(w.length===0){s.push({attrs:[{context:null,start:0,end:null}],next:{context:null}});n.resolve(s)}else{u=w.map(function(v){return this._shallowSyntaxInfoForLineFragment(v.context, +v.state,m,v.start,v.end)}.bind(this));d.group(u).then(function(v){var x=v.map(function(D){return D.attrs});for(v=0;v (%@) }".fmt(l.snapshot.map(function(m){return m.context+ +": "+m.state}).join(", "),l.attrs.map(this._attrsToString.bind(this)).join(", "))}.bind(this)).join(", "),this._invalidRows.join(", "))},updateSyntaxForRows:function(l,m){var n=this._invalidRows,o=n.length,r;for(r=0;r>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: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){if(!e.getPath("model.readOnly")){var f=e.get("view"),g=f.getSelectedRange();f.groupChanges(function(){var h={col:0,row:g.start.row};f.replaceCharacters({start:h,end:{col:0,row:g.end.row+1}},"");f.moveCursorTo(h)})}}; +var d=function(e,f){var g=f.getSelectedRange().start,h=g.row;g=g.col;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.joinLines=function(e){var f=e.get("model");if(!f.get("readOnly")){var g=e.get("view");e=g.getSelectedRange();var h=f.get("lines"),j=e.end.row;h.length!=j&&g.groupChanges(function(){g.replaceCharacters({start:{col:h[j].length,row:j}, +end:{col:/^\s*/.exec(h[j+1])[0].length,row:j+1}},"")})}};b.openLine=function(e){if(!e.getPath("model.readOnly")){var f=e.get("model");e=e.get("view");var g=e.getSelectedRange().end.row,h=f.get("lines");e.moveCursorTo({row:g,col: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.col%f;g="";for(var h=0;h-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.col;var n=h[m],o=false;if(l>=n.length){m++;o=true;if(mn.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,col: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({col: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,_syntaxManagerInitialized:false,_textStorage:null,_textStorageChanged:function(){var g=this._textStorage;c.none(g)||g.removeDelegate(this);var h= +this.get("textStorage");this._textStorage=h;h.addDelegate(this);if(this._syntaxManagerInitialized){var j=g.range();h=h.range();c.none(g)||this.get("syntaxManager").layoutManagerReplacedText(j,h);this._recomputeLayoutForRanges(j,h)}}.observes("textStorage"),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,col:this._maximumWidth}},_recalculateMaximumWidth:function(){var g=0;this.get("textLines").forEach(function(h){h=h.characters.length;if(g=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,col:(e===1?c.col: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: -999px; left: -999px; 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,{initialValue:"",lines:null,readOnly:false,clampPosition:function(e){var f=this.get("lines"),g=e.row;if(g<0)return{row:0,col:0};else if(g>=f.length)return this.range().end;return{row:g,col:Math.max(0,Math.min(e.col,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.col===k)return e;e=e.col===k?{row:e.row+1,col:0}:{row:e.row,col:e.col+1}}else{if(e.row===0&&e.col==0)return e;if(e.col===0){h=this.get("lines");e={row:e.row-1,col:h[e.row-1].length}}else e={row:e.row,col:e.col-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.col;h=h.col; +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")},getValue:function(){return this.get("lines").join("\n")},init:function(){arguments.callee.base.apply(this,arguments);this.set("lines",this.get("initialValue").split("\n"));delete this.initialValue},range:function(){var e=this.get("lines");return{start:{row:0,col:0},end:{row:e.length-1,col:e[e.length-1].length}}},replaceCharacters:function(e,f){if(this.get("readOnly"))throw new Error("Attempt to modify a read-only text storage object"); +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.col;var n=this.get("lines");f[0]=n[l].substring(0,j)+f[0];f[g-1]+=n[m].substring(k.col);n.replace(l,m-l+1,f);this.notifyDelegates("textStorageEdited",e,h)},setValue:function(e){this.replaceCharacters(this.range(),e)}})}); +tiki.module("text_editor:utils/rect",function(a,b){var c=a("sproutcore/runtime").SC;b._distanceFromBounds=function(d,e,f){if(d=f)return d-f;return 0};b.merge=function(d){var e;do{e=false;for(var f=[],g=0;g=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("views/text").TextView,h=a("controllers/undo").EditorUndoController,j=a("controllers/search").EditorSearchController,k=a("settings").settings,l=a("bespin:util/scratchcanvas");b.EditorView=c.View.extend(c.Border,{_fontChanged:function(){for(var m=k.get("fontsize"),n=l.get(),o=this.layoutManager,r="",u= +0;u<100;u++)r+="M";n=n.measureStringWidth(this.font,r)/100;o.set("characterWidth",n);o.set("lineHeight",Math.floor(m*1.6));o.set("lineAscent",Math.floor(m*1.3));this.layoutManager._recomputeEntireLayout();this.gutterView._recomputeLayout();this.textView.setNeedsDisplay()}.observes("font"),_fontSizeChanged:function(){var m=k.get("fontsize"),n=k.get("fontface");this.set("font",m+"px "+n)}.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:j,textView:g,undoController:h,_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 m=this.get("layoutManager"),n=this.get("scrollView"),o=this.createChildView(this.get("gutterView"),{editor:this,layoutManager:m}); +this.set("gutterView",o);o.addObserver("frame",this,this._gutterViewFrameChanged);var r=this.get("textView");m=this.createChildView(n,{containerView:c.ContainerView.extend({hasCustomScrolling:true}),contentView:r.extend({editor:this,layoutManager:m,searchController:this.get("searchController")}),layout:{left:o.get("frame").width,bottom:0,top:0,right:0}});this.set("scrollView",m);m.addObserver("verticalScrollOffset",this,this._scrollViewVerticalScrollOffsetChanged);n=m.get("contentView");this.set("textView", +n);this.set("undoController",this.get("undoController").create({textView:n}));this.get("searchController").set("textView",n);this.set("childViews",[o,m]);this._fontSizeChanged()},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"},_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){a=a("sproutcore/runtime").SC;b.ScrollView=a.ScrollView.extend({_containerViewLaidOut:false,autohidesHorizontalScroller:false,autohidesVerticalScroller:false,borderStyle:a.BORDER_NONE,hasHorizontalScroller:true,hasVerticalScroller:true,horizontalScrollerThickness:17,horizontalScrollerView:a.ScrollerView,verticalScrollerThickness:17,verticalScrollerView:a.ScrollerView,tile:function(){if(!this._containerViewLaidOut){var c=this.get("containerView"); +c.adjust({left:0,bottom:0,top:0,right:0});c.updateLayout();this._containerViewLaidOut=true}var d=this.get("horizontalScrollerView"),e=this.get("verticalScrollerView");d=this.get("isHorizontalScrollerVisible");e=this.get("isVerticalScrollerVisible");c=this.get("horizontalScrollerThickness");var f=this.get("verticalScrollerThickness");if(d){d=this.get("horizontalScrollerView");d.set("scrollbarThickness",c);d.set("layout",{left:0,bottom:6,right:6+f,height:c})}if(e){e=this.get("verticalScrollerView"); +e.set("scrollbarThickness",f);e.set("layout",{top:0,right:6,bottom:6+c,width:f})}this.get("contentView").get("hasPadding")===true&&this.get("contentView").set("padding",{bottom:c+6,right:f+6})}})}); +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,_enclosingScrollView:null,_inChangeGroup:false,_insertionPointBlinkTimer:null,_insertionPointVisible:true, +_keyBuffer:"",_keyMetaBuffer:"",_keyState:"start",_lineAscent:16,_selectedRange:null,_selectedRangeEndVirtual:null,classNames:["text_editor"],_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,r=Math.ceil(n.width);n=n.height;m.save();var u=this.get("theme");if(this.get("isFirstResponder")){m.strokeStyle=u.cursorStyle;m.beginPath();m.moveTo(l+0.5,o);m.lineTo(l+0.5,o+n);m.closePath();m.stroke()}else{m.fillStyle=u.unfocusedCursorFillStyle;m.fillRect(l+0.5,o,r,n);m.strokeStyle=u.unfocusedCursorStrokeStyle;m.strokeRect(l+0.5,o+0.5,r-1,n-1)}m.restore()}},_drawLines:function(l,m){var n=this.get("layoutManager"),o=n.get("textLines"),r=n.get("lineAscent");this.get("theme"); +m.save();m.font=this.getPath("editor.font");var u=n.characterRangeForBoundingRect(l);l=u.start;u=u.end;for(var q=u.row,s=l.row;s<=q;s++){var w=o[s];if(!c.none(w)){var v=w.characters,x=v.length,y=Math.min(u.col,x),D=l.col;if(!(D>=x)){w=w.colors;for(x=0;Dn)return;o=l}var r=this;l=m.getPath("textStorage.lines");m=m.get("syntaxManager");n=Math.min(l.length,n+1);m.updateSyntaxForRows(o, +n).then(function(u){r._syntaxManagerUpdatedSyntaxForRows(u.startRow,u.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,col:0},end:{row:0,col:0}}; +this.set("padding",c.clone(this.get("padding")));this.get("layoutManager").addDelegate(this);this._updateEnclosingScrollView();this._resize()},insertText:function(l){if(this._isReadOnly())return false;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,col:n[n.length-1].length}:f.addPositions(m.start,{row:0,col:l.length}))}.bind(this)); +return true},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.col-=n.col==o.length?1:0;var r=!this.isDelimiter(o[n.col]),u=this,q=function(w,v){for(;w>-1&&w0&&n0&&r%l===0&&(new RegExp("^\\s{"+r+"}")).test(n)?{start:{row:u,col:r-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));return true},resetKeyBuffers:function(){this._keyMetaBuffer=this._keyBuffer=""},scrollPageDown:function(){this._scrollPage(false)},scrollPageUp:function(){this._scrollPage(true)},scrollTo:function(l){var m=this._enclosingScrollView;c.none(m)||m.scrollTo(l)},scrollToPosition:function(l){var m=this.get("layoutManager").characterRectForPosition(l); +l=m.x;var n=m.y,o=m.width;m=m.height;var r=this.get("clippingFrame"),u=r.x,q=r.y,s=this.get("padding"),w=r.width-s.right;r=r.height-s.bottom;this.scrollTo({x:l>=u&&l+o=q&&n+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().chainPromise(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()})},function(l){j.reject(l)});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.status!==b.NEW?j._load().then(function(){var k=b._binarySearch(j._files,g);k!==null&&j._files.splice(k,1);h.resolve()},function(k){h.reject(k)}):h.resolve()},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 r=j[k];if(r.substring(0,n)!=g)break;var u=r.indexOf("/",n)+1;if(u==0)u=r.length;r=r.substring(n,u);if(r!="")if(r!=o){o=r;l.push(r)}}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,d=a("canon:environment");b.History=c.Object.extend({_getStorageName:function(){return"bespin.history."+d.global.get("session").currentUser},_getHistory:function(){var e=this.get("storage")[this._getStorageName()];if(e)return JSON.parse(e);return[]},_setHistory:function(e){this.get("storage")[this._getStorageName()]=JSON.stringify(e)},storage:window.localStorage,addPath:function(e){for(var f=this._getHistory(),g=null, +h=f.length-1;h>=0;h--){var j=f[h];if(j.path===e){g=j;f.splice(h,1);break}}if(g===null)g={path:e};f.length>=30&&f.splice(0,f.length-30+1);f.push(g);this._setHistory(f)},getRecent:function(e){var f=this._getHistory();return f.slice(e/,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:/^