22 lines
23 KiB
Python
22 lines
23 KiB
Python
import{c as Y,d as G,I as N,r as y,J as Z,f as ne,F as oe,K as ie,g as B,U as x,l as se,a as le,o as ue,b as H,k as ce,e as J,n as de,i as fe,t as he,_ as ve}from"./index-C9gpBPbG.js";import{B as ge}from"./box-m5X2L2BC.js";/**
|
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const xe=Y("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const He=Y("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Ge=Y("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/*!
|
|
* qrcode.vue v3.6.0
|
|
* A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
|
|
* © 2017-PRESENT @scopewu(https://github.com/scopewu)
|
|
* MIT License.
|
|
*/var D=function(){return D=Object.assign||function(c){for(var u,l=1,f=arguments.length;l<f;l++){u=arguments[l];for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(c[v]=u[v])}return c},D.apply(this,arguments)};var F;(function(o){var c=(function(){function a(e,t,r,n){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<a.MIN_VERSION||e>a.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var s=[],i=0;i<this.size;i++)s.push(!1);for(var i=0;i<this.size;i++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();var h=this.addEccAndInterleave(r);if(this.drawCodewords(h),n==-1)for(var p=1e9,i=0;i<8;i++){this.applyMask(i),this.drawFormatBits(i);var M=this.getPenaltyScore();M<p&&(n=i,p=M),this.applyMask(i)}f(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}return a.encodeText=function(e,t){var r=o.QrSegment.makeSegments(e);return a.encodeSegments(r,t)},a.encodeBinary=function(e,t){var r=o.QrSegment.makeBytes(e);return a.encodeSegments([r],t)},a.encodeSegments=function(e,t,r,n,s,i){if(r===void 0&&(r=1),n===void 0&&(n=40),s===void 0&&(s=-1),i===void 0&&(i=!0),!(a.MIN_VERSION<=r&&r<=n&&n<=a.MAX_VERSION)||s<-1||s>7)throw new RangeError("Invalid value");var h,p;for(h=r;;h++){var M=a.getNumDataCodewords(h,t)*8,w=v.getTotalBits(e,h);if(w<=M){p=w;break}if(h>=n)throw new RangeError("Data too long")}for(var C=0,R=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];C<R.length;C++){var m=R[C];i&&p<=a.getNumDataCodewords(h,m)*8&&(t=m)}for(var g=[],E=0,P=e;E<P.length;E++){var S=P[E];u(S.mode.modeBits,4,g),u(S.numChars,S.mode.numCharCountBits(h),g);for(var b=0,A=S.getData();b<A.length;b++){var k=A[b];g.push(k)}}f(g.length==p);var L=a.getNumDataCodewords(h,t)*8;f(g.length<=L),u(0,Math.min(4,L-g.length),g),u(0,(8-g.length%8)%8,g),f(g.length%8==0);for(var I=236;g.length<L;I^=253)u(I,8,g);for(var T=[];T.length*8<g.length;)T.push(0);return g.forEach(function(O,Q){return T[Q>>>3]|=O<<7-(Q&7)}),new a(h,t,T,s)},a.prototype.getModule=function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]},a.prototype.getModules=function(){return this.modules},a.prototype.drawFunctionPatterns=function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var t=this.getAlignmentPatternPositions(),r=t.length,e=0;e<r;e++)for(var n=0;n<r;n++)e==0&&n==0||e==0&&n==r-1||e==r-1&&n==0||this.drawAlignmentPattern(t[e],t[n]);this.drawFormatBits(0),this.drawVersion()},a.prototype.drawFormatBits=function(e){for(var t=this.errorCorrectionLevel.formatBits<<3|e,r=t,n=0;n<10;n++)r=r<<1^(r>>>9)*1335;var s=(t<<10|r)^21522;f(s>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(s,n));this.setFunctionModule(8,7,l(s,6)),this.setFunctionModule(8,8,l(s,7)),this.setFunctionModule(7,8,l(s,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(s,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(s,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(s,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var r=this.version<<12|e;f(r>>>18==0);for(var t=0;t<18;t++){var n=l(r,t),s=this.size-11+t%3,i=Math.floor(t/3);this.setFunctionModule(s,i,n),this.setFunctionModule(i,s,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var s=Math.max(Math.abs(n),Math.abs(r)),i=e+n,h=t+r;0<=i&&i<this.size&&0<=h&&h<this.size&&this.setFunctionModule(i,h,s!=2&&s!=4)}},a.prototype.drawAlignmentPattern=function(e,t){for(var r=-2;r<=2;r++)for(var n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,Math.max(Math.abs(n),Math.abs(r))!=1)},a.prototype.setFunctionModule=function(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0},a.prototype.addEccAndInterleave=function(e){var t=this.version,r=this.errorCorrectionLevel;if(e.length!=a.getNumDataCodewords(t,r))throw new RangeError("Invalid argument");for(var n=a.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t],s=a.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t],i=Math.floor(a.getNumRawDataModules(t)/8),h=n-i%n,p=Math.floor(i/n),M=[],w=a.reedSolomonComputeDivisor(s),C=0,R=0;C<n;C++){var m=e.slice(R,R+p-s+(C<h?0:1));R+=m.length;var g=a.reedSolomonComputeRemainder(m,w);C<h&&m.push(0),M.push(m.concat(g))}for(var E=[],P=function(S){M.forEach(function(b,A){(S!=p-s||A>=h)&&E.push(b[S])})},C=0;C<M[0].length;C++)P(C);return f(E.length==i),E},a.prototype.drawCodewords=function(e){if(e.length!=Math.floor(a.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var t=0,r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(var n=0;n<this.size;n++)for(var s=0;s<2;s++){var i=r-s,h=(r+1&2)==0,p=h?this.size-1-n:n;!this.isFunction[p][i]&&t<e.length*8&&(this.modules[p][i]=l(e[t>>>3],7-(t&7)),t++)}}f(t==e.length*8)},a.prototype.applyMask=function(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(var t=0;t<this.size;t++)for(var r=0;r<this.size;r++){var n=void 0;switch(e){case 0:n=(r+t)%2==0;break;case 1:n=t%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+t)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:n=r*t%2+r*t%3==0;break;case 6:n=(r*t%2+r*t%3)%2==0;break;case 7:n=((r+t)%2+r*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][r]&&n&&(this.modules[t][r]=!this.modules[t][r])}},a.prototype.getPenaltyScore=function(){for(var e=0,t=0;t<this.size;t++){for(var r=!1,n=0,s=[0,0,0,0,0,0,0],i=0;i<this.size;i++)this.modules[t][i]==r?(n++,n==5?e+=a.PENALTY_N1:n>5&&e++):(this.finderPenaltyAddHistory(n,s),r||(e+=this.finderPenaltyCountPatterns(s)*a.PENALTY_N3),r=this.modules[t][i],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,s)*a.PENALTY_N3}for(var i=0;i<this.size;i++){for(var r=!1,h=0,s=[0,0,0,0,0,0,0],t=0;t<this.size;t++)this.modules[t][i]==r?(h++,h==5?e+=a.PENALTY_N1:h>5&&e++):(this.finderPenaltyAddHistory(h,s),r||(e+=this.finderPenaltyCountPatterns(s)*a.PENALTY_N3),r=this.modules[t][i],h=1);e+=this.finderPenaltyTerminateAndCount(r,h,s)*a.PENALTY_N3}for(var t=0;t<this.size-1;t++)for(var i=0;i<this.size-1;i++){var p=this.modules[t][i];p==this.modules[t][i+1]&&p==this.modules[t+1][i]&&p==this.modules[t+1][i+1]&&(e+=a.PENALTY_N2)}for(var M=0,w=0,C=this.modules;w<C.length;w++){var R=C[w];M=R.reduce(function(E,P){return E+(P?1:0)},M)}var m=this.size*this.size,g=Math.ceil(Math.abs(M*20-m*10)/m)-1;return f(0<=g&&g<=9),e+=g*a.PENALTY_N4,f(0<=e&&e<=2568888),e},a.prototype.getAlignmentPatternPositions=function(){if(this.version==1)return[];for(var e=Math.floor(this.version/7)+2,t=Math.floor((this.version*8+e*3+5)/(e*4-4))*2,r=[6],n=this.size-7;r.length<e;n-=t)r.splice(1,0,n);return r},a.getNumRawDataModules=function(e){if(e<a.MIN_VERSION||e>a.MAX_VERSION)throw new RangeError("Version number out of range");var t=(16*e+128)*e+64;if(e>=2){var r=Math.floor(e/7)+2;t-=(25*r-10)*r-55,e>=7&&(t-=36)}return f(208<=t&&t<=29648),t},a.getNumDataCodewords=function(e,t){return Math.floor(a.getNumRawDataModules(e)/8)-a.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*a.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]},a.reedSolomonComputeDivisor=function(e){if(e<1||e>255)throw new RangeError("Degree out of range");for(var t=[],r=0;r<e-1;r++)t.push(0);t.push(1);for(var n=1,r=0;r<e;r++){for(var s=0;s<t.length;s++)t[s]=a.reedSolomonMultiply(t[s],n),s+1<t.length&&(t[s]^=t[s+1]);n=a.reedSolomonMultiply(n,2)}return t},a.reedSolomonComputeRemainder=function(e,t){for(var r=t.map(function(p){return 0}),n=function(p){var M=p^r.shift();r.push(0),t.forEach(function(w,C){return r[C]^=a.reedSolomonMultiply(w,M)})},s=0,i=e;s<i.length;s++){var h=i[s];n(h)}return r},a.reedSolomonMultiply=function(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");for(var r=0,n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(t>>>n&1)*e;return f(r>>>8==0),r},a.prototype.finderPenaltyCountPatterns=function(e){var t=e[1];f(t<=this.size*3);var r=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(r&&e[0]>=t*4&&e[6]>=t?1:0)+(r&&e[6]>=t*4&&e[0]>=t?1:0)},a.prototype.finderPenaltyTerminateAndCount=function(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)},a.prototype.finderPenaltyAddHistory=function(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)},a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],a.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],a})();o.QrCode=c;function u(a,e,t){if(e<0||e>31||a>>>e)throw new RangeError("Value out of range");for(var r=e-1;r>=0;r--)t.push(a>>>r&1)}function l(a,e){return(a>>>e&1)!=0}function f(a){if(!a)throw new Error("Assertion error")}var v=(function(){function a(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}return a.makeBytes=function(e){for(var t=[],r=0,n=e;r<n.length;r++){var s=n[r];u(s,8,t)}return new a(a.Mode.BYTE,e.length,t)},a.makeNumeric=function(e){if(!a.isNumeric(e))throw new RangeError("String contains non-numeric characters");for(var t=[],r=0;r<e.length;){var n=Math.min(e.length-r,3);u(parseInt(e.substring(r,r+n),10),n*3+1,t),r+=n}return new a(a.Mode.NUMERIC,e.length,t)},a.makeAlphanumeric=function(e){if(!a.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");var t=[],r;for(r=0;r+2<=e.length;r+=2){var n=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r))*45;n+=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r+1)),u(n,11,t)}return r<e.length&&u(a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r)),6,t),new a(a.Mode.ALPHANUMERIC,e.length,t)},a.makeSegments=function(e){return e==""?[]:a.isNumeric(e)?[a.makeNumeric(e)]:a.isAlphanumeric(e)?[a.makeAlphanumeric(e)]:[a.makeBytes(a.toUtf8ByteArray(e))]},a.makeEci=function(e){var t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)u(e,8,t);else if(e<16384)u(2,2,t),u(e,14,t);else if(e<1e6)u(6,3,t),u(e,21,t);else throw new RangeError("ECI assignment value out of range");return new a(a.Mode.ECI,0,t)},a.isNumeric=function(e){return a.NUMERIC_REGEX.test(e)},a.isAlphanumeric=function(e){return a.ALPHANUMERIC_REGEX.test(e)},a.prototype.getData=function(){return this.bitData.slice()},a.getTotalBits=function(e,t){for(var r=0,n=0,s=e;n<s.length;n++){var i=s[n],h=i.mode.numCharCountBits(t);if(i.numChars>=1<<h)return 1/0;r+=4+h+i.bitData.length}return r},a.toUtf8ByteArray=function(e){e=encodeURI(e);for(var t=[],r=0;r<e.length;r++)e.charAt(r)!="%"?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t},a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",a})();o.QrSegment=v})(F||(F={}));(function(o){(function(c){var u=(function(){function l(f,v){this.ordinal=f,this.formatBits=v}return l.LOW=new l(0,1),l.MEDIUM=new l(1,0),l.QUARTILE=new l(2,3),l.HIGH=new l(3,2),l})();c.Ecc=u})(o.QrCode||(o.QrCode={}))})(F||(F={}));(function(o){(function(c){var u=(function(){function l(f,v){this.modeBits=f,this.numBitsCharCount=v}return l.prototype.numCharCountBits=function(f){return this.numBitsCharCount[Math.floor((f+7)/17)]},l.NUMERIC=new l(1,[10,12,14]),l.ALPHANUMERIC=new l(2,[9,11,13]),l.BYTE=new l(4,[8,16,16]),l.KANJI=new l(8,[8,10,12]),l.ECI=new l(7,[0,0,0]),l})();c.Mode=u})(o.QrSegment||(o.QrSegment={}))})(F||(F={}));var U=F,K="L",W={L:U.QrCode.Ecc.LOW,M:U.QrCode.Ecc.MEDIUM,Q:U.QrCode.Ecc.QUARTILE,H:U.QrCode.Ecc.HIGH},pe=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();function q(o){return o in W}function j(o,c){c===void 0&&(c=0);var u=[];return o.forEach(function(l,f){var v=null;l.forEach(function(a,e){if(!a&&v!==null){u.push("M".concat(v+c," ").concat(f+c,"h").concat(e-v,"v1H").concat(v+c,"z")),v=null;return}if(e===l.length-1){if(!a)return;v===null?u.push("M".concat(e+c,",").concat(f+c," h1v1H").concat(e+c,"z")):u.push("M".concat(v+c,",").concat(f+c," h").concat(e+1-v,"v1H").concat(v+c,"z"));return}a&&v===null&&(v=e)})}),u.join("")}function ee(o,c,u,l){var f=l.width,v=l.height,a=l.x,e=l.y,t=o.length+u*2,r=Math.floor(c*.1),n=t/c,s=(f||r)*n,i=(v||r)*n,h=a==null?o.length/2-s/2:a*n,p=e==null?o.length/2-i/2:e*n,M=null;if(l.excavate){var w=Math.floor(h),C=Math.floor(p),R=Math.ceil(s+h-w),m=Math.ceil(i+p-C);M={x:w,y:C,w:R,h:m}}return{x:h,y:p,h:i,w:s,excavation:M}}function te(o,c){return o.slice().map(function(u,l){return l<c.y||l>=c.y+c.h?u:u.map(function(f,v){return v<c.x||v>=c.x+c.w?f:!1})})}var V={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:K,validator:function(o){return q(o)}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(o){return["linear","radial"].indexOf(o)>-1}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},me=D(D({},V),{renderAs:{type:String,required:!1,default:"canvas",validator:function(o){return["canvas","svg"].indexOf(o)>-1}}}),Ce=G({name:"QRCodeSvg",props:V,setup:function(o){var c=y(0),u=y(""),l,f=function(){var a=o.value,e=o.level,t=o.margin,r=t>>>0,n=q(e)?e:K,s=U.QrCode.encodeText(a,W[n]).getModules();if(c.value=s.length+r*2,o.imageSettings.src){var i=ee(s,o.size,r,o.imageSettings);l={x:i.x+r,y:i.y+r,width:i.w,height:i.h},i.excavation&&(s=te(s,i.excavation))}u.value=j(s,r)},v=function(){if(!o.gradient)return null;var a=o.gradientType==="linear"?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"};return N(o.gradientType==="linear"?"linearGradient":"radialGradient",D({id:"qr-gradient"},a),[N("stop",{offset:"0%",style:{stopColor:o.gradientStartColor}}),N("stop",{offset:"100%",style:{stopColor:o.gradientEndColor}})])};return f(),Z(f),function(){return N("svg",{width:o.size,height:o.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(c.value," ").concat(c.value)},[N("defs",{},[v()]),N("rect",{width:"100%",height:"100%",fill:o.background}),N("path",{fill:o.gradient?"url(#qr-gradient)":o.foreground,d:u.value}),o.imageSettings.src&&N("image",D({href:o.imageSettings.src},l))])}}}),we=G({name:"QRCodeCanvas",props:V,setup:function(o,c){var u=y(null),l=y(null),f=function(){var a=o.value,e=o.level,t=o.size,r=o.margin,n=o.background,s=o.foreground,i=o.gradient,h=o.gradientType,p=o.gradientStartColor,M=o.gradientEndColor,w=r>>>0,C=q(e)?e:K,R=u.value;if(R){var m=R.getContext("2d");if(m){var g=U.QrCode.encodeText(a,W[C]).getModules(),E=g.length+w*2,P=l.value,S={x:0,y:0,width:0,height:0},b=o.imageSettings.src&&P!=null&&P.naturalWidth!==0&&P.naturalHeight!==0;if(b){var A=ee(g,o.size,w,o.imageSettings);S={x:A.x+w,y:A.y+w,width:A.w,height:A.h},A.excavation&&(g=te(g,A.excavation))}var k=window.devicePixelRatio||1,L=t/E*k;if(R.height=R.width=t*k,m.scale(L,L),m.fillStyle=n,m.fillRect(0,0,E,E),i){var I=void 0;h==="linear"?I=m.createLinearGradient(0,0,E,E):I=m.createRadialGradient(E/2,E/2,0,E/2,E/2,E/2),I.addColorStop(0,p),I.addColorStop(1,M),m.fillStyle=I}else m.fillStyle=s;pe?m.fill(new Path2D(j(g,w))):g.forEach(function(T,O){T.forEach(function(Q,X){Q&&m.fillRect(X+w,O+w,1,1)})}),b&&m.drawImage(P,S.x,S.y,S.width,S.height)}}};ne(f),Z(f);var v=c.attrs.style;return function(){return N(oe,[N("canvas",D(D({},c.attrs),{ref:u,style:D(D({},v),{width:"".concat(o.size,"px"),height:"".concat(o.size,"px")})})),o.imageSettings.src&&N("img",{ref:l,src:o.imageSettings.src,style:{display:"none"},onLoad:f})])}}}),$e=G({name:"Qrcode",render:function(){var o=this.$props,c=o.renderAs,u=o.value,l=o.size,f=o.margin,v=o.level,a=o.background,e=o.foreground,t=o.imageSettings,r=o.gradient,n=o.gradientType,s=o.gradientStartColor,i=o.gradientEndColor;return N(c==="svg"?Ce:we,{value:u,size:l,margin:f,level:v,background:a,foreground:e,imageSettings:t,gradient:r,gradientType:n,gradientStartColor:s,gradientEndColor:i})},props:me});const Ye=ie("fileData",()=>{const o=y(x.IDLE),c=y({loaded:0,total:0,percentage:0}),u=y(""),l=y(null),f=y(""),v=y(null),a=y(!1),e=y([]),t=y(0),r=y(1),n=y(10),s=y(!1),i=y([]),h=y([]),p=B(()=>o.value===x.UPLOADING),M=B(()=>o.value===x.SUCCESS),w=B(()=>o.value===x.ERROR),C=B(()=>v.value!==null),R=B(()=>C.value&&!a.value),m=B(()=>Math.ceil(t.value/n.value)),g=d=>{o.value=d},E=d=>{c.value=d},P=d=>{u.value=d},S=d=>{l.value=d},b=()=>{o.value=x.IDLE,c.value={loaded:0,total:0,percentage:0},u.value="",l.value=null},A=d=>{f.value=d},k=d=>{v.value=d},L=d=>{a.value=d},I=()=>{f.value="",v.value=null,a.value=!1},T=d=>{e.value=d},O=d=>{e.value.unshift(d),t.value+=1};return{uploadStatus:o,uploadProgress:c,uploadedCode:u,currentFile:l,downloadCode:f,fileInfo:v,isDownloading:a,fileList:e,totalFiles:t,currentPage:r,pageSize:n,isLoadingList:s,isUploading:p,isUploadSuccess:M,isUploadError:w,hasFileInfo:C,canDownload:R,totalPages:m,setUploadStatus:g,setUploadProgress:E,setUploadedCode:P,setCurrentFile:S,resetUpload:b,setDownloadCode:A,setFileInfo:k,setDownloading:L,resetDownload:I,setFileList:T,addFile:O,removeFile:d=>{const _=e.value.findIndex(z=>z.id===d);_>-1&&(e.value.splice(_,1),t.value-=1)},updateFile:(d,_)=>{const z=e.value.findIndex(ae=>ae.id===d);z>-1&&(e.value[z]={...e.value[z],..._})},setTotalFiles:d=>{t.value=d},setCurrentPage:d=>{r.value=d},setPageSize:d=>{n.value=d},setLoadingList:d=>{s.value=d},resetFileList:()=>{e.value=[],t.value=0,r.value=1,s.value=!1},addShareData:d=>{if(P(d.code),d.name){const _={id:d.code,name:d.name,size:0,type:"",uploadTime:new Date().toISOString(),downloadCount:0};O(_)}},receiveData:i,addReceiveData:d=>{i.value.push(d)},removeReceiveData:d=>{const _=i.value.findIndex(z=>z.id===d);_>-1&&i.value.splice(_,1)},deleteReceiveData:d=>{d>-1&&d<i.value.length&&i.value.splice(d,1)},clearReceiveData:()=>{i.value=[]},shareData:h,addShareDataRecord:d=>{h.value.push(d)},deleteShareData:d=>{d>-1&&d<h.value.length&&h.value.splice(d,1)},clearShareData:()=>{h.value=[]}}}),re=async(o,c={})=>{const{successMsg:u="复制成功",errorMsg:l="复制失败,请手动复制",showMsg:f=!0}=c,v=se();try{if(document.hasFocus()&&navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(o),f&&v.showAlert(u,"success"),!0;const a=document.createElement("textarea");a.value=o,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();const e=document.execCommand("copy");if(document.body.removeChild(a),e)return f&&v.showAlert(u,"success"),!0;throw new Error("execCommand copy failed")}catch(a){return console.error("复制失败:",a),f&&v.showAlert(l,"error"),!1}},Ke=async o=>{const c=`${window.location.origin}/#/?code=${o}`;return re(c,{successMsg:"取件链接已复制到剪贴板",errorMsg:"复制失败,请手动复制取件链接"})},We=async o=>re(o,{successMsg:"取件码已复制到剪贴板",errorMsg:"复制失败,请手动复制取件码"}),Ee=window.location.origin+"/",qe=(o,c)=>{const u=`wget ${Ee}share/select?code=${o} -O "${c}"`;navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(u).then(()=>{console.log("命令已复制到剪贴板!")}).catch(l=>{console.error("复制失败,使用回退方法:",l),$(u)}):(console.warn("Clipboard API 不可用,使用回退方法。"),$(u))};function $(o){const c=document.createElement("textarea");c.value=o,c.style.position="fixed",document.body.appendChild(c),c.focus(),c.select();try{const u=document.execCommand("copy");console.log("回退复制操作成功:",u),document.hasFocus()&&navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(o):$(o)}catch(u){console.error("回退复制操作失败:",u)}document.body.removeChild(c)}const Me={class:"text-center"},ye={class:"flex justify-center mb-8"},Re={class:"rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"},Se={class:"rounded-full bg-gray-900 p-2"},Pe=G({__name:"PageHeader",props:{title:{}},emits:["title-click"],setup(o){const c=fe("isDarkMode");return(u,l)=>(ue(),le("div",Me,[H("div",ye,[H("div",Re,[H("div",Se,[ce(J(ge),{class:"w-8 h-8 text-white"})])])]),H("h2",{onClick:l[0]||(l[0]=f=>u.$emit("title-click")),class:de(["text-3xl cursor-pointer font-extrabold text-center mb-6",[J(c)?"text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300":"text-indigo-600"]])},he(u.title),3)]))}}),Ve=ve(Pe,[["__scopeId","data-v-2a18d8c8"]]);export{xe as C,He as E,Ve as P,$e as Q,Ge as S,qe as a,Ke as b,We as c,re as d,Ye as u};
|