diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d6ad13e4..fd857a64e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Updated StoryController, orientate story media and strip exif ([07a13fcf](https://github.com/pixelfed/pixelfed/commit/07a13fcf)) - Updated admin reports, fixed 404 bug ([dbd5c4cf](https://github.com/pixelfed/pixelfed/commit/dbd5c4cf)) - Updated AdminController, abstracted dashboard stats to AdminStatsService ([41abe9d2](https://github.com/pixelfed/pixelfed/commit/41abe9d2)) +- Updated StoryCompose component, added upload progress page ([2de3c56f](https://github.com/pixelfed/pixelfed/commit/2de3c56f)) ### Changed diff --git a/public/js/story-compose.js b/public/js/story-compose.js index 6efb0c458..c47dd5c61 100644 --- a/public/js/story-compose.js +++ b/public/js/story-compose.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{20:function(t,e,n){t.exports=n("spWN")},"3VoG":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"/*!\n * Cropper.js v1.5.6\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2019-10-04T04:33:44.164Z\n */\n\n.cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cropper-container img {\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n}\n\n.cropper-wrap-box,\n.cropper-canvas,\n.cropper-drag-box,\n.cropper-crop-box,\n.cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.cropper-wrap-box,\n.cropper-canvas {\n overflow: hidden;\n}\n\n.cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n}\n\n.cropper-modal {\n background-color: #000;\n opacity: 0.5;\n}\n\n.cropper-view-box {\n display: block;\n height: 100%;\n outline: 1px solid #39f;\n outline-color: rgba(51, 153, 255, 0.75);\n overflow: hidden;\n width: 100%;\n}\n\n.cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: 0.5;\n position: absolute;\n}\n\n.cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: calc(100% / 3);\n left: 0;\n top: calc(100% / 3);\n width: 100%;\n}\n\n.cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: calc(100% / 3);\n top: 0;\n width: calc(100% / 3);\n}\n\n.cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: 0.75;\n position: absolute;\n top: 50%;\n width: 0;\n}\n\n.cropper-center::before,\n.cropper-center::after {\n background-color: #eee;\n content: ' ';\n display: block;\n position: absolute;\n}\n\n.cropper-center::before {\n height: 1px;\n left: -3px;\n top: 0;\n width: 7px;\n}\n\n.cropper-center::after {\n height: 7px;\n left: 0;\n top: -3px;\n width: 1px;\n}\n\n.cropper-face,\n.cropper-line,\n.cropper-point {\n display: block;\n height: 100%;\n opacity: 0.1;\n position: absolute;\n width: 100%;\n}\n\n.cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n}\n\n.cropper-line {\n background-color: #39f;\n}\n\n.cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n}\n\n.cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n}\n\n.cropper-point {\n background-color: #39f;\n height: 5px;\n opacity: 0.75;\n width: 5px;\n}\n\n.cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -3px;\n right: -3px;\n top: 50%;\n}\n\n.cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-w {\n cursor: ew-resize;\n left: -3px;\n margin-top: -3px;\n top: 50%;\n}\n\n.cropper-point.point-s {\n bottom: -3px;\n cursor: s-resize;\n left: 50%;\n margin-left: -3px;\n}\n\n.cropper-point.point-ne {\n cursor: nesw-resize;\n right: -3px;\n top: -3px;\n}\n\n.cropper-point.point-nw {\n cursor: nwse-resize;\n left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-sw {\n bottom: -3px;\n cursor: nesw-resize;\n left: -3px;\n}\n\n.cropper-point.point-se {\n bottom: -3px;\n cursor: nwse-resize;\n height: 20px;\n opacity: 1;\n right: -3px;\n width: 20px;\n}\n\n@media (min-width: 768px) {\n .cropper-point.point-se {\n height: 15px;\n width: 15px;\n }\n}\n\n@media (min-width: 992px) {\n .cropper-point.point-se {\n height: 10px;\n width: 10px;\n }\n}\n\n@media (min-width: 1200px) {\n .cropper-point.point-se {\n height: 5px;\n opacity: 0.75;\n width: 5px;\n }\n}\n\n.cropper-point.point-se::before {\n background-color: #39f;\n bottom: -50%;\n content: ' ';\n display: block;\n height: 200%;\n opacity: 0;\n position: absolute;\n right: -50%;\n width: 200%;\n}\n\n.cropper-invisible {\n opacity: 0;\n}\n\n.cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n}\n\n.cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n\n.cropper-hidden {\n display: none !important;\n}\n\n.cropper-move {\n cursor: move;\n}\n\n.cropper-crop {\n cursor: crosshair;\n}\n\n.cropper-disabled .cropper-drag-box,\n.cropper-disabled .cropper-face,\n.cropper-disabled .cropper-line,\n.cropper-disabled .cropper-point {\n cursor: not-allowed;\n}\n",""])},"4Toj":function(t,e,n){var i=n("54Wo");t.exports=function(t,e){var n=i(t,e)/1e3;return n>0?Math.floor(n):Math.ceil(n)}},"54Wo":function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t),r=i(e);return n.getTime()-r.getTime()}},"6DAA":function(t,e,n){var i=n("kOWh");t.exports=function(){var t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["AM","PM"],s=["am","pm"],h=["a.m.","p.m."],c={MMM:function(e){return t[e.getMonth()]},MMMM:function(t){return e[t.getMonth()]},dd:function(t){return n[t.getDay()]},ddd:function(t){return r[t.getDay()]},dddd:function(t){return a[t.getDay()]},A:function(t){return t.getHours()/12>=1?o[1]:o[0]},a:function(t){return t.getHours()/12>=1?s[1]:s[0]},aa:function(t){return t.getHours()/12>=1?h[1]:h[0]}};return["M","D","DDD","d","Q","W"].forEach((function(t){c[t+"o"]=function(e,n){return function(t){var e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"}(n[t](e))}})),{formatters:c,formattingTokensRegExp:i(c)}}},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var r,a=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?t:(r=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:i+a.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}},DT56:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t).getTime(),r=i(e).getTime();return nr?1:0}},F809:function(t,e,n){var i=n("yNUO"),r=n("sunR"),a=n("DT56");t.exports=function(t,e){var n=i(t),o=i(e),s=a(n,o),h=Math.abs(r(n,o));return n.setMonth(n.getMonth()-s*h),s*(h-(a(n,o)===-s))}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=(o=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[n].concat(a).concat([r]).join("\n")}var o;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r0?"in "+r:r+" ago":r}}}},NmtT:function(t,e,n){var i=n("yHON"),r=n("yNUO"),a=n("4Toj"),o=n("F809"),s=n("Us+F"),h=1440,c=2520,p=43200,l=86400;t.exports=function(t,e,n){var d=n||{},u=i(t,e),f=d.locale,m=s.distanceInWords.localize;f&&f.distanceInWords&&f.distanceInWords.localize&&(m=f.distanceInWords.localize);var g,v,b={addSuffix:Boolean(d.addSuffix),comparison:u};u>0?(g=r(t),v=r(e)):(g=r(e),v=r(t));var w,x=a(v,g),y=v.getTimezoneOffset()-g.getTimezoneOffset(),C=Math.round(x/60)-y;if(C<2)return d.includeSeconds?x<5?m("lessThanXSeconds",5,b):x<10?m("lessThanXSeconds",10,b):x<20?m("lessThanXSeconds",20,b):x<40?m("halfAMinute",null,b):m(x<60?"lessThanXMinutes":"xMinutes",1,b):0===C?m("lessThanXMinutes",1,b):m("xMinutes",C,b);if(C<45)return m("xMinutes",C,b);if(C<90)return m("aboutXHours",1,b);if(C=t.config.uploader.album_limit)return swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error"),t.uploading=!1,void(t.page=2);var i=e.type;if(-1==$.inArray(i,t.mimes))return swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.mimes+" only.","error"),t.uploading=!1,void(t.page="error");var r=new FormData;r.append("file",e);var a={onUploadProgress:function(e){var n=Math.round(100*e.loaded/e.total);t.uploadProgress=n}};axios.post("/api/stories/v1/add",r,a).then((function(e){t.uploadProgress=100,t.uploading=!1,window.location.href="/i/my/story",t.mediaUrl=e.data.media_url})).catch((function(n){t.uploading=!1,e.value=null;var i=n.response.data.message?n.response.data.message:"Something went wrong.";swal("Oops!",i,"warning")})),e.value=null,t.uploadProgress=0}))},expiresTimestamp:function(t){return(t=new Date(1e3*t)).toDateString()+" "+t.toLocaleTimeString()},edit:function(){this.page="edit"},showLightbox:function(t){this.lightboxMedia={url:t.src},this.$refs.lightboxModal.show()},deleteStory:function(t,e){var n=this;1==window.confirm("Are you sure you want to delete this Story?")&&axios.delete("/api/stories/v1/delete/"+t.id).then((function(t){n.stories.splice(e,1),0==n.stories.length&&(window.location.href="/i/stories/new")}))}}}),s=n("KHd+"),h=Object(s.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container mt-2 mt-md-5"},[n("input",{staticClass:"d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",accept:t.config.mimes}}),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-6 offset-md-3"},["landing"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"90vh"}},[t._m(0),t._v(" "),n("div",{staticClass:"flex-fill"},[n("div",{staticClass:"card w-100 shadow-none"},[n("div",{staticClass:"list-group"},[n("a",{staticClass:"list-group-item text-center lead text-decoration-none text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.upload()}}},[t._v("Add Photo")]),t._v(" "),t.stories.length?n("a",{staticClass:"list-group-item text-center lead text-decoration-none text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.edit()}}},[t._v("Edit Story")]):t._e()])])]),t._v(" "),t._m(1)]):t._e(),t._v(" "),"crop"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"95vh"}},[t._m(2),t._v(" "),n("div",{staticClass:"flex-fill"},[n("div",{staticClass:"card w-100 mt-3"},[n("div",{staticClass:"card-body p-0"},[n("vue-cropper",{ref:"cropper",attrs:{relativeZoom:t.cropper.zoom,aspectRatio:t.cropper.aspectRatio,viewMode:t.cropper.viewMode,zoomable:t.cropper.zoomable,rotatable:!0,src:t.mediaUrl}})],1)])]),t._v(" "),t._m(3)]):t._e(),t._v(" "),"error"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center align-items-center",staticStyle:{height:"90vh"}},[n("p",{staticClass:"h3 mb-0"},[t._v("Oops!")]),t._v(" "),n("p",{staticClass:"text-muted lead"},[t._v("An error occurred, please try again later.")]),t._v(" "),t._m(4)]):t._e(),t._v(" "),"edit"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"90vh"}},[t._m(5),t._v(" "),n("div",{staticClass:"flex-fill py-5"},[n("div",{staticClass:"card w-100 shadow-none",staticStyle:{"max-height":"500px","overflow-y":"auto"}},[n("div",{staticClass:"list-group"},t._l(t.stories,(function(e,i){return n("div",{staticClass:"list-group-item text-center text-dark",attrs:{href:"#"}},[n("div",{staticClass:"media align-items-center"},[n("img",{staticClass:"img-fluid mr-3 cursor-pointer",attrs:{src:e.src,width:"70px",height:"70px"},on:{click:function(n){return t.showLightbox(e)}}}),t._v(" "),n("div",{staticClass:"media-body"},[n("p",{staticClass:"mb-0"},[t._v("Expires")]),t._v(" "),n("p",{staticClass:"mb-0 text-muted small"},[n("span",[t._v(t._s(t.expiresTimestamp(e.expires_at)))])])]),t._v(" "),n("div",{staticClass:"float-right"},[n("button",{staticClass:"btn btn-danger btn-sm font-weight-bold text-uppercase",on:{click:function(n){return t.deleteStory(e,i)}}},[t._v("Delete")])])])])})),0)])]),t._v(" "),t._m(6)]):t._e()])]),t._v(" "),n("b-modal",{ref:"lightboxModal",attrs:{id:"lightbox","hide-header":"","hide-footer":"",centered:"",size:"lg","body-class":"p-0"}},[t.lightboxMedia?n("div",{staticClass:"w-100 h-100"},[n("img",{staticStyle:{"max-height":"100%","max-width":"100%"},attrs:{src:t.lightboxMedia.url}})]):t._e()])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill mt-5 pt-5"},[e("img",{attrs:{src:"/img/pixelfed-icon-grey.svg",width:"60px",height:"60px"}}),this._v(" "),e("p",{staticClass:"font-weight-bold lead text-lighter mt-1"},[this._v("Stories")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"text-center flex-fill"},[n("p",{staticClass:"text-lighter small text-uppercase"},[n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/"}},[t._v("Home")]),t._v(" "),n("span",{staticClass:"px-2 text-lighter"},[t._v("|")]),t._v(" "),n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/i/my/story"}},[t._v("View My Story")]),t._v(" "),n("span",{staticClass:"px-2 text-lighter"},[t._v("|")]),t._v(" "),n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/site/help"}},[t._v("Help")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center pt-5 mb-3 d-flex justify-content-between align-items-center"},[e("div",[e("button",{staticClass:"btn btn-outline-lighter btn-sm py-0 px-md-3"},[e("i",{staticClass:"pr-2 fas fa-chevron-left fa-sm"}),this._v(" Delete")])]),this._v(" "),e("div",{staticClass:"d-flex align-items-center"},[e("img",{staticClass:"d-inline-block mr-2",attrs:{src:"/img/pixelfed-icon-grey.svg",width:"30px",height:"30px"}}),this._v(" "),e("span",{staticClass:"font-weight-bold lead text-lighter"},[this._v("Stories")])]),this._v(" "),e("div",[e("button",{staticClass:"btn btn-outline-success btn-sm py-0 px-md-3"},[this._v("Crop "),e("i",{staticClass:"pl-2 fas fa-chevron-right fa-sm"})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill"},[e("p",{staticClass:"text-lighter small text-uppercase pt-2"},[e("a",{staticClass:"text-muted font-weight-bold mb-0",attrs:{href:"/site/help"}},[this._v("Help")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-muted mb-0"},[e("a",{staticClass:"btn btn-outline-secondary py-0 px-5 font-weight-bold",attrs:{href:"/"}},[this._v("Go back")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill mt-5 pt-5"},[e("img",{attrs:{src:"/img/pixelfed-icon-grey.svg",width:"60px",height:"60px"}}),this._v(" "),e("p",{staticClass:"font-weight-bold lead text-lighter mt-1"},[this._v("Stories")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"flex-fill text-center"},[e("a",{staticClass:"btn btn-outline-secondary py-0 px-5 font-weight-bold",attrs:{href:"/i/stories/new"}},[this._v("Go back")])])}],!1,null,"4041129f",null);e.default=h.exports},"Us+F":function(t,e,n){var i=n("LZbM"),r=n("6DAA");t.exports={distanceInWords:i(),format:r()}},VGX7:function(t,e){t.exports=function(t){var e=new Date(t.getTime()),n=e.getTimezoneOffset();return e.setSeconds(0,0),6e4*n+e.getTime()%6e4}},YQfW:function(t,e,n){var i=n("3VoG");"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,r);i.locals&&(t.exports=i.locals)},YlT8:function(t,e,n){var i=n("NmtT");t.exports=function(t,e){return i(Date.now(),t,e)}},"aET+":function(t,e,n){var i,r,a={},o=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(t,e){return e?e.querySelector(t):document.querySelector(t)},h=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var i=s.call(this,t,n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}}(),c=null,p=0,l=[],d=n("9tPo");function u(t,e){for(var n=0;n=0&&l.splice(e,1)}function v(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var i=function(){0;return n.nc}();i&&(t.attrs.nonce=i)}return b(e,t.attrs),m(t,e),e}function b(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function w(t,e){var n,i,r,a;if(e.transform&&t.css){if(!(a="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=a}if(e.singleton){var o=p++;n=c||(c=v(e)),i=C.bind(null,n,o,!1),r=C.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),m(t,e),e}(e),i=D.bind(null,n,e),r=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),i=M.bind(null,n),r=function(){g(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return u(n,e),function(t){for(var i=[],r=0;r=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["containerStyle","src","alt","imgStyle"])),n={};for(var i in e)void 0!==this[i]&&(n[i]=this[i]);this.cropper=new a.default(this.$refs.img,n)},methods:{reset:function(){return this.cropper.reset()},clear:function(){return this.cropper.clear()},initCrop:function(){return this.cropper.crop()},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(t,e)},enable:function(){return this.cropper.enable()},disable:function(){return this.cropper.disable()},destroy:function(){return this.cropper.destroy()},move:function(t,e){return this.cropper.move(t,e)},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.cropper.moveTo(t,e)},relativeZoom:function(t,e){return this.cropper.zoom(t,e)},zoomTo:function(t,e){return this.cropper.zoomTo(t,e)},rotate:function(t){return this.cropper.rotate(t)},rotateTo:function(t){return this.cropper.rotateTo(t)},scaleX:function(t){return this.cropper.scaleX(t)},scaleY:function(t){return this.cropper.scaleY(t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.cropper.scale(t,e)},getData:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(t)},setData:function(t){return this.cropper.setData(t)},getContainerData:function(){return this.cropper.getContainerData()},getImageData:function(){return this.cropper.getImageData()},getCanvasData:function(){return this.cropper.getCanvasData()},setCanvasData:function(t){return this.cropper.setCanvasData(t)},getCropBoxData:function(){return this.cropper.getCropBoxData()},setCropBoxData:function(t){return this.cropper.setCropBoxData(t)},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(t)},setAspectRatio:function(t){return this.cropper.setAspectRatio(t)},setDragMode:function(t){return this.cropper.setDragMode(t)}}}},pzWd:function(t,e){t.exports=function(t){return t instanceof Date}},spWN:function(t,e,n){Vue.component("story-compose",n("TP5S").default)},sunR:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t),r=i(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}},urRO:function(t,e,n){t.exports=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){for(var n=0;n0&&t<1/0};function N(t){return void 0===t}function z(e){return"object"===t(e)&&null!==e}var W=Object.prototype.hasOwnProperty;function R(t){if(!z(t))return!1;try{var e=t.constructor,n=e.prototype;return e&&n&&W.call(n,"isPrototypeOf")}catch(t){return!1}}function U(t){return"function"==typeof t}var H=Array.prototype.slice;function L(t){return Array.from?Array.from(t):H.call(t)}function X(t,e){return t&&U(e)&&(Array.isArray(t)||_(t.length)?L(t).forEach((function(n,i){e.call(t,n,i,t)})):z(t)&&Object.keys(t).forEach((function(n){e.call(t,t[n],n,t)}))),t}var Y=Object.assign||function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i0&&n.forEach((function(e){z(e)&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t},j=/\.\d*(?:0|9){12}\d*$/;function I(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return j.test(t)?Math.round(t*e)/e:t}var $=/^width|height|left|top|marginLeft|marginTop$/;function P(t,e){var n=t.style;X(e,(function(t,e){$.test(e)&&_(t)&&(t="".concat(t,"px")),n[e]=t}))}function F(t,e){if(e)if(_(t.length))X(t,(function(t){F(t,e)}));else if(t.classList)t.classList.add(e);else{var n=t.className.trim();n?n.indexOf(e)<0&&(t.className="".concat(n," ").concat(e)):t.className=e}}function G(t,e){e&&(_(t.length)?X(t,(function(t){G(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Z(t,e,n){e&&(_(t.length)?X(t,(function(t){Z(t,e,n)})):n?F(t,e):G(t,e))}var q=/([a-z\d])([A-Z])/g;function V(t){return t.replace(q,"$1-$2").toLowerCase()}function J(t,e){return z(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(V(e)))}function Q(t,e,n){z(n)?t[e]=n:t.dataset?t.dataset[e]=n:t.setAttribute("data-".concat(V(e)),n)}var K=/\s\s*/,tt=function(){var t=!1;if(o){var e=!1,n=function(){},i=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});s.addEventListener("test",n,i),s.removeEventListener("test",n,i)}return t}();function et(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(K).forEach((function(e){if(!tt){var a=t.listeners;a&&a[e]&&a[e][n]&&(r=a[e][n],delete a[e][n],0===Object.keys(a[e]).length&&delete a[e],0===Object.keys(a).length&&delete t.listeners)}t.removeEventListener(e,r,i)}))}function nt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(K).forEach((function(e){if(i.once&&!tt){var a=t.listeners,o=void 0===a?{}:a;r=function(){delete o[e][n],t.removeEventListener(e,r,i);for(var a=arguments.length,s=new Array(a),h=0;h1&&void 0!==arguments[1]?arguments[1]:"contain",a=E(i),o=E(n);if(a&&o){var s=n*e;"contain"===r&&s>i||"cover"===r&&s=8&&(a=h+p)}}}if(a){var l,d,u=n.getUint16(a,i);for(d=0;dt.width?3===n?s=t.height*o:h=t.width/o:3===n?h=t.width/o:s=t.height*o;var c={aspectRatio:o,naturalWidth:r,naturalHeight:a,width:s,height:h};c.left=(t.width-s)/2,c.top=(t.height-h)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),this.initialImageData=Y({},e),this.initialCanvasData=Y({},c)},limitCanvas:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,a=this.cropBoxData,o=n.viewMode,s=r.aspectRatio,h=this.cropped&&a;if(t){var c=Number(n.minCanvasWidth)||0,p=Number(n.minCanvasHeight)||0;o>1?(c=Math.max(c,i.width),p=Math.max(p,i.height),3===o&&(p*s>c?c=p*s:p=c/s)):o>0&&(c?c=Math.max(c,h?a.width:0):p?p=Math.max(p,h?a.height:0):h&&(c=a.width,(p=a.height)*s>c?c=p*s:p=c/s));var l=lt({aspectRatio:s,width:c,height:p});c=l.width,p=l.height,r.minWidth=c,r.minHeight=p,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(o>(h?0:1)){var d=i.width-r.width,u=i.height-r.height;r.minLeft=Math.min(0,d),r.minTop=Math.min(0,u),r.maxLeft=Math.max(0,d),r.maxTop=Math.max(0,u),h&&this.limited&&(r.minLeft=Math.min(a.left,a.left+(a.width-r.width)),r.minTop=Math.min(a.top,a.top+(a.height-r.height)),r.maxLeft=a.left,r.maxTop=a.top,2===o&&(r.width>=i.width&&(r.minLeft=Math.min(0,d),r.maxLeft=Math.max(0,d)),r.height>=i.height&&(r.minTop=Math.min(0,u),r.maxTop=Math.max(0,u))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=i.width,r.maxTop=i.height},renderCanvas:function(t,e){var n=this.canvasData,i=this.imageData;if(e){var r=function(t){var e=t.width,n=t.height,i=t.degree;if(90==(i=Math.abs(i)%180))return{width:n,height:e};var r=i%90*Math.PI/180,a=Math.sin(r),o=Math.cos(r),s=e*o+n*a,h=e*a+n*o;return i>90?{width:h,height:s}:{width:s,height:h}}({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),a=r.width,o=r.height,s=n.width*(a/n.naturalWidth),h=n.height*(o/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(h-n.height)/2,n.width=s,n.height=h,n.aspectRatio=a/o,n.naturalWidth=a,n.naturalHeight=o,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heighte.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*i),r.height=Math.max(r.minHeight,r.height*i),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=Y({},r)},limitCropBox:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,a=this.cropBoxData,o=this.limited,s=n.aspectRatio;if(t){var h=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,p=o?Math.min(i.width,r.width,r.width+r.left,i.width-r.left):i.width,l=o?Math.min(i.height,r.height,r.height+r.top,i.height-r.top):i.height;h=Math.min(h,i.width),c=Math.min(c,i.height),s&&(h&&c?c*s>h?c=h/s:h=c*s:h?c=h/s:c&&(h=c*s),l*s>p?l=p/s:p=l*s),a.minWidth=Math.min(h,p),a.minHeight=Math.min(c,l),a.maxWidth=p,a.maxHeight=l}e&&(o?(a.minLeft=Math.max(0,r.left),a.minTop=Math.max(0,r.top),a.maxLeft=Math.min(i.width,r.left+r.width)-a.width,a.maxTop=Math.min(i.height,r.top+r.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=i.width-a.width,a.maxTop=i.height-a.height))},renderCropBox:function(){var t=this.options,e=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=e.width&&n.height>=e.height?"move":"all"),P(this.cropBox,Y({width:n.width,height:n.height},ct({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),it(this.element,"crop",this.getData())}},vt={initPreview:function(){var t=this.element,e=this.crossOrigin,n=this.options.preview,i=e?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",a=document.createElement("img");if(e&&(a.crossOrigin=e),a.src=i,a.alt=r,this.viewBox.appendChild(a),this.viewBoxImage=a,n){var o=n;"string"==typeof n?o=t.ownerDocument.querySelectorAll(n):n.querySelector&&(o=[n]),this.previews=o,X(o,(function(t){var n=document.createElement("img");Q(t,b,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(n.crossOrigin=e),n.src=i,n.alt=r,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(n)}))}},resetPreview:function(){X(this.previews,(function(t){var e=J(t,b);P(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(z(t[e]))try{delete t[e]}catch(n){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(n){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(V(e)))}(t,b)}))},preview:function(){var t=this.imageData,e=this.canvasData,n=this.cropBoxData,i=n.width,r=n.height,a=t.width,o=t.height,s=n.left-e.left-t.left,h=n.top-e.top-t.top;this.cropped&&!this.disabled&&(P(this.viewBoxImage,Y({width:a,height:o},ct(Y({translateX:-s,translateY:-h},t)))),X(this.previews,(function(e){var n=J(e,b),c=n.width,p=n.height,l=c,d=p,u=1;i&&(d=r*(u=c/i)),r&&d>p&&(l=i*(u=p/r),d=p),P(e,{width:l,height:d}),P(e.getElementsByTagName("img")[0],Y({width:a*u,height:o*u},ct(Y({translateX:-s*u,translateY:-h*u},t))))})))}},bt={bind:function(){var t=this.element,e=this.options,n=this.cropper;U(e.cropstart)&&nt(t,"cropstart",e.cropstart),U(e.cropmove)&&nt(t,"cropmove",e.cropmove),U(e.cropend)&&nt(t,"cropend",e.cropend),U(e.crop)&&nt(t,"crop",e.crop),U(e.zoom)&&nt(t,"zoom",e.zoom),nt(n,C,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&nt(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&nt(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),nt(t.ownerDocument,M,this.onCropMove=this.cropMove.bind(this)),nt(t.ownerDocument,D,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&nt(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,n=this.cropper;U(e.cropstart)&&et(t,"cropstart",e.cropstart),U(e.cropmove)&&et(t,"cropmove",e.cropmove),U(e.cropend)&&et(t,"cropend",e.cropend),U(e.crop)&&et(t,"crop",e.crop),U(e.zoom)&&et(t,"zoom",e.zoom),et(n,C,this.onCropStart),e.zoomable&&e.zoomOnWheel&&et(n,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&et(n,"dblclick",this.onDblclick),et(t.ownerDocument,M,this.onCropMove),et(t.ownerDocument,D,this.onCropEnd),e.responsive&&et(window,"resize",this.onResize)}},wt={resize:function(){var t=this.options,e=this.container,n=this.containerData,i=Number(t.minContainerWidth)||200,r=Number(t.minContainerHeight)||100;if(!(this.disabled||n.width<=i||n.height<=r)){var a,o,s=e.offsetWidth/n.width;1===s&&e.offsetHeight===n.height||(t.restore&&(a=this.getCanvasData(),o=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(X(a,(function(t,e){a[e]=t*s}))),this.setCropBoxData(X(o,(function(t,e){o[e]=t*s})))))}},dblclick:function(){var t,e;this.disabled||"none"===this.options.dragMode||this.setDragMode((t=this.dragBox,e=p,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?"move":"crop"))},wheel:function(t){var e=this,n=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?i=t.deltaY>0?1:-1:t.wheelDelta?i=-t.wheelDelta/120:t.detail&&(i=t.detail>0?1:-1),this.zoom(-i*n,t)))},cropStart:function(t){var e=t.buttons,n=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(_(e)&&1!==e||_(n)&&0!==n||t.ctrlKey))){var i,r=this.options,a=this.pointers;t.changedTouches?X(t.changedTouches,(function(t){a[t.identifier]=pt(t)})):a[t.pointerId||0]=pt(t),i=Object.keys(a).length>1&&r.zoomable&&r.zoomOnTouch?"zoom":J(t.target,v),T.test(i)&&!1!==it(this.element,"cropstart",{originalEvent:t,action:i})&&(t.preventDefault(),this.action=i,this.cropping=!1,"crop"===i&&(this.cropping=!0,F(this.dragBox,m)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var n=this.pointers;t.preventDefault(),!1!==it(this.element,"cropmove",{originalEvent:t,action:e})&&(t.changedTouches?X(t.changedTouches,(function(t){Y(n[t.identifier]||{},pt(t,!0))})):Y(n[t.pointerId||0]||{},pt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,n=this.pointers;t.changedTouches?X(t.changedTouches,(function(t){delete n[t.identifier]})):delete n[t.pointerId||0],e&&(t.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,Z(this.dragBox,m,this.cropped&&this.options.modal)),it(this.element,"cropend",{originalEvent:t,action:e}))}}},xt={change:function(t){var e,n=this.options,i=this.canvasData,a=this.containerData,o=this.cropBoxData,s=this.pointers,h=this.action,c=n.aspectRatio,p=o.left,l=o.top,u=o.width,f=o.height,m=p+u,g=l+f,v=0,b=0,w=a.width,x=a.height,y=!0;!c&&t.shiftKey&&(c=u&&f?u/f:1),this.limited&&(v=o.minLeft,b=o.minTop,w=v+Math.min(a.width,i.width,i.left+i.width),x=b+Math.min(a.height,i.height,i.top+i.height));var C=s[Object.keys(s)[0]],M={x:C.endX-C.startX,y:C.endY-C.startY},D=function(t){switch(t){case"e":m+M.x>w&&(M.x=w-m);break;case"w":p+M.xx&&(M.y=x-g)}};switch(h){case"all":p+=M.x,l+=M.y;break;case"e":if(M.x>=0&&(m>=w||c&&(l<=b||g>=x))){y=!1;break}D("e"),(u+=M.x)<0&&(h="w",p-=u=-u),c&&(f=u/c,l+=(o.height-f)/2);break;case"n":if(M.y<=0&&(l<=b||c&&(p<=v||m>=w))){y=!1;break}D("n"),f-=M.y,l+=M.y,f<0&&(h="s",l-=f=-f),c&&(u=f*c,p+=(o.width-u)/2);break;case"w":if(M.x<=0&&(p<=v||c&&(l<=b||g>=x))){y=!1;break}D("w"),u-=M.x,p+=M.x,u<0&&(h="e",p-=u=-u),c&&(f=u/c,l+=(o.height-f)/2);break;case"s":if(M.y>=0&&(g>=x||c&&(p<=v||m>=w))){y=!1;break}D("s"),(f+=M.y)<0&&(h="n",l-=f=-f),c&&(u=f*c,p+=(o.width-u)/2);break;case"ne":if(c){if(M.y<=0&&(l<=b||m>=w)){y=!1;break}D("n"),f-=M.y,l+=M.y,u=f*c}else D("n"),D("e"),M.x>=0?mb&&(f-=M.y,l+=M.y):(f-=M.y,l+=M.y);u<0&&f<0?(h="sw",l-=f=-f,p-=u=-u):u<0?(h="nw",p-=u=-u):f<0&&(h="se",l-=f=-f);break;case"nw":if(c){if(M.y<=0&&(l<=b||p<=v)){y=!1;break}D("n"),f-=M.y,l+=M.y,u=f*c,p+=o.width-u}else D("n"),D("w"),M.x<=0?p>v?(u-=M.x,p+=M.x):M.y<=0&&l<=b&&(y=!1):(u-=M.x,p+=M.x),M.y<=0?l>b&&(f-=M.y,l+=M.y):(f-=M.y,l+=M.y);u<0&&f<0?(h="se",l-=f=-f,p-=u=-u):u<0?(h="ne",p-=u=-u):f<0&&(h="sw",l-=f=-f);break;case"sw":if(c){if(M.x<=0&&(p<=v||g>=x)){y=!1;break}D("w"),u-=M.x,p+=M.x,f=u/c}else D("s"),D("w"),M.x<=0?p>v?(u-=M.x,p+=M.x):M.y>=0&&g>=x&&(y=!1):(u-=M.x,p+=M.x),M.y>=0?g=0&&(m>=w||g>=x)){y=!1;break}D("e"),f=(u+=M.x)/c}else D("s"),D("e"),M.x>=0?m=0&&g>=x&&(y=!1):u+=M.x,M.y>=0?g0?h=M.y>0?"se":"ne":M.x<0&&(p-=u,h=M.y>0?"sw":"nw"),M.y<0&&(l-=f),this.cropped||(G(this.cropBox,d),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}y&&(o.width=u,o.height=f,o.left=p,o.top=l,this.action=h,this.renderCropBox()),X(s,(function(t){t.startX=t.endX,t.startY=t.endY}))}},yt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&F(this.dragBox,m),G(this.cropBox,d),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Y({},this.initialImageData),this.canvasData=Y({},this.initialCanvasData),this.cropBoxData=Y({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Y(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),G(this.dragBox,m),F(this.cropBox,d)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,X(this.previews,(function(e){e.getElementsByTagName("img")[0].src=t})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,G(this.cropper,l)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,F(this.cropper,l)),this},destroy:function(){var t=this.element;return t.cropper?(t.cropper=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=n.left,r=n.top;return this.moveTo(N(t)?t:i+Number(t),N(e)?e:r+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(_(t)&&(n.left=t,i=!0),_(e)&&(n.top=e,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(t,e){var n=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,null,e)},zoomTo:function(t,e,n){var i=this.options,r=this.canvasData,a=r.width,o=r.height,s=r.naturalWidth,h=r.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&i.zoomable){var c=s*t,p=h*t;if(!1===it(this.element,"zoom",{ratio:t,oldRatio:a/s,originalEvent:n}))return this;if(n){var l=this.pointers,d=rt(this.cropper),u=l&&Object.keys(l).length?function(t){var e=0,n=0,i=0;return X(t,(function(t){var r=t.startX,a=t.startY;e+=r,n+=a,i+=1})),{pageX:e/=i,pageY:n/=i}}(l):{pageX:n.pageX,pageY:n.pageY};r.left-=(c-a)*((u.pageX-d.left-r.left)/a),r.top-=(p-o)*((u.pageY-d.top-r.top)/o)}else R(e)&&_(e.x)&&_(e.y)?(r.left-=(c-a)*((e.x-r.left)/a),r.top-=(p-o)*((e.y-r.top)/o)):(r.left-=(c-a)/2,r.top-=(p-o)/2);r.width=c,r.height=p,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return _(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,_(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(_(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.imageData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(_(t)&&(n.scaleX=t,i=!0),_(e)&&(n.scaleY=e,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,i=this.imageData,r=this.canvasData,a=this.cropBoxData;if(this.ready&&this.cropped){t={x:a.left-r.left,y:a.top-r.top,width:a.width,height:a.height};var o=i.width/i.naturalWidth;if(X(t,(function(e,n){t[n]=e/o})),e){var s=Math.round(t.y+t.height),h=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=h-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return n.rotatable&&(t.rotate=i.rotate||0),n.scalable&&(t.scaleX=i.scaleX||1,t.scaleY=i.scaleY||1),t},setData:function(t){var e=this.options,n=this.imageData,i=this.canvasData,r={};if(this.ready&&!this.disabled&&R(t)){var a=!1;e.rotatable&&_(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,a=!0),e.scalable&&(_(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,a=!0),_(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=n.width/n.naturalWidth;_(t.x)&&(r.left=t.x*o+i.left),_(t.y)&&(r.top=t.y*o+i.top),_(t.width)&&(r.width=t.width*o),_(t.height)&&(r.height=t.height*o),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?Y({},this.containerData):{}},getImageData:function(){return this.sized?Y({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&X(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){e[n]=t[n]})),e},setCanvasData:function(t){var e=this.canvasData,n=e.aspectRatio;return this.ready&&!this.disabled&&R(t)&&(_(t.left)&&(e.left=t.left),_(t.top)&&(e.top=t.top),_(t.width)?(e.width=t.width,e.height=t.width/n):_(t.height)&&(e.height=t.height,e.width=t.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,n,i=this.cropBoxData,r=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&R(t)&&(_(t.left)&&(i.left=t.left),_(t.top)&&(i.top=t.top),_(t.width)&&t.width!==i.width&&(e=!0,i.width=t.width),_(t.height)&&t.height!==i.height&&(n=!0,i.height=t.height),r&&(e?i.height=i.width/r:n&&(i.width=i.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,n=dt(this.image,this.imageData,e,t);if(!this.cropped)return n;var i=this.getData(),r=i.x,o=i.y,s=i.width,h=i.height,c=n.width/Math.floor(e.naturalWidth);1!==c&&(r*=c,o*=c,s*=c,h*=c);var p=s/h,l=lt({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=lt({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=lt({aspectRatio:p,width:t.width||(1!==c?n.width:s),height:t.height||(1!==c?n.height:h)}),f=u.width,m=u.height;f=Math.min(l.width,Math.max(d.width,f)),m=Math.min(l.height,Math.max(d.height,m));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=I(f),g.height=I(m),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,f,m);var b=t.imageSmoothingEnabled,w=void 0===b||b,x=t.imageSmoothingQuality;v.imageSmoothingEnabled=w,x&&(v.imageSmoothingQuality=x);var y,C,M,D,T,B,S=n.width,A=n.height,O=r,k=o;O<=-s||O>S?(O=0,y=0,M=0,T=0):O<=0?(M=-O,O=0,T=y=Math.min(S,s+O)):O<=S&&(M=0,T=y=Math.min(s,S-O)),y<=0||k<=-h||k>A?(k=0,C=0,D=0,B=0):k<=0?(D=-k,k=0,B=C=Math.min(A,h+k)):k<=A&&(D=0,B=C=Math.min(h,A-k));var _=[O,k,y,C];if(T>0&&B>0){var E=f/s;_.push(M*E,D*E,T*E,B*E)}return v.drawImage.apply(v,[n].concat(a(_.map((function(t){return Math.floor(I(t))}))))),g},setAspectRatio:function(t){var e=this.options;return this.disabled||N(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,n=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var r="crop"===t,a=e.movable&&"move"===t;t=r||a?t:"none",e.dragMode=t,Q(n,v,t),Z(n,p,r),Z(n,g,a),e.cropBoxMovable||(Q(i,v,t),Z(i,p,r),Z(i,g,a))}return this}},Ct=s.Cropper,Mt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e||!A.test(e.tagName))throw new Error("The first argument is required and must be an or element.");this.element=e,this.options=Y({},O,R(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var n,i,r;return n=t,r=[{key:"noConflict",value:function(){return window.Cropper=Ct,t}},{key:"setDefaults",value:function(t){Y(O,R(t)&&t)}}],(i=[{key:"init",value:function(){var t,e=this.element,n=e.tagName.toLowerCase();if(!e.cropper){if(e.cropper=this,"img"===n){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===n&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var n=this.element,i=this.options;if(i.rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer)if(B.test(t))S.test(t)?this.read((r=t.replace(ft,""),a=atob(r),o=new ArrayBuffer(a.length),X(s=new Uint8Array(o),(function(t,e){s[e]=a.charCodeAt(e)})),o)):this.clone();else{var r,a,o,s,h=new XMLHttpRequest,c=this.clone.bind(this);this.reloading=!0,this.xhr=h,h.onabort=c,h.onerror=c,h.ontimeout=c,h.onprogress=function(){"image/jpeg"!==h.getResponseHeader("content-type")&&h.abort()},h.onload=function(){e.read(h.response)},h.onloadend=function(){e.reloading=!1,e.xhr=null},i.checkCrossOrigin&&st(t)&&n.crossOrigin&&(t=ht(t)),h.open("GET",t),h.responseType="arraybuffer",h.withCredentials="use-credentials"===n.crossOrigin,h.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,n=this.imageData,i=mt(t),r=0,a=1,o=1;if(i>1){this.url=function(t,e){for(var n=[],i=new Uint8Array(t);i.length>0;)n.push(ut.apply(null,L(i.subarray(0,8192)))),i=i.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(n.join("")))}(t,"image/jpeg");var s=function(t){var e=0,n=1,i=1;switch(t){case 2:n=-1;break;case 3:e=-180;break;case 4:i=-1;break;case 5:e=90,i=-1;break;case 6:e=90;break;case 7:e=90,n=-1;break;case 8:e=-90}return{rotate:e,scaleX:n,scaleY:i}}(i);r=s.rotate,a=s.scaleX,o=s.scaleY}e.rotatable&&(n.rotate=r),e.scalable&&(n.scaleX=a,n.scaleY=o),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,n=t.crossOrigin,i=e;this.options.checkCrossOrigin&&st(e)&&(n||(n="anonymous"),i=ht(e)),this.crossOrigin=n,this.crossOriginUrl=i;var r=document.createElement("img");n&&(r.crossOrigin=n),r.src=i||e,r.alt=t.alt||"The image to crop",this.image=r,r.onload=this.start.bind(this),r.onerror=this.stop.bind(this),F(r,u),t.parentNode.insertBefore(r,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var n=s.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(s.navigator.userAgent),i=function(e,n){Y(t.imageData,{naturalWidth:e,naturalHeight:n,aspectRatio:e/n}),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||n){var r=document.createElement("img"),a=document.body||document.documentElement;this.sizingImage=r,r.onload=function(){i(r.width,r.height),n||a.removeChild(r)},r.src=e.src,n||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",a.appendChild(r))}else i(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,n=this.image,i=t.parentNode,r=document.createElement("div");r.innerHTML='
';var a=r.querySelector(".".concat("cropper","-container")),o=a.querySelector(".".concat("cropper","-canvas")),s=a.querySelector(".".concat("cropper","-drag-box")),h=a.querySelector(".".concat("cropper","-crop-box")),c=h.querySelector(".".concat("cropper","-face"));this.container=i,this.cropper=a,this.canvas=o,this.dragBox=s,this.cropBox=h,this.viewBox=a.querySelector(".".concat("cropper","-view-box")),this.face=c,o.appendChild(n),F(t,d),i.insertBefore(a,t.nextSibling),this.isImg||G(n,u),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,F(h,d),e.guides||F(h.getElementsByClassName("".concat("cropper","-dashed")),d),e.center||F(h.getElementsByClassName("".concat("cropper","-center")),d),e.background&&F(a,"".concat("cropper","-bg")),e.highlight||F(c,f),e.cropBoxMovable&&(F(c,g),Q(c,v,"all")),e.cropBoxResizable||(F(h.getElementsByClassName("".concat("cropper","-line")),d),F(h.getElementsByClassName("".concat("cropper","-point")),d)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),U(e.ready)&&nt(t,"ready",e.ready,{once:!0}),it(t,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),G(this.element,d))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&e(n.prototype,i),r&&e(n,r),t}();return Y(Mt.prototype,gt,vt,bt,wt,xt,yt),Mt}()},yHON:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t).getTime(),r=i(e).getTime();return n>r?-1:n0&&(_+=U)}return new Date(E+N+_)}return new Date(t)}}},[[20,0]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{20:function(t,e,n){t.exports=n("spWN")},"3VoG":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"/*!\n * Cropper.js v1.5.6\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2019-10-04T04:33:44.164Z\n */\n\n.cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cropper-container img {\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n}\n\n.cropper-wrap-box,\n.cropper-canvas,\n.cropper-drag-box,\n.cropper-crop-box,\n.cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.cropper-wrap-box,\n.cropper-canvas {\n overflow: hidden;\n}\n\n.cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n}\n\n.cropper-modal {\n background-color: #000;\n opacity: 0.5;\n}\n\n.cropper-view-box {\n display: block;\n height: 100%;\n outline: 1px solid #39f;\n outline-color: rgba(51, 153, 255, 0.75);\n overflow: hidden;\n width: 100%;\n}\n\n.cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: 0.5;\n position: absolute;\n}\n\n.cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: calc(100% / 3);\n left: 0;\n top: calc(100% / 3);\n width: 100%;\n}\n\n.cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: calc(100% / 3);\n top: 0;\n width: calc(100% / 3);\n}\n\n.cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: 0.75;\n position: absolute;\n top: 50%;\n width: 0;\n}\n\n.cropper-center::before,\n.cropper-center::after {\n background-color: #eee;\n content: ' ';\n display: block;\n position: absolute;\n}\n\n.cropper-center::before {\n height: 1px;\n left: -3px;\n top: 0;\n width: 7px;\n}\n\n.cropper-center::after {\n height: 7px;\n left: 0;\n top: -3px;\n width: 1px;\n}\n\n.cropper-face,\n.cropper-line,\n.cropper-point {\n display: block;\n height: 100%;\n opacity: 0.1;\n position: absolute;\n width: 100%;\n}\n\n.cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n}\n\n.cropper-line {\n background-color: #39f;\n}\n\n.cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n}\n\n.cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n}\n\n.cropper-point {\n background-color: #39f;\n height: 5px;\n opacity: 0.75;\n width: 5px;\n}\n\n.cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -3px;\n right: -3px;\n top: 50%;\n}\n\n.cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-w {\n cursor: ew-resize;\n left: -3px;\n margin-top: -3px;\n top: 50%;\n}\n\n.cropper-point.point-s {\n bottom: -3px;\n cursor: s-resize;\n left: 50%;\n margin-left: -3px;\n}\n\n.cropper-point.point-ne {\n cursor: nesw-resize;\n right: -3px;\n top: -3px;\n}\n\n.cropper-point.point-nw {\n cursor: nwse-resize;\n left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-sw {\n bottom: -3px;\n cursor: nesw-resize;\n left: -3px;\n}\n\n.cropper-point.point-se {\n bottom: -3px;\n cursor: nwse-resize;\n height: 20px;\n opacity: 1;\n right: -3px;\n width: 20px;\n}\n\n@media (min-width: 768px) {\n .cropper-point.point-se {\n height: 15px;\n width: 15px;\n }\n}\n\n@media (min-width: 992px) {\n .cropper-point.point-se {\n height: 10px;\n width: 10px;\n }\n}\n\n@media (min-width: 1200px) {\n .cropper-point.point-se {\n height: 5px;\n opacity: 0.75;\n width: 5px;\n }\n}\n\n.cropper-point.point-se::before {\n background-color: #39f;\n bottom: -50%;\n content: ' ';\n display: block;\n height: 200%;\n opacity: 0;\n position: absolute;\n right: -50%;\n width: 200%;\n}\n\n.cropper-invisible {\n opacity: 0;\n}\n\n.cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n}\n\n.cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n\n.cropper-hidden {\n display: none !important;\n}\n\n.cropper-move {\n cursor: move;\n}\n\n.cropper-crop {\n cursor: crosshair;\n}\n\n.cropper-disabled .cropper-drag-box,\n.cropper-disabled .cropper-face,\n.cropper-disabled .cropper-line,\n.cropper-disabled .cropper-point {\n cursor: not-allowed;\n}\n",""])},"4Toj":function(t,e,n){var i=n("54Wo");t.exports=function(t,e){var n=i(t,e)/1e3;return n>0?Math.floor(n):Math.ceil(n)}},"54Wo":function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t),r=i(e);return n.getTime()-r.getTime()}},"6DAA":function(t,e,n){var i=n("kOWh");t.exports=function(){var t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["AM","PM"],s=["am","pm"],h=["a.m.","p.m."],c={MMM:function(e){return t[e.getMonth()]},MMMM:function(t){return e[t.getMonth()]},dd:function(t){return n[t.getDay()]},ddd:function(t){return r[t.getDay()]},dddd:function(t){return a[t.getDay()]},A:function(t){return t.getHours()/12>=1?o[1]:o[0]},a:function(t){return t.getHours()/12>=1?s[1]:s[0]},aa:function(t){return t.getHours()/12>=1?h[1]:h[0]}};return["M","D","DDD","d","Q","W"].forEach((function(t){c[t+"o"]=function(e,n){return function(t){var e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"}(n[t](e))}})),{formatters:c,formattingTokensRegExp:i(c)}}},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var r,a=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?t:(r=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:i+a.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}},DT56:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t).getTime(),r=i(e).getTime();return nr?1:0}},F809:function(t,e,n){var i=n("yNUO"),r=n("sunR"),a=n("DT56");t.exports=function(t,e){var n=i(t),o=i(e),s=a(n,o),h=Math.abs(r(n,o));return n.setMonth(n.getMonth()-s*h),s*(h-(a(n,o)===-s))}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=(o=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[n].concat(a).concat([r]).join("\n")}var o;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r0?"in "+r:r+" ago":r}}}},NmtT:function(t,e,n){var i=n("yHON"),r=n("yNUO"),a=n("4Toj"),o=n("F809"),s=n("Us+F"),h=1440,c=2520,p=43200,l=86400;t.exports=function(t,e,n){var d=n||{},u=i(t,e),f=d.locale,m=s.distanceInWords.localize;f&&f.distanceInWords&&f.distanceInWords.localize&&(m=f.distanceInWords.localize);var g,v,b={addSuffix:Boolean(d.addSuffix),comparison:u};u>0?(g=r(t),v=r(e)):(g=r(e),v=r(t));var w,y=a(v,g),x=v.getTimezoneOffset()-g.getTimezoneOffset(),C=Math.round(y/60)-x;if(C<2)return d.includeSeconds?y<5?m("lessThanXSeconds",5,b):y<10?m("lessThanXSeconds",10,b):y<20?m("lessThanXSeconds",20,b):y<40?m("halfAMinute",null,b):m(y<60?"lessThanXMinutes":"xMinutes",1,b):0===C?m("lessThanXMinutes",1,b):m("xMinutes",C,b);if(C<45)return m("xMinutes",C,b);if(C<90)return m("aboutXHours",1,b);if(C=t.config.uploader.album_limit)return swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error"),t.uploading=!1,void(t.page=2);var i=e.type;if(-1==$.inArray(i,t.mimes))return swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.mimes+" only.","error"),t.uploading=!1,void(t.page="error");var r=new FormData;r.append("file",e);var a={onUploadProgress:function(e){var n=Math.floor(100*e.loaded/e.total);t.uploadProgress=n}};axios.post("/api/stories/v1/add",r,a).then((function(e){t.uploadProgress=100,t.uploading=!1,window.location.href="/i/my/story",t.mediaUrl=e.data.media_url})).catch((function(n){t.uploading=!1,e.value=null;var i=n.response.data.message?n.response.data.message:"Something went wrong.";swal("Oops!",i,"warning")})),e.value=null,t.uploadProgress=0}))},expiresTimestamp:function(t){return(t=new Date(1e3*t)).toDateString()+" "+t.toLocaleTimeString()},edit:function(){this.page="edit"},showLightbox:function(t){this.lightboxMedia={url:t.src},this.$refs.lightboxModal.show()},deleteStory:function(t,e){var n=this;1==window.confirm("Are you sure you want to delete this Story?")&&axios.delete("/api/stories/v1/delete/"+t.id).then((function(t){n.stories.splice(e,1),0==n.stories.length&&(window.location.href="/i/stories/new")}))}}}),s=n("KHd+"),h=Object(s.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container mt-2 mt-md-5"},[n("input",{staticClass:"d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",accept:t.config.mimes}}),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-6 offset-md-3"},["landing"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"90vh"}},[t._m(0),t._v(" "),n("div",{staticClass:"flex-fill"},[n("div",{staticClass:"card w-100 shadow-none"},[n("div",{staticClass:"list-group"},[n("a",{staticClass:"list-group-item text-center lead text-decoration-none text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.upload()}}},[t._v("Add Photo")]),t._v(" "),t.stories.length?n("a",{staticClass:"list-group-item text-center lead text-decoration-none text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.edit()}}},[t._v("Edit Story")]):t._e()])])]),t._v(" "),t._m(1)]):t._e(),t._v(" "),"crop"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"95vh"}},[t._m(2),t._v(" "),n("div",{staticClass:"flex-fill"},[n("div",{staticClass:"card w-100 mt-3"},[n("div",{staticClass:"card-body p-0"},[n("vue-cropper",{ref:"cropper",attrs:{relativeZoom:t.cropper.zoom,aspectRatio:t.cropper.aspectRatio,viewMode:t.cropper.viewMode,zoomable:t.cropper.zoomable,rotatable:!0,src:t.mediaUrl}})],1)])]),t._v(" "),t._m(3)]):t._e(),t._v(" "),"error"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center align-items-center",staticStyle:{height:"90vh"}},[n("p",{staticClass:"h3 mb-0"},[t._v("Oops!")]),t._v(" "),n("p",{staticClass:"text-muted lead"},[t._v("An error occurred, please try again later.")]),t._v(" "),t._m(4)]):t._e(),t._v(" "),"uploading"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center align-items-center",staticStyle:{height:"90vh"}},[100!=t.uploadProgress?n("p",{staticClass:"display-4 mb-0"},[t._v("Uploading "+t._s(t.uploadProgress)+"%")]):n("p",{staticClass:"display-4 mb-0"},[t._v("Publishing Story")])]):t._e(),t._v(" "),"edit"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"90vh"}},[t._m(5),t._v(" "),n("div",{staticClass:"flex-fill py-5"},[n("div",{staticClass:"card w-100 shadow-none",staticStyle:{"max-height":"500px","overflow-y":"auto"}},[n("div",{staticClass:"list-group"},t._l(t.stories,(function(e,i){return n("div",{staticClass:"list-group-item text-center text-dark",attrs:{href:"#"}},[n("div",{staticClass:"media align-items-center"},[n("img",{staticClass:"img-fluid mr-3 cursor-pointer",attrs:{src:e.src,width:"70px",height:"70px"},on:{click:function(n){return t.showLightbox(e)}}}),t._v(" "),n("div",{staticClass:"media-body"},[n("p",{staticClass:"mb-0"},[t._v("Expires")]),t._v(" "),n("p",{staticClass:"mb-0 text-muted small"},[n("span",[t._v(t._s(t.expiresTimestamp(e.expires_at)))])])]),t._v(" "),n("div",{staticClass:"float-right"},[n("button",{staticClass:"btn btn-danger btn-sm font-weight-bold text-uppercase",on:{click:function(n){return t.deleteStory(e,i)}}},[t._v("Delete")])])])])})),0)])]),t._v(" "),t._m(6)]):t._e()])]),t._v(" "),n("b-modal",{ref:"lightboxModal",attrs:{id:"lightbox","hide-header":"","hide-footer":"",centered:"",size:"lg","body-class":"p-0"}},[t.lightboxMedia?n("div",{staticClass:"w-100 h-100"},[n("img",{staticStyle:{"max-height":"100%","max-width":"100%"},attrs:{src:t.lightboxMedia.url}})]):t._e()])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill mt-5 pt-5"},[e("img",{attrs:{src:"/img/pixelfed-icon-grey.svg",width:"60px",height:"60px"}}),this._v(" "),e("p",{staticClass:"font-weight-bold lead text-lighter mt-1"},[this._v("Stories")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"text-center flex-fill"},[n("p",{staticClass:"text-lighter small text-uppercase"},[n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/"}},[t._v("Home")]),t._v(" "),n("span",{staticClass:"px-2 text-lighter"},[t._v("|")]),t._v(" "),n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/i/my/story"}},[t._v("View My Story")]),t._v(" "),n("span",{staticClass:"px-2 text-lighter"},[t._v("|")]),t._v(" "),n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/site/help"}},[t._v("Help")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center pt-5 mb-3 d-flex justify-content-between align-items-center"},[e("div",[e("button",{staticClass:"btn btn-outline-lighter btn-sm py-0 px-md-3"},[e("i",{staticClass:"pr-2 fas fa-chevron-left fa-sm"}),this._v(" Delete")])]),this._v(" "),e("div",{staticClass:"d-flex align-items-center"},[e("img",{staticClass:"d-inline-block mr-2",attrs:{src:"/img/pixelfed-icon-grey.svg",width:"30px",height:"30px"}}),this._v(" "),e("span",{staticClass:"font-weight-bold lead text-lighter"},[this._v("Stories")])]),this._v(" "),e("div",[e("button",{staticClass:"btn btn-outline-success btn-sm py-0 px-md-3"},[this._v("Crop "),e("i",{staticClass:"pl-2 fas fa-chevron-right fa-sm"})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill"},[e("p",{staticClass:"text-lighter small text-uppercase pt-2"},[e("a",{staticClass:"text-muted font-weight-bold mb-0",attrs:{href:"/site/help"}},[this._v("Help")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-muted mb-0"},[e("a",{staticClass:"btn btn-outline-secondary py-0 px-5 font-weight-bold",attrs:{href:"/"}},[this._v("Go back")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill mt-5 pt-5"},[e("img",{attrs:{src:"/img/pixelfed-icon-grey.svg",width:"60px",height:"60px"}}),this._v(" "),e("p",{staticClass:"font-weight-bold lead text-lighter mt-1"},[this._v("Stories")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"flex-fill text-center"},[e("a",{staticClass:"btn btn-outline-secondary py-0 px-5 font-weight-bold",attrs:{href:"/i/stories/new"}},[this._v("Go back")])])}],!1,null,"5591988e",null);e.default=h.exports},"Us+F":function(t,e,n){var i=n("LZbM"),r=n("6DAA");t.exports={distanceInWords:i(),format:r()}},VGX7:function(t,e){t.exports=function(t){var e=new Date(t.getTime()),n=e.getTimezoneOffset();return e.setSeconds(0,0),6e4*n+e.getTime()%6e4}},YQfW:function(t,e,n){var i=n("3VoG");"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,r);i.locals&&(t.exports=i.locals)},YlT8:function(t,e,n){var i=n("NmtT");t.exports=function(t,e){return i(Date.now(),t,e)}},"aET+":function(t,e,n){var i,r,a={},o=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(t,e){return e?e.querySelector(t):document.querySelector(t)},h=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var i=s.call(this,t,n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}}(),c=null,p=0,l=[],d=n("9tPo");function u(t,e){for(var n=0;n=0&&l.splice(e,1)}function v(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var i=function(){0;return n.nc}();i&&(t.attrs.nonce=i)}return b(e,t.attrs),m(t,e),e}function b(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function w(t,e){var n,i,r,a;if(e.transform&&t.css){if(!(a="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=a}if(e.singleton){var o=p++;n=c||(c=v(e)),i=C.bind(null,n,o,!1),r=C.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),m(t,e),e}(e),i=D.bind(null,n,e),r=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),i=M.bind(null,n),r=function(){g(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return u(n,e),function(t){for(var i=[],r=0;r=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["containerStyle","src","alt","imgStyle"])),n={};for(var i in e)void 0!==this[i]&&(n[i]=this[i]);this.cropper=new a.default(this.$refs.img,n)},methods:{reset:function(){return this.cropper.reset()},clear:function(){return this.cropper.clear()},initCrop:function(){return this.cropper.crop()},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(t,e)},enable:function(){return this.cropper.enable()},disable:function(){return this.cropper.disable()},destroy:function(){return this.cropper.destroy()},move:function(t,e){return this.cropper.move(t,e)},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.cropper.moveTo(t,e)},relativeZoom:function(t,e){return this.cropper.zoom(t,e)},zoomTo:function(t,e){return this.cropper.zoomTo(t,e)},rotate:function(t){return this.cropper.rotate(t)},rotateTo:function(t){return this.cropper.rotateTo(t)},scaleX:function(t){return this.cropper.scaleX(t)},scaleY:function(t){return this.cropper.scaleY(t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.cropper.scale(t,e)},getData:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(t)},setData:function(t){return this.cropper.setData(t)},getContainerData:function(){return this.cropper.getContainerData()},getImageData:function(){return this.cropper.getImageData()},getCanvasData:function(){return this.cropper.getCanvasData()},setCanvasData:function(t){return this.cropper.setCanvasData(t)},getCropBoxData:function(){return this.cropper.getCropBoxData()},setCropBoxData:function(t){return this.cropper.setCropBoxData(t)},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(t)},setAspectRatio:function(t){return this.cropper.setAspectRatio(t)},setDragMode:function(t){return this.cropper.setDragMode(t)}}}},pzWd:function(t,e){t.exports=function(t){return t instanceof Date}},spWN:function(t,e,n){Vue.component("story-compose",n("TP5S").default)},sunR:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t),r=i(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}},urRO:function(t,e,n){t.exports=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){for(var n=0;n0&&t<1/0};function N(t){return void 0===t}function z(e){return"object"===t(e)&&null!==e}var W=Object.prototype.hasOwnProperty;function R(t){if(!z(t))return!1;try{var e=t.constructor,n=e.prototype;return e&&n&&W.call(n,"isPrototypeOf")}catch(t){return!1}}function U(t){return"function"==typeof t}var H=Array.prototype.slice;function L(t){return Array.from?Array.from(t):H.call(t)}function X(t,e){return t&&U(e)&&(Array.isArray(t)||_(t.length)?L(t).forEach((function(n,i){e.call(t,n,i,t)})):z(t)&&Object.keys(t).forEach((function(n){e.call(t,t[n],n,t)}))),t}var j=Object.assign||function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i0&&n.forEach((function(e){z(e)&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t},Y=/\.\d*(?:0|9){12}\d*$/;function I(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return Y.test(t)?Math.round(t*e)/e:t}var $=/^width|height|left|top|marginLeft|marginTop$/;function P(t,e){var n=t.style;X(e,(function(t,e){$.test(e)&&_(t)&&(t="".concat(t,"px")),n[e]=t}))}function F(t,e){if(e)if(_(t.length))X(t,(function(t){F(t,e)}));else if(t.classList)t.classList.add(e);else{var n=t.className.trim();n?n.indexOf(e)<0&&(t.className="".concat(n," ").concat(e)):t.className=e}}function G(t,e){e&&(_(t.length)?X(t,(function(t){G(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Z(t,e,n){e&&(_(t.length)?X(t,(function(t){Z(t,e,n)})):n?F(t,e):G(t,e))}var q=/([a-z\d])([A-Z])/g;function V(t){return t.replace(q,"$1-$2").toLowerCase()}function J(t,e){return z(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(V(e)))}function Q(t,e,n){z(n)?t[e]=n:t.dataset?t.dataset[e]=n:t.setAttribute("data-".concat(V(e)),n)}var K=/\s\s*/,tt=function(){var t=!1;if(o){var e=!1,n=function(){},i=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});s.addEventListener("test",n,i),s.removeEventListener("test",n,i)}return t}();function et(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(K).forEach((function(e){if(!tt){var a=t.listeners;a&&a[e]&&a[e][n]&&(r=a[e][n],delete a[e][n],0===Object.keys(a[e]).length&&delete a[e],0===Object.keys(a).length&&delete t.listeners)}t.removeEventListener(e,r,i)}))}function nt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(K).forEach((function(e){if(i.once&&!tt){var a=t.listeners,o=void 0===a?{}:a;r=function(){delete o[e][n],t.removeEventListener(e,r,i);for(var a=arguments.length,s=new Array(a),h=0;h1&&void 0!==arguments[1]?arguments[1]:"contain",a=E(i),o=E(n);if(a&&o){var s=n*e;"contain"===r&&s>i||"cover"===r&&s=8&&(a=h+p)}}}if(a){var l,d,u=n.getUint16(a,i);for(d=0;dt.width?3===n?s=t.height*o:h=t.width/o:3===n?h=t.width/o:s=t.height*o;var c={aspectRatio:o,naturalWidth:r,naturalHeight:a,width:s,height:h};c.left=(t.width-s)/2,c.top=(t.height-h)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),this.initialImageData=j({},e),this.initialCanvasData=j({},c)},limitCanvas:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,a=this.cropBoxData,o=n.viewMode,s=r.aspectRatio,h=this.cropped&&a;if(t){var c=Number(n.minCanvasWidth)||0,p=Number(n.minCanvasHeight)||0;o>1?(c=Math.max(c,i.width),p=Math.max(p,i.height),3===o&&(p*s>c?c=p*s:p=c/s)):o>0&&(c?c=Math.max(c,h?a.width:0):p?p=Math.max(p,h?a.height:0):h&&(c=a.width,(p=a.height)*s>c?c=p*s:p=c/s));var l=lt({aspectRatio:s,width:c,height:p});c=l.width,p=l.height,r.minWidth=c,r.minHeight=p,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(o>(h?0:1)){var d=i.width-r.width,u=i.height-r.height;r.minLeft=Math.min(0,d),r.minTop=Math.min(0,u),r.maxLeft=Math.max(0,d),r.maxTop=Math.max(0,u),h&&this.limited&&(r.minLeft=Math.min(a.left,a.left+(a.width-r.width)),r.minTop=Math.min(a.top,a.top+(a.height-r.height)),r.maxLeft=a.left,r.maxTop=a.top,2===o&&(r.width>=i.width&&(r.minLeft=Math.min(0,d),r.maxLeft=Math.max(0,d)),r.height>=i.height&&(r.minTop=Math.min(0,u),r.maxTop=Math.max(0,u))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=i.width,r.maxTop=i.height},renderCanvas:function(t,e){var n=this.canvasData,i=this.imageData;if(e){var r=function(t){var e=t.width,n=t.height,i=t.degree;if(90==(i=Math.abs(i)%180))return{width:n,height:e};var r=i%90*Math.PI/180,a=Math.sin(r),o=Math.cos(r),s=e*o+n*a,h=e*a+n*o;return i>90?{width:h,height:s}:{width:s,height:h}}({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),a=r.width,o=r.height,s=n.width*(a/n.naturalWidth),h=n.height*(o/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(h-n.height)/2,n.width=s,n.height=h,n.aspectRatio=a/o,n.naturalWidth=a,n.naturalHeight=o,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heighte.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*i),r.height=Math.max(r.minHeight,r.height*i),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=j({},r)},limitCropBox:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,a=this.cropBoxData,o=this.limited,s=n.aspectRatio;if(t){var h=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,p=o?Math.min(i.width,r.width,r.width+r.left,i.width-r.left):i.width,l=o?Math.min(i.height,r.height,r.height+r.top,i.height-r.top):i.height;h=Math.min(h,i.width),c=Math.min(c,i.height),s&&(h&&c?c*s>h?c=h/s:h=c*s:h?c=h/s:c&&(h=c*s),l*s>p?l=p/s:p=l*s),a.minWidth=Math.min(h,p),a.minHeight=Math.min(c,l),a.maxWidth=p,a.maxHeight=l}e&&(o?(a.minLeft=Math.max(0,r.left),a.minTop=Math.max(0,r.top),a.maxLeft=Math.min(i.width,r.left+r.width)-a.width,a.maxTop=Math.min(i.height,r.top+r.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=i.width-a.width,a.maxTop=i.height-a.height))},renderCropBox:function(){var t=this.options,e=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=e.width&&n.height>=e.height?"move":"all"),P(this.cropBox,j({width:n.width,height:n.height},ct({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),it(this.element,"crop",this.getData())}},vt={initPreview:function(){var t=this.element,e=this.crossOrigin,n=this.options.preview,i=e?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",a=document.createElement("img");if(e&&(a.crossOrigin=e),a.src=i,a.alt=r,this.viewBox.appendChild(a),this.viewBoxImage=a,n){var o=n;"string"==typeof n?o=t.ownerDocument.querySelectorAll(n):n.querySelector&&(o=[n]),this.previews=o,X(o,(function(t){var n=document.createElement("img");Q(t,b,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(n.crossOrigin=e),n.src=i,n.alt=r,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(n)}))}},resetPreview:function(){X(this.previews,(function(t){var e=J(t,b);P(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(z(t[e]))try{delete t[e]}catch(n){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(n){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(V(e)))}(t,b)}))},preview:function(){var t=this.imageData,e=this.canvasData,n=this.cropBoxData,i=n.width,r=n.height,a=t.width,o=t.height,s=n.left-e.left-t.left,h=n.top-e.top-t.top;this.cropped&&!this.disabled&&(P(this.viewBoxImage,j({width:a,height:o},ct(j({translateX:-s,translateY:-h},t)))),X(this.previews,(function(e){var n=J(e,b),c=n.width,p=n.height,l=c,d=p,u=1;i&&(d=r*(u=c/i)),r&&d>p&&(l=i*(u=p/r),d=p),P(e,{width:l,height:d}),P(e.getElementsByTagName("img")[0],j({width:a*u,height:o*u},ct(j({translateX:-s*u,translateY:-h*u},t))))})))}},bt={bind:function(){var t=this.element,e=this.options,n=this.cropper;U(e.cropstart)&&nt(t,"cropstart",e.cropstart),U(e.cropmove)&&nt(t,"cropmove",e.cropmove),U(e.cropend)&&nt(t,"cropend",e.cropend),U(e.crop)&&nt(t,"crop",e.crop),U(e.zoom)&&nt(t,"zoom",e.zoom),nt(n,C,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&nt(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&nt(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),nt(t.ownerDocument,M,this.onCropMove=this.cropMove.bind(this)),nt(t.ownerDocument,D,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&nt(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,n=this.cropper;U(e.cropstart)&&et(t,"cropstart",e.cropstart),U(e.cropmove)&&et(t,"cropmove",e.cropmove),U(e.cropend)&&et(t,"cropend",e.cropend),U(e.crop)&&et(t,"crop",e.crop),U(e.zoom)&&et(t,"zoom",e.zoom),et(n,C,this.onCropStart),e.zoomable&&e.zoomOnWheel&&et(n,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&et(n,"dblclick",this.onDblclick),et(t.ownerDocument,M,this.onCropMove),et(t.ownerDocument,D,this.onCropEnd),e.responsive&&et(window,"resize",this.onResize)}},wt={resize:function(){var t=this.options,e=this.container,n=this.containerData,i=Number(t.minContainerWidth)||200,r=Number(t.minContainerHeight)||100;if(!(this.disabled||n.width<=i||n.height<=r)){var a,o,s=e.offsetWidth/n.width;1===s&&e.offsetHeight===n.height||(t.restore&&(a=this.getCanvasData(),o=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(X(a,(function(t,e){a[e]=t*s}))),this.setCropBoxData(X(o,(function(t,e){o[e]=t*s})))))}},dblclick:function(){var t,e;this.disabled||"none"===this.options.dragMode||this.setDragMode((t=this.dragBox,e=p,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?"move":"crop"))},wheel:function(t){var e=this,n=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?i=t.deltaY>0?1:-1:t.wheelDelta?i=-t.wheelDelta/120:t.detail&&(i=t.detail>0?1:-1),this.zoom(-i*n,t)))},cropStart:function(t){var e=t.buttons,n=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(_(e)&&1!==e||_(n)&&0!==n||t.ctrlKey))){var i,r=this.options,a=this.pointers;t.changedTouches?X(t.changedTouches,(function(t){a[t.identifier]=pt(t)})):a[t.pointerId||0]=pt(t),i=Object.keys(a).length>1&&r.zoomable&&r.zoomOnTouch?"zoom":J(t.target,v),T.test(i)&&!1!==it(this.element,"cropstart",{originalEvent:t,action:i})&&(t.preventDefault(),this.action=i,this.cropping=!1,"crop"===i&&(this.cropping=!0,F(this.dragBox,m)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var n=this.pointers;t.preventDefault(),!1!==it(this.element,"cropmove",{originalEvent:t,action:e})&&(t.changedTouches?X(t.changedTouches,(function(t){j(n[t.identifier]||{},pt(t,!0))})):j(n[t.pointerId||0]||{},pt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,n=this.pointers;t.changedTouches?X(t.changedTouches,(function(t){delete n[t.identifier]})):delete n[t.pointerId||0],e&&(t.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,Z(this.dragBox,m,this.cropped&&this.options.modal)),it(this.element,"cropend",{originalEvent:t,action:e}))}}},yt={change:function(t){var e,n=this.options,i=this.canvasData,a=this.containerData,o=this.cropBoxData,s=this.pointers,h=this.action,c=n.aspectRatio,p=o.left,l=o.top,u=o.width,f=o.height,m=p+u,g=l+f,v=0,b=0,w=a.width,y=a.height,x=!0;!c&&t.shiftKey&&(c=u&&f?u/f:1),this.limited&&(v=o.minLeft,b=o.minTop,w=v+Math.min(a.width,i.width,i.left+i.width),y=b+Math.min(a.height,i.height,i.top+i.height));var C=s[Object.keys(s)[0]],M={x:C.endX-C.startX,y:C.endY-C.startY},D=function(t){switch(t){case"e":m+M.x>w&&(M.x=w-m);break;case"w":p+M.xy&&(M.y=y-g)}};switch(h){case"all":p+=M.x,l+=M.y;break;case"e":if(M.x>=0&&(m>=w||c&&(l<=b||g>=y))){x=!1;break}D("e"),(u+=M.x)<0&&(h="w",p-=u=-u),c&&(f=u/c,l+=(o.height-f)/2);break;case"n":if(M.y<=0&&(l<=b||c&&(p<=v||m>=w))){x=!1;break}D("n"),f-=M.y,l+=M.y,f<0&&(h="s",l-=f=-f),c&&(u=f*c,p+=(o.width-u)/2);break;case"w":if(M.x<=0&&(p<=v||c&&(l<=b||g>=y))){x=!1;break}D("w"),u-=M.x,p+=M.x,u<0&&(h="e",p-=u=-u),c&&(f=u/c,l+=(o.height-f)/2);break;case"s":if(M.y>=0&&(g>=y||c&&(p<=v||m>=w))){x=!1;break}D("s"),(f+=M.y)<0&&(h="n",l-=f=-f),c&&(u=f*c,p+=(o.width-u)/2);break;case"ne":if(c){if(M.y<=0&&(l<=b||m>=w)){x=!1;break}D("n"),f-=M.y,l+=M.y,u=f*c}else D("n"),D("e"),M.x>=0?mb&&(f-=M.y,l+=M.y):(f-=M.y,l+=M.y);u<0&&f<0?(h="sw",l-=f=-f,p-=u=-u):u<0?(h="nw",p-=u=-u):f<0&&(h="se",l-=f=-f);break;case"nw":if(c){if(M.y<=0&&(l<=b||p<=v)){x=!1;break}D("n"),f-=M.y,l+=M.y,u=f*c,p+=o.width-u}else D("n"),D("w"),M.x<=0?p>v?(u-=M.x,p+=M.x):M.y<=0&&l<=b&&(x=!1):(u-=M.x,p+=M.x),M.y<=0?l>b&&(f-=M.y,l+=M.y):(f-=M.y,l+=M.y);u<0&&f<0?(h="se",l-=f=-f,p-=u=-u):u<0?(h="ne",p-=u=-u):f<0&&(h="sw",l-=f=-f);break;case"sw":if(c){if(M.x<=0&&(p<=v||g>=y)){x=!1;break}D("w"),u-=M.x,p+=M.x,f=u/c}else D("s"),D("w"),M.x<=0?p>v?(u-=M.x,p+=M.x):M.y>=0&&g>=y&&(x=!1):(u-=M.x,p+=M.x),M.y>=0?g=0&&(m>=w||g>=y)){x=!1;break}D("e"),f=(u+=M.x)/c}else D("s"),D("e"),M.x>=0?m=0&&g>=y&&(x=!1):u+=M.x,M.y>=0?g0?h=M.y>0?"se":"ne":M.x<0&&(p-=u,h=M.y>0?"sw":"nw"),M.y<0&&(l-=f),this.cropped||(G(this.cropBox,d),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}x&&(o.width=u,o.height=f,o.left=p,o.top=l,this.action=h,this.renderCropBox()),X(s,(function(t){t.startX=t.endX,t.startY=t.endY}))}},xt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&F(this.dragBox,m),G(this.cropBox,d),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=j({},this.initialImageData),this.canvasData=j({},this.initialCanvasData),this.cropBoxData=j({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(j(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),G(this.dragBox,m),F(this.cropBox,d)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,X(this.previews,(function(e){e.getElementsByTagName("img")[0].src=t})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,G(this.cropper,l)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,F(this.cropper,l)),this},destroy:function(){var t=this.element;return t.cropper?(t.cropper=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=n.left,r=n.top;return this.moveTo(N(t)?t:i+Number(t),N(e)?e:r+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(_(t)&&(n.left=t,i=!0),_(e)&&(n.top=e,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(t,e){var n=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,null,e)},zoomTo:function(t,e,n){var i=this.options,r=this.canvasData,a=r.width,o=r.height,s=r.naturalWidth,h=r.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&i.zoomable){var c=s*t,p=h*t;if(!1===it(this.element,"zoom",{ratio:t,oldRatio:a/s,originalEvent:n}))return this;if(n){var l=this.pointers,d=rt(this.cropper),u=l&&Object.keys(l).length?function(t){var e=0,n=0,i=0;return X(t,(function(t){var r=t.startX,a=t.startY;e+=r,n+=a,i+=1})),{pageX:e/=i,pageY:n/=i}}(l):{pageX:n.pageX,pageY:n.pageY};r.left-=(c-a)*((u.pageX-d.left-r.left)/a),r.top-=(p-o)*((u.pageY-d.top-r.top)/o)}else R(e)&&_(e.x)&&_(e.y)?(r.left-=(c-a)*((e.x-r.left)/a),r.top-=(p-o)*((e.y-r.top)/o)):(r.left-=(c-a)/2,r.top-=(p-o)/2);r.width=c,r.height=p,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return _(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,_(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(_(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.imageData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(_(t)&&(n.scaleX=t,i=!0),_(e)&&(n.scaleY=e,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,i=this.imageData,r=this.canvasData,a=this.cropBoxData;if(this.ready&&this.cropped){t={x:a.left-r.left,y:a.top-r.top,width:a.width,height:a.height};var o=i.width/i.naturalWidth;if(X(t,(function(e,n){t[n]=e/o})),e){var s=Math.round(t.y+t.height),h=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=h-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return n.rotatable&&(t.rotate=i.rotate||0),n.scalable&&(t.scaleX=i.scaleX||1,t.scaleY=i.scaleY||1),t},setData:function(t){var e=this.options,n=this.imageData,i=this.canvasData,r={};if(this.ready&&!this.disabled&&R(t)){var a=!1;e.rotatable&&_(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,a=!0),e.scalable&&(_(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,a=!0),_(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=n.width/n.naturalWidth;_(t.x)&&(r.left=t.x*o+i.left),_(t.y)&&(r.top=t.y*o+i.top),_(t.width)&&(r.width=t.width*o),_(t.height)&&(r.height=t.height*o),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?j({},this.containerData):{}},getImageData:function(){return this.sized?j({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&X(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){e[n]=t[n]})),e},setCanvasData:function(t){var e=this.canvasData,n=e.aspectRatio;return this.ready&&!this.disabled&&R(t)&&(_(t.left)&&(e.left=t.left),_(t.top)&&(e.top=t.top),_(t.width)?(e.width=t.width,e.height=t.width/n):_(t.height)&&(e.height=t.height,e.width=t.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,n,i=this.cropBoxData,r=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&R(t)&&(_(t.left)&&(i.left=t.left),_(t.top)&&(i.top=t.top),_(t.width)&&t.width!==i.width&&(e=!0,i.width=t.width),_(t.height)&&t.height!==i.height&&(n=!0,i.height=t.height),r&&(e?i.height=i.width/r:n&&(i.width=i.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,n=dt(this.image,this.imageData,e,t);if(!this.cropped)return n;var i=this.getData(),r=i.x,o=i.y,s=i.width,h=i.height,c=n.width/Math.floor(e.naturalWidth);1!==c&&(r*=c,o*=c,s*=c,h*=c);var p=s/h,l=lt({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=lt({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=lt({aspectRatio:p,width:t.width||(1!==c?n.width:s),height:t.height||(1!==c?n.height:h)}),f=u.width,m=u.height;f=Math.min(l.width,Math.max(d.width,f)),m=Math.min(l.height,Math.max(d.height,m));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=I(f),g.height=I(m),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,f,m);var b=t.imageSmoothingEnabled,w=void 0===b||b,y=t.imageSmoothingQuality;v.imageSmoothingEnabled=w,y&&(v.imageSmoothingQuality=y);var x,C,M,D,T,B,S=n.width,A=n.height,O=r,k=o;O<=-s||O>S?(O=0,x=0,M=0,T=0):O<=0?(M=-O,O=0,T=x=Math.min(S,s+O)):O<=S&&(M=0,T=x=Math.min(s,S-O)),x<=0||k<=-h||k>A?(k=0,C=0,D=0,B=0):k<=0?(D=-k,k=0,B=C=Math.min(A,h+k)):k<=A&&(D=0,B=C=Math.min(h,A-k));var _=[O,k,x,C];if(T>0&&B>0){var E=f/s;_.push(M*E,D*E,T*E,B*E)}return v.drawImage.apply(v,[n].concat(a(_.map((function(t){return Math.floor(I(t))}))))),g},setAspectRatio:function(t){var e=this.options;return this.disabled||N(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,n=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var r="crop"===t,a=e.movable&&"move"===t;t=r||a?t:"none",e.dragMode=t,Q(n,v,t),Z(n,p,r),Z(n,g,a),e.cropBoxMovable||(Q(i,v,t),Z(i,p,r),Z(i,g,a))}return this}},Ct=s.Cropper,Mt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e||!A.test(e.tagName))throw new Error("The first argument is required and must be an or element.");this.element=e,this.options=j({},O,R(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var n,i,r;return n=t,r=[{key:"noConflict",value:function(){return window.Cropper=Ct,t}},{key:"setDefaults",value:function(t){j(O,R(t)&&t)}}],(i=[{key:"init",value:function(){var t,e=this.element,n=e.tagName.toLowerCase();if(!e.cropper){if(e.cropper=this,"img"===n){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===n&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var n=this.element,i=this.options;if(i.rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer)if(B.test(t))S.test(t)?this.read((r=t.replace(ft,""),a=atob(r),o=new ArrayBuffer(a.length),X(s=new Uint8Array(o),(function(t,e){s[e]=a.charCodeAt(e)})),o)):this.clone();else{var r,a,o,s,h=new XMLHttpRequest,c=this.clone.bind(this);this.reloading=!0,this.xhr=h,h.onabort=c,h.onerror=c,h.ontimeout=c,h.onprogress=function(){"image/jpeg"!==h.getResponseHeader("content-type")&&h.abort()},h.onload=function(){e.read(h.response)},h.onloadend=function(){e.reloading=!1,e.xhr=null},i.checkCrossOrigin&&st(t)&&n.crossOrigin&&(t=ht(t)),h.open("GET",t),h.responseType="arraybuffer",h.withCredentials="use-credentials"===n.crossOrigin,h.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,n=this.imageData,i=mt(t),r=0,a=1,o=1;if(i>1){this.url=function(t,e){for(var n=[],i=new Uint8Array(t);i.length>0;)n.push(ut.apply(null,L(i.subarray(0,8192)))),i=i.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(n.join("")))}(t,"image/jpeg");var s=function(t){var e=0,n=1,i=1;switch(t){case 2:n=-1;break;case 3:e=-180;break;case 4:i=-1;break;case 5:e=90,i=-1;break;case 6:e=90;break;case 7:e=90,n=-1;break;case 8:e=-90}return{rotate:e,scaleX:n,scaleY:i}}(i);r=s.rotate,a=s.scaleX,o=s.scaleY}e.rotatable&&(n.rotate=r),e.scalable&&(n.scaleX=a,n.scaleY=o),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,n=t.crossOrigin,i=e;this.options.checkCrossOrigin&&st(e)&&(n||(n="anonymous"),i=ht(e)),this.crossOrigin=n,this.crossOriginUrl=i;var r=document.createElement("img");n&&(r.crossOrigin=n),r.src=i||e,r.alt=t.alt||"The image to crop",this.image=r,r.onload=this.start.bind(this),r.onerror=this.stop.bind(this),F(r,u),t.parentNode.insertBefore(r,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var n=s.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(s.navigator.userAgent),i=function(e,n){j(t.imageData,{naturalWidth:e,naturalHeight:n,aspectRatio:e/n}),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||n){var r=document.createElement("img"),a=document.body||document.documentElement;this.sizingImage=r,r.onload=function(){i(r.width,r.height),n||a.removeChild(r)},r.src=e.src,n||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",a.appendChild(r))}else i(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,n=this.image,i=t.parentNode,r=document.createElement("div");r.innerHTML='
';var a=r.querySelector(".".concat("cropper","-container")),o=a.querySelector(".".concat("cropper","-canvas")),s=a.querySelector(".".concat("cropper","-drag-box")),h=a.querySelector(".".concat("cropper","-crop-box")),c=h.querySelector(".".concat("cropper","-face"));this.container=i,this.cropper=a,this.canvas=o,this.dragBox=s,this.cropBox=h,this.viewBox=a.querySelector(".".concat("cropper","-view-box")),this.face=c,o.appendChild(n),F(t,d),i.insertBefore(a,t.nextSibling),this.isImg||G(n,u),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,F(h,d),e.guides||F(h.getElementsByClassName("".concat("cropper","-dashed")),d),e.center||F(h.getElementsByClassName("".concat("cropper","-center")),d),e.background&&F(a,"".concat("cropper","-bg")),e.highlight||F(c,f),e.cropBoxMovable&&(F(c,g),Q(c,v,"all")),e.cropBoxResizable||(F(h.getElementsByClassName("".concat("cropper","-line")),d),F(h.getElementsByClassName("".concat("cropper","-point")),d)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),U(e.ready)&&nt(t,"ready",e.ready,{once:!0}),it(t,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),G(this.element,d))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&e(n.prototype,i),r&&e(n,r),t}();return j(Mt.prototype,gt,vt,bt,wt,yt,xt),Mt}()},yHON:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t).getTime(),r=i(e).getTime();return n>r?-1:n0&&(_+=U)}return new Date(E+N+_)}return new Date(t)}}},[[20,0]]]); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index e15e3271b..89fe1711b 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -23,7 +23,7 @@ "/js/quill.js": "/js/quill.js?id=9b15ab0ae830e7293390", "/js/search.js": "/js/search.js?id=22e8bccee621e57963d9", "/js/status.js": "/js/status.js?id=c0058d6c5fecb0bc96c0", - "/js/story-compose.js": "/js/story-compose.js?id=df582bf83d8c0d0bc3de", + "/js/story-compose.js": "/js/story-compose.js?id=0a2ac08ac4dbc66b105f", "/js/theme-monokai.js": "/js/theme-monokai.js?id=39b089458f249e8717ad", "/js/timeline.js": "/js/timeline.js?id=1db81ef37e38304aba79" } diff --git a/resources/assets/js/components/StoryCompose.vue b/resources/assets/js/components/StoryCompose.vue index 9ec338eb0..7d9ca47f8 100644 --- a/resources/assets/js/components/StoryCompose.vue +++ b/resources/assets/js/components/StoryCompose.vue @@ -79,6 +79,12 @@

+ +
+

Uploading {{uploadProgress}}%

+

Publishing Story

+
+
@@ -152,10 +158,11 @@ 'crop', 'edit', 'confirm', - 'error' + 'error', + 'uploading' ], uploading: false, - uploadProgress: 100, + uploadProgress: 0, cropper: { aspectRatio: 9/16, viewMode: 1, @@ -192,6 +199,7 @@ let self = this; self.uploading = true; let io = document.querySelector('#pf-dz'); + self.page = 'uploading'; Array.prototype.forEach.call(io.files, function(io, i) { if(self.media && self.media.length + i >= self.config.uploader.album_limit) { swal('Error', 'You can only upload ' + self.config.uploader.album_limit + ' photos per album', 'error'); @@ -213,7 +221,7 @@ let xhrConfig = { onUploadProgress: function(e) { - let progress = Math.round( (e.loaded * 100) / e.total ); + let progress = Math.floor( (e.loaded * 100) / e.total ); self.uploadProgress = progress; } };