@gingkoo/base-server 0.0.1-alpha.0 → 0.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/app.js +32 -40
- package/backend/common/entity.js +55 -0
- package/backend/common/enum.js +247 -0
- package/backend/common/fss/index.js +18 -0
- package/backend/common/fss/routers/attachment.js +45 -0
- package/backend/common/fss/routers/download.js +43 -0
- package/backend/common/fss/routers/import_export.js +113 -0
- package/backend/common/fss/routers/resources.js +149 -0
- package/backend/common/fss/routers/upload.js +81 -0
- package/backend/common/fss/services/import_export.js +159 -0
- package/backend/common/fss/services/index.js +92 -0
- package/backend/common/fss/utils.js +39 -0
- package/backend/common/ginfo/config.js +5 -0
- package/backend/common/ginfo/index.js +62 -0
- package/backend/common/index_template.html +28 -0
- package/backend/common/logger/index.js +96 -0
- package/backend/common/mapping.js +98 -0
- package/backend/common/middleware/auth.js +97 -0
- package/backend/common/middleware/cors.js +13 -0
- package/backend/common/middleware/response.js +25 -0
- package/backend/common/page_engine.js +487 -0
- package/backend/common/schedule.js +45 -0
- package/backend/common/services/dataCombine.js +67 -0
- package/backend/common/services/dept.js +37 -0
- package/backend/common/services/dict.js +487 -0
- package/backend/common/services/email.js +49 -0
- package/backend/common/services/generalConfig.js +137 -0
- package/backend/common/services/login.js +18 -0
- package/backend/common/services/notice.js +260 -0
- package/backend/common/services/permission.js +500 -0
- package/backend/common/services/roles.js +57 -0
- package/backend/common/services/send-notice.js +86 -0
- package/backend/common/services/task.js +259 -0
- package/backend/common/services/user.js +673 -0
- package/backend/common/socket.js +18 -0
- package/backend/common/sse/index.js +81 -0
- package/backend/common/sse/router.js +30 -0
- package/backend/common/task.js +75 -0
- package/backend/common/wechat/index.js +9 -0
- package/backend/common/wechat/routers/auth.js +238 -0
- package/{modules/user/frontend → backend/common/wechat/routers}/index.html +14 -7
- package/backend/common/wechat/services/auth.js +209 -0
- package/backend/common/wechat/services/notice.js +171 -0
- package/backend/config/index.js +63 -0
- package/backend/config/path.js +3 -0
- package/backend/router.js +96 -0
- package/backend/routers/app.js +222 -0
- package/backend/routers/automate.js +276 -0
- package/backend/routers/dict.js +370 -0
- package/backend/routers/email.js +85 -0
- package/backend/routers/generalConfig.js +276 -0
- package/backend/routers/idm.js +245 -0
- package/backend/routers/module.js +357 -0
- package/backend/routers/notice.js +138 -0
- package/backend/routers/pages.js +46 -0
- package/backend/routers/permission.js +985 -0
- package/backend/routers/setting.js +184 -0
- package/backend/routers/team/index.js +22 -0
- package/backend/routers/team/routers/mapping.js +29 -0
- package/backend/routers/team/routers/member.js +72 -0
- package/backend/routers/team/routers/membermanage.js +289 -0
- package/backend/routers/team/routers/pages.js +47 -0
- package/backend/routers/team/routers/roles.js +92 -0
- package/backend/routers/team/routers/teaminfo.js +27 -0
- package/backend/routers/team/routers/usergroup.js +213 -0
- package/backend/routers/team/services/mapping.js +101 -0
- package/backend/routers/team/services/member.js +206 -0
- package/backend/routers/team/services/roles.js +71 -0
- package/backend/routers/team/services/teaminfo.js +20 -0
- package/backend/routers/team/services/usergroup.js +128 -0
- package/backend/routers/user.js +436 -0
- package/backend/services/automate.js +60 -0
- package/backend/services/config.js +14 -0
- package/backend/services/module.js +298 -0
- package/backend/services/permission.js +192 -0
- package/backend/services/services.js +115 -0
- package/backend/services/setting.js +190 -0
- package/backend/services/token.js +42 -0
- package/backend/space.js +52 -0
- package/backend/space_mapping.js +15 -0
- package/backend/utils/avatar.js +48 -0
- package/backend/utils/color_gen_helper.js +20 -0
- package/backend/utils/date.js +66 -0
- package/backend/utils/excel.js +446 -0
- package/backend/utils/fs/doc.md +64 -0
- package/backend/utils/fs/index.js +127 -0
- package/backend/utils/jwt.js +54 -0
- package/backend/utils/modules/sequence.js +93 -0
- package/backend/utils/object.js +31 -0
- package/backend/utils/page-query-helper/index.js +61 -0
- package/backend/utils/path.js +123 -0
- package/backend/utils/run.js +25 -0
- package/backend/utils/tokenize.js +82 -0
- package/backend/utils/typeof.js +5 -0
- package/backend/utils/util.js +153 -0
- package/backend/views/api/index.js +32 -0
- package/backend/views/api/index.xml +49 -0
- package/backend/views/dict/index.js +80 -0
- package/backend/views/dict/index.xml +52 -0
- package/backend/views/index.js +32 -0
- package/backend/views/members_manage/index.js +68 -0
- package/backend/views/members_manage/index.xml +68 -0
- package/backend/views/roles/index.js +17 -0
- package/backend/views/roles/index.xml +47 -0
- package/backend/views/usergroup/index.js +68 -0
- package/backend/views/usergroup/index.xml +65 -0
- package/dist/assets/css/index-cc834b52.css +3 -0
- package/dist/assets/css/index-cc834b52.css.gz +0 -0
- package/dist/assets/js/index-9eef7474.js +762 -0
- package/dist/assets/js/index-9eef7474.js.gz +0 -0
- package/dist/assets/js/react-cropper.es-d3337769.js +10 -0
- package/dist/assets/js/react-cropper.es-d3337769.js.gz +0 -0
- package/dist/assets/png/u9-2348c304.png +0 -0
- package/dist/assets/woff2/materialicons-83be7b2f.woff2 +0 -0
- package/dist/index.html +162 -0
- package/package.json +60 -5
- package/common/router.js +0 -42
- package/modules/user/backend/index.js +0 -19
- package/modules/user/backend/routers/user.js +0 -11
- package/modules/user/frontend/index.js +0 -1
- package/serve.js +0 -9
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{e as Yt,r as rt,j as Xt}from"./index-9eef7474.js";/*!
|
|
2
|
+
* Cropper.js v1.6.1
|
|
3
|
+
* https://fengyuanchen.github.io/cropperjs
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2015-present Chen Fengyuan
|
|
6
|
+
* Released under the MIT license
|
|
7
|
+
*
|
|
8
|
+
* Date: 2023-09-17T03:44:19.860Z
|
|
9
|
+
*/function Ht(a,t){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(n){return Object.getOwnPropertyDescriptor(a,n).enumerable})),i.push.apply(i,e)}return i}function ae(a){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Ht(Object(i),!0).forEach(function(e){Ee(a,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)):Ht(Object(i)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(i,e))})}return a}function yt(a){return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(a)}function xe(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function Wt(a,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,ne(e.key),e)}}function De(a,t,i){return t&&Wt(a.prototype,t),i&&Wt(a,i),Object.defineProperty(a,"prototype",{writable:!1}),a}function Ee(a,t,i){return t=ne(t),t in a?Object.defineProperty(a,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[t]=i,a}function re(a){return Me(a)||Te(a)||Oe(a)||Ce()}function Me(a){if(Array.isArray(a))return xt(a)}function Te(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Oe(a,t){if(!!a){if(typeof a=="string")return xt(a,t);var i=Object.prototype.toString.call(a).slice(8,-1);if(i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set")return Array.from(a);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return xt(a,t)}}function xt(a,t){(t==null||t>a.length)&&(t=a.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=a[i];return e}function Ce(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
10
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(a,t){if(typeof a!="object"||a===null)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var e=i.call(a,t||"default");if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(a)}function ne(a){var t=Ne(a,"string");return typeof t=="symbol"?t:String(t)}var gt=typeof window<"u"&&typeof window.document<"u",W=gt?window:{},Rt=gt&&W.document.documentElement?"ontouchstart"in W.document.documentElement:!1,St=gt?"PointerEvent"in W:!1,D="cropper",It="all",oe="crop",se="move",he="zoom",q="e",F="w",J="s",U="n",nt="ne",ot="nw",st="se",ht="sw",Dt="".concat(D,"-crop"),jt="".concat(D,"-disabled"),z="".concat(D,"-hidden"),Ut="".concat(D,"-hide"),Ae="".concat(D,"-invisible"),pt="".concat(D,"-modal"),Et="".concat(D,"-move"),lt="".concat(D,"Action"),dt="".concat(D,"Preview"),Bt="crop",ce="move",le="none",Mt="crop",Tt="cropend",Ot="cropmove",Ct="cropstart",Vt="dblclick",Re=Rt?"touchstart":"mousedown",Se=Rt?"touchmove":"mousemove",Ie=Rt?"touchend touchcancel":"mouseup",Gt=St?"pointerdown":Re,$t=St?"pointermove":Se,qt=St?"pointerup pointercancel":Ie,Ft="ready",Zt="resize",Kt="wheel",Nt="zoom",Qt="image/jpeg",Be=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ze=/^data:/,Le=/^data:image\/jpeg;base64,/,ke=/^img|canvas$/i,fe=200,de=100,Jt={viewMode:0,dragMode:Bt,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:fe,minContainerHeight:de,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Pe='<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>',_e=Number.isNaN||W.isNaN;function b(a){return typeof a=="number"&&!_e(a)}var te=function(t){return t>0&&t<1/0};function vt(a){return typeof a>"u"}function K(a){return yt(a)==="object"&&a!==null}var Ye=Object.prototype.hasOwnProperty;function tt(a){if(!K(a))return!1;try{var t=a.constructor,i=t.prototype;return t&&i&&Ye.call(i,"isPrototypeOf")}catch{return!1}}function B(a){return typeof a=="function"}var Xe=Array.prototype.slice;function ue(a){return Array.from?Array.from(a):Xe.call(a)}function C(a,t){return a&&B(t)&&(Array.isArray(a)||b(a.length)?ue(a).forEach(function(i,e){t.call(a,i,e,a)}):K(a)&&Object.keys(a).forEach(function(i){t.call(a,a[i],i,a)})),a}var E=Object.assign||function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return K(t)&&e.length>0&&e.forEach(function(r){K(r)&&Object.keys(r).forEach(function(o){t[o]=r[o]})}),t},He=/\.\d*(?:0|9){12}\d*$/;function it(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return He.test(a)?Math.round(a*t)/t:a}var We=/^width|height|left|top|marginLeft|marginTop$/;function V(a,t){var i=a.style;C(t,function(e,n){We.test(n)&&b(e)&&(e="".concat(e,"px")),i[n]=e})}function je(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function A(a,t){if(!!t){if(b(a.length)){C(a,function(e){A(e,t)});return}if(a.classList){a.classList.add(t);return}var i=a.className.trim();i?i.indexOf(t)<0&&(a.className="".concat(i," ").concat(t)):a.className=t}}function H(a,t){if(!!t){if(b(a.length)){C(a,function(i){H(i,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function et(a,t,i){if(!!t){if(b(a.length)){C(a,function(e){et(e,t,i)});return}i?A(a,t):H(a,t)}}var Ue=/([a-z\d])([A-Z])/g;function zt(a){return a.replace(Ue,"$1-$2").toLowerCase()}function At(a,t){return K(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat(zt(t)))}function ft(a,t,i){K(i)?a[t]=i:a.dataset?a.dataset[t]=i:a.setAttribute("data-".concat(zt(t)),i)}function Ve(a,t){if(K(a[t]))try{delete a[t]}catch{a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch{a.dataset[t]=void 0}else a.removeAttribute("data-".concat(zt(t)))}var pe=/\s\s*/,ge=function(){var a=!1;if(gt){var t=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(r){t=r}});W.addEventListener("test",i,e),W.removeEventListener("test",i,e)}return a}();function P(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(pe).forEach(function(r){if(!ge){var o=a.listeners;o&&o[r]&&o[r][i]&&(n=o[r][i],delete o[r][i],Object.keys(o[r]).length===0&&delete o[r],Object.keys(o).length===0&&delete a.listeners)}a.removeEventListener(r,n,e)})}function k(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(pe).forEach(function(r){if(e.once&&!ge){var o=a.listeners,s=o===void 0?{}:o;n=function(){delete s[r][i],a.removeEventListener(r,n,e);for(var l=arguments.length,h=new Array(l),c=0;c<l;c++)h[c]=arguments[c];i.apply(a,h)},s[r]||(s[r]={}),s[r][i]&&a.removeEventListener(r,s[r][i],e),s[r][i]=n,a.listeners=s}a.addEventListener(r,n,e)})}function at(a,t,i){var e;return B(Event)&&B(CustomEvent)?e=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):(e=document.createEvent("CustomEvent"),e.initCustomEvent(t,!0,!0,i)),a.dispatchEvent(e)}function me(a){var t=a.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var bt=W.location,Ge=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function ee(a){var t=a.match(Ge);return t!==null&&(t[1]!==bt.protocol||t[2]!==bt.hostname||t[3]!==bt.port)}function ie(a){var t="timestamp=".concat(new Date().getTime());return a+(a.indexOf("?")===-1?"?":"&")+t}function ct(a){var t=a.rotate,i=a.scaleX,e=a.scaleY,n=a.translateX,r=a.translateY,o=[];b(n)&&n!==0&&o.push("translateX(".concat(n,"px)")),b(r)&&r!==0&&o.push("translateY(".concat(r,"px)")),b(t)&&t!==0&&o.push("rotate(".concat(t,"deg)")),b(i)&&i!==1&&o.push("scaleX(".concat(i,")")),b(e)&&e!==1&&o.push("scaleY(".concat(e,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function $e(a){var t=ae({},a),i=0;return C(a,function(e,n){delete t[n],C(t,function(r){var o=Math.abs(e.startX-r.startX),s=Math.abs(e.startY-r.startY),u=Math.abs(e.endX-r.endX),l=Math.abs(e.endY-r.endY),h=Math.sqrt(o*o+s*s),c=Math.sqrt(u*u+l*l),d=(c-h)/h;Math.abs(d)>Math.abs(i)&&(i=d)})}),i}function ut(a,t){var i=a.pageX,e=a.pageY,n={endX:i,endY:e};return t?n:ae({startX:i,startY:e},n)}function qe(a){var t=0,i=0,e=0;return C(a,function(n){var r=n.startX,o=n.startY;t+=r,i+=o,e+=1}),t/=e,i/=e,{pageX:t,pageY:i}}function G(a){var t=a.aspectRatio,i=a.height,e=a.width,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=te(e),o=te(i);if(r&&o){var s=i*t;n==="contain"&&s>e||n==="cover"&&s<e?i=e/t:e=i*t}else r?i=e/t:o&&(e=i*t);return{width:e,height:i}}function Fe(a){var t=a.width,i=a.height,e=a.degree;if(e=Math.abs(e)%180,e===90)return{width:i,height:t};var n=e%90*Math.PI/180,r=Math.sin(n),o=Math.cos(n),s=t*o+i*r,u=t*r+i*o;return e>90?{width:u,height:s}:{width:s,height:u}}function Ze(a,t,i,e){var n=t.aspectRatio,r=t.naturalWidth,o=t.naturalHeight,s=t.rotate,u=s===void 0?0:s,l=t.scaleX,h=l===void 0?1:l,c=t.scaleY,d=c===void 0?1:c,m=i.aspectRatio,g=i.naturalWidth,x=i.naturalHeight,w=e.fillColor,M=w===void 0?"transparent":w,O=e.imageSmoothingEnabled,T=O===void 0?!0:O,N=e.imageSmoothingQuality,I=N===void 0?"low":N,f=e.maxWidth,p=f===void 0?1/0:f,v=e.maxHeight,y=v===void 0?1/0:v,R=e.minWidth,j=R===void 0?0:R,_=e.minHeight,Y=_===void 0?0:_,L=document.createElement("canvas"),S=L.getContext("2d"),X=G({aspectRatio:m,width:p,height:y}),$=G({aspectRatio:m,width:j,height:Y},"cover"),Q=Math.min(X.width,Math.max($.width,g)),mt=Math.min(X.height,Math.max($.height,x)),Lt=G({aspectRatio:n,width:p,height:y}),kt=G({aspectRatio:n,width:j,height:Y},"cover"),Pt=Math.min(Lt.width,Math.max(kt.width,r)),_t=Math.min(Lt.height,Math.max(kt.height,o)),we=[-Pt/2,-_t/2,Pt,_t];return L.width=it(Q),L.height=it(mt),S.fillStyle=M,S.fillRect(0,0,Q,mt),S.save(),S.translate(Q/2,mt/2),S.rotate(u*Math.PI/180),S.scale(h,d),S.imageSmoothingEnabled=T,S.imageSmoothingQuality=I,S.drawImage.apply(S,[a].concat(re(we.map(function(ye){return Math.floor(it(ye))})))),S.restore(),L}var ve=String.fromCharCode;function Ke(a,t,i){var e="";i+=t;for(var n=t;n<i;n+=1)e+=ve(a.getUint8(n));return e}var Qe=/^data:.*,/;function Je(a){var t=a.replace(Qe,""),i=atob(t),e=new ArrayBuffer(i.length),n=new Uint8Array(e);return C(n,function(r,o){n[o]=i.charCodeAt(o)}),e}function ti(a,t){for(var i=[],e=8192,n=new Uint8Array(a);n.length>0;)i.push(ve.apply(null,ue(n.subarray(0,e)))),n=n.subarray(e);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function ei(a){var t=new DataView(a),i;try{var e,n,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var o=t.byteLength,s=2;s+1<o;){if(t.getUint8(s)===255&&t.getUint8(s+1)===225){n=s;break}s+=1}if(n){var u=n+4,l=n+10;if(Ke(t,u,4)==="Exif"){var h=t.getUint16(l);if(e=h===18761,(e||h===19789)&&t.getUint16(l+2,e)===42){var c=t.getUint32(l+4,e);c>=8&&(r=l+c)}}}if(r){var d=t.getUint16(r,e),m,g;for(g=0;g<d;g+=1)if(m=r+g*12+2,t.getUint16(m,e)===274){m+=8,i=t.getUint16(m,e),t.setUint16(m,1,e);break}}}catch{i=1}return i}function ii(a){var t=0,i=1,e=1;switch(a){case 2:i=-1;break;case 3:t=-180;break;case 4:e=-1;break;case 5:t=90,e=-1;break;case 6:t=90;break;case 7:t=90,i=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:i,scaleY:e}}var ai={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,i=this.options,e=this.container,n=this.cropper,r=Number(i.minContainerWidth),o=Number(i.minContainerHeight);A(n,z),H(t,z);var s={width:Math.max(e.offsetWidth,r>=0?r:fe),height:Math.max(e.offsetHeight,o>=0?o:de)};this.containerData=s,V(n,{width:s.width,height:s.height}),A(t,z),H(n,z)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,n=Math.abs(i.rotate)%180===90,r=n?i.naturalHeight:i.naturalWidth,o=n?i.naturalWidth:i.naturalHeight,s=r/o,u=t.width,l=t.height;t.height*s>t.width?e===3?u=t.height*s:l=t.width/s:e===3?l=t.width/s:u=t.height*s;var h={aspectRatio:s,naturalWidth:r,naturalHeight:o,width:u,height:l};this.canvasData=h,this.limited=e===1||e===2,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=E({},h)},limitCanvas:function(t,i){var e=this.options,n=this.containerData,r=this.canvasData,o=this.cropBoxData,s=e.viewMode,u=r.aspectRatio,l=this.cropped&&o;if(t){var h=Number(e.minCanvasWidth)||0,c=Number(e.minCanvasHeight)||0;s>1?(h=Math.max(h,n.width),c=Math.max(c,n.height),s===3&&(c*u>h?h=c*u:c=h/u)):s>0&&(h?h=Math.max(h,l?o.width:0):c?c=Math.max(c,l?o.height:0):l&&(h=o.width,c=o.height,c*u>h?h=c*u:c=h/u));var d=G({aspectRatio:u,width:h,height:c});h=d.width,c=d.height,r.minWidth=h,r.minHeight=c,r.maxWidth=1/0,r.maxHeight=1/0}if(i)if(s>(l?0:1)){var m=n.width-r.width,g=n.height-r.height;r.minLeft=Math.min(0,m),r.minTop=Math.min(0,g),r.maxLeft=Math.max(0,m),r.maxTop=Math.max(0,g),l&&this.limited&&(r.minLeft=Math.min(o.left,o.left+(o.width-r.width)),r.minTop=Math.min(o.top,o.top+(o.height-r.height)),r.maxLeft=o.left,r.maxTop=o.top,s===2&&(r.width>=n.width&&(r.minLeft=Math.min(0,m),r.maxLeft=Math.max(0,m)),r.height>=n.height&&(r.minTop=Math.min(0,g),r.maxTop=Math.max(0,g))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=n.width,r.maxTop=n.height},renderCanvas:function(t,i){var e=this.canvasData,n=this.imageData;if(i){var r=Fe({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),o=r.width,s=r.height,u=e.width*(o/e.naturalWidth),l=e.height*(s/e.naturalHeight);e.left-=(u-e.width)/2,e.top-=(l-e.height)/2,e.width=u,e.height=l,e.aspectRatio=o/s,e.naturalWidth=o,e.naturalHeight=s,this.limitCanvas(!0,!1)}(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCanvas(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,V(this.canvas,E({width:e.width,height:e.height},ct({translateX:e.left,translateY:e.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var i=this.canvasData,e=this.imageData,n=e.naturalWidth*(i.width/i.naturalWidth),r=e.naturalHeight*(i.height/i.naturalHeight);E(e,{width:n,height:r,left:(i.width-n)/2,top:(i.height-r)/2}),V(this.image,E({width:e.width,height:e.height},ct(E({translateX:e.left,translateY:e.top},e)))),t&&this.output()},initCropBox:function(){var t=this.options,i=this.canvasData,e=t.aspectRatio||t.initialAspectRatio,n=Number(t.autoCropArea)||.8,r={width:i.width,height:i.height};e&&(i.height*e>i.width?r.height=r.width/e:r.width=r.height*e),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*n),r.height=Math.max(r.minHeight,r.height*n),r.left=i.left+(i.width-r.width)/2,r.top=i.top+(i.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=E({},r)},limitCropBox:function(t,i){var e=this.options,n=this.containerData,r=this.canvasData,o=this.cropBoxData,s=this.limited,u=e.aspectRatio;if(t){var l=Number(e.minCropBoxWidth)||0,h=Number(e.minCropBoxHeight)||0,c=s?Math.min(n.width,r.width,r.width+r.left,n.width-r.left):n.width,d=s?Math.min(n.height,r.height,r.height+r.top,n.height-r.top):n.height;l=Math.min(l,n.width),h=Math.min(h,n.height),u&&(l&&h?h*u>l?h=l/u:l=h*u:l?h=l/u:h&&(l=h*u),d*u>c?d=c/u:c=d*u),o.minWidth=Math.min(l,c),o.minHeight=Math.min(h,d),o.maxWidth=c,o.maxHeight=d}i&&(s?(o.minLeft=Math.max(0,r.left),o.minTop=Math.max(0,r.top),o.maxLeft=Math.min(n.width,r.left+r.width)-o.width,o.maxTop=Math.min(n.height,r.top+r.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=n.width-o.width,o.maxTop=n.height-o.height))},renderCropBox:function(){var t=this.options,i=this.containerData,e=this.cropBoxData;(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCropBox(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,t.movable&&t.cropBoxMovable&&ft(this.face,lt,e.width>=i.width&&e.height>=i.height?se:It),V(this.cropBox,E({width:e.width,height:e.height},ct({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),at(this.element,Mt,this.getData())}},ri={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,n=i?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",o=document.createElement("img");if(i&&(o.crossOrigin=i),o.src=n,o.alt=r,this.viewBox.appendChild(o),this.viewBoxImage=o,!!e){var s=e;typeof e=="string"?s=t.ownerDocument.querySelectorAll(e):e.querySelector&&(s=[e]),this.previews=s,C(s,function(u){var l=document.createElement("img");ft(u,dt,{width:u.offsetWidth,height:u.offsetHeight,html:u.innerHTML}),i&&(l.crossOrigin=i),l.src=n,l.alt=r,l.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;"',u.innerHTML="",u.appendChild(l)})}},resetPreview:function(){C(this.previews,function(t){var i=At(t,dt);V(t,{width:i.width,height:i.height}),t.innerHTML=i.html,Ve(t,dt)})},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,n=e.width,r=e.height,o=t.width,s=t.height,u=e.left-i.left-t.left,l=e.top-i.top-t.top;!this.cropped||this.disabled||(V(this.viewBoxImage,E({width:o,height:s},ct(E({translateX:-u,translateY:-l},t)))),C(this.previews,function(h){var c=At(h,dt),d=c.width,m=c.height,g=d,x=m,w=1;n&&(w=d/n,x=r*w),r&&x>m&&(w=m/r,g=n*w,x=m),V(h,{width:g,height:x}),V(h.getElementsByTagName("img")[0],E({width:o*w,height:s*w},ct(E({translateX:-u*w,translateY:-l*w},t))))}))}},ni={bind:function(){var t=this.element,i=this.options,e=this.cropper;B(i.cropstart)&&k(t,Ct,i.cropstart),B(i.cropmove)&&k(t,Ot,i.cropmove),B(i.cropend)&&k(t,Tt,i.cropend),B(i.crop)&&k(t,Mt,i.crop),B(i.zoom)&&k(t,Nt,i.zoom),k(e,Gt,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&k(e,Kt,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&k(e,Vt,this.onDblclick=this.dblclick.bind(this)),k(t.ownerDocument,$t,this.onCropMove=this.cropMove.bind(this)),k(t.ownerDocument,qt,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&k(window,Zt,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;B(i.cropstart)&&P(t,Ct,i.cropstart),B(i.cropmove)&&P(t,Ot,i.cropmove),B(i.cropend)&&P(t,Tt,i.cropend),B(i.crop)&&P(t,Mt,i.crop),B(i.zoom)&&P(t,Nt,i.zoom),P(e,Gt,this.onCropStart),i.zoomable&&i.zoomOnWheel&&P(e,Kt,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&P(e,Vt,this.onDblclick),P(t.ownerDocument,$t,this.onCropMove),P(t.ownerDocument,qt,this.onCropEnd),i.responsive&&P(window,Zt,this.onResize)}},oi={resize:function(){if(!this.disabled){var t=this.options,i=this.container,e=this.containerData,n=i.offsetWidth/e.width,r=i.offsetHeight/e.height,o=Math.abs(n-1)>Math.abs(r-1)?n:r;if(o!==1){var s,u;t.restore&&(s=this.getCanvasData(),u=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(C(s,function(l,h){s[h]=l*o})),this.setCropBoxData(C(u,function(l,h){u[h]=l*o})))}}},dblclick:function(){this.disabled||this.options.dragMode===le||this.setDragMode(je(this.dragBox,Dt)?ce:Bt)},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*e,t)))},cropStart:function(t){var i=t.buttons,e=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(b(i)&&i!==1||b(e)&&e!==0||t.ctrlKey))){var n=this.options,r=this.pointers,o;t.changedTouches?C(t.changedTouches,function(s){r[s.identifier]=ut(s)}):r[t.pointerId||0]=ut(t),Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?o=he:o=At(t.target,lt),!!Be.test(o)&&at(this.element,Ct,{originalEvent:t,action:o})!==!1&&(t.preventDefault(),this.action=o,this.cropping=!1,o===oe&&(this.cropping=!0,A(this.dragBox,pt)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var e=this.pointers;t.preventDefault(),at(this.element,Ot,{originalEvent:t,action:i})!==!1&&(t.changedTouches?C(t.changedTouches,function(n){E(e[n.identifier]||{},ut(n,!0))}):E(e[t.pointerId||0]||{},ut(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?C(t.changedTouches,function(n){delete e[n.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,et(this.dragBox,pt,this.cropped&&this.options.modal)),at(this.element,Tt,{originalEvent:t,action:i}))}}},si={change:function(t){var i=this.options,e=this.canvasData,n=this.containerData,r=this.cropBoxData,o=this.pointers,s=this.action,u=i.aspectRatio,l=r.left,h=r.top,c=r.width,d=r.height,m=l+c,g=h+d,x=0,w=0,M=n.width,O=n.height,T=!0,N;!u&&t.shiftKey&&(u=c&&d?c/d:1),this.limited&&(x=r.minLeft,w=r.minTop,M=x+Math.min(n.width,e.width,e.left+e.width),O=w+Math.min(n.height,e.height,e.top+e.height));var I=o[Object.keys(o)[0]],f={x:I.endX-I.startX,y:I.endY-I.startY},p=function(y){switch(y){case q:m+f.x>M&&(f.x=M-m);break;case F:l+f.x<x&&(f.x=x-l);break;case U:h+f.y<w&&(f.y=w-h);break;case J:g+f.y>O&&(f.y=O-g);break}};switch(s){case It:l+=f.x,h+=f.y;break;case q:if(f.x>=0&&(m>=M||u&&(h<=w||g>=O))){T=!1;break}p(q),c+=f.x,c<0&&(s=F,c=-c,l-=c),u&&(d=c/u,h+=(r.height-d)/2);break;case U:if(f.y<=0&&(h<=w||u&&(l<=x||m>=M))){T=!1;break}p(U),d-=f.y,h+=f.y,d<0&&(s=J,d=-d,h-=d),u&&(c=d*u,l+=(r.width-c)/2);break;case F:if(f.x<=0&&(l<=x||u&&(h<=w||g>=O))){T=!1;break}p(F),c-=f.x,l+=f.x,c<0&&(s=q,c=-c,l-=c),u&&(d=c/u,h+=(r.height-d)/2);break;case J:if(f.y>=0&&(g>=O||u&&(l<=x||m>=M))){T=!1;break}p(J),d+=f.y,d<0&&(s=U,d=-d,h-=d),u&&(c=d*u,l+=(r.width-c)/2);break;case nt:if(u){if(f.y<=0&&(h<=w||m>=M)){T=!1;break}p(U),d-=f.y,h+=f.y,c=d*u}else p(U),p(q),f.x>=0?m<M?c+=f.x:f.y<=0&&h<=w&&(T=!1):c+=f.x,f.y<=0?h>w&&(d-=f.y,h+=f.y):(d-=f.y,h+=f.y);c<0&&d<0?(s=ht,d=-d,c=-c,h-=d,l-=c):c<0?(s=ot,c=-c,l-=c):d<0&&(s=st,d=-d,h-=d);break;case ot:if(u){if(f.y<=0&&(h<=w||l<=x)){T=!1;break}p(U),d-=f.y,h+=f.y,c=d*u,l+=r.width-c}else p(U),p(F),f.x<=0?l>x?(c-=f.x,l+=f.x):f.y<=0&&h<=w&&(T=!1):(c-=f.x,l+=f.x),f.y<=0?h>w&&(d-=f.y,h+=f.y):(d-=f.y,h+=f.y);c<0&&d<0?(s=st,d=-d,c=-c,h-=d,l-=c):c<0?(s=nt,c=-c,l-=c):d<0&&(s=ht,d=-d,h-=d);break;case ht:if(u){if(f.x<=0&&(l<=x||g>=O)){T=!1;break}p(F),c-=f.x,l+=f.x,d=c/u}else p(J),p(F),f.x<=0?l>x?(c-=f.x,l+=f.x):f.y>=0&&g>=O&&(T=!1):(c-=f.x,l+=f.x),f.y>=0?g<O&&(d+=f.y):d+=f.y;c<0&&d<0?(s=nt,d=-d,c=-c,h-=d,l-=c):c<0?(s=st,c=-c,l-=c):d<0&&(s=ot,d=-d,h-=d);break;case st:if(u){if(f.x>=0&&(m>=M||g>=O)){T=!1;break}p(q),c+=f.x,d=c/u}else p(J),p(q),f.x>=0?m<M?c+=f.x:f.y>=0&&g>=O&&(T=!1):c+=f.x,f.y>=0?g<O&&(d+=f.y):d+=f.y;c<0&&d<0?(s=ot,d=-d,c=-c,h-=d,l-=c):c<0?(s=ht,c=-c,l-=c):d<0&&(s=nt,d=-d,h-=d);break;case se:this.move(f.x,f.y),T=!1;break;case he:this.zoom($e(o),t),T=!1;break;case oe:if(!f.x||!f.y){T=!1;break}N=me(this.cropper),l=I.startX-N.left,h=I.startY-N.top,c=r.minWidth,d=r.minHeight,f.x>0?s=f.y>0?st:nt:f.x<0&&(l-=c,s=f.y>0?ht:ot),f.y<0&&(h-=d),this.cropped||(H(this.cropBox,z),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(r.width=c,r.height=d,r.left=l,r.top=h,this.action=s,this.renderCropBox()),C(o,function(v){v.startX=v.endX,v.startY=v.endY})}},hi={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&A(this.dragBox,pt),H(this.cropBox,z),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=E({},this.initialImageData),this.canvasData=E({},this.initialCanvasData),this.cropBoxData=E({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(E(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),H(this.dragBox,pt),A(this.cropBox,z)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,C(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,H(this.cropper,jt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,A(this.cropper,jt)),this},destroy:function(){var t=this.element;return t[D]?(t[D]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,n=e.left,r=e.top;return this.moveTo(vt(t)?t:n+Number(t),vt(i)?i:r+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(b(t)&&(e.left=t,n=!0),b(i)&&(e.top=i,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(e.width*t/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var n=this.options,r=this.canvasData,o=r.width,s=r.height,u=r.naturalWidth,l=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&n.zoomable){var h=u*t,c=l*t;if(at(this.element,Nt,{ratio:t,oldRatio:o/u,originalEvent:e})===!1)return this;if(e){var d=this.pointers,m=me(this.cropper),g=d&&Object.keys(d).length?qe(d):{pageX:e.pageX,pageY:e.pageY};r.left-=(h-o)*((g.pageX-m.left-r.left)/o),r.top-=(c-s)*((g.pageY-m.top-r.top)/s)}else tt(i)&&b(i.x)&&b(i.y)?(r.left-=(h-o)*((i.x-r.left)/o),r.top-=(c-s)*((i.y-r.top)/s)):(r.left-=(h-o)/2,r.top-=(c-s)/2);r.width=h,r.height=c,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),b(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,b(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(b(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.imageData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(b(t)&&(e.scaleX=t,n=!0),b(i)&&(e.scaleY=i,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,e=this.imageData,n=this.canvasData,r=this.cropBoxData,o;if(this.ready&&this.cropped){o={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height};var s=e.width/e.naturalWidth;if(C(o,function(h,c){o[c]=h/s}),t){var u=Math.round(o.y+o.height),l=Math.round(o.x+o.width);o.x=Math.round(o.x),o.y=Math.round(o.y),o.width=l-o.x,o.height=u-o.y}}else o={x:0,y:0,width:0,height:0};return i.rotatable&&(o.rotate=e.rotate||0),i.scalable&&(o.scaleX=e.scaleX||1,o.scaleY=e.scaleY||1),o},setData:function(t){var i=this.options,e=this.imageData,n=this.canvasData,r={};if(this.ready&&!this.disabled&&tt(t)){var o=!1;i.rotatable&&b(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,o=!0),i.scalable&&(b(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,o=!0),b(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var s=e.width/e.naturalWidth;b(t.x)&&(r.left=t.x*s+n.left),b(t.y)&&(r.top=t.y*s+n.top),b(t.width)&&(r.width=t.width*s),b(t.height)&&(r.height=t.height*s),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?E({},this.containerData):{}},getImageData:function(){return this.sized?E({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&C(["left","top","width","height","naturalWidth","naturalHeight"],function(e){i[e]=t[e]}),i},setCanvasData:function(t){var i=this.canvasData,e=i.aspectRatio;return this.ready&&!this.disabled&&tt(t)&&(b(t.left)&&(i.left=t.left),b(t.top)&&(i.top=t.top),b(t.width)?(i.width=t.width,i.height=t.width/e):b(t.height)&&(i.height=t.height,i.width=t.height*e),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,e=this.options.aspectRatio,n,r;return this.ready&&this.cropped&&!this.disabled&&tt(t)&&(b(t.left)&&(i.left=t.left),b(t.top)&&(i.top=t.top),b(t.width)&&t.width!==i.width&&(n=!0,i.width=t.width),b(t.height)&&t.height!==i.height&&(r=!0,i.height=t.height),e&&(n?i.height=i.width/e:r&&(i.width=i.height*e)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,e=Ze(this.image,this.imageData,i,t);if(!this.cropped)return e;var n=this.getData(t.rounded),r=n.x,o=n.y,s=n.width,u=n.height,l=e.width/Math.floor(i.naturalWidth);l!==1&&(r*=l,o*=l,s*=l,u*=l);var h=s/u,c=G({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=G({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),m=G({aspectRatio:h,width:t.width||(l!==1?e.width:s),height:t.height||(l!==1?e.height:u)}),g=m.width,x=m.height;g=Math.min(c.width,Math.max(d.width,g)),x=Math.min(c.height,Math.max(d.height,x));var w=document.createElement("canvas"),M=w.getContext("2d");w.width=it(g),w.height=it(x),M.fillStyle=t.fillColor||"transparent",M.fillRect(0,0,g,x);var O=t.imageSmoothingEnabled,T=O===void 0?!0:O,N=t.imageSmoothingQuality;M.imageSmoothingEnabled=T,N&&(M.imageSmoothingQuality=N);var I=e.width,f=e.height,p=r,v=o,y,R,j,_,Y,L;p<=-s||p>I?(p=0,y=0,j=0,Y=0):p<=0?(j=-p,p=0,y=Math.min(I,s+p),Y=y):p<=I&&(j=0,y=Math.min(s,I-p),Y=y),y<=0||v<=-u||v>f?(v=0,R=0,_=0,L=0):v<=0?(_=-v,v=0,R=Math.min(f,u+v),L=R):v<=f&&(_=0,R=Math.min(u,f-v),L=R);var S=[p,v,y,R];if(Y>0&&L>0){var X=g/s;S.push(j*X,_*X,Y*X,L*X)}return M.drawImage.apply(M,[e].concat(re(S.map(function($){return Math.floor(it($))})))),w},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!vt(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,e=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var r=t===Bt,o=i.movable&&t===ce;t=r||o?t:le,i.dragMode=t,ft(e,lt,t),et(e,Dt,r),et(e,Et,o),i.cropBoxMovable||(ft(n,lt,t),et(n,Dt,r),et(n,Et,o))}return this}},ci=W.Cropper,be=function(){function a(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(xe(this,a),!t||!ke.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=E({},Jt,tt(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 De(a,[{key:"init",value:function(){var i=this.element,e=i.tagName.toLowerCase(),n;if(!i[D]){if(i[D]=this,e==="img"){if(this.isImg=!0,n=i.getAttribute("src")||"",this.originalUrl=n,!n)return;n=i.src}else e==="canvas"&&window.HTMLCanvasElement&&(n=i.toDataURL());this.load(n)}}},{key:"load",value:function(i){var e=this;if(!!i){this.url=i,this.imageData={};var n=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(ze.test(i)){Le.test(i)?this.read(Je(i)):this.clone();return}var o=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=o,o.onabort=s,o.onerror=s,o.ontimeout=s,o.onprogress=function(){o.getResponseHeader("content-type")!==Qt&&o.abort()},o.onload=function(){e.read(o.response)},o.onloadend=function(){e.reloading=!1,e.xhr=null},r.checkCrossOrigin&&ee(i)&&n.crossOrigin&&(i=ie(i)),o.open("GET",i,!0),o.responseType="arraybuffer",o.withCredentials=n.crossOrigin==="use-credentials",o.send()}}},{key:"read",value:function(i){var e=this.options,n=this.imageData,r=ei(i),o=0,s=1,u=1;if(r>1){this.url=ti(i,Qt);var l=ii(r);o=l.rotate,s=l.scaleX,u=l.scaleY}e.rotatable&&(n.rotate=o),e.scalable&&(n.scaleX=s,n.scaleY=u),this.clone()}},{key:"clone",value:function(){var i=this.element,e=this.url,n=i.crossOrigin,r=e;this.options.checkCrossOrigin&&ee(e)&&(n||(n="anonymous"),r=ie(e)),this.crossOrigin=n,this.crossOriginUrl=r;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=r||e,o.alt=i.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),A(o,Ut),i.parentNode.insertBefore(o,i.nextSibling)}},{key:"start",value:function(){var i=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var n=W.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(W.navigator.userAgent),r=function(l,h){E(i.imageData,{naturalWidth:l,naturalHeight:h,aspectRatio:l/h}),i.initialImageData=E({},i.imageData),i.sizing=!1,i.sized=!0,i.build()};if(e.naturalWidth&&!n){r(e.naturalWidth,e.naturalHeight);return}var o=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),n||s.removeChild(o)},o.src=e.src,n||(o.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;",s.appendChild(o))}},{key:"stop",value:function(){var i=this.image;i.onload=null,i.onerror=null,i.parentNode.removeChild(i),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var i=this.element,e=this.options,n=this.image,r=i.parentNode,o=document.createElement("div");o.innerHTML=Pe;var s=o.querySelector(".".concat(D,"-container")),u=s.querySelector(".".concat(D,"-canvas")),l=s.querySelector(".".concat(D,"-drag-box")),h=s.querySelector(".".concat(D,"-crop-box")),c=h.querySelector(".".concat(D,"-face"));this.container=r,this.cropper=s,this.canvas=u,this.dragBox=l,this.cropBox=h,this.viewBox=s.querySelector(".".concat(D,"-view-box")),this.face=c,u.appendChild(n),A(i,z),r.insertBefore(s,i.nextSibling),H(n,Ut),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,A(h,z),e.guides||A(h.getElementsByClassName("".concat(D,"-dashed")),z),e.center||A(h.getElementsByClassName("".concat(D,"-center")),z),e.background&&A(s,"".concat(D,"-bg")),e.highlight||A(c,Ae),e.cropBoxMovable&&(A(c,Et),ft(c,lt,It)),e.cropBoxResizable||(A(h.getElementsByClassName("".concat(D,"-line")),z),A(h.getElementsByClassName("".concat(D,"-point")),z)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),B(e.ready)&&k(i,Ft,e.ready,{once:!0}),at(i,Ft)}}},{key:"unbuild",value:function(){if(!!this.ready){this.ready=!1,this.unbind(),this.resetPreview();var i=this.cropper.parentNode;i&&i.removeChild(this.cropper),H(this.element,z)}}},{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=ci,a}},{key:"setDefaults",value:function(i){E(Jt,tt(i)&&i)}}]),a}();E(be.prototype,ai,ri,ni,oi,si,hi);var Z=function(){return Z=Object.assign||function(a){for(var t,i=1,e=arguments.length;i<e;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n]);return a},Z.apply(this,arguments)};function wt(a,t){var i={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(i[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(e=Object.getOwnPropertySymbols(a);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(i[e[n]]=a[e[n]])}return i}var li=["aspectRatio","autoCrop","autoCropArea","background","center","checkCrossOrigin","checkOrientation","cropBoxMovable","cropBoxResizable","data","dragMode","guides","highlight","initialAspectRatio","minCanvasHeight","minCanvasWidth","minContainerHeight","minContainerWidth","minCropBoxHeight","minCropBoxWidth","modal","movable","preview","responsive","restore","rotatable","scalable","toggleDragModeOnDblclick","viewMode","wheelZoomRatio","zoomOnTouch","zoomOnWheel","zoomable","cropstart","cropmove","cropend","crop","zoom","ready"],fi={opacity:0,maxWidth:"100%"},ui=Yt.forwardRef(function(a,t){var i=wt(a,[]),e=i.dragMode,n=e===void 0?"crop":e,r=i.src,o=i.style,s=i.className,u=i.crossOrigin,l=i.scaleX,h=i.scaleY,c=i.enable,d=i.zoomTo,m=i.rotateTo,g=i.alt,x=g===void 0?"picture":g,w=i.ready,M=i.onInitialized,O=wt(i,["dragMode","src","style","className","crossOrigin","scaleX","scaleY","enable","zoomTo","rotateTo","alt","ready","onInitialized"]),T={scaleY:h,scaleX:l,enable:c,zoomTo:d,rotateTo:m},N=function(){for(var f=[],p=0;p<arguments.length;p++)f[p]=arguments[p];var v=rt.exports.useRef(null);return Yt.useEffect(function(){f.forEach(function(y){y&&(typeof y=="function"?y(v.current):y.current=v.current)})},[f]),v}(t,rt.exports.useRef(null));rt.exports.useEffect(function(){var f;((f=N.current)===null||f===void 0?void 0:f.cropper)&&typeof d=="number"&&N.current.cropper.zoomTo(d)},[i.zoomTo]),rt.exports.useEffect(function(){var f;((f=N.current)===null||f===void 0?void 0:f.cropper)&&r!==void 0&&N.current.cropper.reset().clear().replace(r)},[r]),rt.exports.useEffect(function(){if(N.current!==null){var f=new be(N.current,Z(Z({dragMode:n},O),{ready:function(p){p.currentTarget!==null&&function(v,y){y===void 0&&(y={});var R=y.enable,j=R===void 0||R,_=y.scaleX,Y=_===void 0?1:_,L=y.scaleY,S=L===void 0?1:L,X=y.zoomTo,$=X===void 0?0:X,Q=y.rotateTo;j?v.enable():v.disable(),v.scaleX(Y),v.scaleY(S),Q!==void 0&&v.rotateTo(Q),$>0&&v.zoomTo($)}(p.currentTarget.cropper,T),w&&w(p)}}));M&&M(f)}return function(){var p,v;(v=(p=N.current)===null||p===void 0?void 0:p.cropper)===null||v===void 0||v.destroy()}},[N]);var I=function(f){return li.reduce(function(p,v){var y=p,R=v;return y[R],wt(y,[typeof R=="symbol"?R:R+""])},f)}(Z(Z({},O),{crossOrigin:u,src:r,alt:x}));return Xt("div",{style:o,className:s,children:Xt("img",{...Z({},I,{style:fi,ref:N})})})});export{ui as Cropper,ui as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
|
7
|
+
<meta name="renderer" content="webkit" />
|
|
8
|
+
<meta name="force-rendering" content="webkit" />
|
|
9
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
10
|
+
<title></title>
|
|
11
|
+
<link rel="shortcut icon" type="images/x-icon" href="/static/favicon.ico" />
|
|
12
|
+
<link rel="stylesheet" type="text/css" href="/static/css/index.css" />
|
|
13
|
+
<script type="module" crossorigin src="/assets/js/index-9eef7474.js"></script>
|
|
14
|
+
<link rel="stylesheet" href="/assets/css/index-cc834b52.css">
|
|
15
|
+
</head>
|
|
16
|
+
|
|
17
|
+
<body>
|
|
18
|
+
<div id="root" class="app-wrapper">
|
|
19
|
+
<style>
|
|
20
|
+
* {
|
|
21
|
+
margin: 0;
|
|
22
|
+
}
|
|
23
|
+
html,
|
|
24
|
+
body,
|
|
25
|
+
.app-wrapper {
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
}
|
|
29
|
+
.page-loading-content {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
height: 100%;
|
|
35
|
+
min-height: 420px;
|
|
36
|
+
}
|
|
37
|
+
.page-loading-warp {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
padding: 98px;
|
|
42
|
+
}
|
|
43
|
+
.p-spin {
|
|
44
|
+
position: absolute;
|
|
45
|
+
display: none;
|
|
46
|
+
-webkit-box-sizing: border-box;
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
margin: 0;
|
|
49
|
+
padding: 0;
|
|
50
|
+
color: rgba(0, 0, 0, 0.65);
|
|
51
|
+
color: #1890ff;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
line-height: 1.5;
|
|
54
|
+
text-align: center;
|
|
55
|
+
list-style: none;
|
|
56
|
+
opacity: 0;
|
|
57
|
+
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
|
58
|
+
transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
|
59
|
+
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
|
60
|
+
transition:
|
|
61
|
+
transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86),
|
|
62
|
+
-webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
|
63
|
+
-webkit-font-feature-settings: 'tnum';
|
|
64
|
+
font-feature-settings: 'tnum';
|
|
65
|
+
}
|
|
66
|
+
.p-spin-spinning {
|
|
67
|
+
position: static;
|
|
68
|
+
display: inline-block;
|
|
69
|
+
opacity: 1;
|
|
70
|
+
}
|
|
71
|
+
.p-spin-dot {
|
|
72
|
+
position: relative;
|
|
73
|
+
display: inline-block;
|
|
74
|
+
width: 20px;
|
|
75
|
+
height: 20px;
|
|
76
|
+
font-size: 20px;
|
|
77
|
+
}
|
|
78
|
+
.p-spin-dot i {
|
|
79
|
+
position: absolute;
|
|
80
|
+
display: block;
|
|
81
|
+
width: 14px;
|
|
82
|
+
height: 14px;
|
|
83
|
+
background-color: #1890ff;
|
|
84
|
+
border-radius: 100%;
|
|
85
|
+
-webkit-transform: scale(0.75);
|
|
86
|
+
-ms-transform: scale(0.75);
|
|
87
|
+
transform: scale(0.75);
|
|
88
|
+
-webkit-transform-origin: 50% 50%;
|
|
89
|
+
-ms-transform-origin: 50% 50%;
|
|
90
|
+
transform-origin: 50% 50%;
|
|
91
|
+
opacity: 0.3;
|
|
92
|
+
-webkit-animation: pSpinMove 1s infinite linear alternate;
|
|
93
|
+
animation: pSpinMove 1s infinite linear alternate;
|
|
94
|
+
}
|
|
95
|
+
.p-spin-dot i:nth-child(1) {
|
|
96
|
+
top: 0;
|
|
97
|
+
left: 0;
|
|
98
|
+
}
|
|
99
|
+
.p-spin-dot i:nth-child(2) {
|
|
100
|
+
top: 0;
|
|
101
|
+
right: 0;
|
|
102
|
+
-webkit-animation-delay: 0.4s;
|
|
103
|
+
animation-delay: 0.4s;
|
|
104
|
+
}
|
|
105
|
+
.p-spin-dot i:nth-child(3) {
|
|
106
|
+
right: 0;
|
|
107
|
+
bottom: 0;
|
|
108
|
+
-webkit-animation-delay: 0.8s;
|
|
109
|
+
animation-delay: 0.8s;
|
|
110
|
+
}
|
|
111
|
+
.p-spin-dot i:nth-child(4) {
|
|
112
|
+
bottom: 0;
|
|
113
|
+
left: 0;
|
|
114
|
+
-webkit-animation-delay: 1.2s;
|
|
115
|
+
animation-delay: 1.2s;
|
|
116
|
+
}
|
|
117
|
+
.p-spin-dot-spin {
|
|
118
|
+
-webkit-transform: rotate(45deg);
|
|
119
|
+
-ms-transform: rotate(45deg);
|
|
120
|
+
transform: rotate(45deg);
|
|
121
|
+
-webkit-animation: protate 1.2s infinite linear;
|
|
122
|
+
animation: pRotate 1.2s infinite linear;
|
|
123
|
+
}
|
|
124
|
+
.p-spin-lg .p-spin-dot {
|
|
125
|
+
width: 32px;
|
|
126
|
+
height: 32px;
|
|
127
|
+
font-size: 32px;
|
|
128
|
+
}
|
|
129
|
+
@-webkit-keyframes pSpinMove {
|
|
130
|
+
to {
|
|
131
|
+
opacity: 1;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
@keyframes pSpinMove {
|
|
135
|
+
to {
|
|
136
|
+
opacity: 1;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
@-webkit-keyframes pRotate {
|
|
140
|
+
to {
|
|
141
|
+
-webkit-transform: rotate(405deg);
|
|
142
|
+
transform: rotate(405deg);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
@keyframes pRotate {
|
|
146
|
+
to {
|
|
147
|
+
-webkit-transform: rotate(405deg);
|
|
148
|
+
transform: rotate(405deg);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</style>
|
|
152
|
+
<div class="page-loading-content">
|
|
153
|
+
<div class="page-loading-warp">
|
|
154
|
+
<div class="p-spin p-spin-lg p-spin-spinning">
|
|
155
|
+
<span class="p-spin-dot p-spin-dot-spin"><i></i><i></i><i></i><i></i></span>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
</body>
|
|
162
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,25 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gingkoo/base-server",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "app.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
7
|
+
"dev": "vite --mode development",
|
|
8
|
+
"build": "npm run clean && vite build --mode production",
|
|
9
|
+
"serve": "nodemon serve -p 2222",
|
|
10
|
+
"check": "node scripts/check_publish.js",
|
|
11
|
+
"clean": "rimraf dist",
|
|
12
|
+
"prepublishOnly": "npm run check && npm run build"
|
|
8
13
|
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"backend",
|
|
17
|
+
"static",
|
|
18
|
+
"app.js"
|
|
19
|
+
],
|
|
9
20
|
"keywords": [],
|
|
10
21
|
"author": "",
|
|
11
22
|
"license": "ISC",
|
|
12
23
|
"dependencies": {
|
|
24
|
+
"@gingkoo/node-tools": "^1.1.0-alpha.0",
|
|
25
|
+
"bcryptjs": "^2.4.3",
|
|
26
|
+
"chalk": "^4.1.2",
|
|
13
27
|
"compression": "^1.7.4",
|
|
14
28
|
"connect-timeout": "^1.9.0",
|
|
15
29
|
"cookie-parser": "^1.4.6",
|
|
30
|
+
"date-fns": "^2.29.3",
|
|
16
31
|
"express": "^4.19.1",
|
|
17
32
|
"express-xml-bodyparser": "^0.3.0",
|
|
18
|
-
"
|
|
33
|
+
"getavataaars": "^1.0.0",
|
|
34
|
+
"http-proxy-middleware": "^2.0.1",
|
|
35
|
+
"jsonwebtoken": "^8.5.1",
|
|
36
|
+
"lodash": "^4.17.21",
|
|
37
|
+
"log4js": "^6.9.1",
|
|
38
|
+
"minimist": "^1.2.8",
|
|
39
|
+
"multer": "^1.4.3",
|
|
40
|
+
"node-httpclient": "0.0.2",
|
|
41
|
+
"node-schedule": "^2.1.1",
|
|
42
|
+
"nodemailer": "^6.9.4",
|
|
43
|
+
"pako": "^2.1.0",
|
|
44
|
+
"socket.io": "^4.7.5",
|
|
45
|
+
"urlencode": "^1.1.0",
|
|
46
|
+
"xmlreader": "^0.2.3"
|
|
19
47
|
},
|
|
20
48
|
"devDependencies": {
|
|
49
|
+
"@emotion/css": "^11.11.2",
|
|
50
|
+
"@gingkoo/pandora-ui": "0.0.67-rc.31",
|
|
51
|
+
"@types/react": "^18.0.24",
|
|
52
|
+
"@types/react-dom": "^18.0.8",
|
|
53
|
+
"@types/styled-components": "^5.1.26",
|
|
54
|
+
"@vitejs/plugin-react": "^2.2.0",
|
|
55
|
+
"@wangeditor/core": ">=1.1.0",
|
|
56
|
+
"@wangeditor/editor": ">=5.1.0",
|
|
57
|
+
"@wangeditor/editor-for-react": "^1.0.6",
|
|
58
|
+
"@wecom/jssdk": "^1.4.5",
|
|
59
|
+
"antd": "4.20.3",
|
|
60
|
+
"antd-img-crop": "^4.2.3",
|
|
61
|
+
"less": "^4.2.0",
|
|
62
|
+
"mobx": "^6.7.0",
|
|
63
|
+
"mobx-react": "^7.6.0",
|
|
21
64
|
"nodemon": "^3.1.0",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
65
|
+
"prettier": "^3.2.5",
|
|
66
|
+
"react": "^18.2.0",
|
|
67
|
+
"react-dom": "^18.2.0",
|
|
68
|
+
"react-iframe": "^1.8.5",
|
|
69
|
+
"react-router-dom": "^6.22.3",
|
|
70
|
+
"react-sortablejs": "^6.1.4",
|
|
71
|
+
"react-zmage": "^0.8.5-beta.37",
|
|
72
|
+
"rimraf": "^5.0.5",
|
|
73
|
+
"styled-components": "^5.3.9",
|
|
74
|
+
"vite": "^3.2.3",
|
|
75
|
+
"vite-plugin-compression": "^0.5.1",
|
|
76
|
+
"vite-plugin-externals": "^0.6.2",
|
|
77
|
+
"vite-plugin-html": "^3.2.0",
|
|
78
|
+
"vite-plugin-imp": "^2.4.0"
|
|
24
79
|
}
|
|
25
80
|
}
|
package/common/router.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const express = require('express');
|
|
3
|
-
// const { createProxyMiddleware } = require('http-proxy-middleware');
|
|
4
|
-
// const { authCheck } = require('@common/middleware/auth');
|
|
5
|
-
// const config = require('@config/index');
|
|
6
|
-
|
|
7
|
-
const user = require('../modules/user/backend/index');
|
|
8
|
-
|
|
9
|
-
var router = express.Router();
|
|
10
|
-
|
|
11
|
-
router.use('/user', user);
|
|
12
|
-
|
|
13
|
-
// if (config.isProxyCloud) {
|
|
14
|
-
// const cloudRouter = require('./proxy_cloud');
|
|
15
|
-
// router.use('/', cloudRouter);
|
|
16
|
-
// }
|
|
17
|
-
|
|
18
|
-
// if (config.isDev) {
|
|
19
|
-
// router.use(
|
|
20
|
-
// '/',
|
|
21
|
-
// createProxyMiddleware({
|
|
22
|
-
// target: 'http://127.0.0.1:4000',
|
|
23
|
-
// changeOrigin: false,
|
|
24
|
-
// ws: true,
|
|
25
|
-
// pathRewrite: {
|
|
26
|
-
// '^/': '',
|
|
27
|
-
// },
|
|
28
|
-
// onProxyReq: function (proxyReq, req, res) {
|
|
29
|
-
// if (req.body) {
|
|
30
|
-
// let bodyData = JSON.stringify(req.body);
|
|
31
|
-
// proxyReq.setHeader('Content-Type', 'application/json');
|
|
32
|
-
// proxyReq.setHeader('Content-Length', Buffer.byteLength(bodyData));
|
|
33
|
-
// proxyReq.write(bodyData);
|
|
34
|
-
// }
|
|
35
|
-
// },
|
|
36
|
-
// }),
|
|
37
|
-
// );
|
|
38
|
-
// } else {
|
|
39
|
-
// router.use('/', express.static('dist'));
|
|
40
|
-
// }
|
|
41
|
-
|
|
42
|
-
module.exports = router;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const express = require('express');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
// const config = require('@config/index');
|
|
5
|
-
// const { authCheck } = require('@common/middleware/auth');
|
|
6
|
-
const user = require('./routers/user');
|
|
7
|
-
|
|
8
|
-
var router = express.Router();
|
|
9
|
-
router.use('/', express.static(path.join(__dirname, '../frontend/')));
|
|
10
|
-
|
|
11
|
-
console.log(
|
|
12
|
-
`🌟 ~ express.static(path.join(__dirname, '../frontend/index.html')):`,
|
|
13
|
-
path.join(__dirname, '../frontend/index.html'),
|
|
14
|
-
);
|
|
15
|
-
// !config.isDev && router.use(/^(\/|\/index|\/index.html)$/, express.static('dist/team/index.html'));
|
|
16
|
-
|
|
17
|
-
router.use('/', user);
|
|
18
|
-
|
|
19
|
-
module.exports = router;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log(12);
|