UNPKG

xz-toolcomponents

Version:

修复裁剪返回抖动问题

2 lines 32.6 kB
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["xz-toolComponents"]=e():t["xz-toolComponents"]=e()})("undefined"!==typeof self?self:this,(function(){return function(){"use strict";var t={34:function(t,e,o){var r=o(4901);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},81:function(t,e,o){var r=o(9565),n=o(9306),i=o(8551),s=o(6823),u=o(851),c=TypeError;t.exports=function(t,e){var o=arguments.length<2?u(t):e;if(n(o))return i(r(o,t));throw new c(s(t)+" is not iterable")}},283:function(t,e,o){var r=o(9504),n=o(9039),i=o(4901),s=o(9297),u=o(3724),c=o(350).CONFIGURABLE,f=o(3706),a=o(1181),h=a.enforce,l=a.get,p=String,y=Object.defineProperty,g=r("".slice),m=r("".replace),d=r([].join),v=u&&!n((function(){return 8!==y((function(){}),"length",{value:8}).length})),x=String(String).split("String"),b=t.exports=function(t,e,o){"Symbol("===g(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),o&&o.getter&&(e="get "+e),o&&o.setter&&(e="set "+e),(!s(t,"name")||c&&t.name!==e)&&(u?y(t,"name",{value:e,configurable:!0}):t.name=e),v&&o&&s(o,"arity")&&t.length!==o.arity&&y(t,"length",{value:o.arity});try{o&&s(o,"constructor")&&o.constructor?u&&y(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(n){}var r=h(t);return s(r,"source")||(r.source=d(x,"string"==typeof e?e:"")),t};Function.prototype.toString=b((function(){return i(this)&&l(this).source||f(this)}),"toString")},350:function(t,e,o){var r=o(3724),n=o(9297),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,u=n(i,"name"),c=u&&"something"===function(){}.name,f=u&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:u,PROPER:c,CONFIGURABLE:f}},397:function(t,e,o){var r=o(7751);t.exports=r("document","documentElement")},421:function(t){t.exports={}},616:function(t,e,o){var r=o(9039);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},679:function(t,e,o){var r=o(1625),n=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw new n("Incorrect invocation")}},741:function(t){var e=Math.ceil,o=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?o:e)(r)}},757:function(t,e,o){var r=o(7751),n=o(4901),i=o(1625),s=o(7040),u=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&i(e.prototype,u(t))}},851:function(t,e,o){var r=o(6955),n=o(5966),i=o(4117),s=o(6269),u=o(8227),c=u("iterator");t.exports=function(t){if(!i(t))return n(t,c)||n(t,"@@iterator")||s[r(t)]}},1072:function(t,e,o){var r=o(1828),n=o(8727);t.exports=Object.keys||function(t){return r(t,n)}},1181:function(t,e,o){var r,n,i,s=o(8622),u=o(4576),c=o(34),f=o(6699),a=o(9297),h=o(7629),l=o(6119),p=o(421),y="Object already initialized",g=u.TypeError,m=u.WeakMap,d=function(t){return i(t)?n(t):r(t,{})},v=function(t){return function(e){var o;if(!c(e)||(o=n(e)).type!==t)throw new g("Incompatible receiver, "+t+" required");return o}};if(s||h.state){var x=h.state||(h.state=new m);x.get=x.get,x.has=x.has,x.set=x.set,r=function(t,e){if(x.has(t))throw new g(y);return e.facade=t,x.set(t,e),e},n=function(t){return x.get(t)||{}},i=function(t){return x.has(t)}}else{var b=l("state");p[b]=!0,r=function(t,e){if(a(t,b))throw new g(y);return e.facade=t,f(t,b,e),e},n=function(t){return a(t,b)?t[b]:{}},i=function(t){return a(t,b)}}t.exports={set:r,get:n,has:i,enforce:d,getterFor:v}},1291:function(t,e,o){var r=o(741);t.exports=function(t){var e=+t;return e!==e||0===e?0:r(e)}},1625:function(t,e,o){var r=o(9504);t.exports=r({}.isPrototypeOf)},1767:function(t){t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},1828:function(t,e,o){var r=o(9504),n=o(9297),i=o(5397),s=o(9617).indexOf,u=o(421),c=r([].push);t.exports=function(t,e){var o,r=i(t),f=0,a=[];for(o in r)!n(u,o)&&n(r,o)&&c(a,o);while(e.length>f)n(r,o=e[f++])&&(~s(a,o)||c(a,o));return a}},2106:function(t,e,o){var r=o(283),n=o(4913);t.exports=function(t,e,o){return o.get&&r(o.get,e,{getter:!0}),o.set&&r(o.set,e,{setter:!0}),n.f(t,e,o)}},2140:function(t,e,o){var r=o(8227),n=r("toStringTag"),i={};i[n]="z",t.exports="[object z]"===String(i)},2195:function(t,e,o){var r=o(9504),n=r({}.toString),i=r("".slice);t.exports=function(t){return i(n(t),8,-1)}},2211:function(t,e,o){var r=o(9039);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},2360:function(t,e,o){var r,n=o(8551),i=o(6801),s=o(8727),u=o(421),c=o(397),f=o(4055),a=o(6119),h=">",l="<",p="prototype",y="script",g=a("IE_PROTO"),m=function(){},d=function(t){return l+y+h+t+l+"/"+y+h},v=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},x=function(){var t,e=f("iframe"),o="java"+y+":";return e.style.display="none",c.appendChild(e),e.src=String(o),t=e.contentWindow.document,t.open(),t.write(d("document.F=Object")),t.close(),t.F},b=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}b="undefined"!=typeof document?document.domain&&r?v(r):x():v(r);var t=s.length;while(t--)delete b[p][s[t]];return b()};u[g]=!0,t.exports=Object.create||function(t,e){var o;return null!==t?(m[p]=n(t),o=new m,m[p]=null,o[g]=t):o=b(),void 0===e?o:i.f(o,e)}},2489:function(t,e,o){var r=o(6518),n=o(9565),i=o(9306),s=o(8551),u=o(1767),c=o(9462),f=o(6319),a=o(6395),h=c((function(){var t,e,o,r=this.iterator,i=this.predicate,u=this.next;while(1){if(t=s(n(u,r)),e=this.done=!!t.done,e)return;if(o=t.value,f(r,i,[o,this.counter++],!0))return o}}));r({target:"Iterator",proto:!0,real:!0,forced:a},{filter:function(t){return s(this),i(t),new h(u(this),{predicate:t})}})},2529:function(t){t.exports=function(t,e){return{value:t,done:e}}},2652:function(t,e,o){var r=o(6080),n=o(9565),i=o(8551),s=o(6823),u=o(4209),c=o(6198),f=o(1625),a=o(81),h=o(851),l=o(9539),p=TypeError,y=function(t,e){this.stopped=t,this.result=e},g=y.prototype;t.exports=function(t,e,o){var m,d,v,x,b,w,T,C=o&&o.that,S=!(!o||!o.AS_ENTRIES),R=!(!o||!o.IS_RECORD),O=!(!o||!o.IS_ITERATOR),I=!(!o||!o.INTERRUPTED),j=r(e,C),P=function(t){return m&&l(m,"normal",t),new y(!0,t)},B=function(t){return S?(i(t),I?j(t[0],t[1],P):j(t[0],t[1])):I?j(t,P):j(t)};if(R)m=t.iterator;else if(O)m=t;else{if(d=h(t),!d)throw new p(s(t)+" is not iterable");if(u(d)){for(v=0,x=c(t);x>v;v++)if(b=B(t[v]),b&&f(g,b))return b;return new y(!1)}m=a(t,d)}w=R?t.next:m.next;while(!(T=n(w,m)).done){try{b=B(T.value)}catch(z){l(m,"throw",z)}if("object"==typeof b&&b&&f(g,b))return b}return new y(!1)}},2777:function(t,e,o){var r=o(9565),n=o(34),i=o(757),s=o(5966),u=o(4270),c=o(8227),f=TypeError,a=c("toPrimitive");t.exports=function(t,e){if(!n(t)||i(t))return t;var o,c=s(t,a);if(c){if(void 0===e&&(e="default"),o=r(c,t,e),!n(o)||i(o))return o;throw new f("Can't convert object to primitive value")}return void 0===e&&(e="number"),u(t,e)}},2787:function(t,e,o){var r=o(9297),n=o(4901),i=o(8981),s=o(6119),u=o(2211),c=s("IE_PROTO"),f=Object,a=f.prototype;t.exports=u?f.getPrototypeOf:function(t){var e=i(t);if(r(e,c))return e[c];var o=e.constructor;return n(o)&&e instanceof o?o.prototype:e instanceof f?a:null}},2796:function(t,e,o){var r=o(9039),n=o(4901),i=/#|\.prototype\./,s=function(t,e){var o=c[u(t)];return o===a||o!==f&&(n(e)?r(e):!!e)},u=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=s.data={},f=s.NATIVE="N",a=s.POLYFILL="P";t.exports=s},2839:function(t,e,o){var r=o(4576),n=r.navigator,i=n&&n.userAgent;t.exports=i?String(i):""},3392:function(t,e,o){var r=o(9504),n=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++n+i,36)}},3706:function(t,e,o){var r=o(9504),n=o(4901),i=o(7629),s=r(Function.toString);n(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},3717:function(t,e){e.f=Object.getOwnPropertySymbols},3724:function(t,e,o){var r=o(9039);t.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:function(t,e,o){var r=o(4576),n=o(34),i=r.document,s=n(i)&&n(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},4117:function(t){t.exports=function(t){return null===t||void 0===t}},4209:function(t,e,o){var r=o(8227),n=o(6269),i=r("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||s[i]===t)}},4270:function(t,e,o){var r=o(9565),n=o(4901),i=o(34),s=TypeError;t.exports=function(t,e){var o,u;if("string"===e&&n(o=t.toString)&&!i(u=r(o,t)))return u;if(n(o=t.valueOf)&&!i(u=r(o,t)))return u;if("string"!==e&&n(o=t.toString)&&!i(u=r(o,t)))return u;throw new s("Can't convert object to primitive value")}},4495:function(t,e,o){var r=o(9519),n=o(9039),i=o(4576),s=i.String;t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},4576:function(t,e,o){var r=function(t){return t&&t.Math===Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof o.g&&o.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4659:function(t,e,o){var r=o(3724),n=o(4913),i=o(6980);t.exports=function(t,e,o){r?n.f(t,e,i(0,o)):t[e]=o}},4901:function(t){var e="object"==typeof document&&document.all;t.exports="undefined"==typeof e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},4913:function(t,e,o){var r=o(3724),n=o(5917),i=o(8686),s=o(8551),u=o(6969),c=TypeError,f=Object.defineProperty,a=Object.getOwnPropertyDescriptor,h="enumerable",l="configurable",p="writable";e.f=r?i?function(t,e,o){if(s(t),e=u(e),s(o),"function"===typeof t&&"prototype"===e&&"value"in o&&p in o&&!o[p]){var r=a(t,e);r&&r[p]&&(t[e]=o.value,o={configurable:l in o?o[l]:r[l],enumerable:h in o?o[h]:r[h],writable:!1})}return f(t,e,o)}:f:function(t,e,o){if(s(t),e=u(e),s(o),n)try{return f(t,e,o)}catch(r){}if("get"in o||"set"in o)throw new c("Accessors not supported");return"value"in o&&(t[e]=o.value),t}},5031:function(t,e,o){var r=o(7751),n=o(9504),i=o(8480),s=o(3717),u=o(8551),c=n([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(u(t)),o=s.f;return o?c(e,o(t)):e}},5397:function(t,e,o){var r=o(7055),n=o(7750);t.exports=function(t){return r(n(t))}},5610:function(t,e,o){var r=o(1291),n=Math.max,i=Math.min;t.exports=function(t,e){var o=r(t);return o<0?n(o+e,0):i(o,e)}},5745:function(t,e,o){var r=o(7629);t.exports=function(t,e){return r[t]||(r[t]=e||{})}},5917:function(t,e,o){var r=o(3724),n=o(9039),i=o(4055);t.exports=!r&&!n((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},5966:function(t,e,o){var r=o(9306),n=o(4117);t.exports=function(t,e){var o=t[e];return n(o)?void 0:r(o)}},6080:function(t,e,o){var r=o(7476),n=o(9306),i=o(616),s=r(r.bind);t.exports=function(t,e){return n(t),void 0===e?t:i?s(t,e):function(){return t.apply(e,arguments)}}},6119:function(t,e,o){var r=o(5745),n=o(3392),i=r("keys");t.exports=function(t){return i[t]||(i[t]=n(t))}},6198:function(t,e,o){var r=o(8014);t.exports=function(t){return r(t.length)}},6269:function(t){t.exports={}},6279:function(t,e,o){var r=o(6840);t.exports=function(t,e,o){for(var n in e)r(t,n,e[n],o);return t}},6319:function(t,e,o){var r=o(8551),n=o(9539);t.exports=function(t,e,o,i){try{return i?e(r(o)[0],o[1]):e(o)}catch(s){n(t,"throw",s)}}},6395:function(t){t.exports=!1},6518:function(t,e,o){var r=o(4576),n=o(7347).f,i=o(6699),s=o(6840),u=o(9433),c=o(7740),f=o(2796);t.exports=function(t,e){var o,a,h,l,p,y,g=t.target,m=t.global,d=t.stat;if(a=m?r:d?r[g]||u(g,{}):r[g]&&r[g].prototype,a)for(h in e){if(p=e[h],t.dontCallGetSet?(y=n(a,h),l=y&&y.value):l=a[h],o=f(m?h:g+(d?".":"#")+h,t.forced),!o&&void 0!==l){if(typeof p==typeof l)continue;c(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),s(a,h,p,t)}}},6699:function(t,e,o){var r=o(3724),n=o(4913),i=o(6980);t.exports=r?function(t,e,o){return n.f(t,e,i(1,o))}:function(t,e,o){return t[e]=o,t}},6801:function(t,e,o){var r=o(3724),n=o(8686),i=o(4913),s=o(8551),u=o(5397),c=o(1072);e.f=r&&!n?Object.defineProperties:function(t,e){s(t);var o,r=u(e),n=c(e),f=n.length,a=0;while(f>a)i.f(t,o=n[a++],r[o]);return t}},6823:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(o){return"Object"}}},6840:function(t,e,o){var r=o(4901),n=o(4913),i=o(283),s=o(9433);t.exports=function(t,e,o,u){u||(u={});var c=u.enumerable,f=void 0!==u.name?u.name:e;if(r(o)&&i(o,f,u),u.global)c?t[e]=o:s(e,o);else{try{u.unsafe?t[e]&&(c=!0):delete t[e]}catch(a){}c?t[e]=o:n.f(t,e,{value:o,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},6955:function(t,e,o){var r=o(2140),n=o(4901),i=o(2195),s=o(8227),u=s("toStringTag"),c=Object,f="Arguments"===i(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(o){}};t.exports=r?i:function(t){var e,o,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(o=a(e=c(t),u))?o:f?i(e):"Object"===(r=i(e))&&n(e.callee)?"Arguments":r}},6969:function(t,e,o){var r=o(2777),n=o(757);t.exports=function(t){var e=r(t,"string");return n(e)?e:e+""}},6980:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},7040:function(t,e,o){var r=o(4495);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:function(t,e,o){var r=o(9504),n=o(9039),i=o(2195),s=Object,u=r("".split);t.exports=n((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"===i(t)?u(t,""):s(t)}:s},7347:function(t,e,o){var r=o(3724),n=o(9565),i=o(8773),s=o(6980),u=o(5397),c=o(6969),f=o(9297),a=o(5917),h=Object.getOwnPropertyDescriptor;e.f=r?h:function(t,e){if(t=u(t),e=c(e),a)try{return h(t,e)}catch(o){}if(f(t,e))return s(!n(i.f,t,e),t[e])}},7476:function(t,e,o){var r=o(2195),n=o(9504);t.exports=function(t){if("Function"===r(t))return n(t)}},7629:function(t,e,o){var r=o(6395),n=o(4576),i=o(9433),s="__core-js_shared__",u=t.exports=n[s]||i(s,{});(u.versions||(u.versions=[])).push({version:"3.41.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7657:function(t,e,o){var r,n,i,s=o(9039),u=o(4901),c=o(34),f=o(2360),a=o(2787),h=o(6840),l=o(8227),p=o(6395),y=l("iterator"),g=!1;[].keys&&(i=[].keys(),"next"in i?(n=a(a(i)),n!==Object.prototype&&(r=n)):g=!0);var m=!c(r)||s((function(){var t={};return r[y].call(t)!==t}));m?r={}:p&&(r=f(r)),u(r[y])||h(r,y,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:g}},7740:function(t,e,o){var r=o(9297),n=o(5031),i=o(7347),s=o(4913);t.exports=function(t,e,o){for(var u=n(e),c=s.f,f=i.f,a=0;a<u.length;a++){var h=u[a];r(t,h)||o&&r(o,h)||c(t,h,f(e,h))}}},7750:function(t,e,o){var r=o(4117),n=TypeError;t.exports=function(t){if(r(t))throw new n("Can't call method on "+t);return t}},7751:function(t,e,o){var r=o(4576),n=o(4901),i=function(t){return n(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},8014:function(t,e,o){var r=o(1291),n=Math.min;t.exports=function(t){var e=r(t);return e>0?n(e,9007199254740991):0}},8111:function(t,e,o){var r=o(6518),n=o(4576),i=o(679),s=o(8551),u=o(4901),c=o(2787),f=o(2106),a=o(4659),h=o(9039),l=o(9297),p=o(8227),y=o(7657).IteratorPrototype,g=o(3724),m=o(6395),d="constructor",v="Iterator",x=p("toStringTag"),b=TypeError,w=n[v],T=m||!u(w)||w.prototype!==y||!h((function(){w({})})),C=function(){if(i(this,y),c(this)===y)throw new b("Abstract class Iterator not directly constructable")},S=function(t,e){g?f(y,t,{configurable:!0,get:function(){return e},set:function(e){if(s(this),this===y)throw new b("You can't redefine this property");l(this,t)?this[t]=e:a(this,t,e)}}):y[t]=e};l(y,x)||S(x,v),!T&&l(y,d)&&y[d]!==Object||S(d,C),C.prototype=y,r({global:!0,constructor:!0,forced:T},{Iterator:C})},8227:function(t,e,o){var r=o(4576),n=o(5745),i=o(9297),s=o(3392),u=o(4495),c=o(7040),f=r.Symbol,a=n("wks"),h=c?f["for"]||f:f&&f.withoutSetter||s;t.exports=function(t){return i(a,t)||(a[t]=u&&i(f,t)?f[t]:h("Symbol."+t)),a[t]}},8237:function(t,e,o){var r=o(6518),n=o(2652),i=o(9306),s=o(8551),u=o(1767),c=TypeError;r({target:"Iterator",proto:!0,real:!0},{reduce:function(t){s(this),i(t);var e=u(this),o=arguments.length<2,r=o?void 0:arguments[1],f=0;if(n(e,(function(e){o?(o=!1,r=e):r=t(r,e,f),f++}),{IS_RECORD:!0}),o)throw new c("Reduce of empty iterator with no initial value");return r}})},8480:function(t,e,o){var r=o(1828),n=o(8727),i=n.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},8551:function(t,e,o){var r=o(34),n=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not an object")}},8622:function(t,e,o){var r=o(4576),n=o(4901),i=r.WeakMap;t.exports=n(i)&&/native code/.test(String(i))},8686:function(t,e,o){var r=o(3724),n=o(9039);t.exports=r&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8727:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8773:function(t,e){var o={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!o.call({1:2},1);e.f=n?function(t){var e=r(this,t);return!!e&&e.enumerable}:o},8981:function(t,e,o){var r=o(7750),n=Object;t.exports=function(t){return n(r(t))}},9039:function(t){t.exports=function(t){try{return!!t()}catch(e){return!0}}},9297:function(t,e,o){var r=o(9504),n=o(8981),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(n(t),e)}},9306:function(t,e,o){var r=o(4901),n=o(6823),i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not a function")}},9433:function(t,e,o){var r=o(4576),n=Object.defineProperty;t.exports=function(t,e){try{n(r,t,{value:e,configurable:!0,writable:!0})}catch(o){r[t]=e}return e}},9462:function(t,e,o){var r=o(9565),n=o(2360),i=o(6699),s=o(6279),u=o(8227),c=o(1181),f=o(5966),a=o(7657).IteratorPrototype,h=o(2529),l=o(9539),p=u("toStringTag"),y="IteratorHelper",g="WrapForValidIterator",m=c.set,d=function(t){var e=c.getterFor(t?g:y);return s(n(a),{next:function(){var o=e(this);if(t)return o.nextHandler();if(o.done)return h(void 0,!0);try{var r=o.nextHandler();return o.returnHandlerResult?r:h(r,o.done)}catch(n){throw o.done=!0,n}},return:function(){var o=e(this),n=o.iterator;if(o.done=!0,t){var i=f(n,"return");return i?r(i,n):h(void 0,!0)}if(o.inner)try{l(o.inner.iterator,"normal")}catch(s){return l(n,"throw",s)}return n&&l(n,"normal"),h(void 0,!0)}})},v=d(!0),x=d(!1);i(x,p,"Iterator Helper"),t.exports=function(t,e,o){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=e?g:y,n.returnHandlerResult=!!o,n.nextHandler=t,n.counter=0,n.done=!1,m(this,n)};return r.prototype=e?v:x,r}},9504:function(t,e,o){var r=o(616),n=Function.prototype,i=n.call,s=r&&n.bind.bind(i,i);t.exports=r?s:function(t){return function(){return i.apply(t,arguments)}}},9519:function(t,e,o){var r,n,i=o(4576),s=o(2839),u=i.process,c=i.Deno,f=u&&u.versions||c&&c.version,a=f&&f.v8;a&&(r=a.split("."),n=r[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&s&&(r=s.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/),r&&(n=+r[1]))),t.exports=n},9539:function(t,e,o){var r=o(9565),n=o(8551),i=o(5966);t.exports=function(t,e,o){var s,u;n(t);try{if(s=i(t,"return"),!s){if("throw"===e)throw o;return o}s=r(s,t)}catch(c){u=!0,s=c}if("throw"===e)throw o;if(u)throw s;return n(s),o}},9565:function(t,e,o){var r=o(616),n=Function.prototype.call;t.exports=r?n.bind(n):function(){return n.apply(n,arguments)}},9617:function(t,e,o){var r=o(5397),n=o(5610),i=o(6198),s=function(t){return function(e,o,s){var u=r(e),c=i(u);if(0===c)return!t&&-1;var f,a=n(s,c);if(t&&o!==o){while(c>a)if(f=u[a++],f!==f)return!0}else for(;c>a;a++)if((t||a in u)&&u[a]===o)return t||a||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}}},e={};function o(r){var n=e[r];if(void 0!==n)return n.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,o),i.exports}!function(){o.d=function(t,e){for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})}}(),function(){o.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}(),function(){o.p=""}();var r={};if(o.r(r),o.d(r,{default:function(){return m}}),"undefined"!==typeof window){var n=window.document.currentScript,i=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(o.p=i[1])}var s=function(){var t=this,e=t._self._c;return e("div",{ref:"myCut",staticClass:"xz-cutMachine-myCut"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.url,expression:"url"}],ref:"parentDom",staticClass:"xz-cutMachine-imgBox"},[e("div",{ref:"sourceImg",staticClass:"xz-cutMachine-img"},[e("img",{ref:"imgRef",staticStyle:{height:"100%",width:"100%"},attrs:{id:"dynamicImage",src:t.url,alt:""}}),e("canvas",{ref:"canvasRect",staticClass:"xz-cutMachine-canvasRect"}),e("span",{ref:"leftTop",staticClass:"xz-cutMachine-leftTop xz-cutMachine-dot",on:{mousedown:function(e){return e.target!==e.currentTarget?null:t.LTchange("leftTop",e)}}}),e("span",{ref:"rightTop",staticClass:"xz-cutMachine-rightTop xz-cutMachine-dot",on:{mousedown:function(e){return e.target!==e.currentTarget?null:t.LTchange("rightTop",e)}}}),e("span",{ref:"leftBottom",staticClass:"xz-cutMachine-leftBottom xz-cutMachine-dot",on:{mousedown:function(e){return e.target!==e.currentTarget?null:t.LTchange("leftBottom",e)}}}),e("span",{ref:"rightBottom",staticClass:"xz-cutMachine-rightBottom xz-cutMachine-dot",on:{mousedown:function(e){return e.target!==e.currentTarget?null:t.LTchange("rightBottom",e)}}}),e("div",{ref:"bogus",staticClass:"xz-cutMachine-bogus",on:{mouseover:function(e){return e.target!==e.currentTarget?null:t.mouseoverBogus.apply(null,arguments)}}})])]),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.url,expression:"!url"}],staticClass:"xz-cutMachine-text"},[t._v("请选择图片")])])},u=[],c=(o(8111),o(2489),o(8237),{name:"xz-cutMachine",props:{url:{type:String,default:""},outputType:{type:String,default:"png"},isRealTime:{type:Boolean,default:!0},cutSizi:{type:Object,default:()=>({w:0,h:0})},dotColor:{type:String,default:"yellow"},dotSize:{type:String,default:"12px"},fontColor:{type:String,default:"rgba(59, 57, 57, 0.685)"},fontSize:{type:String,default:""}},data(){return{myCut:null,parentDom:null,sourceImg:null,realWidthL:0,realHeight:0,ctx:null,picName:"",bogus:null,lock:!0}},computed:{},watch:{url:{immediate:!0,handler(t){if(t){let e=new Image;e.src=t,e.onload=()=>{this.realWidth=e.naturalWidth||e.width,this.realHeight=e.naturalHeight||e.height,this.centerImage(e.naturalWidth,e.naturalHeight),this.initCutDotPosition(),this.initCanvas(),this.picName=this.generateRandomString(16),this.cropping()}}}},dotColor:{immediate:!0,handler(t){this.$nextTick((()=>{t=t||"yellow",this.myCut&&this.myCut.style.setProperty("--dotColor",t)}))}},dotSize:{immediate:!0,handler(t){this.$nextTick((()=>{t=t||"12px",this.myCut&&this.myCut.style.setProperty("--dotSize",t)}))}},fontColor:{immediate:!0,handler(t){this.$nextTick((()=>{t=t||"rgba(59, 57, 57, 0.685)",this.myCut&&this.myCut.style.setProperty("--fontColor",t)}))}},fontSize:{immediate:!0,handler(t){this.$nextTick((()=>{let e=t||.1*this.myCut.offsetWidth+"px";this.myCut&&this.myCut.style.setProperty("--fontSize",e)}))}}},created(){},mounted(){this.myCut=this.$refs.myCut,this.parentDom=this.$refs.parentDom,this.parentDomWidth=this.parentDom.offsetWidth,this.parentDomHeight=this.parentDom.offsetHeight,this.sourceImg=this.$refs.sourceImg,this.canvasRect=this.$refs.canvasRect,this.leftTop=this.$refs.leftTop,this.rightTop=this.$refs.rightTop,this.leftBottom=this.$refs.leftBottom,this.rightBottom=this.$refs.rightBottom,this.bogus=this.$refs.bogus,this.initCutDotCursor(),this.bogus.addEventListener("mousedown",this.mousedownCanvas)},methods:{setBogus(t,e,o,r){this.myCut.style.setProperty("--BogusX",t+"px"),this.myCut.style.setProperty("--BogusY",e+"px"),this.myCut.style.setProperty("--BogusW",o+"px"),this.myCut.style.setProperty("--BogusH",r+"px")},mouseoverBogus(){this.myCut.style.setProperty("--cursor","move")},initCutDotCursor(){this.myCut&&this.myCut.style.setProperty("--cursor14","nw-resize"),this.myCut&&this.myCut.style.setProperty("--cursor23","ne-resize")},setDotCursor(t,e,o){"leftTop"!=t&&"rightBottom"!=t||!(o.x>e.bottomLeft.x&&o.y<e.bottomLeft.y||o.x<e.topRight.x&&o.y>e.topRight.y)||(this.myCut&&this.myCut.style.setProperty("--cursor14","ne-resize"),this.myCut&&this.myCut.style.setProperty("--cursor23","nw-resize")),"leftTop"!=t&&"rightBottom"!=t||!(o.x<e.bottomRight.x&&o.y<e.bottomRight.y||o.x>e.topLeft.x&&o.y>e.topLeft.y)||(this.myCut&&this.myCut.style.setProperty("--cursor14","nw-resize"),this.myCut&&this.myCut.style.setProperty("--cursor23","ne-resize")),"rightTop"!=t&&"leftBottom"!=t||!(o.x>e.bottomLeft.x&&o.y<e.bottomLeft.y||o.x<e.topRight.x&&o.y>e.topRight.y)||(this.myCut&&this.myCut.style.setProperty("--cursor14","nw-resize"),this.myCut&&this.myCut.style.setProperty("--cursor23","ne-resize")),"rightTop"!=t&&"leftBottom"!=t||!(o.x<e.bottomRight.x&&o.y<e.bottomRight.y||o.x>e.topLeft.x&&o.y>e.topLeft.y)||(this.myCut&&this.myCut.style.setProperty("--cursor14","ne-resize"),this.myCut&&this.myCut.style.setProperty("--cursor23","nw-resize"))},initCutDotPosition(){this.leftTop.style.left=0,this.leftTop.style.top=0,this.rightTop.style.left=this.sourceImg.offsetWidth/2+"px",this.rightTop.style.top=0,this.leftBottom.style.left=0,this.leftBottom.style.top=this.sourceImg.offsetHeight/2+"px",this.rightBottom.style.left=this.sourceImg.offsetWidth/2+"px",this.rightBottom.style.top=this.sourceImg.offsetHeight/2+"px"},initCanvas(){const t=this.leftTop.clientWidth/2,e=this.leftTop.offsetLeft+t,o=this.leftTop.offsetTop+t,r=this.rightTop.offsetLeft-this.leftTop.offsetLeft,n=this.leftBottom.offsetTop-this.leftTop.offsetTop;this.canvasRect.width=this.sourceImg.getBoundingClientRect().width,this.canvasRect.height=this.sourceImg.getBoundingClientRect().height,this.ctx=this.canvasRect.getContext("2d"),this.ctx.fillStyle="rgba(0, 0, 0, .8)",this.ctx.fillRect(0,0,this.canvasRect.width,this.canvasRect.height),this.ctx.globalCompositeOperation="destination-out",this.ctx.fillRect(e,o,r,n),this.ctx.globalCompositeOperation="source-over",this.setBogus(e,o,r,n)},drawRect(t,e,o,r){this.ctx.clearRect(0,0,this.ctx.width,this.ctx.height),this.ctx.width=this.sourceImg.getBoundingClientRect().width,this.ctx.height=this.sourceImg.getBoundingClientRect().height,this.ctx.fillStyle="rgba(0, 0, 0, .8)",this.ctx.fillRect(0,0,this.canvasRect.width,this.canvasRect.height),this.ctx.globalCompositeOperation="destination-out",this.ctx.fillRect(t,e,o,r),this.ctx.globalCompositeOperation="source-over",this.setBogus(t,e,o,r)},mousedownCanvas(t){const{topLeft:e,bottomRight:o}=this.getTopLeftCoordinate(),r=this.sourceImg.getBoundingClientRect(),n=this.leftTop.clientWidth/2,i=t.clientX>e.x+n+r.left,s=t.clientX<o.x+n+r.left,u=t.clientY>e.y+n+r.top,c=t.clientY<o.y+n+r.top;if(!(i&&s&&u&&c))return;const f=o.x-e.x,a=o.y-e.y,h=t.clientX-e.x,l=t.clientY-e.y;window.onmousemove=t=>{let e=r.height,o=r.width,i=t.clientX-h,s=t.clientY-l;i=Math.min(Math.max(0-n,i),o-f-n),s=Math.min(Math.max(0-n,s),e-a-n);const u=i+f,c=s,p=i,y=s+a,g=i+f,m=s+a;this.leftTop.style.left=i+"px",this.leftTop.style.top=s+"px",this.rightTop.style.left=u+"px",this.rightTop.style.top=c+"px",this.leftBottom.style.left=p+"px",this.leftBottom.style.top=y+"px",this.rightBottom.style.left=g+"px",this.rightBottom.style.top=m+"px",this.drawRect(i+n,s+n,f,a),this.initCutDotCursor(),this.isRealTime&&this.cropping()},window.onmouseup=()=>{!this.isRealTime&&this.cropping(),window.onmousemove=null,window.onmouseup=null}},LTchange(t){const e=this.leftTop.clientWidth/2,o=this.sourceImg.getBoundingClientRect();window.onmousemove=r=>{const n=r.clientX-o.left-e,i=r.clientY-o.top-e;this[t].style.left=n>=-e&&n<=o.width-e&&n+"px",this[t].style.top=i>=-e&&i<=o.height-e&&i+"px","leftTop"==t&&(this.leftBottom.style.left=this.leftTop.style.left,this.rightTop.style.top=this.leftTop.style.top),"rightTop"==t&&(this.leftTop.style.top=this.rightTop.style.top,this.rightBottom.style.left=this.rightTop.style.left),"leftBottom"==t&&(this.leftTop.style.left=this.leftBottom.style.left,this.rightBottom.style.top=this.leftBottom.style.top),"rightBottom"==t&&(this.rightTop.style.left=this.rightBottom.style.left,this.leftBottom.style.top=this.rightBottom.style.top);const{topLeft:s,bottomLeft:u,topRight:c,bottomRight:f}=this.getTopLeftCoordinate();this.setDotCursor(t,{topLeft:s,bottomLeft:u,topRight:c,bottomRight:f},{x:n,y:i}),this.drawRect(s.x+e,s.y+e,Math.abs(this.leftTop.offsetLeft-this.rightTop.offsetLeft),Math.abs(this.leftTop.offsetTop-this.leftBottom.offsetTop)),this.isRealTime&&this.cropping()},window.onmouseup=()=>{this.cropping(),!this.isRealTime&&this.cropping(),window.onmousemove=null,window.onmouseup=null}},getTopLeftCoordinate(t){t=t||[{x:this.leftTop.offsetLeft,y:this.leftTop.offsetTop},{x:this.leftBottom.offsetLeft,y:this.leftBottom.offsetTop},{x:this.rightTop.offsetLeft,y:this.rightTop.offsetTop},{x:this.rightBottom.offsetLeft,y:this.rightBottom.offsetTop}],t.sort(((t,e)=>t.x-e.x||t.y-e.y));const e=t[0].x,o=t[3].x,r=t.filter((t=>t.x===e)),n=t.filter((t=>t.x===o)),i=t=>({top:t.reduce(((t,e)=>e.y<t.y?e:t),t[0]),bottom:t.reduce(((t,e)=>e.y>t.y?e:t),t[0])}),s=i(r),u=i(n);return{topLeft:s.top,bottomLeft:s.bottom,topRight:u.top,bottomRight:u.bottom}},centerImage(t,e){e>t?(this.sourceImg.style.height="100%",this.sourceImg.style.width="auto",this.sourceImg.style.top="0",this.sourceImg.style.left=(this.parentDom.offsetWidth-this.sourceImg.offsetWidth)/2+"px"):t>e?(this.sourceImg.style.height="auto",this.sourceImg.style.width="100%",this.sourceImg.style.left="0",this.sourceImg.style.top=(this.parentDom.offsetHeight-this.sourceImg.offsetHeight)/2+"px"):(this.sourceImg.style.height="100%",this.sourceImg.style.width="100%",this.sourceImg.style.left="0",this.sourceImg.style.top="0")},calculate(){const{topLeft:t,bottomRight:e}=this.getTopLeftCoordinate(),o=this.sourceImg;let r={realWidth:this.realWidth,realHeight:this.realHeight},n={width:o.offsetWidth,heigh:o.offsetHeight,top:t.y+this.leftTop.clientWidth/2,left:t.x+this.leftTop.clientWidth/2},i=r.realWidth/n.width,s=r.realHeight/n.heigh;const u=e.x-t.x,c=e.y-t.y;let f={cx:n.left*i,cy:n.top*s,cWidth:u*i,cHeight:c*s};return f},cropping(){if(!this.lock)return;this.lock=!1;let{cx:t,cy:e,cWidth:o,cHeight:r}=this.calculate();const n=document.createElement("canvas"),i=n.getContext("2d");let s=this.cutSizi.w,u=this.cutSizi.h;if(this.cutSizi.w<=0){const{topLeft:t,bottomRight:e}=this.getTopLeftCoordinate();s=e.x-t.x,u=e.y-t.y}n.width=s*devicePixelRatio,n.height=u*devicePixelRatio,i.drawImage(this.$refs.imgRef,t,e,o,r,0,0,n.width,n.height),n.toBlob((t=>{const e=new File([t],`${this.picName}.${this.outputType}`,{type:`image/${this.outputType}`});this.emitFun(e),this.lock=!0}))},generateRandomString(t){const e="123456789abcdefghijklmnopqrstuvwxyz";let o="";const r=e.length;for(let n=0;n<t;n++)o+=e.charAt(Math.floor(Math.random()*r));return o},emitFun(t){this.$emit("resultCallback",t)}}}),f=c;function a(t,e,o,r,n,i,s,u){var c,f="function"===typeof t?t.options:t;if(e&&(f.render=e,f.staticRenderFns=o,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),s?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},f._ssrRegister=c):n&&(c=u?function(){n.call(this,(f.functional?this.parent:this).$root.$options.shadowRoot)}:n),c)if(f.functional){f._injectStyles=c;var a=f.render;f.render=function(t,e){return c.call(e),a(t,e)}}else{var h=f.beforeCreate;f.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:f}}var h=a(f,s,u,!1,null,null,null),l=h.exports;const p=[l],y=function(t){p.forEach((e=>{t.component(e.name,e)}))};var g=y,m=g;return r}()})); //# sourceMappingURL=xz-toolComponents.umd.min.js.map