niucloud-admin/niucloud/public/admin/assets/preview-ba8d2d34.js
全栈小学生 26524c4bf5 update admin
2023-08-12 16:21:13 +08:00

9 lines
29 KiB
JavaScript

import{d as Jt,r as D,R as $t,w as Yt,e as Q,f as _t,Q as $,g as S,B as V,u as M,y as P,x as U,A as bt,v as At,H as qt}from"./base-04829be5.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{E as Ot,v as Y}from"./index-30df2c14.js";import{t as T}from"./index-043d021e.js";import{u as jt}from"./vue-router-fee568b2.js";import{g as Gt}from"./weapp-9f5d7d39.js";import{w as Qt}from"./sys-f9859bed.js";import{f as Wt,a as Zt}from"./storage-1a3ddb14.js";import{l as Xt}from"./diy-7cd4083a.js";import{a as st}from"./index-92283b18.js";import{E as te}from"./index-db9b8d96.js";import{E as ee}from"./index-eb678249.js";import{a as ne,E as oe}from"./index-6bd50bb5.js";import{E as re}from"./index-c4af56cf.js";import"./index-7e933ae4.js";import"./common-111e3797.js";import"./common-2cf17469.js";import"./index-faea7bd5.js";import"./index-236cb599.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./typescript-defaf979.js";import"./index-a2524300.js";import"./event-9519ab40.js";import"./index-d7f4b4bb.js";import"./index-de053f2e.js";import"./error-78e43d3e.js";import"./index-4edf2cad.js";import"./castArray-11aea762.js";import"./_Uint8Array-99b916e9.js";import"./_initCloneObject-e5a1aa13.js";import"./index-ed22fe56.js";import"./index-1d455165.js";import"./debounce-f064e94e.js";import"./position-b298e95e.js";import"./scroll-e5463626.js";var j={},ie=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},vt={},I={};let wt;const se=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];I.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};I.getSymbolTotalCodewords=function(t){return se[t]};I.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};I.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');wt=t};I.isKanjiModeEnabled=function(){return typeof wt<"u"};I.toSJIS=function(t){return wt(t)};var et={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+i)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,n){if(e.isValid(r))return r;try{return t(r)}catch{return n}}})(et);function St(){this.buffer=[],this.length=0}St.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let i=0;i<t;i++)this.putBit((e>>>t-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var ae=St;function G(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}G.prototype.set=function(e,t,i,r){const n=e*this.size+t;this.data[n]=i,r&&(this.reservedBit[n]=!0)};G.prototype.get=function(e,t){return this.data[e*this.size+t]};G.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i};G.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var ue=G,Mt={};(function(e){const t=I.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const n=Math.floor(r/7)+2,o=t(r),s=o===145?26:Math.ceil((o-13)/(2*n-2))*2,a=[o-7];for(let u=1;u<n-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},e.getPositions=function(r){const n=[],o=e.getRowColCoords(r),s=o.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||n.push([o[a],o[u]]);return n}})(Mt);var Pt={};const le=I.getSymbolSize,It=7;Pt.getPositions=function(t){const i=le(t);return[[0,0],[i-It,0],[0,i-It]]};var Rt={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const o=n.size;let s=0,a=0,u=0,l=null,c=null;for(let B=0;B<o;B++){a=u=0,l=c=null;for(let p=0;p<o;p++){let d=n.get(B,p);d===l?a++:(a>=5&&(s+=t.N1+(a-5)),l=d,a=1),d=n.get(p,B),d===c?u++:(u>=5&&(s+=t.N1+(u-5)),c=d,u=1)}a>=5&&(s+=t.N1+(a-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(n){const o=n.size;let s=0;for(let a=0;a<o-1;a++)for(let u=0;u<o-1;u++){const l=n.get(a,u)+n.get(a,u+1)+n.get(a+1,u)+n.get(a+1,u+1);(l===4||l===0)&&s++}return s*t.N2},e.getPenaltyN3=function(n){const o=n.size;let s=0,a=0,u=0;for(let l=0;l<o;l++){a=u=0;for(let c=0;c<o;c++)a=a<<1&2047|n.get(l,c),c>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|n.get(c,l),c>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(n){let o=0;const s=n.data.length;for(let u=0;u<s;u++)o+=n.data[u];return Math.abs(Math.ceil(o*100/s/5)-10)*t.N4};function i(r,n,o){switch(r){case e.Patterns.PATTERN000:return(n+o)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return o%3===0;case e.Patterns.PATTERN011:return(n+o)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(o/3))%2===0;case e.Patterns.PATTERN101:return n*o%2+n*o%3===0;case e.Patterns.PATTERN110:return(n*o%2+n*o%3)%2===0;case e.Patterns.PATTERN111:return(n*o%3+(n+o)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(n,o){const s=o.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)o.isReserved(u,a)||o.xor(u,a,i(n,u,a))},e.getBestMask=function(n,o){const s=Object.keys(e.Patterns).length;let a=0,u=1/0;for(let l=0;l<s;l++){o(l),e.applyMask(l,n);const c=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(l,n),c<u&&(u=c,a=l)}return a}})(Rt);var nt={};const F=et,W=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Z=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];nt.getBlocksCount=function(t,i){switch(i){case F.L:return W[(t-1)*4+0];case F.M:return W[(t-1)*4+1];case F.Q:return W[(t-1)*4+2];case F.H:return W[(t-1)*4+3];default:return}};nt.getTotalCodewordsCount=function(t,i){switch(i){case F.L:return Z[(t-1)*4+0];case F.M:return Z[(t-1)*4+1];case F.Q:return Z[(t-1)*4+2];case F.H:return Z[(t-1)*4+3];default:return}};var Lt={},ot={};const q=new Uint8Array(512),X=new Uint8Array(256);(function(){let t=1;for(let i=0;i<255;i++)q[i]=t,X[t]=i,t<<=1,t&256&&(t^=285);for(let i=255;i<512;i++)q[i]=q[i-255]})();ot.log=function(t){if(t<1)throw new Error("log("+t+")");return X[t]};ot.exp=function(t){return q[t]};ot.mul=function(t,i){return t===0||i===0?0:q[X[t]+X[i]]};(function(e){const t=ot;e.mul=function(r,n){const o=new Uint8Array(r.length+n.length-1);for(let s=0;s<r.length;s++)for(let a=0;a<n.length;a++)o[s+a]^=t.mul(r[s],n[a]);return o},e.mod=function(r,n){let o=new Uint8Array(r);for(;o.length-n.length>=0;){const s=o[0];for(let u=0;u<n.length;u++)o[u]^=t.mul(n[u],s);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o},e.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let o=0;o<r;o++)n=e.mul(n,new Uint8Array([1,t.exp(o)]));return n}})(Lt);const Dt=Lt;function yt(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}yt.prototype.initialize=function(t){this.degree=t,this.genPoly=Dt.generateECPolynomial(this.degree)};yt.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(t.length+this.degree);i.set(t);const r=Dt.mod(i,this.genPoly),n=this.degree-r.length;if(n>0){const o=new Uint8Array(this.degree);return o.set(r,n),o}return r};var ce=yt,Ut={},k={},Et={};Et.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var R={};const Ft="[0-9]+",fe="[A-Z $%*+\\-./:]+";let O="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";O=O.replace(/u/g,"\\u");const de="(?:(?![A-Z0-9 $%*+\\-./:]|"+O+`)(?:.|[\r
]))+`;R.KANJI=new RegExp(O,"g");R.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");R.BYTE=new RegExp(de,"g");R.NUMERIC=new RegExp(Ft,"g");R.ALPHANUMERIC=new RegExp(fe,"g");const ge=new RegExp("^"+O+"$"),he=new RegExp("^"+Ft+"$"),me=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");R.testKanji=function(t){return ge.test(t)};R.testNumeric=function(t){return he.test(t)};R.testAlphanumeric=function(t){return me.test(t)};(function(e){const t=Et,i=R;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},e.getBestModeForData=function(o){return i.testNumeric(o)?e.NUMERIC:i.testAlphanumeric(o)?e.ALPHANUMERIC:i.testKanji(o)?e.KANJI:e.BYTE},e.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},e.isValid=function(o){return o&&o.bit&&o.ccBits};function r(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(o,s){if(e.isValid(o))return o;try{return r(o)}catch{return s}}})(k);(function(e){const t=I,i=nt,r=et,n=k,o=Et,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=t.getBCHDigit(s);function u(p,d,w){for(let y=1;y<=40;y++)if(d<=e.getCapacity(y,w,p))return y}function l(p,d){return n.getCharCountIndicator(p,d)+4}function c(p,d){let w=0;return p.forEach(function(y){const b=l(y.mode,d);w+=b+y.getBitsLength()}),w}function B(p,d){for(let w=1;w<=40;w++)if(c(p,w)<=e.getCapacity(w,d,n.MIXED))return w}e.from=function(d,w){return o.isValid(d)?parseInt(d,10):w},e.getCapacity=function(d,w,y){if(!o.isValid(d))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=n.BYTE);const b=t.getSymbolTotalCodewords(d),m=i.getTotalCodewordsCount(d,w),h=(b-m)*8;if(y===n.MIXED)return h;const f=h-l(y,d);switch(y){case n.NUMERIC:return Math.floor(f/10*3);case n.ALPHANUMERIC:return Math.floor(f/11*2);case n.KANJI:return Math.floor(f/13);case n.BYTE:default:return Math.floor(f/8)}},e.getBestVersionForData=function(d,w){let y;const b=r.from(w,r.M);if(Array.isArray(d)){if(d.length>1)return B(d,b);if(d.length===0)return 1;y=d[0]}else y=d;return u(y.mode,y.getLength(),b)},e.getEncodedBits=function(d){if(!o.isValid(d)||d<7)throw new Error("Invalid QR Code version");let w=d<<12;for(;t.getBCHDigit(w)-a>=0;)w^=s<<t.getBCHDigit(w)-a;return d<<12|w}})(Ut);var kt={};const dt=I,Vt=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,pe=1<<14|1<<12|1<<10|1<<4|1<<1,Tt=dt.getBCHDigit(Vt);kt.getEncodedBits=function(t,i){const r=t.bit<<3|i;let n=r<<10;for(;dt.getBCHDigit(n)-Tt>=0;)n^=Vt<<dt.getBCHDigit(n)-Tt;return(r<<10|n)^pe};var zt={};const we=k;function z(e){this.mode=we.NUMERIC,this.data=e.toString()}z.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};z.prototype.getLength=function(){return this.data.length};z.prototype.getBitsLength=function(){return z.getBitsLength(this.data.length)};z.prototype.write=function(t){let i,r,n;for(i=0;i+3<=this.data.length;i+=3)r=this.data.substr(i,3),n=parseInt(r,10),t.put(n,10);const o=this.data.length-i;o>0&&(r=this.data.substr(i),n=parseInt(r,10),t.put(n,o*3+1))};var ye=z;const Ee=k,at=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function x(e){this.mode=Ee.ALPHANUMERIC,this.data=e}x.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};x.prototype.getLength=function(){return this.data.length};x.prototype.getBitsLength=function(){return x.getBitsLength(this.data.length)};x.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let r=at.indexOf(this.data[i])*45;r+=at.indexOf(this.data[i+1]),t.put(r,11)}this.data.length%2&&t.put(at.indexOf(this.data[i]),6)};var Ce=x,Be=function(t){for(var i=[],r=t.length,n=0;n<r;n++){var o=t.charCodeAt(n);if(o>=55296&&o<=56319&&r>n+1){var s=t.charCodeAt(n+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,n+=1)}if(o<128){i.push(o);continue}if(o<2048){i.push(o>>6|192),i.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){i.push(o>>12|224),i.push(o>>6&63|128),i.push(o&63|128);continue}if(o>=65536&&o<=1114111){i.push(o>>18|240),i.push(o>>12&63|128),i.push(o>>6&63|128),i.push(o&63|128);continue}i.push(239,191,189)}return new Uint8Array(i).buffer};const _e=Be,be=k;function H(e){this.mode=be.BYTE,typeof e=="string"&&(e=_e(e)),this.data=new Uint8Array(e)}H.getBitsLength=function(t){return t*8};H.prototype.getLength=function(){return this.data.length};H.prototype.getBitsLength=function(){return H.getBitsLength(this.data.length)};H.prototype.write=function(e){for(let t=0,i=this.data.length;t<i;t++)e.put(this.data[t],8)};var Ae=H;const Ie=k,Te=I;function K(e){this.mode=Ie.KANJI,this.data=e}K.getBitsLength=function(t){return t*13};K.prototype.getLength=function(){return this.data.length};K.prototype.getBitsLength=function(){return K.getBitsLength(this.data.length)};K.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let i=Te.toSJIS(this.data[t]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),e.put(i,13)}};var Ne=K,gt={},ve={get exports(){return gt},set exports(e){gt=e}};(function(e){var t={single_source_shortest_paths:function(i,r,n){var o={},s={};s[r]=0;var a=t.PriorityQueue.make();a.push(r,0);for(var u,l,c,B,p,d,w,y,b;!a.empty();){u=a.pop(),l=u.value,B=u.cost,p=i[l]||{};for(c in p)p.hasOwnProperty(c)&&(d=p[c],w=B+d,y=s[c],b=typeof s[c]>"u",(b||y>w)&&(s[c]=w,a.push(c,w),o[c]=l))}if(typeof n<"u"&&typeof s[n]>"u"){var m=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(m)}return o},extract_shortest_path_from_predecessor_list:function(i,r){for(var n=[],o=r;o;)n.push(o),i[o],o=i[o];return n.reverse(),n},find_path:function(i,r,n){var o=t.single_source_shortest_paths(i,r,n);return t.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(i){var r=t.PriorityQueue,n={},o;i=i||{};for(o in r)r.hasOwnProperty(o)&&(n[o]=r[o]);return n.queue=[],n.sorter=i.sorter||r.default_sorter,n},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var n={value:i,cost:r};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(ve);(function(e){const t=k,i=ye,r=Ce,n=Ae,o=Ne,s=R,a=I,u=gt;function l(m){return unescape(encodeURIComponent(m)).length}function c(m,h,f){const g=[];let E;for(;(E=m.exec(f))!==null;)g.push({data:E[0],index:E.index,mode:h,length:E[0].length});return g}function B(m){const h=c(s.NUMERIC,t.NUMERIC,m),f=c(s.ALPHANUMERIC,t.ALPHANUMERIC,m);let g,E;return a.isKanjiModeEnabled()?(g=c(s.BYTE,t.BYTE,m),E=c(s.KANJI,t.KANJI,m)):(g=c(s.BYTE_KANJI,t.BYTE,m),E=[]),h.concat(f,g,E).sort(function(_,A){return _.index-A.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function p(m,h){switch(h){case t.NUMERIC:return i.getBitsLength(m);case t.ALPHANUMERIC:return r.getBitsLength(m);case t.KANJI:return o.getBitsLength(m);case t.BYTE:return n.getBitsLength(m)}}function d(m){return m.reduce(function(h,f){const g=h.length-1>=0?h[h.length-1]:null;return g&&g.mode===f.mode?(h[h.length-1].data+=f.data,h):(h.push(f),h)},[])}function w(m){const h=[];for(let f=0;f<m.length;f++){const g=m[f];switch(g.mode){case t.NUMERIC:h.push([g,{data:g.data,mode:t.ALPHANUMERIC,length:g.length},{data:g.data,mode:t.BYTE,length:g.length}]);break;case t.ALPHANUMERIC:h.push([g,{data:g.data,mode:t.BYTE,length:g.length}]);break;case t.KANJI:h.push([g,{data:g.data,mode:t.BYTE,length:l(g.data)}]);break;case t.BYTE:h.push([{data:g.data,mode:t.BYTE,length:l(g.data)}])}}return h}function y(m,h){const f={},g={start:{}};let E=["start"];for(let C=0;C<m.length;C++){const _=m[C],A=[];for(let N=0;N<_.length;N++){const v=_[N],J=""+C+N;A.push(J),f[J]={node:v,lastCount:0},g[J]={};for(let it=0;it<E.length;it++){const L=E[it];f[L]&&f[L].node.mode===v.mode?(g[L][J]=p(f[L].lastCount+v.length,v.mode)-p(f[L].lastCount,v.mode),f[L].lastCount+=v.length):(f[L]&&(f[L].lastCount=v.length),g[L][J]=p(v.length,v.mode)+4+t.getCharCountIndicator(v.mode,h))}}E=A}for(let C=0;C<E.length;C++)g[E[C]].end=0;return{map:g,table:f}}function b(m,h){let f;const g=t.getBestModeForData(m);if(f=t.from(h,g),f!==t.BYTE&&f.bit<g.bit)throw new Error('"'+m+'" cannot be encoded with mode '+t.toString(f)+`.
Suggested mode is: `+t.toString(g));switch(f===t.KANJI&&!a.isKanjiModeEnabled()&&(f=t.BYTE),f){case t.NUMERIC:return new i(m);case t.ALPHANUMERIC:return new r(m);case t.KANJI:return new o(m);case t.BYTE:return new n(m)}}e.fromArray=function(h){return h.reduce(function(f,g){return typeof g=="string"?f.push(b(g,null)):g.data&&f.push(b(g.data,g.mode)),f},[])},e.fromString=function(h,f){const g=B(h,a.isKanjiModeEnabled()),E=w(g),C=y(E,f),_=u.find_path(C.map,"start","end"),A=[];for(let N=1;N<_.length-1;N++)A.push(C.table[_[N]].node);return e.fromArray(d(A))},e.rawSplit=function(h){return e.fromArray(B(h,a.isKanjiModeEnabled()))}})(zt);const rt=I,ut=et,Se=ae,Me=ue,Pe=Mt,Re=Pt,ht=Rt,mt=nt,Le=ce,tt=Ut,De=kt,Ue=k,lt=zt;function Fe(e,t){const i=e.size,r=Re.getPositions(t);for(let n=0;n<r.length;n++){const o=r[n][0],s=r[n][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||i<=o+a))for(let u=-1;u<=7;u++)s+u<=-1||i<=s+u||(a>=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?e.set(o+a,s+u,!0,!0):e.set(o+a,s+u,!1,!0))}}function ke(e){const t=e.size;for(let i=8;i<t-8;i++){const r=i%2===0;e.set(i,6,r,!0),e.set(6,i,r,!0)}}function Ve(e,t){const i=Pe.getPositions(t);for(let r=0;r<i.length;r++){const n=i[r][0],o=i[r][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(n+s,o+a,!0,!0):e.set(n+s,o+a,!1,!0)}}function ze(e,t){const i=e.size,r=tt.getEncodedBits(t);let n,o,s;for(let a=0;a<18;a++)n=Math.floor(a/3),o=a%3+i-8-3,s=(r>>a&1)===1,e.set(n,o,s,!0),e.set(o,n,s,!0)}function ct(e,t,i){const r=e.size,n=De.getEncodedBits(t,i);let o,s;for(o=0;o<15;o++)s=(n>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(r-15+o,8,s,!0),o<8?e.set(8,r-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(r-8,8,1,!0)}function xe(e,t){const i=e.size;let r=-1,n=i-1,o=7,s=0;for(let a=i-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!e.isReserved(n,a-u)){let l=!1;s<t.length&&(l=(t[s]>>>o&1)===1),e.set(n,a-u,l),o--,o===-1&&(s++,o=7)}if(n+=r,n<0||i<=n){n-=r,r=-r;break}}}function He(e,t,i){const r=new Se;i.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),Ue.getCharCountIndicator(u.mode,e)),u.write(r)});const n=rt.getSymbolTotalCodewords(e),o=mt.getTotalCodewordsCount(e,t),s=(n-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(s-r.getLengthInBits())/8;for(let u=0;u<a;u++)r.put(u%2?17:236,8);return Ke(r,e,t)}function Ke(e,t,i){const r=rt.getSymbolTotalCodewords(t),n=mt.getTotalCodewordsCount(t,i),o=r-n,s=mt.getBlocksCount(t,i),a=r%s,u=s-a,l=Math.floor(r/s),c=Math.floor(o/s),B=c+1,p=l-c,d=new Le(p);let w=0;const y=new Array(s),b=new Array(s);let m=0;const h=new Uint8Array(e.buffer);for(let _=0;_<s;_++){const A=_<u?c:B;y[_]=h.slice(w,w+A),b[_]=d.encode(y[_]),w+=A,m=Math.max(m,A)}const f=new Uint8Array(r);let g=0,E,C;for(E=0;E<m;E++)for(C=0;C<s;C++)E<y[C].length&&(f[g++]=y[C][E]);for(E=0;E<p;E++)for(C=0;C<s;C++)f[g++]=b[C][E];return f}function Je(e,t,i,r){let n;if(Array.isArray(e))n=lt.fromArray(e);else if(typeof e=="string"){let l=t;if(!l){const c=lt.rawSplit(e);l=tt.getBestVersionForData(c,i)}n=lt.fromString(e,l||40)}else throw new Error("Invalid data");const o=tt.getBestVersionForData(n,i);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+o+`.
`);const s=He(t,i,n),a=rt.getSymbolSize(t),u=new Me(a);return Fe(u,t),ke(u),Ve(u,t),ct(u,i,0),t>=7&&ze(u,t),xe(u,s),isNaN(r)&&(r=ht.getBestMask(u,ct.bind(null,u,i))),ht.applyMask(r,u),ct(u,i,r),{modules:u,version:t,errorCorrectionLevel:i,maskPattern:r,segments:n}}vt.create=function(t,i){if(typeof t>"u"||t==="")throw new Error("No input text");let r=ut.M,n,o;return typeof i<"u"&&(r=ut.from(i.errorCorrectionLevel,ut.M),n=tt.from(i.version),o=ht.from(i.maskPattern),i.toSJISFunc&&rt.setToSJISFunction(i.toSJISFunc)),Je(t,n,r,o)};var xt={},Ct={};(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(o){return[o,o]}))),r.length===6&&r.push("F","F");const n=parseInt(r.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const n=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,o=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:o,scale:o?4:s,margin:n,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,n){return n.width&&n.width>=r+n.margin*2?n.width/(r+n.margin*2):n.scale},e.getImageWidth=function(r,n){const o=e.getScale(r,n);return Math.floor((r+n.margin*2)*o)},e.qrToImageData=function(r,n,o){const s=n.modules.size,a=n.modules.data,u=e.getScale(s,o),l=Math.floor((s+o.margin*2)*u),c=o.margin*u,B=[o.color.light,o.color.dark];for(let p=0;p<l;p++)for(let d=0;d<l;d++){let w=(p*l+d)*4,y=o.color.light;if(p>=c&&d>=c&&p<l-c&&d<l-c){const b=Math.floor((p-c)/u),m=Math.floor((d-c)/u);y=B[a[b*s+m]?1:0]}r[w++]=y.r,r[w++]=y.g,r[w++]=y.b,r[w]=y.a}}})(Ct);(function(e){const t=Ct;function i(n,o,s){n.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=s,o.width=s,o.style.height=s+"px",o.style.width=s+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(o,s,a){let u=a,l=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(l=r()),u=t.getOptions(u);const c=t.getImageWidth(o.modules.size,u),B=l.getContext("2d"),p=B.createImageData(c,c);return t.qrToImageData(p.data,o,u),i(B,l,c),B.putImageData(p,0,0),l},e.renderToDataURL=function(o,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const l=e.render(o,s,u),c=u.type||"image/png",B=u.rendererOpts||{};return l.toDataURL(c,B.quality)}})(xt);var Ht={};const $e=Ct;function Nt(e,t){const i=e.a/255,r=t+'="'+e.hex+'"';return i<1?r+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':r}function ft(e,t,i){let r=e+t;return typeof i<"u"&&(r+=" "+i),r}function Ye(e,t,i){let r="",n=0,o=!1,s=0;for(let a=0;a<e.length;a++){const u=Math.floor(a%t),l=Math.floor(a/t);!u&&!o&&(o=!0),e[a]?(s++,a>0&&u>0&&e[a-1]||(r+=o?ft("M",u+i,.5+l+i):ft("m",n,0),n=0,o=!1),u+1<t&&e[a+1]||(r+=ft("h",s),s=0)):n++}return r}Ht.render=function(t,i,r){const n=$e.getOptions(i),o=t.modules.size,s=t.modules.data,a=o+n.margin*2,u=n.color.light.a?"<path "+Nt(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+Nt(n.color.dark,"stroke")+' d="'+Ye(s,o,n.margin)+'"/>',c='viewBox="0 0 '+a+" "+a+'"',p='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+c+' shape-rendering="crispEdges">'+u+l+`</svg>
`;return typeof r=="function"&&r(null,p),p};const qe=ie,pt=vt,Kt=xt,Oe=Ht;function Bt(e,t,i,r,n){const o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!qe())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(n=i,i=t,t=r=void 0):s===3&&(t.getContext&&typeof n>"u"?(n=r,r=void 0):(n=r,r=i,i=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=t,t=r=void 0):s===2&&!t.getContext&&(r=i,i=t,t=void 0),new Promise(function(u,l){try{const c=pt.create(i,r);u(e(c,t,r))}catch(c){l(c)}})}try{const u=pt.create(i,r);n(null,e(u,t,r))}catch(u){n(u)}}j.create=pt.create;j.toCanvas=Bt.bind(null,Kt.render);j.toDataURL=Bt.bind(null,Kt.renderToDataURL);j.toString=Bt.bind(null,function(e,t,i){return Oe.render(e,i)});const je={class:"main-container w-[375px] mx-auto my-[20px] relative"},Ge={class:"flex h-full"},Qe=["src"],We={class:"w-[375px] border border-slate-100 bg-body pt-[20px] px-[20px]"},Ze={class:"font-bold text-xl mb-[40px]"},Xe={class:"mb-[20px] flex flex-col"},tn={class:"mb-[10px]"},en={key:0,class:"w-[400px] absolute bg-body top-[10%] -right-[450px]"},nn={class:"info-wrap mt-[20px]"},on={class:"px-[20px] pb-[10px] font-bold"},rn={class:"px-[20px] pb-[10px] font-bold mt-[40px]"},sn={class:"text-gray-400"},qn=Jt({__name:"preview",setup(e){const t=D(""),i=D(""),r=D(""),n=D(""),o=D(!1),s=D(!1),a=D(!1),u=D(0);new Date().getTime();const l=jt();l.query.id=l.query.id||0,l.query.name=l.query.name||"",Qt().then(h=>{i.value=h.data.wap_domain,t.value=h.data.wap_url,B()});const c=()=>{if(i.value.trim().length==0){st({type:"warning",message:`${T("wapDomainPlaceholder")}`});return}t.value=i.value+"/wap",B(),Zt.set({key:"wap_domain",data:t.value}),s.value=!0,a.value=!1},B=()=>{Xt({id:l.query.id,name:l.query.name}).then(h=>{let f=h.data;n.value=`${t.value}/${f.page}`,j.toDataURL(n.value,{errorCorrectionLevel:"L",margin:0,width:100}).then(g=>{r.value=g})})},p=()=>{if(n.value){var h=new Date().getTime(),f=h-u.value;f<1e3?(a.value=!0,s.value=!1,n.value="",r.value=""):(a.value=!1,s.value=!0),o.value=!0}},d=$t({qr_code:""});D("weapp"),Gt().then(h=>{if(h.code==1){let f=h.data;d.qr_code=f.qr_code}});const{copy:w,isSupported:y,copied:b}=Ot(),m=h=>{y.value||st({message:T("notSupportCopy"),type:"warning"}),w(h)};return Yt(b,()=>{b.value&&st({message:T("copySuccess"),type:"success"})}),(h,f)=>{const g=te,E=ee,C=ne,_=re,A=oe;return Q(),_t("div",je,[$(S("div",Ge,[$(S("iframe",{class:"w-[375px] border border-slate-100 bg-gray-100",src:n.value,frameborder:"0",id:"previewIframe",onLoad:p},null,40,Qe),[[Y,s.value]]),$(S("div",We,[S("div",Ze,V(M(T)("developTitle")),1),S("div",Xe,[S("text",tn,V(M(T)("wapDomain")),1),P(g,{modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=N=>i.value=N),placeholder:M(T)("wapDomainPlaceholder"),clearable:""},null,8,["modelValue","placeholder"])]),P(E,{type:"primary",onClick:c},{default:U(()=>[bt(V(M(T)("confirm")),1)]),_:1})],512),[[Y,a.value]]),s.value?(Q(),_t("div",en,[S("div",nn,[S("div",on,V(M(T)("h5")),1),P(A,{"label-width":"40px",class:"px-[20px]"},{default:U(()=>[$(P(C,{label:M(T)("link")},{default:U(()=>[P(g,{readonly:"",value:n.value},{append:U(()=>[P(E,{onClick:f[1]||(f[1]=N=>m(n.value)),class:"bg-primary copy"},{default:U(()=>[bt(V(M(T)("copy")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),[[Y,n.value]]),$(P(C,{label:" "},{default:U(()=>[P(_,{src:r.value},null,8,["src"])]),_:1},512),[[Y,r.value]])]),_:1}),S("div",rn,V(M(T)("weapp")),1),P(A,{"label-width":"40px",class:"px-[20px]"},{default:U(()=>[d.qr_code?(Q(),At(C,{key:0,label:" "},{default:U(()=>[P(_,{class:"w-[100px] h-[100px]",src:M(Wt)(d.qr_code)},null,8,["src"])]),_:1})):(Q(),At(C,{key:1,label:" "},{default:U(()=>[S("span",sn,V(M(T)("weappNotSet")),1)]),_:1}))]),_:1})])])):qt("",!0)],512),[[Y,o.value]])])}}});export{qn as default};