"use strict";define("ghost/adapters/application",["exports","ghost/adapters/embedded-relation-adapter"],function(e,t){e["default"]=t["default"].extend({shouldBackgroundReloadRecord:function(){return!1}})}),define("ghost/adapters/base",["exports","ember","ember-data/adapters/rest","ghost/utils/ghost-paths","ember-simple-auth/mixins/data-adapter-mixin"],function(e,t,n,a,r){var l=t["default"].inject.service;e["default"]=n["default"].extend(r["default"],{authorizer:"authorizer:oauth2",host:window.location.origin,namespace:(0,a["default"])().apiRoot.slice(1),session:l(),shouldBackgroundReloadRecord:function(){return!1},query:function(e,t,n){var a=void 0;return n.id&&(a=n.id,delete n.id),this.ajax(this.buildURL(t.modelName,a),"GET",{data:n})},buildURL:function(){var e=this._super.apply(this,arguments);return"/"!==e.slice(-1)&&(e+="/"),e},deleteRecord:function(){var e=this._super.apply(this,arguments);return e.then(function(){return null})},handleResponse:function(e){return 401===e&&this.get("session.isAuthenticated")?void this.get("session").invalidate():this._super.apply(this,arguments)}})}),define("ghost/adapters/embedded-relation-adapter",["exports","ember","ghost/adapters/base"],function(e,t,n){function a(e){return e&&e.constructor===Symbol?"symbol":typeof e}var r=t["default"].get,l=t["default"].isNone;e["default"]=n["default"].extend({find:function(e,t,n,a){return this.ajax(this.buildIncludeURL(e,t.modelName,n,a,"find"),"GET")},findRecord:function(e,t,n,a){return this.ajax(this.buildIncludeURL(e,t.modelName,n,a,"findRecord"),"GET")},findAll:function(e,t,n){var a=void 0,r=void 0;return n&&(a={since:n}),r=this.buildIncludeURL(e,t.modelName,null,null,"findAll"),this.ajax(r,"GET",{data:a})},query:function(e,t,n){return this._super(e,t,this.buildQuery(e,t.modelName,n))},queryRecord:function(e,t,n){return this._super(e,t,this.buildQuery(e,t.modelName,n))},createRecord:function(e,t,n){return this.saveRecord(e,t,n,{method:"POST"},"createRecord")},updateRecord:function(e,t,n){var a={method:"PUT",id:r(n,"id")};return this.saveRecord(e,t,n,a,"updateRecord")},saveRecord:function(e,t,n,a,r){var l=a||{},o=this.buildIncludeURL(e,t.modelName,l.id,n,r),i=this.preparePayload(e,t,n);return this.ajax(o,l.method,i)},preparePayload:function(e,t,n){var a=e.serializerFor(t.modelName),r={};return a.serializeIntoHash(r,t,n),{data:r}},buildIncludeURL:function(e,t,n,a,r,l){var o=this.getEmbeddedRelations(e,t),i=this.buildURL(t,n,a,r,l);return o.length&&(i+="?include="+o.join(",")),i},buildQuery:function(e,t,n){var r={},o=this.getEmbeddedRelations(e,t),i=n||{};return o.length&&("string"==typeof n||"number"==typeof n?(i={},i.id=n,i.include=o.join(",")):("object"===("undefined"==typeof n?"undefined":a(n))||l(n))&&(i=i||{},o=o.concat(i.include?i.include.split(","):[]),o.forEach(function(e){r[e]=!0}),i.include=Object.keys(r).join(","))),i},getEmbeddedRelations:function(e,t){var n=e.modelFor(t),a=[];return n.eachRelationship(function(e,t){"hasMany"===t.kind&&Object.prototype.hasOwnProperty.call(t.options,"embedded")&&"always"===t.options.embedded&&a.push(e)}),a}})}),define("ghost/adapters/setting",["exports","ghost/adapters/application"],function(e,t){e["default"]=t["default"].extend({updateRecord:function(e,t,n){var a={},r=e.serializerFor(t.modelName);return delete n.id,r.serializeIntoHash(a,t,n),this.ajax(this.buildURL(t.modelName),"PUT",{data:a})}})}),define("ghost/adapters/tag",["exports","ghost/adapters/application","ghost/mixins/slug-url"],function(e,t,n){e["default"]=t["default"].extend(n["default"])}),define("ghost/adapters/user",["exports","ghost/adapters/application","ghost/mixins/slug-url"],function(e,t,n){e["default"]=t["default"].extend(n["default"],{find:function(e,t,n){return this.findQuery(e,t,{id:n,status:"all"})},findRecord:function(e,t,n,a){var r=this.buildIncludeURL(e,t.modelName,n,a,"findRecord");return r+="&status=all",this.ajax(r,"GET")},findAll:function(e,t,n){return this.query(e,t,{id:n,status:"all"})}})}),define("ghost/app",["exports","ember","ember-resolver","ember/load-initializers","ghost/utils/link-component","ghost/utils/text-field","ghost/config/environment"],function(e,t,n,a,r,l,o){var i=t["default"].Application;t["default"].MODEL_FACTORY_INJECTIONS=!0;var s=i.extend({Resolver:n["default"],modulePrefix:o["default"].modulePrefix,podModulePrefix:o["default"].podModulePrefix});(0,a["default"])(s,o["default"].modulePrefix),e["default"]=s}),define("ghost/assets/lib/uploader",["exports","ember","ghost/utils/ghost-paths"],function(e,t,n){var a=t["default"].$,r=(0,n["default"])(),l=function(e,t){var n=this,l='
',o='',i=a("
",{"class":"js-upload-progress progress progress-success active",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100"}).append(a("
",{"class":"js-upload-progress-bar bar",style:"width:0%"}));a.extend(this,{complete:function(t){var l=function(t,r){e.find("img.js-upload-target").attr({width:t,height:r}).css({display:"block"}),e.find(".fileupload-loading").remove(),e.css({height:"auto"}),e.delay(250).animate({opacity:100},1e3,function(){a(".js-button-accept").prop("disabled",!1),n.init()})},o=function(t){e.animate({opacity:0},250,function(){e.removeClass("image-uploader").addClass("pre-image-uploader"),n.removeExtras(),e.animate({height:t.height()},250,function(){l(t.width(),t.height())})})},s=function(){var n=e.find("img.js-upload-target").attr({src:"",width:"auto",height:"auto"});i.animate({opacity:0},250,function(){e.find("span.media").after('')}),n.one("load",function(){e.trigger("uploadsuccess",[t]),o(n)}).attr("src",t)};s()},bindFileUpload:function(){var n=this;e.find(".js-fileupload").fileupload().fileupload("option",{url:r.apiRoot+"/uploads/",add:function(n,r){a(".js-button-accept").prop("disabled",!0),e.find(".js-fileupload").removeClass("right"),e.find(".js-url").remove(),i.find(".js-upload-progress-bar").removeClass("fail"),e.trigger("uploadstart",[e.attr("id")]),e.find("span.media, div.description, a.image-url, a.image-webcam").animate({opacity:0},250,function(){e.find("div.description").hide().css({opacity:100}),t.progressbar&&(e.find("div.js-fail").after(i),i.animate({opacity:100},250)),r.submit()})},dropZone:t.fileStorage?e:null,progressall:function(n,a){var r=parseInt(a.loaded/a.total*100,10);t.progressbar&&(e.trigger("uploadprogress",[r,a]),i.find(".js-upload-progress-bar").css("width",r+"%"))},fail:function(t,r){a(".js-button-accept").prop("disabled",!1),e.trigger("uploadfailure",[r.result]),e.find(".js-upload-progress-bar").addClass("fail"),413===r.jqXHR.status?e.find("div.js-fail").text("The image you uploaded was larger than the maximum file size your server allows."):415===r.jqXHR.status?e.find("div.js-fail").text("The image type you uploaded is not supported. Please use .PNG, .JPG, .GIF, .SVG."):e.find("div.js-fail").text("Something went wrong :("),e.find("div.js-fail, button.js-fail").fadeIn(1500),e.find("button.js-fail").on("click",function(){e.css({minHeight:0}),e.find("div.description").show(),n.removeExtras(),n.init()})},done:function(e,t){n.complete(t.result)}})},buildExtras:function(){e.find("span.media")[0]||e.prepend(''),e.find("div.description")[0]||e.append('
Add image
'),e.find("div.js-fail")[0]||e.append(''),e.find("button.js-fail")[0]||e.append(''),e.find("a.image-url")[0]||e.append('')},removeExtras:function(){e.find("span.media, div.js-upload-progress, a.image-url, a.image-upload, a.image-webcam, div.js-fail, button.js-fail, a.js-cancel, button.js-button-accept").remove()},initWithDropzone:function(){var n=this;return e.find("img.js-upload-target").css({display:"none"}),e.find("div.description").show(),e.removeClass("pre-image-uploader image-uploader-url").addClass("image-uploader"),this.removeExtras(),this.buildExtras(),this.bindFileUpload(),t.fileStorage?void e.find("a.image-url").on("click",function(){n.initUrl()}):void this.initUrl()},initUrl:function(){var n=this;this.removeExtras(),e.addClass("image-uploader-url").removeClass("pre-image-uploader"),e.find(".js-fileupload").addClass("right"),e.find(".js-cancel").on("click",function(){e.find(".js-url").remove(),e.find(".js-fileupload").removeClass("right"),e.trigger("imagecleared"),n.removeExtras(),n.initWithDropzone()}),e.find(".js-url")[0]||e.find("div.description").before(l),t.editor&&(e.find("div.js-url").append(''),e.find("div.description").hide()),e.find(".js-button-accept").on("click",function(){var t=e.find(".js-upload-url").val();e.find("div.description").hide(),e.find(".js-fileupload").removeClass("right"),e.find(".js-url").remove(),""===t?(e.trigger("uploadsuccess","http://"),n.initWithDropzone()):n.complete(t)}),t.fileStorage!==!1&&e.append(''),e.find("a.image-upload").on("click",function(){e.find(".js-url").remove(),e.find(".js-fileupload").removeClass("right"),n.initWithDropzone()})},initWithImage:function(){var t=this;this.removeExtras(),e.removeClass("image-uploader image-uploader-url").addClass("pre-image-uploader"),e.find("div.description").hide(),e.find("img.js-upload-target").show(),e.append(o),e.find(".js-cancel").on("click",function(){e.find("img.js-upload-target").attr({src:""}),e.find("div.description").show(),e.trigger("imagecleared"),e.trigger("uploadsuccess","http://"),t.initWithDropzone()})},init:function(){var t=e.find("img.js-upload-target");t[0]||e.prepend(''),a(".js-button-accept").prop("disabled",!1),""===t.attr("src")||void 0===t.attr("src")?this.initWithDropzone():this.initWithImage()},reset:function(){e.find(".js-url").remove(),e.find(".js-fileupload").removeClass("right"),this.removeExtras(),this.initWithDropzone()}})};e["default"]=function(e){var t=a.extend({progressbar:!0,editor:!1,fileStorage:!0},e);return this.each(function(){var e=a(this),n=new l(e,t);a(this).attr("data-uploaderui",!0),this.uploaderUi=n,n.init()})}}),define("ghost/authenticators/oauth2",["exports","ember","ember-simple-auth/authenticators/oauth2-password-grant"],function(e,t,n){var a=t["default"].computed,r=t["default"].inject.service;e["default"]=n["default"].extend({config:r(),ghostPaths:r(),serverTokenEndpoint:a("ghostPaths.apiRoot",function(){return this.get("ghostPaths.apiRoot")+"/authentication/token"}),serverTokenRevocationEndpoint:a("ghostPaths.apiRoot",function(){return this.get("ghostPaths.apiRoot")+"/authentication/revoke"}),makeRequest:function(e,t){return t.client_id=this.get("config.clientId"),t.client_secret=this.get("config.clientSecret"),this._super(e,t)}})}),define("ghost/authorizers/oauth2",["exports","ember-simple-auth/authorizers/oauth2-bearer"],function(e,t){e["default"]=t["default"]}),define("ghost/components/app-version",["exports","ember-cli-app-version/components/app-version","ghost/config/environment"],function(e,t,n){var a=n["default"].APP.name,r=n["default"].APP.version;e["default"]=t["default"].extend({version:r,name:a})}),define("ghost/components/ember-selectize",["exports","ember-cli-selectize/components/ember-selectize"],function(e,t){e["default"]=t["default"]}),define("ghost/components/gh-activating-list-item",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].run;e["default"]=n.extend({tagName:"li",classNameBindings:["active"],active:!1,linkClasses:null,click:function(){this.$("a").blur()},actions:{setActive:function(e){a.schedule("afterRender",this,function(){this.set("active",e)})}}})}),define("ghost/components/gh-alert",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service;e["default"]=n.extend({tagName:"article",classNames:["gh-alert"],classNameBindings:["typeClass"],notifications:r(),typeClass:a("message.type",function(){var e=this.get("message.type"),t="",n=void 0;return n={success:"green",error:"red",warn:"yellow",info:"blue"},void 0!==n[e]&&(t+="gh-alert-"+n[e]),t}),actions:{closeNotification:function(){this.get("notifications").closeNotification(this.get("message"))}}})}),define("ghost/components/gh-alerts",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service,l=t["default"].observer,o=a.alias;e["default"]=n.extend({tagName:"aside",classNames:"gh-alerts",notifications:r(),messages:o("notifications.alerts"),messageCountObserver:l("messages.[]",function(){this.sendAction("notify",this.get("messages").length)})})}),define("ghost/components/gh-app",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].observer;e["default"]=n.extend({classNames:["gh-app"],showSettingsMenu:!1,toggleSettingsMenuBodyClass:a("showSettingsMenu",function(){var e=this.get("showSettingsMenu");t["default"].$("body").toggleClass("settings-menu-expanded",e)})})}),define("ghost/components/gh-blog-url",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].inject.service;e["default"]=n.extend({tagName:"",config:a()})}),define("ghost/components/gh-cm-editor",["exports","ember"],function(e,t){var n=t["default"].Component;e["default"]=n.extend({classNameBindings:["isFocused:focused"],value:"",isFocused:!1,lineNumbers:!0,indentUnit:4,mode:"htmlmixed",theme:"xq-light",_editor:null,didInsertElement:function(){var e=this;this._super.apply(this,arguments);var n=this.getProperties("lineNumbers","indentUnit","mode","theme"),a=new CodeMirror(this.get("element"),n);a.getDoc().setValue(this.get("value")),a.on("focus",t["default"].run.bind(this,"set","isFocused",!0)),a.on("blur",t["default"].run.bind(this,"set","isFocused",!1)),a.on("change",function(){t["default"].run(e,function(){this.set("value",a.getDoc().getValue())})}),this._editor=a},willDestroyElement:function(){this._super.apply(this,arguments);var e=this._editor.getWrapperElement();e.parentNode.removeChild(e),this._editor=null}})}),define("ghost/components/gh-content-cover",["exports","ember"],function(e,t){var n=t["default"].Component;e["default"]=n.extend({classNames:["content-cover"],onClick:null,onMouseEnter:null,click:function(){this.sendAction("onClick")},mouseEnter:function(){this.sendAction("onMouseEnter")}})}),define("ghost/components/gh-content-preview-content",["exports","ember"],function(e,t){var n=t["default"].Component;e["default"]=n.extend({classNames:["content-preview-content"],content:null,didReceiveAttrs:function(e){if(this._super.apply(this,arguments),e.newAttrs.content&&this.get("content")!==e.newAttrs.content.value){var t=this.$();t&&t.closest(".content-preview").scrollTop(0)}}})}),define("ghost/components/gh-content-view-container",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service;e["default"]=n.extend({tagName:"section",classNames:["gh-view","content-view-container"],mediaQueries:r(),previewIsHidden:a.reads("mediaQueries.maxWidth900")})}),define("ghost/components/gh-datetime-input",["exports","ember","ghost/mixins/text-input","ghost/utils/bound-one-way","ghost/utils/date-formatting"],function(e,t,n,a,r){var l=t["default"].Component;e["default"]=l.extend(n["default"],{tagName:"span",classNames:"input-icon icon-calendar",datetime:(0,a["default"])("value"),inputClass:null,inputId:null,inputName:null,didReceiveAttrs:function(){var e=this.get("datetime")||moment();if(!this.attrs.update)throw new Error("You must provide an `update` action to `{{"+this.templateName+"}}`.");this.set("datetime",(0,r.formatDate)(e))},focusOut:function(){var e=this.get("datetime");this.attrs.update(e)}})}),define("ghost/components/gh-dropdown-button",["exports","ember","ghost/mixins/dropdown-mixin"],function(e,t,n){var a=t["default"].Component,r=t["default"].inject.service;e["default"]=a.extend(n["default"],{tagName:"button",attributeBindings:"role",role:"button",dropdownName:null,dropdown:r(),click:function(e){this._super(e),this.get("dropdown").toggleDropdown(this.get("dropdownName"),this)}})}),define("ghost/components/gh-dropdown",["exports","ember","ghost/mixins/dropdown-mixin"],function(e,t,n){var a=t["default"].Component,r=t["default"].computed,l=t["default"].inject.service;e["default"]=a.extend(n["default"],{classNames:"dropdown",classNameBindings:["fadeIn:fade-in-scale:fade-out","isOpen:open:closed"],name:null,closeOnClick:!1,closing:!1,isOpen:!1,fadeIn:r("isOpen","closing",function(){return this.get("isOpen")&&!this.get("closing")}),dropdown:l(),open:function(){this.set("isOpen",!0),this.set("closing",!1),this.set("button.isOpen",!0)},close:function(){var e=this;this.set("closing",!0),this.get("button")&&this.set("button.isOpen",!1),this.$().on("animationend webkitAnimationEnd oanimationend MSAnimationEnd",function(n){"fade-out"===n.originalEvent.animationName&&t["default"].run(e,function(){this.get("closing")&&(this.set("isOpen",!1),this.set("closing",!1))})})},toggle:function(e){var t=this.get("closing"),n=this.get("isOpen"),a=this.get("name"),r=e.target,l=this.get("button");a!==r||n&&!t?n&&this.close():(l||(l=e.button,this.set("button",l)),this.open())},click:function(e){return this._super(e),this.get("closeOnClick")?this.close():void 0},didInsertElement:function(){var e=this.get("dropdown");this._super.apply(this,arguments),e.on("close",this,this.close),e.on("toggle",this,this.toggle)},willDestroyElement:function(){var e=this.get("dropdown");this._super.apply(this,arguments),e.off("close",this,this.close),e.off("toggle",this,this.toggle)}})}),define("ghost/components/gh-ed-editor",["exports","ember","ghost/mixins/ed-editor-api","ghost/mixins/ed-editor-shortcuts","ghost/mixins/ed-editor-scroll"],function(e,t,n,a,r){var l=t["default"].TextArea,o=t["default"].run;e["default"]=l.extend(n["default"],a["default"],r["default"],{focus:!1,focusIn:function(){this.sendAction("onFocusIn")},setFocus:function(){this.get("focus")&&this.$().val(this.$().val()).focus()},didInsertElement:function(){this._super.apply(this,arguments),this.setFocus(),this.attrs.setEditor(this),o.scheduleOnce("afterRender",this,this.afterRenderEvent)},afterRenderEvent:function(){this.get("focus")&&this.get("focusCursorAtEnd")&&this.setSelection("end")},actions:{toggleCopyHTMLModal:function(e){this.attrs.toggleCopyHTMLModal(e)}}})}),define("ghost/components/gh-ed-preview",["exports","ember","ghost/assets/lib/uploader"],function(e,t,n){var a=t["default"].$,r=t["default"].Component,l=t["default"].inject.service,o=t["default"].run;e["default"]=r.extend({config:l(),_scrollWrapper:null,didInsertElement:function(){this._super.apply(this,arguments),this._scrollWrapper=this.$().closest(".entry-preview-content"),this.adjustScrollPosition(this.get("scrollPosition")),o.scheduleOnce("afterRender",this,this.dropzoneHandler)},didReceiveAttrs:function(e){this._super.apply(this,arguments),e.oldAttrs&&(e.newAttrs.scrollPosition&&e.newAttrs.scrollPosition.value!==e.oldAttrs.scrollPosition.value&&this.adjustScrollPosition(e.newAttrs.scrollPosition.value),e.newAttrs.markdown.value!==e.oldAttrs.markdown.value&&o.scheduleOnce("afterRender",this,this.dropzoneHandler))},adjustScrollPosition:function(e){var t=this._scrollWrapper;t&&t.scrollTop(e)},dropzoneHandler:function(){var e=a('.js-drop-zone[data-uploaderui!="true"]');e.length&&(n["default"].call(e,{editor:!0,fileStorage:this.get("config.fileStorage")}),e.on("uploadstart",o.bind(this,"sendAction","uploadStarted")),e.on("uploadfailure",o.bind(this,"sendAction","uploadFinished")),e.on("uploadsuccess",o.bind(this,"sendAction","uploadFinished")),e.on("uploadsuccess",o.bind(this,"sendAction","uploadSuccess")),this.sendAction("updateHeight",this.$().height()))}})}),define("ghost/components/gh-editor-save-button",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed;e["default"]=n.extend({tagName:"section",classNames:["splitbtn","js-publish-splitbutton"],classNameBindings:["isNew:unsaved"],isNew:null,isPublished:null,willPublish:null,postOrPage:null,submitting:!1,isDangerous:a("isPublished","willPublish",function(){return this.get("isPublished")!==this.get("willPublish")}),publishText:a("isPublished","postOrPage",function(){return this.get("isPublished")?"Update "+this.get("postOrPage"):"Publish Now"}),draftText:a("isPublished",function(){return this.get("isPublished")?"Unpublish":"Save Draft"}),deleteText:a("postOrPage",function(){return"Delete "+this.get("postOrPage")}),saveText:a("willPublish","publishText","draftText",function(){return this.get("willPublish")?this.get("publishText"):this.get("draftText")}),actions:{save:function(){this.sendAction("save")},setSaveType:function(e){this.sendAction("setSaveType",e)},"delete":function(){this.sendAction("delete")}}})}),define("ghost/components/gh-editor",["exports","ember","ghost/mixins/shortcuts","ghost/utils/ed-image-manager","ghost/utils/editor-shortcuts"],function(e,t,n,a,r){var l=t["default"].Component,o=t["default"].computed,i=t["default"].run,s=o.equal;e["default"]=l.extend(n["default"],{tagName:"section",classNames:["view-container","view-editor"],activeTab:"markdown",editor:null,editorDisabled:void 0,editorScrollInfo:null,height:null,shouldFocusEditor:!1,showCopyHTMLModal:!1,copyHTMLModalContent:null,shortcuts:r["default"],markdownActive:s("activeTab","markdown"),previewActive:s("activeTab","preview"),scrollPosition:o("editorScrollInfo","height",function(){var e=this.get("editorScrollInfo"),t=this.$previewContent,n=this.$previewViewPort;if(!e||!t||!n)return 0;var a=t.height()-n.height(),r=void 0,l=void 0;return l=a/e.diff,r=e.top*l}),didInsertElement:function(){this._super.apply(this,arguments),this.registerShortcuts(),i.scheduleOnce("afterRender",this,this._cacheElements)},willDestroyElement:function(){this.attrs.onTeardown&&this.attrs.onTeardown(),this.removeShortcuts()},_cacheElements:function(){this.$previewViewPort=this.$(".js-entry-preview-content"),this.$previewContent=this.$(".js-rendered-markdown")},actions:{selectTab:function(e){this.set("activeTab",e)},updateScrollInfo:function(e){this.set("editorScrollInfo",e)},updateHeight:function(e){this.set("height",e)},setEditor:function(e){this.set("editor",e)},disableEditor:function(){this.set("editorDisabled",!0)},enableEditor:function(){this.set("editorDisabled",void 0)},editorShortcut:function(e){this.editor.$().is(":focus")&&this.editor.shortcut(e.type)},handleImgUpload:function(e,t){var n=this.get("editor"),r=n.getValue(),l=a["default"].getSrcRange(r,e.target),o=void 0;l&&(o=l.start+t.length+1,l.needsParens&&(t="("+t+")"),n.replaceSelection(t,l.start,l.end,o))},toggleCopyHTMLModal:function(e){this.set("copyHTMLModalContent",e),this.toggleProperty("showCopyHTMLModal")}}})}),define("ghost/components/gh-error-message",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].isEmpty;e["default"]=n.extend({tagName:"p",classNames:["response"],errors:null,property:"",isVisible:a.notEmpty("errors"),message:a("errors.[]","property",function(){var e=this.get("property"),t=this.get("errors"),n=[],a=void 0;return!r(t)&&t.get(e)?(t.get(e).forEach(function(e){n.push(e)}),a=Math.floor(Math.random()*n.length),n[a].message):void 0})})}),define("ghost/components/gh-feature-flag",["exports","ember"],function(e,t){var n=t["default"].computed,a=t["default"].inject.service,r=t["default"].Component,l=r.extend({tagName:"label",classNames:"checkbox",attributeBindings:["for"],_flagValue:null,feature:a(),isVisible:n.notEmpty("_flagValue"),init:function(){var e=this;this._super.apply(this,arguments),this.get("feature."+this.get("flag")).then(function(t){e.set("_flagValue",t)})},value:n("_flagValue",{get:function(){return this.get("_flagValue")},set:function(e,t){return this.set("feature."+this.get("flag"),t)}}),"for":n("flag",function(){return"labs-"+this.get("flag")}),name:n("flag",function(){return"labs["+this.get("flag")+"]"})});l.reopenClass({positionalParams:["flag"]}),e["default"]=l}),define("ghost/components/gh-file-upload",["exports","ember"],function(e,t){var n=t["default"].Component;e["default"]=n.extend({_file:null,uploadButtonText:"Text",uploadButtonDisabled:!0,onUpload:null,onAdd:null,shouldResetForm:!0,change:function(e){this.set("uploadButtonDisabled",!1),this.sendAction("onAdd"),this._file=e.target.files[0]},actions:{upload:function(){!this.get("uploadButtonDisabled")&&this._file&&this.sendAction("onUpload",this._file),this.set("uploadButtonDisabled",!0),this.get("shouldResetForm")&&this.$().closest("form")[0].reset()}}})}),define("ghost/components/gh-form-group",["exports","ghost/components/gh-validation-status-container"],function(e,t){e["default"]=t["default"].extend({classNames:"form-group"})}),define("ghost/components/gh-fullscreen-modal",["exports","ember","liquid-tether/components/liquid-tether"],function(e,t,n){var a=t["default"].RSVP.Promise,r=t["default"].inject.service,l=t["default"].isBlank,o=t["default"].on,i=t["default"].run,s=t["default"].A,d=n["default"].extend({to:"fullscreen-modal",target:"document.body",targetModifier:"visible",targetAttachment:"top center",attachment:"top center",tetherClass:"fullscreen-modal",overlayClass:"fullscreen-modal-background",modalPath:"unknown",dropdown:r(),init:function(){this._super.apply(this,arguments),this.modalPath="modals/"+this.get("modal")},setTetherClass:o("init",function(){var e=this.get("tetherClass"),t=(this.get("modifier")||"").split(" "),n=s([e]);t.forEach(function(t){if(!l(t)){var a=e+"-"+t;n.push(a)}}),this.set("tetherClass",n.join(" "))}),closeDropdowns:o("didInsertElement",function(){i.schedule("afterRender",this,function(){this.get("dropdown").closeDropdowns()})}),actions:{close:function(){return this.attrs.close?this.attrs.close():new a(function(e){e()})},confirm:function(){return this.attrs.confirm?this.attrs.confirm():new a(function(e){e()})},clickOverlay:function(){this.send("close")}}});d.reopenClass({positionalParams:["modal"]}),e["default"]=d}),define("ghost/components/gh-infinite-scroll",["exports","ember","ghost/mixins/infinite-scroll"],function(e,t,n){var a=t["default"].Component;e["default"]=a.extend(n["default"],{actions:{checkScroll:function(){this._checkScroll()}}})}),define("ghost/components/gh-input",["exports","ember","ghost/mixins/text-input"],function(e,t,n){var a=t["default"].TextField;e["default"]=a.extend(n["default"],{classNames:"gh-input"})}),define("ghost/components/gh-main",["exports","ember"],function(e,t){var n=t["default"].Component;e["default"]=n.extend({tagName:"main",classNames:["gh-main"],ariaRole:"main",mouseEnter:function(){this.sendAction("onMouseEnter")}})}),define("ghost/components/gh-menu-toggle",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service;e["default"]=n.extend({classNames:["gh-menu-toggle"],mediaQueries:r(),isMobile:a.reads("mediaQueries.isMobile"),maximise:!1,iconClass:a("maximise","isMobile",function(){return this.get("maximise")&&!this.get("isMobile")?"icon-maximise":"icon-minimise"}),click:function(){this.get("isMobile")?this.sendAction("mobileAction"):(this.toggleProperty("maximise"),this.sendAction("desktopAction"))}})}),define("ghost/components/gh-nav-menu",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].inject.service;e["default"]=n.extend({tagName:"nav",classNames:["gh-nav"],classNameBindings:["open"],open:!1,config:a(),session:a(),mouseEnter:function(){this.sendAction("onMouseEnter")},actions:{toggleAutoNav:function(){this.sendAction("toggleMaximise")},showMarkdownHelp:function(){this.sendAction("showMarkdownHelp")},closeMobileMenu:function(){this.sendAction("closeMobileMenu")},openAutoNav:function(){this.sendAction("openAutoNav")}}})}),define("ghost/components/gh-navigation",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].run;e["default"]=n.extend({tagName:"section",classNames:"gh-view",didInsertElement:function(){var e=this.$(".js-gh-blognav"),t=".gh-blognav-item:not(.gh-blognav-item:last-child)",n=this;this._super.apply(this,arguments),e.sortable({handle:".gh-blognav-grab",items:t,start:function(e,t){a(function(){t.item.data("start-index",t.item.index())})},update:function(e,t){a(function(){n.sendAction("moveItem",t.item.data("start-index"),t.item.index())})}})},willDestroyElement:function(){this._super.apply(this,arguments),this.$(".ui-sortable").sortable("destroy")}})}),define("ghost/components/gh-navitem-url-input",["exports","ember"],function(e,t){var n=t["default"].TextField,a=t["default"].computed,r=t["default"].run,l=function(e,t){return"/"!==t[0]&&"/"!==e.slice(-1)?t="/"+t:"/"===t[0]&&"/"===e.slice(-1)&&(t=t.slice(1)),e+t},o=function(e){return!e.match(/\s/)&&!validator.isURL(e)&&!e.match(/^(\/\/|#|[a-zA-Z0-9\-]+:)/)};e["default"]=n.extend({classNames:"gh-input",classNameBindings:["fakePlaceholder"],isBaseUrl:a("baseUrl","value",function(){return this.get("baseUrl")===this.get("value")}),fakePlaceholder:a("isBaseUrl","hasFocus","isNew",function(){return this.get("isBaseUrl")&&this.get("isNew")&&!this.get("hasFocus")}),didReceiveAttrs:function(){this._super.apply(this,arguments);var e=this.get("baseUrl"),t=this.get("url");o(t)&&(t=l(e,t)),this.set("value",t)},focusIn:function(e){this.set("hasFocus",!0),this.get("isBaseUrl")&&r.next(function(e){var t=e.value.length;e.setSelectionRange(t,t)},e.target)},keyDown:function(e){!this.get("isBaseUrl")||8!==e.keyCode&&46!==e.keyCode||(this.set("value",""),e.preventDefault()),83===e.keyCode&&e.metaKey&&this.notifyUrlChanged()},keyPress:function(e){return this.attrs.clearErrors(),13===e.keyCode&&this.notifyUrlChanged(),!0},focusOut:function(){this.set("hasFocus",!1),this.notifyUrlChanged()},notifyUrlChanged:function(){var e=this.get("value").trim(),t=document.createElement("a"),n=this.get("baseUrl"),a=document.createElement("a");this.set("value",e),t.href=e,a.href=n,validator.isEmail(e)&&(e="mailto:"+e,this.set("value",e)),o(e)&&(e=l(n,e),this.set("value",e));var r=t.host===a.host,i=e.match(/^#/),s=0===t.pathname.indexOf(a.pathname);t.pathname+"/"===a.pathname&&(s=!0),!i&&r&&s&&(e=e.replace(/^[a-zA-Z0-9\-]+:/,""),e=e.replace(/^\/\//,""),e=e.replace(a.host,""),e=e.replace(a.pathname,""),"/"!==t.pathname.slice(-1)&&(e=e.replace(a.pathname.slice(0,-1),"")),e.match(/^\//)||(e="/"+e),e.match(/\/$/)||e.match(/[\.#\?]/)||(e+="/")),this.sendAction("change",e)}})}),define("ghost/components/gh-navitem",["exports","ember","ghost/mixins/validation-state","ember-sortable/mixins/sortable-item"],function(e,t,n,a){var r=t["default"].Component,l=t["default"].computed,o=t["default"].run,i=l.alias,s=l.readOnly;e["default"]=r.extend(n["default"],a["default"],{classNames:"gh-blognav-item",classNameBindings:["errorClass","navItem.isNew::gh-blognav-item--sortable"],"new":!1,handle:".gh-blognav-grab",model:i("navItem"),errors:s("navItem.errors"),errorClass:l("hasError",function(){return this.get("hasError")?"gh-blognav-item--error":void 0}),keyPress:function(e){13===e.keyCode&&this.get("navItem.isNew")&&(e.preventDefault(),o.scheduleOnce("actions",this,function(){this.send("addItem")}))},actions:{addItem:function(){this.sendAction("addItem")},deleteItem:function(e){this.sendAction("deleteItem",e)},updateUrl:function(e){this.sendAction("updateUrl",e,this.get("navItem"))},clearLabelErrors:function(){this.get("navItem.errors").remove("label")},clearUrlErrors:function(){this.get("navItem.errors").remove("url")}}})}),define("ghost/components/gh-notification",["exports","ember"],function(e,t){ var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service;e["default"]=n.extend({tagName:"article",classNames:["gh-notification","gh-notification-passive"],classNameBindings:["typeClass"],message:null,notifications:r(),typeClass:a("message.type",function(){var e=this.get("message.type"),t="",n=void 0;return n={success:"green",error:"red",warn:"yellow"},void 0!==n[e]&&(t+="gh-notification-"+n[e]),t}),didInsertElement:function(){var e=this;this._super.apply(this,arguments),this.$().on("animationend webkitAnimationEnd oanimationend MSAnimationEnd",function(t){"fade-out"===t.originalEvent.animationName&&e.get("notifications").closeNotification(e.get("message"))})},willDestroyElement:function(){this._super.apply(this,arguments),this.$().off("animationend webkitAnimationEnd oanimationend MSAnimationEnd")},actions:{closeNotification:function(){this.get("notifications").closeNotification(this.get("message"))}}})}),define("ghost/components/gh-notifications",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service,l=a.alias;e["default"]=n.extend({tagName:"aside",classNames:"gh-notifications",notifications:r(),messages:l("notifications.notifications")})}),define("ghost/components/gh-popover-button",["exports","ember","ghost/components/gh-dropdown-button"],function(e,t,n){function a(){return this}var r=t["default"].inject.service;e["default"]=n["default"].extend({dropdown:r(),click:a,mouseEnter:function(){this._super.apply(this,arguments),this.get("dropdown").toggleDropdown(this.get("popoverName"),this)},mouseLeave:function(){this._super.apply(this,arguments),this.get("dropdown").toggleDropdown(this.get("popoverName"),this)}})}),define("ghost/components/gh-popover",["exports","ember","ghost/components/gh-dropdown"],function(e,t,n){var a=t["default"].inject.service;e["default"]=n["default"].extend({classNames:"ghost-popover",dropdown:a()})}),define("ghost/components/gh-posts-list-item",["exports","ember","ghost/mixins/active-link-wrapper"],function(e,t,n){var a=t["default"].$,r=t["default"].Component,l=t["default"].computed,o=t["default"].inject.service,i=l.alias,s=l.equal;e["default"]=r.extend(n["default"],{tagName:"li",classNameBindings:["isFeatured:featured","isPage:page"],post:null,previewIsHidden:!1,isFeatured:i("post.featured"),isPage:i("post.page"),isPublished:s("post.status","published"),ghostPaths:o(),authorName:l("post.author.name","post.author.email",function(){return this.get("post.author.name")||this.get("post.author.email")}),authorAvatar:l("post.author.image",function(){return this.get("post.author.image")||this.get("ghostPaths.subdir")+"/ghost/img/user-image.png"}),authorAvatarBackground:l("authorAvatar",function(){return t["default"].String.htmlSafe("background-image: url("+this.get("authorAvatar")+")")}),click:function(){this.sendAction("onClick",this.get("post"))},doubleClick:function(){this.sendAction("onDoubleClick",this.get("post"))},didInsertElement:function(){this._super.apply(this,arguments),this.addObserver("active",this,this.scrollIntoView)},willDestroyElement:function(){this._super.apply(this,arguments),this.removeObserver("active",this,this.scrollIntoView),this.get("post.isDeleted")&&this.attrs.onDelete&&this.attrs.onDelete()},scrollIntoView:function(){if(this.get("active")){var e=this.$(),t=e.offset().top,n=e.height(),r=a(".js-content-scrollbox"),l=r.height(),o=r.scrollTop(),i=void 0,s=void 0,d=void 0;s=l>t,i=t>n,d=i&&s,d||r.clearQueue().animate({scrollTop:o+t-40-l/2})}}})}),define("ghost/components/gh-profile-image",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service,l=t["default"].run,o=a.notEmpty;e["default"]=n.extend({email:"",size:90,debounce:300,validEmail:"",hasUploadedImage:!1,fileStorage:!0,ghostPaths:r(),displayGravatar:o("validEmail"),init:function(){this._super.apply(this,arguments),this.trySetValidEmail()},defaultImage:a("ghostPaths",function(){var e=this.get("ghostPaths.subdir")+"/ghost/img/user-image.png";return t["default"].String.htmlSafe("background-image: url("+e+")")}),trySetValidEmail:function(){if(!this.get("isDestroyed")){var e=this.get("email");this.set("validEmail",validator.isEmail(e)?e:"")}},didReceiveAttrs:function(e){this._super.apply(this,arguments);var t=parseInt(e.newAttrs.throttle||this.get("debounce"));l.debounce(this,"trySetValidEmail",t)},imageBackground:a("validEmail","size",function(){var e=this.get("validEmail"),n=this.get("size"),a="";if(e){var r="//www.gravatar.com/avatar/"+window.md5(e)+"?s="+n+"&d=blank";a="background-image: url("+r+")"}return t["default"].String.htmlSafe(a)}),didInsertElement:function(){var e=this.get("size"),t=this.$(".js-file-input");this._super.apply(this,arguments),t.fileupload({url:this.get("ghostPaths.url").api("uploads"),dropZone:this.$(".js-img-dropzone"),previewMaxHeight:e,previewMaxWidth:e,previewCrop:!0,maxNumberOfFiles:1,autoUpload:!1}).on("fileuploadadd",l.bind(this,this.queueFile)).on("fileuploadprocessalways",l.bind(this,this.triggerPreview))},willDestroyElement:function(){var e=this.$(".js-file-input");this._super.apply(this,arguments),e.length&&e.data()["blueimp-fileupload"]&&e.fileupload("destroy")},queueFile:function(e,t){var n=t.files[0].name;/\.(gif|jpe?g|png|svg?z)$/i.test(n)&&this.sendAction("setImage",t)},triggerPreview:function(e,t){var n=t.files[t.index];n.preview&&(this.set("hasUploadedImage",!0),this.$(".js-img-preview").empty().append(this.$(n.preview).addClass("gravatar-img")))}})}),define("ghost/components/gh-search-input",["exports","ember"],function(e,t){var n=t["default"].$,a=t["default"].Component,r=t["default"].RSVP,l=t["default"].computed,o=t["default"].inject.service,i=t["default"].observer,s=l.filterBy;e["default"]=a.extend({selection:null,content:[],isLoading:!1,contentExpiry:1e4,contentExpiresAt:!1,posts:s("content","category","Posts"),pages:s("content","category","Pages"),users:s("content","category","Users"),tags:s("content","category","Tags"),_store:o("store"),_routing:o("-routing"),ajax:o(),_selectize:l(function(){return this.$("select")[0].selectize}),refreshContent:function(){var e=this,t=[],n=new Date,a=this.get("contentExpiry"),l=this.get("contentExpiresAt");this.get("isLoading")||l>n||(this.set("isLoading",!0),this.set("content",[]),t.pushObject(this._loadPosts()),t.pushObject(this._loadUsers()),t.pushObject(this._loadTags()),r.all(t).then(function(){})["finally"](function(){e.set("isLoading",!1),e.set("contentExpiresAt",new Date(n.getTime()+a))}))},_loadPosts:function(){var e=this.get("_store"),t=e.adapterFor("post").urlForQuery({},"post")+"/",n={fields:"id,title,page",limit:"all",status:"all",staticPages:"all"},a=this.get("content");return this.get("ajax").request(t,{data:n}).then(function(e){a.pushObjects(e.posts.map(function(e){return{id:"post."+e.id,title:e.title,category:e.page?"Pages":"Posts"}}))})},_loadUsers:function(){var e=this.get("_store"),t=e.adapterFor("user").urlForQuery({},"user")+"/",n={fields:"name,slug",limit:"all"},a=this.get("content");return this.get("ajax").request(t,{data:n}).then(function(e){a.pushObjects(e.users.map(function(e){return{id:"user."+e.slug,title:e.name,category:"Users"}}))})},_loadTags:function(){var e=this.get("_store"),t=e.adapterFor("tag").urlForQuery({},"tag")+"/",n={fields:"name,slug",limit:"all"},a=this.get("content");return this.get("ajax").request(t,{data:n}).then(function(e){a.pushObjects(e.tags.map(function(e){return{id:"tag."+e.slug,title:e.name,category:"Tags"}}))})},_keepSelectionClear:i("selection",function(){null!==this.get("selection")&&this.set("selection",null)}),_setKeymasterScope:function(){key.setScope("search-input")},_resetKeymasterScope:function(){key.setScope("default")},willDestroy:function(){this._super.apply(this,arguments),this._resetKeymasterScope()},actions:{openSelected:function(e){var t=this,n=null;if(e){if("Posts"===e.category||"Pages"===e.category){var a=e.id.replace("post.","");n=this.get("_routing.router").transitionTo("editor.edit",a)}if("Users"===e.category){var a=e.id.replace("user.","");n=this.get("_routing.router").transitionTo("team.user",a)}if("Tags"===e.category){var a=e.id.replace("tag.","");n=this.get("_routing.router").transitionTo("settings.tags.tag",a)}n.then(function(){t.get("_selectize").$control_input.is(":focus")&&t._setKeymasterScope()})}},focusInput:function(){this.get("_selectize").focus()},onInit:function(){var e=this.get("_selectize"),t='';e.$empty_results_container=n(t),e.$empty_results_container.hide(),e.$dropdown.append(e.$empty_results_container)},onFocus:function(){this._setKeymasterScope(),this.refreshContent()},onBlur:function(){var e=this.get("_selectize");this._resetKeymasterScope(),e.$empty_results_container.hide()},onType:function(){var e=this.get("_selectize");e.hasOptions?e.$empty_results_container.hide():(e.open(),e.$empty_results_container.show())}}})}),define("ghost/components/gh-select-native",["exports","ember"],function(e,t){function n(){return this}var a=t["default"].Component,r=t["default"].computed,l=r.reads;e["default"]=a.extend({content:null,prompt:null,optionValuePath:"id",optionLabelPath:"title",selection:null,action:n,_selection:l("selection"),actions:{change:function(){var e=this.$("select")[0],t=e.selectedIndex,n=!!this.get("prompt"),a=n?t-1:t,r=this.get("content").objectAt(a);this.set("_selection",r),this.sendAction("action",r)}}})}),define("ghost/components/gh-selectize",["exports","ember","ember-cli-selectize/components/ember-selectize"],function(e,t,n){var a=t["default"].computed,r=t["default"].isArray,l=t["default"].isBlank,o=t["default"].get,i=t["default"].run,s=t["default"].A;e["default"]=n["default"].extend({selectizeOptions:a(function(){var e=this._super.apply(this,arguments);return e.onChange=i.bind(this,"_onChange"),e}),_create:function(e,t){var n=this._selectize.caretPos;this._selectize.setTextboxValue(""),i.schedule("actions",this,function(){this.sendAction("create-item",e,n)}),t(null)},_addSelection:function(e){var t=this.get("_valuePath"),n=o(e,t),a=this._selectize.caretPos;a-=1,this.get("selection").insertAt(a,e),i.schedule("actions",this,function(){this.sendAction("add-item",e),this.sendAction("add-value",n)})},_onChange:function(e){var n=t["default"].get(this,"selection"),a=t["default"].get(this,"_valuePath"),l=s([]);if(e&&n&&r(n)&&e.length===o(n,"length")){var i=n.any(function(t){return-1===e.indexOf(o(t,a))});if(!i){var d=n.every(function(t,n){return o(t,a)===e[n]});d||(e.forEach(function(e){var t=n.find(function(t){return""+o(t,a)===e});t&&l.addObject(t)}),this.set("selection",l))}}},_preventOpeningWhenBlank:function(){var e=this.get("openOnFocus");e||i.schedule("afterRender",this,function(){var e=this._selectize;e&&(e.on("dropdown_open",function(){l(e.$control_input.val())&&e.close()}),e.on("type",function(t){l(t)&&e.close()}))})},didInsertElement:function(){this._super.apply(this,arguments),this._preventOpeningWhenBlank()}})}),define("ghost/components/gh-skip-link",["exports","ember"],function(e,t){var n=t["default"].$,a=t["default"].Component;e["default"]=a.extend({tagName:"a",anchor:"",classNames:["sr-only","sr-only-focusable"],attributeBindings:["href"],href:t["default"].String.htmlSafe("javascript:;"),click:function(){var e=this.get("anchor"),a=t["default"].$(e);a&&(t["default"].$("body").scrollTop(a.offset().top),t["default"].$(a).attr("tabindex",-1).on("blur focusout",function(){n(this).removeAttr("tabindex")}).focus())}})}),define("ghost/components/gh-spin-button",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].observer,l=t["default"].run,o=a.equal;e["default"]=n.extend({tagName:"button",buttonText:"",submitting:!1,showSpinner:!1,showSpinnerTimeout:null,autoWidth:!0,attributeBindings:["disabled","type","tabindex"],disabled:o("showSpinner",!0),click:function(){return this.get("action")?(this.sendAction("action"),!1):!0},toggleSpinner:r("submitting",function(){var e=this.get("submitting"),t=this.get("showSpinnerTimeout");e?(this.set("showSpinner",!0),this.set("showSpinnerTimeout",l.later(this,function(){this.get("submitting")||this.set("showSpinner",!1),this.set("showSpinnerTimeout",null)},1e3))):e||null!==t||this.set("showSpinner",!1)}),setSize:r("showSpinner",function(){this.get("showSpinner")&&this.get("autoWidth")?(this.$().width(this.$().width()),this.$().height(this.$().height())):(this.$().width(""),this.$().height(""))}),willDestroy:function(){this._super.apply(this,arguments),l.cancel(this.get("showSpinnerTimeout"))}})}),define("ghost/components/gh-tab-pane",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=a.alias;e["default"]=n.extend({classNameBindings:["active"],tabsManager:a(function(){return this.nearestWithProperty("isTabsManager")}),tab:a("tabsManager.tabs.[]","tabsManager.tabPanes.[]",function(){var e=this.get("tabsManager.tabPanes").indexOf(this),t=this.get("tabsManager.tabs");return t&&t.objectAt(e)}),active:r("tab.active"),willRender:function(){this._super.apply(this,arguments),this.get("tabsManager").registerTabPane(this)},willDestroyElement:function(){this._super.apply(this,arguments),this.get("tabsManager").unregisterTabPane(this)}})}),define("ghost/components/gh-tab",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed;e["default"]=n.extend({tabsManager:a(function(){return this.nearestWithProperty("isTabsManager")}),active:a("tabsManager.activeTab",function(){return this.get("tabsManager.activeTab")===this}),index:a("tabsManager.tabs.[]",function(){return this.get("tabsManager.tabs").indexOf(this)}),click:function(){this.get("tabsManager").select(this)},willRender:function(){this._super.apply(this,arguments),this.get("tabsManager").registerTab(this)},willDestroyElement:function(){this._super.apply(this,arguments),this.get("tabsManager").unregisterTab(this)}})}),define("ghost/components/gh-tabs-manager",["exports","ember"],function(e,t){var n=t["default"].Component;e["default"]=n.extend({activeTab:null,tabs:[],tabPanes:[],isTabsManager:!0,select:function(e){this.set("activeTab",e),this.sendAction("selected")},registerTab:function(e){this.get("tabs").addObject(e)},unregisterTab:function(e){this.get("tabs").removeObject(e)},registerTabPane:function(e){this.get("tabPanes").addObject(e)},unregisterTabPane:function(e){this.get("tabPanes").removeObject(e)}})}),define("ghost/components/gh-tag-settings-form",["exports","ember","ghost/utils/bound-one-way"],function(e,t,n){var a=t["default"].Component,r=t["default"].Handlebars,l=t["default"].computed,o=t["default"].get,i=t["default"].inject.service,s=l.reads;e["default"]=a.extend({tag:null,scratchName:(0,n["default"])("tag.name"),scratchSlug:(0,n["default"])("tag.slug"),scratchDescription:(0,n["default"])("tag.description"),scratchMetaTitle:(0,n["default"])("tag.metaTitle"),scratchMetaDescription:(0,n["default"])("tag.metaDescription"),isViewingSubview:!1,config:i(),mediaQueries:i(),isMobile:s("mediaQueries.maxWidth600"),title:l("tag.isNew",function(){return this.get("tag.isNew")?"New Tag":"Tag Settings"}),seoTitle:l("scratchName","scratchMetaTitle",function(){var e=this.get("scratchMetaTitle")||"";return e=e.length>0?e:this.get("scratchName"),e&&e.length>70&&(e=e.substring(0,70).trim(),e=r.Utils.escapeExpression(e),e=t["default"].String.htmlSafe(e+"…")),e}),seoURL:l("scratchSlug",function(){var e=this.get("config.blogUrl"),n=this.get("scratchSlug")||"",a=e+"/tag/"+n;return n&&(a+="/"),a.length>70&&(a=a.substring(0,70).trim(),a=t["default"].String.htmlSafe(a+"…")),a}),seoDescription:l("scratchDescription","scratchMetaDescription",function(){var e=this.get("scratchMetaDescription")||"";return e=e.length>0?e:this.get("scratchDescription"),e&&e.length>156&&(e=e.substring(0,156).trim(),e=r.Utils.escapeExpression(e),e=t["default"].String.htmlSafe(e+"…")),e}),didReceiveAttrs:function(e){this._super.apply(this,arguments),o(e,"newAttrs.tag.value.id")!==o(e,"oldAttrs.tag.value.id")&&this.reset()},reset:function(){this.set("isViewingSubview",!1),this.$()&&this.$(".settings-menu-pane").scrollTop(0)},focusIn:function(){key.setScope("tag-settings-form")},focusOut:function(){key.setScope("default")},actions:{setProperty:function(e,t){this.attrs.setProperty(e,t)},setCoverImage:function(e){this.attrs.setProperty("image",e)},clearCoverImage:function(){this.attrs.setProperty("image","")},setUploaderReference:function(){},openMeta:function(){this.set("isViewingSubview",!0)},closeMeta:function(){this.set("isViewingSubview",!1)},deleteTag:function(){this.attrs.showDeleteTagModal()}}})}),define("ghost/components/gh-tag",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({willDestroyElement:function(){this._super.apply(this,arguments),this.get("tag.isDeleted")&&this.attrs.onDelete&&this.attrs.onDelete()}})}),define("ghost/components/gh-tags-management-container",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service,l=t["default"].isBlank,o=t["default"].observer,i=t["default"].run,s=a.equal,d=a.reads;e["default"]=n.extend({classNames:["view-container"],classNameBindings:["isMobile"],mediaQueries:r(),tags:null,selectedTag:null,isMobile:d("mediaQueries.maxWidth600"),isEmpty:s("tags.length",0),init:function(){this._super.apply(this,arguments),i.schedule("actions",this,this.fireMobileChangeActions)},displaySettingsPane:a("isEmpty","selectedTag","isMobile",function(){var e=this.get("isEmpty"),t=this.get("selectedTag"),n=this.get("isMobile");return n&&e?!0:n&&l(t)?!1:!0}),fireMobileChangeActions:o("isMobile",function(){this.get("isMobile")||this.sendAction("leftMobile")})})}),define("ghost/components/gh-textarea",["exports","ember","ghost/mixins/text-input"],function(e,t,n){var a=t["default"].TextArea;e["default"]=a.extend(n["default"],{classNames:"gh-input"})}),define("ghost/components/gh-trim-focus-input",["exports","ember"],function(e,t){var n=t["default"].TextField,a=t["default"].computed;e["default"]=n.extend({focus:!0,classNames:"gh-input",attributeBindings:["autofocus"],autofocus:a(function(){return this.get("focus")?device.ios()?!1:"autofocus":!1}),_focusField:function(){this.get("focus")&&!device.ios()&&this.$().val(this.$().val()).focus()},_trimValue:function(){var e=this.$().val();this.$().val(e.trim())},didInsertElement:function(){this._super.apply(this,arguments),this._focusField()},focusOut:function(){this._super.apply(this,arguments),this._trimValue()}})}),define("ghost/components/gh-uploader",["exports","ember","ghost/assets/lib/uploader"],function(e,t,n){var a=t["default"].Component,r=t["default"].computed,l=t["default"].get,o=t["default"].inject.service,i=t["default"].isEmpty,s=t["default"].run;e["default"]=a.extend({classNames:["image-uploader","js-post-image-upload"],config:o(),imageSource:r("image",function(){return this.get("image")||""}),removeListeners:function(){var e=this.$();e.off(),e.find(".js-cancel").off()},didReceiveAttrs:function(e){var t=e.oldAttrs&&l(e.oldAttrs,"image.value"),n=e.newAttrs&&l(e.newAttrs,"image.value");this._super.apply(this,arguments),i(n)&&!i(t)&&this.$()[0].uploaderUi.reset(),!i(n)&&this.$()&&(this.$(".js-upload-target").attr("src",""),this.$()[0].uploaderUi.reset(),this.$()[0].uploaderUi.initWithImage())},didInsertElement:function(){this._super.apply(this,arguments),this.send("initUploader")},willDestroyElement:function(){this._super.apply(this,arguments),this.removeListeners()},actions:{initUploader:function(){var e=this,t=this.$(),a=n["default"].call(t,{editor:!0,fileStorage:this.get("config.fileStorage")});t.on("uploadsuccess",function(t,n){n&&""!==n&&"http://"!==n&&s(e,function(){this.sendAction("uploaded",n)})}),t.on("imagecleared",s.bind(this,"sendAction","canceled")),this.sendAction("initUploader",a)}}})}),define("ghost/components/gh-url-preview",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service;e["default"]=n.extend({classNames:"ghost-url-preview",prefix:null,slug:null,config:r(),url:a("slug",function(){var e=this.get("config.blogUrl"),t=e.substr(e.indexOf("://")+3),n=this.get("prefix")?this.get("prefix")+"/":"",a=this.get("slug")?this.get("slug")+"/":"",r=t+"/"+n+a;return r})})}),define("ghost/components/gh-user-active",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service;e["default"]=n.extend({tagName:"",user:null,ghostPaths:r(),userDefault:a("ghostPaths",function(){return this.get("ghostPaths.subdir")+"/ghost/img/user-image.png"}),userImageBackground:a("user.image","userDefault",function(){var e=this.get("user.image")||this.get("userDefault");return t["default"].String.htmlSafe("background-image: url("+e+")")}),lastLogin:a("user.lastLogin",function(){var e=this.get("user.lastLogin");return e?e.fromNow():"(Never)"})})}),define("ghost/components/gh-user-invited",["exports","ember"],function(e,t){var n=t["default"].Component,a=t["default"].computed,r=t["default"].inject.service;e["default"]=n.extend({tagName:"",user:null,isSending:!1,notifications:r(),createdAt:a("user.createdAt",function(){var e=this.get("user.createdAt");return e?e.fromNow():""}),actions:{resend:function(){var e=this,t=this.get("user"),n=this.get("notifications");this.set("isSending",!0),t.resendInvite().then(function(e){var a="Invitation resent! ("+t.get("email")+")";"invited-pending"===e.users[0].status?n.showAlert("Invitation email was not sent. Please try resending.",{type:"error",key:"invite.resend.not-sent"}):(t.set("status",e.users[0].status),n.showNotification(a,{key:"invite.resend.success"}))})["catch"](function(e){n.showAPIError(e,{key:"invite.resend"})})["finally"](function(){e.set("isSending",!1)})},revoke:function(){var e=this,t=this.get("user"),n=t.get("email"),a=this.get("notifications");t.reload().then(function(){t.get("invited")?t.destroyRecord().then(function(){var e="Invitation revoked. ("+n+")";a.showNotification(e,{key:"invite.revoke.success"})})["catch"](function(e){a.showAPIError(e,{key:"invite.revoke"})}):(e.sendAction("reload"),a.showAlert("This user has already accepted the invitation.",{type:"error",delayed:!0,key:"invite.revoke.already-accepted"}))})}}})}),define("ghost/components/gh-validation-status-container",["exports","ember","ghost/mixins/validation-state"],function(e,t,n){var a=t["default"].Component,r=t["default"].computed;e["default"]=a.extend(n["default"],{classNameBindings:["errorClass"],errorClass:r("property","hasError","hasValidated.[]",function(){var e=this.get("hasValidated"),t=this.get("property");return e&&e.contains(t)?this.get("hasError")?"error":"success":""})})}),define("ghost/components/gh-view-title",["exports","ember"],function(e,t){var n=t["default"].Component;e["default"]=n.extend({tagName:"h2",classNames:["view-title"],actions:{openMobileMenu:function(){this.sendAction("openMobileMenu")}}})}),define("ghost/components/lf-outlet",["exports","liquid-fire/ember-internals"],function(e,t){e["default"]=t.StaticOutlet}),define("ghost/components/lf-overlay",["exports","ember"],function(e,t){var n="__lf-modal-open-counter";e["default"]=t["default"].Component.extend({tagName:"span",classNames:["lf-overlay"],didInsertElement:function(){var e=t["default"].$("body"),a=e.data(n)||0;e.addClass("lf-modal-open"),e.data(n,a+1)},willDestroy:function(){var e=t["default"].$("body"),a=e.data(n)||0;e.data(n,a-1),2>a&&e.removeClass("lf-modal-open lf-modal-closing")}})}),define("ghost/components/liquid-append",["exports","liquid-tether/components/liquid-append"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t["default"]}})}),define("ghost/components/liquid-bind",["exports","ember"],function(e,t){var n=t["default"].Component.extend({tagName:"",positionalParams:["value"]});n.reopenClass({positionalParams:["value"]}),e["default"]=n}),define("ghost/components/liquid-child",["exports","ember"],function(e,t){e["default"]=t["default"].Component.extend({classNames:["liquid-child"],didInsertElement:function(){var e=this.$();e&&e.css("visibility","hidden"),this.sendAction("liquidChildDidRender",this)}})}),define("ghost/components/liquid-container",["exports","ember","liquid-fire/growable","ghost/components/liquid-measured"],function(e,t,n,a){function r(e,t){if(e.view){var n=e.view.$(),r=n.position();t||(t=(0,a.measure)(n)),n.outerWidth(t.width),n.outerHeight(t.height),n.css({position:"absolute",top:r.top,left:r.left})}}function l(e){e.view&&!e.view.isDestroyed&&e.view.$().css({width:"",height:"",position:""})}e["default"]=t["default"].Component.extend(n["default"],{classNames:["liquid-container"],lockSize:function(e,t){e.outerWidth(t.width),e.outerHeight(t.height)},unlockSize:function(){var e=this,t=function(){e.updateAnimatingClass(!1);var t=e.$();t&&t.css({width:"",height:""})};this._scaling?this._scaling.then(t):t()},updateAnimatingClass:function(e){!this.isDestroyed&&this._wasInserted&&(0===arguments.length?e=this.get("liquidAnimating"):this.set("liquidAnimating",e),e?this.$().addClass("liquid-animating"):this.$().removeClass("liquid-animating"))},startMonitoringSize:t["default"].on("didInsertElement",function(){this._wasInserted=!0,this.updateAnimatingClass()}),actions:{willTransition:function(e){if(this._wasInserted){var t=this.$();this._cachedSize=(0,a.measure)(t);for(var n=0;n1?"posts":"post"}),actions:{confirm:function(){var e=this;this.set("submitting",!0),this.attrs.confirm()["finally"](function(){e.send("closeModal")})}}})}),define("ghost/components/modals/delete-user",["exports","ghost/components/modals/base"],function(e,t){e["default"]=t["default"].extend({submitting:!1,user:null,actions:{confirm:function(){var e=this;this.set("submitting",!0),this.attrs.confirm()["finally"](function(){e.send("closeModal")})}}})}),define("ghost/components/modals/invite-new-user",["exports","ember","ghost/components/modals/base","ghost/mixins/validation-engine"],function(e,t,n,a){var r=t["default"].RSVP.Promise,l=t["default"].inject.service,o=t["default"].run,i=t["default"].A;e["default"]=n["default"].extend(a["default"],{classNames:"modal-content invite-new-user",role:null,roles:null,authorRole:null,submitting:!1,validationType:"inviteUser",notifications:l(),store:l(),init:function(){this._super.apply(this,arguments),o.schedule("afterRender",this,function(){var e=this;this.get("store").query("role",{permissions:"assign"}).then(function(t){var n=t.findBy("name","Author");e.set("roles",t),e.set("authorRole",n),e.get("role")||e.set("role",n)})})},willDestroyElement:function(){this._super.apply(this,arguments),this.get("errors").clear(),this.set("hasValidated",i())},validate:function(){var e=this,t=this.get("email");return new r(function(n,a){return e._super().then(function(){e.get("store").findAll("user",{reload:!0}).then(function(r){var l=r.findBy("email",t);l?(e.get("errors").clear("email"),"invited"===l.get("status")||"invited-pending"===l.get("status")?e.get("errors").add("email","A user with that email address was already invited."):e.get("errors").add("email","A user with that email address already exists."),e.get("hasValidated").addObject("email"),a()):n()})},function(){e.get("hasValidated").addObject("email"),a()})})},actions:{setRole:function(e){this.set("role",e)},confirm:function(){var e=this,t=this.get("email"),n=this.get("role"),a=this.get("notifications"),r=void 0;this.validate().then(function(){e.set("submitting",!0),r=e.get("store").createRecord("user",{email:t,role:n,status:"invited"}),r.save().then(function(){var e="Invitation sent! ("+t+")";"invited-pending"===r.get("status")?a.showAlert("Invitation email was not sent. Please try resending.",{type:"error",key:"invite.send.failed"}):a.showNotification(e,{key:"invite.send.success"})})["catch"](function(e){r.deleteRecord(),a.showErrors(e,{key:"invite.send"})})["finally"](function(){e.send("closeModal")})})}}})}),define("ghost/components/modals/leave-editor",["exports","ghost/components/modals/base"],function(e,t){e["default"]=t["default"].extend({actions:{confirm:function(){var e=this;this.attrs.confirm()["finally"](function(){e.send("closeModal")})}}})}),define("ghost/components/modals/markdown-help",["exports","ghost/components/modals/base"],function(e,t){e["default"]=t["default"].extend({})}),define("ghost/components/modals/re-authenticate",["exports","ember","ghost/components/modals/base","ghost/mixins/validation-engine"],function(e,t,n,a){var r=t["default"].$,l=t["default"].computed,o=t["default"].inject.service;e["default"]=n["default"].extend(a["default"],{validationType:"signin",submitting:!1,authenticationError:null,notifications:o(),session:o(),identification:l("session.user.email",function(){return this.get("session.user.email")}),_authenticate:function(){var e=this,t=this.get("session"),n="authenticator:oauth2",a=this.get("identification"),r=this.get("password");return t.set("skipAuthSuccessHandler",!0),this.toggleProperty("submitting"),t.authenticate(n,a,r)["finally"](function(){e.toggleProperty("submitting"),t.set("skipAuthSuccessHandler",void 0)})},actions:{confirm:function(){var e=this;r("#login").find("input").trigger("change"),this.set("authenticationError",null),this.validate({property:"signin"}).then(function(){e._authenticate().then(function(){e.get("notifications").closeAlerts("post.save"),e.send("closeModal")})["catch"](function(n){n&&n.errors&&(n.errors.forEach(function(e){e.message=t["default"].String.htmlSafe(e.message)}),e.get("errors").add("password","Incorrect password"),e.get("hasValidated").pushObject("password"),e.set("authenticationError",n.errors[0].message))})},function(){e.get("hasValidated").pushObject("password")})}}})}),define("ghost/components/modals/transfer-owner",["exports","ghost/components/modals/base"],function(e,t){e["default"]=t["default"].extend({user:null,submitting:!1,actions:{confirm:function(){var e=this;this.set("submitting",!0),this.attrs.confirm()["finally"](function(){e.send("closeModal")})}}})}),define("ghost/components/modals/upload-image",["exports","ember","ghost/components/modals/base","ghost/assets/lib/uploader","ghost/utils/caja-sanitizers"],function(e,t,n,a,r){var l=t["default"].computed,o=t["default"].inject.service,i=t["default"].isEmpty;e["default"]=n["default"].extend({acceptEncoding:"image/*",model:null,submitting:!1,config:o(),notifications:o(),imageUrl:l("model.model","model.imageProperty",{get:function(){var e=this.get("model.imageProperty");return this.get("model.model."+e)},set:function(e,t){var n=this.get("model.model"),a=this.get("model.imageProperty");return n.set(a,t)}}),didInsertElement:function(){this._super.apply(this,arguments),a["default"].call(this.$(".js-drop-zone"),{fileStorage:this.get("config.fileStorage")})},keyDown:function(){this._setErrorState(!1)},_setErrorState:function(e){e?this.$(".js-upload-url").addClass("error"):this.$(".js-upload-url").removeClass("error")},_setImageProperty:function(){var e=void 0;if(this.$(".js-upload-url").val()){if(e=this.$(".js-upload-url").val(),!i(e)&&!r["default"].url(e))return this._setErrorState(!0),{message:"Image URI is not valid"}}else e=this.$(".js-upload-target").attr("src");return this.set("imageUrl",e),!0},actions:{confirm:function(){var e=this,t=this.get("model.model"),n=this.get("notifications"),a=this._setImageProperty();a.message||(this.set("submitting",!0),t.save()["catch"](function(e){n.showAPIError(e,{key:"image.upload"})})["finally"](function(){e.send("closeModal")}))}}})}),define("ghost/components/sortable-group",["exports","ember-sortable/components/sortable-group"],function(e,t){e["default"]=t["default"]}),define("ghost/components/sortable-item",["exports","ember-sortable/components/sortable-item"],function(e,t){e["default"]=t["default"]}),define("ghost/controllers/about",["exports","ember"],function(e,t){var n=t["default"].Controller,a=t["default"].computed;e["default"]=n.extend({updateNotificationCount:0,actions:{updateNotificationChange:function(e){this.set("updateNotificationCount",e)}},copyrightYear:a(function(){var e=new Date;return e.getFullYear()})})}),define("ghost/controllers/application",["exports","ember"],function(e,t){var n=t["default"].Controller,a=t["default"].computed,r=t["default"].inject.service;e["default"]=n.extend({dropdown:r(),signedOut:a.match("currentPath",/(signin|signup|setup|reset)/),topNotificationCount:0,showMobileMenu:!1,showSettingsMenu:!1,showMarkdownHelpModal:!1,autoNav:!1,autoNavOpen:a("autoNav",{get:function(){return!1},set:function(e,t){return this.get("autoNav")?t:!1}}),actions:{topNotificationChange:function(e){this.set("topNotificationCount",e)},toggleAutoNav:function(){this.toggleProperty("autoNav")},openAutoNav:function(){this.set("autoNavOpen",!0)},closeAutoNav:function(){this.set("autoNavOpen",!1)},closeMobileMenu:function(){this.set("showMobileMenu",!1)}}})}),define("ghost/controllers/array",["exports","ember"],function(e,t){e["default"]=t["default"].Controller}),define("ghost/controllers/editor/edit",["exports","ember","ghost/mixins/editor-base-controller"],function(e,t,n){var a=t["default"].Controller;e["default"]=a.extend(n["default"],{showDeletePostModal:!1,actions:{toggleDeletePostModal:function(){this.toggleProperty("showDeletePostModal")}}})}),define("ghost/controllers/editor/new",["exports","ember","ghost/mixins/editor-base-controller"],function(e,t,n){function a(){return this}var r=t["default"].Controller;e["default"]=r.extend(n["default"],{autoSave:a,actions:{save:function(e){var t=this;return this._super(e).then(function(e){e.get("id")&&t.replaceRoute("editor.edit",e)})}}})}),define("ghost/controllers/error",["exports","ember"],function(e,t){var n=t["default"].Controller,a=t["default"].computed;e["default"]=n.extend({stack:!1,code:a("content.status",function(){return this.get("content.status")>200?this.get("content.status"):500}),message:a("content.statusText",function(){return 404===this.get("code")?"Page not found":"error"!==this.get("content.statusText")?this.get("content.statusText"):"Internal Server Error"})})}),define("ghost/controllers/feature",["exports","ember"],function(e,t){var n=t["default"].Controller,a=t["default"].PromiseProxyMixin,r=t["default"].computed,l=r.alias;e["default"]=n.extend(a,{setting:l("content"),labs:r("isSettled","setting.labs",function(){var e={};if(this.get("isFulfilled"))try{e=JSON.parse(this.get("setting.labs")||{})}catch(t){e={}}return e}),publicAPI:r("config.publicAPI","labs.publicAPI",function(){return this.get("config.publicAPI")||this.get("labs.publicAPI")}),init:function(){this._super.apply(this,arguments);var e=this.store.query("setting",{type:"blog,theme"}).then(function(e){return e.get("firstObject")});this.set("promise",e)}})}),define("ghost/controllers/object",["exports","ember"],function(e,t){e["default"]=t["default"].Controller}),define("ghost/controllers/post-settings-menu",["exports","ember","ghost/utils/date-formatting","ghost/mixins/settings-menu-controller","ghost/utils/bound-one-way","ghost/utils/isNumber"],function(e,t,n,a,r,l){var o=t["default"].$,i=t["default"].ArrayProxy,s=t["default"].Controller,d=t["default"].Handlebars,c=t["default"].PromiseProxyMixin,u=t["default"].RSVP,p=t["default"].computed,m=t["default"].guidFor,h=t["default"].inject,g=h.service,f=h.controller,v=t["default"].isArray,b=t["default"].isBlank,C=t["default"].observer,x=t["default"].run;e["default"]=s.extend(a["default"],{debounceId:null,lastPromise:null,selectedAuthor:null,uploaderReference:null,application:f(),config:g(),ghostPaths:g(),notifications:g(),session:g(),slugGenerator:g(),initializeSelectedAuthor:C("model",function(){var e=this;return this.get("model.author").then(function(t){return e.set("selectedAuthor",t),t})}),authors:p(function(){var e={};return e.promise=this.store.query("user",{limit:"all"}).then(function(e){return e.rejectBy("id","me").sortBy("name")}).then(function(e){return e.filter(function(e){return e.get("active")})}),i.extend(c).create(e)}),slugValue:(0,r["default"])("model.slug"),generateAndSetSlug:function(e){var t=this,n=this.get("model.titleScratch"),a=this.get("lastPromise"),r=void 0;"(Untitled)"===n&&this.get("model.slug")||(r=u.resolve(a).then(function(){return t.get("slugGenerator").generateSlug("post",n).then(function(n){b(n)||t.set(e,n)})["catch"](function(){})}),this.set("lastPromise",r))},metaTitleScratch:(0,r["default"])("model.metaTitle"),metaDescriptionScratch:(0,r["default"])("model.metaDescription"),seoTitle:p("model.titleScratch","metaTitleScratch",function(){var e=this.get("metaTitleScratch")||"";return e=e.length>0?e:this.get("model.titleScratch"),e.length>70&&(e=e.substring(0,70).trim(),e=d.Utils.escapeExpression(e),e=t["default"].String.htmlSafe(e+"…")),e}),seoDescription:p("model.scratch","metaDescriptionScratch",function(){var e=this.get("metaDescriptionScratch")||"",n="",a=void 0,r=void 0;return e.length>0?r=e:(a=o(".rendered-markdown"),void 0!==a&&a.length>0&&(n=a.clone(),n.find(".js-drop-zone").remove(),n=n[0].innerHTML),r=o("
",{html:n}).text(),r=r.replace(/\n+/g," ").trim()),r.length>156&&(r=r.substring(0,156).trim(),r=d.Utils.escapeExpression(r),r=t["default"].String.htmlSafe(r+"…")),r}),seoURL:p("model.slug","config.blogUrl",function(){var e=this.get("config.blogUrl"),n=this.get("model.slug")?this.get("model.slug"):"",a=e+"/"+n;return n&&(a+="/"),a.length>70&&(a=a.substring(0,70).trim(),a=t["default"].String.htmlSafe(a+"…")),a}),addTitleObserver:C("model",function(){(this.get("model.isNew")||"(Untitled)"===this.get("model.title"))&&this.addObserver("model.titleScratch",this,"titleObserver")}),titleObserver:function(){var e=this.get("model.title"),t=void 0;(this.get("model.isNew")&&!e||"(Untitled)"===e)&&(t=x.debounce(this,"generateAndSetSlug","model.slug",700)),this.set("debounceId",t)},availableTags:p(function(){return this.get("store").filter("tag",{limit:"all"},function(){return!0})}),showErrors:function(e){e=v(e)?e:[e],this.get("notifications").showErrors(e)},actions:{discardEnter:function(){return!1},togglePage:function(){var e=this;this.toggleProperty("model.page"),this.get("model.isNew")||this.get("model").save()["catch"](function(t){e.showErrors(t),e.get("model").rollbackAttributes()})},toggleFeatured:function(){var e=this;this.toggleProperty("model.featured"),this.get("model.isNew")||this.get("model").save(this.get("saveOptions"))["catch"](function(t){e.showErrors(t),e.get("model").rollbackAttributes()})},updateSlug:function(e){var t=this,n=this.get("model.slug");return e=e||n,e=e&&e.trim(),e&&n!==e?void this.get("slugGenerator").generateSlug("post",e).then(function(a){if(a!==n){var r=a.split("-"),o=Number(r.pop());if((0,l["default"])(o)&&o>0&&n===r.join("-")&&a!==e)return void t.set("slugValue",n);if(t.set("model.slug",a),t.hasObserverFor("model.titleScratch")&&t.removeObserver("model.titleScratch",t,"titleObserver"),!t.get("model.isNew"))return t.get("model").save()}})["catch"](function(e){t.showErrors(e),t.get("model").rollbackAttributes()}):void this.set("slugValue",n)},setPublishedAt:function(e){var t=this,a=(0,n.parseDateString)(e),r=moment(this.get("model.publishedAt")),l="";return e?(a.isValid()||(l="Published Date must be a valid date with format: DD MMM YY @ HH:mm (e.g. 6 Dec 14 @ 15:00)"),a.diff(new Date,"h")>0&&(l="Published Date cannot currently be in the future."),l?void this.get("model.errors").add("post-setting-date",l):void(r&&r.isSame(a)||(this.set("model.publishedAt",a),this.get("model.isNew")||this.get("model").save()["catch"](function(e){t.showErrors(e),t.get("model").rollbackAttributes()})))):void(this.get("model.isDraft")&&this.set("model.publishedAt",null))},setMetaTitle:function(e){var t="metaTitle",n=this.get("model"),a=n.get(t)||"";a!==e&&(n.set(t,e),n.get("isNew")||n.save())},setMetaDescription:function(e){var t="metaDescription",n=this.get("model"),a=n.get(t)||"";a!==e&&(n.set(t,e),n.get("isNew")||n.save())},setCoverImage:function(e){var t=this;this.set("model.image",e),this.get("model.isNew")||this.get("model").save()["catch"](function(e){t.showErrors(e),t.get("model").rollbackAttributes()})},clearCoverImage:function(){var e=this;this.set("model.image",""),this.get("model.isNew")||this.get("model").save()["catch"](function(t){e.showErrors(t),e.get("model").rollbackAttributes()})},resetUploader:function(){var e=this.get("uploaderReference");e&&e[0]&&e[0].uploaderUi.reset()},resetPubDate:function(){this.set("publishedAtValue","")},closeNavMenu:function(){this.get("application").send("closeNavMenu")},changeAuthor:function(e){var t=this,n=this.get("model.author"),a=this.get("model");e.get("id")!==n.get("id")&&(a.set("author",e),this.get("model.isNew")||a.save()["catch"](function(e){t.showErrors(e),t.set("selectedAuthor",n),a.rollbackAttributes()}))},addTag:function(e,t){var n=this,a=this.get("model.tags"),r=a.map(function(e){return e.get("name").toLowerCase()}),l=void 0,o=void 0;e=e.trim(),r.contains(e.toLowerCase())||this.get("availableTags").then(function(a){l=a.map(function(e){return e.get("name").toLowerCase()}),l.contains(e.toLowerCase())?o=a.find(function(t){return t.get("name").toLowerCase()===e.toLowerCase()}):(o=n.get("store").createRecord("tag",{name:e}),o.set("uuid",m(o))),o&&n.get("model.tags").insertAt(t,o)})},removeTag:function(e){this.get("model.tags").removeObject(e),e.get("isNew")&&e.destroyRecord()}}})}),define("ghost/controllers/posts",["exports","ember"],function(e,t){function n(e,t){var n=e.get("updatedAt"),r=t.get("updatedAt"),o=void 0,i=void 0,s=void 0,d=void 0;return e.get("isNew")||!n?-1:t.get("isNew")||!r?1:(o=l(parseInt(e.get("id")),parseInt(t.get("id"))),s=l(e.get("status"),t.get("status")),d=l(n.valueOf(),r.valueOf()),i=a(e,t),0===s?0===i?0===d?-1*o:-1*d:-1*i:s)}function a(e,t){var n=e.get("publishedAt"),a=t.get("publishedAt");return n||a?!n&&a?-1:!a&&n?1:l(n.valueOf(),a.valueOf()):0}var r=t["default"].Controller,l=t["default"].compare,o=t["default"].computed,i=o.equal;e["default"]=r.extend({showDeletePostModal:!1,postListFocused:i("keyboardFocus","postList"),postContentFocused:i("keyboardFocus","postContent"),sortedPosts:o("model.@each.status","model.@each.publishedAt","model.@each.isNew","model.@each.updatedAt",function(){var e=this.get("model").toArray();return e.sort(n)}),actions:{toggleDeletePostModal:function(){this.toggleProperty("showDeletePostModal")}}})}),define("ghost/controllers/reset",["exports","ember","ghost/mixins/validation-engine"],function(e,t,n){var a=t["default"].Controller,r=t["default"].computed,l=t["default"].inject.service;e["default"]=a.extend(n["default"],{newPassword:"",ne2Password:"",token:"",submitting:!1,flowErrors:"",validationType:"reset",ghostPaths:l(),notifications:l(),session:l(),ajax:l(),email:r("token",function(){return atob(this.get("token")).split("|")[1]}),clearData:function(){this.setProperties({newPassword:"",ne2Password:"",token:""})},actions:{submit:function(){var e=this,t=this.getProperties("newPassword","ne2Password","token");this.set("flowErrors",""),this.get("hasValidated").addObjects(["newPassword","ne2Password"]),this.validate().then(function(){var n=e.get("ghostPaths.url").api("authentication","passwordreset");e.toggleProperty("submitting"),e.get("ajax").put(n,{data:{passwordreset:[t]}}).then(function(n){e.toggleProperty("submitting"),e.get("notifications").showAlert(n.passwordreset[0].message,{type:"warn",delayed:!0,key:"password.reset"}),e.get("session").authenticate("authenticator:oauth2",e.get("email"),t.newPassword)})["catch"](function(t){e.get("notifications").showAPIError(t,{key:"password.reset"}),e.toggleProperty("submitting")})})["catch"](function(t){if(e.get("errors.newPassword")&&e.set("flowErrors",e.get("errors.newPassword")[0].message),e.get("errors.ne2Password")&&e.set("flowErrors",e.get("errors.ne2Password")[0].message),0===e.get("errors.length"))throw t})}}})}),define("ghost/controllers/settings/code-injection",["exports","ember","ghost/mixins/settings-save"],function(e,t,n){var a=t["default"].Controller,r=t["default"].inject.service;e["default"]=a.extend(n["default"],{notifications:r(),save:function(){var e=this.get("notifications");return this.get("model").save()["catch"](function(t){e.showAPIError(t,{key:"code-injection.save"})})}})}),define("ghost/controllers/settings/general",["exports","ember","ghost/mixins/settings-save","ghost/utils/random-password"],function(e,t,n,a){var r=t["default"].Controller,l=t["default"].computed,o=t["default"].inject.service,i=t["default"].observer;e["default"]=r.extend(n["default"],{showUploadLogoModal:!1,showUploadCoverModal:!1,notifications:o(),config:o(),selectedTheme:l("model.activeTheme","themes",function(){var e=this.get("model.activeTheme"),t=this.get("themes"),n=void 0;return t.forEach(function(t){t.name===e&&(n=t)}),n}),logoImageSource:l("model.logo",function(){return this.get("model.logo")||""}),coverImageSource:l("model.cover",function(){return this.get("model.cover")||""}),isDatedPermalinks:l("model.permalinks",{set:function(e,t){this.set("model.permalinks",t?"/:year/:month/:day/:slug/":"/:slug/");var n=this.get("model.permalinks");return"/:slug/"!==n},get:function(){var e=this.get("model.permalinks");return"/:slug/"!==e}}),themes:l(function(){return this.get("model.availableThemes").reduce(function(e,t){var n={};return n.name=t.name,n.label=t["package"]?t["package"].name+" - "+t["package"].version:t.name,n["package"]=t["package"],n.active=!!t.active,e.push(n),e},[])}).readOnly(),generatePassword:i("model.isPrivate",function(){this.get("model.errors").remove("password"),this.get("model.isPrivate")&&this.get("model.hasDirtyAttributes")&&this.get("model").set("password",(0,a["default"])())}),save:function(){var e=this.get("notifications"),t=this.get("config");return this.get("model").save().then(function(e){return t.set("blogTitle",e.get("title")),e})["catch"](function(t){t&&e.showAPIError(t,{key:"settings.save"})})},actions:{validate:function(e){this.get("model").validate({property:e})},checkPostsPerPage:function(){var e=this.get("model.postsPerPage");(1>e||e>1e3||isNaN(e))&&this.set("model.postsPerPage",5)},setTheme:function(e){this.set("model.activeTheme",e.name)},toggleUploadCoverModal:function(){this.toggleProperty("showUploadCoverModal")},toggleUploadLogoModal:function(){this.toggleProperty("showUploadLogoModal")}}})}),define("ghost/controllers/settings/labs",["exports","ember"],function(e,t){var n=t["default"].$,a=t["default"].Controller,r=t["default"].inject.service,l=t["default"].isArray;e["default"]=a.extend({uploadButtonText:"Import",importErrors:"",submitting:!1,showDeleteAllModal:!1,ghostPaths:r(),notifications:r(),session:r(),ajax:r(),actions:{onUpload:function(e){var t=this,n=new FormData,a=this.get("notifications"),r=this.get("session.user.id"),o=this.get("ghostPaths.url").api("db");this.set("uploadButtonText","Importing"),this.set("importErrors",""),n.append("importfile",e),this.get("ajax").post(o,{data:n,dataType:"json",cache:!1,contentType:!1,processData:!1}).then(function(){t.store.unloadAll(),t.set("session.user",t.store.findRecord("user",r)),a.showNotification("Import successful.",{key:"import.upload.success"})})["catch"](function(e){e&&e.errors&&l(e.errors)&&t.set("importErrors",e.errors),a.showAlert("Import Failed",{type:"error",key:"import.upload.failed"})})["finally"](function(){t.set("uploadButtonText","Import")})},exportData:function(){var e=this.get("ghostPaths.url").api("db"),t=this.get("session.data.authenticated.access_token"),a=e+"?access_token="+t,r=n("#iframeDownload");0===r.length&&(r=n("