forked from mirror/pixelfed
1 line
70 KiB
JavaScript
1 line
70 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{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.9\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2020-09-10T13:16:21.689Z\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 n<r?-1:n>r?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;r<this.length;r++){var a=this[r][0];"number"==typeof a&&(i[a]=!0)}for(r=0;r<t.length;r++){var o=t[r];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),e.push(o))}},e}},"KHd+":function(t,e,n){"use strict";function i(t,e,n,i,r,a,o,s){var h,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):r&&(h=s?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),h)if(c.functional){c._injectStyles=h;var l=c.render;c.render=function(t,e){return h.call(e),l(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,h):[h]}return{exports:t,options:c}}n.d(e,"a",(function(){return i}))},LZbM:function(t,e){t.exports=function(){var t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(e,n,i){var r;return i=i||{},r="string"==typeof t[e]?t[e]:1===n?t[e].one:t[e].other.replace("{{count}}",n),i.addSuffix?i.comparison>0?"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");t.exports=function(t,e,n){var h=n||{},c=i(t,e),l=h.locale,p=s.distanceInWords.localize;l&&l.distanceInWords&&l.distanceInWords.localize&&(p=l.distanceInWords.localize);var d,u,f={addSuffix:Boolean(h.addSuffix),comparison:c};c>0?(d=r(t),u=r(e)):(d=r(e),u=r(t));var m,g=a(u,d),v=u.getTimezoneOffset()-d.getTimezoneOffset(),b=Math.round(g/60)-v;if(b<2)return h.includeSeconds?g<5?p("lessThanXSeconds",5,f):g<10?p("lessThanXSeconds",10,f):g<20?p("lessThanXSeconds",20,f):g<40?p("halfAMinute",null,f):p(g<60?"lessThanXMinutes":"xMinutes",1,f):0===b?p("lessThanXMinutes",1,f):p("xMinutes",b,f);if(b<45)return p("xMinutes",b,f);if(b<90)return p("aboutXHours",1,f);if(b<1440)return p("aboutXHours",Math.round(b/60),f);if(b<2520)return p("xDays",1,f);if(b<43200)return p("xDays",Math.round(b/1440),f);if(b<86400)return p("aboutXMonths",m=Math.round(b/43200),f);if((m=o(u,d))<12)return p("xMonths",Math.round(b/43200),f);var w=m%12,y=Math.floor(m/12);return w<3?p("aboutXYears",y,f):w<9?p("overXYears",y,f):p("almostXYears",y+1,f)}},TP5S:function(t,e,n){"use strict";n.r(e);var i=n("hoI+"),r=n("lcPr"),a=n.n(r),o=(n("YQfW"),{components:{VueCropper:a.a,VueTimeago:i.a},props:["profile-id"],data:function(){return{loaded:!1,config:window.App.config,mimes:["image/jpeg","image/png"],page:"landing",pages:["landing","crop","edit","confirm","error","uploading"],uploading:!1,uploadProgress:0,cropper:{aspectRatio:9/16,viewMode:1,zoomable:!0,zoom:null},mediaUrl:null,stories:[],lightboxMedia:!1}},mounted:function(){var t=this;this.mediaWatcher(),axios.get("/api/stories/v0/fetch/"+this.profileId).then((function(e){t.stories=e.data,t.loaded=!0}))},methods:{upload:function(){$('.file-input[name="media"]').trigger("click")},mediaWatcher:function(){var t=this;$(document).on("change","#pf-dz",(function(e){t.triggerUpload()}))},triggerUpload:function(){var t=this;t.uploading=!0;var e=document.querySelector("#pf-dz");t.page="uploading",Array.prototype.forEach.call(e.files,(function(e,n){if(t.media&&t.media.length+n>=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/v0/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/v0/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(" "),t.loaded?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 py-4"},[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")]):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("div",{staticClass:"mr-3 cursor-pointer",on:{click:function(n){return t.showLightbox(e)}}},[n("img",{staticClass:"img-fluid",attrs:{src:e.src,width:"70px",height:"70px"}}),t._v(" "),n("p",{staticClass:"small text-muted text-center mb-0"},[t._v("(expand)")])]),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._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,"58bef23e",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,l=0,p=[],d=n("9tPo");function u(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=a[i.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](i.parts[o]);for(;o<i.parts.length;o++)r.parts.push(w(i.parts[o],e))}else{var s=[];for(o=0;o<i.parts.length;o++)s.push(w(i.parts[o],e));a[i.id]={id:i.id,refs:1,parts:s}}}}function f(t,e){for(var n=[],i={},r=0;r<t.length;r++){var a=t[r],o=e.base?a[0]+e.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};i[o]?i[o].parts.push(s):n.push(i[o]={id:o,parts:[s]})}return n}function m(t,e){var n=h(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=p[p.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),p.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=h(t.insertAt.before,n);n.insertBefore(e,r)}}function g(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=p.indexOf(t);e>=0&&p.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=l++;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<n.length;r++){var o=n[r];(s=a[o.id]).refs--,i.push(s)}t&&u(f(t,e),e);for(r=0;r<i.length;r++){var s;if(0===(s=i[r]).refs){for(var h=0;h<s.parts.length;h++)s.parts[h]();delete a[s.id]}}}};var y,x=(y=[],function(t,e){return y[t]=e,y.filter(Boolean).join("\n")});function C(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=x(e,r);else{var a=document.createTextNode(r),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(a,o[e]):t.appendChild(a)}}function M(t,e){var n=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function D(t,e,n){var i=n.css,r=n.sourceMap,a=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||a)&&(i=d(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([i],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}},"hoI+":function(t,e,n){"use strict";var i=n("YlT8"),r=n.n(i),a=function(t,e,n){var i=n.includeSeconds,a=n.addSuffix;return void 0===a&&(a=!0),r()(t,{locale:e,includeSeconds:i,addSuffix:a})};e.a=function(t,e){if(!t.prototype.$timeago){0;var n={locale:e.locale};t.prototype.$timeago=t.observable?t.observable(n):new t({data:n});var i=function(t){void 0===t&&(t={});var e=t.locales||{};return{name:t.name||"Timeago",props:{datetime:{required:!0},title:{type:[String,Boolean]},locale:{type:String},autoUpdate:{type:[Number,Boolean]},converter:{type:Function},converterOptions:{type:Object}},data:function(){return{timeago:this.getTimeago()}},computed:{localeName:function(){return this.locale||this.$timeago.locale}},mounted:function(){this.startUpdater()},beforeDestroy:function(){this.stopUpdater()},render:function(t){return t("time",{attrs:{datetime:new Date(this.datetime).toISOString(),title:"string"==typeof this.title?this.title:!1===this.title?null:this.timeago}},[this.timeago])},methods:{getTimeago:function(n){return(this.converter||t.converter||a)(n||this.datetime,e[this.locale||this.$timeago.locale],this.converterOptions||{})},convert:function(t){this.timeago=this.getTimeago(t)},startUpdater:function(){var t=this;if(this.autoUpdate){var e=!0===this.autoUpdate?60:this.autoUpdate;this.updater=setInterval((function(){t.convert()}),1e3*e)}},stopUpdater:function(){this.updater&&(clearInterval(this.updater),this.updater=null)}},watch:{autoUpdate:function(t){this.stopUpdater(),t&&this.startUpdater()},datetime:function(){this.convert()},localeName:function(){this.convert()},converter:function(){this.convert()},converterOptions:{handler:function(){this.convert()},deep:!0}}}}(e);t.component(i.name,i)}}},kOWh:function(t,e){var n=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];t.exports=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);var r=n.concat(e).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+r.join("|")+"|.)","g")}},lcPr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n("urRO"),a=(i=r)&&i.__esModule?i:{default:i};var o="undefined"==typeof window?[String,Array]:[String,Array,Element,NodeList];e.default={render:function(t){var e=this.crossorigin||void 0;return t("div",{style:this.containerStyle},[t("img",{ref:"img",attrs:{src:this.src,alt:this.alt||"image",style:"max-width: 100%",crossorigin:e},on:this.$listeners,style:this.imgStyle})])},props:{containerStyle:Object,src:{type:String,default:""},alt:String,imgStyle:Object,viewMode:Number,dragMode:String,initialAspectRatio:Number,aspectRatio:Number,data:Object,preview:o,responsive:{type:Boolean,default:!0},restore:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},crossorigin:{type:String},modal:{type:Boolean,default:!0},guides:{type:Boolean,default:!0},center:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},background:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!0},autoCropArea:Number,movable:{type:Boolean,default:!0},rotatable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0},zoomable:{type:Boolean,default:!0},zoomOnTouch:{type:Boolean,default:!0},zoomOnWheel:{type:Boolean,default:!0},wheelZoomRatio:Number,cropBoxMovable:{type:Boolean,default:!0},cropBoxResizable:{type:Boolean,default:!0},toggleDragModeOnDblclick:{type:Boolean,default:!0},minCanvasWidth:Number,minCanvasHeight:Number,minCropBoxWidth:Number,minCropBoxHeight:Number,minContainerWidth:Number,minContainerHeight:Number,ready:Function,cropstart:Function,cropmove:Function,cropend:Function,crop:Function,zoom:Function},mounted:function(){var t=this.$options.props,e=(t.containerStyle,t.src,t.alt,t.imgStyle,function(t,e){var n={};for(var i in t)e.indexOf(i)>=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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var h="undefined"!=typeof window&&void 0!==window.document,c=h?window:{},l=!(!h||!c.document.documentElement)&&"ontouchstart"in c.document.documentElement,p=!!h&&"PointerEvent"in c,d="".concat("cropper","-crop"),u="".concat("cropper","-disabled"),f="".concat("cropper","-hidden"),m="".concat("cropper","-hide"),g="".concat("cropper","-invisible"),v="".concat("cropper","-modal"),b="".concat("cropper","-move"),w="".concat("cropper","Action"),y="".concat("cropper","Preview"),x=l?"touchstart":"mousedown",C=l?"touchmove":"mousemove",M=l?"touchend touchcancel":"mouseup",D=p?"pointerdown":x,T=p?"pointermove":C,S=p?"pointerup pointercancel":M,B=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,A=/^data:/,O=/^data:image\/jpeg;base64,/,k=/^img|canvas$/i,_={viewMode:0,dragMode:"crop",initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},E=Number.isNaN||c.isNaN;function N(t){return"number"==typeof t&&!E(t)}var z=function(t){return t>0&&t<1/0};function W(t){return void 0===t}function R(e){return"object"===t(e)&&null!==e}var U=Object.prototype.hasOwnProperty;function H(t){if(!R(t))return!1;try{var e=t.constructor,n=e.prototype;return e&&n&&U.call(n,"isPrototypeOf")}catch(t){return!1}}function j(t){return"function"==typeof t}var L=Array.prototype.slice;function X(t){return Array.from?Array.from(t):L.call(t)}function Y(t,e){return t&&j(e)&&(Array.isArray(t)||N(t.length)?X(t).forEach((function(n,i){e.call(t,n,i,t)})):R(t)&&Object.keys(t).forEach((function(n){e.call(t,t[n],n,t)}))),t}var I=Object.assign||function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return R(t)&&n.length>0&&n.forEach((function(e){R(e)&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t},$=/\.\d*(?:0|9){12}\d*$/;function P(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return $.test(t)?Math.round(t*e)/e:t}var F=/^width|height|left|top|marginLeft|marginTop$/;function G(t,e){var n=t.style;Y(e,(function(t,e){F.test(e)&&N(t)&&(t="".concat(t,"px")),n[e]=t}))}function Z(t,e){if(e)if(N(t.length))Y(t,(function(t){Z(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 q(t,e){e&&(N(t.length)?Y(t,(function(t){q(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function V(t,e,n){e&&(N(t.length)?Y(t,(function(t){V(t,e,n)})):n?Z(t,e):q(t,e))}var J=/([a-z\d])([A-Z])/g;function Q(t){return t.replace(J,"$1-$2").toLowerCase()}function K(t,e){return R(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Q(e)))}function tt(t,e,n){R(n)?t[e]=n:t.dataset?t.dataset[e]=n:t.setAttribute("data-".concat(Q(e)),n)}var et=/\s\s*/,nt=function(){var t=!1;if(h){var e=!1,n=function(){},i=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});c.addEventListener("test",n,i),c.removeEventListener("test",n,i)}return t}();function it(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(et).forEach((function(e){if(!nt){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 rt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(et).forEach((function(e){if(i.once&&!nt){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;h<a;h++)s[h]=arguments[h];n.apply(t,s)},o[e]||(o[e]={}),o[e][n]&&t.removeEventListener(e,o[e][n],i),o[e][n]=r,t.listeners=o}t.addEventListener(e,r,i)}))}function at(t,e,n){var i;return j(Event)&&j(CustomEvent)?i=new CustomEvent(e,{detail:n,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n),t.dispatchEvent(i)}function ot(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var st=c.location,ht=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function ct(t){var e=t.match(ht);return null!==e&&(e[1]!==st.protocol||e[2]!==st.hostname||e[3]!==st.port)}function lt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function pt(t){var e=t.rotate,n=t.scaleX,i=t.scaleY,r=t.translateX,a=t.translateY,o=[];N(r)&&0!==r&&o.push("translateX(".concat(r,"px)")),N(a)&&0!==a&&o.push("translateY(".concat(a,"px)")),N(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),N(n)&&1!==n&&o.push("scaleX(".concat(n,")")),N(i)&&1!==i&&o.push("scaleY(".concat(i,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function dt(t,e){var n=t.pageX,i=t.pageY,r={endX:n,endY:i};return e?r:a({startX:n,startY:i},r)}function ut(t){var e=t.aspectRatio,n=t.height,i=t.width,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",a=z(i),o=z(n);if(a&&o){var s=n*e;"contain"===r&&s>i||"cover"===r&&s<i?n=i/e:i=n*e}else a?n=i/e:o&&(i=n*e);return{width:i,height:n}}function ft(t,e,n,i){var r=e.aspectRatio,a=e.naturalWidth,s=e.naturalHeight,h=e.rotate,c=void 0===h?0:h,l=e.scaleX,p=void 0===l?1:l,d=e.scaleY,u=void 0===d?1:d,f=n.aspectRatio,m=n.naturalWidth,g=n.naturalHeight,v=i.fillColor,b=void 0===v?"transparent":v,w=i.imageSmoothingEnabled,y=void 0===w||w,x=i.imageSmoothingQuality,C=void 0===x?"low":x,M=i.maxWidth,D=void 0===M?1/0:M,T=i.maxHeight,S=void 0===T?1/0:T,B=i.minWidth,A=void 0===B?0:B,O=i.minHeight,k=void 0===O?0:O,_=document.createElement("canvas"),E=_.getContext("2d"),N=ut({aspectRatio:f,width:D,height:S}),z=ut({aspectRatio:f,width:A,height:k},"cover"),W=Math.min(N.width,Math.max(z.width,m)),R=Math.min(N.height,Math.max(z.height,g)),U=ut({aspectRatio:r,width:D,height:S}),H=ut({aspectRatio:r,width:A,height:k},"cover"),j=Math.min(U.width,Math.max(H.width,a)),L=Math.min(U.height,Math.max(H.height,s)),X=[-j/2,-L/2,j,L];return _.width=P(W),_.height=P(R),E.fillStyle=b,E.fillRect(0,0,W,R),E.save(),E.translate(W/2,R/2),E.rotate(c*Math.PI/180),E.scale(p,u),E.imageSmoothingEnabled=y,E.imageSmoothingQuality=C,E.drawImage.apply(E,[t].concat(o(X.map((function(t){return Math.floor(P(t))}))))),E.restore(),_}var mt=String.fromCharCode,gt=/^data:.*,/;function vt(t){var e,n=new DataView(t);try{var i,r,a;if(255===n.getUint8(0)&&216===n.getUint8(1))for(var o=n.byteLength,s=2;s+1<o;){if(255===n.getUint8(s)&&225===n.getUint8(s+1)){r=s;break}s+=1}if(r){var h=r+10;if("Exif"===function(t,e,n){var i="";n+=e;for(var r=e;r<n;r+=1)i+=mt(t.getUint8(r));return i}(n,r+4,4)){var c=n.getUint16(h);if(((i=18761===c)||19789===c)&&42===n.getUint16(h+2,i)){var l=n.getUint32(h+4,i);l>=8&&(a=h+l)}}}if(a){var p,d,u=n.getUint16(a,i);for(d=0;d<u;d+=1)if(p=a+12*d+2,274===n.getUint16(p,i)){p+=8,e=n.getUint16(p,i),n.setUint16(p,1,i);break}}}catch(t){e=1}return e}var bt={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,n=this.container,i=this.cropper,r=Number(e.minContainerWidth),a=Number(e.minContainerHeight);Z(i,f),q(t,f);var o={width:Math.max(n.offsetWidth,r>=0?r:200),height:Math.max(n.offsetHeight,a>=0?a:100)};this.containerData=o,G(i,{width:o.width,height:o.height}),Z(t,f),q(i,f)},initCanvas:function(){var t=this.containerData,e=this.imageData,n=this.options.viewMode,i=Math.abs(e.rotate)%180==90,r=i?e.naturalHeight:e.naturalWidth,a=i?e.naturalWidth:e.naturalHeight,o=r/a,s=t.width,h=t.height;t.height*o>t.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};this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=I({},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,l=Number(n.minCanvasHeight)||0;o>1?(c=Math.max(c,i.width),l=Math.max(l,i.height),3===o&&(l*s>c?c=l*s:l=c/s)):o>0&&(c?c=Math.max(c,h?a.width:0):l?l=Math.max(l,h?a.height:0):h&&(c=a.width,(l=a.height)*s>c?c=l*s:l=c/s));var p=ut({aspectRatio:s,width:c,height:l});c=p.width,l=p.height,r.minWidth=c,r.minHeight=l,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.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,G(this.canvas,I({width:n.width,height:n.height},pt({translateX:n.left,translateY:n.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,n=this.imageData,i=n.naturalWidth*(e.width/e.naturalWidth),r=n.naturalHeight*(e.height/e.naturalHeight);I(n,{width:i,height:r,left:(e.width-i)/2,top:(e.height-r)/2}),G(this.image,I({width:n.width,height:n.height},pt(I({translateX:n.left,translateY:n.top},n)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,n=t.aspectRatio||t.initialAspectRatio,i=Number(t.autoCropArea)||.8,r={width:e.width,height:e.height};n&&(e.height*n>e.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=I({},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,l=o?Math.min(i.width,r.width,r.width+r.left,i.width-r.left):i.width,p=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),p*s>l?p=l/s:l=p*s),a.minWidth=Math.min(h,l),a.minHeight=Math.min(c,p),a.maxWidth=l,a.maxHeight=p}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.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,t.movable&&t.cropBoxMovable&&tt(this.face,w,n.width>=e.width&&n.height>=e.height?"move":"all"),G(this.cropBox,I({width:n.width,height:n.height},pt({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),at(this.element,"crop",this.getData())}},wt={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,Y(o,(function(t){var n=document.createElement("img");tt(t,y,{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(){Y(this.previews,(function(t){var e=K(t,y);G(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(R(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(Q(e)))}(t,y)}))},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&&(G(this.viewBoxImage,I({width:a,height:o},pt(I({translateX:-s,translateY:-h},t)))),Y(this.previews,(function(e){var n=K(e,y),c=n.width,l=n.height,p=c,d=l,u=1;i&&(d=r*(u=c/i)),r&&d>l&&(p=i*(u=l/r),d=l),G(e,{width:p,height:d}),G(e.getElementsByTagName("img")[0],I({width:a*u,height:o*u},pt(I({translateX:-s*u,translateY:-h*u},t))))})))}},yt={bind:function(){var t=this.element,e=this.options,n=this.cropper;j(e.cropstart)&&rt(t,"cropstart",e.cropstart),j(e.cropmove)&&rt(t,"cropmove",e.cropmove),j(e.cropend)&&rt(t,"cropend",e.cropend),j(e.crop)&&rt(t,"crop",e.crop),j(e.zoom)&&rt(t,"zoom",e.zoom),rt(n,D,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&rt(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&rt(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),rt(t.ownerDocument,T,this.onCropMove=this.cropMove.bind(this)),rt(t.ownerDocument,S,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&rt(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,n=this.cropper;j(e.cropstart)&&it(t,"cropstart",e.cropstart),j(e.cropmove)&&it(t,"cropmove",e.cropmove),j(e.cropend)&&it(t,"cropend",e.cropend),j(e.crop)&&it(t,"crop",e.crop),j(e.zoom)&&it(t,"zoom",e.zoom),it(n,D,this.onCropStart),e.zoomable&&e.zoomOnWheel&&it(n,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&it(n,"dblclick",this.onDblclick),it(t.ownerDocument,T,this.onCropMove),it(t.ownerDocument,S,this.onCropEnd),e.responsive&&it(window,"resize",this.onResize)}},xt={resize:function(){if(!this.disabled){var t,e,n=this.options,i=this.container,r=this.containerData,a=i.offsetWidth/r.width;1===a&&i.offsetHeight===r.height||(n.restore&&(t=this.getCanvasData(),e=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(Y(t,(function(e,n){t[n]=e*a}))),this.setCropBoxData(Y(e,(function(t,n){e[n]=t*a})))))}},dblclick:function(){var t,e;this.disabled||"none"===this.options.dragMode||this.setDragMode((t=this.dragBox,e=d,(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)&&(N(e)&&1!==e||N(n)&&0!==n||t.ctrlKey))){var i,r=this.options,a=this.pointers;t.changedTouches?Y(t.changedTouches,(function(t){a[t.identifier]=dt(t)})):a[t.pointerId||0]=dt(t),i=Object.keys(a).length>1&&r.zoomable&&r.zoomOnTouch?"zoom":K(t.target,w),B.test(i)&&!1!==at(this.element,"cropstart",{originalEvent:t,action:i})&&(t.preventDefault(),this.action=i,this.cropping=!1,"crop"===i&&(this.cropping=!0,Z(this.dragBox,v)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var n=this.pointers;t.preventDefault(),!1!==at(this.element,"cropmove",{originalEvent:t,action:e})&&(t.changedTouches?Y(t.changedTouches,(function(t){I(n[t.identifier]||{},dt(t,!0))})):I(n[t.pointerId||0]||{},dt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,n=this.pointers;t.changedTouches?Y(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,V(this.dragBox,v,this.cropped&&this.options.modal)),at(this.element,"cropend",{originalEvent:t,action:e}))}}},Ct={change:function(t){var e,n=this.options,i=this.canvasData,r=this.containerData,o=this.cropBoxData,s=this.pointers,h=this.action,c=n.aspectRatio,l=o.left,p=o.top,d=o.width,u=o.height,m=l+d,g=p+u,v=0,b=0,w=r.width,y=r.height,x=!0;!c&&t.shiftKey&&(c=d&&u?d/u:1),this.limited&&(v=o.minLeft,b=o.minTop,w=v+Math.min(r.width,i.width,i.left+i.width),y=b+Math.min(r.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":l+M.x<v&&(M.x=v-l);break;case"n":p+M.y<b&&(M.y=b-p);break;case"s":g+M.y>y&&(M.y=y-g)}};switch(h){case"all":l+=M.x,p+=M.y;break;case"e":if(M.x>=0&&(m>=w||c&&(p<=b||g>=y))){x=!1;break}D("e"),(d+=M.x)<0&&(h="w",l-=d=-d),c&&(u=d/c,p+=(o.height-u)/2);break;case"n":if(M.y<=0&&(p<=b||c&&(l<=v||m>=w))){x=!1;break}D("n"),u-=M.y,p+=M.y,u<0&&(h="s",p-=u=-u),c&&(d=u*c,l+=(o.width-d)/2);break;case"w":if(M.x<=0&&(l<=v||c&&(p<=b||g>=y))){x=!1;break}D("w"),d-=M.x,l+=M.x,d<0&&(h="e",l-=d=-d),c&&(u=d/c,p+=(o.height-u)/2);break;case"s":if(M.y>=0&&(g>=y||c&&(l<=v||m>=w))){x=!1;break}D("s"),(u+=M.y)<0&&(h="n",p-=u=-u),c&&(d=u*c,l+=(o.width-d)/2);break;case"ne":if(c){if(M.y<=0&&(p<=b||m>=w)){x=!1;break}D("n"),u-=M.y,p+=M.y,d=u*c}else D("n"),D("e"),M.x>=0?m<w?d+=M.x:M.y<=0&&p<=b&&(x=!1):d+=M.x,M.y<=0?p>b&&(u-=M.y,p+=M.y):(u-=M.y,p+=M.y);d<0&&u<0?(h="sw",p-=u=-u,l-=d=-d):d<0?(h="nw",l-=d=-d):u<0&&(h="se",p-=u=-u);break;case"nw":if(c){if(M.y<=0&&(p<=b||l<=v)){x=!1;break}D("n"),u-=M.y,p+=M.y,d=u*c,l+=o.width-d}else D("n"),D("w"),M.x<=0?l>v?(d-=M.x,l+=M.x):M.y<=0&&p<=b&&(x=!1):(d-=M.x,l+=M.x),M.y<=0?p>b&&(u-=M.y,p+=M.y):(u-=M.y,p+=M.y);d<0&&u<0?(h="se",p-=u=-u,l-=d=-d):d<0?(h="ne",l-=d=-d):u<0&&(h="sw",p-=u=-u);break;case"sw":if(c){if(M.x<=0&&(l<=v||g>=y)){x=!1;break}D("w"),d-=M.x,l+=M.x,u=d/c}else D("s"),D("w"),M.x<=0?l>v?(d-=M.x,l+=M.x):M.y>=0&&g>=y&&(x=!1):(d-=M.x,l+=M.x),M.y>=0?g<y&&(u+=M.y):u+=M.y;d<0&&u<0?(h="ne",p-=u=-u,l-=d=-d):d<0?(h="se",l-=d=-d):u<0&&(h="nw",p-=u=-u);break;case"se":if(c){if(M.x>=0&&(m>=w||g>=y)){x=!1;break}D("e"),u=(d+=M.x)/c}else D("s"),D("e"),M.x>=0?m<w?d+=M.x:M.y>=0&&g>=y&&(x=!1):d+=M.x,M.y>=0?g<y&&(u+=M.y):u+=M.y;d<0&&u<0?(h="nw",p-=u=-u,l-=d=-d):d<0?(h="sw",l-=d=-d):u<0&&(h="ne",p-=u=-u);break;case"move":this.move(M.x,M.y),x=!1;break;case"zoom":this.zoom(function(t){var e=a({},t),n=0;return Y(t,(function(t,i){delete e[i],Y(e,(function(e){var i=Math.abs(t.startX-e.startX),r=Math.abs(t.startY-e.startY),a=Math.abs(t.endX-e.endX),o=Math.abs(t.endY-e.endY),s=Math.sqrt(i*i+r*r),h=(Math.sqrt(a*a+o*o)-s)/s;Math.abs(h)>Math.abs(n)&&(n=h)}))})),n}(s),t),x=!1;break;case"crop":if(!M.x||!M.y){x=!1;break}e=ot(this.cropper),l=C.startX-e.left,p=C.startY-e.top,d=o.minWidth,u=o.minHeight,M.x>0?h=M.y>0?"se":"ne":M.x<0&&(l-=d,h=M.y>0?"sw":"nw"),M.y<0&&(p-=u),this.cropped||(q(this.cropBox,f),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}x&&(o.width=d,o.height=u,o.left=l,o.top=p,this.action=h,this.renderCropBox()),Y(s,(function(t){t.startX=t.endX,t.startY=t.endY}))}},Mt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Z(this.dragBox,v),q(this.cropBox,f),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=I({},this.initialImageData),this.canvasData=I({},this.initialCanvasData),this.cropBoxData=I({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(I(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),q(this.dragBox,v),Z(this.cropBox,f)),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,Y(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,q(this.cropper,u)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Z(this.cropper,u)),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(W(t)?t:i+Number(t),W(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&&(N(t)&&(n.left=t,i=!0),N(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,l=h*t;if(!1===at(this.element,"zoom",{ratio:t,oldRatio:a/s,originalEvent:n}))return this;if(n){var p=this.pointers,d=ot(this.cropper),u=p&&Object.keys(p).length?function(t){var e=0,n=0,i=0;return Y(t,(function(t){var r=t.startX,a=t.startY;e+=r,n+=a,i+=1})),{pageX:e/=i,pageY:n/=i}}(p):{pageX:n.pageX,pageY:n.pageY};r.left-=(c-a)*((u.pageX-d.left-r.left)/a),r.top-=(l-o)*((u.pageY-d.top-r.top)/o)}else H(e)&&N(e.x)&&N(e.y)?(r.left-=(c-a)*((e.x-r.left)/a),r.top-=(l-o)*((e.y-r.top)/o)):(r.left-=(c-a)/2,r.top-=(l-o)/2);r.width=c,r.height=l,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return N(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,N(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(N(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&&(N(t)&&(n.scaleX=t,i=!0),N(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(Y(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&&H(t)){var a=!1;e.rotatable&&N(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,a=!0),e.scalable&&(N(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,a=!0),N(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=n.width/n.naturalWidth;N(t.x)&&(r.left=t.x*o+i.left),N(t.y)&&(r.top=t.y*o+i.top),N(t.width)&&(r.width=t.width*o),N(t.height)&&(r.height=t.height*o),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?I({},this.containerData):{}},getImageData:function(){return this.sized?I({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&Y(["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&&H(t)&&(N(t.left)&&(e.left=t.left),N(t.top)&&(e.top=t.top),N(t.width)?(e.width=t.width,e.height=t.width/n):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&&H(t)&&(N(t.left)&&(i.left=t.left),N(t.top)&&(i.top=t.top),N(t.width)&&t.width!==i.width&&(e=!0,i.width=t.width),N(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=ft(this.image,this.imageData,e,t);if(!this.cropped)return n;var i=this.getData(),r=i.x,a=i.y,s=i.width,h=i.height,c=n.width/Math.floor(e.naturalWidth);1!==c&&(r*=c,a*=c,s*=c,h*=c);var l=s/h,p=ut({aspectRatio:l,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=ut({aspectRatio:l,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=ut({aspectRatio:l,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(p.width,Math.max(d.width,f)),m=Math.min(p.height,Math.max(d.height,m));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=P(f),g.height=P(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,S,B=n.width,A=n.height,O=r,k=a;O<=-s||O>B?(O=0,x=0,M=0,T=0):O<=0?(M=-O,O=0,T=x=Math.min(B,s+O)):O<=B&&(M=0,T=x=Math.min(s,B-O)),x<=0||k<=-h||k>A?(k=0,C=0,D=0,S=0):k<=0?(D=-k,k=0,S=C=Math.min(A,h+k)):k<=A&&(D=0,S=C=Math.min(h,A-k));var _=[O,k,x,C];if(T>0&&S>0){var E=f/s;_.push(M*E,D*E,T*E,S*E)}return v.drawImage.apply(v,[n].concat(o(_.map((function(t){return Math.floor(P(t))}))))),g},setAspectRatio:function(t){var e=this.options;return this.disabled||W(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,tt(n,w,t),V(n,d,r),V(n,b,a),e.cropBoxMovable||(tt(i,w,t),V(i,d,r),V(i,b,a))}return this}},Dt=c.Cropper,Tt=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e(this,t),!n||!k.test(n.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=n,this.options=I({},_,H(i)&&i),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 i,r,a;return i=t,a=[{key:"noConflict",value:function(){return window.Cropper=Dt,t}},{key:"setDefaults",value:function(t){I(_,H(t)&&t)}}],(r=[{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(A.test(t))O.test(t)?this.read((r=t.replace(gt,""),a=atob(r),o=new ArrayBuffer(a.length),Y(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&&ct(t)&&n.crossOrigin&&(t=lt(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=vt(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(mt.apply(null,X(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&&ct(e)&&(n||(n="anonymous"),i=lt(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),Z(r,m),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=c.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(c.navigator.userAgent),i=function(e,n){I(t.imageData,{naturalWidth:e,naturalHeight:n,aspectRatio:e/n}),t.initialImageData=I({},t.imageData),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='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';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),Z(t,f),i.insertBefore(a,t.nextSibling),this.isImg||q(n,m),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,Z(h,f),e.guides||Z(h.getElementsByClassName("".concat("cropper","-dashed")),f),e.center||Z(h.getElementsByClassName("".concat("cropper","-center")),f),e.background&&Z(a,"".concat("cropper","-bg")),e.highlight||Z(c,g),e.cropBoxMovable&&(Z(c,b),tt(c,w,"all")),e.cropBoxResizable||(Z(h.getElementsByClassName("".concat("cropper","-line")),f),Z(h.getElementsByClassName("".concat("cropper","-point")),f)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),j(e.ready)&&rt(t,"ready",e.ready,{once:!0}),at(t,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),q(this.element,f))}},{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()}}])&&n(i.prototype,r),a&&n(i,a),t}();return I(Tt.prototype,bt,wt,yt,xt,Ct,Mt),Tt}()},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:n<r?1:0}},yNUO:function(t,e,n){var i=n("VGX7"),r=n("pzWd"),a=/[T ]/,o=/:/,s=/^(\d{2})$/,h=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],c=/^(\d{4})/,l=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],p=/^-(\d{2})$/,d=/^-?(\d{3})$/,u=/^-?(\d{2})-?(\d{2})$/,f=/^-?W(\d{2})$/,m=/^-?W(\d{2})-?(\d{1})$/,g=/^(\d{2}([.,]\d*)?)$/,v=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,b=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,w=/([Z+-].*)$/,y=/^(Z)$/,x=/^([+-])(\d{2})$/,C=/^([+-])(\d{2}):?(\d{2})$/;function M(t,e,n){e=e||0,n=n||0;var i=new Date(0);i.setUTCFullYear(t,0,4);var r=7*e+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}t.exports=function(t,e){if(r(t))return new Date(t.getTime());if("string"!=typeof t)return new Date(t);var n=(e||{}).additionalDigits;n=null==n?2:Number(n);var D=function(t){var e,n={},i=t.split(a);o.test(i[0])?(n.date=null,e=i[0]):(n.date=i[0],e=i[1]);if(e){var r=w.exec(e);r?(n.time=e.replace(r[1],""),n.timezone=r[1]):n.time=e}return n}(t),T=function(t,e){var n,i=h[e],r=l[e];if(n=c.exec(t)||r.exec(t)){var a=n[1];return{year:parseInt(a,10),restDateString:t.slice(a.length)}}if(n=s.exec(t)||i.exec(t)){var o=n[1];return{year:100*parseInt(o,10),restDateString:t.slice(o.length)}}return{year:null}}(D.date,n),S=T.year,B=function(t,e){if(null===e)return null;var n,i,r,a;if(0===t.length)return(i=new Date(0)).setUTCFullYear(e),i;if(n=p.exec(t))return i=new Date(0),r=parseInt(n[1],10)-1,i.setUTCFullYear(e,r),i;if(n=d.exec(t)){i=new Date(0);var o=parseInt(n[1],10);return i.setUTCFullYear(e,0,o),i}if(n=u.exec(t)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return i.setUTCFullYear(e,r,s),i}if(n=f.exec(t))return a=parseInt(n[1],10)-1,M(e,a);if(n=m.exec(t)){a=parseInt(n[1],10)-1;var h=parseInt(n[2],10)-1;return M(e,a,h)}return null}(T.restDateString,S);if(B){var A,O=B.getTime(),k=0;if(D.time&&(k=function(t){var e,n,i;if(e=g.exec(t))return(n=parseFloat(e[1].replace(",",".")))%24*36e5;if(e=v.exec(t))return n=parseInt(e[1],10),i=parseFloat(e[2].replace(",",".")),n%24*36e5+6e4*i;if(e=b.exec(t)){n=parseInt(e[1],10),i=parseInt(e[2],10);var r=parseFloat(e[3].replace(",","."));return n%24*36e5+6e4*i+1e3*r}return null}(D.time)),D.timezone)A=6e4*function(t){var e,n;if(e=y.exec(t))return 0;if(e=x.exec(t))return n=60*parseInt(e[2],10),"+"===e[1]?-n:n;if(e=C.exec(t))return n=60*parseInt(e[2],10)+parseInt(e[3],10),"+"===e[1]?-n:n;return 0}(D.timezone);else{var _=O+k,E=new Date(_);A=i(E);var N=new Date(_);N.setDate(E.getDate()+1);var z=i(N)-i(E);z>0&&(A+=z)}return new Date(O+k+A)}return new Date(t)}}},[[20,0]]]); |