|
|
import{d as t,e,f as n,W as r,j as o,k as i,s as a,v as s,g as u,S as l,t as c,y as d,G as f,u as h,z as g,B as v,F as p,C as m,x as w,J as y,H as E,T as C,a5 as A,$ as B,m as _}from"./index-BBl9NF8i.js";import{j as b,e as I}from"./content.DVkGYAJC.js";import{a as M,f as T}from"./datetime.DReAHQ1x.js";import{_ as N}from"./_plugin-vue_export-helper.BCo6x5W8.js";var P={},R={},L={};let x;const k=[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];L.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 4*t+17},L.getSymbolTotalCodewords=function(t){return k[t]},L.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},L.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');x=t},L.isKanjiModeEnabled=function(){return void 0!==x},L.toSJIS=function(t){return x(t)};var U,S={};function F(){this.buffer=[],this.length=0}(U=S).L={bit:1},U.M={bit:0},U.Q={bit:3},U.H={bit:2},U.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},U.from=function(t,e){if(U.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return U.L;case"m":case"medium":return U.M;case"q":case"quartile":return U.Q;case"h":case"high":return U.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(n){return e}},F.prototype={get:function(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(let n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var z=F;function D(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}D.prototype.set=function(t,e,n,r){const o=t*this.size+e;this.data[o]=n,r&&(this.reservedBit[o]=!0)},D.prototype.get=function(t,e){return this.data[t*this.size+e]},D.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},D.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var H=D,J={};!function(t){const e=L.getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,r=e(t),o=145===r?26:2*Math.ceil((r-13)/(2*n-2)),i=[r-7];for(let e=1;e<n-1;e++)i[e]=i[e-1]-o;return i.push(6),i.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),o=r.length;for(let t=0;t<o;t++)for(let e=0;e<o;e++)0===t&&0===e||0===t&&e===o-1||t===o-1&&0===e||n.push([r[t],r[e]]);return n}}(J);var K={};const Y=L.getSymbolSize;K.getPositions=function(t){const e=Y(t);return[[0,0],[e-7,0],[0,e-7]]};var q={};!function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e=3,n=3,r=40,o=10;function i(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,o=0,i=0,a=null,s=null;for(let u=0;u<n;u++){o=i=0,a=s=null;for(let l=0;l<n;l++){let n=t.get(u,l);n===a?o++:(o>=5&&(r+=e+(o-5)),a=n,o=1),n=t.get(l,u),n===s?i++:(i>=5&&(r+=e+(i-5)),s=n,i=1)}o>=5&&(r+=e+(o-5)),i>=5&&(r+=e+(i-5))}return r},t.getPenaltyN2=function(t){const e=t.size;let r=0;for(let n=0;n<e-1;n++)for(let o=0;o<e-1;o++){const e=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==e&&0!==e||r++}return r*n},t.getPenaltyN3=function(t){const e=t.size;let n=0,o=0,i=0;for(let r=0;r<e;r++){o=i=0;for(let a=0;a<e;a++)o=o<<1&2047|t.get(r,a),a>=10&&(1488===o||93===o)&&n++,i=i<<1&2047|t.get(a,r),a>=10&&(1488===i||93===i)&&n++}return n*r},t.getPenaltyN4=function(t){let e=0;const n=t.data.length;for(let r=0;r<n;r++)e+=t.data[r];return Math.abs(Math.ceil(100*e/n/5)-10)*o},t.applyMask=function(t,e){const n=e.size;for(let r=0;r<n;r++)for(let o=0;o<n;o++)e.isReserved(o,r)||e.xor(o,r,i(t,o,r))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let o=0,i=1/0;for(let a=0;a<r;a++){n(a),t.applyMask(a,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),r<i&&(i=r,o=a)}return o}}(q);var j={};const V=S,$=[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],O=[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];j.getBlocksCount=function(t,e){switch(e){case V.L:return $[4*(t-1)+0];case V.M:return $[4*(t-1)+1];case V.Q:return $[4*(t-1)+2];case V.H:return $[4*(t-1)+3];default:return}},j.getTotalCodewordsCount=function(t,e){switch(e){case V.L:return O[4*(t-1)+0];case V.M:return O[4*(t-1)+1];case V.Q:return O[4*(t-1)+2];case V.H:return O[4*(t-1)+3];default:return}};var Q={},Z={};const W=new Uint8Array(512),X=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)W[e]=t,X[t]=e,t<<=1,256&t&&(t^=285);for(let e=255;e<512;e++)W[e]=W[e-255]}(),Z.log=function(t){if(t<1)throw new Error("log("+t+")");return X[t]},Z.exp=function(t){return W[t]},Z.mul=function(t,e){return 0===t||0===e?0:W[X[t]+X[e]]},function(t){const e=Z;t.mul=function(t,n){const r=new Uint8Array(t.length+n.length-1);for(let o=0;o<t.length;o++)for(let i=0;i<n.length;i++)r[o+i]^=e.mul(t[o],n[i]);return r},t.mod=function(t,n){let r=new Uint8Array(t);for(;r.length-n.length>=0;){const t=r[0];for(let i=0;i<n.length;i++)r[i]^=e.mul(n[i],t);let o=0;for(;o<r.length&&0===r[o];)o++;r=r.slice(o)}return r},t.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let o=0;o<n;o++)r=t.mul(r,new Uint8Array([1,e.exp(o)]));return r}}(Q);const G=Q;function tt(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}tt.prototype.initialize=function(t){this.degree=t,this.genPoly=G.generateECPolynomial(this.degree)},tt.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(t.length+this.degree);e.set(t);const n=G.mod(e,this.genPoly),r=this.degree-n.length;if(r>0){const t=new Uint8Array(this.degree);return t.set(n,r),t}return n};var et=tt,nt={},rt={},ot={isValid:function(t){return!isNaN(t)&&t>=1&&t<=40}},it={};const at="[0-9]+";let st="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";st=st.replace(/u/g,"\\u");const ut="(?:(?![A-Z0-9 $%*+\\-./:]|"+st+")(?:.|[\r\n]))+";it.KANJI=new RegExp(st,"g"),it.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),it.BYTE=new RegExp(ut,"g"),it.NUMERIC=new RegExp(at,"g"),it.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const lt=new RegExp("^"+st+"$"),ct=new RegExp("^"+at+"$"),dt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");it.testKanji=function(t){return lt.test(t)},it.testNumeric=function(t){return ct.test(t)},it.testAlphanumeric=function(t){return dt.test(t)},function(t){const e=ot,n=it;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,n){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!e.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?t.ccBits[0]:n<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(r){return n}}}(rt),function(t){const e=L,n=j,r=S,o=rt,i=ot,a=e.getBCHDigit(7973);function s(t,e){return o.getCharCountIndicator(t,e)+4}function u(t,e){let n=0;return t.forEach(function(t){const r=s(t.mode,e);n+=r+t.getBitsLength()}),n}t.from=function(t,e){return i.isValid(t)?parseInt(t,10):e},t.getCapacity=function(t,r,a){if(!i.isValid(t))throw new Error("Invalid QR Code version");void 0===a&&(a=o.BYTE);const u=8*(e.getSymbolTotalCodewords(t)-n.getTotalCodewordsCount(t,r));if(a===o.MIXED)return u;const l=u-s(a,t);switch(a){case o.NUMERIC:return Math.floor(l/10*3);case o.ALPHANUMERIC:return Math.floor(l/11*2);case o.KANJI:return Math.floor(l/13);case o.BYTE:default:return Math.floor(l/8)}},t.getBestVersionForData=function(e,n){let i;const a=r.from(n,r.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(u(e,r)<=t.getCapacity(r,n,o.MIXED))return r}(e,a);if(0===e.length)return 1;i=e[0]}else i=e;return function(e,n,r){for(let o=1;o<=40;o++)if(n<=t.getCapacity(o,r,e))return o}(i.mode,i.getLength(),a)},t.getEncodedBits=function(t){if(!i.isValid(t)||t<7)throw new Error("Invalid QR Code version");let n=t<<12;for(;e.getBCHDigit(n)-a>=0;)n^=7973<<e.getBCHDigit(n)-a;return t<<12|n}}(nt);var ft={};const ht=L,gt=ht.getBCHDigit(1335);ft.getEncodedBits=function(t,e){const n=t.bit<<3|e;let r=n<<10;for(;ht.getBCHDigit(r)-gt>=0;)r^=1335<<ht.getBCHDigit(r)-gt;return 21522^(n<<10|r)};var vt={};const pt=rt;function mt(t){this.mode=pt.NUMERIC,this.data=t.toString()}mt.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},mt.prototype.getLength=function(){return this.data.length},mt.prototype.getBitsLength=function(){return mt.getBitsLength(this.data.length)},mt.prototype.write=function(t){let e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);const o=this.data.length-e;o>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*o+1))};var wt=mt;const yt=rt,Et=["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 Ct(t){this.mode=yt.ALPHANUMERIC,this.data=t}Ct.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},Ct.prototype.getLength=function(){return this.data.length},Ct.prototype.getBitsLength=function(){return Ct.getBitsLength(this.data.length)},Ct.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let n=45*Et.indexOf(this.data[e]);n+=Et.indexOf(this.data[e+1]),t.put(n,11)}this.data.length%2&&t.put(Et.indexOf(this.data[e]),6)};var At=Ct;const Bt=rt;function _t(t){this.mode=Bt.BYTE,this.data="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t)}_t.getBitsLength=function(t){return 8*t},_t.prototype.getLength=function(){return this.data.length},_t.prototype.getBitsLength=function(){return _t.getBitsLength(this.data.length)},_t.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)};var bt=_t;const It=rt,Mt=L;function Tt(t){this.mode=It.KANJI,this.data=t}Tt.getBitsLength=function(t){return 13*t},Tt.prototype.getLength=function(){return this.data.length},Tt.prototype.getBitsLength=function(){return Tt.getBitsLength(this.data.length)},Tt.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=Mt.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13)}};var Nt,Pt=Tt,Rt={exports:{}},Lt=Rt.exports=Nt={single_source_shortest_paths:function(t,e,n){var r={},o={};o[e]=0;var i,a,s,u,l,c,d,f=Nt.PriorityQueue.make();for(f.push(e,0);!f.empty();)for(s in a=(i=f.pop()).value,u=i.cost,l=t[a]||{})l.hasOwnProperty(s)&&(c=u+l[s],d=o[s],(void 0===o[s]||d>c)&&(o[s]=c,f.push(s,c),r[s]=a));if(void 0!==n&&void 0===o[n]){var h=["Could not find a path from ",e," to ",n,"."].join("");throw new Error(h)}return r},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,e,n){var r=Nt.single_source_shortest_paths(t,e,n);return Nt.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(t){var e,n=Nt.PriorityQueue,r={};for(e in t=t||{},n)n.hasOwnProperty(e)&&(r[e]=n[e]);return r.queue=[],r.sorter=t.sorter||n.default_sorter,r},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};!function(t){const e=rt,n=wt,r=At,o=bt,i=Pt,a=it,s=L,u=Lt;function l(t){return unescape(encodeURIComponent(t)).length}function c(t,e,n){const r=[];let o;for(;null!==(o=t.exec(n));)r.push({data:o[0],index:o.index,mode:e,length:o[0].length});return r}function d(t){const n=c(a.NUMERIC,e.NUMERIC,t),r=c(a.ALPHANUMERIC,e.ALPHANUMERIC,t);let o,i;s.isKanjiModeEnabled()?(o=c(a.BYTE,e.BYTE,t),i=c(a.KANJI,e.KANJI,t)):(o=c(a.BYTE_KANJI,e.BYTE,t),i=[]);return n.concat(r,o,i).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function f(t,a){switch(a){case e.NUMERIC:return n.getBitsLength(t);case e.ALPHANUMERIC:return r.getBitsLength(t);case e.KANJI:return i.getBitsLength(t);case e.BYTE:return o.getBitsLength(t)}}function h(t,a){let u;const l=e.getBestModeForData(t);if(u=e.from(a,l),u!==e.BYTE&&u.bit<l.bit)throw new Error('"'+t+'" cannot be encoded with mode '+e.toString(u)+".\n Suggested mode is: "+e.toString(l));switch(u!==e.KANJI||s.isKanjiModeEnabled()||(u=e.BYTE),u){case e.NUMERIC:return new n(t);case e.ALPHANUMERIC:return new r(t);case e.KANJI:return new i(t);case e.BYTE:return new o(t)}}t.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(h(e,null)):e.data&&t.push(h(e.data,e.mode)),t},[])},t.fromString=function(n,r){const o=function(t){const n=[];for(let r=0;r<t.length;r++){const o=t[r];switch(o.mode){case e.NUMERIC:n.push([o,{data:o.data,mode:e.ALPHANUMERIC,length:o.length},{data:o.data,mode:e.BYTE,length:o.length}]);break;case e.ALPHANUMERIC:n.push([o,{data:o.data,mode:e.BYTE,length:o.length}]);break;case e.KANJI:n.push([o,{data:o.data,mode:e.BYTE,length:l(o.data)}]);break;case e.BYTE:n.push([{data:o.data,mode:e.BYTE,length:l(o.data)}])}}return n}(d(n,s.isKanjiModeEnabled())),i=function(t,n){const r={},o={start:{}};let i=["start"];for(let a=0;a<t.length;a++){const s=t[a],u=[];for(let t=0;t<s.length;t++){const l=s[t],c=""+a+t;u.push(c),r[c]={node:l,lastCount:0},o[c]={};for(let t=0;t<i.length;t++){const a=i[t];r[a]&&r[a].node.mode===l.mode?(o[a][c]=f(r[a].lastCount+l.length,l.mode)-f(r[a].lastCount,l.mode),r[a].lastCount+=l.length):(r[a]&&(r[a].lastCount=l.length),o[a][c]=f(l.length,l.mode)+4+e.getCharCountIndicator(l.mode,n))}}i=u}for(let e=0;e<i.length;e++)o[i[e]].end=0;return{map:o,table:r}}(o,r),a=u.find_path(i.map,"start","end"),c=[];for(let t=1;t<a.length-1;t++)c.push(i.table[a[t]].node);return t.fromArray(function(t){return t.reduce(function(t,e){const n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(c))},t.rawSplit=function(e){return t.fromArray(d(e,s.isKanjiModeEnabled()))}}(vt);const xt=L,kt=S,Ut=z,St=H,Ft=J,zt=K,Dt=q,Ht=j,Jt=et,Kt=nt,Yt=ft,qt=rt,jt=vt;function Vt(t,e,n){const r=t.size,o=Yt.getEncodedBits(e,n);let i,a;for(i=0;i<15;i++)a=1==(o>>i&1),i<6?t.set(i,8,a,!0):i<8?t.set(i+1,8,a,!0):t.set(r-15+i,8,a,!0),i<8?t.set(8,r-i-1,a,!0):i<9?t.set(8,15-i-1+1,a,!0):t.set(8,15-i-1,a,!0);t.set(r-8,8,1,!0)}function $t(t,e,n){const r=new Ut;n.forEach(function(e){r.put(e.mode.bit,4),r.put(e.getLength(),qt.getCharCountIndicator(e.mode,t)),e.write(r)});const o=8*(xt.getSymbolTotalCodewords(t)-Ht.getTotalCodewordsCount(t,e));for(r.getLengthInBits()+4<=o&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(0);const i=(o-r.getLengthInBits())/8;for(let a=0;a<i;a++)r.put(a%2?17:236,8);return function(t,e,n){const r=xt.getSymbolTotalCodewords(e),o=Ht.getTotalCodewordsCount(e,n),i=r-o,a=Ht.getBlocksCount(e,n),s=r%a,u=a-s,l=Math.floor(r/a),c=Math.floor(i/a),d=c+1,f=l-c,h=new Jt(f);let g=0;const v=new Array(a),p=new Array(a);let m=0;const w=new Uint8Array(t.buffer);for(let B=0;B<a;B++){const t=B<u?c:d;v[B]=w.slice(g,g+t),p[B]=h.encode(v[B]),g+=t,m=Math.max(m,t)}const y=new Uint8Array(r);let E,C,A=0;for(E=0;E<m;E++)for(C=0;C<a;C++)E<v[C].length&&(y[A++]=v[C][E]);for(E=0;E<f;E++)for(C=0;C<a;C++)y[A++]=p[C][E];return y}(r,t,e)}function Ot(t,e,n,r){let o;if(Array.isArray(t))o=jt.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");{let r=e;if(!r){const e=jt.rawSplit(t);r=Kt.getBestVersionForData(e,n)}o=jt.fromString(t,r||40)}}const i=Kt.getBestVersionForData(o,n);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<i)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+i+".\n")}else e=i;const a=$t(e,n,o),s=xt.getSymbolSize(e),u=new St(s);return function(t,e){const n=t.size,r=zt.getPositions(e);for(let o=0;o<r.length;o++){const e=r[o][0],i=r[o][1];for(let r=-1;r<=7;r++)if(!(e+r<=-1||n<=e+r))for(let o=-1;o<=7;o++)i+o<=-1||n<=i+o||(r>=0&&r<=6&&(0===o||6===o)||o>=0&&o<=6&&(0===r||6===r)||r>=2&&r<=4&&o>=2&&o<=4?t.set(e+r,i+o,!0,!0):t.set(e+r,i+o,!1,!0))}}(u,e),function(t){const e=t.size;for(let n=8;n<e-8;n++){const e=n%2==0;t.set(n,6,e,!0),t.set(6,n,e,!0)}}(u),function(t,e){const n=Ft.getPositions(e);for(let r=0;r<n.length;r++){const e=n[r][0],o=n[r][1];for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)-2===n||2===n||-2===r||2===r||0===n&&0===r?t.set(e+n,o+r,!0,!0):t.set(e+n,o+r,!1,!0)}}(u,e),Vt(u,n,0),e>=7&&function(t,e){const n=t.size,r=Kt.getEncodedBits(e);let o,i,a;for(let s=0;s<18;s++)o=Math.floor(s/3),i=s%3+n-8-3,a=1==(r>>s&1),t.set(o,i,a,!0),t.set(i,o,a,!0)}(u,e),function(t,e){const n=t.size;let r=-1,o=n-1,i=7,a=0;for(let s=n-1;s>0;s-=2)for(6===s&&s--;;){for(let n=0;n<2;n++)if(!t.isReserved(o,s-n)){let r=!1;a<e.length&&(r=1==(e[a]>>>i&1)),t.set(o,s-n,r),i--,-1===i&&(a++,i=7)}if(o+=r,o<0||n<=o){o-=r,r=-r;break}}}(u,a),isNaN(r)&&(r=Dt.getBestMask(u,Vt.bind(null,u,n))),Dt.applyMask(r,u),Vt(u,n,r),{modules:u,version:e,errorCorrectionLevel:n,maskPattern:r,segments:o}}R.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");let n,r,o=kt.M;return void 0!==e&&(o=kt.from(e.errorCorrectionLevel,kt.M),n=Kt.from(e.version),r=Dt.from(e.maskPattern),e.toSJISFunc&&xt.setToSJISFunction(e.toSJISFunc)),Ot(t,n,o,r)};var Qt={},Zt={};!function(t){function e(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");const n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const n=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:r,scale:r?4:o,margin:n,color:{dark:e(t.color.dark||"#000000ff"),light:e(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const o=n.modules.size,i=n.modules.data,a=t.getScale(o,r),s=Math.floor((o+2*r.margin)*a),u=r.margin*a,l=[r.color.light,r.color.dark];for(let t=0;t<s;t++)for(let n=0;n<s;n++){let c=4*(t*s+n),d=r.color.light;if(t>=u&&n>=u&&t<s-u&&n<s-u){d=l[i[Math.floor((t-u)/a)*o+Math.floor((n-u)/a)]?1:0]}e[c++]=d.r,e[c++]=d.g,e[c++]=d.b,e[c]=d.a}}}(Zt),function(t){const e=Zt;t.render=function(t,n,r){let o=r,i=n;void 0!==o||n&&n.getContext||(o=n,n=void 0),n||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=e.getOptions(o);const a=e.getImageWidth(t.modules.size,o),s=i.getContext("2d"),u=s.createImageData(a,a);return e.qrToImageData(u.data,t,o),function(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(s,i,a),s.putImageData(u,0,0),i},t.renderToDataURL=function(e,n,r){let o=r;void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={});const i=t.render(e,n,o),a=o.type||"image/png",s=o.rendererOpts||{};return i.toDataURL(a,s.quality)}}(Qt);var Wt={};const Xt=Zt;function Gt(t,e){const n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function te(t,e,n){let r=t+e;return void 0!==n&&(r+=" "+n),r}Wt.render=function(t,e,n){const r=Xt.getOptions(e),o=t.modules.size,i=t.modules.data,a=o+2*r.margin,s=r.color.light.a?"<path "+Gt(r.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",u="<path "+Gt(r.color.dark,"stroke")+' d="'+function(t,e,n){let r="",o=0,i=!1,a=0;for(let s=0;s<t.length;s++){const u=Math.floor(s%e),l=Math.floor(s/e);u||i||(i=!0),t[s]?(a++,s>0&&u>0&&t[s-1]||(r+=i?te("M",u+n,.5+l+n):te("m",o,0),o=0,i=!1),u+1<e&&t[s+1]||(r+=te("h",a),a=0)):o++}return r}(i,o,r.margin)+'"/>',l='viewBox="0 0 '+a+" "+a+'"',c='<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+l+' shape-rendering="crispEdges">'+s+u+"</svg>\n";return"function"==typeof n&&n(null,c),c};const ee=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},ne=R,re=Qt,oe=Wt;function ie(t,e,n,r,o){const i=[].slice.call(arguments,1),a=i.length,s="function"==typeof i[a-1];if(!s&&!ee())throw new Error("Callback required as last argument");if(!s){if(a<1)throw new Error("Too few arguments provided");return 1===a?(n=e,e=r=void 0):2!==a||e.getContext||(r=n,n=e,e=void 0),new Promise(function(o,i){try{const i=ne.create(n,r);o(t(i,e,r))}catch(a){i(a)}})}if(a<2)throw new Error("Too few arguments provided");2===a?(o=n,n=e,e=r=void 0):3===a&&(e.getContext&&void 0===o?(o=r,r=void 0):(o=r,r=n,n=e,e=void 0));try{const i=ne.create(n,r);o(null,t(i,e,r))}catch(u){o(u)}}P.create=ne.create,P.toCanvas=ie.bind(null,re.render),P.toDataURL=ie.bind(null,re.renderToDataURL),P.toString=ie.bind(null,function(t,e,n){return oe.render(t,n)});const ae=N(t({__name:"reservation-detail",setup(t){const N=e(null),R=e(""),L=e(!1),x=e(!1),k=e("");function U(){return!!u(l.accessToken)}const S=n(()=>{var t;const e=null==(t=N.value)?void 0:t.activity;if(!(null==e?void 0:e.start_at)&&!(null==e?void 0:e.end_at))return"-";const n=e.start_at?M(e.start_at):"",r=e.end_at?M(e.end_at):"";return n&&r?`${n} ~ ${r}`:n||r||"-"});const F=e([]);function z(){var t;const e=(null==(t=N.value)?void 0:t.qr_token)||"";e&&A({data:e})}function D(){var t;const e=null==(t=N.value)?void 0:t.activity,n=Number(null==e?void 0:e.lat),r=Number(null==e?void 0:e.lng);n&&r?B({latitude:n,longitude:r,name:(null==e?void 0:e.title)||"活动位置",address:(null==e?void 0:e.address)||"",scale:16}):a({title:"活动暂未标注地图坐标,无法导航",icon:"none"})}async function H(t){if(!t)return;const e=/^1\d{10}$/.test(R.value);if(e||U()){L.value=!0;try{N.value=await b(t,e?R.value:void 0),await async function(){var t;const e=null==(t=N.value)?void 0:t.qr_token;if(e)try{k.value=await P.toDataURL(e,{width:320,margin:1,errorCorrectionLevel:"M"})}catch{k.value=""}else k.value=""}(),function(){var t,e;const n=Math.max(1,Number((null==(t=N.value)?void 0:t.ticket_count)||1)),r=(null==(e=N.value)?void 0:e.visitor_name)||"观众";F.value=Array.from({length:n},(t,e)=>({label:1===n?r:`${r}${e+1}`,qr:k.value}))}()}catch(n){a({title:(null==n?void 0:n.message)||"加载详情失败",icon:"none"})}finally{L.value=!1}}else a({title:"缺少验证信息",icon:"none"})}async function J(){var t;if(!(null==(t=N.value)?void 0:t.id))return;if("pending"!==N.value.status)return void a({title:"当前状态不可取消",icon:"none"});const e=/^1\d{10}$/.test(R.value);if(!e&&!U())return;if((await _({title:"确认取消预约",content:"取消后将释放该日期占用名额,是否继续?",confirmText:"确认取消",confirmColor:"#ff7d00"})).confirm){x.value=!0;try{await I(N.value.id,e?R.value:void 0),a({title:"取消成功",icon:"success"}),await H(N.value.id)}catch(n){a({title:(null==n?void 0:n.message)||"取消失败",icon:"none"})}finally{x.value=!1}}}return r(t=>{const e=Number((null==t?void 0:t.id)||0);R.value=String((null==t?void 0:t.phone)||""),H(e)}),(t,e)=>{const n=s,r=w,a=E,u=C;return c(),o(n,{class:"page"},{default:i(()=>{var t;return[L.value&&!N.value?(c(),o(n,{key:0,class:"loading"},{default:i(()=>[d("加载中…")]),_:1})):f("",!0),h(n,{class:"card"},{default:i(()=>{var t,e,a;return[h(n,{class:"title"},{default:i(()=>{var t,e;return[d(g((null==(e=null==(t=N.value)?void 0:t.activity)?void 0:e.title)||"-"),1)]}),_:1}),(null==(a=null==(e=null==(t=N.value)?void 0:t.activity)?void 0:e.tags)?void 0:a.length)?(c(),o(n,{key:0,class:"tags"},{default:i(()=>[(c(!0),v(p,null,m(N.value.activity.tags,(t,e)=>(c(),o(r,{key:e,class:"tag"},{default:i(()=>[d(g(t),1)]),_:2},1024))),128))]),_:1})):f("",!0),h(n,{class:"sec-label"},{default:i(()=>[d("活动信息")]),_:1}),h(n,{class:"meta"},{default:i(()=>[d("活动时间:"+g(S.value),1)]),_:1}),h(n,{class:"addr-row"},{default:i(()=>[h(n,{class:"addr-main"},{default:i(()=>[h(r,{class:"addr-label"},{default:i(()=>[d("活动地址")]),_:1}),h(r,{class:"addr-text"},{default:i(()=>{var t,e;return[d(g((null==(e=null==(t=N.value)?void 0:t.activity)?void 0:e.address)||"-"),1)]}),_:1})]),_:1}),h(n,{class:"nav-btn",onClick:D},{default:i(()=>[d("导航")]),_:1})]),_:1}),h(n,{class:"sec-label"},{default:i(()=>[d("场馆")]),_:1}),h(n,{class:"meta"},{default:i(()=>{var t,e;return[d(g((null==(e=null==(t=N.value)?void 0:t.venue)?void 0:e.name)||"-"),1)]}),_:1})]}),_:1}),h(n,{class:"card"},{default:i(()=>{var t;return[h(n,{class:"sec-label"},{default:i(()=>[d("预约订单")]),_:1}),h(n,{class:"meta"},{default:i(()=>{var t,e;return[d("预约日期:"+g(y(T)(null==(e=null==(t=N.value)?void 0:t.activity_day)?void 0:e.activity_date)),1)]}),_:1}),h(n,{class:"meta"},{default:i(()=>{var t;return[d("参观人数:"+g((null==(t=N.value)?void 0:t.ticket_count)||1)+" 人",1)]}),_:1}),h(n,{class:"meta"},{default:i(()=>{var t,e;return[d("状态:"+g((e=null==(t=N.value)?void 0:t.status,"pending"===e?"待核销":"verified"===e?"已核销":"cancelled"===e?"已取消":e||"-")),1)]}),_:1}),h(n,{class:"meta"},{default:i(()=>{var t;return[d("下单时间:"+g(y(M)(null==(t=N.value)?void 0:t.created_at)),1)]}),_:1}),(null==(t=N.value)?void 0:t.verified_at)?(c(),o(n,{key:0,class:"meta"},{default:i(()=>[d("核销时间:"+g(y(M)(N.value.verified_at)),1)]),_:1})):f("",!0),h(n,{class:"meta"},{default:i(()=>{var t;return[d("报名人:"+g((null==(t=N.value)?void 0:t.visitor_name)||"-"),1)]}),_:1}),h(n,{class:"meta"},{default:i(()=>{var t;return[d("手机:"+g((null==(t=N.value)?void 0:t.visitor_phone)||"-"),1)]}),_:1})]}),_:1}),(null==(t=N.value)?void 0:t.qr_token)?(c(),o(n,{key:1,class:"card"},{default:i(()=>[h(n,{class:"sub-title"},{default:i(()=>[d("入馆凭证")]),_:1}),(c(!0),v(p,null,m(F.value,(t,e)=>(c(),o(n,{class:"ticket",key:e},{default:i(()=>[h(n,{class:"ticket-head"},{default:i(()=>[h(r,null,{default:i(()=>[d("请向工作人员出示此码")]),_:1}),h(r,{class:"copy",onClick:z},{default:i(()=>[d("复制码")]),_:1})]),_:1}),t.qr?(c(),o(a,{key:0,class:"qr",src:t.qr,mode:"aspectFit"},null,8,["src"])):(c(),o(n,{key:1,class:"tip"},{default:i(()=>[d("二维码生成中...")]),_:1})),h(n,{class:"qr-name"},{default:i(()=>[d(g(t.label),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})):f("",!0),h(n,{class:"action"},{default:i(()=>{var t;return[h(u,{class:"btn",disabled:"pending"!==(null==(t=N.value)?void 0:t.status)||x.value||L.value,onClick:J},{default:i(()=>[d(g(x.value?"取消中...":"取消预约"),1)]),_:1},8,["disabled"])]}),_:1})]}),_:1})}}}),[["__scopeId","data-v-4d1fc7ce"]]);export{ae as default};
|