/
home
/
maktab
/
admin
/
js
/
File Upload :
llllll
Current File: /home/maktab/admin/js/chunk-914d4b14.c4eb763a.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-914d4b14","chunk-af6dcddc"],{"0235":function(t,e,i){},"0984":function(t,e,i){},2819:function(t,e,i){"use strict";var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex gap-1 w-full max-w-fit"},[e("ATooltip",[e("template",{slot:"title"},[t._v("\n نمایش جزئیات\n ")]),e("span",{on:{click:function(e){return t.$emit("view")}}},[e("Icon",{staticClass:"!text-[25px] cursor-pointer",attrs:{icon:"vuesax:clipboard-text-linear"}})],1)],2),t.hasEdit?e("ATooltip",{attrs:{placement:"bottom"}},[e("template",{slot:"title"},[t._v("\n ویرایش\n ")]),e("div",{on:{click:function(e){return t.$emit("edit")}}},[e("Icon",{class:"!text-[25px] cursor-pointer text-success",attrs:{icon:"vuesax:edit-linear"}})],1)],2):t._e(),t.hasDelete?e("ATooltip",{attrs:{placement:"bottom"}},[e("template",{slot:"title"},[t._v("\n حذف\n ")]),e("ConfirmBtn",{attrs:{title:"آیتم حذف شود؟",icon:"vuesax:trash-linear",iconClass:"!text-[25px] cursor-pointer text-danger"},on:{confirm:function(e){return t.$emit("delete")}}})],2):t._e(),t.hasActive?e("ATooltip",{attrs:{placement:"bottom"}},[e("template",{slot:"title"},[t._v("\n "+t._s("".concat(t.isActive(!t.record[t.activeKey])," کردن"))+"\n ")]),e("ConfirmBtn",{attrs:{title:"آیتم ".concat(t.isActive(!t.record[t.activeKey])," شود؟"),icon:t.record[t.activeKey]?"vuesax:tick-square-linear":"vuesax:close-square-linear",iconClass:"!text-[25px] cursor-pointer ".concat(t.record[t.activeKey]?"text-primary":"text-danger")},on:{confirm:function(e){return t.$emit("active")}}})],2):t._e(),t._t("default")],2)},n=[],r=i("947d"),o=i("dc19"),s={name:"RestFullActionSheet",components:{Icon:o["a"],ConfirmBtn:r["a"]},props:{record:Object,rowKey:String,hasActive:Boolean,hasEdit:Boolean,hasDelete:Boolean,activeKey:String},methods:{isActive:function(t){return t?"فعال":"غیر فعال"}}},c=s,h=i("2877"),l=Object(h["a"])(c,a,n,!1,null,"3f179bc8",null);e["a"]=l.exports},3355:function(t,e,i){"use strict";var a=function(){var t=this,e=t._self._c;return t.value?e("div",[e("div",{staticClass:"font-bold text-black text-xl"},[t._v("\n "+t._s(t.title)+":\n ")]),e("div",{staticClass:"mt-2"},[t._v("\n "+t._s(t.value)+"\n ")])]):t._e()},n=[],r={name:"InfoItem",props:{title:{required:!0},value:{required:!0}}},o=r,s=i("2877"),c=Object(s["a"])(o,a,n,!1,null,"4b848b84",null);e["a"]=c.exports},"402d":function(t,e,i){"use strict";var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"clearfix"},[e("AUpload",{attrs:{action:t.url,headers:t.headers,"list-type":"picture-card",multiple:!1,data:t.getData,"file-list":t.fileList,remove:t.handleRemove,"before-upload":t.handleBeforeUpload},on:{preview:t.handlePreview,select:t.select,change:t.handleChange}},[0==t.fileList.length?e("div",[e("a-icon",{attrs:{type:"plus"}}),e("div",{staticClass:"ant-upload-text"},[t._v("\n بارگذاری\n ")])],1):t._e()]),e("AModal",{attrs:{visible:t.previewVisible,footer:null},on:{cancel:t.handleCancel}},[e("img",{staticStyle:{width:"100%"},attrs:{alt:"example",src:t.previewImage}})]),t.srcImageCompressed?e("CropModal",{attrs:{imgBeforeCrop:t.srcImageCompressed},on:{cancel:t.closeCropModal,ok:t.handleOK}}):t._e()],1)},n=[],r=i("3835"),o=(i("96cf"),i("1da1")),s=(i("c5f6"),function(){var t=this,e=t._self._c;return e("a-modal",{attrs:{visible:!0,footer:null},on:{cancel:function(e){return t.$emit("cancel")}}},[e("a-spin",{attrs:{spinning:t.loading}},[e("div",{staticClass:"m-5 rounded"},[e("img",{ref:"image",staticClass:"mt-3 w-full",attrs:{alt:"example",src:t.imgBeforeCrop}})])]),e("div",{staticClass:"text-center w-full"},[e("a-button",{staticClass:"w-22",attrs:{type:"primary"},on:{click:t.request}},[t._v("تایید")])],1)],1)}),c=[],h=i("bb36"),l=i("bab4"),d=i.n(l),u=(i("6107"),{name:"CropModal",data:function(){return{loading:!1}},props:{imgBeforeCrop:{require:!0}},computed:{headers:function(){return{Authorization:"Bearer "+localStorage.getItem("accessToken")||!1}}},created:function(){var t=this;this.$nextTick((function(){var e=t;t.image=t.$refs.image,t.cropper=new d.a(t.image,{zoomable:!1,scalable:!1,aspectRatio:1,crop:function(){e.newCanvasData=this.cropper.getCroppedCanvas()}})}))},methods:{request:function(){var t=this;this.newCanvasData.toBlob(function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(i){var a,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=new FormData,a.append("file",i),a.append("has_thumb",1),a.append("has_watermark",0),a.append("subject",1),a.append("title",1),a.append("type",3),t.loading=!0,n=t,e.next=11,Object(h["b"])({method:"post",url:"".concat(h["a"],"site/file"),data:a,headers:t.headers}).then((function(t){200!==t.status&&201!==t.status||(n.$message.success("عملیات با موفقیت انجام شد"),n.$emit("ok",t.data)),n.loading=!1})).catch((function(t){n.$message.error("خطا در آپلود عکس")}));case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}}}),p=u,m=i("2877"),f=Object(m["a"])(p,s,c,!1,null,"52d1bc84",null),v=f.exports;i("988e");function g(t){return new Promise((function(e,i){var a=new FileReader;a.readAsDataURL(t),a.onload=function(){return e(a.result)},a.onerror=function(t){return i(t)}}))}var b={name:"UploadInput",components:{CropModal:v},props:{limit:{type:Number,required:!1,default:20}},data:function(){return{url:"".concat(h["a"],"site/file"),previewVisible:!1,previewImage:"",srcImageCompressed:void 0,fileList:[],fileListReserve:[],openModal:!1}},watch:{fileList:function(t,e){t.length>e.length?this.$emit("add-file",t):t.length<e.length&&this.$emit("remove-file",t)}},methods:{handleOK:function(t){this.$emit("ok",t),this.srcImageCompressed=void 0},closeCropModal:function(){this.srcImageCompressed=void 0,this.fileList=[]},handleRemove:function(t){this.$emit("remove",t),console.log("remove")},handleCancel:function(){this.previewVisible=!1},handlePreview:function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.url||e.preview){t.next=4;break}return t.next=3,g(e.originFileObj);case 3:e.preview=t.sent;case 4:this.previewImage=e.url||e.preview,this.previewVisible=!0;case 6:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),handleChange:function(t){var e=t.fileList,i=(t.event,t.file);"removed"!==i.status&&this.myCompressor(i),this.fileList=e},myCompressor:function(t){var e=320,i=320,a="image/jpeg",n=1,o=this,s=(document.getElementById("img-input"),URL.createObjectURL(t)),c=new Image;function h(t,e,i){var a=t.width,n=t.height;return a>n?a>e&&(n=Math.round(n*e/a),a=e):n>i&&(a=Math.round(a*i/n),n=i),[a,n]}c.src=s,c.onerror=function(){URL.revokeObjectURL(this.src),console.log("Cannot load image")},c.onload=function(){URL.revokeObjectURL(this.src);var s=h(c,e,i),l=Object(r["a"])(s,2),d=l[0],u=l[1],p=document.createElement("canvas");p.width=d,p.height=u;var m=p.getContext("2d");m.drawImage(c,0,0,d,u),p.toBlob((function(e){console.log("Original file",t),console.log("Compressed file",e);var i=window.URL||window.webkitURL,a=i.createObjectURL(e);o.$nextTick((function(){console.log("imageUrl ====>",a),o.srcImageCompressed=a}))}),a,n),console.log("ctx ====>",m)}},select:function(){},getData:function(){return{has_thumb:1,has_watermark:0,subject:1,title:1,type:3}},handleBeforeUpload:function(t){return!1}},computed:{headers:function(){return{Authorization:"Bearer "+localStorage.getItem("accessToken")||!1}}}},w=b,x=(i("51f9"),Object(m["a"])(w,a,n,!1,null,null,null));e["a"]=x.exports},"51f9":function(t,e,i){"use strict";i("0984")},6107:function(t,e,i){},"894d":function(t,e,i){"use strict";i("0235")},"947d":function(t,e,i){"use strict";var a=function(){var t=this,e=t._self._c;return e("APopconfirm",{attrs:{"ok-text":t.okText||"بله","cancel-text":t.cancelText||"خیر"},on:{confirm:function(e){return t.$emit("confirm")}}},[e("template",{slot:"title"},[t._v("\n "+t._s(t.title)+"\n ")]),e("Icon",{class:t.iconClass,attrs:{icon:t.icon}})],2)},n=[],r=i("dc19"),o={name:"TooltipBtn",components:{Icon:r["a"]},props:{icon:{type:String,required:!0},title:{type:String,required:!1},iconClass:{type:String,required:!1},okText:{type:String,required:!1},cancelText:{type:String,required:!1}}},s=o,c=i("2877"),h=Object(c["a"])(s,a,n,!1,null,"2ae9e054",null);e["a"]=h.exports},"988e":function(t,e){t.exports={imageResize:t=>{const e=t.file,i=t.maxSize,a=new FileReader;let n=new Image;const r=document.createElement("canvas"),o=function(t){const e=t.split(",")[0].indexOf("base64")>=0?atob(t.split(",")[1]):unescape(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],a=e.length,n=new Uint8Array(a);for(let r=0;r<a;r++)n[r]=e.charCodeAt(r);return new Blob([n],{type:i})},s=function(){let t=n.width,e=n.height;t>e?t>i&&(e*=i/t,t=i):e>i&&(t*=i/e,e=i),r.width=t,r.height=e,r.getContext("2d").drawImage(n,0,0,t,e);const a=r.toDataURL("image/jpeg");return o(a)};return new Promise((function(t,i){e.type.match(/image.*/)?(a.onload=function(e){n.onload=function(){return t(s())},n.src=e.target.result.toString()},a.readAsDataURL(e)):i(new Error("Not an image"))}))}}},a4cb:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t._self._c;return e("a-spin",{attrs:{spinning:t.loading},on:{submit:function(t){}}},[e("vx-card",{attrs:{title:"مشخصات پلینو"}},[e("a-tabs",{attrs:{animated:""},on:{change:function(e){t.isEdit=!1}},model:{value:t.infType,callback:function(e){t.infType=e},expression:"infType"}},[e("a-tab-pane",{key:2,attrs:{tab:"نظرات"}},[e("CommentsList")],1),e("a-tab-pane",{key:1,attrs:{tab:"اطلاعات محل کار"}},[t.isEdit?e("WorkInformationEdit",{on:{not_edit:function(e){t.isEdit=!1},refresh:t.loadProfileData,loading:t.setLoading},model:{value:t.personData,callback:function(e){t.personData=e},expression:"personData"}}):e("WorkInformationView",{on:{edit:function(e){t.isEdit=!0}},model:{value:t.personData,callback:function(e){t.personData=e},expression:"personData"}})],1),e("a-tab-pane",{key:0,attrs:{tab:"اطلاعات فردی"}},[t.isEdit?e("BaseInformationEdit",{on:{not_edit:function(e){t.isEdit=!1},refresh:t.loadProfileData,loading:t.setLoading},model:{value:t.personData,callback:function(e){t.personData=e},expression:"personData"}}):e("BaseInformationView",{on:{edit:function(e){t.isEdit=!0}},model:{value:t.personData,callback:function(e){t.personData=e},expression:"personData"}})],1)],1)],1)],1)},n=[],r=(i("96cf"),i("1da1")),o=i("bb36"),s=(i("7f7f"),function(){var t=this,e=t._self._c;return e("div",[t.value?e("div",{staticClass:"grid md:grid-cols-5 w-full relative"},[t.value.file?e("div",{staticStyle:{width:"10rem",height:"10rem"}},[e("img",{staticClass:"shadow-lg rounded-lg w-full object-fill",staticStyle:{width:"inherit",height:"inherit"},attrs:{src:t.value.file.full_src,alt:t.value.name}})]):t._e(),t.value?e("div",{staticClass:"grid grid-cols-1 md:grid-cols-4 gap-5 md:col-span-4 w-full mt-10 md:mt-0"},[e("InfoItem",{attrs:{title:"نام و نام خانوادگی",value:t.value.name}}),e("InfoItem",{attrs:{title:"شماره موبایل",value:t.value.mobile}}),e("InfoItem",{attrs:{title:"تاریخ تولد",value:t._f("jdateNoTime")(t.value.birthday)}}),e("InfoItem",{attrs:{title:"تحصیلات",value:t.value.education}}),e("InfoItem",{staticClass:"md:col-span-2",attrs:{title:"توضیحات",value:t.value.description}})],1):t._e()]):t._e(),e("a-button",{staticClass:"mt-12",attrs:{type:"primary"},on:{click:function(e){return t.$emit("edit")}}},[t._v(" صفحه ویرایش اطلاعات فردی")])],1)}),c=[],h=i("3355"),l={name:"BaseInformationView",components:{InfoItem:h["a"]},props:{value:{required:!0}}},d=l,u=i("2877"),p=Object(u["a"])(d,s,c,!1,null,"5520f655",null),m=p.exports,f=function(){var t=this,e=t._self._c;return e("div",[e("a-form",{attrs:{form:t.form},on:{submit:t.handleSubmit}},[e("div",{staticClass:"grid md:grid-cols-3 gap-5"},[e("a-form-item",{attrs:{label:"نام"}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:t.inputFa("fname"),expression:"inputFa('fname')"}]})],1),e("a-form-item",{attrs:{label:"نام خانوادگی"}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:t.inputFa("lname"),expression:"inputFa('lname')"}]})],1),e("a-form-item",{attrs:{label:"شماره همراه"}},[e("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:t.input("mobile"),expression:"input('mobile')"}],attrs:{type:"number"}})],1),e("a-form-item",{attrs:{label:"تاریخ تولد"}},[e("datepicker",{attrs:{id:"birthday","auto-submit":!0,"display-format":"jYYYY-jMM-jDD"},model:{value:t.models.birthday,callback:function(e){t.$set(t.models,"birthday",e)},expression:"models.birthday"}})],1),e("a-form-item",{attrs:{label:"تحصیلات"}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:t.inputFa("education"),expression:"inputFa('education')"}]})],1),e("a-form-item",{attrs:{label:"توضیحات"}},[e("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:t.input("description",!1),expression:"input('description',false)"}]})],1),e("a-form-item",{attrs:{label:"تصویر"}},[e("SingleImageCropUpload",{ref:"photo",on:{ok:t.picUploaded,remove:t.picRemove}})],1)],1),e("div",{staticClass:"flex gap-5",staticStyle:{"margin-top":"3em"}},[e("a-button",{attrs:{type:"primary","html-type":"submit"}},[t._v("\n ویرایش اطلاعات\n ")]),e("a-button",{on:{click:function(e){return t.$emit("not_edit")}}},[t._v("\n بازگشت\n ")])],1)])],1)},v=[],g=i("fe2f"),b=i("402d"),w=i("a632"),x=i.n(w),y=i("8855"),C={name:"BaseInformationEdit",data:function(){return{form:this.$form.createForm(this,{name:"coordinated"}),file_id:void 0,input:y["a"],inputFa:y["b"],models:{birthday:void 0,father_birthday:void 0,mother_birthday:void 0}}},props:{value:{}},computed:{id:function(){return this.$route.params.id}},methods:{handleSubmit:function(t){var e=this;t.preventDefault(),this.form.validateFields(function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(i,a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i){t.next=17;break}return e.models.birthday&&(a.birthday=e.models.birthday),t.prev=2,e.$emit("loading",!0),t.next=6,o["b"].put("/admin/pol/user/".concat(e.id),a);case 6:e.$message.success("ویرایش با موفقیت انجام شد"),e.$emit("not_edit"),e.$emit("refresh"),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](2),e.$message.error("خطا در ثبت اطلاعات");case 14:return t.prev=14,e.$emit("loading",!1),t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[2,11,14,17]])})));return function(e,i){return t.apply(this,arguments)}}())},picUploaded:function(t){this.file_id=t.id},picRemove:function(t){this.file_id=void 0},fetchData:function(){this.form.setFieldsValue(this.value),this.models.birthday=this.value.birthday;var t=this.value;this.$refs.photo.fileList.push({uid:t.file.id,status:"done",name:t.file.title,response:{id:t.file.id,image:t.file.full_src},url:t.file.full_src}),console.log(this.value)}},components:{SingleUploadInput:g["a"],datepicker:x.a,SingleImageCropUpload:b["a"]},mounted:function(){this.fetchData()}},k=C,M=Object(u["a"])(k,f,v,!1,null,"08aaee22",null),D=M.exports,_=function(){var t=this,e=t._self._c;return e("div",[t.value?e("div",{staticClass:"grid md:grid-cols-5 w-full relative"},[t.value.file_work?e("div",{staticStyle:{width:"10rem",height:"10rem"}},[e("img",{staticClass:"shadow-lg rounded-lg w-full object-fill",staticStyle:{width:"inherit",height:"inherit"},attrs:{src:t.value.file_work.full_src,alt:t.value.name}})]):t._e(),t.value?e("div",{staticClass:"grid grid-cols-1 md:grid-cols-3 gap-5 md:col-span-4 w-full mt-10 md:mt-0"},[e("InfoItem",{attrs:{title:"شغل",value:t.value.job}}),e("InfoItem",{attrs:{title:"عنوان محل کار",value:t.value.specialty}}),e("InfoItem",{attrs:{title:"تلفن محل کار",value:t.value.job_phone}}),e("InfoItem",{staticClass:"md:col-span-2",attrs:{title:"آدرس محل کار",value:t.value.job_address}})],1):t._e()]):t._e(),e("a-button",{staticClass:"mt-12",attrs:{type:"primary"},on:{click:function(e){return t.$emit("edit")}}},[t._v(" صفحه ویرایش اطلاعات محل کار")])],1)},B=[],I={name:"BaseInformationView",components:{InfoItem:h["a"]},props:{value:{required:!0}}},O=I,j=Object(u["a"])(O,_,B,!1,null,"3c449848",null),R=j.exports,T=function(){var t=this,e=t._self._c;return e("div",[e("a-form",{attrs:{form:t.form},on:{submit:t.handleSubmit}},[e("div",{staticClass:"grid md:grid-cols-3 gap-5"},[e("a-form-item",{attrs:{label:"شغل"}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:t.inputFa("job"),expression:"inputFa('job')"}]})],1),e("a-form-item",{attrs:{label:"شماره تلفن محل کار"}},[e("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:t.input("job_phone"),expression:"input('job_phone')"}],attrs:{type:"number"}})],1),e("a-form-item",{attrs:{label:"عنوان محل کار"}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:t.inputFa("specialty"),expression:"inputFa('specialty') "}]})],1),e("a-form-item",{staticClass:"md:col-span-2",attrs:{label:"آدرس محل کار"}},[e("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:t.input("job_address"),expression:"input('job_address')"}]})],1),e("a-form-item",{attrs:{label:"تصویر"}},[e("SingleUploadInput",{ref:"photo",on:{ok:t.picUploaded,remove:t.picRemove}})],1)],1),e("div",{staticClass:"flex gap-5",staticStyle:{"margin-top":"3em"}},[e("a-button",{attrs:{type:"primary","html-type":"submit"}},[t._v("\n ویرایش اطلاعات\n ")]),e("a-button",{on:{click:function(e){return t.$emit("not_edit")}}},[t._v("\n بازگشت\n ")])],1)])],1)},E=[],L={name:"BaseInformationEdit",data:function(){return{form:this.$form.createForm(this,{name:"coordinated"}),file_work_id:void 0,input:y["a"],inputFa:y["b"],models:{birthday:void 0,father_birthday:void 0,mother_birthday:void 0}}},props:{value:{}},computed:{id:function(){return this.$route.params.id}},methods:{handleSubmit:function(t){var e=this;t.preventDefault(),this.form.validateFields(function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(i,a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i){t.next=17;break}return e.file_work_id&&(a.file_work_id=e.file_work_id),t.prev=2,e.$emit("loading",!0),t.next=6,o["b"].put("/admin/pol/user/".concat(e.id),a);case 6:e.$message.success("ویرایش با موفقیت انجام شد"),e.$emit("not_edit"),e.$emit("refresh"),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](2),e.$message.error("خطا در ثبت اطلاعات");case 14:return t.prev=14,e.$emit("loading",!1),t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[2,11,14,17]])})));return function(e,i){return t.apply(this,arguments)}}())},picUploaded:function(t){this.file_work_id=t.id},picRemove:function(t){this.file_work_id=void 0},fetchData:function(){this.form.setFieldsValue(this.value),this.models.birthday=this.value.birthday;var t=this.value;this.$refs.photo.fileList.push({uid:t.file_work.id,status:"done",name:t.file_work.title,response:{id:t.file_work.id,image:t.file_work.full_src},url:t.file_work.full_src}),console.log(this.value)}},components:{SingleUploadInput:g["a"],datepicker:x.a},mounted:function(){this.fetchData()}},S=L,$=Object(u["a"])(S,T,E,!1,null,"31798548",null),N=$.exports,A=function(){var t=this,e=t._self._c;return e("div",[e("div",[e("XTable",{ref:"tbl",attrs:{model:t.cols},scopedSlots:t._u([{key:"operator",fn:function(i){var a=i.record;return[e("RestFullActionSheet",{attrs:{record:a,activeKey:"active","has-delete":!0,"has-active":!1,"has-edit":!1},on:{active:function(e){return t.toggleActive(a.id)},edit:function(e){return t.toEdit(a.id)},delete:function(e){return t.deleteItem(a.id)},view:function(e){return t.setInitialValue(a)}}},[a.caj?e("ATooltip",{attrs:{placement:"bottom"}},[e("template",{slot:"title"},[t._v("\n "+t._s("".concat(3===a.sts?"غیر فعال":"فعال"," کردن"))+"\n ")]),e("ConfirmBtn",{attrs:{title:"نظر ".concat(3===a.sts?"رد":"تایید"," شود؟"),icon:3===a.sts?"vuesax:tick-square-linear":"vuesax:close-square-linear",iconClass:"!text-[25px] cursor-pointer ".concat(3===a.sts?"text-success":"text-danger")},on:{confirm:function(e){return t.changeActivity(a.id,a.sts)}}})],2):t._e(),a.caj?e("ATooltip",{attrs:{placement:"bottom"}},[e("template",{slot:"title"},[t._v("\n پاسخ\n ")]),e("ConfirmBtn",{attrs:{title:"نظر پاسخ داده شود؟",icon:"vuesax:messages-linear",iconClass:"!text-[25px] cursor-pointer text-primary"},on:{confirm:function(e){return t.replyCommentItem(a.id,a.body)}}})],2):t._e()],1)]}}])})],1),e("a-modal",{attrs:{footer:null},model:{value:t.addModal,callback:function(e){t.addModal=e},expression:"addModal"}},[e("a-spin",{attrs:{spinning:t.loading},on:{submit:t.handleSubmit}},[e("a-form",{attrs:{form:t.form}},[e("InfoItem",{attrs:{value:t.last_text,title:"متن نظر"}}),t._v("\n "+t._s(t.last_text)+"\n\n "),e("a-form-item",{attrs:{label:"عنوان"}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["subject",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['subject', { rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }] }]"}]})],1),e("a-form-item",{attrs:{label:"متن نظر"}},[e("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["body",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['body', { rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }] }]"}],attrs:{rows:4}})],1),e("a-button",{staticStyle:{"margin-top":"3em"},attrs:{type:"primary","html-type":"submit"}},[t._v("\n ثبت\n ")])],1)],1)],1),t.initialValue?e("a-modal",{attrs:{footer:null},model:{value:t.view,callback:function(e){t.view=e},expression:"view"}},[e("div",{staticClass:"md:flex gap-5 pt-10"},[e("div",[e("a-descriptions",{attrs:{title:"اطلاعات",column:{xxl:3,md:2,xs:1}}},[e("a-descriptions-item",{attrs:{label:"شناسه"}},[t._v("\n "+t._s(t.initialValue.id||"-")+"\n ")]),e("a-descriptions-item",{attrs:{label:"نام و نام خانوادگی"}},[t._v("\n "+t._s(t.initialValue.name||"-")+"\n ")]),e("a-descriptions-item",{attrs:{label:"تاریخ"}},[t._v("\n "+t._s(t.initialValue.caj)+"\n ")]),e("a-descriptions-item",{attrs:{label:"متن نظر"}},[t._v("\n "+t._s(t.initialValue.body)+"\n ")])],1)],1)])]):t._e()],1)},W=[],H=i("e0d2"),z=new H["b"]("/admin/comment/table","لیست نظرات");z.add(new H["a"]("id","شناسه").filterText()),z.add(new H["a"]("owner.name","نام و نام خانوادگی").filterText()),z.add(new H["a"]("caj","تاریخ").filterDate()),z.add(new H["a"]("body","متن نظر").filterText()),z.add(new H["a"]("operator","عملیات").renderSlot("operator"));var U=z,Y=i("ff6e"),X=i("2819"),P=i("947d"),q={name:"list",components:{RestFullActionSheet:X["a"],XTable:Y["a"],ConfirmBtn:P["a"],InfoItem:h["a"]},data:function(){return{cols:null,initialValue:void 0,form:this.$form.createForm(this,{name:"coordinated"}),loading:!1,view:!1,addModal:!1,parent_id:void 0,last_text:void 0}},computed:{id:function(){return this.$route.params.id}},methods:{handleSubmit:function(t){var e=this;t.preventDefault(),this.form.validateFields(function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(i,a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.parent_id&&(a.parent_id=e.parent_id),e.id&&(a.pol_user_id=parseInt(e.id)),i){t.next=19;break}return t.prev=3,e.loading=!0,t.next=7,o["b"].post("/admin/comment",a);case 7:e.$message.success("پاسخ پیام با موفقیت ثبت شد"),e.parent_id=void 0,e.last_text=void 0,e.addModal=!1,t.next=16;break;case 13:t.prev=13,t.t0=t["catch"](3),e.$message.error("خطا در پاسخ نظر");case 16:return t.prev=16,e.loading=!1,t.finish(16);case 19:case"end":return t.stop()}}),t,null,[[3,13,16,19]])})));return function(e,i){return t.apply(this,arguments)}}())},changeActivity:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(e,i){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return console.log(e," ",i),t.prev=1,this.$refs.tbl.loading=!0,a={id:0},a.id=e,2===i?a.sts=3:3===i?(a.sts=2,a.reason_reject="نظر رد شد"):a.sts=3,t.next=8,o["b"].post("/admin/comment/sts",a);case 8:this.$refs.tbl.fetch(),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](1),console.log(t.t0);case 14:return t.prev=14,this.$refs.tbl.loading=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])})));function e(e,i){return t.apply(this,arguments)}return e}(),toggleActive:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.$refs.tbl.loading=!0,t.next=4,o["b"].get("/api/student/active/".concat(e));case 4:return this.$message.success("وضعیت کاربر با موفقیت تغیر کرد"),t.next=7,this.$refs.tbl.fetch();case 7:t.next=13;break;case 9:t.prev=9,t.t0=t["catch"](0),console.log(t.t0),this.$message.error("خطا در تعیین وضعیت");case 13:return t.prev=13,this.$refs.tbl.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,this,[[0,9,13,16]])})));function e(e){return t.apply(this,arguments)}return e}(),replyCommentItem:function(t,e){this.addModal=!0,this.parent_id=t,this.last_text=e},toEdit:function(t){var e=this.$router.resolve({path:"/students/info/health/edit",query:{stdid:this.id,editid:t}});window.open(e.href,"_blank").focus()},setInitialValue:function(t){this.initialValue=t,console.log(t),this.view=!0},deleteItem:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.$refs.tbl.loading=!0,t.next=4,o["b"].delete("/api/health/".concat(e));case 4:return t.next=6,this.$refs.tbl.fetch();case 6:this.$message.success("آیتم با موفقیت حذف شد"),t.next=13;break;case 9:t.prev=9,t.t0=t["catch"](0),this.$message.error("خطا در حذف آیتم"),console.log(t.t0);case 13:return t.prev=13,this.$refs.tbl.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,this,[[0,9,13,16]])})));function e(e){return t.apply(this,arguments)}return e}()},created:function(){this.cols=U}},F=q,V=Object(u["a"])(F,A,W,!1,null,"d4d23a12",null),K=V.exports,Q={name:"info-edit",data:function(){return{loading:!1,infType:0,isEdit:!1,personData:void 0}},components:{BaseInformationView:m,BaseInformationEdit:D,WorkInformationView:R,WorkInformationEdit:N,CommentsList:K},computed:{id:function(){return this.$route.params.id}},methods:{loadProfileData:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o["b"].get("/admin/pol/user/".concat(this.id));case 3:e=t.sent,i=e.data,this.personData=i,console.log(i),t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),console.log(t.t0);case 12:case"end":return t.stop()}}),t,this,[[0,9]])})));function e(){return t.apply(this,arguments)}return e}(),setLoading:function(t){this.loading=t}},created:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,this.loadProfileData();case 3:this.htab&&(this.infType=2),this.loading=!1;case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},Z=Q,J=Object(u["a"])(Z,a,n,!1,null,"3139a744",null);e["default"]=J.exports},bab4:function(t,e,i){ /*! * Cropper.js v1.6.2 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2024-04-21T07:43:05.335Z */ (function(e,i){t.exports=i()})(0,(function(){"use strict";function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,a)}return i}function e(e){for(var i=1;i<arguments.length;i++){var a=null!=arguments[i]?arguments[i]:{};i%2?t(Object(a),!0).forEach((function(t){c(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function i(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function a(t){var e=i(t,"string");return"symbol"==typeof e?e:e+""}function n(t){return n="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},n(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function s(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t,e,i){return e=a(e),e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function h(t){return l(t)||d(t)||u(t)||m()}function l(t){if(Array.isArray(t))return p(t)}function d(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t,e){if(t){if("string"===typeof t)return p(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f="undefined"!==typeof window&&"undefined"!==typeof window.document,v=f?window:{},g=!(!f||!v.document.documentElement)&&"ontouchstart"in v.document.documentElement,b=!!f&&"PointerEvent"in v,w="cropper",x="all",y="crop",C="move",k="zoom",M="e",D="w",_="s",B="n",I="ne",O="nw",j="se",R="sw",T="".concat(w,"-crop"),E="".concat(w,"-disabled"),L="".concat(w,"-hidden"),S="".concat(w,"-hide"),$="".concat(w,"-invisible"),N="".concat(w,"-modal"),A="".concat(w,"-move"),W="".concat(w,"Action"),H="".concat(w,"Preview"),z="crop",U="move",Y="none",X="crop",P="cropend",q="cropmove",F="cropstart",V="dblclick",K=g?"touchstart":"mousedown",Q=g?"touchmove":"mousemove",Z=g?"touchend touchcancel":"mouseup",J=b?"pointerdown":K,G=b?"pointermove":Q,tt=b?"pointerup pointercancel":Z,et="ready",it="resize",at="wheel",nt="zoom",rt="image/jpeg",ot=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,st=/^data:/,ct=/^data:image\/jpeg;base64,/,ht=/^img|canvas$/i,lt=200,dt=100,ut={viewMode:0,dragMode:z,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:lt,minContainerHeight:dt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},pt='<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>',mt=Number.isNaN||v.isNaN;function ft(t){return"number"===typeof t&&!mt(t)}var vt=function(t){return t>0&&t<1/0};function gt(t){return"undefined"===typeof t}function bt(t){return"object"===n(t)&&null!==t}var wt=Object.prototype.hasOwnProperty;function xt(t){if(!bt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&wt.call(i,"isPrototypeOf")}catch(a){return!1}}function yt(t){return"function"===typeof t}var Ct=Array.prototype.slice;function kt(t){return Array.from?Array.from(t):Ct.call(t)}function Mt(t,e){return t&&yt(e)&&(Array.isArray(t)||ft(t.length)?kt(t).forEach((function(i,a){e.call(t,i,a,t)})):bt(t)&&Object.keys(t).forEach((function(i){e.call(t,t[i],i,t)}))),t}var Dt=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),a=1;a<e;a++)i[a-1]=arguments[a];return bt(t)&&i.length>0&&i.forEach((function(e){bt(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},_t=/\.\d*(?:0|9){12}\d*$/;function Bt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return _t.test(t)?Math.round(t*e)/e:t}var It=/^width|height|left|top|marginLeft|marginTop$/;function Ot(t,e){var i=t.style;Mt(e,(function(t,e){It.test(e)&&ft(t)&&(t="".concat(t,"px")),i[e]=t}))}function jt(t,e){return t.classList?t.classList.contains(e):t.className.indexOf(e)>-1}function Rt(t,e){if(e)if(ft(t.length))Mt(t,(function(t){Rt(t,e)}));else if(t.classList)t.classList.add(e);else{var i=t.className.trim();i?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e}}function Tt(t,e){e&&(ft(t.length)?Mt(t,(function(t){Tt(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Et(t,e,i){e&&(ft(t.length)?Mt(t,(function(t){Et(t,e,i)})):i?Rt(t,e):Tt(t,e))}var Lt=/([a-z\d])([A-Z])/g;function St(t){return t.replace(Lt,"$1-$2").toLowerCase()}function $t(t,e){return bt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(St(e)))}function Nt(t,e,i){bt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(St(e)),i)}function At(t,e){if(bt(t[e]))try{delete t[e]}catch(i){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(i){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(St(e)))}var Wt=/\s\s*/,Ht=function(){var t=!1;if(f){var e=!1,i=function(){},a=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});v.addEventListener("test",i,a),v.removeEventListener("test",i,a)}return t}();function zt(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(Wt).forEach((function(e){if(!Ht){var r=t.listeners;r&&r[e]&&r[e][i]&&(n=r[e][i],delete r[e][i],0===Object.keys(r[e]).length&&delete r[e],0===Object.keys(r).length&&delete t.listeners)}t.removeEventListener(e,n,a)}))}function Ut(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;e.trim().split(Wt).forEach((function(e){if(a.once&&!Ht){var r=t.listeners,o=void 0===r?{}:r;n=function(){delete o[e][i],t.removeEventListener(e,n,a);for(var r=arguments.length,s=new Array(r),c=0;c<r;c++)s[c]=arguments[c];i.apply(t,s)},o[e]||(o[e]={}),o[e][i]&&t.removeEventListener(e,o[e][i],a),o[e][i]=n,t.listeners=o}t.addEventListener(e,n,a)}))}function Yt(t,e,i){var a;return yt(Event)&&yt(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent"),a.initCustomEvent(e,!0,!0,i)),t.dispatchEvent(a)}function Xt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Pt=v.location,qt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Ft(t){var e=t.match(qt);return null!==e&&(e[1]!==Pt.protocol||e[2]!==Pt.hostname||e[3]!==Pt.port)}function Vt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function Kt(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,r=t.translateY,o=[];ft(n)&&0!==n&&o.push("translateX(".concat(n,"px)")),ft(r)&&0!==r&&o.push("translateY(".concat(r,"px)")),ft(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),ft(i)&&1!==i&&o.push("scaleX(".concat(i,")")),ft(a)&&1!==a&&o.push("scaleY(".concat(a,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Qt(t){var i=e({},t),a=0;return Mt(t,(function(t,e){delete i[e],Mt(i,(function(e){var i=Math.abs(t.startX-e.startX),n=Math.abs(t.startY-e.startY),r=Math.abs(t.endX-e.endX),o=Math.abs(t.endY-e.endY),s=Math.sqrt(i*i+n*n),c=Math.sqrt(r*r+o*o),h=(c-s)/s;Math.abs(h)>Math.abs(a)&&(a=h)}))})),a}function Zt(t,i){var a=t.pageX,n=t.pageY,r={endX:a,endY:n};return i?r:e({startX:a,startY:n},r)}function Jt(t){var e=0,i=0,a=0;return Mt(t,(function(t){var n=t.startX,r=t.startY;e+=n,i+=r,a+=1})),e/=a,i/=a,{pageX:e,pageY:i}}function Gt(t){var e=t.aspectRatio,i=t.height,a=t.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",r=vt(a),o=vt(i);if(r&&o){var s=i*e;"contain"===n&&s>a||"cover"===n&&s<a?i=a/e:a=i*e}else r?i=a/e:o&&(a=i*e);return{width:a,height:i}}function te(t){var e=t.width,i=t.height,a=t.degree;if(a=Math.abs(a)%180,90===a)return{width:i,height:e};var n=a%90*Math.PI/180,r=Math.sin(n),o=Math.cos(n),s=e*o+i*r,c=e*r+i*o;return a>90?{width:c,height:s}:{width:s,height:c}}function ee(t,e,i,a){var n=e.aspectRatio,r=e.naturalWidth,o=e.naturalHeight,s=e.rotate,c=void 0===s?0:s,l=e.scaleX,d=void 0===l?1:l,u=e.scaleY,p=void 0===u?1:u,m=i.aspectRatio,f=i.naturalWidth,v=i.naturalHeight,g=a.fillColor,b=void 0===g?"transparent":g,w=a.imageSmoothingEnabled,x=void 0===w||w,y=a.imageSmoothingQuality,C=void 0===y?"low":y,k=a.maxWidth,M=void 0===k?1/0:k,D=a.maxHeight,_=void 0===D?1/0:D,B=a.minWidth,I=void 0===B?0:B,O=a.minHeight,j=void 0===O?0:O,R=document.createElement("canvas"),T=R.getContext("2d"),E=Gt({aspectRatio:m,width:M,height:_}),L=Gt({aspectRatio:m,width:I,height:j},"cover"),S=Math.min(E.width,Math.max(L.width,f)),$=Math.min(E.height,Math.max(L.height,v)),N=Gt({aspectRatio:n,width:M,height:_}),A=Gt({aspectRatio:n,width:I,height:j},"cover"),W=Math.min(N.width,Math.max(A.width,r)),H=Math.min(N.height,Math.max(A.height,o)),z=[-W/2,-H/2,W,H];return R.width=Bt(S),R.height=Bt($),T.fillStyle=b,T.fillRect(0,0,S,$),T.save(),T.translate(S/2,$/2),T.rotate(c*Math.PI/180),T.scale(d,p),T.imageSmoothingEnabled=x,T.imageSmoothingQuality=C,T.drawImage.apply(T,[t].concat(h(z.map((function(t){return Math.floor(Bt(t))}))))),T.restore(),R}var ie=String.fromCharCode;function ae(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=ie(t.getUint8(n));return a}var ne=/^data:.*,/;function re(t){var e=t.replace(ne,""),i=atob(e),a=new ArrayBuffer(i.length),n=new Uint8Array(a);return Mt(n,(function(t,e){n[e]=i.charCodeAt(e)})),a}function oe(t,e){var i=[],a=8192,n=new Uint8Array(t);while(n.length>0)i.push(ie.apply(null,kt(n.subarray(0,a)))),n=n.subarray(a);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}function se(t){var e,i=new DataView(t);try{var a,n,r;if(255===i.getUint8(0)&&216===i.getUint8(1)){var o=i.byteLength,s=2;while(s+1<o){if(255===i.getUint8(s)&&225===i.getUint8(s+1)){n=s;break}s+=1}}if(n){var c=n+4,h=n+10;if("Exif"===ae(i,c,4)){var l=i.getUint16(h);if(a=18761===l,(a||19789===l)&&42===i.getUint16(h+2,a)){var d=i.getUint32(h+4,a);d>=8&&(r=h+d)}}}if(r){var u,p,m=i.getUint16(r,a);for(p=0;p<m;p+=1)if(u=r+12*p+2,274===i.getUint16(u,a)){u+=8,e=i.getUint16(u,a),i.setUint16(u,1,a);break}}}catch(f){e=1}return e}function ce(t){var e=0,i=1,a=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:a=-1;break;case 5:e=90,a=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:i,scaleY:a}}var he={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,a=this.cropper,n=Number(e.minContainerWidth),r=Number(e.minContainerHeight);Rt(a,L),Tt(t,L);var o={width:Math.max(i.offsetWidth,n>=0?n:lt),height:Math.max(i.offsetHeight,r>=0?r:dt)};this.containerData=o,Ot(a,{width:o.width,height:o.height}),Rt(t,L),Tt(a,L)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,a=Math.abs(e.rotate)%180===90,n=a?e.naturalHeight:e.naturalWidth,r=a?e.naturalWidth:e.naturalHeight,o=n/r,s=t.width,c=t.height;t.height*o>t.width?3===i?s=t.height*o:c=t.width/o:3===i?c=t.width/o:s=t.height*o;var h={aspectRatio:o,naturalWidth:n,naturalHeight:r,width:s,height:c};this.canvasData=h,this.limited=1===i||2===i,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=Dt({},h)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,r=this.cropBoxData,o=i.viewMode,s=n.aspectRatio,c=this.cropped&&r;if(t){var h=Number(i.minCanvasWidth)||0,l=Number(i.minCanvasHeight)||0;o>1?(h=Math.max(h,a.width),l=Math.max(l,a.height),3===o&&(l*s>h?h=l*s:l=h/s)):o>0&&(h?h=Math.max(h,c?r.width:0):l?l=Math.max(l,c?r.height:0):c&&(h=r.width,l=r.height,l*s>h?h=l*s:l=h/s));var d=Gt({aspectRatio:s,width:h,height:l});h=d.width,l=d.height,n.minWidth=h,n.minHeight=l,n.maxWidth=1/0,n.maxHeight=1/0}if(e)if(o>(c?0:1)){var u=a.width-n.width,p=a.height-n.height;n.minLeft=Math.min(0,u),n.minTop=Math.min(0,p),n.maxLeft=Math.max(0,u),n.maxTop=Math.max(0,p),c&&this.limited&&(n.minLeft=Math.min(r.left,r.left+(r.width-n.width)),n.minTop=Math.min(r.top,r.top+(r.height-n.height)),n.maxLeft=r.left,n.maxTop=r.top,2===o&&(n.width>=a.width&&(n.minLeft=Math.min(0,u),n.maxLeft=Math.max(0,u)),n.height>=a.height&&(n.minTop=Math.min(0,p),n.maxTop=Math.max(0,p))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height},renderCanvas:function(t,e){var i=this.canvasData,a=this.imageData;if(e){var n=te({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),r=n.width,o=n.height,s=i.width*(r/i.naturalWidth),c=i.height*(o/i.naturalHeight);i.left-=(s-i.width)/2,i.top-=(c-i.height)/2,i.width=s,i.height=c,i.aspectRatio=r/o,i.naturalWidth=r,i.naturalHeight=o,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,Ot(this.canvas,Dt({width:i.width,height:i.height},Kt({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,a=i.naturalWidth*(e.width/e.naturalWidth),n=i.naturalHeight*(e.height/e.naturalHeight);Dt(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),Ot(this.image,Dt({width:i.width,height:i.height},Kt(Dt({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,a=Number(t.autoCropArea)||.8,n={width:e.width,height:e.height};i&&(e.height*i>e.width?n.height=n.width/i:n.width=n.height*i),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*a),n.height=Math.max(n.minHeight,n.height*a),n.left=e.left+(e.width-n.width)/2,n.top=e.top+(e.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=Dt({},n)},limitCropBox:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,r=this.cropBoxData,o=this.limited,s=i.aspectRatio;if(t){var c=Number(i.minCropBoxWidth)||0,h=Number(i.minCropBoxHeight)||0,l=o?Math.min(a.width,n.width,n.width+n.left,a.width-n.left):a.width,d=o?Math.min(a.height,n.height,n.height+n.top,a.height-n.top):a.height;c=Math.min(c,a.width),h=Math.min(h,a.height),s&&(c&&h?h*s>c?h=c/s:c=h*s:c?h=c/s:h&&(c=h*s),d*s>l?d=l/s:l=d*s),r.minWidth=Math.min(c,l),r.minHeight=Math.min(h,d),r.maxWidth=l,r.maxHeight=d}e&&(o?(r.minLeft=Math.max(0,n.left),r.minTop=Math.max(0,n.top),r.maxLeft=Math.min(a.width,n.left+n.width)-r.width,r.maxTop=Math.min(a.height,n.top+n.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=a.width-r.width,r.maxTop=a.height-r.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&Nt(this.face,W,i.width>=e.width&&i.height>=e.height?C:x),Ot(this.cropBox,Dt({width:i.width,height:i.height},Kt({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Yt(this.element,X,this.getData())}},le={initPreview:function(){var t=this.element,e=this.crossOrigin,i=this.options.preview,a=e?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",r=document.createElement("img");if(e&&(r.crossOrigin=e),r.src=a,r.alt=n,this.viewBox.appendChild(r),this.viewBoxImage=r,i){var o=i;"string"===typeof i?o=t.ownerDocument.querySelectorAll(i):i.querySelector&&(o=[i]),this.previews=o,Mt(o,(function(t){var i=document.createElement("img");Nt(t,H,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(i.crossOrigin=e),i.src=a,i.alt=n,i.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(i)}))}},resetPreview:function(){Mt(this.previews,(function(t){var e=$t(t,H);Ot(t,{width:e.width,height:e.height}),t.innerHTML=e.html,At(t,H)}))},preview:function(){var t=this.imageData,e=this.canvasData,i=this.cropBoxData,a=i.width,n=i.height,r=t.width,o=t.height,s=i.left-e.left-t.left,c=i.top-e.top-t.top;this.cropped&&!this.disabled&&(Ot(this.viewBoxImage,Dt({width:r,height:o},Kt(Dt({translateX:-s,translateY:-c},t)))),Mt(this.previews,(function(e){var i=$t(e,H),h=i.width,l=i.height,d=h,u=l,p=1;a&&(p=h/a,u=n*p),n&&u>l&&(p=l/n,d=a*p,u=l),Ot(e,{width:d,height:u}),Ot(e.getElementsByTagName("img")[0],Dt({width:r*p,height:o*p},Kt(Dt({translateX:-s*p,translateY:-c*p},t))))})))}},de={bind:function(){var t=this.element,e=this.options,i=this.cropper;yt(e.cropstart)&&Ut(t,F,e.cropstart),yt(e.cropmove)&&Ut(t,q,e.cropmove),yt(e.cropend)&&Ut(t,P,e.cropend),yt(e.crop)&&Ut(t,X,e.crop),yt(e.zoom)&&Ut(t,nt,e.zoom),Ut(i,J,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Ut(i,at,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Ut(i,V,this.onDblclick=this.dblclick.bind(this)),Ut(t.ownerDocument,G,this.onCropMove=this.cropMove.bind(this)),Ut(t.ownerDocument,tt,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Ut(window,it,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;yt(e.cropstart)&&zt(t,F,e.cropstart),yt(e.cropmove)&&zt(t,q,e.cropmove),yt(e.cropend)&&zt(t,P,e.cropend),yt(e.crop)&&zt(t,X,e.crop),yt(e.zoom)&&zt(t,nt,e.zoom),zt(i,J,this.onCropStart),e.zoomable&&e.zoomOnWheel&&zt(i,at,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&zt(i,V,this.onDblclick),zt(t.ownerDocument,G,this.onCropMove),zt(t.ownerDocument,tt,this.onCropEnd),e.responsive&&zt(window,it,this.onResize)}},ue={resize:function(){if(!this.disabled){var t,e,i=this.options,a=this.container,n=this.containerData,r=a.offsetWidth/n.width,o=a.offsetHeight/n.height,s=Math.abs(r-1)>Math.abs(o-1)?r:o;if(1!==s)i.restore&&(t=this.getCanvasData(),e=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(Mt(t,(function(e,i){t[i]=e*s}))),this.setCropBoxData(Mt(e,(function(t,i){e[i]=t*s}))))}},dblclick:function(){this.disabled||this.options.dragMode===Y||this.setDragMode(jt(this.dragBox,T)?U:z)},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?a=t.deltaY>0?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=t.detail>0?1:-1),this.zoom(-a*i,t)))},cropStart:function(t){var e=t.buttons,i=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(ft(e)&&1!==e||ft(i)&&0!==i||t.ctrlKey))){var a,n=this.options,r=this.pointers;t.changedTouches?Mt(t.changedTouches,(function(t){r[t.identifier]=Zt(t)})):r[t.pointerId||0]=Zt(t),a=Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?k:$t(t.target,W),ot.test(a)&&!1!==Yt(this.element,F,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,a===y&&(this.cropping=!0,Rt(this.dragBox,N)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==Yt(this.element,q,{originalEvent:t,action:e})&&(t.changedTouches?Mt(t.changedTouches,(function(t){Dt(i[t.identifier]||{},Zt(t,!0))})):Dt(i[t.pointerId||0]||{},Zt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?Mt(t.changedTouches,(function(t){delete i[t.identifier]})):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,Et(this.dragBox,N,this.cropped&&this.options.modal)),Yt(this.element,P,{originalEvent:t,action:e}))}}},pe={change:function(t){var e,i=this.options,a=this.canvasData,n=this.containerData,r=this.cropBoxData,o=this.pointers,s=this.action,c=i.aspectRatio,h=r.left,l=r.top,d=r.width,u=r.height,p=h+d,m=l+u,f=0,v=0,g=n.width,b=n.height,w=!0;!c&&t.shiftKey&&(c=d&&u?d/u:1),this.limited&&(f=r.minLeft,v=r.minTop,g=f+Math.min(n.width,a.width,a.left+a.width),b=v+Math.min(n.height,a.height,a.top+a.height));var T=o[Object.keys(o)[0]],E={x:T.endX-T.startX,y:T.endY-T.startY},S=function(t){switch(t){case M:p+E.x>g&&(E.x=g-p);break;case D:h+E.x<f&&(E.x=f-h);break;case B:l+E.y<v&&(E.y=v-l);break;case _:m+E.y>b&&(E.y=b-m);break}};switch(s){case x:h+=E.x,l+=E.y;break;case M:if(E.x>=0&&(p>=g||c&&(l<=v||m>=b))){w=!1;break}S(M),d+=E.x,d<0&&(s=D,d=-d,h-=d),c&&(u=d/c,l+=(r.height-u)/2);break;case B:if(E.y<=0&&(l<=v||c&&(h<=f||p>=g))){w=!1;break}S(B),u-=E.y,l+=E.y,u<0&&(s=_,u=-u,l-=u),c&&(d=u*c,h+=(r.width-d)/2);break;case D:if(E.x<=0&&(h<=f||c&&(l<=v||m>=b))){w=!1;break}S(D),d-=E.x,h+=E.x,d<0&&(s=M,d=-d,h-=d),c&&(u=d/c,l+=(r.height-u)/2);break;case _:if(E.y>=0&&(m>=b||c&&(h<=f||p>=g))){w=!1;break}S(_),u+=E.y,u<0&&(s=B,u=-u,l-=u),c&&(d=u*c,h+=(r.width-d)/2);break;case I:if(c){if(E.y<=0&&(l<=v||p>=g)){w=!1;break}S(B),u-=E.y,l+=E.y,d=u*c}else S(B),S(M),E.x>=0?p<g?d+=E.x:E.y<=0&&l<=v&&(w=!1):d+=E.x,E.y<=0?l>v&&(u-=E.y,l+=E.y):(u-=E.y,l+=E.y);d<0&&u<0?(s=R,u=-u,d=-d,l-=u,h-=d):d<0?(s=O,d=-d,h-=d):u<0&&(s=j,u=-u,l-=u);break;case O:if(c){if(E.y<=0&&(l<=v||h<=f)){w=!1;break}S(B),u-=E.y,l+=E.y,d=u*c,h+=r.width-d}else S(B),S(D),E.x<=0?h>f?(d-=E.x,h+=E.x):E.y<=0&&l<=v&&(w=!1):(d-=E.x,h+=E.x),E.y<=0?l>v&&(u-=E.y,l+=E.y):(u-=E.y,l+=E.y);d<0&&u<0?(s=j,u=-u,d=-d,l-=u,h-=d):d<0?(s=I,d=-d,h-=d):u<0&&(s=R,u=-u,l-=u);break;case R:if(c){if(E.x<=0&&(h<=f||m>=b)){w=!1;break}S(D),d-=E.x,h+=E.x,u=d/c}else S(_),S(D),E.x<=0?h>f?(d-=E.x,h+=E.x):E.y>=0&&m>=b&&(w=!1):(d-=E.x,h+=E.x),E.y>=0?m<b&&(u+=E.y):u+=E.y;d<0&&u<0?(s=I,u=-u,d=-d,l-=u,h-=d):d<0?(s=j,d=-d,h-=d):u<0&&(s=O,u=-u,l-=u);break;case j:if(c){if(E.x>=0&&(p>=g||m>=b)){w=!1;break}S(M),d+=E.x,u=d/c}else S(_),S(M),E.x>=0?p<g?d+=E.x:E.y>=0&&m>=b&&(w=!1):d+=E.x,E.y>=0?m<b&&(u+=E.y):u+=E.y;d<0&&u<0?(s=O,u=-u,d=-d,l-=u,h-=d):d<0?(s=R,d=-d,h-=d):u<0&&(s=I,u=-u,l-=u);break;case C:this.move(E.x,E.y),w=!1;break;case k:this.zoom(Qt(o),t),w=!1;break;case y:if(!E.x||!E.y){w=!1;break}e=Xt(this.cropper),h=T.startX-e.left,l=T.startY-e.top,d=r.minWidth,u=r.minHeight,E.x>0?s=E.y>0?j:I:E.x<0&&(h-=d,s=E.y>0?R:O),E.y<0&&(l-=u),this.cropped||(Tt(this.cropBox,L),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}w&&(r.width=d,r.height=u,r.left=h,r.top=l,this.action=s,this.renderCropBox()),Mt(o,(function(t){t.startX=t.endX,t.startY=t.endY}))}},me={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Rt(this.dragBox,N),Tt(this.cropBox,L),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Dt({},this.initialImageData),this.canvasData=Dt({},this.initialCanvasData),this.cropBoxData=Dt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Dt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Tt(this.dragBox,N),Rt(this.cropBox,L)),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,Mt(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,Tt(this.cropper,E)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Rt(this.cropper,E)),this},destroy:function(){var t=this.element;return t[w]?(t[w]=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,i=this.canvasData,a=i.left,n=i.top;return this.moveTo(gt(t)?t:a+Number(t),gt(e)?e:n+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(ft(t)&&(i.left=t,a=!0),ft(e)&&(i.top=e,a=!0),a&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=Number(t),t=t<0?1/(1-t):1+t,this.zoomTo(i.width*t/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var a=this.options,n=this.canvasData,r=n.width,o=n.height,s=n.naturalWidth,c=n.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&a.zoomable){var h=s*t,l=c*t;if(!1===Yt(this.element,nt,{ratio:t,oldRatio:r/s,originalEvent:i}))return this;if(i){var d=this.pointers,u=Xt(this.cropper),p=d&&Object.keys(d).length?Jt(d):{pageX:i.pageX,pageY:i.pageY};n.left-=(h-r)*((p.pageX-u.left-n.left)/r),n.top-=(l-o)*((p.pageY-u.top-n.top)/o)}else xt(e)&&ft(e.x)&&ft(e.y)?(n.left-=(h-r)*((e.x-n.left)/r),n.top-=(l-o)*((e.y-n.top)/o)):(n.left-=(h-r)/2,n.top-=(l-o)/2);n.width=h,n.height=l,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),ft(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,ft(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(ft(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(ft(t)&&(i.scaleX=t,a=!0),ft(e)&&(i.scaleY=e,a=!0),a&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,a=this.imageData,n=this.canvasData,r=this.cropBoxData;if(this.ready&&this.cropped){t={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height};var o=a.width/a.naturalWidth;if(Mt(t,(function(e,i){t[i]=e/o})),e){var s=Math.round(t.y+t.height),c=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=c-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return i.rotatable&&(t.rotate=a.rotate||0),i.scalable&&(t.scaleX=a.scaleX||1,t.scaleY=a.scaleY||1),t},setData:function(t){var e=this.options,i=this.imageData,a=this.canvasData,n={};if(this.ready&&!this.disabled&&xt(t)){var r=!1;e.rotatable&&ft(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,r=!0),e.scalable&&(ft(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,r=!0),ft(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,r=!0)),r&&this.renderCanvas(!0,!0);var o=i.width/i.naturalWidth;ft(t.x)&&(n.left=t.x*o+a.left),ft(t.y)&&(n.top=t.y*o+a.top),ft(t.width)&&(n.width=t.width*o),ft(t.height)&&(n.height=t.height*o),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?Dt({},this.containerData):{}},getImageData:function(){return this.sized?Dt({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&Mt(["left","top","width","height","naturalWidth","naturalHeight"],(function(i){e[i]=t[i]})),e},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&xt(t)&&(ft(t.left)&&(e.left=t.left),ft(t.top)&&(e.top=t.top),ft(t.width)?(e.width=t.width,e.height=t.width/i):ft(t.height)&&(e.height=t.height,e.width=t.height*i),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,i,a=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&xt(t)&&(ft(t.left)&&(a.left=t.left),ft(t.top)&&(a.top=t.top),ft(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),ft(t.height)&&t.height!==a.height&&(i=!0,a.height=t.height),n&&(e?a.height=a.width/n:i&&(a.width=a.height*n)),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,i=ee(this.image,this.imageData,e,t);if(!this.cropped)return i;var a=this.getData(t.rounded),n=a.x,r=a.y,o=a.width,s=a.height,c=i.width/Math.floor(e.naturalWidth);1!==c&&(n*=c,r*=c,o*=c,s*=c);var l=o/s,d=Gt({aspectRatio:l,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),u=Gt({aspectRatio:l,width:t.minWidth||0,height:t.minHeight||0},"cover"),p=Gt({aspectRatio:l,width:t.width||(1!==c?i.width:o),height:t.height||(1!==c?i.height:s)}),m=p.width,f=p.height;m=Math.min(d.width,Math.max(u.width,m)),f=Math.min(d.height,Math.max(u.height,f));var v=document.createElement("canvas"),g=v.getContext("2d");v.width=Bt(m),v.height=Bt(f),g.fillStyle=t.fillColor||"transparent",g.fillRect(0,0,m,f);var b=t.imageSmoothingEnabled,w=void 0===b||b,x=t.imageSmoothingQuality;g.imageSmoothingEnabled=w,x&&(g.imageSmoothingQuality=x);var y,C,k,M,D,_,B=i.width,I=i.height,O=n,j=r;O<=-o||O>B?(O=0,y=0,k=0,D=0):O<=0?(k=-O,O=0,y=Math.min(B,o+O),D=y):O<=B&&(k=0,y=Math.min(o,B-O),D=y),y<=0||j<=-s||j>I?(j=0,C=0,M=0,_=0):j<=0?(M=-j,j=0,C=Math.min(I,s+j),_=C):j<=I&&(M=0,C=Math.min(s,I-j),_=C);var R=[O,j,y,C];if(D>0&&_>0){var T=m/o;R.push(k*T,M*T,D*T,_*T)}return g.drawImage.apply(g,[i].concat(h(R.map((function(t){return Math.floor(Bt(t))}))))),v},setAspectRatio:function(t){var e=this.options;return this.disabled||gt(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,i=this.dragBox,a=this.face;if(this.ready&&!this.disabled){var n=t===z,r=e.movable&&t===U;t=n||r?t:Y,e.dragMode=t,Nt(i,W,t),Et(i,T,n),Et(i,A,r),e.cropBoxMovable||(Nt(a,W,t),Et(a,T,n),Et(a,A,r))}return this}},fe=v.Cropper,ve=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,t),!e||!ht.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Dt({},ut,xt(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()}return s(t,[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[w]){if(e[w]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var i=this.element,a=this.options;if(a.rotatable||a.scalable||(a.checkOrientation=!1),a.checkOrientation&&window.ArrayBuffer)if(st.test(t))ct.test(t)?this.read(re(t)):this.clone();else{var n=new XMLHttpRequest,r=this.clone.bind(this);this.reloading=!0,this.xhr=n,n.onabort=r,n.onerror=r,n.ontimeout=r,n.onprogress=function(){n.getResponseHeader("content-type")!==rt&&n.abort()},n.onload=function(){e.read(n.response)},n.onloadend=function(){e.reloading=!1,e.xhr=null},a.checkCrossOrigin&&Ft(t)&&i.crossOrigin&&(t=Vt(t)),n.open("GET",t,!0),n.responseType="arraybuffer",n.withCredentials="use-credentials"===i.crossOrigin,n.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=se(t),n=0,r=1,o=1;if(a>1){this.url=oe(t,rt);var s=ce(a);n=s.rotate,r=s.scaleX,o=s.scaleY}e.rotatable&&(i.rotate=n),e.scalable&&(i.scaleX=r,i.scaleY=o),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,a=e;this.options.checkCrossOrigin&&Ft(e)&&(i||(i="anonymous"),a=Vt(e)),this.crossOrigin=i,this.crossOriginUrl=a;var n=document.createElement("img");i&&(n.crossOrigin=i),n.src=a||e,n.alt=t.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),Rt(n,S),t.parentNode.insertBefore(n,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var i=v.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(v.navigator.userAgent),a=function(e,i){Dt(t.imageData,{naturalWidth:e,naturalHeight:i,aspectRatio:e/i}),t.initialImageData=Dt({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||i){var n=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){a(n.width,n.height),i||r.removeChild(n)},n.src=e.src,i||(n.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;",r.appendChild(n))}else a(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,i=this.image,a=t.parentNode,n=document.createElement("div");n.innerHTML=pt;var r=n.querySelector(".".concat(w,"-container")),o=r.querySelector(".".concat(w,"-canvas")),s=r.querySelector(".".concat(w,"-drag-box")),c=r.querySelector(".".concat(w,"-crop-box")),h=c.querySelector(".".concat(w,"-face"));this.container=a,this.cropper=r,this.canvas=o,this.dragBox=s,this.cropBox=c,this.viewBox=r.querySelector(".".concat(w,"-view-box")),this.face=h,o.appendChild(i),Rt(t,L),a.insertBefore(r,t.nextSibling),Tt(i,S),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,Rt(c,L),e.guides||Rt(c.getElementsByClassName("".concat(w,"-dashed")),L),e.center||Rt(c.getElementsByClassName("".concat(w,"-center")),L),e.background&&Rt(r,"".concat(w,"-bg")),e.highlight||Rt(h,$),e.cropBoxMovable&&(Rt(h,A),Nt(h,W,x)),e.cropBoxResizable||(Rt(c.getElementsByClassName("".concat(w,"-line")),L),Rt(c.getElementsByClassName("".concat(w,"-point")),L)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),yt(e.ready)&&Ut(t,et,e.ready,{once:!0}),Yt(t,et)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),Tt(this.element,L)}}},{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()}}],[{key:"noConflict",value:function(){return window.Cropper=fe,t}},{key:"setDefaults",value:function(t){Dt(ut,xt(t)&&t)}}])}();return Dt(ve.prototype,he,le,de,ue,pe,me),ve}))},fe2f:function(t,e,i){"use strict";var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"clearfix"},[e("AUpload",{attrs:{action:t.url,headers:t.headers,"list-type":"picture-card",multiple:!1,data:t.getData,"file-list":t.fileList,remove:t.handleRemove},on:{preview:t.handlePreview,select:t.select,change:t.handleChange}},[0===t.fileList.length?e("div",[e("a-icon",{attrs:{type:"plus"}}),e("div",{staticClass:"ant-upload-text"},[t._v("\n بارگذاری\n ")])],1):t._e()]),e("AModal",{attrs:{visible:t.previewVisible,footer:null},on:{cancel:t.handleCancel}},[e("img",{staticStyle:{width:"100%"},attrs:{alt:"example",src:t.previewImage}})])],1)},n=[],r=(i("96cf"),i("1da1")),o=(i("c5f6"),i("bb36"));function s(t){return new Promise((function(e,i){var a=new FileReader;a.readAsDataURL(t),a.onload=function(){return e(a.result)},a.onerror=function(t){return i(t)}}))}var c={name:"UploadInput",props:{limit:{type:Number,required:!1,default:20}},data:function(){return{url:o["a"]+"site/file",previewVisible:!1,previewImage:"",fileList:[]}},watch:{fileList:function(t,e){t.length>e.length?this.$emit("add-file",t):t.length<e.length&&this.$emit("remove-file",t)}},methods:{handleRemove:function(t){this.$emit("remove",t)},handleCancel:function(){this.previewVisible=!1},handlePreview:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.url||e.preview){t.next=4;break}return t.next=3,s(e.originFileObj);case 3:e.preview=t.sent;case 4:this.previewImage=e.url||e.preview,this.previewVisible=!0;case 6:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),handleChange:function(t){var e=t.fileList,i=(t.event,t.file);"done"===i.status&&i.response&&i.response.id&&this.$emit("ok",i.response),this.fileList=e},select:function(){},getData:function(){return{has_thumb:1,has_watermark:0,subject:1,title:1}}},computed:{headers:function(){return{Authorization:"Bearer "+localStorage.getItem("token")||!1}}}},h=c,l=(i("894d"),i("2877")),d=Object(l["a"])(h,a,n,!1,null,null,null);e["a"]=d.exports}}]); //# sourceMappingURL=chunk-914d4b14.c4eb763a.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure