瀏覽代碼

first commit

gcz 2 年之前
當前提交
eafdbd9f72
共有 100 個文件被更改,包括 8575 次插入0 次删除
  1. 15 0
      .gitignore
  2. 42 0
      App.vue
  3. 145 0
      center/center.vue
  4. 156 0
      center/checkdetails.vue
  5. 229 0
      center/checklist.vue
  6. 87 0
      center/checksuccess.vue
  7. 89 0
      center/paycode.vue
  8. 173 0
      center/resetpass.vue
  9. 199 0
      center/scan.vue
  10. 65 0
      common/apiurl.js
  11. 27 0
      common/config.js
  12. 29 0
      common/http.api.js
  13. 86 0
      common/http.interceptor.js
  14. 123 0
      common/request.js
  15. 411 0
      components/ay-qrcode/ay-qrcode.vue
  16. 872 0
      components/ay-qrcode/qrcode_wx.js
  17. 263 0
      components/ay-qrcode/weapp-qrcode.js
  18. 127 0
      components/tabbar.vue
  19. 20 0
      index.html
  20. 82 0
      main.js
  21. 101 0
      manifest.json
  22. 18 0
      mixin.js
  23. 245 0
      node_modules/@zxing/library/LICENSE
  24. 126 0
      node_modules/@zxing/library/README.md
  25. 12 0
      node_modules/@zxing/library/cjs/browser.d.ts
  26. 25 0
      node_modules/@zxing/library/cjs/browser.js
  27. 16 0
      node_modules/@zxing/library/cjs/browser/BrowserAztecCodeReader.d.ts
  28. 39 0
      node_modules/@zxing/library/cjs/browser/BrowserAztecCodeReader.js
  29. 15 0
      node_modules/@zxing/library/cjs/browser/BrowserBarcodeReader.d.ts
  30. 37 0
      node_modules/@zxing/library/cjs/browser/BrowserBarcodeReader.js
  31. 411 0
      node_modules/@zxing/library/cjs/browser/BrowserCodeReader.d.ts
  32. 1077 0
      node_modules/@zxing/library/cjs/browser/BrowserCodeReader.js
  33. 13 0
      node_modules/@zxing/library/cjs/browser/BrowserDatamatrixCodeReader.d.ts
  34. 36 0
      node_modules/@zxing/library/cjs/browser/BrowserDatamatrixCodeReader.js
  35. 14 0
      node_modules/@zxing/library/cjs/browser/BrowserMultiFormatReader.d.ts
  36. 39 0
      node_modules/@zxing/library/cjs/browser/BrowserMultiFormatReader.js
  37. 13 0
      node_modules/@zxing/library/cjs/browser/BrowserPDF417Reader.d.ts
  38. 36 0
      node_modules/@zxing/library/cjs/browser/BrowserPDF417Reader.js
  39. 13 0
      node_modules/@zxing/library/cjs/browser/BrowserQRCodeReader.d.ts
  40. 36 0
      node_modules/@zxing/library/cjs/browser/BrowserQRCodeReader.js
  41. 46 0
      node_modules/@zxing/library/cjs/browser/BrowserQRCodeSvgWriter.d.ts
  42. 129 0
      node_modules/@zxing/library/cjs/browser/BrowserQRCodeSvgWriter.js
  43. 49 0
      node_modules/@zxing/library/cjs/browser/BrowserSvgCodeWriter.d.ts
  44. 134 0
      node_modules/@zxing/library/cjs/browser/BrowserSvgCodeWriter.js
  45. 6 0
      node_modules/@zxing/library/cjs/browser/DecodeContinuouslyCallback.d.ts
  46. 2 0
      node_modules/@zxing/library/cjs/browser/DecodeContinuouslyCallback.js
  47. 29 0
      node_modules/@zxing/library/cjs/browser/HTMLCanvasElementLuminanceSource.d.ts
  48. 170 0
      node_modules/@zxing/library/cjs/browser/HTMLCanvasElementLuminanceSource.js
  49. 4 0
      node_modules/@zxing/library/cjs/browser/HTMLVisualMediaElement.d.ts
  50. 2 0
      node_modules/@zxing/library/cjs/browser/HTMLVisualMediaElement.js
  51. 27 0
      node_modules/@zxing/library/cjs/browser/VideoInputDevice.d.ts
  52. 34 0
      node_modules/@zxing/library/cjs/browser/VideoInputDevice.js
  53. 7 0
      node_modules/@zxing/library/cjs/core/ArgumentException.d.ts
  54. 28 0
      node_modules/@zxing/library/cjs/core/ArgumentException.js
  55. 7 0
      node_modules/@zxing/library/cjs/core/ArithmeticException.d.ts
  56. 28 0
      node_modules/@zxing/library/cjs/core/ArithmeticException.js
  57. 10 0
      node_modules/@zxing/library/cjs/core/ArrayIndexOutOfBoundsException.d.ts
  58. 33 0
      node_modules/@zxing/library/cjs/core/ArrayIndexOutOfBoundsException.js
  59. 42 0
      node_modules/@zxing/library/cjs/core/BarcodeFormat.d.ts
  60. 64 0
      node_modules/@zxing/library/cjs/core/BarcodeFormat.js
  61. 53 0
      node_modules/@zxing/library/cjs/core/Binarizer.d.ts
  62. 41 0
      node_modules/@zxing/library/cjs/core/Binarizer.js
  63. 78 0
      node_modules/@zxing/library/cjs/core/BinaryBitmap.d.ts
  64. 129 0
      node_modules/@zxing/library/cjs/core/BinaryBitmap.js
  65. 8 0
      node_modules/@zxing/library/cjs/core/ChecksumException.d.ts
  66. 31 0
      node_modules/@zxing/library/cjs/core/ChecksumException.js
  67. 69 0
      node_modules/@zxing/library/cjs/core/DecodeHintType.d.ts
  68. 104 0
      node_modules/@zxing/library/cjs/core/DecodeHintType.js
  69. 13 0
      node_modules/@zxing/library/cjs/core/Dimension.d.ts
  70. 55 0
      node_modules/@zxing/library/cjs/core/Dimension.js
  71. 99 0
      node_modules/@zxing/library/cjs/core/EncodeHintType.d.ts
  72. 120 0
      node_modules/@zxing/library/cjs/core/EncodeHintType.js
  73. 17 0
      node_modules/@zxing/library/cjs/core/Exception.d.ts
  74. 42 0
      node_modules/@zxing/library/cjs/core/Exception.js
  75. 8 0
      node_modules/@zxing/library/cjs/core/FormatException.d.ts
  76. 31 0
      node_modules/@zxing/library/cjs/core/FormatException.js
  77. 7 0
      node_modules/@zxing/library/cjs/core/IllegalArgumentException.d.ts
  78. 28 0
      node_modules/@zxing/library/cjs/core/IllegalArgumentException.js
  79. 7 0
      node_modules/@zxing/library/cjs/core/IllegalStateException.d.ts
  80. 28 0
      node_modules/@zxing/library/cjs/core/IllegalStateException.js
  81. 7 0
      node_modules/@zxing/library/cjs/core/IndexOutOfBoundsException.d.ts
  82. 28 0
      node_modules/@zxing/library/cjs/core/IndexOutOfBoundsException.js
  83. 22 0
      node_modules/@zxing/library/cjs/core/InvertedLuminanceSource.d.ts
  84. 94 0
      node_modules/@zxing/library/cjs/core/InvertedLuminanceSource.js
  85. 84 0
      node_modules/@zxing/library/cjs/core/LuminanceSource.d.ts
  86. 119 0
      node_modules/@zxing/library/cjs/core/LuminanceSource.js
  87. 59 0
      node_modules/@zxing/library/cjs/core/MultiFormatReader.d.ts
  88. 215 0
      node_modules/@zxing/library/cjs/core/MultiFormatReader.js
  89. 13 0
      node_modules/@zxing/library/cjs/core/MultiFormatWriter.d.ts
  90. 99 0
      node_modules/@zxing/library/cjs/core/MultiFormatWriter.js
  91. 8 0
      node_modules/@zxing/library/cjs/core/NotFoundException.d.ts
  92. 31 0
      node_modules/@zxing/library/cjs/core/NotFoundException.js
  93. 7 0
      node_modules/@zxing/library/cjs/core/NullPointerException.d.ts
  94. 28 0
      node_modules/@zxing/library/cjs/core/NullPointerException.js
  95. 6 0
      node_modules/@zxing/library/cjs/core/OutOfMemoryError.d.ts
  96. 27 0
      node_modules/@zxing/library/cjs/core/OutOfMemoryError.js
  97. 35 0
      node_modules/@zxing/library/cjs/core/PlanarYUVLuminanceSource.d.ts
  98. 154 0
      node_modules/@zxing/library/cjs/core/PlanarYUVLuminanceSource.js
  99. 22 0
      node_modules/@zxing/library/cjs/core/RGBLuminanceSource.d.ts
  100. 136 0
      node_modules/@zxing/library/cjs/core/RGBLuminanceSource.js

+ 15 - 0
.gitignore

@@ -0,0 +1,15 @@
+.DS_Store
+
+unpackage/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Editor directories and files
+.hbuilderx
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln

+ 42 - 0
App.vue

@@ -0,0 +1,42 @@
+<script>
+	export default {
+		globalData: {
+		    statusBarHeight: 0, // 状态导航栏高度
+		    navHeight: 0, // 总体高度
+		    navigationBarHeight: 0, // 导航栏高度(标题栏高度)
+		},
+		onLaunch: function() {
+			// console.log('App Launch')
+			 // 状态栏高度
+			this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
+		 
+			// #ifdef MP-WEIXIN
+			// 获取微信胶囊的位置信息 width,height,top,right,left,bottom
+			const custom = wx.getMenuButtonBoundingClientRect()
+			// console.log(custom)
+		 
+			// 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
+			this.globalData.navigationBarHeight = custom.height + (custom.top - this.globalData.statusBarHeight) * 2
+			// console.log("导航栏高度:"+this.globalData.navigationBarHeight)
+		 
+			// 总体高度 = 状态栏高度 + 导航栏高度
+			this.globalData.navHeight = this.globalData.navigationBarHeight + this.globalData.statusBarHeight
+		 
+			// #endif
+		 
+			// console.log('this.globalData==========',this.globalData)
+		},
+		onShow: function() {
+			// console.log('App Show')
+		},
+		onHide: function() {
+			// console.log('App Hide')
+		}
+	}
+</script>
+
+<style lang="scss">
+	/*每个页面公共css */
+	@import "@/uni_modules/uview-ui/index.scss";
+	@import "@/static/css/common.scss";
+</style>

+ 145 - 0
center/center.vue

@@ -0,0 +1,145 @@
+<template>
+	<view class="pages">
+		<!-- <u-navbar
+			title="我的"
+			:placeholder="true"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar> -->
+		<view class="top u-flex">
+			<view class="userinfo u-flex">
+				<img class="defaultavatar" src="../static/img/defaultavatar.png" alt="">
+				<view class="text">
+					<view class="name">{{vuex_user_info.username}}</view>
+					<view class="dept">
+						<text>{{vuex_member_info.dept}}</text>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="page-wrap">
+			<view class="tool-wrap">
+				<u-cell-group :border="false">
+					<u-cell
+					    title="核销记录"
+					    value=""
+					    center
+						:isLink="true"
+						:border="true"
+						icon="/static/img/center-icon-1.png"
+						url="/center/checklist"
+						:customStyle="cellCustomStyle"
+					></u-cell>
+				    <u-cell
+				        title="修改密码"
+				        value=""
+				        center
+						:isLink="true"
+						:border="true"
+						icon="/static/img/center-icon-2.png"
+						url="/center/resetpass"
+						:customStyle="cellCustomStyle"
+				    ></u-cell>
+					<u-cell
+					    title="退出登录"
+					    value=""
+					    center
+						:isLink="true"
+						:border="true"
+						@click="logOut"
+						icon="/static/img/center-icon-3.png"
+						:customStyle="cellCustomStyle"
+					></u-cell>
+				</u-cell-group>
+			</view>
+		</view>
+		<tabbar :tabbarIndexProps='2' />
+	</view>
+</template>
+
+<script>
+	import { systemInfo } from "@/mixin.js";
+	import tabbar from "../components/tabbar.vue";
+	export default {
+		components:{
+			tabbar
+		},
+		mixins:[systemInfo],
+		data() {
+			return {
+				staticUrl:this.$commonConfig.staticUrl,
+				memberInfo:{},
+				cellCustomStyle:{
+					'background-color':'#fff',
+					'border-radius':'8rpx',
+					'margin-bottom':'14rpx',
+				}
+			}
+		},
+		onShow() {
+			this.getMemberInfo()
+		},
+		onLoad() {
+			this.getSystemInfo();
+		},
+		methods: {
+			getMemberInfo(){
+				this.$u.api.memberInfo({id:this.vuex_member_info.id}).then(res=>{
+					this.memberInfo = res.data;
+					this.$u.vuex('vuex_member_info', res.data);
+					}).catch(err=>{
+					console.log('memberInfo',err.data);
+				})
+			},
+			logOut(){
+				this.$u.vuex('vuex_user_info', {});
+				this.getMemberInfo()
+			}
+		}
+	}
+</script>
+<style>
+page{
+	background-color: #fff;
+}
+</style>
+<style lang="scss" scoped>
+.top{
+	color: #fff;
+	height: 280rpx;
+	background: url(../static/img/center-bg.png) no-repeat;
+	position: relative;
+	padding: 50rpx 30rpx;
+	box-sizing: border-box;
+	align-items: end;
+	.userinfo{
+		text-align: left;
+		.defaultavatar{
+			width: 110rpx;
+			height: 110rpx;
+		}
+		.text{
+			margin-left: 32rpx;
+			font-size: 26rpx;
+			font-family: PingFangSC-Regular, PingFang SC;
+			font-weight: 400;
+			color: #FFFFFF;
+			line-height: 36rpx;
+			.name{
+				font-size: 34rpx;
+				font-weight: 600;
+				color: #FFFFFF;
+				line-height: 48rpx;
+				margin-bottom: 8rpx;
+			}
+		}
+	}
+}
+.tool-wrap{
+	margin-top: 20rpx;
+	/deep/ .u-cell__body{
+		padding-left: 0;
+	}
+}
+</style>

+ 156 - 0
center/checkdetails.vue

@@ -0,0 +1,156 @@
+<template>
+    <view class="">
+		<!-- <u-navbar
+			:title="title"
+			:placeholder="true"
+			@leftClick="leftClick"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar> -->
+		<view class="page-wrap">
+			<view class="block goods u-flex u-col-top">
+				<img class="img" :src="orderDetails.mainImg" alt="">
+				<view class="text">
+					<view class="title ellipsis-2">{{orderDetails.goodsName}}</view>
+					<view class="bottom u-flex u-row-between">
+						<view class="price">{{orderDetails.credit}}积分</view>
+						<view class="quantity">共{{orderDetails.quantity}}件</view>
+					</view>
+				</view>
+			</view>
+			<view class="block info">
+				<view class="info-item u-flex">
+					<view class="til">姓      名</view>
+					<text>{{orderDetails.name}}</text>
+				</view>
+				<view class="info-item u-flex" v-if="orderDetails.checkTime">
+					<text class="til">部      门</text>
+					<text>{{orderDetails.dept}}</text>
+				</view>
+				<view class="info-item u-flex">
+					<text class="til">核销时间</text>
+					<text>{{orderDetails.checkTime}}</text>
+				</view>
+				<view class="info-item u-flex"  v-if="orderDetails.checkName">
+					<text class="til">核销人</text>
+					<text>{{orderDetails.checkName}}</text>
+				</view>
+			</view>
+		</view>
+    </view>
+</template>
+<script>
+    export default {
+        data() {
+            return {
+				id:'',
+				orderDetails:{},
+            }
+        },
+		onLoad(page) {
+			this.id = page.id;
+		},
+		onShow() {
+			this.getOrderDetails(this.id);
+		},
+		computed:{
+			// payType(){
+			// 	return function(value){
+			// 		let payTypeList = ['', '微信', '余额', '积分']
+			// 		return '-' + payTypeList[value]
+			// 	}
+			// }
+		},
+        methods: {
+			leftClick(){
+				console.log('orderdetails leftClick');
+			},
+			getOrderDetails(id){
+				this.$u.api.checkDetail({id:id}).then(res=>{
+					this.orderDetails = res.data
+					// console.log('orderDetails',JSON.parse(JSON.stringify(res.data)));
+				}).catch(err=>{
+					console.log('getOrderDetails',err);
+				})
+			},
+        }
+    }
+</script>
+<style>
+	page{
+		background: #F5F9FC;
+	}
+</style>
+<style lang="scss" scoped>
+.block{
+	background: #FFFFFF;
+	border-radius: 24rpx;
+	margin-bottom: 10rpx;
+	padding: 30rpx;
+}
+.goods{
+	.img{
+		width: 180rpx;
+		height: 180rpx;
+	}
+	.text{
+		flex: 1;
+		margin-left: 40rpx;
+		.title{
+			font-size: 30rpx;
+			font-family: PingFangSC-Regular, PingFang SC;
+			font-weight: 400;
+			color: #333333;
+			line-height: 42rpx;
+			margin-bottom: 20rpx;
+			min-height: 84rpx;
+		}
+		.bottom{
+			font-size: 28rpx;
+			font-family: PingFangSC-Regular, PingFang SC;
+			font-weight: 400;
+			color: #999999;
+			line-height: 40rpx;
+			.price{
+				font-size: 32rpx;
+				font-weight: 600;
+				color: #FFB100;
+				line-height: 44rpx;
+			}
+		}
+	}
+}
+.info{
+	.info-item{
+		font-size: 30rpx;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #333333;
+		line-height: 42rpx;
+		margin-bottom: 20rpx;
+		.til{
+			text-align: end;
+			min-width: 122rpx;
+			color: #999;
+			margin-right: 40rpx;
+		}
+	}
+}
+.status{
+	padding: 26rpx 0;
+	background: #FFFFFF;
+	border-radius: 24rpx;
+	font-size: 34rpx;
+	font-weight: 600;
+	color: #009AEF;
+	line-height: 48rpx;
+	text-align: center;
+	&.status1{
+		color: #333;
+	}
+	&.status2{
+		color: #999;
+	}
+}
+</style>

+ 229 - 0
center/checklist.vue

@@ -0,0 +1,229 @@
+<template>
+	<view class="">
+	<!-- 	<u-navbar
+			title="我的业绩"
+			:placeholder="true"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar> -->
+		<view class="page-wrap">
+			<view class="date u-flex"@click="pickerDateShow = true">
+				<img class="img" src="../static/img/date-ico.png" alt="">
+				{{checkDate}}
+			</view>
+			<u-datetime-picker
+					:show="pickerDateShow"
+					ref="datePicker"
+					v-model="timestamp"
+					mode="date"
+					@cancel="pickerDateShow=false"
+					:maxDate="new Date().getTime()"
+					:formatter="formatter"
+					@confirm="confirmDate"
+			></u-datetime-picker>
+		</view>
+		<mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
+			<view class="page-wrap" v-show="dataList.length>0" >
+				<view class="list">
+					<view class="item" @click="goDetail(item.id)" v-for="item in dataList" :key="item.id">
+						<view class="userinfo">
+							姓名:{{item.createBy}}/{{item.dept}}
+						</view>
+						<view class="goods-name">核销商品:{{item.goodsName}}</view>
+						<view class="quantity">数量:{{item.quantity}}</view>
+						<view class="bottom u-flex u-row-between">
+							<text>{{item.checkTime}}</text>
+							<u-icon name="arrow-right" color="#333" size="18"></u-icon>	
+						</view>
+					</view>
+				</view>
+			</view>
+		</mescroll-body>
+	</view>
+</template>
+
+<script>
+	// 引入mescroll-mixins.js
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	export default {
+		mixins: [MescrollMixin], // 使用mixin
+		data() {
+			return {
+				timestamp:undefined,
+				pickerDateShow:false,
+				downOption: {},
+				// 上拉加载的配置(可选, 绝大部分情况无需配置)
+				upOption: {
+					page: {
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					empty: {
+						tip: '暂无相关数据'
+					}
+				},
+				// ,{name:'安全学习',recordType:3}
+				tabsList:[{name:'全部',recordType:''},{name:'答题',recordType:1},{name:'兑换码失效',recordType:4}],
+				recordType:'',
+				params:{
+					checkDate:''
+				},
+				activeIndex:0,
+				dataList: []
+			}
+		},
+		onShow() {
+			
+		},
+		onLoad() {
+			this.timestamp = Number(new Date());
+			this.checkDate = uni.$u.timeFormat(this.timestamp, 'yyyy年mm月dd日');
+			this.params.checkDate = uni.$u.timeFormat(this.timestamp, 'yyyy-mm-dd');
+		},
+		onReady() {
+			// 微信小程序需要用此写法
+			this.$refs.datePicker.setFormatter(this.formatter)
+		},
+		methods: {
+			/*下拉刷新的回调, 重置列表为第一页 (此处可删,mixins已默认)
+			downCallback(){
+				this.mescroll.resetUpScroll();
+			},
+			/*上拉加载的回调*/
+			upCallback(page) {
+				// 此处可以继续请求其他接口
+				// if(page.num == 1){
+				// 	// 请求其他接口...
+				// }
+			
+				// 如果希望先请求其他接口,再触发upCallback,可参考以下写法
+				// if(!this.params.id){
+				// 	this.mescroll.endErr()
+				// 	return // 此处return,先获取xx
+				// }
+			
+				let pageNum = page.num; // 页码, 默认从1开始
+				let pageSize = page.size; // 页长, 默认每页10条isAsc:0//时间排序 0:降序 1:升序 (默认星级降序排序)
+
+				this.params = Object.assign(this.params,{pageNum:pageNum,pageSize:pageSize});
+				this.$u.api.checkList(this.params).then(data => {
+					console.log('data',JSON.parse(JSON.stringify(data)));
+					// 接口返回的当前页数据列表 (数组)
+					let curPageData = data.data.rows;
+					this.totalAmount = data.data.total;
+					console.log('curPageData',JSON.parse(JSON.stringify(curPageData)));
+					// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+					let curPageLen = curPageData.length; 
+					// 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
+					// let totalPage =  data.data.data.totalPage; 
+					// 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
+					let totalSize = curPageData.total; 
+					// 接口返回的是否有下一页 (true/false)
+					// let hasNext = data.xxx; 
+					// console.log('totalPage',totalPage,'curPageLen',curPageLen);
+					//设置列表数据
+					if(page.num == 1) this.dataList = []; //如果是第一页需手动置空列表
+					this.dataList = this.dataList.concat(curPageData); //追加新数据
+					// 请求成功,隐藏加载状态
+					//方法一(推荐): 后台接口有返回列表的总页数 totalPage
+					// this.mescroll.endByPage(curPageLen, totalPage); 
+					//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+					this.mescroll.endBySize(curPageLen, totalSize); 
+				}).catch(err => {
+					this.mescroll.endErr()
+					console.log(err)
+				});	
+			
+			},
+			/*若希望重新加载列表,只需调用此方法即可(内部会自动page.num=1,再主动触发up.callback)*/
+			reloadList() {
+				this.mescroll.resetUpScroll();
+			},
+			itemClick(item){
+				console.log('item',item);
+			},
+			confirmDate(e){
+				console.log('confirmDate',e);
+				this.pickerDateShow = false;
+				this.checkDate = uni.$u.timeFormat(e.value, 'yyyy年mm月dd日');
+				this.params.checkDate = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
+				this.reloadList()
+			},
+			formatter(type, value) {
+				if (type === 'year') {
+					return `${value}年`
+				}
+				if (type === 'month') {
+					return `${value}月`
+				}
+				if (type === 'day') {
+					return `${value}日`
+				}
+				return value
+			},
+			goDetail(id){
+				console.log('goDetail',id);
+				uni.$u.route('/center/checkdetails', {
+					id: id
+				});
+			}
+		}
+	}
+</script>
+<style>
+page{
+	background-color: #F5F9FC;
+}
+</style>
+<style lang="scss" scoped>
+
+.list{
+	border-radius: 8rpx;
+	padding: 0 20rpx;
+	.item{
+		background-color: #fff;
+		padding: 30rpx;
+		background-color: #fff;
+		margin-bottom: 20rpx;
+		border-radius: 24rpx;
+		font-size: 28rpx;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #666666;
+		line-height: 40rpx;
+		.userinfo{
+			font-size: 32rpx;
+			font-weight: 600;
+			color: #333333;
+			line-height: 44rpx;
+			margin-bottom: 14rpx;
+		}
+		.goods-name{
+			margin-bottom: 12rpx;
+		}
+		.quantity{
+			margin-bottom: 12rpx;
+		}
+		.bottom{
+			font-size: 28rpx;
+			font-weight: 400;
+			color: #999999;
+			line-height: 40rpx;
+		}
+	}
+}
+.date{
+	width: fit-content;
+	padding: 12rpx 20rpx;
+	background-color: #fff;
+	border-radius: 16rpx;
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #009AEF;
+	line-height: 40rpx;
+	.img{
+		margin-right: 10rpx;
+	}
+}
+</style>

+ 87 - 0
center/checksuccess.vue

@@ -0,0 +1,87 @@
+<template>
+	<view class="pages">
+		<view class="icon-wrap u-flex u-row-center" v-if="success=='true'">
+			<u-icon name="checkmark" color="#fff" size="80"></u-icon>
+		</view>
+		<view class="icon-wrap u-flex u-row-center" v-else style="background-color: #FFB100;">
+			<u-icon name="close" color="#fff" size="80"></u-icon>
+		</view>
+		<view class="title">{{title}}</view>
+		<view class="full-btn" v-if="success=='true'" @click="btnClick">继续扫码核销</view>
+		<view class="msg" v-else>{{msg}}</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				title:'核销成功',
+				codeData:null,
+				msg:null,
+				success:null,
+			}
+		},
+		onShow() {		
+		},
+		onLoad(page) {
+			this.codeData = page.codeData;
+			this.msg = page.msg;
+			this.success = page.success;
+			console.log('success',this.success);
+			if(this.success=='true'){
+				this.title = '核销成功';
+			}else{
+				this.title = '核销失败';
+			}
+			uni.setNavigationBarTitle({
+			    title:this.title
+			});
+		},
+		methods: {
+			btnClick(){
+				// uni.$u.route('/pages/index/index', {
+				// });
+				uni.reLaunch({url: `/pages/index/index`});
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #F5F5F5;
+	}
+</style>
+<style lang="scss" scoped>
+.pages{
+	text-align: center;
+}
+
+.icon-wrap{
+	width: 180rpx;
+	height: 180rpx;
+	margin: 120rpx auto 20rpx;
+	padding: 20rpx;
+	background-color: #00EFB2;
+	border-radius: 50%;
+}
+.title{
+	font-size: 34rpx;
+	font-family: PingFangSC-Semibold, PingFang SC;
+	font-weight: 600;
+	color: #333333;
+	line-height: 48rpx;
+	margin-bottom: 120rpx;
+}
+.full-btn{
+	margin: 20rpx 10%;
+	background-color: #009AEF;
+}
+.msg{
+	font-size: 30rpx;
+	font-family: PingFangSC-Regular, PingFang SC;
+	font-weight: 400;
+	color: #999999;
+	line-height: 42rpx;
+}
+</style>

+ 89 - 0
center/paycode.vue

@@ -0,0 +1,89 @@
+<template>
+	<view class="pages">
+		<u-navbar
+			title="推广码"
+			:placeholder="true"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
+		<view class="content">
+			<img class="qrCode" :src="details.qrCode" alt="">
+			<view class="tip">仅限消费者注册使用(微信浏览器长按保存)</view>
+			<text class="save" @click="save">保存本地</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {downloadImage} from '@/utils/downloadImage.js';
+	export default {
+		components:{
+			
+		},
+		data() {
+			return {
+				id:'',
+				staticUrl:this.$commonConfig.staticUrl,
+				details:{}
+			}
+		},
+		onShow() {
+		},
+		onLoad(page) {
+			console.log('page',page);
+			this.id = page.id;
+			this.getPageData()
+		},
+		onUnload() {
+		},
+		onReady() {
+		},
+		methods: {
+			getPageData(){
+				this.$u.api.shopById({id:this.id}).then(res=>{
+					this.details = res.data;
+					// console.log('getPageData',this.details);
+				}).catch(err=>{
+					console.log('getPageData',err);
+				})
+			},
+			save(){
+				downloadImage(this.details.qrCode, this.details.name);
+			}
+		}
+	}
+</script>
+<style>
+page{
+	background-color: #005223;
+}
+</style>
+<style lang="scss" scoped>
+.content{
+	text-align: center;
+	margin: 90rpx 45rpx 24rpx;
+	background: #FFFFFF;
+	border-radius: 8rpx;
+	padding: 100rpx 20rpx;
+	box-sizing: border-box;
+	.qrCode{
+		width: 250px;
+		height: 250px;
+	}
+	.tip{
+		font-size: 24rpx;
+		font-weight: 400;
+		color: #999999;
+		margin-bottom: 40rpx;
+	}
+	.save{
+		padding: 25rpx 98rpx;
+		font-size: 26rpx;
+		font-weight: 600;
+		color: #FFFFFF;
+		background-color: #00A447;
+		border-radius: 4rpx;
+	}
+}
+</style>

+ 173 - 0
center/resetpass.vue

@@ -0,0 +1,173 @@
+<template>
+	<view class="pages">
+		<u-navbar
+			title="修改密码"
+			:placeholder="true"
+			:autoBack="true"
+			 :safeAreaInsetTop="true"
+		>
+		</u-navbar>
+		<view class="page-wrap">
+			<u--form labelPosition="left" :model="form"  :rules="rules" ref="uForm" >
+				<u-form-item label="" prop="oldPassword" :borderBottom="false" ref="oldPassword" >
+					<u--input
+						v-model="form.oldPassword"
+						border="none"
+						placeholder="请输入旧密码"
+						:customStyle="inputCustomStyle"
+					></u--input>
+				</u-form-item>
+				<u-form-item label="" prop="password" :borderBottom="false" ref="password" >
+					<u--input
+						v-model="form.password"
+						border="none"
+						:password="true"
+						placeholder="请输入新密码"
+						:customStyle="inputCustomStyle"
+					></u--input>
+				</u-form-item>
+				<u-form-item label="" prop="comfpassword" :borderBottom="false" ref="comfpassword" >
+					<u--input
+						v-model="form.comfpassword"
+						border="none"
+						:password="true"
+						placeholder="确认密码"
+						:customStyle="inputCustomStyle"
+					></u--input>
+				</u-form-item>
+			</u--form>
+			<u-button
+				@click="submit"
+				text="确认" 
+				type="primary" 
+				shape="circle" 
+				:customStyle="{'margin-top':'60rpx',height:'98rpx','box-sizing':'border-box'}"
+				>
+			</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		
+		data() {
+			return {
+				form:{
+					oldPassword:'',
+					password:'',
+					comfpassword:'',
+				},
+				
+				rules: {
+					oldPassword: {
+						type: 'string',
+						required: true,
+						message: '请输入旧密码',
+						trigger: ['blur', 'change']
+					},
+					password: [
+						{
+							type: 'string',
+							required: true,
+							message: '请输入新密码',
+							trigger: ['blur', 'change']
+						},
+						{
+							min: 6,
+							max: 10,
+							message: '长度在6-10个字符之间',
+							trigger: 'blur',
+						},
+					],
+					comfpassword: [
+						{
+							type: 'string',
+							required: true,
+							message: '请确认密码',
+							trigger: ['blur', 'change']
+						},
+						{
+							validator: (rule, value, callback) => {
+								if (value === '') {
+									callback(new Error('请再次输入密码'));
+								} else if (value !== this.form.password) {
+									callback(new Error('两次输入密码不一致!'));
+								} else {
+									callback();
+								}
+							},
+							trigger: 'blur',
+						}
+					],
+				},
+				inputCustomStyle:{
+					// height:'98rpx',
+					'border-color':'#eee',
+					'background-color': '#F5F9FC',
+					'padding-left':'30rpx',
+					'box-sizing':'border-box',
+				}
+			}
+		},
+		onShow() {
+		},
+		onReady() {
+			this.$refs.uForm.setRules(this.rules)
+		},
+		onLoad() {
+
+		},
+		methods: {
+			chekPass(){
+				console.log('chekPass---',this.form);
+				return new Promise((resolve, reject)=>{
+					if(!password){
+						 reject('needAuth');
+					}
+				})
+			},
+			async submit(){
+				// console.log('form',this.form);
+				this.$refs.uForm.validate().then(res => {
+					// let chekPassResult = await this.chekPass();
+					// return
+					// uni.$u.toast('校验通过')
+					const param = {
+						oldPassword:this.form.oldPassword,
+						password:this.form.password
+					}
+					this.$u.api.updatePassword(param).then(res=>{
+						// console.log('res',res.data);
+						this.$u.vuex('vuex_user_info', res.data);
+						uni.showToast({
+							title:res.msg,
+							icon:'success'
+						})
+						setTimeout(()=>{
+							uni.$u.route('/pages/login/login');
+						},2000)
+						// uni.reLaunch({url: this.backUrl});
+					}).catch(err=>{
+						console.log('login',err);
+					})
+				}).catch(errors => {
+					uni.$u.toast('请正确填写表单')
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.page-wrap{
+	.u-form-item{
+		margin-bottom: 40rpx;
+	}
+	/deep/ .u-form-item__body{
+		background-color:#F5F9FC;
+		border-radius: 16rpx;
+	}
+}
+
+</style>

+ 199 - 0
center/scan.vue

@@ -0,0 +1,199 @@
+<template>
+	<view class="pages">
+		<view class="scan">
+			<!-- <view class="loop_line"></view> -->
+			<u-icon class="close" name="close-circle" color="#fff" size="30" @click="closeScan"></u-icon>
+		    <view class="video-container">
+		      <video class="video" id="video_nav_id" :controls="false"></video>
+		    </view>
+		    <view class="camera-container" v-if="videoInputDevices.length>1">
+		      <label>摄像头:</label>
+		      <select v-model="currentVideoInputDevice">
+		        <option
+		          v-for="(videoInputDevice, index) in videoInputDevices"
+		          :key="index"
+		          :value="videoInputDevice"
+		        >
+		          {{ videoInputDevice.label }}
+		        </option>
+		      </select>
+		    </view>
+		  </view>
+	</view>
+</template>
+
+<script>
+	import {
+	  BrowserMultiFormatReader,
+	  ChecksumException,
+	  FormatException,
+	} from "@zxing/library";
+	// import { LOG } from "@zxing/library/esm/core/datamatrix/encoder/constants";
+	export default {
+		data() {
+			return {
+				exchangeCode:'',
+				codeReader: null,
+				videoInputDevices: [],
+				currentVideoInputDevice: {},
+				decodeResult: undefined,
+			}
+		},
+		onShow() {
+		},
+		beforeDestroy() {
+			this.codeReader.reset(); //关闭摄像头
+			alert('销毁')
+		},
+		mounted() {
+			var video = document.getElementById('video_nav_id').getElementsByTagName('video')[0]
+			video.setAttribute('id','video-1')
+			video.setAttribute('class','video_calss')
+			this.codeReader = new BrowserMultiFormatReader();
+			this.openScan();
+		},
+		onLoad() {
+
+		},
+		watch: {
+		   currentVideoInputDevice: function () {
+		     this.decodeFromInputVideo();
+		   },
+		   decodeResult: function () {
+		     this.successDecode();
+		   },
+		},
+		methods: {
+			async openScan() {
+			      const _this = this;
+				  // console.log('codeReader', this.codeReader);
+				  // camera.setDisplayOrientation(90);
+			      _this.codeReader
+			        .getVideoInputDevices() //老版本listVideoInputDevices()
+			        .then((videoInputDevices) => {
+			          if (videoInputDevices && videoInputDevices.length) {
+			            if (videoInputDevices.length > 1) {
+			              videoInputDevices.reverse();
+			            } //防止先唤出前摄像头
+			            _this.videoInputDevices = videoInputDevices;
+			            _this.currentVideoInputDevice = videoInputDevices[0];
+			          }else{
+						  alert('没有检测到摄像头')
+					  }
+			        })
+			        .catch(() => {});
+			    },
+			
+			    decodeFromInputVideo() {
+			      const _this = this;
+			      _this.codeReader.reset();
+			      // 多次
+				try {
+					_this.codeReader.decodeFromVideoDevice(_this.currentVideoInputDevice.deviceId, 'video-1',(res,err) => {
+						if(res) {
+							_this.decodeResult = res.text;
+						}
+						if (err) {
+												  // alert(err)
+						  if (err instanceof ChecksumException) {
+													alert("A code was found, but it's read value was not valid.")
+						    console.log(
+						      "A code was found, but it's read value was not valid."
+						    );
+						  }
+						  if (err instanceof FormatException) {
+													alert("A code was found, but it was in a invalid format.")
+						    console.log("A code was found, but it was in a invalid format.");
+						  }
+						}
+					})
+				}catch(err){
+					uni.showToast({title: `初始化失败${err}`,icon: 'none'});
+				}
+			},
+			closeScan(){
+				// this.$router.go(-1)
+				// uni.navigateBack()
+				uni.$u.route('/pages/index/index');
+			},
+			successDecode() {
+			  const _this = this;
+			  let result = JSON.parse(_this.decodeResult);
+			  this.exchangeCode = result.qrcode;
+			  
+			  let pages = getCurrentPages();             //获取所有页面栈实例列表
+			  let nowPage = pages[ pages.length - 1];    //当前页页面实例
+			  let prevPage = pages[ pages.length - 2 ];  //上一页页面实例
+			  prevPage.$vm.exchangeCode=  this.exchangeCode;         // 修改上一页data里面的数据
+			  
+			  this.closeScan();
+			  // this.getCheckGoods();
+			  // alert(_this.decodeResult);
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+#video_nav_id {
+	height: 100%;
+	width: 100%;
+}
+/deep/.uni-video-cover {
+	display: none;
+}
+
+.scan {
+position: fixed;
+left: 0;
+top: 0;
+z-index: 9999;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  color: #ff9900;
+  width: 100%;
+  height: 100vh;
+  background: #000;
+  .video-container {
+	width: 100%;
+	height: 100%;
+    display: flex;
+    justify-content: center;
+    /deep/ #video-1{
+      width: 100%;
+      height: 100%;
+    }
+    @media (min-width: 500px) {
+      video {
+        // width: 80vh;
+        max-width: 96vw;
+        height: 80vh;
+      }
+    }
+  }
+  .camera-container {
+    margin-top: 5vh;
+    width: 80%;
+    height: 50px;
+    line-height: 44px;
+    border-radius: 10px;
+    border: 3px solid #ff9900;
+    display: flex;
+    justify-content: center;
+    select {
+      width: calc(100% - 80px);
+      color: #ff9900;
+      background: transparent;
+      border: none;
+      outline: none;
+    }
+  }
+  .close{
+	  position: absolute;
+	  right: 40rpx;
+	  top: 40rpx;
+	  z-index: 100;
+  }
+}
+</style>

+ 65 - 0
common/apiurl.js

@@ -0,0 +1,65 @@
+/*
+	接口统一管理
+*/
+const apiurl = {
+	// 用户注册登陆
+	login: {
+		url: '/auth/accountLogin',
+		type: 'post'
+	},
+	//登录用户信息
+	memberInfo: {
+		url: '/memberInfo/getInfoById',
+		type: 'get'
+	},
+	// 重新登录
+	reLogin: {
+		url: '/auth/login',
+		type: 'post'
+	},
+	// 修改密码
+	updatePassword: {
+		url: '/memberInfo/updatePassword',
+		type: 'put'
+	},
+	// 修改用户信息
+	updateMemberInfo: {
+		url: '/memberInfo/update',
+		type: 'put'
+	},
+	//核销商品信息
+	getCheckGood: {
+		url: '/memberExchangeRecord/getCheckGood',
+		type: 'get'
+	},
+	//奖品核销
+	check: {
+		url: '/memberExchangeRecord/check',
+		type: 'put'
+	},
+	//核销记录
+	checkList: {
+		url: '/memberExchangeRecord/selectCheckList',
+		type: 'get'
+	},
+	//核销详情
+	checkDetail: {
+		url: '/memberExchangeRecord/selectById',
+		type: 'get'
+	},
+	
+}
+
+
+/*
+* 特殊处理接口
+*/ 
+const otherApiUrl = {
+	// 文件上传
+	uploadFile: '/file/upload/single/minio',
+}
+
+export {
+	apiurl,
+	otherApiUrl
+}

+ 27 - 0
common/config.js

@@ -0,0 +1,27 @@
+/**
+ * 配置通用 
+ */
+const node_dev = process.env.H_NODE_ENV;
+//运行到浏览器用的
+let baseUrl='/api';
+let upFileUrl='https://fileupload.hw.hongweisoft.com/upload/single/minio';
+
+//打包用的
+if (node_dev) {
+ baseUrl = process.env.H_BASE_URL;
+ upFileUrl = process.env.H_UP_FILE_URL;
+}
+
+const commonConfig = {
+	wxAppid: '', // 测试wxAppid
+	baseUrl: '/api', // 服务器地址
+	uploadFileUrl: upFileUrl, // 上传文件路径
+	paginationConfig:{
+		  pageNum: 1,
+		  pageSize: 10
+	},//分页参数
+	successCode:200,//接口返回状态
+}
+export {
+	commonConfig
+}

+ 29 - 0
common/http.api.js

@@ -0,0 +1,29 @@
+import {
+	apiurl
+} from "./apiurl.js"
+
+// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
+const install = (Vue, vm) => {
+
+	let httpMap = {}
+	const http = uni.$u.http
+	
+	// 循环请求路径对象生成对应的方式请求
+	Object.keys(apiurl).forEach((key) => {
+		if(apiurl[key]?.type=='get'){
+			httpMap[key] = (data = {}, config = {}) => http[apiurl[key]?.type](apiurl[key]?.url, {params:data}, config);
+		}else{
+			httpMap[key] = (params = {}, config = {}) => http[apiurl[key]?.type](apiurl[key]?.url, params, config);
+		}
+	    
+	});
+	
+	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
+	vm.$u.api = {
+		...httpMap
+	};
+}
+
+export default {
+	install
+}

+ 86 - 0
common/http.interceptor.js

@@ -0,0 +1,86 @@
+import { commonConfig } from '@/common/config.js';
+import store  from '../store/index.js'
+import {againToken}  from '../utils/leaderToken.js'
+// 这里的vm,就是我们在vue文件里面的this,所以我们能在这里获取vuex的变量,比如存放在里面的token
+// 同时,我们也可以在此使用getApp().globalData,如果你把token放在getApp().globalData的话,也是可以使用的
+const install = (Vue, vm) => {
+	Vue.prototype.$u.http.setConfig({
+		baseUrl: commonConfig.baseUrl,
+		timeout: 40000,
+		// 如果将此值设置为true,拦截回调中将会返回服务端返回的所有数据response,而不是response.data
+		// 设置为true后,就需要在this.$u.http.interceptor.response进行多一次的判断,请打印查看具体值
+		// originalData: true, 
+		// 设置自定义头部content-type
+		// header: {
+		// 	'content-type': 'xxx'
+		// }
+	});
+	// 请求拦截,配置Token等参数
+	Vue.prototype.$u.http.interceptor.request = (config) => {
+		// config.header.Token = 'xxxxxx';
+		// 方式一,存放在vuex的token,假设使用了uView封装的vuex方式,见:https://uviewui.com/components/globalVariable.html
+		// config.header.token = vm.vuex_token;
+		if(vm.vuex_user.accessToken){config.header.Authorization = `Bearer ${vm.vuex_user.accessToken}`;}
+		if(vm.vuex_user.userId){config.header['user_id'] = `${vm.vuex_user.userId}`;}
+		// 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
+		// config.header.token = vm.$store.state.token;
+		
+		// 方式三,如果token放在了globalData,通过getApp().globalData获取
+		// config.header.token = getApp().globalData.username;
+		
+		// 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的,所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
+		// const token = uni.getStorageSync('token');
+		// config.header.token = token;
+		// url加时间戳
+		if(config.url.indexOf('?') > -1){
+		    config.url = config.url + '&t=' + Date.now()	
+		} else {
+			config.url = config.url + '?t=' + Date.now()	
+		}
+		// 此url参数为this.$u.get(url)中的url值
+		let noTokenList = ['/wechat/h5/user','/client/auth/verifyCode'];
+		if(noTokenList.includes(config.url)) config.header.noToken = true;
+		// console.log('noTokenList.includes(config.url)',noTokenList.includes(config.url));
+		// console.log('config.url',config.url);
+		return config; 
+	}
+	// 响应拦截,判断状态码是否通过
+	Vue.prototype.$u.http.interceptor.response = (res) => {
+		// 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据
+		// 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
+		// console.log('interceptor res',res);
+		if(res.code == 200) {
+			// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
+			return res;  
+		} else if(res.msg == "令牌不能为空" || res.code == 401){
+			if(vm.vuex_user.userId) {
+				againToken(vm.vuex_user.userId)
+			} else {
+				const backUrl = location.href
+				const loginUrl = 'phoneLogin'
+				if (backUrl.indexOf(loginUrl) > 0) {
+					localStorage.clear()
+				} else {
+					// uni.showToast({
+					// 	title: res.msg + "即将跳转到登录页",
+					// 	icon: "none",
+					// 	duration: 2000
+					// });
+					localStorage.setItem('backUrl', location.href)
+					// alert('还未登录,即将跳转登录');
+					setTimeout(() => {
+						uni.navigateTo({
+							url: "/pages/login/login"
+						})
+					}, 1000)
+				}
+			}
+		
+			
+		}else return res;
+	}
+}
+
+export default {
+	install
+}

+ 123 - 0
common/request.js

@@ -0,0 +1,123 @@
+import { commonConfig } from '@/common/config.js';
+import {againToken}  from '../utils/againToken.js'
+import { showFullScreenLoading , tryHideFullScreenLoading } from '../utils/loading.js'
+// 此vm参数为页面的实例,可以通过它引用vuex中的变量
+module.exports = (vm) => {
+    // 初始化请求配置
+    uni.$u.http.setConfig((config) => {
+        /* config 为默认全局配置*/
+        config.baseURL = commonConfig.baseUrl; /* 根域名 */
+        return config
+    })
+	
+	// 请求拦截
+	uni.$u.http.interceptors.request.use((config) => { // 可使用async await 做异步操作
+	// console.log('config========',config);
+	    // 初始化请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
+	    config.data = config.data || {}
+		// 根据custom参数中配置的是否需要token,添加对应的请求头
+		if(!config?.custom?.auth) {
+			// 可以在此通过vm引用vuex中的变量,具体值在vm.$store.state中
+			// config.header.token = vm.vuex_user_info.token;
+			config.header.Authorization = `Bearer ${vm.vuex_user_info.token}`;
+		}
+		if(!config?.custom?.noload){
+			showFullScreenLoading()
+		}
+	    return config 
+	}, config => { // 可使用async await 做异步操作
+	    return Promise.reject(config)
+	})
+	
+	let unlogin = function(){
+		if(vm.vuex_user_info.userid&&vm.vuex_wechatOpenid) {
+			againToken(vm.$u,vm.vuex_wechatOpenid,vm.vuex_user_info.userid)
+		} else {
+			let pages = getCurrentPages();
+			// console.log('pages',pages);
+			let backUrl = pages[pages.length - 1].route;
+			let options =uni.$u.queryParams( pages[pages.length - 1].options);
+			let fullBackUrl = backUrl+options;
+			const loginUrl = 'login'
+			if (backUrl.indexOf(loginUrl) > 0) {
+				uni.removeStorage({
+					key: 'backUrl',
+					success: function (res) {
+						// console.log('success');
+					}
+				});
+			} else {
+				// uni.showToast({
+				// 	title: res.msg + "即将跳转到登录页",
+				// 	icon: "none",
+				// 	duration: 2000
+				// });
+				uni.setStorage({
+					key: 'backUrl',
+					data: fullBackUrl,
+					success: function () {
+						// console.log('setStorage success');
+					}
+				});
+				setTimeout(() => {
+					uni.$u.route('/pages/login/login');
+				}, 1000)
+			}
+		}
+	}
+	
+	// 响应拦截
+	uni.$u.http.interceptors.response.use((response) => {/* 对响应成功做点什么 可使用async await 做异步操作*/
+		// console.log('response====response',response);
+		const data = response.data
+
+		// 自定义参数
+		const custom = response.config?.custom
+		if (data.code !== 200) {
+			// console.log('data====',data);
+			// 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
+			if (custom.toast !== false) {
+				const unshowmsg = ['令牌不能为空'];
+				if (!unshowmsg.includes(data.msg)) {
+				  uni.$u.toast(data.msg)
+				}
+			}
+			if(data.msg == "令牌验证失败" || data.msg == "令牌不能为空" || data.code == 401){
+				unlogin()
+			}
+			
+			if(data.msg == "用户不存在!"||data.msg == "用户未注册"){
+				uni.clearStorage();
+				unlogin()
+			}
+			
+			return Promise.reject(data)
+			// 如果需要catch返回,则进行reject
+			// if (custom?.catch) {
+			// 	return Promise.reject(data)
+			// } else {
+			// 	// 否则返回一个pending中的promise,请求不会进入catch中
+			// 	return new Promise(() => { })
+			// }
+		}
+		// console.log('data--',data);
+		tryHideFullScreenLoading()
+		return data === undefined ? {} : data
+	}, (response) => {
+		tryHideFullScreenLoading()
+		// console.log('response==',response);
+		const data = response.data;
+		// console.log('data==',data);
+		// 对响应错误做点什么 (statusCode !== 200)
+		let errMap = {
+			'404':'接口不存在'
+		};
+		if (response.statusCode in errMap) {
+		  uni.$u.toast(errMap[response.statusCode])
+		}
+		if(data.msg == "令牌不能为空" || data.code == 401){
+			unlogin()
+		}
+		return Promise.reject(response)
+	})
+}

+ 411 - 0
components/ay-qrcode/ay-qrcode.vue

@@ -0,0 +1,411 @@
+<template>
+	<view :class="modal?'show-qrcode':'hide-qrcode'">
+		<view class="box-qrcode" :style="{'margin-left':  marginLeft + 'px'}" @longtap="longtapCode">
+			<!-- style="width: 550rpx;height: 550rpx;" -->
+			
+			<canvas class="canvas-qrcode" :style="style_w_h" :canvas-id="qrcode_id">
+				
+				<!-- #ifndef MP -->
+				<view v-if="modal&&is_themeImg" :style="style_w_h" class="box-img-qrcode">
+					<image :style="style_w_h_img" mode="scaleToFill" :src="themeImg"></image>
+				</view>
+				<!-- #endif -->
+				
+			</canvas>
+			
+			<!-- <image mode="scaleToFill" :src="imagePath"></image> -->
+			
+		</view>
+	</view>
+</template>
+
+<script>
+	var qr_we = require("./qrcode_wx.js");
+	const qrCode = require('./weapp-qrcode.js')
+	export default {
+		data() {
+			return {
+				isAndroid : false ,
+				show: true,
+				imagePath: '',
+				// qrcode_id: 'qrcode_id',
+				marginLeft: 0,
+				//一般的安卓app只需加30就能显示全
+				//苹果app的不加就能显示全,加了就要弄margin-left
+				//有些安卓app显示不全
+				add_num : 30 ,
+				add_num_key : 'rectify_code_key',
+			}
+		},
+		props: {
+			modal: {
+				type: Boolean,
+				default: false
+			},
+			url: {
+				type: String,
+				default: ''
+			},
+			height: {
+				type: Number,
+				default: 260
+			},
+			width: {
+				type: Number,
+				default: 260
+			},
+			themeColor: {
+				type: String,
+				default: '#333333',
+			},
+			qrcode_id: {
+				type: String,
+				default: 'qrcode_id',
+			},
+			is_themeImg: {
+				type: Boolean,
+				default: false,
+			},
+			themeImg: {
+				type: String,
+				default: 'https://cdn.pixabay.com/photo/2016/11/29/13/24/balloons-1869816__340.jpg',
+			},
+			h_w_img: {
+				type: Number,
+				default: 30
+			},
+			
+			
+		},
+		watch:{
+			
+		},
+		computed: {
+			style_w_h() {
+				return this.set_style_w_h();
+			},
+			style_w_h_img() {
+				let that = this;
+				var height = parseInt(that.h_w_img);
+				var width = parseInt(that.h_w_img);
+				var style = '';
+				if (height > 0) {
+					style = `height:${height*2}rpx;`;
+				}
+				if (width > 0) {
+					style += `width:${width*2}rpx;z-index: 2;`;
+				}
+			
+				return style;
+			},
+		},
+		created: function() {
+			let that = this;
+			try {
+				//app苹果二维码不居中
+				//#ifndef MP
+				let isAndroid = false ;
+			    const res = uni.getSystemInfoSync();
+			    if(res.platform == 'android'){
+					isAndroid = true ;
+				}else{
+					isAndroid = false ;
+				}
+				
+				
+				if (!isAndroid) {
+					that.marginLeft = 46;
+				}
+				
+				that.isAndroid = isAndroid ;
+				try {
+					const add_num = uni.getStorageSync(that.add_num_key);
+					if (add_num) {
+						that.add_num = add_num;
+					}
+					
+				} catch (e) {
+					// error
+				
+				}
+				// #endif
+
+			} catch (e) {
+			    // error
+			}
+
+			//#ifdef MP
+			//that.marginLeft = 40;
+			// #endif
+
+		},
+		methods: {
+			set_style_w_h(){
+				
+				let that = this;
+				var height = parseInt(that.height);
+				var width = parseInt(that.width);
+				var style = '';
+				var height = height*2 ;
+				var width = width*2 ;
+				
+				//#ifndef MP
+				var add = that.add_num ;
+				
+				height +=  add;
+				width +=  add;
+				// #endif
+				
+				if (height > 0) {
+					style = `height:${height}rpx;`;
+				}
+				if (width > 0) {
+					style += `width:${width}rpx;`;
+				}
+				
+				return style;
+			},
+			hideQrcode() {
+				this.$emit("hideQrcode")
+			},
+			// 二维码生成工具
+			crtQrCode() {
+				let that = this;
+				//#ifndef MP
+				new qrCode(that.qrcode_id, {
+					text: this.url,
+					width: that.width,
+					height: that.height,
+					colorDark: that.themeColor,//#333333
+					colorLight: "#FFFFFF",
+					correctLevel: qrCode.CorrectLevel.H,
+				})
+				// #endif
+				//#ifdef MP
+				that.createQrCode(this.url, that.qrcode_id, that.width, that.height,that.themeColor,that.is_themeImg,that.themeImg,that.h_w_img);
+				// #endif
+
+				//that.createQrCode(this.url, that.qrcode_id, that.width, that.height);
+			},
+			//#ifdef MP
+
+			createQrCode: function(url, canvasId, cavW, cavH,cavColor,haveImg,imgurl,imgsize) {
+				//调用插件中的draw方法,绘制二维码图片
+				qr_we.api.draw(url, canvasId, cavW, cavH,cavColor,haveImg,imgurl,imgsize, this, this.canvasToTempImage);
+				// setTimeout(() => { this.canvasToTempImage();},100);
+
+			},
+			
+			// #endif
+			//获取临时缓存照片路径,存入data中
+			canvasToTempImage: function() {
+				var that = this;
+			},
+			saveImage: function() {
+				var that = this;
+				uni.canvasToTempFilePath({
+					canvasId: that.qrcode_id,
+					success: function(res) {
+						var tempFilePath = res.tempFilePath;
+						console.log(tempFilePath);
+						that.imagePath = tempFilePath;
+						
+						//保存到相册
+						// uni.saveFile({
+						//       tempFilePath: tempFilePath,
+						//       success: function (res2) {
+						//         var savedFilePath = res2.savedFilePath;
+								
+								
+						//       }
+						// });
+						uni.saveImageToPhotosAlbum({
+							filePath : tempFilePath ,
+							success: function (res3) {
+								uni.showModal({
+									title: '提示',
+									content: '保存成功',
+									confirmText: '确定',
+									showCancel: false,
+									confirmColor: '#33CCCC',
+									success(res4) {
+										
+									}
+								}) 
+							},
+						});
+					},
+					fail: function(res) {
+						console.log(res);
+					}
+				}, that);
+			},
+			//微信小程序支持:长按二维码,提示是否保存相册
+			//安卓APP长按校正二维码
+			longtapCode(){
+				var that = this;
+				
+				//#ifndef MP
+				uni.showModal({
+					title: '校正二维码',
+					content: '二维码是否异常',
+					confirmText: '确定',
+					confirmColor: '#33CCCC',
+					success(res) {
+						if (res.confirm) {
+							that.rectify_code();
+						}
+					}
+				})
+				// #endif
+				
+				//#ifdef MP-WEIXIN
+				uni.showModal({
+					title: '提示',
+					content: '是否保存到相册',
+					confirmText: '确定',
+					confirmColor: '#33CCCC',
+					success(res) {
+						if (res.confirm) {
+							that.saveImage();
+						}
+					}
+				})
+				// #endif
+			},
+			//安卓有些手机不正常,长按可选择矫正
+			rectify_code(){
+				var that = this;
+				let add_num = that.add_num ;
+				add_num += 30 ;
+				that.add_num = add_num;
+				that.crtQrCode();//重新生成才会立即覆盖
+				try {
+					//第一次长按校正设置了就不用在设置
+					uni.setStorage({
+						key: that.add_num_key,
+						data: add_num,
+						success: function() {
+							
+						}
+					});
+				} catch (e) {
+					// error
+				
+				}
+			},
+		},
+		mounted() {}
+	}
+</script>
+
+<style scoped lang="scss">
+	// .qrcode-box {
+	// 	position: fixed;
+	// 	left: 0;
+	// 	top: 0;
+	// 	right: 0;
+	// 	bottom: 0;
+	// 	height: 100vh;
+	// 	width: 100vw;
+	// 	background-color: rgba(59, 59, 59, 0.6);
+	// 	// opacity: 0.8;
+	// 	text-align: center;
+	// 	display: flex;
+	// 	align-items: center;
+	// 	display: none;
+
+	// 	.qrcode-item {
+	// 		flex: 1;
+	// 		position: relative;
+	// 		text-align: center;
+
+	// 		.item-box {
+	// 			width: 90%;
+	// 			margin: auto;
+	// 			display: inline-block;
+	// 			margin-top: 30%;
+	// 			padding-bottom: 30rpx;
+
+	// 			// animation: show 0.7s;
+	// 			.title {
+	// 				font-size: 46rpx;
+	// 				text-align: center;
+	// 				margin-bottom: 24rpx;
+	// 			}
+
+	// 			.canvas {
+	// 				margin: auto;
+	// 				display: inline-block;
+	// 				margin: auto;
+	// 			}
+
+	// 			background-color: #FFFFFF;
+	// 		}
+
+	// 	}
+	// }
+	.box-qrcode{
+		text-align: center;
+		position: relative;
+		.box-img-qrcode{
+			position: absolute;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+			z-index: 2;
+		}
+	}
+	image{
+		width: 60upx;
+		height: 60upx;
+		border-radius: 50%;
+		
+	}
+	.canvas-qrcode {
+		
+		margin: auto;
+		display: inline-block;
+		float: left;
+	}
+	
+	
+	.opacity-qrcode {
+		opacity: 0;
+		display: block;
+	}
+
+	.show-qrcode {
+		display: block;
+		animation: fade 0.7s;
+
+		// -moz-animation: fade 0.5s; /* Firefox */
+		// -webkit-animation: fade 0.5s; /* Safari 和 Chrome */
+		// -o-animation: fade 0.5s;
+	}
+
+	.hide-qrcode {
+		animation: hide 0.7s;
+	}
+
+	@keyframes fade {
+		from {
+			opacity: 0.8;
+		}
+
+		to {
+			opacity: 1;
+		}
+	}
+
+	@keyframes hide {
+		from {
+			opacity: 1;
+		}
+
+		to {
+			opacity: 0;
+		}
+	}
+</style>

+ 872 - 0
components/ay-qrcode/qrcode_wx.js

@@ -0,0 +1,872 @@
+!(function() {
+
+	// alignment pattern
+	var adelta = [
+		0, 11, 15, 19, 23, 27, 31,
+		16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24,
+		26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28
+	];
+
+	// version block
+	var vpat = [
+		0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d,
+		0x928, 0xb78, 0x45d, 0xa17, 0x532, 0x9a6, 0x683, 0x8c9,
+		0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75,
+		0x250, 0x9d5, 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64,
+		0x541, 0xc69
+	];
+
+	// final format bits with mask: level << 3 | mask
+	var fmtword = [
+		0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976, //L
+		0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0, //M
+		0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed, //Q
+		0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b //H
+	];
+
+	// 4 per version: number of blocks 1,2; data width; ecc width
+	var eccblocks = [
+		1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17,
+		1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28,
+		1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22,
+		1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16,
+		1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22,
+		2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28,
+		2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26,
+		2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26,
+		2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24,
+		2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28,
+		4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24,
+		2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28,
+		4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22,
+		3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24,
+		5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24,
+		5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30,
+		1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28,
+		5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28,
+		3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26,
+		3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28,
+		4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30,
+		2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24,
+		4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30,
+		6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30,
+		8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30,
+		10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30,
+		8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30,
+		3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30,
+		7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30,
+		5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30,
+		13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30,
+		17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30,
+		17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30,
+		13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30,
+		12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30,
+		6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30,
+		17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30,
+		4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30,
+		20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30,
+		19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30
+	];
+
+	// Galois field log table
+	var glog = [
+		0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b,
+		0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71,
+		0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45,
+		0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6,
+		0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88,
+		0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40,
+		0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d,
+		0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57,
+		0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18,
+		0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e,
+		0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61,
+		0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2,
+		0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6,
+		0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a,
+		0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7,
+		0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf
+	];
+
+	// Galios field exponent table
+	var gexp = [
+		0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26,
+		0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0,
+		0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23,
+		0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1,
+		0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0,
+		0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2,
+		0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce,
+		0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc,
+		0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54,
+		0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73,
+		0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff,
+		0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41,
+		0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6,
+		0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09,
+		0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16,
+		0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00
+	];
+
+	// Working buffers:
+	// data input and ecc append, image working buffer, fixed part of image, run lengths for badness
+	var strinbuf = [],
+		eccbuf = [],
+		qrframe = [],
+		framask = [],
+		rlens = [];
+	// Control values - width is based on version, last 4 are from table.
+	var version, width, neccblk1, neccblk2, datablkw, eccblkwid;
+	var ecclevel = 2;
+	// set bit to indicate cell in qrframe is immutable.  symmetric around diagonal
+	function setmask(x, y) {
+		var bt;
+		if (x > y) {
+			bt = x;
+			x = y;
+			y = bt;
+		}
+		// y*y = 1+3+5...
+		bt = y;
+		bt *= y;
+		bt += y;
+		bt >>= 1;
+		bt += x;
+		framask[bt] = 1;
+	}
+
+	// enter alignment pattern - black to qrframe, white to mask (later black frame merged to mask)
+	function putalign(x, y) {
+		var j;
+
+		qrframe[x + width * y] = 1;
+		for (j = -2; j < 2; j++) {
+			qrframe[(x + j) + width * (y - 2)] = 1;
+			qrframe[(x - 2) + width * (y + j + 1)] = 1;
+			qrframe[(x + 2) + width * (y + j)] = 1;
+			qrframe[(x + j + 1) + width * (y + 2)] = 1;
+		}
+		for (j = 0; j < 2; j++) {
+			setmask(x - 1, y + j);
+			setmask(x + 1, y - j);
+			setmask(x - j, y - 1);
+			setmask(x + j, y + 1);
+		}
+	}
+
+	//========================================================================
+	// Reed Solomon error correction
+	// exponentiation mod N
+	function modnn(x) {
+		while (x >= 255) {
+			x -= 255;
+			x = (x >> 8) + (x & 255);
+		}
+		return x;
+	}
+
+	var genpoly = [];
+
+	// Calculate and append ECC data to data block.  Block is in strinbuf, indexes to buffers given.
+	function appendrs(data, dlen, ecbuf, eclen) {
+		var i, j, fb;
+
+		for (i = 0; i < eclen; i++)
+			strinbuf[ecbuf + i] = 0;
+		for (i = 0; i < dlen; i++) {
+			fb = glog[strinbuf[data + i] ^ strinbuf[ecbuf]];
+			if (fb != 255) /* fb term is non-zero */
+				for (j = 1; j < eclen; j++)
+					strinbuf[ecbuf + j - 1] = strinbuf[ecbuf + j] ^ gexp[modnn(fb + genpoly[eclen - j])];
+			else
+				for (j = ecbuf; j < ecbuf + eclen; j++)
+					strinbuf[j] = strinbuf[j + 1];
+			strinbuf[ecbuf + eclen - 1] = fb == 255 ? 0 : gexp[modnn(fb + genpoly[0])];
+		}
+	}
+
+	//========================================================================
+	// Frame data insert following the path rules
+
+	// check mask - since symmetrical use half.
+	function ismasked(x, y) {
+		var bt;
+		if (x > y) {
+			bt = x;
+			x = y;
+			y = bt;
+		}
+		bt = y;
+		bt += y * y;
+		bt >>= 1;
+		bt += x;
+		return framask[bt];
+	}
+
+	//========================================================================
+	//  Apply the selected mask out of the 8.
+	function applymask(m) {
+		var x, y, r3x, r3y;
+
+		switch (m) {
+			case 0:
+				for (y = 0; y < width; y++)
+					for (x = 0; x < width; x++)
+						if (!((x + y) & 1) && !ismasked(x, y))
+							qrframe[x + y * width] ^= 1;
+				break;
+			case 1:
+				for (y = 0; y < width; y++)
+					for (x = 0; x < width; x++)
+						if (!(y & 1) && !ismasked(x, y))
+							qrframe[x + y * width] ^= 1;
+				break;
+			case 2:
+				for (y = 0; y < width; y++)
+					for (r3x = 0, x = 0; x < width; x++, r3x++) {
+						if (r3x == 3)
+							r3x = 0;
+						if (!r3x && !ismasked(x, y))
+							qrframe[x + y * width] ^= 1;
+					}
+				break;
+			case 3:
+				for (r3y = 0, y = 0; y < width; y++, r3y++) {
+					if (r3y == 3)
+						r3y = 0;
+					for (r3x = r3y, x = 0; x < width; x++, r3x++) {
+						if (r3x == 3)
+							r3x = 0;
+						if (!r3x && !ismasked(x, y))
+							qrframe[x + y * width] ^= 1;
+					}
+				}
+				break;
+			case 4:
+				for (y = 0; y < width; y++)
+					for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++, r3x++) {
+						if (r3x == 3) {
+							r3x = 0;
+							r3y = !r3y;
+						}
+						if (!r3y && !ismasked(x, y))
+							qrframe[x + y * width] ^= 1;
+					}
+				break;
+			case 5:
+				for (r3y = 0, y = 0; y < width; y++, r3y++) {
+					if (r3y == 3)
+						r3y = 0;
+					for (r3x = 0, x = 0; x < width; x++, r3x++) {
+						if (r3x == 3)
+							r3x = 0;
+						if (!((x & y & 1) + !(!r3x | !r3y)) && !ismasked(x, y))
+							qrframe[x + y * width] ^= 1;
+					}
+				}
+				break;
+			case 6:
+				for (r3y = 0, y = 0; y < width; y++, r3y++) {
+					if (r3y == 3)
+						r3y = 0;
+					for (r3x = 0, x = 0; x < width; x++, r3x++) {
+						if (r3x == 3)
+							r3x = 0;
+						if (!(((x & y & 1) + (r3x && (r3x == r3y))) & 1) && !ismasked(x, y))
+							qrframe[x + y * width] ^= 1;
+					}
+				}
+				break;
+			case 7:
+				for (r3y = 0, y = 0; y < width; y++, r3y++) {
+					if (r3y == 3)
+						r3y = 0;
+					for (r3x = 0, x = 0; x < width; x++, r3x++) {
+						if (r3x == 3)
+							r3x = 0;
+						if (!(((r3x && (r3x == r3y)) + ((x + y) & 1)) & 1) && !ismasked(x, y))
+							qrframe[x + y * width] ^= 1;
+					}
+				}
+				break;
+		}
+		return;
+	}
+
+	// Badness coefficients.
+	var N1 = 3,
+		N2 = 3,
+		N3 = 40,
+		N4 = 10;
+
+	// Using the table of the length of each run, calculate the amount of bad image 
+	// - long runs or those that look like finders; called twice, once each for X and Y
+	function badruns(length) {
+		var i;
+		var runsbad = 0;
+		for (i = 0; i <= length; i++)
+			if (rlens[i] >= 5)
+				runsbad += N1 + rlens[i] - 5;
+		// BwBBBwB as in finder
+		for (i = 3; i < length - 1; i += 2)
+			if (rlens[i - 2] == rlens[i + 2] &&
+				rlens[i + 2] == rlens[i - 1] &&
+				rlens[i - 1] == rlens[i + 1] &&
+				rlens[i - 1] * 3 == rlens[i]
+				// white around the black pattern? Not part of spec
+				&&
+				(rlens[i - 3] == 0 // beginning
+					||
+					i + 3 > length // end
+					||
+					rlens[i - 3] * 3 >= rlens[i] * 4 || rlens[i + 3] * 3 >= rlens[i] * 4)
+			)
+				runsbad += N3;
+		return runsbad;
+	}
+
+	// Calculate how bad the masked image is - blocks, imbalance, runs, or finders.
+	function badcheck() {
+		var x, y, h, b, b1;
+		var thisbad = 0;
+		var bw = 0;
+
+		// blocks of same color.
+		for (y = 0; y < width - 1; y++)
+			for (x = 0; x < width - 1; x++)
+				if ((qrframe[x + width * y] && qrframe[(x + 1) + width * y] &&
+						qrframe[x + width * (y + 1)] && qrframe[(x + 1) + width * (y + 1)]) // all black
+					||
+					!(qrframe[x + width * y] || qrframe[(x + 1) + width * y] ||
+						qrframe[x + width * (y + 1)] || qrframe[(x + 1) + width * (y + 1)])) // all white
+					thisbad += N2;
+
+		// X runs
+		for (y = 0; y < width; y++) {
+			rlens[0] = 0;
+			for (h = b = x = 0; x < width; x++) {
+				if ((b1 = qrframe[x + width * y]) == b)
+					rlens[h]++;
+				else
+					rlens[++h] = 1;
+				b = b1;
+				bw += b ? 1 : -1;
+			}
+			thisbad += badruns(h);
+		}
+
+		// black/white imbalance
+		if (bw < 0)
+			bw = -bw;
+
+		var big = bw;
+		var count = 0;
+		big += big << 2;
+		big <<= 1;
+		while (big > width * width)
+			big -= width * width, count++;
+		thisbad += count * N4;
+
+		// Y runs
+		for (x = 0; x < width; x++) {
+			rlens[0] = 0;
+			for (h = b = y = 0; y < width; y++) {
+				if ((b1 = qrframe[x + width * y]) == b)
+					rlens[h]++;
+				else
+					rlens[++h] = 1;
+				b = b1;
+			}
+			thisbad += badruns(h);
+		}
+		return thisbad;
+	}
+
+	function genframe(instring) {
+		var x, y, k, t, v, i, j, m;
+
+		// find the smallest version that fits the string
+		t = instring.length;
+		version = 0;
+		do {
+			version++;
+			k = (ecclevel - 1) * 4 + (version - 1) * 16;
+			neccblk1 = eccblocks[k++];
+			neccblk2 = eccblocks[k++];
+			datablkw = eccblocks[k++];
+			eccblkwid = eccblocks[k];
+			k = datablkw * (neccblk1 + neccblk2) + neccblk2 - 3 + (version <= 9);
+			if (t <= k)
+				break;
+		} while (version < 40);
+
+		// FIXME - insure that it fits insted of being truncated
+		width = 17 + 4 * version;
+
+		// allocate, clear and setup data structures
+		v = datablkw + (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2;
+		for (t = 0; t < v; t++)
+			eccbuf[t] = 0;
+		strinbuf = instring.slice(0);
+
+		for (t = 0; t < width * width; t++)
+			qrframe[t] = 0;
+
+		for (t = 0; t < (width * (width + 1) + 1) / 2; t++)
+			framask[t] = 0;
+
+		// insert finders - black to frame, white to mask
+		for (t = 0; t < 3; t++) {
+			k = 0;
+			y = 0;
+			if (t == 1)
+				k = (width - 7);
+			if (t == 2)
+				y = (width - 7);
+			qrframe[(y + 3) + width * (k + 3)] = 1;
+			for (x = 0; x < 6; x++) {
+				qrframe[(y + x) + width * k] = 1;
+				qrframe[y + width * (k + x + 1)] = 1;
+				qrframe[(y + 6) + width * (k + x)] = 1;
+				qrframe[(y + x + 1) + width * (k + 6)] = 1;
+			}
+			for (x = 1; x < 5; x++) {
+				setmask(y + x, k + 1);
+				setmask(y + 1, k + x + 1);
+				setmask(y + 5, k + x);
+				setmask(y + x + 1, k + 5);
+			}
+			for (x = 2; x < 4; x++) {
+				qrframe[(y + x) + width * (k + 2)] = 1;
+				qrframe[(y + 2) + width * (k + x + 1)] = 1;
+				qrframe[(y + 4) + width * (k + x)] = 1;
+				qrframe[(y + x + 1) + width * (k + 4)] = 1;
+			}
+		}
+
+		// alignment blocks
+		if (version > 1) {
+			t = adelta[version];
+			y = width - 7;
+			for (;;) {
+				x = width - 7;
+				while (x > t - 3) {
+					putalign(x, y);
+					if (x < t)
+						break;
+					x -= t;
+				}
+				if (y <= t + 9)
+					break;
+				y -= t;
+				putalign(6, y);
+				putalign(y, 6);
+			}
+		}
+
+		// single black
+		qrframe[8 + width * (width - 8)] = 1;
+
+		// timing gap - mask only
+		for (y = 0; y < 7; y++) {
+			setmask(7, y);
+			setmask(width - 8, y);
+			setmask(7, y + width - 7);
+		}
+		for (x = 0; x < 8; x++) {
+			setmask(x, 7);
+			setmask(x + width - 8, 7);
+			setmask(x, width - 8);
+		}
+
+		// reserve mask-format area
+		for (x = 0; x < 9; x++)
+			setmask(x, 8);
+		for (x = 0; x < 8; x++) {
+			setmask(x + width - 8, 8);
+			setmask(8, x);
+		}
+		for (y = 0; y < 7; y++)
+			setmask(8, y + width - 7);
+
+		// timing row/col
+		for (x = 0; x < width - 14; x++)
+			if (x & 1) {
+				setmask(8 + x, 6);
+				setmask(6, 8 + x);
+			}
+		else {
+			qrframe[(8 + x) + width * 6] = 1;
+			qrframe[6 + width * (8 + x)] = 1;
+		}
+
+		// version block
+		if (version > 6) {
+			t = vpat[version - 7];
+			k = 17;
+			for (x = 0; x < 6; x++)
+				for (y = 0; y < 3; y++, k--)
+					if (1 & (k > 11 ? version >> (k - 12) : t >> k)) {
+						qrframe[(5 - x) + width * (2 - y + width - 11)] = 1;
+						qrframe[(2 - y + width - 11) + width * (5 - x)] = 1;
+					}
+			else {
+				setmask(5 - x, 2 - y + width - 11);
+				setmask(2 - y + width - 11, 5 - x);
+			}
+		}
+
+		// sync mask bits - only set above for white spaces, so add in black bits
+		for (y = 0; y < width; y++)
+			for (x = 0; x <= y; x++)
+				if (qrframe[x + width * y])
+					setmask(x, y);
+
+		// convert string to bitstream
+		// 8 bit data to QR-coded 8 bit data (numeric or alphanum, or kanji not supported)
+		v = strinbuf.length;
+
+		// string to array
+		for (i = 0; i < v; i++)
+			eccbuf[i] = strinbuf.charCodeAt(i);
+		strinbuf = eccbuf.slice(0);
+
+		// calculate max string length
+		x = datablkw * (neccblk1 + neccblk2) + neccblk2;
+		if (v >= x - 2) {
+			v = x - 2;
+			if (version > 9)
+				v--;
+		}
+
+		// shift and repack to insert length prefix
+		i = v;
+		if (version > 9) {
+			strinbuf[i + 2] = 0;
+			strinbuf[i + 3] = 0;
+			while (i--) {
+				t = strinbuf[i];
+				strinbuf[i + 3] |= 255 & (t << 4);
+				strinbuf[i + 2] = t >> 4;
+			}
+			strinbuf[2] |= 255 & (v << 4);
+			strinbuf[1] = v >> 4;
+			strinbuf[0] = 0x40 | (v >> 12);
+		} else {
+			strinbuf[i + 1] = 0;
+			strinbuf[i + 2] = 0;
+			while (i--) {
+				t = strinbuf[i];
+				strinbuf[i + 2] |= 255 & (t << 4);
+				strinbuf[i + 1] = t >> 4;
+			}
+			strinbuf[1] |= 255 & (v << 4);
+			strinbuf[0] = 0x40 | (v >> 4);
+		}
+		// fill to end with pad pattern
+		i = v + 3 - (version < 10);
+		while (i < x) {
+			strinbuf[i++] = 0xec;
+			// buffer has room    if (i == x)      break;
+			strinbuf[i++] = 0x11;
+		}
+
+		// calculate and append ECC
+
+		// calculate generator polynomial
+		genpoly[0] = 1;
+		for (i = 0; i < eccblkwid; i++) {
+			genpoly[i + 1] = 1;
+			for (j = i; j > 0; j--)
+				genpoly[j] = genpoly[j] ?
+				genpoly[j - 1] ^ gexp[modnn(glog[genpoly[j]] + i)] : genpoly[j - 1];
+			genpoly[0] = gexp[modnn(glog[genpoly[0]] + i)];
+		}
+		for (i = 0; i <= eccblkwid; i++)
+			genpoly[i] = glog[genpoly[i]]; // use logs for genpoly[] to save calc step
+
+		// append ecc to data buffer
+		k = x;
+		y = 0;
+		for (i = 0; i < neccblk1; i++) {
+			appendrs(y, datablkw, k, eccblkwid);
+			y += datablkw;
+			k += eccblkwid;
+		}
+		for (i = 0; i < neccblk2; i++) {
+			appendrs(y, datablkw + 1, k, eccblkwid);
+			y += datablkw + 1;
+			k += eccblkwid;
+		}
+		// interleave blocks
+		y = 0;
+		for (i = 0; i < datablkw; i++) {
+			for (j = 0; j < neccblk1; j++)
+				eccbuf[y++] = strinbuf[i + j * datablkw];
+			for (j = 0; j < neccblk2; j++)
+				eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))];
+		}
+		for (j = 0; j < neccblk2; j++)
+			eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))];
+		for (i = 0; i < eccblkwid; i++)
+			for (j = 0; j < neccblk1 + neccblk2; j++)
+				eccbuf[y++] = strinbuf[x + i + j * eccblkwid];
+		strinbuf = eccbuf;
+
+		// pack bits into frame avoiding masked area.
+		x = y = width - 1;
+		k = v = 1; // up, minus
+		/* inteleaved data and ecc codes */
+		m = (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2;
+		for (i = 0; i < m; i++) {
+			t = strinbuf[i];
+			for (j = 0; j < 8; j++, t <<= 1) {
+				if (0x80 & t)
+					qrframe[x + width * y] = 1;
+				do { // find next fill position
+					if (v)
+						x--;
+					else {
+						x++;
+						if (k) {
+							if (y != 0)
+								y--;
+							else {
+								x -= 2;
+								k = !k;
+								if (x == 6) {
+									x--;
+									y = 9;
+								}
+							}
+						} else {
+							if (y != width - 1)
+								y++;
+							else {
+								x -= 2;
+								k = !k;
+								if (x == 6) {
+									x--;
+									y -= 8;
+								}
+							}
+						}
+					}
+					v = !v;
+				} while (ismasked(x, y));
+			}
+		}
+
+		// save pre-mask copy of frame
+		strinbuf = qrframe.slice(0);
+		t = 0; // best
+		y = 30000; // demerit
+		// for instead of while since in original arduino code
+		// if an early mask was "good enough" it wouldn't try for a better one
+		// since they get more complex and take longer.
+		for (k = 0; k < 8; k++) {
+			applymask(k); // returns black-white imbalance
+			x = badcheck();
+			if (x < y) { // current mask better than previous best?
+				y = x;
+				t = k;
+			}
+			if (t == 7)
+				break; // don't increment i to a void redoing mask
+			qrframe = strinbuf.slice(0); // reset for next pass
+		}
+		if (t != k) // redo best mask - none good enough, last wasn't t
+			applymask(t);
+
+		// add in final mask/ecclevel bytes
+		y = fmtword[t + ((ecclevel - 1) << 3)];
+		// low byte
+		for (k = 0; k < 8; k++, y >>= 1)
+			if (y & 1) {
+				qrframe[(width - 1 - k) + width * 8] = 1;
+				if (k < 6)
+					qrframe[8 + width * k] = 1;
+				else
+					qrframe[8 + width * (k + 1)] = 1;
+			}
+		// high byte
+		for (k = 0; k < 7; k++, y >>= 1)
+			if (y & 1) {
+				qrframe[8 + width * (width - 7 + k)] = 1;
+				if (k)
+					qrframe[(6 - k) + width * 8] = 1;
+				else
+					qrframe[7 + width * 8] = 1;
+			}
+		return qrframe;
+	}
+
+
+
+
+	var _canvas = null;
+
+	var api = {
+
+		get ecclevel() {
+			return ecclevel;
+		},
+
+		set ecclevel(val) {
+			ecclevel = val;
+		},
+
+		get size() {
+			return _size;
+		},
+
+		set size(val) {
+			_size = val
+		},
+
+		get canvas() {
+			return _canvas;
+		},
+
+		set canvas(el) {
+			_canvas = el;
+		},
+
+		getFrame: function(string) {
+			return genframe(string);
+		},
+		//这里的utf16to8(str)是对Text中的字符串进行转码,让其支持中文
+		utf16to8: function(str) {
+			var out, i, len, c;
+
+			out = "";
+			len = str.length;
+			for (i = 0; i < len; i++) {
+				c = str.charCodeAt(i);
+				if ((c >= 0x0001) && (c <= 0x007F)) {
+					out += str.charAt(i);
+				} else if (c > 0x07FF) {
+					out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
+					out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
+					out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
+				} else {
+					out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
+					out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
+				}
+			}
+			return out;
+		},
+		/**
+		 * 新增$this参数,传入组件的this,兼容在组件中生成
+		 */
+		draw: function(str, canvas, cavW, cavH, cavColor, haveImg, imageUrl, imageSize, $this, cb = function() {}, ecc) {
+			var that = this;
+			ecclevel = ecc || ecclevel;
+			canvas = canvas || _canvas;
+			if (!canvas) {
+				console.warn('No canvas provided to draw QR code in!')
+				return;
+			}
+			
+			
+			let pre_background = "#ffffff";
+			var size = Math.min(cavW, cavH);
+			str = that.utf16to8(str); //增加中文显示
+
+			var frame = that.getFrame(str);
+				// 组件中生成qrcode需要绑定this 
+			var ctx = uni.createCanvasContext(canvas, $this);
+			var px = Math.round(size / (width ));
+			
+			var roundedSize = px * (width);
+			// var px = 1 ;
+			// var roundedSize = px * (width + 8) ;
+			
+			//var roundedSize = 0 ;
+			//var offset = Math.floor((size - roundedSize) / 2);
+			var offset = 0 ;
+			size = roundedSize;
+			//ctx.clearRect(0, 0, cavW, cavW);
+			ctx.setFillStyle(pre_background)
+			ctx.fillRect(0, 0, cavW, cavW);
+			ctx.setFillStyle(cavColor);
+			for (var i = 0; i < width; i++) {
+				for (var j = 0; j < width; j++) {
+					if (frame[j * width + i]) {
+						ctx.fillRect(px * ( i) + offset, px * ( j) + offset, px, px);
+					}
+				}
+			}
+
+			//画图片
+			if (haveImg) {
+				try {
+					var x = Number(((cavW - imageSize - 14) / 2).toFixed(2));
+					var y = Number(((cavH - imageSize -14) / 2).toFixed(2));
+					drawRoundedRect(ctx, x, y, imageSize, imageSize, imageSize / 2, 6, true, true)
+
+					let isNetImg = false;
+
+					isNetImg = imageUrl.substr(0, 4) == 'http' ? true : false;
+
+					if (isNetImg) {
+						//网络图片下载到本地
+						uni.getImageInfo({
+							src: imageUrl,
+							success: function(res) {
+								ctx.drawImage(res.path, x, y, imageSize, imageSize);
+								//--增加绘制完成回调
+								ctx.draw(false, function() {
+									cb();
+								})
+							}
+						})
+					} else {
+						ctx.drawImage(imageUrl, x, y, imageSize, imageSize);
+						//--增加绘制完成回调
+						ctx.draw(false, function() {
+							cb();
+						})
+					}
+
+
+
+
+					// 画圆角矩形
+					function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
+						ctxi.setLineWidth(lineWidth);
+						ctxi.setFillStyle(pre_background);
+						ctxi.setStrokeStyle(pre_background);
+						ctxi.beginPath(); // draw top and top right corner 
+						ctxi.moveTo(x + r, y);
+						ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner 
+						ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner 
+						ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner 
+						ctxi.arcTo(x, y, x + r, y, r);
+						ctxi.closePath();
+						if (fill) {
+							ctxi.fill();
+						}
+						if (stroke) {
+							ctxi.stroke();
+						}
+					}
+				} catch (e) {
+					//TODO handle the exception
+				}
+
+			} else {
+				//--增加绘制完成回调
+				ctx.draw(false, function() {
+					cb();
+				})
+			}
+
+
+
+		}
+	}
+	module.exports = {
+		api
+	}
+})();

文件差異過大導致無法顯示
+ 263 - 0
components/ay-qrcode/weapp-qrcode.js


+ 127 - 0
components/tabbar.vue

@@ -0,0 +1,127 @@
+<template>
+	<view class="tabbar">
+		<u-tabbar
+			:value="tabbarValue"
+			@change="tabbarChange"
+			:fixed="true"
+			:placeholder="true"
+			:border="false"
+			inactiveColor="#999"
+			activeColor="#009AEF"
+			:customStyle="{'padding-top':'5px'}"
+			:safeAreaInsetBottom="true"
+		>
+			<u-tabbar-item text="首页" >
+				<image
+					class="u-page__item__slot-icon"
+					slot="active-icon"
+					src="../static/img/tabbar-home.png"
+				></image>
+				<image
+					class="u-page__item__slot-icon"
+					slot="inactive-icon"
+					src="../static/img/tabbar-home-gray.png"
+				></image>
+			</u-tabbar-item>
+			<!-- <u-tabbar-item text="奖品兑换" >
+				<image
+					class="u-page__item__slot-icon"
+					slot="active-icon"
+					src="../static/img/tabbar-gift.png"
+				></image>
+				<image
+					class="u-page__item__slot-icon"
+					slot="inactive-icon"
+					src="../static/img/tabbar-gift-gray.png"
+				></image>
+			</u-tabbar-item> -->
+			<u-tabbar-item text="个人中心" >
+				<image
+					class="u-page__item__slot-icon"
+					slot="active-icon"
+					src="../static/img/tabbar-my.png"
+				></image>
+				<image
+					class="u-page__item__slot-icon"
+					slot="inactive-icon"
+					src="../static/img/tabbar-my-gray.png"
+				></image>
+			</u-tabbar-item>
+		</u-tabbar>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'tabbar',
+	props:{
+		tabbarIndexProps:{
+			type:Number,
+			default:0
+		},
+	},
+	data() {
+		return {
+			staticUrl:this.$commonConfig.staticUrl,
+			tabbarValue:0,
+		}
+	},
+	watch:{
+		'tabbarIndexProps': {
+			handler(newVal, oldVal) {
+				// let pages = getCurrentPages();
+				// console.log('pages============',pages);
+				this.tabbarValue = newVal
+			},
+			immediate: true
+		}
+	},
+	onLoad() {
+		console.log('onLoad tabbarIndex',this.tabbarIndex);
+	},
+	onShow() {
+		console.log('tabbarIndex',this.tabbarIndex);
+		this.tabbarValue = this.tabbarIndex
+	},
+	methods: {
+		tabbarChange(name){
+			// console.log('name====',name);
+			const tabBarRoutes = {
+			0: '/pages/index/index',
+			// 1: {
+			//   url: '/shopping/producTypetList',
+			//   query: {
+			// 	navType: 'navigateTo'
+			//   }
+			// },
+			// 1: '/shopping/order',
+			1: '/center/center'
+		  };
+		  
+		  const targetRoute = tabBarRoutes[name];
+		  
+		  if (typeof targetRoute === 'string') {
+			uni.reLaunch({url: targetRoute});
+		  } else if (typeof targetRoute === 'object') {
+			  if(targetRoute.query.navType=='navigateTo'){
+				  this.$u.route(targetRoute.url, targetRoute.query);
+				  return
+			  }
+			let queryParams = uni.$u.queryParams(targetRoute.query);
+			uni.reLaunch({url: targetRoute.url+queryParams});
+		  }
+			// this.tabbarValue = name
+		}
+	}
+}	
+</script>
+
+<style lang="scss" scoped>
+.u-page__item__slot-icon{
+	width: 40rpx;
+	height: 40rpx;
+	&.big{
+		transform: scale(1.5) translateY(-0.5em);
+	}
+}
+</style>

+ 20 - 0
index.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <script>
+      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
+        CSS.supports('top: constant(a)'))
+      document.write(
+        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+    </script>
+    <title></title>
+    <!--preload-links-->
+    <!--app-context-->
+  </head>
+  <body>
+    <div id="app"><!--app-html--></div>
+    <script type="module" src="/main.js"></script>
+  </body>
+</html>

+ 82 - 0
main.js

@@ -0,0 +1,82 @@
+import App from './App'
+
+// #ifndef VUE3
+import Vue from 'vue'
+Vue.config.productionTip = false
+App.mpType = 'app'
+
+try {
+  function isPromise(obj) {
+    return (
+      !!obj &&
+      (typeof obj === "object" || typeof obj === "function") &&
+      typeof obj.then === "function"
+    );
+  }
+
+  // 统一 vue2 API Promise 化返回格式与 vue3 保持一致
+  uni.addInterceptor({
+    returnValue(res) {
+      if (!isPromise(res)) {
+        return res;
+      }
+      return new Promise((resolve, reject) => {
+        res.then((res) => {
+          if (res[0]) {
+            reject(res[0]);
+          } else {
+            resolve(res[1]);
+          }
+        });
+      });
+    },
+  });
+} catch (error) { }
+
+import uView from '@/uni_modules/uview-ui'
+Vue.use(uView)
+
+import { commonConfig } from './common/config';
+Vue.prototype.$commonConfig = commonConfig;
+
+import './utils/filter' 
+
+import store from '@/store';
+
+// 引入uView提供的对vuex的简写法文件
+let vuexStore = require('@/store/$u.mixin.js');
+Vue.mixin(vuexStore);
+
+const app = new Vue({
+  ...App,
+  store
+})
+
+//uviewui v1
+// // http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
+// import httpInterceptor from '@/common/http.interceptor.js';
+// Vue.use(httpInterceptor, app);
+
+
+// 引入请求封装,将app参数传递到配置中
+require('./common/request.js')(app)
+// http接口API抽离,免于写url或者一些固定的参数
+import httpApi from '@/common/http.api.js';
+Vue.use(httpApi, app);
+
+app.$mount()
+
+
+
+
+// #endif
+
+// #ifdef VUE3
+import { createSSRApp } from 'vue'
+export function createApp() {
+  const app = createSSRApp(App)
+  return {
+    app
+  }
+}
+// #endif

+ 101 - 0
manifest.json

@@ -0,0 +1,101 @@
+{
+    "name" : "xusfood_h5",
+    "appid" : "__UNI__D90E79B",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
+    /* 5+App特有相关 */
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueStyleCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        /* 模块配置 */
+        "modules" : {},
+        /* 应用发布信息 */
+        "distribute" : {
+            /* android打包配置 */
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios" : {},
+            /* SDK配置 */
+            "sdkConfigs" : {}
+        }
+    },
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "",
+        "setting" : {
+            "urlCheck" : false,
+            "minified" : true,
+            "postcss" : true
+        },
+        "usingComponents" : true,
+        "permission" : {
+            "scope.userLocation" : {
+                "desc" : "你的位置信息将用于小程序位置接口的效果展示"
+            }
+        },
+        "requiredPrivateInfos" : [ "getLocation", "chooseLocation" ],
+        "lazyCodeLoading" : "requiredComponents"
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    "uniStatistics" : {
+        "enable" : false
+    },
+    "vueVersion" : "2",
+    "h5" : {
+        "devServer" : {
+            "https" : true,
+            "proxy" : {
+                "/api" : {
+                    "target" : "https://securityapi.hw.hongweisoft.com/appapi/app", //请求的目标域名
+                    "changeOrigin" : true,
+                    "secure" : false,
+                    "pathRewrite" : {
+                        //使用代理; 告诉他你这个连接要用代理
+                        "^/api" : ""
+                    }
+                }
+            }
+        },
+        "sdkConfigs" : {
+            "maps" : {}
+        },
+        "template" : "template.h5.html"
+    }
+}

+ 18 - 0
mixin.js

@@ -0,0 +1,18 @@
+export const systemInfo = {
+  data: () => ({
+    statusBarHeight: 0,
+    navigationBarHeight: 0,
+    navHeight: 0,
+    windowHeight: 0, // 可使用窗口高度
+  }),
+ 
+  methods: {
+    // 获取设备信息
+    getSystemInfo() {
+      this.statusBarHeight = getApp().globalData.statusBarHeight
+      this.navigationBarHeight = getApp().globalData.navigationBarHeight
+      this.windowHeight = uni.getSystemInfoSync().windowHeight
+      this.navHeight = getApp().globalData.navHeight
+    },
+  },
+}

+ 245 - 0
node_modules/@zxing/library/LICENSE

@@ -0,0 +1,245 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+========================================================================
+jai-imageio
+========================================================================
+
+Copyright (c) 2005 Sun Microsystems, Inc.
+Copyright © 2010-2014 University of Manchester
+Copyright © 2010-2015 Stian Soiland-Reyes
+Copyright © 2015 Peter Hull
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+- Redistribution of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+- Redistribution in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+
+Neither the name of Sun Microsystems, Inc. or the names of
+contributors may be used to endorse or promote products derived
+from this software without specific prior written permission.
+
+This software is provided "AS IS," without a warranty of any
+kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
+WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
+EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL
+NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
+USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR
+ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
+CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
+REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
+INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+You acknowledge that this software is not designed or intended for
+use in the design, construction, operation or maintenance of any
+nuclear facility.

+ 126 - 0
node_modules/@zxing/library/README.md

@@ -0,0 +1,126 @@
+[<img align="right" src="https://raw.github.com/wiki/zxing/zxing/zxing-logo.png"/>][1]
+
+# ZXing
+
+## Project in Maintenance Mode Only
+
+The project is in maintenance mode, meaning, changes are driven by contributed patches.
+Only bug fixes and minor enhancements will be considered. The Barcode Scanner app can
+no longer be published, so it's unlikely any changes will be accepted for it.
+There is otherwise no active development or roadmap for this project. It is "DIY".
+
+### Runs on your favorite ECMAScript ecosystem
+
+> If it doesn't, we gonna make it.
+
+## What is ZXing?
+
+> [ZXing][1] ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.
+
+## Supported Formats
+
+> See [Projects](https://github.com/zxing-js/library/projects) and [Milestones](https://github.com/zxing-js/library/milestones) for what is currently done and what's planned next. 👀
+
+| 1D product | 1D industrial                        | 2D           |
+| ---------- |--------------------------------------|--------------|
+| UPC-A      | Code 39                              | QR Code      |
+| UPC-E      | Code 93                              | Data Matrix  |
+| EAN-8      | Code 128                             | Aztec        |
+| EAN-13     | Codabar                              | PDF 417      |
+|            | ITF                                  | ~~MaxiCode~~ |
+|            | RSS-14                               |              |
+|            | RSS-Expanded (not production ready!) |              |
+
+
+## Status
+
+[![Maintainer wanted](https://img.shields.io/badge/maintained-help%20wanted-red)](https://npmjs.org/package/@zxing/ngx-scanner)
+[![Greenkeeper badge](https://badges.greenkeeper.io/zxing-js/library.svg)](https://greenkeeper.io/)
+
+[![NPM version](https://img.shields.io/npm/v/@zxing/library.svg?&label=npm)][0]
+[![npm](https://img.shields.io/npm/dm/localeval.svg)][0]
+[![Contributors](https://img.shields.io/github/contributors/zxing-js/library.svg)](https://github.com/zxing-js/library/graphs/contributors)
+[![Commits to deploy](https://img.shields.io/github/commits-since/zxing-js/library/master.svg?label=commits%20to%20deploy)](https://github.com/zxing-js/library/compare/master...develop)
+
+[![Maintainability](https://api.codeclimate.com/v1/badges/2b9c6ae92412ee8e15a9/maintainability)](https://codeclimate.com/github/zxing-js/library/maintainability)
+[![Test Coverage](https://api.codeclimate.com/v1/badges/2b9c6ae92412ee8e15a9/test_coverage)](https://codeclimate.com/github/zxing-js/library/test_coverage)
+
+### Attention
+
+>NOTE: While we do not have the time to actively maintain zxing-js anymore, we are open to new maintainers taking the lead.
+
+## Demo
+
+See [Live Preview](https://zxing-js.github.io/library/) in browser.
+
+**Note:** All the examples are using ES6, be sure is supported in your browser or modify as needed, Chrome recommended.
+
+## Installation
+
+`npm i @zxing/library --save`
+
+or
+
+`yarn add @zxing/library`
+
+## Limitations
+
+On iOS-Devices **with iOS < 14.3** camera access works only in native Safari and not in other Browsers (Chrome,...) or Apps that use an UIWebView or WKWebView. This is not a restriction of this library but of the limited WebRTC support by Apple. The behavior might change in iOS 11.3 (Apr 2018?, not tested) as stated [here](https://developer.apple.com/library/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_11_1.html#//apple_ref/doc/uid/TP40014305-CH14-SW1)
+
+> iOS 14.3 (released in december 2020) now supports WebRTC in 3rd party browsers as well 🎉 
+
+### Browser Support
+
+The browser layer is using the [MediaDevices](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices) web API which is not supported by older browsers.
+
+_You can use external polyfills like [WebRTC adapter](https://github.com/webrtc/adapter) to increase browser compatibility._
+
+Also, note that the library is using the [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) (`Int32Array`, `Uint8ClampedArray`, etc.) which are not available in older browsers (e.g. Android 4 default browser).
+
+_You can use [core-js](https://github.com/zloirock/core-js) to add support to these browsers._
+
+In the PDF 417 decoder recent addition, the library now makes use of the new `BigInt` type, which [is not supported by all browsers][2] as well. There's no way to polyfill that and ponyfill libraries are **way to big**, but even if PDF 417 decoding relies on `BigInt` the rest of the library shall work ok in browsers that doesn't support it.
+
+_There's no polyfills for `BigInt` in the way it's coded in here._
+
+## Usage
+
+```javascript
+// use with commonJS
+const { MultiFormatReader, BarcodeFormat } = require('@zxing/library');
+// or with ES6 modules
+import { MultiFormatReader, BarcodeFormat } from '@zxing/library';
+
+const hints = new Map();
+const formats = [BarcodeFormat.QR_CODE, BarcodeFormat.DATA_MATRIX/*, ...*/];
+
+hints.set(DecodeHintType.POSSIBLE_FORMATS, formats);
+
+const reader = new MultiFormatReader();
+
+const luminanceSource = new RGBLuminanceSource(imgByteArray, imgWidth, imgHeight);
+const binaryBitmap = new BinaryBitmap(new HybridBinarizer(luminanceSource));
+
+reader.decode(binaryBitmap, hints);
+```
+
+## Contributing
+
+See [Contributing Guide](https://github.com/zxing-js/library/blob/master/CONTRIBUTING.md) for information regarding porting approach and reasoning behind some of the approaches taken.
+
+## Contributors
+
+Special thanks to all the contributors who have contributed for this project. We heartly thankful to you all.
+
+[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/0)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/0)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/1)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/1)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/2)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/2)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/3)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/3)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/4)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/4)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/5)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/5)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/6)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/6)[![](https://sourcerer.io/fame/odahcam/zxing-js/library/images/7)](https://sourcerer.io/fame/odahcam/zxing-js/library/links/7)
+
+And a special thanks to [@aleris][3] who created the project itself and made available the initial QR code port.
+
+---
+
+[![Bless](https://cdn.rawgit.com/LunaGao/BlessYourCodeTag/master/tags/alpaca.svg)](http://lunagao.github.io/BlessYourCodeTag/)
+
+[0]: https://www.npmjs.com/package/@zxing/library
+[1]: https://github.com/zxing/zxing
+[2]: https://caniuse.com/#feat=bigint
+[3]: https://github.com/aleris

+ 12 - 0
node_modules/@zxing/library/cjs/browser.d.ts

@@ -0,0 +1,12 @@
+export * from './browser/BrowserAztecCodeReader';
+export * from './browser/BrowserBarcodeReader';
+export * from './browser/BrowserCodeReader';
+export * from './browser/BrowserDatamatrixCodeReader';
+export * from './browser/BrowserMultiFormatReader';
+export * from './browser/BrowserPDF417Reader';
+export * from './browser/BrowserQRCodeReader';
+export * from './browser/BrowserQRCodeSvgWriter';
+export * from './browser/DecodeContinuouslyCallback';
+export * from './browser/HTMLCanvasElementLuminanceSource';
+export * from './browser/HTMLVisualMediaElement';
+export * from './browser/VideoInputDevice';

+ 25 - 0
node_modules/@zxing/library/cjs/browser.js

@@ -0,0 +1,25 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+// browser
+__exportStar(require("./browser/BrowserAztecCodeReader"), exports);
+__exportStar(require("./browser/BrowserBarcodeReader"), exports);
+__exportStar(require("./browser/BrowserCodeReader"), exports);
+__exportStar(require("./browser/BrowserDatamatrixCodeReader"), exports);
+__exportStar(require("./browser/BrowserMultiFormatReader"), exports);
+__exportStar(require("./browser/BrowserPDF417Reader"), exports);
+__exportStar(require("./browser/BrowserQRCodeReader"), exports);
+__exportStar(require("./browser/BrowserQRCodeSvgWriter"), exports);
+__exportStar(require("./browser/DecodeContinuouslyCallback"), exports);
+__exportStar(require("./browser/HTMLCanvasElementLuminanceSource"), exports);
+__exportStar(require("./browser/HTMLVisualMediaElement"), exports);
+__exportStar(require("./browser/VideoInputDevice"), exports);

+ 16 - 0
node_modules/@zxing/library/cjs/browser/BrowserAztecCodeReader.d.ts

@@ -0,0 +1,16 @@
+import { BrowserCodeReader } from './BrowserCodeReader';
+/**
+ * Aztec Code reader to use from browser.
+ *
+ * @class BrowserAztecCodeReader
+ * @extends {BrowserCodeReader}
+ */
+export declare class BrowserAztecCodeReader extends BrowserCodeReader {
+    /**
+     * Creates an instance of BrowserAztecCodeReader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     *
+     * @memberOf BrowserAztecCodeReader
+     */
+    constructor(timeBetweenScansMillis?: number);
+}

+ 39 - 0
node_modules/@zxing/library/cjs/browser/BrowserAztecCodeReader.js

@@ -0,0 +1,39 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserAztecCodeReader = void 0;
+var BrowserCodeReader_1 = require("./BrowserCodeReader");
+var AztecReader_1 = require("../core/aztec/AztecReader");
+/**
+ * Aztec Code reader to use from browser.
+ *
+ * @class BrowserAztecCodeReader
+ * @extends {BrowserCodeReader}
+ */
+var BrowserAztecCodeReader = /** @class */ (function (_super) {
+    __extends(BrowserAztecCodeReader, _super);
+    /**
+     * Creates an instance of BrowserAztecCodeReader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     *
+     * @memberOf BrowserAztecCodeReader
+     */
+    function BrowserAztecCodeReader(timeBetweenScansMillis) {
+        if (timeBetweenScansMillis === void 0) { timeBetweenScansMillis = 500; }
+        return _super.call(this, new AztecReader_1.default(), timeBetweenScansMillis) || this;
+    }
+    return BrowserAztecCodeReader;
+}(BrowserCodeReader_1.BrowserCodeReader));
+exports.BrowserAztecCodeReader = BrowserAztecCodeReader;

+ 15 - 0
node_modules/@zxing/library/cjs/browser/BrowserBarcodeReader.d.ts

@@ -0,0 +1,15 @@
+import { BrowserCodeReader } from './BrowserCodeReader';
+import DecodeHintType from '../core/DecodeHintType';
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * Barcode reader reader to use from browser.
+ */
+export declare class BrowserBarcodeReader extends BrowserCodeReader {
+    /**
+     * Creates an instance of BrowserBarcodeReader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     * @param {Map<DecodeHintType, any>} hints
+     */
+    constructor(timeBetweenScansMillis?: number, hints?: Map<DecodeHintType, any>);
+}

+ 37 - 0
node_modules/@zxing/library/cjs/browser/BrowserBarcodeReader.js

@@ -0,0 +1,37 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserBarcodeReader = void 0;
+var BrowserCodeReader_1 = require("./BrowserCodeReader");
+var MultiFormatOneDReader_1 = require("../core/oned/MultiFormatOneDReader");
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * Barcode reader reader to use from browser.
+ */
+var BrowserBarcodeReader = /** @class */ (function (_super) {
+    __extends(BrowserBarcodeReader, _super);
+    /**
+     * Creates an instance of BrowserBarcodeReader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     * @param {Map<DecodeHintType, any>} hints
+     */
+    function BrowserBarcodeReader(timeBetweenScansMillis, hints) {
+        if (timeBetweenScansMillis === void 0) { timeBetweenScansMillis = 500; }
+        return _super.call(this, new MultiFormatOneDReader_1.default(hints), timeBetweenScansMillis, hints) || this;
+    }
+    return BrowserBarcodeReader;
+}(BrowserCodeReader_1.BrowserCodeReader));
+exports.BrowserBarcodeReader = BrowserBarcodeReader;

+ 411 - 0
node_modules/@zxing/library/cjs/browser/BrowserCodeReader.d.ts

@@ -0,0 +1,411 @@
+import BinaryBitmap from '../core/BinaryBitmap';
+import DecodeHintType from '../core/DecodeHintType';
+import Reader from '../core/Reader';
+import Result from '../core/Result';
+import { DecodeContinuouslyCallback } from './DecodeContinuouslyCallback';
+import { HTMLVisualMediaElement } from './HTMLVisualMediaElement';
+import { VideoInputDevice } from './VideoInputDevice';
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * Base class for browser code reader.
+ */
+export declare class BrowserCodeReader {
+    protected readonly reader: Reader;
+    protected timeBetweenScansMillis: number;
+    protected _hints?: Map<DecodeHintType, any>;
+    /**
+     * If navigator is present.
+     */
+    get hasNavigator(): boolean;
+    /**
+     * If mediaDevices under navigator is supported.
+     */
+    get isMediaDevicesSuported(): boolean;
+    /**
+     * If enumerateDevices under navigator is supported.
+     */
+    get canEnumerateDevices(): boolean;
+    /**
+     * This will break the loop.
+     */
+    private _stopContinuousDecode;
+    /**
+     * This will break the loop.
+     */
+    private _stopAsyncDecode;
+    /**
+     * Delay time between decode attempts made by the scanner.
+     */
+    protected _timeBetweenDecodingAttempts: number;
+    /** Time between two decoding tries in milli seconds. */
+    get timeBetweenDecodingAttempts(): number;
+    /**
+     * Change the time span the decoder waits between two decoding tries.
+     *
+     * @param {number} millis Time between two decoding tries in milli seconds.
+     */
+    set timeBetweenDecodingAttempts(millis: number);
+    /**
+     * The HTML canvas element, used to draw the video or image's frame for decoding.
+     */
+    protected captureCanvas: HTMLCanvasElement;
+    /**
+     * The HTML canvas element context.
+     */
+    protected captureCanvasContext: CanvasRenderingContext2D;
+    /**
+     * The HTML image element, used as a fallback for the video element when decoding.
+     */
+    protected imageElement: HTMLImageElement;
+    /**
+     * Should contain the current registered listener for image loading,
+     * used to unregister that listener when needed.
+     */
+    protected imageLoadedListener: EventListener;
+    /**
+     * The stream output from camera.
+     */
+    protected stream: MediaStream;
+    /**
+     * The HTML video element, used to display the camera stream.
+     */
+    protected videoElement: HTMLVideoElement;
+    /**
+     * Should contain the current registered listener for video loaded-metadata,
+     * used to unregister that listener when needed.
+     */
+    protected videoCanPlayListener: EventListener;
+    /**
+     * Should contain the current registered listener for video play-ended,
+     * used to unregister that listener when needed.
+     */
+    protected videoEndedListener: EventListener;
+    /**
+     * Should contain the current registered listener for video playing,
+     * used to unregister that listener when needed.
+     */
+    protected videoPlayingEventListener: EventListener;
+    /**
+     * Sets the hints.
+     */
+    set hints(hints: Map<DecodeHintType, any>);
+    /**
+     * Sets the hints.
+     */
+    get hints(): Map<DecodeHintType, any>;
+    /**
+     * Creates an instance of BrowserCodeReader.
+     * @param {Reader} reader The reader instance to decode the barcode
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent successful decode tries
+     *
+     * @memberOf BrowserCodeReader
+     */
+    constructor(reader: Reader, timeBetweenScansMillis?: number, _hints?: Map<DecodeHintType, any>);
+    /**
+     * Lists all the available video input devices.
+     */
+    listVideoInputDevices(): Promise<MediaDeviceInfo[]>;
+    /**
+     * Obtain the list of available devices with type 'videoinput'.
+     *
+     * @returns {Promise<VideoInputDevice[]>} an array of available video input devices
+     *
+     * @memberOf BrowserCodeReader
+     *
+     * @deprecated Use `listVideoInputDevices` instead.
+     */
+    getVideoInputDevices(): Promise<VideoInputDevice[]>;
+    /**
+     * Let's you find a device using it's Id.
+     */
+    findDeviceById(deviceId: string): Promise<MediaDeviceInfo>;
+    /**
+     * Decodes the barcode from the device specified by deviceId while showing the video in the specified video element.
+     *
+     * @param deviceId the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
+     * @param video the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     *
+     * @deprecated Use `decodeOnceFromVideoDevice` instead.
+     */
+    decodeFromInputVideoDevice(deviceId?: string, videoSource?: string | HTMLVideoElement): Promise<Result>;
+    /**
+     * In one attempt, tries to decode the barcode from the device specified by deviceId while showing the video in the specified video element.
+     *
+     * @param deviceId the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
+     * @param video the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    decodeOnceFromVideoDevice(deviceId?: string, videoSource?: string | HTMLVideoElement): Promise<Result>;
+    /**
+     * In one attempt, tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
+     *
+     * @param constraints the media stream constraints to get s valid media stream to decode from
+     * @param video the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    decodeOnceFromConstraints(constraints: MediaStreamConstraints, videoSource?: string | HTMLVideoElement): Promise<Result>;
+    /**
+     * In one attempt, tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
+     *
+     * @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
+     * @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    decodeOnceFromStream(stream: MediaStream, videoSource?: string | HTMLVideoElement): Promise<Result>;
+    /**
+     * Continuously decodes the barcode from the device specified by device while showing the video in the specified video element.
+     *
+     * @param {string|null} [deviceId] the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
+     * @param {string|HTMLVideoElement|null} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<void>}
+     *
+     * @memberOf BrowserCodeReader
+     *
+     * @deprecated Use `decodeFromVideoDevice` instead.
+     */
+    decodeFromInputVideoDeviceContinuously(deviceId: string | null, videoSource: string | HTMLVideoElement | null, callbackFn: DecodeContinuouslyCallback): Promise<void>;
+    /**
+     * Continuously tries to decode the barcode from the device specified by device while showing the video in the specified video element.
+     *
+     * @param {string|null} [deviceId] the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
+     * @param {string|HTMLVideoElement|null} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<void>}
+     *
+     * @memberOf BrowserCodeReader
+     */
+    decodeFromVideoDevice(deviceId: string | null, videoSource: string | HTMLVideoElement | null, callbackFn: DecodeContinuouslyCallback): Promise<void>;
+    /**
+     * Continuously tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
+     *
+     * @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
+     * @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    decodeFromConstraints(constraints: MediaStreamConstraints, videoSource: string | HTMLVideoElement, callbackFn: DecodeContinuouslyCallback): Promise<void>;
+    /**
+     * In one attempt, tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
+     *
+     * @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
+     * @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    decodeFromStream(stream: MediaStream, videoSource: string | HTMLVideoElement, callbackFn: DecodeContinuouslyCallback): Promise<void>;
+    /**
+     * Breaks the decoding loop.
+     */
+    stopAsyncDecode(): void;
+    /**
+     * Breaks the decoding loop.
+     */
+    stopContinuousDecode(): void;
+    /**
+     * Sets the new stream and request a new decoding-with-delay.
+     *
+     * @param stream The stream to be shown in the video element.
+     * @param decodeFn A callback for the decode method.
+     */
+    protected attachStreamToVideo(stream: MediaStream, videoSource: string | HTMLVideoElement): Promise<HTMLVideoElement>;
+    /**
+     *
+     * @param videoElement
+     */
+    protected playVideoOnLoadAsync(videoElement: HTMLVideoElement): Promise<void>;
+    /**
+     * Binds listeners and callbacks to the videoElement.
+     *
+     * @param element
+     * @param callbackFn
+     */
+    protected playVideoOnLoad(element: HTMLVideoElement, callbackFn: EventListener): void;
+    /**
+     * Checks if the given video element is currently playing.
+     */
+    isVideoPlaying(video: HTMLVideoElement): boolean;
+    /**
+     * Just tries to play the video and logs any errors.
+     * The play call is only made is the video is not already playing.
+     */
+    tryPlayVideo(videoElement: HTMLVideoElement): Promise<void>;
+    /**
+     * Searches and validates a media element.
+     */
+    getMediaElement(mediaElementId: string, type: string): HTMLVisualMediaElement;
+    /**
+     * Decodes the barcode from an image.
+     *
+     * @param {(string|HTMLImageElement)} [source] The image element that can be either an element id or the element itself. Can be undefined in which case the decoding will be done from the imageUrl parameter.
+     * @param {string} [url]
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    decodeFromImage(source?: string | HTMLImageElement, url?: string): Promise<Result>;
+    /**
+     * Decodes the barcode from a video.
+     *
+     * @param {(string|HTMLImageElement)} [source] The image element that can be either an element id or the element itself. Can be undefined in which case the decoding will be done from the imageUrl parameter.
+     * @param {string} [url]
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    decodeFromVideo(source?: string | HTMLVideoElement, url?: string): Promise<Result>;
+    /**
+     * Decodes continuously the barcode from a video.
+     *
+     * @param {(string|HTMLImageElement)} [source] The image element that can be either an element id or the element itself. Can be undefined in which case the decoding will be done from the imageUrl parameter.
+     * @param {string} [url]
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     *
+     * @experimental
+     */
+    decodeFromVideoContinuously(source: string | HTMLVideoElement | null, url: string | null, callbackFn: DecodeContinuouslyCallback): Promise<void>;
+    /**
+     * Decodes something from an image HTML element.
+     */
+    decodeFromImageElement(source: string | HTMLImageElement): Promise<Result>;
+    /**
+     * Decodes something from an image HTML element.
+     */
+    decodeFromVideoElement(source: string | HTMLVideoElement): Promise<Result>;
+    /**
+     * Decodes something from an image HTML element.
+     */
+    decodeFromVideoElementContinuously(source: string | HTMLVideoElement, callbackFn: DecodeContinuouslyCallback): Promise<void>;
+    /**
+     * Sets up the video source so it can be decoded when loaded.
+     *
+     * @param source The video source element.
+     */
+    private _decodeFromVideoElementSetup;
+    /**
+     * Decodes an image from a URL.
+     */
+    decodeFromImageUrl(url?: string): Promise<Result>;
+    /**
+     * Decodes an image from a URL.
+     */
+    decodeFromVideoUrl(url: string): Promise<Result>;
+    /**
+     * Decodes an image from a URL.
+     *
+     * @experimental
+     */
+    decodeFromVideoUrlContinuously(url: string, callbackFn: DecodeContinuouslyCallback): Promise<void>;
+    private _decodeOnLoadImage;
+    private _decodeOnLoadVideo;
+    private _decodeOnLoadVideoContinuously;
+    isImageLoaded(img: HTMLImageElement): boolean;
+    prepareImageElement(imageSource?: HTMLImageElement | string): HTMLImageElement;
+    /**
+     * Sets a HTMLVideoElement for scanning or creates a new one.
+     *
+     * @param videoSource The HTMLVideoElement to be set.
+     */
+    prepareVideoElement(videoSource?: HTMLVideoElement | string): HTMLVideoElement;
+    /**
+     * Tries to decode from the video input until it finds some value.
+     */
+    decodeOnce(element: HTMLVisualMediaElement, retryIfNotFound?: boolean, retryIfChecksumOrFormatError?: boolean): Promise<Result>;
+    /**
+     * Continuously decodes from video input.
+     */
+    decodeContinuously(element: HTMLVideoElement, callbackFn: DecodeContinuouslyCallback): void;
+    /**
+     * Gets the BinaryBitmap for ya! (and decodes it)
+     */
+    decode(element: HTMLVisualMediaElement): Result;
+    /**
+     * Creates a binaryBitmap based in some image source.
+     *
+     * @param mediaElement HTML element containing drawable image source.
+     */
+    createBinaryBitmap(mediaElement: HTMLVisualMediaElement): BinaryBitmap;
+    /**
+     *
+     */
+    protected getCaptureCanvasContext(mediaElement?: HTMLVisualMediaElement): CanvasRenderingContext2D;
+    /**
+     *
+     */
+    protected getCaptureCanvas(mediaElement?: HTMLVisualMediaElement): HTMLCanvasElement;
+    /**
+     * Overwriting this allows you to manipulate the next frame in anyway you want before decode.
+     */
+    drawFrameOnCanvas(srcElement: HTMLVideoElement, dimensions?: {
+        sx: number;
+        sy: number;
+        sWidth: number;
+        sHeight: number;
+        dx: number;
+        dy: number;
+        dWidth: number;
+        dHeight: number;
+    }, canvasElementContext?: CanvasRenderingContext2D): void;
+    /**
+     * Ovewriting this allows you to manipulate the snapshot image in anyway you want before decode.
+     */
+    drawImageOnCanvas(srcElement: HTMLImageElement, dimensions?: {
+        sx: number;
+        sy: number;
+        sWidth: number;
+        sHeight: number;
+        dx: number;
+        dy: number;
+        dWidth: number;
+        dHeight: number;
+    }, canvasElementContext?: CanvasRenderingContext2D): void;
+    /**
+     * Call the encapsulated readers decode
+     */
+    decodeBitmap(binaryBitmap: BinaryBitmap): Result;
+    /**
+     * 🖌 Prepares the canvas for capture and scan frames.
+     */
+    createCaptureCanvas(mediaElement?: HTMLVisualMediaElement): HTMLCanvasElement;
+    /**
+     * Stops the continuous scan and cleans the stream.
+     */
+    protected stopStreams(): void;
+    /**
+     * Resets the code reader to the initial state. Cancels any ongoing barcode scanning from video or camera.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    reset(): void;
+    private _destroyVideoElement;
+    private _destroyImageElement;
+    /**
+     * Cleans canvas references 🖌
+     */
+    private _destroyCaptureCanvas;
+    /**
+     * Defines what the videoElement src will be.
+     *
+     * @param videoElement
+     * @param stream
+     */
+    addVideoSource(videoElement: HTMLVideoElement, stream: MediaStream): void;
+    /**
+     * Unbinds a HTML video src property.
+     *
+     * @param videoElement
+     */
+    private cleanVideoSource;
+}

+ 1077 - 0
node_modules/@zxing/library/cjs/browser/BrowserCodeReader.js

@@ -0,0 +1,1077 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+var __values = (this && this.__values) || function(o) {
+    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
+    if (m) return m.call(o);
+    if (o && typeof o.length === "number") return {
+        next: function () {
+            if (o && i >= o.length) o = void 0;
+            return { value: o && o[i++], done: !o };
+        }
+    };
+    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserCodeReader = void 0;
+var ArgumentException_1 = require("../core/ArgumentException");
+var BinaryBitmap_1 = require("../core/BinaryBitmap");
+var ChecksumException_1 = require("../core/ChecksumException");
+var HybridBinarizer_1 = require("../core/common/HybridBinarizer");
+var FormatException_1 = require("../core/FormatException");
+var NotFoundException_1 = require("../core/NotFoundException");
+var HTMLCanvasElementLuminanceSource_1 = require("./HTMLCanvasElementLuminanceSource");
+var VideoInputDevice_1 = require("./VideoInputDevice");
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * Base class for browser code reader.
+ */
+var BrowserCodeReader = /** @class */ (function () {
+    /**
+     * Creates an instance of BrowserCodeReader.
+     * @param {Reader} reader The reader instance to decode the barcode
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent successful decode tries
+     *
+     * @memberOf BrowserCodeReader
+     */
+    function BrowserCodeReader(reader, timeBetweenScansMillis, _hints) {
+        if (timeBetweenScansMillis === void 0) { timeBetweenScansMillis = 500; }
+        this.reader = reader;
+        this.timeBetweenScansMillis = timeBetweenScansMillis;
+        this._hints = _hints;
+        /**
+         * This will break the loop.
+         */
+        this._stopContinuousDecode = false;
+        /**
+         * This will break the loop.
+         */
+        this._stopAsyncDecode = false;
+        /**
+         * Delay time between decode attempts made by the scanner.
+         */
+        this._timeBetweenDecodingAttempts = 0;
+    }
+    Object.defineProperty(BrowserCodeReader.prototype, "hasNavigator", {
+        /**
+         * If navigator is present.
+         */
+        get: function () {
+            return typeof navigator !== 'undefined';
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BrowserCodeReader.prototype, "isMediaDevicesSuported", {
+        /**
+         * If mediaDevices under navigator is supported.
+         */
+        get: function () {
+            return this.hasNavigator && !!navigator.mediaDevices;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BrowserCodeReader.prototype, "canEnumerateDevices", {
+        /**
+         * If enumerateDevices under navigator is supported.
+         */
+        get: function () {
+            return !!(this.isMediaDevicesSuported && navigator.mediaDevices.enumerateDevices);
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BrowserCodeReader.prototype, "timeBetweenDecodingAttempts", {
+        /** Time between two decoding tries in milli seconds. */
+        get: function () {
+            return this._timeBetweenDecodingAttempts;
+        },
+        /**
+         * Change the time span the decoder waits between two decoding tries.
+         *
+         * @param {number} millis Time between two decoding tries in milli seconds.
+         */
+        set: function (millis) {
+            this._timeBetweenDecodingAttempts = millis < 0 ? 0 : millis;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BrowserCodeReader.prototype, "hints", {
+        /**
+         * Sets the hints.
+         */
+        get: function () {
+            return this._hints;
+        },
+        /**
+         * Sets the hints.
+         */
+        set: function (hints) {
+            this._hints = hints || null;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    /**
+     * Lists all the available video input devices.
+     */
+    BrowserCodeReader.prototype.listVideoInputDevices = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var devices, videoDevices, devices_1, devices_1_1, device, kind, deviceId, label, groupId, videoDevice;
+            var e_1, _a;
+            return __generator(this, function (_b) {
+                switch (_b.label) {
+                    case 0:
+                        if (!this.hasNavigator) {
+                            throw new Error("Can't enumerate devices, navigator is not present.");
+                        }
+                        if (!this.canEnumerateDevices) {
+                            throw new Error("Can't enumerate devices, method not supported.");
+                        }
+                        return [4 /*yield*/, navigator.mediaDevices.enumerateDevices()];
+                    case 1:
+                        devices = _b.sent();
+                        videoDevices = [];
+                        try {
+                            for (devices_1 = __values(devices), devices_1_1 = devices_1.next(); !devices_1_1.done; devices_1_1 = devices_1.next()) {
+                                device = devices_1_1.value;
+                                kind = device.kind === 'video' ? 'videoinput' : device.kind;
+                                if (kind !== 'videoinput') {
+                                    continue;
+                                }
+                                deviceId = device.deviceId || device.id;
+                                label = device.label || "Video device " + (videoDevices.length + 1);
+                                groupId = device.groupId;
+                                videoDevice = { deviceId: deviceId, label: label, kind: kind, groupId: groupId };
+                                videoDevices.push(videoDevice);
+                            }
+                        }
+                        catch (e_1_1) { e_1 = { error: e_1_1 }; }
+                        finally {
+                            try {
+                                if (devices_1_1 && !devices_1_1.done && (_a = devices_1.return)) _a.call(devices_1);
+                            }
+                            finally { if (e_1) throw e_1.error; }
+                        }
+                        return [2 /*return*/, videoDevices];
+                }
+            });
+        });
+    };
+    /**
+     * Obtain the list of available devices with type 'videoinput'.
+     *
+     * @returns {Promise<VideoInputDevice[]>} an array of available video input devices
+     *
+     * @memberOf BrowserCodeReader
+     *
+     * @deprecated Use `listVideoInputDevices` instead.
+     */
+    BrowserCodeReader.prototype.getVideoInputDevices = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var devices;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.listVideoInputDevices()];
+                    case 1:
+                        devices = _a.sent();
+                        return [2 /*return*/, devices.map(function (d) { return new VideoInputDevice_1.VideoInputDevice(d.deviceId, d.label); })];
+                }
+            });
+        });
+    };
+    /**
+     * Let's you find a device using it's Id.
+     */
+    BrowserCodeReader.prototype.findDeviceById = function (deviceId) {
+        return __awaiter(this, void 0, void 0, function () {
+            var devices;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.listVideoInputDevices()];
+                    case 1:
+                        devices = _a.sent();
+                        if (!devices) {
+                            return [2 /*return*/, null];
+                        }
+                        return [2 /*return*/, devices.find(function (x) { return x.deviceId === deviceId; })];
+                }
+            });
+        });
+    };
+    /**
+     * Decodes the barcode from the device specified by deviceId while showing the video in the specified video element.
+     *
+     * @param deviceId the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
+     * @param video the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     *
+     * @deprecated Use `decodeOnceFromVideoDevice` instead.
+     */
+    BrowserCodeReader.prototype.decodeFromInputVideoDevice = function (deviceId, videoSource) {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.decodeOnceFromVideoDevice(deviceId, videoSource)];
+                    case 1: return [2 /*return*/, _a.sent()];
+                }
+            });
+        });
+    };
+    /**
+     * In one attempt, tries to decode the barcode from the device specified by deviceId while showing the video in the specified video element.
+     *
+     * @param deviceId the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
+     * @param video the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.decodeOnceFromVideoDevice = function (deviceId, videoSource) {
+        return __awaiter(this, void 0, void 0, function () {
+            var videoConstraints, constraints;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0:
+                        this.reset();
+                        if (!deviceId) {
+                            videoConstraints = { facingMode: 'environment' };
+                        }
+                        else {
+                            videoConstraints = { deviceId: { exact: deviceId } };
+                        }
+                        constraints = { video: videoConstraints };
+                        return [4 /*yield*/, this.decodeOnceFromConstraints(constraints, videoSource)];
+                    case 1: return [2 /*return*/, _a.sent()];
+                }
+            });
+        });
+    };
+    /**
+     * In one attempt, tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
+     *
+     * @param constraints the media stream constraints to get s valid media stream to decode from
+     * @param video the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.decodeOnceFromConstraints = function (constraints, videoSource) {
+        return __awaiter(this, void 0, void 0, function () {
+            var stream;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, navigator.mediaDevices.getUserMedia(constraints)];
+                    case 1:
+                        stream = _a.sent();
+                        return [4 /*yield*/, this.decodeOnceFromStream(stream, videoSource)];
+                    case 2: return [2 /*return*/, _a.sent()];
+                }
+            });
+        });
+    };
+    /**
+     * In one attempt, tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
+     *
+     * @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
+     * @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.decodeOnceFromStream = function (stream, videoSource) {
+        return __awaiter(this, void 0, void 0, function () {
+            var video, result;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0:
+                        this.reset();
+                        return [4 /*yield*/, this.attachStreamToVideo(stream, videoSource)];
+                    case 1:
+                        video = _a.sent();
+                        return [4 /*yield*/, this.decodeOnce(video)];
+                    case 2:
+                        result = _a.sent();
+                        return [2 /*return*/, result];
+                }
+            });
+        });
+    };
+    /**
+     * Continuously decodes the barcode from the device specified by device while showing the video in the specified video element.
+     *
+     * @param {string|null} [deviceId] the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
+     * @param {string|HTMLVideoElement|null} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<void>}
+     *
+     * @memberOf BrowserCodeReader
+     *
+     * @deprecated Use `decodeFromVideoDevice` instead.
+     */
+    BrowserCodeReader.prototype.decodeFromInputVideoDeviceContinuously = function (deviceId, videoSource, callbackFn) {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.decodeFromVideoDevice(deviceId, videoSource, callbackFn)];
+                    case 1: return [2 /*return*/, _a.sent()];
+                }
+            });
+        });
+    };
+    /**
+     * Continuously tries to decode the barcode from the device specified by device while showing the video in the specified video element.
+     *
+     * @param {string|null} [deviceId] the id of one of the devices obtained after calling getVideoInputDevices. Can be undefined, in this case it will decode from one of the available devices, preffering the main camera (environment facing) if available.
+     * @param {string|HTMLVideoElement|null} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<void>}
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.decodeFromVideoDevice = function (deviceId, videoSource, callbackFn) {
+        return __awaiter(this, void 0, void 0, function () {
+            var videoConstraints, constraints;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0:
+                        if (!deviceId) {
+                            videoConstraints = { facingMode: 'environment' };
+                        }
+                        else {
+                            videoConstraints = { deviceId: { exact: deviceId } };
+                        }
+                        constraints = { video: videoConstraints };
+                        return [4 /*yield*/, this.decodeFromConstraints(constraints, videoSource, callbackFn)];
+                    case 1: return [2 /*return*/, _a.sent()];
+                }
+            });
+        });
+    };
+    /**
+     * Continuously tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
+     *
+     * @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
+     * @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.decodeFromConstraints = function (constraints, videoSource, callbackFn) {
+        return __awaiter(this, void 0, void 0, function () {
+            var stream;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, navigator.mediaDevices.getUserMedia(constraints)];
+                    case 1:
+                        stream = _a.sent();
+                        return [4 /*yield*/, this.decodeFromStream(stream, videoSource, callbackFn)];
+                    case 2: return [2 /*return*/, _a.sent()];
+                }
+            });
+        });
+    };
+    /**
+     * In one attempt, tries to decode the barcode from a stream obtained from the given constraints while showing the video in the specified video element.
+     *
+     * @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
+     * @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in which case no video will be shown.
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.decodeFromStream = function (stream, videoSource, callbackFn) {
+        return __awaiter(this, void 0, void 0, function () {
+            var video;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0:
+                        this.reset();
+                        return [4 /*yield*/, this.attachStreamToVideo(stream, videoSource)];
+                    case 1:
+                        video = _a.sent();
+                        return [4 /*yield*/, this.decodeContinuously(video, callbackFn)];
+                    case 2: return [2 /*return*/, _a.sent()];
+                }
+            });
+        });
+    };
+    /**
+     * Breaks the decoding loop.
+     */
+    BrowserCodeReader.prototype.stopAsyncDecode = function () {
+        this._stopAsyncDecode = true;
+    };
+    /**
+     * Breaks the decoding loop.
+     */
+    BrowserCodeReader.prototype.stopContinuousDecode = function () {
+        this._stopContinuousDecode = true;
+    };
+    /**
+     * Sets the new stream and request a new decoding-with-delay.
+     *
+     * @param stream The stream to be shown in the video element.
+     * @param decodeFn A callback for the decode method.
+     */
+    BrowserCodeReader.prototype.attachStreamToVideo = function (stream, videoSource) {
+        return __awaiter(this, void 0, void 0, function () {
+            var videoElement;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0:
+                        videoElement = this.prepareVideoElement(videoSource);
+                        this.addVideoSource(videoElement, stream);
+                        this.videoElement = videoElement;
+                        this.stream = stream;
+                        return [4 /*yield*/, this.playVideoOnLoadAsync(videoElement)];
+                    case 1:
+                        _a.sent();
+                        return [2 /*return*/, videoElement];
+                }
+            });
+        });
+    };
+    /**
+     *
+     * @param videoElement
+     */
+    BrowserCodeReader.prototype.playVideoOnLoadAsync = function (videoElement) {
+        var _this = this;
+        return new Promise(function (resolve, reject) {
+            return _this.playVideoOnLoad(videoElement, function () { return resolve(); });
+        });
+    };
+    /**
+     * Binds listeners and callbacks to the videoElement.
+     *
+     * @param element
+     * @param callbackFn
+     */
+    BrowserCodeReader.prototype.playVideoOnLoad = function (element, callbackFn) {
+        var _this = this;
+        this.videoEndedListener = function () { return _this.stopStreams(); };
+        this.videoCanPlayListener = function () { return _this.tryPlayVideo(element); };
+        element.addEventListener('ended', this.videoEndedListener);
+        element.addEventListener('canplay', this.videoCanPlayListener);
+        element.addEventListener('playing', callbackFn);
+        // if canplay was already fired, we won't know when to play, so just give it a try
+        this.tryPlayVideo(element);
+    };
+    /**
+     * Checks if the given video element is currently playing.
+     */
+    BrowserCodeReader.prototype.isVideoPlaying = function (video) {
+        return (video.currentTime > 0 &&
+            !video.paused &&
+            !video.ended &&
+            video.readyState > 2);
+    };
+    /**
+     * Just tries to play the video and logs any errors.
+     * The play call is only made is the video is not already playing.
+     */
+    BrowserCodeReader.prototype.tryPlayVideo = function (videoElement) {
+        return __awaiter(this, void 0, void 0, function () {
+            var _a;
+            return __generator(this, function (_b) {
+                switch (_b.label) {
+                    case 0:
+                        if (this.isVideoPlaying(videoElement)) {
+                            console.warn('Trying to play video that is already playing.');
+                            return [2 /*return*/];
+                        }
+                        _b.label = 1;
+                    case 1:
+                        _b.trys.push([1, 3, , 4]);
+                        return [4 /*yield*/, videoElement.play()];
+                    case 2:
+                        _b.sent();
+                        return [3 /*break*/, 4];
+                    case 3:
+                        _a = _b.sent();
+                        console.warn('It was not possible to play the video.');
+                        return [3 /*break*/, 4];
+                    case 4: return [2 /*return*/];
+                }
+            });
+        });
+    };
+    /**
+     * Searches and validates a media element.
+     */
+    BrowserCodeReader.prototype.getMediaElement = function (mediaElementId, type) {
+        var mediaElement = document.getElementById(mediaElementId);
+        if (!mediaElement) {
+            throw new ArgumentException_1.default("element with id '" + mediaElementId + "' not found");
+        }
+        if (mediaElement.nodeName.toLowerCase() !== type.toLowerCase()) {
+            throw new ArgumentException_1.default("element with id '" + mediaElementId + "' must be an " + type + " element");
+        }
+        return mediaElement;
+    };
+    /**
+     * Decodes the barcode from an image.
+     *
+     * @param {(string|HTMLImageElement)} [source] The image element that can be either an element id or the element itself. Can be undefined in which case the decoding will be done from the imageUrl parameter.
+     * @param {string} [url]
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.decodeFromImage = function (source, url) {
+        if (!source && !url) {
+            throw new ArgumentException_1.default('either imageElement with a src set or an url must be provided');
+        }
+        if (url && !source) {
+            return this.decodeFromImageUrl(url);
+        }
+        return this.decodeFromImageElement(source);
+    };
+    /**
+     * Decodes the barcode from a video.
+     *
+     * @param {(string|HTMLImageElement)} [source] The image element that can be either an element id or the element itself. Can be undefined in which case the decoding will be done from the imageUrl parameter.
+     * @param {string} [url]
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.decodeFromVideo = function (source, url) {
+        if (!source && !url) {
+            throw new ArgumentException_1.default('Either an element with a src set or an URL must be provided');
+        }
+        if (url && !source) {
+            return this.decodeFromVideoUrl(url);
+        }
+        return this.decodeFromVideoElement(source);
+    };
+    /**
+     * Decodes continuously the barcode from a video.
+     *
+     * @param {(string|HTMLImageElement)} [source] The image element that can be either an element id or the element itself. Can be undefined in which case the decoding will be done from the imageUrl parameter.
+     * @param {string} [url]
+     * @returns {Promise<Result>} The decoding result.
+     *
+     * @memberOf BrowserCodeReader
+     *
+     * @experimental
+     */
+    BrowserCodeReader.prototype.decodeFromVideoContinuously = function (source, url, callbackFn) {
+        if (undefined === source && undefined === url) {
+            throw new ArgumentException_1.default('Either an element with a src set or an URL must be provided');
+        }
+        if (url && !source) {
+            return this.decodeFromVideoUrlContinuously(url, callbackFn);
+        }
+        return this.decodeFromVideoElementContinuously(source, callbackFn);
+    };
+    /**
+     * Decodes something from an image HTML element.
+     */
+    BrowserCodeReader.prototype.decodeFromImageElement = function (source) {
+        if (!source) {
+            throw new ArgumentException_1.default('An image element must be provided.');
+        }
+        this.reset();
+        var element = this.prepareImageElement(source);
+        this.imageElement = element;
+        var task;
+        if (this.isImageLoaded(element)) {
+            task = this.decodeOnce(element, false, true);
+        }
+        else {
+            task = this._decodeOnLoadImage(element);
+        }
+        return task;
+    };
+    /**
+     * Decodes something from an image HTML element.
+     */
+    BrowserCodeReader.prototype.decodeFromVideoElement = function (source) {
+        var element = this._decodeFromVideoElementSetup(source);
+        return this._decodeOnLoadVideo(element);
+    };
+    /**
+     * Decodes something from an image HTML element.
+     */
+    BrowserCodeReader.prototype.decodeFromVideoElementContinuously = function (source, callbackFn) {
+        var element = this._decodeFromVideoElementSetup(source);
+        return this._decodeOnLoadVideoContinuously(element, callbackFn);
+    };
+    /**
+     * Sets up the video source so it can be decoded when loaded.
+     *
+     * @param source The video source element.
+     */
+    BrowserCodeReader.prototype._decodeFromVideoElementSetup = function (source) {
+        if (!source) {
+            throw new ArgumentException_1.default('A video element must be provided.');
+        }
+        this.reset();
+        var element = this.prepareVideoElement(source);
+        // defines the video element before starts decoding
+        this.videoElement = element;
+        return element;
+    };
+    /**
+     * Decodes an image from a URL.
+     */
+    BrowserCodeReader.prototype.decodeFromImageUrl = function (url) {
+        if (!url) {
+            throw new ArgumentException_1.default('An URL must be provided.');
+        }
+        this.reset();
+        var element = this.prepareImageElement();
+        this.imageElement = element;
+        var decodeTask = this._decodeOnLoadImage(element);
+        element.src = url;
+        return decodeTask;
+    };
+    /**
+     * Decodes an image from a URL.
+     */
+    BrowserCodeReader.prototype.decodeFromVideoUrl = function (url) {
+        if (!url) {
+            throw new ArgumentException_1.default('An URL must be provided.');
+        }
+        this.reset();
+        // creates a new element
+        var element = this.prepareVideoElement();
+        var decodeTask = this.decodeFromVideoElement(element);
+        element.src = url;
+        return decodeTask;
+    };
+    /**
+     * Decodes an image from a URL.
+     *
+     * @experimental
+     */
+    BrowserCodeReader.prototype.decodeFromVideoUrlContinuously = function (url, callbackFn) {
+        if (!url) {
+            throw new ArgumentException_1.default('An URL must be provided.');
+        }
+        this.reset();
+        // creates a new element
+        var element = this.prepareVideoElement();
+        var decodeTask = this.decodeFromVideoElementContinuously(element, callbackFn);
+        element.src = url;
+        return decodeTask;
+    };
+    BrowserCodeReader.prototype._decodeOnLoadImage = function (element) {
+        var _this = this;
+        return new Promise(function (resolve, reject) {
+            _this.imageLoadedListener = function () {
+                return _this.decodeOnce(element, false, true).then(resolve, reject);
+            };
+            element.addEventListener('load', _this.imageLoadedListener);
+        });
+    };
+    BrowserCodeReader.prototype._decodeOnLoadVideo = function (videoElement) {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: 
+                    // plays the video
+                    return [4 /*yield*/, this.playVideoOnLoadAsync(videoElement)];
+                    case 1:
+                        // plays the video
+                        _a.sent();
+                        return [4 /*yield*/, this.decodeOnce(videoElement)];
+                    case 2: 
+                    // starts decoding after played the video
+                    return [2 /*return*/, _a.sent()];
+                }
+            });
+        });
+    };
+    BrowserCodeReader.prototype._decodeOnLoadVideoContinuously = function (videoElement, callbackFn) {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: 
+                    // plays the video
+                    return [4 /*yield*/, this.playVideoOnLoadAsync(videoElement)];
+                    case 1:
+                        // plays the video
+                        _a.sent();
+                        // starts decoding after played the video
+                        this.decodeContinuously(videoElement, callbackFn);
+                        return [2 /*return*/];
+                }
+            });
+        });
+    };
+    BrowserCodeReader.prototype.isImageLoaded = function (img) {
+        // During the onload event, IE correctly identifies any images that
+        // weren’t downloaded as not complete. Others should too. Gecko-based
+        // browsers act like NS4 in that they report this incorrectly.
+        if (!img.complete) {
+            return false;
+        }
+        // However, they do have two very useful properties: naturalWidth and
+        // naturalHeight. These give the true size of the image. If it failed
+        // to load, either of these should be zero.
+        if (img.naturalWidth === 0) {
+            return false;
+        }
+        // No other way of checking: assume it’s ok.
+        return true;
+    };
+    BrowserCodeReader.prototype.prepareImageElement = function (imageSource) {
+        var imageElement;
+        if (typeof imageSource === 'undefined') {
+            imageElement = document.createElement('img');
+            imageElement.width = 200;
+            imageElement.height = 200;
+        }
+        if (typeof imageSource === 'string') {
+            imageElement = this.getMediaElement(imageSource, 'img');
+        }
+        if (imageSource instanceof HTMLImageElement) {
+            imageElement = imageSource;
+        }
+        return imageElement;
+    };
+    /**
+     * Sets a HTMLVideoElement for scanning or creates a new one.
+     *
+     * @param videoSource The HTMLVideoElement to be set.
+     */
+    BrowserCodeReader.prototype.prepareVideoElement = function (videoSource) {
+        var videoElement;
+        if (!videoSource && typeof document !== 'undefined') {
+            videoElement = document.createElement('video');
+            videoElement.width = 200;
+            videoElement.height = 200;
+        }
+        if (typeof videoSource === 'string') {
+            videoElement = (this.getMediaElement(videoSource, 'video'));
+        }
+        if (videoSource instanceof HTMLVideoElement) {
+            videoElement = videoSource;
+        }
+        // Needed for iOS 11
+        videoElement.setAttribute('autoplay', 'true');
+        videoElement.setAttribute('muted', 'true');
+        videoElement.setAttribute('playsinline', 'true');
+        return videoElement;
+    };
+    /**
+     * Tries to decode from the video input until it finds some value.
+     */
+    BrowserCodeReader.prototype.decodeOnce = function (element, retryIfNotFound, retryIfChecksumOrFormatError) {
+        var _this = this;
+        if (retryIfNotFound === void 0) { retryIfNotFound = true; }
+        if (retryIfChecksumOrFormatError === void 0) { retryIfChecksumOrFormatError = true; }
+        this._stopAsyncDecode = false;
+        var loop = function (resolve, reject) {
+            if (_this._stopAsyncDecode) {
+                reject(new NotFoundException_1.default('Video stream has ended before any code could be detected.'));
+                _this._stopAsyncDecode = undefined;
+                return;
+            }
+            try {
+                var result = _this.decode(element);
+                resolve(result);
+            }
+            catch (e) {
+                var ifNotFound = retryIfNotFound && e instanceof NotFoundException_1.default;
+                var isChecksumOrFormatError = e instanceof ChecksumException_1.default || e instanceof FormatException_1.default;
+                var ifChecksumOrFormat = isChecksumOrFormatError && retryIfChecksumOrFormatError;
+                if (ifNotFound || ifChecksumOrFormat) {
+                    // trying again
+                    return setTimeout(loop, _this._timeBetweenDecodingAttempts, resolve, reject);
+                }
+                reject(e);
+            }
+        };
+        return new Promise(function (resolve, reject) { return loop(resolve, reject); });
+    };
+    /**
+     * Continuously decodes from video input.
+     */
+    BrowserCodeReader.prototype.decodeContinuously = function (element, callbackFn) {
+        var _this = this;
+        this._stopContinuousDecode = false;
+        var loop = function () {
+            if (_this._stopContinuousDecode) {
+                _this._stopContinuousDecode = undefined;
+                return;
+            }
+            try {
+                var result = _this.decode(element);
+                callbackFn(result, null);
+                setTimeout(loop, _this.timeBetweenScansMillis);
+            }
+            catch (e) {
+                callbackFn(null, e);
+                var isChecksumOrFormatError = e instanceof ChecksumException_1.default || e instanceof FormatException_1.default;
+                var isNotFound = e instanceof NotFoundException_1.default;
+                if (isChecksumOrFormatError || isNotFound) {
+                    // trying again
+                    setTimeout(loop, _this._timeBetweenDecodingAttempts);
+                }
+            }
+        };
+        loop();
+    };
+    /**
+     * Gets the BinaryBitmap for ya! (and decodes it)
+     */
+    BrowserCodeReader.prototype.decode = function (element) {
+        // get binary bitmap for decode function
+        var binaryBitmap = this.createBinaryBitmap(element);
+        return this.decodeBitmap(binaryBitmap);
+    };
+    /**
+     * Creates a binaryBitmap based in some image source.
+     *
+     * @param mediaElement HTML element containing drawable image source.
+     */
+    BrowserCodeReader.prototype.createBinaryBitmap = function (mediaElement) {
+        var ctx = this.getCaptureCanvasContext(mediaElement);
+        if (mediaElement instanceof HTMLVideoElement) {
+            this.drawFrameOnCanvas(mediaElement);
+        }
+        else {
+            this.drawImageOnCanvas(mediaElement);
+        }
+        var canvas = this.getCaptureCanvas(mediaElement);
+        var luminanceSource = new HTMLCanvasElementLuminanceSource_1.HTMLCanvasElementLuminanceSource(canvas);
+        var hybridBinarizer = new HybridBinarizer_1.default(luminanceSource);
+        return new BinaryBitmap_1.default(hybridBinarizer);
+    };
+    /**
+     *
+     */
+    BrowserCodeReader.prototype.getCaptureCanvasContext = function (mediaElement) {
+        if (!this.captureCanvasContext) {
+            var elem = this.getCaptureCanvas(mediaElement);
+            var ctx = void 0;
+            try {
+                ctx = elem.getContext('2d', { willReadFrequently: true });
+            }
+            catch (e) {
+                ctx = elem.getContext('2d');
+            }
+            this.captureCanvasContext = ctx;
+        }
+        return this.captureCanvasContext;
+    };
+    /**
+     *
+     */
+    BrowserCodeReader.prototype.getCaptureCanvas = function (mediaElement) {
+        if (!this.captureCanvas) {
+            var elem = this.createCaptureCanvas(mediaElement);
+            this.captureCanvas = elem;
+        }
+        return this.captureCanvas;
+    };
+    /**
+     * Overwriting this allows you to manipulate the next frame in anyway you want before decode.
+     */
+    BrowserCodeReader.prototype.drawFrameOnCanvas = function (srcElement, dimensions, canvasElementContext) {
+        if (dimensions === void 0) { dimensions = {
+            sx: 0,
+            sy: 0,
+            sWidth: srcElement.videoWidth,
+            sHeight: srcElement.videoHeight,
+            dx: 0,
+            dy: 0,
+            dWidth: srcElement.videoWidth,
+            dHeight: srcElement.videoHeight,
+        }; }
+        if (canvasElementContext === void 0) { canvasElementContext = this.captureCanvasContext; }
+        canvasElementContext.drawImage(srcElement, dimensions.sx, dimensions.sy, dimensions.sWidth, dimensions.sHeight, dimensions.dx, dimensions.dy, dimensions.dWidth, dimensions.dHeight);
+    };
+    /**
+     * Ovewriting this allows you to manipulate the snapshot image in anyway you want before decode.
+     */
+    BrowserCodeReader.prototype.drawImageOnCanvas = function (srcElement, dimensions, canvasElementContext) {
+        if (dimensions === void 0) { dimensions = {
+            sx: 0,
+            sy: 0,
+            sWidth: srcElement.naturalWidth,
+            sHeight: srcElement.naturalHeight,
+            dx: 0,
+            dy: 0,
+            dWidth: srcElement.naturalWidth,
+            dHeight: srcElement.naturalHeight,
+        }; }
+        if (canvasElementContext === void 0) { canvasElementContext = this.captureCanvasContext; }
+        canvasElementContext.drawImage(srcElement, dimensions.sx, dimensions.sy, dimensions.sWidth, dimensions.sHeight, dimensions.dx, dimensions.dy, dimensions.dWidth, dimensions.dHeight);
+    };
+    /**
+     * Call the encapsulated readers decode
+     */
+    BrowserCodeReader.prototype.decodeBitmap = function (binaryBitmap) {
+        return this.reader.decode(binaryBitmap, this._hints);
+    };
+    /**
+     * 🖌 Prepares the canvas for capture and scan frames.
+     */
+    BrowserCodeReader.prototype.createCaptureCanvas = function (mediaElement) {
+        if (typeof document === 'undefined') {
+            this._destroyCaptureCanvas();
+            return null;
+        }
+        var canvasElement = document.createElement('canvas');
+        var width;
+        var height;
+        if (typeof mediaElement !== 'undefined') {
+            if (mediaElement instanceof HTMLVideoElement) {
+                width = mediaElement.videoWidth;
+                height = mediaElement.videoHeight;
+            }
+            else if (mediaElement instanceof HTMLImageElement) {
+                width = mediaElement.naturalWidth || mediaElement.width;
+                height = mediaElement.naturalHeight || mediaElement.height;
+            }
+        }
+        canvasElement.style.width = width + 'px';
+        canvasElement.style.height = height + 'px';
+        canvasElement.width = width;
+        canvasElement.height = height;
+        return canvasElement;
+    };
+    /**
+     * Stops the continuous scan and cleans the stream.
+     */
+    BrowserCodeReader.prototype.stopStreams = function () {
+        if (this.stream) {
+            this.stream.getVideoTracks().forEach(function (t) { return t.stop(); });
+            this.stream = undefined;
+        }
+        if (this._stopAsyncDecode === false) {
+            this.stopAsyncDecode();
+        }
+        if (this._stopContinuousDecode === false) {
+            this.stopContinuousDecode();
+        }
+    };
+    /**
+     * Resets the code reader to the initial state. Cancels any ongoing barcode scanning from video or camera.
+     *
+     * @memberOf BrowserCodeReader
+     */
+    BrowserCodeReader.prototype.reset = function () {
+        // stops the camera, preview and scan 🔴
+        this.stopStreams();
+        // clean and forget about HTML elements
+        this._destroyVideoElement();
+        this._destroyImageElement();
+        this._destroyCaptureCanvas();
+    };
+    BrowserCodeReader.prototype._destroyVideoElement = function () {
+        if (!this.videoElement) {
+            return;
+        }
+        // first gives freedon to the element 🕊
+        if (typeof this.videoEndedListener !== 'undefined') {
+            this.videoElement.removeEventListener('ended', this.videoEndedListener);
+        }
+        if (typeof this.videoPlayingEventListener !== 'undefined') {
+            this.videoElement.removeEventListener('playing', this.videoPlayingEventListener);
+        }
+        if (typeof this.videoCanPlayListener !== 'undefined') {
+            this.videoElement.removeEventListener('loadedmetadata', this.videoCanPlayListener);
+        }
+        // then forgets about that element 😢
+        this.cleanVideoSource(this.videoElement);
+        this.videoElement = undefined;
+    };
+    BrowserCodeReader.prototype._destroyImageElement = function () {
+        if (!this.imageElement) {
+            return;
+        }
+        // first gives freedon to the element 🕊
+        if (undefined !== this.imageLoadedListener) {
+            this.imageElement.removeEventListener('load', this.imageLoadedListener);
+        }
+        // then forget about that element 😢
+        this.imageElement.src = undefined;
+        this.imageElement.removeAttribute('src');
+        this.imageElement = undefined;
+    };
+    /**
+     * Cleans canvas references 🖌
+     */
+    BrowserCodeReader.prototype._destroyCaptureCanvas = function () {
+        // then forget about that element 😢
+        this.captureCanvasContext = undefined;
+        this.captureCanvas = undefined;
+    };
+    /**
+     * Defines what the videoElement src will be.
+     *
+     * @param videoElement
+     * @param stream
+     */
+    BrowserCodeReader.prototype.addVideoSource = function (videoElement, stream) {
+        // Older browsers may not have `srcObject`
+        try {
+            // @note Throws Exception if interrupted by a new loaded request
+            videoElement.srcObject = stream;
+        }
+        catch (err) {
+            // @note Avoid using this in new browsers, as it is going away.
+            // @ts-ignore
+            videoElement.src = URL.createObjectURL(stream);
+        }
+    };
+    /**
+     * Unbinds a HTML video src property.
+     *
+     * @param videoElement
+     */
+    BrowserCodeReader.prototype.cleanVideoSource = function (videoElement) {
+        try {
+            videoElement.srcObject = null;
+        }
+        catch (err) {
+            videoElement.src = '';
+        }
+        this.videoElement.removeAttribute('src');
+    };
+    return BrowserCodeReader;
+}());
+exports.BrowserCodeReader = BrowserCodeReader;

+ 13 - 0
node_modules/@zxing/library/cjs/browser/BrowserDatamatrixCodeReader.d.ts

@@ -0,0 +1,13 @@
+import { BrowserCodeReader } from './BrowserCodeReader';
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * QR Code reader to use from browser.
+ */
+export declare class BrowserDatamatrixCodeReader extends BrowserCodeReader {
+    /**
+     * Creates an instance of BrowserQRCodeReader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     */
+    constructor(timeBetweenScansMillis?: number);
+}

+ 36 - 0
node_modules/@zxing/library/cjs/browser/BrowserDatamatrixCodeReader.js

@@ -0,0 +1,36 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserDatamatrixCodeReader = void 0;
+var BrowserCodeReader_1 = require("./BrowserCodeReader");
+var DataMatrixReader_1 = require("../core/datamatrix/DataMatrixReader");
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * QR Code reader to use from browser.
+ */
+var BrowserDatamatrixCodeReader = /** @class */ (function (_super) {
+    __extends(BrowserDatamatrixCodeReader, _super);
+    /**
+     * Creates an instance of BrowserQRCodeReader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     */
+    function BrowserDatamatrixCodeReader(timeBetweenScansMillis) {
+        if (timeBetweenScansMillis === void 0) { timeBetweenScansMillis = 500; }
+        return _super.call(this, new DataMatrixReader_1.default(), timeBetweenScansMillis) || this;
+    }
+    return BrowserDatamatrixCodeReader;
+}(BrowserCodeReader_1.BrowserCodeReader));
+exports.BrowserDatamatrixCodeReader = BrowserDatamatrixCodeReader;

+ 14 - 0
node_modules/@zxing/library/cjs/browser/BrowserMultiFormatReader.d.ts

@@ -0,0 +1,14 @@
+import { BrowserCodeReader } from './BrowserCodeReader';
+import MultiFormatReader from '../core/MultiFormatReader';
+import BinaryBitmap from '../core/BinaryBitmap';
+import Result from '../core/Result';
+import DecodeHintType from '../core/DecodeHintType';
+export declare class BrowserMultiFormatReader extends BrowserCodeReader {
+    protected readonly reader: MultiFormatReader;
+    constructor(hints?: Map<DecodeHintType, any>, timeBetweenScansMillis?: number);
+    /**
+     * Overwrite decodeBitmap to call decodeWithState, which will pay
+     * attention to the hints set in the constructor function
+     */
+    decodeBitmap(binaryBitmap: BinaryBitmap): Result;
+}

+ 39 - 0
node_modules/@zxing/library/cjs/browser/BrowserMultiFormatReader.js

@@ -0,0 +1,39 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserMultiFormatReader = void 0;
+var BrowserCodeReader_1 = require("./BrowserCodeReader");
+var MultiFormatReader_1 = require("../core/MultiFormatReader");
+var BrowserMultiFormatReader = /** @class */ (function (_super) {
+    __extends(BrowserMultiFormatReader, _super);
+    function BrowserMultiFormatReader(hints, timeBetweenScansMillis) {
+        if (hints === void 0) { hints = null; }
+        if (timeBetweenScansMillis === void 0) { timeBetweenScansMillis = 500; }
+        var _this = this;
+        var reader = new MultiFormatReader_1.default();
+        reader.setHints(hints);
+        _this = _super.call(this, reader, timeBetweenScansMillis) || this;
+        return _this;
+    }
+    /**
+     * Overwrite decodeBitmap to call decodeWithState, which will pay
+     * attention to the hints set in the constructor function
+     */
+    BrowserMultiFormatReader.prototype.decodeBitmap = function (binaryBitmap) {
+        return this.reader.decodeWithState(binaryBitmap);
+    };
+    return BrowserMultiFormatReader;
+}(BrowserCodeReader_1.BrowserCodeReader));
+exports.BrowserMultiFormatReader = BrowserMultiFormatReader;

+ 13 - 0
node_modules/@zxing/library/cjs/browser/BrowserPDF417Reader.d.ts

@@ -0,0 +1,13 @@
+import { BrowserCodeReader } from './BrowserCodeReader';
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * QR Code reader to use from browser.
+ */
+export declare class BrowserPDF417Reader extends BrowserCodeReader {
+    /**
+     * Creates an instance of BrowserPDF417Reader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     */
+    constructor(timeBetweenScansMillis?: number);
+}

+ 36 - 0
node_modules/@zxing/library/cjs/browser/BrowserPDF417Reader.js

@@ -0,0 +1,36 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserPDF417Reader = void 0;
+var BrowserCodeReader_1 = require("./BrowserCodeReader");
+var PDF417Reader_1 = require("../core/pdf417/PDF417Reader");
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * QR Code reader to use from browser.
+ */
+var BrowserPDF417Reader = /** @class */ (function (_super) {
+    __extends(BrowserPDF417Reader, _super);
+    /**
+     * Creates an instance of BrowserPDF417Reader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     */
+    function BrowserPDF417Reader(timeBetweenScansMillis) {
+        if (timeBetweenScansMillis === void 0) { timeBetweenScansMillis = 500; }
+        return _super.call(this, new PDF417Reader_1.default(), timeBetweenScansMillis) || this;
+    }
+    return BrowserPDF417Reader;
+}(BrowserCodeReader_1.BrowserCodeReader));
+exports.BrowserPDF417Reader = BrowserPDF417Reader;

+ 13 - 0
node_modules/@zxing/library/cjs/browser/BrowserQRCodeReader.d.ts

@@ -0,0 +1,13 @@
+import { BrowserCodeReader } from './BrowserCodeReader';
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * QR Code reader to use from browser.
+ */
+export declare class BrowserQRCodeReader extends BrowserCodeReader {
+    /**
+     * Creates an instance of BrowserQRCodeReader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     */
+    constructor(timeBetweenScansMillis?: number);
+}

+ 36 - 0
node_modules/@zxing/library/cjs/browser/BrowserQRCodeReader.js

@@ -0,0 +1,36 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserQRCodeReader = void 0;
+var BrowserCodeReader_1 = require("./BrowserCodeReader");
+var QRCodeReader_1 = require("../core/qrcode/QRCodeReader");
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * QR Code reader to use from browser.
+ */
+var BrowserQRCodeReader = /** @class */ (function (_super) {
+    __extends(BrowserQRCodeReader, _super);
+    /**
+     * Creates an instance of BrowserQRCodeReader.
+     * @param {number} [timeBetweenScansMillis=500] the time delay between subsequent decode tries
+     */
+    function BrowserQRCodeReader(timeBetweenScansMillis) {
+        if (timeBetweenScansMillis === void 0) { timeBetweenScansMillis = 500; }
+        return _super.call(this, new QRCodeReader_1.default(), timeBetweenScansMillis) || this;
+    }
+    return BrowserQRCodeReader;
+}(BrowserCodeReader_1.BrowserCodeReader));
+exports.BrowserQRCodeReader = BrowserQRCodeReader;

+ 46 - 0
node_modules/@zxing/library/cjs/browser/BrowserQRCodeSvgWriter.d.ts

@@ -0,0 +1,46 @@
+import EncodeHintType from '../core/EncodeHintType';
+/**
+ * @deprecated Moving to @zxing/browser
+ */
+declare class BrowserQRCodeSvgWriter {
+    private static readonly QUIET_ZONE_SIZE;
+    /**
+     * SVG markup NameSpace
+     */
+    private static readonly SVG_NS;
+    /**
+     * Writes and renders a QRCode SVG element.
+     *
+     * @param contents
+     * @param width
+     * @param height
+     * @param hints
+     */
+    write(contents: string, width: number, height: number, hints?: Map<EncodeHintType, any>): SVGSVGElement;
+    /**
+     * Renders the result and then appends it to the DOM.
+     */
+    writeToDom(containerElement: string | HTMLElement, contents: string, width: number, height: number, hints?: Map<EncodeHintType, any>): void;
+    /**
+     * Note that the input matrix uses 0 == white, 1 == black.
+     * The output matrix uses 0 == black, 255 == white (i.e. an 8 bit greyscale bitmap).
+     */
+    private renderResult;
+    /**
+     * Creates a SVG element.
+     *
+     * @param w SVG's width attribute
+     * @param h SVG's height attribute
+     */
+    private createSVGElement;
+    /**
+     * Creates a SVG rect element.
+     *
+     * @param x Element's x coordinate
+     * @param y Element's y coordinate
+     * @param w Element's width attribute
+     * @param h Element's height attribute
+     */
+    private createSvgRectElement;
+}
+export { BrowserQRCodeSvgWriter };

+ 129 - 0
node_modules/@zxing/library/cjs/browser/BrowserQRCodeSvgWriter.js

@@ -0,0 +1,129 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserQRCodeSvgWriter = void 0;
+var EncodeHintType_1 = require("../core/EncodeHintType");
+var Encoder_1 = require("../core/qrcode/encoder/Encoder");
+var ErrorCorrectionLevel_1 = require("../core/qrcode/decoder/ErrorCorrectionLevel");
+var IllegalArgumentException_1 = require("../core/IllegalArgumentException");
+var IllegalStateException_1 = require("../core/IllegalStateException");
+/**
+ * @deprecated Moving to @zxing/browser
+ */
+var BrowserQRCodeSvgWriter = /** @class */ (function () {
+    function BrowserQRCodeSvgWriter() {
+    }
+    /**
+     * Writes and renders a QRCode SVG element.
+     *
+     * @param contents
+     * @param width
+     * @param height
+     * @param hints
+     */
+    BrowserQRCodeSvgWriter.prototype.write = function (contents, width, height, hints) {
+        if (hints === void 0) { hints = null; }
+        if (contents.length === 0) {
+            throw new IllegalArgumentException_1.default('Found empty contents');
+        }
+        // if (format != BarcodeFormat.QR_CODE) {
+        //   throw new IllegalArgumentException("Can only encode QR_CODE, but got " + format)
+        // }
+        if (width < 0 || height < 0) {
+            throw new IllegalArgumentException_1.default('Requested dimensions are too small: ' + width + 'x' + height);
+        }
+        var errorCorrectionLevel = ErrorCorrectionLevel_1.default.L;
+        var quietZone = BrowserQRCodeSvgWriter.QUIET_ZONE_SIZE;
+        if (hints !== null) {
+            if (undefined !== hints.get(EncodeHintType_1.default.ERROR_CORRECTION)) {
+                errorCorrectionLevel = ErrorCorrectionLevel_1.default.fromString(hints.get(EncodeHintType_1.default.ERROR_CORRECTION).toString());
+            }
+            if (undefined !== hints.get(EncodeHintType_1.default.MARGIN)) {
+                quietZone = Number.parseInt(hints.get(EncodeHintType_1.default.MARGIN).toString(), 10);
+            }
+        }
+        var code = Encoder_1.default.encode(contents, errorCorrectionLevel, hints);
+        return this.renderResult(code, width, height, quietZone);
+    };
+    /**
+     * Renders the result and then appends it to the DOM.
+     */
+    BrowserQRCodeSvgWriter.prototype.writeToDom = function (containerElement, contents, width, height, hints) {
+        if (hints === void 0) { hints = null; }
+        if (typeof containerElement === 'string') {
+            containerElement = document.querySelector(containerElement);
+        }
+        var svgElement = this.write(contents, width, height, hints);
+        if (containerElement)
+            containerElement.appendChild(svgElement);
+    };
+    /**
+     * Note that the input matrix uses 0 == white, 1 == black.
+     * The output matrix uses 0 == black, 255 == white (i.e. an 8 bit greyscale bitmap).
+     */
+    BrowserQRCodeSvgWriter.prototype.renderResult = function (code, width /*int*/, height /*int*/, quietZone /*int*/) {
+        var input = code.getMatrix();
+        if (input === null) {
+            throw new IllegalStateException_1.default();
+        }
+        var inputWidth = input.getWidth();
+        var inputHeight = input.getHeight();
+        var qrWidth = inputWidth + (quietZone * 2);
+        var qrHeight = inputHeight + (quietZone * 2);
+        var outputWidth = Math.max(width, qrWidth);
+        var outputHeight = Math.max(height, qrHeight);
+        var multiple = Math.min(Math.floor(outputWidth / qrWidth), Math.floor(outputHeight / qrHeight));
+        // Padding includes both the quiet zone and the extra white pixels to accommodate the requested
+        // dimensions. For example, if input is 25x25 the QR will be 33x33 including the quiet zone.
+        // If the requested size is 200x160, the multiple will be 4, for a QR of 132x132. These will
+        // handle all the padding from 100x100 (the actual QR) up to 200x160.
+        var leftPadding = Math.floor((outputWidth - (inputWidth * multiple)) / 2);
+        var topPadding = Math.floor((outputHeight - (inputHeight * multiple)) / 2);
+        var svgElement = this.createSVGElement(outputWidth, outputHeight);
+        for (var inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
+            // Write the contents of this row of the barcode
+            for (var inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
+                if (input.get(inputX, inputY) === 1) {
+                    var svgRectElement = this.createSvgRectElement(outputX, outputY, multiple, multiple);
+                    svgElement.appendChild(svgRectElement);
+                }
+            }
+        }
+        return svgElement;
+    };
+    /**
+     * Creates a SVG element.
+     *
+     * @param w SVG's width attribute
+     * @param h SVG's height attribute
+     */
+    BrowserQRCodeSvgWriter.prototype.createSVGElement = function (w, h) {
+        var svgElement = document.createElementNS(BrowserQRCodeSvgWriter.SVG_NS, 'svg');
+        svgElement.setAttributeNS(null, 'height', w.toString());
+        svgElement.setAttributeNS(null, 'width', h.toString());
+        return svgElement;
+    };
+    /**
+     * Creates a SVG rect element.
+     *
+     * @param x Element's x coordinate
+     * @param y Element's y coordinate
+     * @param w Element's width attribute
+     * @param h Element's height attribute
+     */
+    BrowserQRCodeSvgWriter.prototype.createSvgRectElement = function (x, y, w, h) {
+        var rect = document.createElementNS(BrowserQRCodeSvgWriter.SVG_NS, 'rect');
+        rect.setAttributeNS(null, 'x', x.toString());
+        rect.setAttributeNS(null, 'y', y.toString());
+        rect.setAttributeNS(null, 'height', w.toString());
+        rect.setAttributeNS(null, 'width', h.toString());
+        rect.setAttributeNS(null, 'fill', '#000000');
+        return rect;
+    };
+    BrowserQRCodeSvgWriter.QUIET_ZONE_SIZE = 4;
+    /**
+     * SVG markup NameSpace
+     */
+    BrowserQRCodeSvgWriter.SVG_NS = 'http://www.w3.org/2000/svg';
+    return BrowserQRCodeSvgWriter;
+}());
+exports.BrowserQRCodeSvgWriter = BrowserQRCodeSvgWriter;

+ 49 - 0
node_modules/@zxing/library/cjs/browser/BrowserSvgCodeWriter.d.ts

@@ -0,0 +1,49 @@
+import EncodeHintType from '../core/EncodeHintType';
+/**
+ * @deprecated Moving to @zxing/browser
+ */
+declare abstract class BrowserSvgCodeWriter {
+    /**
+     * Default quiet zone in pixels.
+     */
+    private static readonly QUIET_ZONE_SIZE;
+    /**
+     * SVG markup NameSpace
+     */
+    private static readonly SVG_NS;
+    /**
+     * A HTML container element for the image.
+     */
+    private containerElement;
+    /**
+     * Constructs. 😉
+     */
+    constructor(containerElement: string | HTMLElement);
+    /**
+     * Writes the QR code to a SVG and renders it in the container.
+     */
+    write(contents: string, width: number, height: number, hints?: Map<EncodeHintType, any>): SVGSVGElement;
+    /**
+     * Encodes the content to a Barcode type.
+     */
+    private encode;
+    /**
+     * Renders the SVG in the container.
+     *
+     * @note the input matrix uses 0 == white, 1 == black. The output matrix uses 0 == black, 255 == white (i.e. an 8 bit greyscale bitmap).
+     */
+    private renderResult;
+    /**
+     * Creates a SVG element.
+     */
+    protected createSVGElement(w: number, h: number): SVGSVGElement;
+    /**
+     * Creates a SVG rect.
+     */
+    protected createSvgPathPlaceholderElement(w: number, h: number): SVGPathElement;
+    /**
+     * Creates a SVG rect.
+     */
+    protected createSvgRectElement(x: number, y: number, w: number, h: number): SVGRectElement;
+}
+export { BrowserSvgCodeWriter };

+ 134 - 0
node_modules/@zxing/library/cjs/browser/BrowserSvgCodeWriter.js

@@ -0,0 +1,134 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BrowserSvgCodeWriter = void 0;
+var EncodeHintType_1 = require("../core/EncodeHintType");
+var Encoder_1 = require("../core/qrcode/encoder/Encoder");
+var ErrorCorrectionLevel_1 = require("../core/qrcode/decoder/ErrorCorrectionLevel");
+var IllegalArgumentException_1 = require("../core/IllegalArgumentException");
+var IllegalStateException_1 = require("../core/IllegalStateException");
+/**
+ * @deprecated Moving to @zxing/browser
+ */
+var BrowserSvgCodeWriter = /** @class */ (function () {
+    /**
+     * Constructs. 😉
+     */
+    function BrowserSvgCodeWriter(containerElement) {
+        if (typeof containerElement === 'string') {
+            this.containerElement = document.getElementById(containerElement);
+        }
+        else {
+            this.containerElement = containerElement;
+        }
+    }
+    /**
+     * Writes the QR code to a SVG and renders it in the container.
+     */
+    BrowserSvgCodeWriter.prototype.write = function (contents, width, height, hints) {
+        if (hints === void 0) { hints = null; }
+        if (contents.length === 0) {
+            throw new IllegalArgumentException_1.default('Found empty contents');
+        }
+        if (width < 0 || height < 0) {
+            throw new IllegalArgumentException_1.default('Requested dimensions are too small: ' + width + 'x' + height);
+        }
+        var quietZone = hints && hints.get(EncodeHintType_1.default.MARGIN) !== undefined
+            ? Number.parseInt(hints.get(EncodeHintType_1.default.MARGIN).toString(), 10)
+            : BrowserSvgCodeWriter.QUIET_ZONE_SIZE;
+        var code = this.encode(hints, contents);
+        return this.renderResult(code, width, height, quietZone);
+    };
+    /**
+     * Encodes the content to a Barcode type.
+     */
+    BrowserSvgCodeWriter.prototype.encode = function (hints, contents) {
+        var errorCorrectionLevel = ErrorCorrectionLevel_1.default.L;
+        if (hints && hints.get(EncodeHintType_1.default.ERROR_CORRECTION) !== undefined) {
+            errorCorrectionLevel = ErrorCorrectionLevel_1.default.fromString(hints.get(EncodeHintType_1.default.ERROR_CORRECTION).toString());
+        }
+        var code = Encoder_1.default.encode(contents, errorCorrectionLevel, hints);
+        return code;
+    };
+    /**
+     * Renders the SVG in the container.
+     *
+     * @note the input matrix uses 0 == white, 1 == black. The output matrix uses 0 == black, 255 == white (i.e. an 8 bit greyscale bitmap).
+     */
+    BrowserSvgCodeWriter.prototype.renderResult = function (code, width /*int*/, height /*int*/, quietZone /*int*/) {
+        // if (this.format && format != this.format) {
+        //   throw new IllegalArgumentException("Can only encode QR_CODE, but got " + format)
+        // }
+        var input = code.getMatrix();
+        if (input === null) {
+            throw new IllegalStateException_1.default();
+        }
+        var inputWidth = input.getWidth();
+        var inputHeight = input.getHeight();
+        var qrWidth = inputWidth + (quietZone * 2);
+        var qrHeight = inputHeight + (quietZone * 2);
+        var outputWidth = Math.max(width, qrWidth);
+        var outputHeight = Math.max(height, qrHeight);
+        var multiple = Math.min(Math.floor(outputWidth / qrWidth), Math.floor(outputHeight / qrHeight));
+        // Padding includes both the quiet zone and the extra white pixels to accommodate the requested
+        // dimensions. For example, if input is 25x25 the QR will be 33x33 including the quiet zone.
+        // If the requested size is 200x160, the multiple will be 4, for a QR of 132x132. These will
+        // handle all the padding from 100x100 (the actual QR) up to 200x160.
+        var leftPadding = Math.floor((outputWidth - (inputWidth * multiple)) / 2);
+        var topPadding = Math.floor((outputHeight - (inputHeight * multiple)) / 2);
+        var svgElement = this.createSVGElement(outputWidth, outputHeight);
+        var placeholder = this.createSvgPathPlaceholderElement(width, height);
+        svgElement.append(placeholder);
+        this.containerElement.appendChild(svgElement);
+        // 2D loop
+        for (var inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
+            // Write the contents of this row of the barcode
+            for (var inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
+                if (input.get(inputX, inputY) === 1) {
+                    var svgRectElement = this.createSvgRectElement(outputX, outputY, multiple, multiple);
+                    svgElement.appendChild(svgRectElement);
+                }
+            }
+        }
+        return svgElement;
+    };
+    /**
+     * Creates a SVG element.
+     */
+    BrowserSvgCodeWriter.prototype.createSVGElement = function (w, h) {
+        var el = document.createElementNS(BrowserSvgCodeWriter.SVG_NS, 'svg');
+        el.setAttributeNS(null, 'width', h.toString());
+        el.setAttributeNS(null, 'height', w.toString());
+        return el;
+    };
+    /**
+     * Creates a SVG rect.
+     */
+    BrowserSvgCodeWriter.prototype.createSvgPathPlaceholderElement = function (w, h) {
+        var el = document.createElementNS(BrowserSvgCodeWriter.SVG_NS, 'path');
+        el.setAttributeNS(null, 'd', "M0 0h" + w + "v" + h + "H0z");
+        el.setAttributeNS(null, 'fill', 'none');
+        return el;
+    };
+    /**
+     * Creates a SVG rect.
+     */
+    BrowserSvgCodeWriter.prototype.createSvgRectElement = function (x, y, w, h) {
+        var el = document.createElementNS(BrowserSvgCodeWriter.SVG_NS, 'rect');
+        el.setAttributeNS(null, 'x', x.toString());
+        el.setAttributeNS(null, 'y', y.toString());
+        el.setAttributeNS(null, 'height', w.toString());
+        el.setAttributeNS(null, 'width', h.toString());
+        el.setAttributeNS(null, 'fill', '#000000');
+        return el;
+    };
+    /**
+     * Default quiet zone in pixels.
+     */
+    BrowserSvgCodeWriter.QUIET_ZONE_SIZE = 4;
+    /**
+     * SVG markup NameSpace
+     */
+    BrowserSvgCodeWriter.SVG_NS = 'http://www.w3.org/2000/svg';
+    return BrowserSvgCodeWriter;
+}());
+exports.BrowserSvgCodeWriter = BrowserSvgCodeWriter;

+ 6 - 0
node_modules/@zxing/library/cjs/browser/DecodeContinuouslyCallback.d.ts

@@ -0,0 +1,6 @@
+import Exception from '../core/Exception';
+import Result from '../core/Result';
+/**
+ * Callback format for continuous decode scan.
+ */
+export declare type DecodeContinuouslyCallback = (result: Result, error?: Exception) => any;

+ 2 - 0
node_modules/@zxing/library/cjs/browser/DecodeContinuouslyCallback.js

@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });

+ 29 - 0
node_modules/@zxing/library/cjs/browser/HTMLCanvasElementLuminanceSource.d.ts

@@ -0,0 +1,29 @@
+import LuminanceSource from '../core/LuminanceSource';
+/**
+ * @deprecated Moving to @zxing/browser
+ */
+export declare class HTMLCanvasElementLuminanceSource extends LuminanceSource {
+    private canvas;
+    private buffer;
+    private static DEGREE_TO_RADIANS;
+    private static FRAME_INDEX;
+    private tempCanvasElement;
+    constructor(canvas: HTMLCanvasElement);
+    private static makeBufferFromCanvasImageData;
+    private static toGrayscaleBuffer;
+    getRow(y: number, row: Uint8ClampedArray): Uint8ClampedArray;
+    getMatrix(): Uint8ClampedArray;
+    isCropSupported(): boolean;
+    crop(left: number, top: number, width: number, height: number): LuminanceSource;
+    /**
+     * This is always true, since the image is a gray-scale image.
+     *
+     * @return true
+     */
+    isRotateSupported(): boolean;
+    rotateCounterClockwise(): LuminanceSource;
+    rotateCounterClockwise45(): LuminanceSource;
+    private getTempCanvasElement;
+    private rotate;
+    invert(): LuminanceSource;
+}

+ 170 - 0
node_modules/@zxing/library/cjs/browser/HTMLCanvasElementLuminanceSource.js

@@ -0,0 +1,170 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.HTMLCanvasElementLuminanceSource = void 0;
+var InvertedLuminanceSource_1 = require("../core/InvertedLuminanceSource");
+var LuminanceSource_1 = require("../core/LuminanceSource");
+var IllegalArgumentException_1 = require("../core/IllegalArgumentException");
+/**
+ * @deprecated Moving to @zxing/browser
+ */
+var HTMLCanvasElementLuminanceSource = /** @class */ (function (_super) {
+    __extends(HTMLCanvasElementLuminanceSource, _super);
+    function HTMLCanvasElementLuminanceSource(canvas) {
+        var _this = _super.call(this, canvas.width, canvas.height) || this;
+        _this.canvas = canvas;
+        _this.tempCanvasElement = null;
+        _this.buffer = HTMLCanvasElementLuminanceSource.makeBufferFromCanvasImageData(canvas);
+        return _this;
+    }
+    HTMLCanvasElementLuminanceSource.makeBufferFromCanvasImageData = function (canvas) {
+        var imageData = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height);
+        return HTMLCanvasElementLuminanceSource.toGrayscaleBuffer(imageData.data, canvas.width, canvas.height);
+    };
+    HTMLCanvasElementLuminanceSource.toGrayscaleBuffer = function (imageBuffer, width, height) {
+        var grayscaleBuffer = new Uint8ClampedArray(width * height);
+        HTMLCanvasElementLuminanceSource.FRAME_INDEX = !HTMLCanvasElementLuminanceSource.FRAME_INDEX;
+        if (HTMLCanvasElementLuminanceSource.FRAME_INDEX) {
+            for (var i = 0, j = 0, length_1 = imageBuffer.length; i < length_1; i += 4, j++) {
+                var gray = void 0;
+                var alpha = imageBuffer[i + 3];
+                // The color of fully-transparent pixels is irrelevant. They are often, technically, fully-transparent
+                // black (0 alpha, and then 0 RGB). They are often used, of course as the "white" area in a
+                // barcode image. Force any such pixel to be white:
+                if (alpha === 0) {
+                    gray = 0xFF;
+                }
+                else {
+                    var pixelR = imageBuffer[i];
+                    var pixelG = imageBuffer[i + 1];
+                    var pixelB = imageBuffer[i + 2];
+                    // .299R + 0.587G + 0.114B (YUV/YIQ for PAL and NTSC),
+                    // (306*R) >> 10 is approximately equal to R*0.299, and so on.
+                    // 0x200 >> 10 is 0.5, it implements rounding.
+                    gray = (306 * pixelR +
+                        601 * pixelG +
+                        117 * pixelB +
+                        0x200) >> 10;
+                }
+                grayscaleBuffer[j] = gray;
+            }
+        }
+        else {
+            for (var i = 0, j = 0, length_2 = imageBuffer.length; i < length_2; i += 4, j++) {
+                var gray = void 0;
+                var alpha = imageBuffer[i + 3];
+                // The color of fully-transparent pixels is irrelevant. They are often, technically, fully-transparent
+                // black (0 alpha, and then 0 RGB). They are often used, of course as the "white" area in a
+                // barcode image. Force any such pixel to be white:
+                if (alpha === 0) {
+                    gray = 0xFF;
+                }
+                else {
+                    var pixelR = imageBuffer[i];
+                    var pixelG = imageBuffer[i + 1];
+                    var pixelB = imageBuffer[i + 2];
+                    // .299R + 0.587G + 0.114B (YUV/YIQ for PAL and NTSC),
+                    // (306*R) >> 10 is approximately equal to R*0.299, and so on.
+                    // 0x200 >> 10 is 0.5, it implements rounding.
+                    gray = (306 * pixelR +
+                        601 * pixelG +
+                        117 * pixelB +
+                        0x200) >> 10;
+                }
+                grayscaleBuffer[j] = 0xFF - gray;
+            }
+        }
+        return grayscaleBuffer;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.getRow = function (y /*int*/, row) {
+        if (y < 0 || y >= this.getHeight()) {
+            throw new IllegalArgumentException_1.default('Requested row is outside the image: ' + y);
+        }
+        var width = this.getWidth();
+        var start = y * width;
+        if (row === null) {
+            row = this.buffer.slice(start, start + width);
+        }
+        else {
+            if (row.length < width) {
+                row = new Uint8ClampedArray(width);
+            }
+            // The underlying raster of image consists of bytes with the luminance values
+            // TODO: can avoid set/slice?
+            row.set(this.buffer.slice(start, start + width));
+        }
+        return row;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.getMatrix = function () {
+        return this.buffer;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.isCropSupported = function () {
+        return true;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.crop = function (left /*int*/, top /*int*/, width /*int*/, height /*int*/) {
+        _super.prototype.crop.call(this, left, top, width, height);
+        return this;
+    };
+    /**
+     * This is always true, since the image is a gray-scale image.
+     *
+     * @return true
+     */
+    HTMLCanvasElementLuminanceSource.prototype.isRotateSupported = function () {
+        return true;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.rotateCounterClockwise = function () {
+        this.rotate(-90);
+        return this;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.rotateCounterClockwise45 = function () {
+        this.rotate(-45);
+        return this;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.getTempCanvasElement = function () {
+        if (null === this.tempCanvasElement) {
+            var tempCanvasElement = this.canvas.ownerDocument.createElement('canvas');
+            tempCanvasElement.width = this.canvas.width;
+            tempCanvasElement.height = this.canvas.height;
+            this.tempCanvasElement = tempCanvasElement;
+        }
+        return this.tempCanvasElement;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.rotate = function (angle) {
+        var tempCanvasElement = this.getTempCanvasElement();
+        var tempContext = tempCanvasElement.getContext('2d');
+        var angleRadians = angle * HTMLCanvasElementLuminanceSource.DEGREE_TO_RADIANS;
+        // Calculate and set new dimensions for temp canvas
+        var width = this.canvas.width;
+        var height = this.canvas.height;
+        var newWidth = Math.ceil(Math.abs(Math.cos(angleRadians)) * width + Math.abs(Math.sin(angleRadians)) * height);
+        var newHeight = Math.ceil(Math.abs(Math.sin(angleRadians)) * width + Math.abs(Math.cos(angleRadians)) * height);
+        tempCanvasElement.width = newWidth;
+        tempCanvasElement.height = newHeight;
+        // Draw at center of temp canvas to prevent clipping of image data
+        tempContext.translate(newWidth / 2, newHeight / 2);
+        tempContext.rotate(angleRadians);
+        tempContext.drawImage(this.canvas, width / -2, height / -2);
+        this.buffer = HTMLCanvasElementLuminanceSource.makeBufferFromCanvasImageData(tempCanvasElement);
+        return this;
+    };
+    HTMLCanvasElementLuminanceSource.prototype.invert = function () {
+        return new InvertedLuminanceSource_1.default(this);
+    };
+    HTMLCanvasElementLuminanceSource.DEGREE_TO_RADIANS = Math.PI / 180;
+    HTMLCanvasElementLuminanceSource.FRAME_INDEX = true;
+    return HTMLCanvasElementLuminanceSource;
+}(LuminanceSource_1.default));
+exports.HTMLCanvasElementLuminanceSource = HTMLCanvasElementLuminanceSource;

+ 4 - 0
node_modules/@zxing/library/cjs/browser/HTMLVisualMediaElement.d.ts

@@ -0,0 +1,4 @@
+/**
+ * HTML elements that can be decoded.
+ */
+export declare type HTMLVisualMediaElement = HTMLVideoElement | HTMLImageElement;

+ 2 - 0
node_modules/@zxing/library/cjs/browser/HTMLVisualMediaElement.js

@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });

+ 27 - 0
node_modules/@zxing/library/cjs/browser/VideoInputDevice.d.ts

@@ -0,0 +1,27 @@
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * Video input device metadata containing the id and label of the device if available.
+ */
+export declare class VideoInputDevice implements MediaDeviceInfo {
+    deviceId: string;
+    label: string;
+    /** @inheritdoc */
+    readonly kind = "videoinput";
+    /** @inheritdoc */
+    readonly groupId: string;
+    /**
+     * Creates an instance of VideoInputDevice.
+     *
+     * @param {string} deviceId the video input device id
+     * @param {string} label the label of the device if available
+     */
+    constructor(deviceId: string, label: string, groupId?: string);
+    /** @inheritdoc */
+    toJSON(): {
+        kind: string;
+        groupId: string;
+        deviceId: string;
+        label: string;
+    };
+}

+ 34 - 0
node_modules/@zxing/library/cjs/browser/VideoInputDevice.js

@@ -0,0 +1,34 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.VideoInputDevice = void 0;
+/**
+ * @deprecated Moving to @zxing/browser
+ *
+ * Video input device metadata containing the id and label of the device if available.
+ */
+var VideoInputDevice = /** @class */ (function () {
+    /**
+     * Creates an instance of VideoInputDevice.
+     *
+     * @param {string} deviceId the video input device id
+     * @param {string} label the label of the device if available
+     */
+    function VideoInputDevice(deviceId, label, groupId) {
+        this.deviceId = deviceId;
+        this.label = label;
+        /** @inheritdoc */
+        this.kind = 'videoinput';
+        this.groupId = groupId || undefined;
+    }
+    /** @inheritdoc */
+    VideoInputDevice.prototype.toJSON = function () {
+        return {
+            kind: this.kind,
+            groupId: this.groupId,
+            deviceId: this.deviceId,
+            label: this.label,
+        };
+    };
+    return VideoInputDevice;
+}());
+exports.VideoInputDevice = VideoInputDevice;

+ 7 - 0
node_modules/@zxing/library/cjs/core/ArgumentException.d.ts

@@ -0,0 +1,7 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class ArgumentException extends Exception {
+    static readonly kind: string;
+}

+ 28 - 0
node_modules/@zxing/library/cjs/core/ArgumentException.js

@@ -0,0 +1,28 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var ArgumentException = /** @class */ (function (_super) {
+    __extends(ArgumentException, _super);
+    function ArgumentException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    ArgumentException.kind = 'ArgumentException';
+    return ArgumentException;
+}(Exception_1.default));
+exports.default = ArgumentException;

+ 7 - 0
node_modules/@zxing/library/cjs/core/ArithmeticException.d.ts

@@ -0,0 +1,7 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class ArithmeticException extends Exception {
+    static readonly kind: string;
+}

+ 28 - 0
node_modules/@zxing/library/cjs/core/ArithmeticException.js

@@ -0,0 +1,28 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var ArithmeticException = /** @class */ (function (_super) {
+    __extends(ArithmeticException, _super);
+    function ArithmeticException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    ArithmeticException.kind = 'ArithmeticException';
+    return ArithmeticException;
+}(Exception_1.default));
+exports.default = ArithmeticException;

+ 10 - 0
node_modules/@zxing/library/cjs/core/ArrayIndexOutOfBoundsException.d.ts

@@ -0,0 +1,10 @@
+import IndexOutOfBoundsException from './IndexOutOfBoundsException';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
+    index: number;
+    message: string;
+    static readonly kind: string;
+    constructor(index?: number, message?: string);
+}

+ 33 - 0
node_modules/@zxing/library/cjs/core/ArrayIndexOutOfBoundsException.js

@@ -0,0 +1,33 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var IndexOutOfBoundsException_1 = require("./IndexOutOfBoundsException");
+/**
+ * Custom Error class of type Exception.
+ */
+var ArrayIndexOutOfBoundsException = /** @class */ (function (_super) {
+    __extends(ArrayIndexOutOfBoundsException, _super);
+    function ArrayIndexOutOfBoundsException(index, message) {
+        if (index === void 0) { index = undefined; }
+        if (message === void 0) { message = undefined; }
+        var _this = _super.call(this, message) || this;
+        _this.index = index;
+        _this.message = message;
+        return _this;
+    }
+    ArrayIndexOutOfBoundsException.kind = 'ArrayIndexOutOfBoundsException';
+    return ArrayIndexOutOfBoundsException;
+}(IndexOutOfBoundsException_1.default));
+exports.default = ArrayIndexOutOfBoundsException;

+ 42 - 0
node_modules/@zxing/library/cjs/core/BarcodeFormat.d.ts

@@ -0,0 +1,42 @@
+/**
+ * Enumerates barcode formats known to this package. Please keep alphabetized.
+ *
+ * @author Sean Owen
+ */
+declare enum BarcodeFormat {
+    /** Aztec 2D barcode format. */
+    AZTEC = 0,
+    /** CODABAR 1D format. */
+    CODABAR = 1,
+    /** Code 39 1D format. */
+    CODE_39 = 2,
+    /** Code 93 1D format. */
+    CODE_93 = 3,
+    /** Code 128 1D format. */
+    CODE_128 = 4,
+    /** Data Matrix 2D barcode format. */
+    DATA_MATRIX = 5,
+    /** EAN-8 1D format. */
+    EAN_8 = 6,
+    /** EAN-13 1D format. */
+    EAN_13 = 7,
+    /** ITF (Interleaved Two of Five) 1D format. */
+    ITF = 8,
+    /** MaxiCode 2D barcode format. */
+    MAXICODE = 9,
+    /** PDF417 format. */
+    PDF_417 = 10,
+    /** QR Code 2D barcode format. */
+    QR_CODE = 11,
+    /** RSS 14 */
+    RSS_14 = 12,
+    /** RSS EXPANDED */
+    RSS_EXPANDED = 13,
+    /** UPC-A 1D format. */
+    UPC_A = 14,
+    /** UPC-E 1D format. */
+    UPC_E = 15,
+    /** UPC/EAN extension format. Not a stand-alone format. */
+    UPC_EAN_EXTENSION = 16
+}
+export default BarcodeFormat;

+ 64 - 0
node_modules/@zxing/library/cjs/core/BarcodeFormat.js

@@ -0,0 +1,64 @@
+"use strict";
+/*
+ * Direct port to TypeScript of ZXing by Adrian Toșcă
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*namespace com.google.zxing {*/
+/**
+ * Enumerates barcode formats known to this package. Please keep alphabetized.
+ *
+ * @author Sean Owen
+ */
+var BarcodeFormat;
+(function (BarcodeFormat) {
+    /** Aztec 2D barcode format. */
+    BarcodeFormat[BarcodeFormat["AZTEC"] = 0] = "AZTEC";
+    /** CODABAR 1D format. */
+    BarcodeFormat[BarcodeFormat["CODABAR"] = 1] = "CODABAR";
+    /** Code 39 1D format. */
+    BarcodeFormat[BarcodeFormat["CODE_39"] = 2] = "CODE_39";
+    /** Code 93 1D format. */
+    BarcodeFormat[BarcodeFormat["CODE_93"] = 3] = "CODE_93";
+    /** Code 128 1D format. */
+    BarcodeFormat[BarcodeFormat["CODE_128"] = 4] = "CODE_128";
+    /** Data Matrix 2D barcode format. */
+    BarcodeFormat[BarcodeFormat["DATA_MATRIX"] = 5] = "DATA_MATRIX";
+    /** EAN-8 1D format. */
+    BarcodeFormat[BarcodeFormat["EAN_8"] = 6] = "EAN_8";
+    /** EAN-13 1D format. */
+    BarcodeFormat[BarcodeFormat["EAN_13"] = 7] = "EAN_13";
+    /** ITF (Interleaved Two of Five) 1D format. */
+    BarcodeFormat[BarcodeFormat["ITF"] = 8] = "ITF";
+    /** MaxiCode 2D barcode format. */
+    BarcodeFormat[BarcodeFormat["MAXICODE"] = 9] = "MAXICODE";
+    /** PDF417 format. */
+    BarcodeFormat[BarcodeFormat["PDF_417"] = 10] = "PDF_417";
+    /** QR Code 2D barcode format. */
+    BarcodeFormat[BarcodeFormat["QR_CODE"] = 11] = "QR_CODE";
+    /** RSS 14 */
+    BarcodeFormat[BarcodeFormat["RSS_14"] = 12] = "RSS_14";
+    /** RSS EXPANDED */
+    BarcodeFormat[BarcodeFormat["RSS_EXPANDED"] = 13] = "RSS_EXPANDED";
+    /** UPC-A 1D format. */
+    BarcodeFormat[BarcodeFormat["UPC_A"] = 14] = "UPC_A";
+    /** UPC-E 1D format. */
+    BarcodeFormat[BarcodeFormat["UPC_E"] = 15] = "UPC_E";
+    /** UPC/EAN extension format. Not a stand-alone format. */
+    BarcodeFormat[BarcodeFormat["UPC_EAN_EXTENSION"] = 16] = "UPC_EAN_EXTENSION";
+})(BarcodeFormat || (BarcodeFormat = {}));
+exports.default = BarcodeFormat;

+ 53 - 0
node_modules/@zxing/library/cjs/core/Binarizer.d.ts

@@ -0,0 +1,53 @@
+import LuminanceSource from './LuminanceSource';
+import BitArray from './common/BitArray';
+import BitMatrix from './common/BitMatrix';
+/**
+ * This class hierarchy provides a set of methods to convert luminance data to 1 bit data.
+ * It allows the algorithm to vary polymorphically, for example allowing a very expensive
+ * thresholding technique for servers and a fast one for mobile. It also permits the implementation
+ * to vary, e.g. a JNI version for Android and a Java fallback version for other platforms.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+declare abstract class Binarizer {
+    private source;
+    protected constructor(source: LuminanceSource);
+    getLuminanceSource(): LuminanceSource;
+    /**
+     * Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
+     * cached data. Callers should assume this method is expensive and call it as seldom as possible.
+     * This method is intended for decoding 1D barcodes and may choose to apply sharpening.
+     * For callers which only examine one row of pixels at a time, the same BitArray should be reused
+     * and passed in with each call for performance. However it is legal to keep more than one row
+     * at a time if needed.
+     *
+     * @param y The row to fetch, which must be in [0, bitmap height)
+     * @param row An optional preallocated array. If null or too small, it will be ignored.
+     *            If used, the Binarizer will call BitArray.clear(). Always use the returned object.
+     * @return The array of bits for this row (true means black).
+     * @throws NotFoundException if row can't be binarized
+     */
+    abstract getBlackRow(y: number, row: BitArray): BitArray;
+    /**
+     * Converts a 2D array of luminance data to 1 bit data. As above, assume this method is expensive
+     * and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or
+     * may not apply sharpening. Therefore, a row from this matrix may not be identical to one
+     * fetched using getBlackRow(), so don't mix and match between them.
+     *
+     * @return The 2D array of bits for the image (true means black).
+     * @throws NotFoundException if image can't be binarized to make a matrix
+     */
+    abstract getBlackMatrix(): BitMatrix;
+    /**
+     * Creates a new object with the same type as this Binarizer implementation, but with pristine
+     * state. This is needed because Binarizer implementations may be stateful, e.g. keeping a cache
+     * of 1 bit data. See Effective Java for why we can't use Java's clone() method.
+     *
+     * @param source The LuminanceSource this Binarizer will operate on.
+     * @return A new concrete Binarizer implementation object.
+     */
+    abstract createBinarizer(source: LuminanceSource): Binarizer;
+    getWidth(): number;
+    getHeight(): number;
+}
+export default Binarizer;

+ 41 - 0
node_modules/@zxing/library/cjs/core/Binarizer.js

@@ -0,0 +1,41 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * This class hierarchy provides a set of methods to convert luminance data to 1 bit data.
+ * It allows the algorithm to vary polymorphically, for example allowing a very expensive
+ * thresholding technique for servers and a fast one for mobile. It also permits the implementation
+ * to vary, e.g. a JNI version for Android and a Java fallback version for other platforms.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+var Binarizer = /** @class */ (function () {
+    function Binarizer(source) {
+        this.source = source;
+    }
+    Binarizer.prototype.getLuminanceSource = function () {
+        return this.source;
+    };
+    Binarizer.prototype.getWidth = function () {
+        return this.source.getWidth();
+    };
+    Binarizer.prototype.getHeight = function () {
+        return this.source.getHeight();
+    };
+    return Binarizer;
+}());
+exports.default = Binarizer;

+ 78 - 0
node_modules/@zxing/library/cjs/core/BinaryBitmap.d.ts

@@ -0,0 +1,78 @@
+/**
+ * This class is the core bitmap class used by ZXing to represent 1 bit data. Reader objects
+ * accept a BinaryBitmap and attempt to decode it.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+import Binarizer from './Binarizer';
+import BitArray from './common/BitArray';
+import BitMatrix from './common/BitMatrix';
+export default class BinaryBitmap {
+    private binarizer;
+    private matrix;
+    constructor(binarizer: Binarizer);
+    /**
+     * @return The width of the bitmap.
+     */
+    getWidth(): number;
+    /**
+     * @return The height of the bitmap.
+     */
+    getHeight(): number;
+    /**
+     * Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
+     * cached data. Callers should assume this method is expensive and call it as seldom as possible.
+     * This method is intended for decoding 1D barcodes and may choose to apply sharpening.
+     *
+     * @param y The row to fetch, which must be in [0, bitmap height)
+     * @param row An optional preallocated array. If null or too small, it will be ignored.
+     *            If used, the Binarizer will call BitArray.clear(). Always use the returned object.
+     * @return The array of bits for this row (true means black).
+     * @throws NotFoundException if row can't be binarized
+     */
+    getBlackRow(y: number, row: BitArray): BitArray;
+    /**
+     * Converts a 2D array of luminance data to 1 bit. As above, assume this method is expensive
+     * and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or
+     * may not apply sharpening. Therefore, a row from this matrix may not be identical to one
+     * fetched using getBlackRow(), so don't mix and match between them.
+     *
+     * @return The 2D array of bits for the image (true means black).
+     * @throws NotFoundException if image can't be binarized to make a matrix
+     */
+    getBlackMatrix(): BitMatrix;
+    /**
+     * @return Whether this bitmap can be cropped.
+     */
+    isCropSupported(): boolean;
+    /**
+     * Returns a new object with cropped image data. Implementations may keep a reference to the
+     * original data rather than a copy. Only callable if isCropSupported() is true.
+     *
+     * @param left The left coordinate, which must be in [0,getWidth())
+     * @param top The top coordinate, which must be in [0,getHeight())
+     * @param width The width of the rectangle to crop.
+     * @param height The height of the rectangle to crop.
+     * @return A cropped version of this object.
+     */
+    crop(left: number, top: number, width: number, height: number): BinaryBitmap;
+    /**
+     * @return Whether this bitmap supports counter-clockwise rotation.
+     */
+    isRotateSupported(): boolean;
+    /**
+     * Returns a new object with rotated image data by 90 degrees counterclockwise.
+     * Only callable if {@link #isRotateSupported()} is true.
+     *
+     * @return A rotated version of this object.
+     */
+    rotateCounterClockwise(): BinaryBitmap;
+    /**
+     * Returns a new object with rotated image data by 45 degrees counterclockwise.
+     * Only callable if {@link #isRotateSupported()} is true.
+     *
+     * @return A rotated version of this object.
+     */
+    rotateCounterClockwise45(): BinaryBitmap;
+    toString(): string;
+}

+ 129 - 0
node_modules/@zxing/library/cjs/core/BinaryBitmap.js

@@ -0,0 +1,129 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+var IllegalArgumentException_1 = require("./IllegalArgumentException");
+var BinaryBitmap = /** @class */ (function () {
+    function BinaryBitmap(binarizer) {
+        this.binarizer = binarizer;
+        if (binarizer === null) {
+            throw new IllegalArgumentException_1.default('Binarizer must be non-null.');
+        }
+    }
+    /**
+     * @return The width of the bitmap.
+     */
+    BinaryBitmap.prototype.getWidth = function () {
+        return this.binarizer.getWidth();
+    };
+    /**
+     * @return The height of the bitmap.
+     */
+    BinaryBitmap.prototype.getHeight = function () {
+        return this.binarizer.getHeight();
+    };
+    /**
+     * Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
+     * cached data. Callers should assume this method is expensive and call it as seldom as possible.
+     * This method is intended for decoding 1D barcodes and may choose to apply sharpening.
+     *
+     * @param y The row to fetch, which must be in [0, bitmap height)
+     * @param row An optional preallocated array. If null or too small, it will be ignored.
+     *            If used, the Binarizer will call BitArray.clear(). Always use the returned object.
+     * @return The array of bits for this row (true means black).
+     * @throws NotFoundException if row can't be binarized
+     */
+    BinaryBitmap.prototype.getBlackRow = function (y /*int*/, row) {
+        return this.binarizer.getBlackRow(y, row);
+    };
+    /**
+     * Converts a 2D array of luminance data to 1 bit. As above, assume this method is expensive
+     * and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or
+     * may not apply sharpening. Therefore, a row from this matrix may not be identical to one
+     * fetched using getBlackRow(), so don't mix and match between them.
+     *
+     * @return The 2D array of bits for the image (true means black).
+     * @throws NotFoundException if image can't be binarized to make a matrix
+     */
+    BinaryBitmap.prototype.getBlackMatrix = function () {
+        // The matrix is created on demand the first time it is requested, then cached. There are two
+        // reasons for this:
+        // 1. This work will never be done if the caller only installs 1D Reader objects, or if a
+        //    1D Reader finds a barcode before the 2D Readers run.
+        // 2. This work will only be done once even if the caller installs multiple 2D Readers.
+        if (this.matrix === null || this.matrix === undefined) {
+            this.matrix = this.binarizer.getBlackMatrix();
+        }
+        return this.matrix;
+    };
+    /**
+     * @return Whether this bitmap can be cropped.
+     */
+    BinaryBitmap.prototype.isCropSupported = function () {
+        return this.binarizer.getLuminanceSource().isCropSupported();
+    };
+    /**
+     * Returns a new object with cropped image data. Implementations may keep a reference to the
+     * original data rather than a copy. Only callable if isCropSupported() is true.
+     *
+     * @param left The left coordinate, which must be in [0,getWidth())
+     * @param top The top coordinate, which must be in [0,getHeight())
+     * @param width The width of the rectangle to crop.
+     * @param height The height of the rectangle to crop.
+     * @return A cropped version of this object.
+     */
+    BinaryBitmap.prototype.crop = function (left /*int*/, top /*int*/, width /*int*/, height /*int*/) {
+        var newSource = this.binarizer.getLuminanceSource().crop(left, top, width, height);
+        return new BinaryBitmap(this.binarizer.createBinarizer(newSource));
+    };
+    /**
+     * @return Whether this bitmap supports counter-clockwise rotation.
+     */
+    BinaryBitmap.prototype.isRotateSupported = function () {
+        return this.binarizer.getLuminanceSource().isRotateSupported();
+    };
+    /**
+     * Returns a new object with rotated image data by 90 degrees counterclockwise.
+     * Only callable if {@link #isRotateSupported()} is true.
+     *
+     * @return A rotated version of this object.
+     */
+    BinaryBitmap.prototype.rotateCounterClockwise = function () {
+        var newSource = this.binarizer.getLuminanceSource().rotateCounterClockwise();
+        return new BinaryBitmap(this.binarizer.createBinarizer(newSource));
+    };
+    /**
+     * Returns a new object with rotated image data by 45 degrees counterclockwise.
+     * Only callable if {@link #isRotateSupported()} is true.
+     *
+     * @return A rotated version of this object.
+     */
+    BinaryBitmap.prototype.rotateCounterClockwise45 = function () {
+        var newSource = this.binarizer.getLuminanceSource().rotateCounterClockwise45();
+        return new BinaryBitmap(this.binarizer.createBinarizer(newSource));
+    };
+    /*@Override*/
+    BinaryBitmap.prototype.toString = function () {
+        try {
+            return this.getBlackMatrix().toString();
+        }
+        catch (e /*: NotFoundException*/) {
+            return '';
+        }
+    };
+    return BinaryBitmap;
+}());
+exports.default = BinaryBitmap;

+ 8 - 0
node_modules/@zxing/library/cjs/core/ChecksumException.d.ts

@@ -0,0 +1,8 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class ChecksumException extends Exception {
+    static readonly kind: string;
+    static getChecksumInstance(): ChecksumException;
+}

+ 31 - 0
node_modules/@zxing/library/cjs/core/ChecksumException.js

@@ -0,0 +1,31 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var ChecksumException = /** @class */ (function (_super) {
+    __extends(ChecksumException, _super);
+    function ChecksumException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    ChecksumException.getChecksumInstance = function () {
+        return new ChecksumException();
+    };
+    ChecksumException.kind = 'ChecksumException';
+    return ChecksumException;
+}(Exception_1.default));
+exports.default = ChecksumException;

+ 69 - 0
node_modules/@zxing/library/cjs/core/DecodeHintType.d.ts

@@ -0,0 +1,69 @@
+/**
+ * Encapsulates a type of hint that a caller may pass to a barcode reader to help it
+ * more quickly or accurately decode it. It is up to implementations to decide what,
+ * if anything, to do with the information that is supplied.
+ *
+ * @author Sean Owen
+ * @author dswitkin@google.com (Daniel Switkin)
+ * @see Reader#decode(BinaryBitmap,java.util.Map)
+ */
+declare enum DecodeHintType {
+    /**
+     * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
+     */
+    OTHER = 0,
+    /**
+     * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
+     * use {@link Boolean#TRUE}.
+     */
+    PURE_BARCODE = 1,
+    /**
+     * Image is known to be of one of a few possible formats.
+     * Maps to a {@link List} of {@link BarcodeFormat}s.
+     */
+    POSSIBLE_FORMATS = 2,
+    /**
+     * Spend more time to try to find a barcode; optimize for accuracy, not speed.
+     * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
+     */
+    TRY_HARDER = 3,
+    /**
+     * Specifies what character encoding to use when decoding, where applicable (type String)
+     */
+    CHARACTER_SET = 4,
+    /**
+     * Allowed lengths of encoded data -- reject anything else. Maps to an {@code Int32Array}.
+     */
+    ALLOWED_LENGTHS = 5,
+    /**
+     * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
+     * use {@link Boolean#TRUE}.
+     */
+    ASSUME_CODE_39_CHECK_DIGIT = 6,
+    /**
+     * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
+     * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
+     * use {@link Boolean#TRUE}.
+     */
+    ASSUME_GS1 = 7,
+    /**
+     * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
+     * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
+     * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
+     */
+    RETURN_CODABAR_START_END = 8,
+    /**
+     * The caller needs to be notified via callback when a possible {@link ResultPoint}
+     * is found. Maps to a {@link ResultPointCallback}.
+     */
+    NEED_RESULT_POINT_CALLBACK = 9,
+    /**
+     * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
+     * Maps to an {@code Int32Array} of the allowed extension lengths, for example [2], [5], or [2, 5].
+     * If it is optional to have an extension, do not set this hint. If this is set,
+     * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
+     * at all.
+     */
+    ALLOWED_EAN_EXTENSIONS = 10
+}
+export default DecodeHintType;

+ 104 - 0
node_modules/@zxing/library/cjs/core/DecodeHintType.js

@@ -0,0 +1,104 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+/*namespace com.google.zxing {*/
+/**
+ * Encapsulates a type of hint that a caller may pass to a barcode reader to help it
+ * more quickly or accurately decode it. It is up to implementations to decide what,
+ * if anything, to do with the information that is supplied.
+ *
+ * @author Sean Owen
+ * @author dswitkin@google.com (Daniel Switkin)
+ * @see Reader#decode(BinaryBitmap,java.util.Map)
+ */
+var DecodeHintType;
+(function (DecodeHintType) {
+    /**
+     * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
+     */
+    DecodeHintType[DecodeHintType["OTHER"] = 0] = "OTHER"; /*(Object.class)*/
+    /**
+     * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
+     * use {@link Boolean#TRUE}.
+     */
+    DecodeHintType[DecodeHintType["PURE_BARCODE"] = 1] = "PURE_BARCODE"; /*(Void.class)*/
+    /**
+     * Image is known to be of one of a few possible formats.
+     * Maps to a {@link List} of {@link BarcodeFormat}s.
+     */
+    DecodeHintType[DecodeHintType["POSSIBLE_FORMATS"] = 2] = "POSSIBLE_FORMATS"; /*(List.class)*/
+    /**
+     * Spend more time to try to find a barcode; optimize for accuracy, not speed.
+     * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
+     */
+    DecodeHintType[DecodeHintType["TRY_HARDER"] = 3] = "TRY_HARDER"; /*(Void.class)*/
+    /**
+     * Specifies what character encoding to use when decoding, where applicable (type String)
+     */
+    DecodeHintType[DecodeHintType["CHARACTER_SET"] = 4] = "CHARACTER_SET"; /*(String.class)*/
+    /**
+     * Allowed lengths of encoded data -- reject anything else. Maps to an {@code Int32Array}.
+     */
+    DecodeHintType[DecodeHintType["ALLOWED_LENGTHS"] = 5] = "ALLOWED_LENGTHS"; /*(Int32Array.class)*/
+    /**
+     * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
+     * use {@link Boolean#TRUE}.
+     */
+    DecodeHintType[DecodeHintType["ASSUME_CODE_39_CHECK_DIGIT"] = 6] = "ASSUME_CODE_39_CHECK_DIGIT"; /*(Void.class)*/
+    /**
+     * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
+     * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
+     * use {@link Boolean#TRUE}.
+     */
+    DecodeHintType[DecodeHintType["ASSUME_GS1"] = 7] = "ASSUME_GS1"; /*(Void.class)*/
+    /**
+     * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
+     * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
+     * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
+     */
+    DecodeHintType[DecodeHintType["RETURN_CODABAR_START_END"] = 8] = "RETURN_CODABAR_START_END"; /*(Void.class)*/
+    /**
+     * The caller needs to be notified via callback when a possible {@link ResultPoint}
+     * is found. Maps to a {@link ResultPointCallback}.
+     */
+    DecodeHintType[DecodeHintType["NEED_RESULT_POINT_CALLBACK"] = 9] = "NEED_RESULT_POINT_CALLBACK"; /*(ResultPointCallback.class)*/
+    /**
+     * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
+     * Maps to an {@code Int32Array} of the allowed extension lengths, for example [2], [5], or [2, 5].
+     * If it is optional to have an extension, do not set this hint. If this is set,
+     * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
+     * at all.
+     */
+    DecodeHintType[DecodeHintType["ALLOWED_EAN_EXTENSIONS"] = 10] = "ALLOWED_EAN_EXTENSIONS"; /*(Int32Array.class)*/
+    // End of enumeration values.
+    /**
+     * Data type the hint is expecting.
+     * Among the possible values the {@link Void} stands out as being used for
+     * hints that do not expect a value to be supplied (flag hints). Such hints
+     * will possibly have their value ignored, or replaced by a
+     * {@link Boolean#TRUE}. Hint suppliers should probably use
+     * {@link Boolean#TRUE} as directed by the actual hint documentation.
+     */
+    // private valueType: Class<?>
+    // DecodeHintType(valueType: Class<?>) {
+    //   this.valueType = valueType
+    // }
+    // public getValueType(): Class<?> {
+    //   return valueType
+    // }
+})(DecodeHintType || (DecodeHintType = {}));
+exports.default = DecodeHintType;

+ 13 - 0
node_modules/@zxing/library/cjs/core/Dimension.d.ts

@@ -0,0 +1,13 @@
+/**
+ * Simply encapsulates a width and height.
+ */
+export default class Dimension {
+    private width;
+    private height;
+    constructor(width: number, height: number);
+    getWidth(): number;
+    getHeight(): number;
+    equals(other: any): boolean;
+    hashCode(): number;
+    toString(): string;
+}

+ 55 - 0
node_modules/@zxing/library/cjs/core/Dimension.js

@@ -0,0 +1,55 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+var IllegalArgumentException_1 = require("./IllegalArgumentException");
+/*namespace com.google.zxing {*/
+/**
+ * Simply encapsulates a width and height.
+ */
+var Dimension = /** @class */ (function () {
+    function Dimension(width /*int*/, height /*int*/) {
+        this.width = width;
+        this.height = height;
+        if (width < 0 || height < 0) {
+            throw new IllegalArgumentException_1.default();
+        }
+    }
+    Dimension.prototype.getWidth = function () {
+        return this.width;
+    };
+    Dimension.prototype.getHeight = function () {
+        return this.height;
+    };
+    /*@Override*/
+    Dimension.prototype.equals = function (other) {
+        if (other instanceof Dimension) {
+            var d = other;
+            return this.width === d.width && this.height === d.height;
+        }
+        return false;
+    };
+    /*@Override*/
+    Dimension.prototype.hashCode = function () {
+        return this.width * 32713 + this.height;
+    };
+    /*@Override*/
+    Dimension.prototype.toString = function () {
+        return this.width + 'x' + this.height;
+    };
+    return Dimension;
+}());
+exports.default = Dimension;

+ 99 - 0
node_modules/@zxing/library/cjs/core/EncodeHintType.d.ts

@@ -0,0 +1,99 @@
+/**
+ * These are a set of hints that you may pass to Writers to specify their behavior.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+declare enum EncodeHintType {
+    /**
+     * Specifies what degree of error correction to use, for example in QR Codes.
+     * Type depends on the encoder. For example for QR codes it's type
+     * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
+     * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
+     * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
+     * In all cases, it can also be a {@link String} representation of the desired value as well.
+     * Note: an Aztec symbol should have a minimum of 25% EC words.
+     */
+    ERROR_CORRECTION = 0,
+    /**
+     * Specifies what character encoding to use where applicable (type {@link String})
+     */
+    CHARACTER_SET = 1,
+    /**
+     * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
+     */
+    DATA_MATRIX_SHAPE = 2,
+    /**
+     * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
+     * {@link String } value).
+     * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
+     * character set via ECIs.
+     * Please note that in that case, the most compact character encoding is chosen for characters in
+     * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
+     * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
+     * means of the {@link #CHARACTER_SET} encoding hint.
+     * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
+     * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
+     * for the purpose of delimiting AIs.
+     * This option and {@link #FORCE_C40} are mutually exclusive.
+     */
+    DATA_MATRIX_COMPACT = 3,
+    /**
+     * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
+     *
+     * @deprecated use width/height params in
+     * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
+     */
+    MIN_SIZE = 4,
+    /**
+     * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
+     *
+     * @deprecated without replacement
+     */
+    MAX_SIZE = 5,
+    /**
+     * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
+     * by format; for example it controls margin before and after the barcode horizontally for
+     * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
+     */
+    MARGIN = 6,
+    /**
+     * Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or "true" or "false"
+     * {@link String} value).
+     */
+    PDF417_COMPACT = 7,
+    /**
+     * Specifies what compaction mode to use for PDF417 (type
+     * {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its
+     * enum values).
+     */
+    PDF417_COMPACTION = 8,
+    /**
+     * Specifies the minimum and maximum number of rows and columns for PDF417 (type
+     * {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
+     */
+    PDF417_DIMENSIONS = 9,
+    /**
+     * Specifies the required number of layers for an Aztec code.
+     * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
+     * 0 indicates to use the minimum number of layers (the default).
+     * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
+     * (Type {@link Integer}, or {@link String} representation of the integer value).
+     */
+    AZTEC_LAYERS = 10,
+    /**
+     * Specifies the exact version of QR code to be encoded.
+     * (Type {@link Integer}, or {@link String} representation of the integer value).
+     */
+    QR_VERSION = 11,
+    /**
+     * Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or "true" or "false"
+     * {@link String } value).
+     */
+    GS1_FORMAT = 12,
+    /**
+     * Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This
+     * option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
+     */
+    FORCE_C40 = 13
+}
+export default EncodeHintType;

+ 120 - 0
node_modules/@zxing/library/cjs/core/EncodeHintType.js

@@ -0,0 +1,120 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+/*namespace com.google.zxing {*/
+/**
+ * These are a set of hints that you may pass to Writers to specify their behavior.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+var EncodeHintType;
+(function (EncodeHintType) {
+    /**
+     * Specifies what degree of error correction to use, for example in QR Codes.
+     * Type depends on the encoder. For example for QR codes it's type
+     * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
+     * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
+     * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
+     * In all cases, it can also be a {@link String} representation of the desired value as well.
+     * Note: an Aztec symbol should have a minimum of 25% EC words.
+     */
+    EncodeHintType[EncodeHintType["ERROR_CORRECTION"] = 0] = "ERROR_CORRECTION";
+    /**
+     * Specifies what character encoding to use where applicable (type {@link String})
+     */
+    EncodeHintType[EncodeHintType["CHARACTER_SET"] = 1] = "CHARACTER_SET";
+    /**
+     * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
+     */
+    EncodeHintType[EncodeHintType["DATA_MATRIX_SHAPE"] = 2] = "DATA_MATRIX_SHAPE";
+    /**
+     * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
+     * {@link String } value).
+     * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
+     * character set via ECIs.
+     * Please note that in that case, the most compact character encoding is chosen for characters in
+     * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
+     * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
+     * means of the {@link #CHARACTER_SET} encoding hint.
+     * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
+     * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
+     * for the purpose of delimiting AIs.
+     * This option and {@link #FORCE_C40} are mutually exclusive.
+     */
+    EncodeHintType[EncodeHintType["DATA_MATRIX_COMPACT"] = 3] = "DATA_MATRIX_COMPACT";
+    /**
+     * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
+     *
+     * @deprecated use width/height params in
+     * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
+     */
+    /*@Deprecated*/
+    EncodeHintType[EncodeHintType["MIN_SIZE"] = 4] = "MIN_SIZE";
+    /**
+     * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
+     *
+     * @deprecated without replacement
+     */
+    /*@Deprecated*/
+    EncodeHintType[EncodeHintType["MAX_SIZE"] = 5] = "MAX_SIZE";
+    /**
+     * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
+     * by format; for example it controls margin before and after the barcode horizontally for
+     * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
+     */
+    EncodeHintType[EncodeHintType["MARGIN"] = 6] = "MARGIN";
+    /**
+     * Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or "true" or "false"
+     * {@link String} value).
+     */
+    EncodeHintType[EncodeHintType["PDF417_COMPACT"] = 7] = "PDF417_COMPACT";
+    /**
+     * Specifies what compaction mode to use for PDF417 (type
+     * {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its
+     * enum values).
+     */
+    EncodeHintType[EncodeHintType["PDF417_COMPACTION"] = 8] = "PDF417_COMPACTION";
+    /**
+     * Specifies the minimum and maximum number of rows and columns for PDF417 (type
+     * {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
+     */
+    EncodeHintType[EncodeHintType["PDF417_DIMENSIONS"] = 9] = "PDF417_DIMENSIONS";
+    /**
+     * Specifies the required number of layers for an Aztec code.
+     * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
+     * 0 indicates to use the minimum number of layers (the default).
+     * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
+     * (Type {@link Integer}, or {@link String} representation of the integer value).
+     */
+    EncodeHintType[EncodeHintType["AZTEC_LAYERS"] = 10] = "AZTEC_LAYERS";
+    /**
+     * Specifies the exact version of QR code to be encoded.
+     * (Type {@link Integer}, or {@link String} representation of the integer value).
+     */
+    EncodeHintType[EncodeHintType["QR_VERSION"] = 11] = "QR_VERSION";
+    /**
+     * Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or "true" or "false"
+     * {@link String } value).
+     */
+    EncodeHintType[EncodeHintType["GS1_FORMAT"] = 12] = "GS1_FORMAT";
+    /**
+     * Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This
+     * option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
+     */
+    EncodeHintType[EncodeHintType["FORCE_C40"] = 13] = "FORCE_C40";
+})(EncodeHintType || (EncodeHintType = {}));
+exports.default = EncodeHintType;

+ 17 - 0
node_modules/@zxing/library/cjs/core/Exception.d.ts

@@ -0,0 +1,17 @@
+import { CustomError } from 'ts-custom-error';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class Exception extends CustomError {
+    message: string;
+    /**
+     * It's typed as string so it can be extended and overriden.
+     */
+    static readonly kind: string;
+    /**
+     * Allows Exception to be constructed directly
+     * with some message and prototype definition.
+     */
+    constructor(message?: string);
+    getKind(): string;
+}

+ 42 - 0
node_modules/@zxing/library/cjs/core/Exception.js

@@ -0,0 +1,42 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var ts_custom_error_1 = require("ts-custom-error");
+/**
+ * Custom Error class of type Exception.
+ */
+var Exception = /** @class */ (function (_super) {
+    __extends(Exception, _super);
+    /**
+     * Allows Exception to be constructed directly
+     * with some message and prototype definition.
+     */
+    function Exception(message) {
+        if (message === void 0) { message = undefined; }
+        var _this = _super.call(this, message) || this;
+        _this.message = message;
+        return _this;
+    }
+    Exception.prototype.getKind = function () {
+        var ex = this.constructor;
+        return ex.kind;
+    };
+    /**
+     * It's typed as string so it can be extended and overriden.
+     */
+    Exception.kind = 'Exception';
+    return Exception;
+}(ts_custom_error_1.CustomError));
+exports.default = Exception;

+ 8 - 0
node_modules/@zxing/library/cjs/core/FormatException.d.ts

@@ -0,0 +1,8 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class FormatException extends Exception {
+    static readonly kind: string;
+    static getFormatInstance(): FormatException;
+}

+ 31 - 0
node_modules/@zxing/library/cjs/core/FormatException.js

@@ -0,0 +1,31 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var FormatException = /** @class */ (function (_super) {
+    __extends(FormatException, _super);
+    function FormatException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    FormatException.getFormatInstance = function () {
+        return new FormatException();
+    };
+    FormatException.kind = 'FormatException';
+    return FormatException;
+}(Exception_1.default));
+exports.default = FormatException;

+ 7 - 0
node_modules/@zxing/library/cjs/core/IllegalArgumentException.d.ts

@@ -0,0 +1,7 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class IllegalArgumentException extends Exception {
+    static readonly kind: string;
+}

+ 28 - 0
node_modules/@zxing/library/cjs/core/IllegalArgumentException.js

@@ -0,0 +1,28 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var IllegalArgumentException = /** @class */ (function (_super) {
+    __extends(IllegalArgumentException, _super);
+    function IllegalArgumentException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    IllegalArgumentException.kind = 'IllegalArgumentException';
+    return IllegalArgumentException;
+}(Exception_1.default));
+exports.default = IllegalArgumentException;

+ 7 - 0
node_modules/@zxing/library/cjs/core/IllegalStateException.d.ts

@@ -0,0 +1,7 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class IllegalStateException extends Exception {
+    static readonly kind: string;
+}

+ 28 - 0
node_modules/@zxing/library/cjs/core/IllegalStateException.js

@@ -0,0 +1,28 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var IllegalStateException = /** @class */ (function (_super) {
+    __extends(IllegalStateException, _super);
+    function IllegalStateException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    IllegalStateException.kind = 'IllegalStateException';
+    return IllegalStateException;
+}(Exception_1.default));
+exports.default = IllegalStateException;

+ 7 - 0
node_modules/@zxing/library/cjs/core/IndexOutOfBoundsException.d.ts

@@ -0,0 +1,7 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class IndexOutOfBoundsException extends Exception {
+    static readonly kind: string;
+}

+ 28 - 0
node_modules/@zxing/library/cjs/core/IndexOutOfBoundsException.js

@@ -0,0 +1,28 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var IndexOutOfBoundsException = /** @class */ (function (_super) {
+    __extends(IndexOutOfBoundsException, _super);
+    function IndexOutOfBoundsException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    IndexOutOfBoundsException.kind = 'IndexOutOfBoundsException';
+    return IndexOutOfBoundsException;
+}(Exception_1.default));
+exports.default = IndexOutOfBoundsException;

+ 22 - 0
node_modules/@zxing/library/cjs/core/InvertedLuminanceSource.d.ts

@@ -0,0 +1,22 @@
+import LuminanceSource from './LuminanceSource';
+/**
+ * A wrapper implementation of {@link LuminanceSource} which inverts the luminances it returns -- black becomes
+ * white and vice versa, and each value becomes (255-value).
+ *
+ * @author Sean Owen
+ */
+export default class InvertedLuminanceSource extends LuminanceSource {
+    private delegate;
+    constructor(delegate: LuminanceSource);
+    getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
+    getMatrix(): Uint8ClampedArray;
+    isCropSupported(): boolean;
+    crop(left: number, top: number, width: number, height: number): LuminanceSource;
+    isRotateSupported(): boolean;
+    /**
+     * @return original delegate {@link LuminanceSource} since invert undoes itself
+     */
+    invert(): LuminanceSource;
+    rotateCounterClockwise(): LuminanceSource;
+    rotateCounterClockwise45(): LuminanceSource;
+}

+ 94 - 0
node_modules/@zxing/library/cjs/core/InvertedLuminanceSource.js

@@ -0,0 +1,94 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var LuminanceSource_1 = require("./LuminanceSource");
+/*namespace com.google.zxing {*/
+/**
+ * A wrapper implementation of {@link LuminanceSource} which inverts the luminances it returns -- black becomes
+ * white and vice versa, and each value becomes (255-value).
+ *
+ * @author Sean Owen
+ */
+var InvertedLuminanceSource = /** @class */ (function (_super) {
+    __extends(InvertedLuminanceSource, _super);
+    function InvertedLuminanceSource(delegate) {
+        var _this = _super.call(this, delegate.getWidth(), delegate.getHeight()) || this;
+        _this.delegate = delegate;
+        return _this;
+    }
+    /*@Override*/
+    InvertedLuminanceSource.prototype.getRow = function (y /*int*/, row) {
+        var sourceRow = this.delegate.getRow(y, row);
+        var width = this.getWidth();
+        for (var i = 0; i < width; i++) {
+            sourceRow[i] = /*(byte)*/ (255 - (sourceRow[i] & 0xFF));
+        }
+        return sourceRow;
+    };
+    /*@Override*/
+    InvertedLuminanceSource.prototype.getMatrix = function () {
+        var matrix = this.delegate.getMatrix();
+        var length = this.getWidth() * this.getHeight();
+        var invertedMatrix = new Uint8ClampedArray(length);
+        for (var i = 0; i < length; i++) {
+            invertedMatrix[i] = /*(byte)*/ (255 - (matrix[i] & 0xFF));
+        }
+        return invertedMatrix;
+    };
+    /*@Override*/
+    InvertedLuminanceSource.prototype.isCropSupported = function () {
+        return this.delegate.isCropSupported();
+    };
+    /*@Override*/
+    InvertedLuminanceSource.prototype.crop = function (left /*int*/, top /*int*/, width /*int*/, height /*int*/) {
+        return new InvertedLuminanceSource(this.delegate.crop(left, top, width, height));
+    };
+    /*@Override*/
+    InvertedLuminanceSource.prototype.isRotateSupported = function () {
+        return this.delegate.isRotateSupported();
+    };
+    /**
+     * @return original delegate {@link LuminanceSource} since invert undoes itself
+     */
+    /*@Override*/
+    InvertedLuminanceSource.prototype.invert = function () {
+        return this.delegate;
+    };
+    /*@Override*/
+    InvertedLuminanceSource.prototype.rotateCounterClockwise = function () {
+        return new InvertedLuminanceSource(this.delegate.rotateCounterClockwise());
+    };
+    /*@Override*/
+    InvertedLuminanceSource.prototype.rotateCounterClockwise45 = function () {
+        return new InvertedLuminanceSource(this.delegate.rotateCounterClockwise45());
+    };
+    return InvertedLuminanceSource;
+}(LuminanceSource_1.default));
+exports.default = InvertedLuminanceSource;

+ 84 - 0
node_modules/@zxing/library/cjs/core/LuminanceSource.d.ts

@@ -0,0 +1,84 @@
+/**
+ * The purpose of this class hierarchy is to abstract different bitmap implementations across
+ * platforms into a standard interface for requesting greyscale luminance values. The interface
+ * only provides immutable methods; therefore crop and rotation create copies. This is to ensure
+ * that one Reader does not modify the original luminance source and leave it in an unknown state
+ * for other Readers in the chain.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+declare abstract class LuminanceSource {
+    private width;
+    private height;
+    protected constructor(width: number, height: number);
+    /**
+     * Fetches one row of luminance data from the underlying platform's bitmap. Values range from
+     * 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have
+     * to bitwise and with 0xff for each value. It is preferable for implementations of this method
+     * to only fetch this row rather than the whole image, since no 2D Readers may be installed and
+     * getMatrix() may never be called.
+     *
+     * @param y The row to fetch, which must be in [0,getHeight())
+     * @param row An optional preallocated array. If null or too small, it will be ignored.
+     *            Always use the returned object, and ignore the .length of the array.
+     * @return An array containing the luminance data.
+     */
+    abstract getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
+    /**
+     * Fetches luminance data for the underlying bitmap. Values should be fetched using:
+     * {@code int luminance = array[y * width + x] & 0xff}
+     *
+     * @return A row-major 2D array of luminance values. Do not use result.length as it may be
+     *         larger than width * height bytes on some platforms. Do not modify the contents
+     *         of the result.
+     */
+    abstract getMatrix(): Uint8ClampedArray;
+    /**
+     * @return The width of the bitmap.
+     */
+    getWidth(): number;
+    /**
+     * @return The height of the bitmap.
+     */
+    getHeight(): number;
+    /**
+     * @return Whether this subclass supports cropping.
+     */
+    isCropSupported(): boolean;
+    /**
+     * Returns a new object with cropped image data. Implementations may keep a reference to the
+     * original data rather than a copy. Only callable if isCropSupported() is true.
+     *
+     * @param left The left coordinate, which must be in [0,getWidth())
+     * @param top The top coordinate, which must be in [0,getHeight())
+     * @param width The width of the rectangle to crop.
+     * @param height The height of the rectangle to crop.
+     * @return A cropped version of this object.
+     */
+    crop(left: number, top: number, width: number, height: number): LuminanceSource;
+    /**
+     * @return Whether this subclass supports counter-clockwise rotation.
+     */
+    isRotateSupported(): boolean;
+    /**
+     * @return a wrapper of this {@code LuminanceSource} which inverts the luminances it returns -- black becomes
+     *  white and vice versa, and each value becomes (255-value).
+     */
+    abstract invert(): LuminanceSource;
+    /**
+     * Returns a new object with rotated image data by 90 degrees counterclockwise.
+     * Only callable if {@link #isRotateSupported()} is true.
+     *
+     * @return A rotated version of this object.
+     */
+    rotateCounterClockwise(): LuminanceSource;
+    /**
+     * Returns a new object with rotated image data by 45 degrees counterclockwise.
+     * Only callable if {@link #isRotateSupported()} is true.
+     *
+     * @return A rotated version of this object.
+     */
+    rotateCounterClockwise45(): LuminanceSource;
+    toString(): string;
+}
+export default LuminanceSource;

+ 119 - 0
node_modules/@zxing/library/cjs/core/LuminanceSource.js

@@ -0,0 +1,119 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+var StringBuilder_1 = require("./util/StringBuilder");
+var UnsupportedOperationException_1 = require("./UnsupportedOperationException");
+/*namespace com.google.zxing {*/
+/**
+ * The purpose of this class hierarchy is to abstract different bitmap implementations across
+ * platforms into a standard interface for requesting greyscale luminance values. The interface
+ * only provides immutable methods; therefore crop and rotation create copies. This is to ensure
+ * that one Reader does not modify the original luminance source and leave it in an unknown state
+ * for other Readers in the chain.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+var LuminanceSource = /** @class */ (function () {
+    function LuminanceSource(width /*int*/, height /*int*/) {
+        this.width = width;
+        this.height = height;
+    }
+    /**
+     * @return The width of the bitmap.
+     */
+    LuminanceSource.prototype.getWidth = function () {
+        return this.width;
+    };
+    /**
+     * @return The height of the bitmap.
+     */
+    LuminanceSource.prototype.getHeight = function () {
+        return this.height;
+    };
+    /**
+     * @return Whether this subclass supports cropping.
+     */
+    LuminanceSource.prototype.isCropSupported = function () {
+        return false;
+    };
+    /**
+     * Returns a new object with cropped image data. Implementations may keep a reference to the
+     * original data rather than a copy. Only callable if isCropSupported() is true.
+     *
+     * @param left The left coordinate, which must be in [0,getWidth())
+     * @param top The top coordinate, which must be in [0,getHeight())
+     * @param width The width of the rectangle to crop.
+     * @param height The height of the rectangle to crop.
+     * @return A cropped version of this object.
+     */
+    LuminanceSource.prototype.crop = function (left /*int*/, top /*int*/, width /*int*/, height /*int*/) {
+        throw new UnsupportedOperationException_1.default('This luminance source does not support cropping.');
+    };
+    /**
+     * @return Whether this subclass supports counter-clockwise rotation.
+     */
+    LuminanceSource.prototype.isRotateSupported = function () {
+        return false;
+    };
+    /**
+     * Returns a new object with rotated image data by 90 degrees counterclockwise.
+     * Only callable if {@link #isRotateSupported()} is true.
+     *
+     * @return A rotated version of this object.
+     */
+    LuminanceSource.prototype.rotateCounterClockwise = function () {
+        throw new UnsupportedOperationException_1.default('This luminance source does not support rotation by 90 degrees.');
+    };
+    /**
+     * Returns a new object with rotated image data by 45 degrees counterclockwise.
+     * Only callable if {@link #isRotateSupported()} is true.
+     *
+     * @return A rotated version of this object.
+     */
+    LuminanceSource.prototype.rotateCounterClockwise45 = function () {
+        throw new UnsupportedOperationException_1.default('This luminance source does not support rotation by 45 degrees.');
+    };
+    /*@Override*/
+    LuminanceSource.prototype.toString = function () {
+        var row = new Uint8ClampedArray(this.width);
+        var result = new StringBuilder_1.default();
+        for (var y = 0; y < this.height; y++) {
+            var sourceRow = this.getRow(y, row);
+            for (var x = 0; x < this.width; x++) {
+                var luminance = sourceRow[x] & 0xFF;
+                var c = void 0;
+                if (luminance < 0x40) {
+                    c = '#';
+                }
+                else if (luminance < 0x80) {
+                    c = '+';
+                }
+                else if (luminance < 0xC0) {
+                    c = '.';
+                }
+                else {
+                    c = ' ';
+                }
+                result.append(c);
+            }
+            result.append('\n');
+        }
+        return result.toString();
+    };
+    return LuminanceSource;
+}());
+exports.default = LuminanceSource;

+ 59 - 0
node_modules/@zxing/library/cjs/core/MultiFormatReader.d.ts

@@ -0,0 +1,59 @@
+import DecodeHintType from './DecodeHintType';
+import Reader from './Reader';
+import Result from './Result';
+import BinaryBitmap from './BinaryBitmap';
+/**
+ * MultiFormatReader is a convenience class and the main entry point into the library for most uses.
+ * By default it attempts to decode all barcode formats that the library supports. Optionally, you
+ * can provide a hints object to request different behavior, for example only decoding QR codes.
+ *
+ * @author Sean Owen
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+export default class MultiFormatReader implements Reader {
+    private hints;
+    private readers;
+    /**
+     * This version of decode honors the intent of Reader.decode(BinaryBitmap) in that it
+     * passes null as a hint to the decoders. However, that makes it inefficient to call repeatedly.
+     * Use setHints() followed by decodeWithState() for continuous scan applications.
+     *
+     * @param image The pixel data to decode
+     * @return The contents of the image
+     *
+     * @throws NotFoundException Any errors which occurred
+     */
+    /**
+     * Decode an image using the hints provided. Does not honor existing state.
+     *
+     * @param image The pixel data to decode
+     * @param hints The hints to use, clearing the previous state.
+     * @return The contents of the image
+     *
+     * @throws NotFoundException Any errors which occurred
+     */
+    decode(image: BinaryBitmap, hints?: Map<DecodeHintType, any>): Result;
+    /**
+     * Decode an image using the state set up by calling setHints() previously. Continuous scan
+     * clients will get a <b>large</b> speed increase by using this instead of decode().
+     *
+     * @param image The pixel data to decode
+     * @return The contents of the image
+     *
+     * @throws NotFoundException Any errors which occurred
+     */
+    decodeWithState(image: BinaryBitmap): Result;
+    /**
+     * This method adds state to the MultiFormatReader. By setting the hints once, subsequent calls
+     * to decodeWithState(image) can reuse the same set of readers without reallocating memory. This
+     * is important for performance in continuous scan clients.
+     *
+     * @param hints The set of hints to use for subsequent calls to decode(image)
+     */
+    setHints(hints?: Map<DecodeHintType, any> | null): void;
+    reset(): void;
+    /**
+     * @throws NotFoundException
+     */
+    private decodeInternal;
+}

+ 215 - 0
node_modules/@zxing/library/cjs/core/MultiFormatReader.js

@@ -0,0 +1,215 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var __values = (this && this.__values) || function(o) {
+    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
+    if (m) return m.call(o);
+    if (o && typeof o.length === "number") return {
+        next: function () {
+            if (o && i >= o.length) o = void 0;
+            return { value: o && o[i++], done: !o };
+        }
+    };
+    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var DecodeHintType_1 = require("./DecodeHintType");
+var BarcodeFormat_1 = require("./BarcodeFormat");
+var QRCodeReader_1 = require("./qrcode/QRCodeReader");
+var AztecReader_1 = require("./aztec/AztecReader");
+var MultiFormatOneDReader_1 = require("./oned/MultiFormatOneDReader");
+var DataMatrixReader_1 = require("./datamatrix/DataMatrixReader");
+var NotFoundException_1 = require("./NotFoundException");
+var PDF417Reader_1 = require("./pdf417/PDF417Reader");
+var ReaderException_1 = require("./ReaderException");
+/*namespace com.google.zxing {*/
+/**
+ * MultiFormatReader is a convenience class and the main entry point into the library for most uses.
+ * By default it attempts to decode all barcode formats that the library supports. Optionally, you
+ * can provide a hints object to request different behavior, for example only decoding QR codes.
+ *
+ * @author Sean Owen
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+var MultiFormatReader = /** @class */ (function () {
+    function MultiFormatReader() {
+    }
+    /**
+     * This version of decode honors the intent of Reader.decode(BinaryBitmap) in that it
+     * passes null as a hint to the decoders. However, that makes it inefficient to call repeatedly.
+     * Use setHints() followed by decodeWithState() for continuous scan applications.
+     *
+     * @param image The pixel data to decode
+     * @return The contents of the image
+     *
+     * @throws NotFoundException Any errors which occurred
+     */
+    /*@Override*/
+    // public decode(image: BinaryBitmap): Result {
+    //   setHints(null)
+    //   return decodeInternal(image)
+    // }
+    /**
+     * Decode an image using the hints provided. Does not honor existing state.
+     *
+     * @param image The pixel data to decode
+     * @param hints The hints to use, clearing the previous state.
+     * @return The contents of the image
+     *
+     * @throws NotFoundException Any errors which occurred
+     */
+    /*@Override*/
+    MultiFormatReader.prototype.decode = function (image, hints) {
+        this.setHints(hints);
+        return this.decodeInternal(image);
+    };
+    /**
+     * Decode an image using the state set up by calling setHints() previously. Continuous scan
+     * clients will get a <b>large</b> speed increase by using this instead of decode().
+     *
+     * @param image The pixel data to decode
+     * @return The contents of the image
+     *
+     * @throws NotFoundException Any errors which occurred
+     */
+    MultiFormatReader.prototype.decodeWithState = function (image) {
+        // Make sure to set up the default state so we don't crash
+        if (this.readers === null || this.readers === undefined) {
+            this.setHints(null);
+        }
+        return this.decodeInternal(image);
+    };
+    /**
+     * This method adds state to the MultiFormatReader. By setting the hints once, subsequent calls
+     * to decodeWithState(image) can reuse the same set of readers without reallocating memory. This
+     * is important for performance in continuous scan clients.
+     *
+     * @param hints The set of hints to use for subsequent calls to decode(image)
+     */
+    MultiFormatReader.prototype.setHints = function (hints) {
+        this.hints = hints;
+        var tryHarder = hints !== null && hints !== undefined && undefined !== hints.get(DecodeHintType_1.default.TRY_HARDER);
+        /*@SuppressWarnings("unchecked")*/
+        var formats = hints === null || hints === undefined ? null : hints.get(DecodeHintType_1.default.POSSIBLE_FORMATS);
+        var readers = new Array();
+        if (formats !== null && formats !== undefined) {
+            var addOneDReader = formats.some(function (f) {
+                return f === BarcodeFormat_1.default.UPC_A ||
+                    f === BarcodeFormat_1.default.UPC_E ||
+                    f === BarcodeFormat_1.default.EAN_13 ||
+                    f === BarcodeFormat_1.default.EAN_8 ||
+                    f === BarcodeFormat_1.default.CODABAR ||
+                    f === BarcodeFormat_1.default.CODE_39 ||
+                    f === BarcodeFormat_1.default.CODE_93 ||
+                    f === BarcodeFormat_1.default.CODE_128 ||
+                    f === BarcodeFormat_1.default.ITF ||
+                    f === BarcodeFormat_1.default.RSS_14 ||
+                    f === BarcodeFormat_1.default.RSS_EXPANDED;
+            });
+            // Put 1D readers upfront in "normal" mode
+            // TYPESCRIPTPORT: TODO: uncomment below as they are ported
+            if (addOneDReader && !tryHarder) {
+                readers.push(new MultiFormatOneDReader_1.default(hints));
+            }
+            if (formats.includes(BarcodeFormat_1.default.QR_CODE)) {
+                readers.push(new QRCodeReader_1.default());
+            }
+            if (formats.includes(BarcodeFormat_1.default.DATA_MATRIX)) {
+                readers.push(new DataMatrixReader_1.default());
+            }
+            if (formats.includes(BarcodeFormat_1.default.AZTEC)) {
+                readers.push(new AztecReader_1.default());
+            }
+            if (formats.includes(BarcodeFormat_1.default.PDF_417)) {
+                readers.push(new PDF417Reader_1.default());
+            }
+            // if (formats.includes(BarcodeFormat.MAXICODE)) {
+            //    readers.push(new MaxiCodeReader())
+            // }
+            // At end in "try harder" mode
+            if (addOneDReader && tryHarder) {
+                readers.push(new MultiFormatOneDReader_1.default(hints));
+            }
+        }
+        if (readers.length === 0) {
+            if (!tryHarder) {
+                readers.push(new MultiFormatOneDReader_1.default(hints));
+            }
+            readers.push(new QRCodeReader_1.default());
+            readers.push(new DataMatrixReader_1.default());
+            readers.push(new AztecReader_1.default());
+            readers.push(new PDF417Reader_1.default());
+            // readers.push(new MaxiCodeReader())
+            if (tryHarder) {
+                readers.push(new MultiFormatOneDReader_1.default(hints));
+            }
+        }
+        this.readers = readers; // .toArray(new Reader[readers.size()])
+    };
+    /*@Override*/
+    MultiFormatReader.prototype.reset = function () {
+        var e_1, _a;
+        if (this.readers !== null) {
+            try {
+                for (var _b = __values(this.readers), _c = _b.next(); !_c.done; _c = _b.next()) {
+                    var reader = _c.value;
+                    reader.reset();
+                }
+            }
+            catch (e_1_1) { e_1 = { error: e_1_1 }; }
+            finally {
+                try {
+                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
+                }
+                finally { if (e_1) throw e_1.error; }
+            }
+        }
+    };
+    /**
+     * @throws NotFoundException
+     */
+    MultiFormatReader.prototype.decodeInternal = function (image) {
+        var e_2, _a;
+        if (this.readers === null) {
+            throw new ReaderException_1.default('No readers where selected, nothing can be read.');
+        }
+        try {
+            for (var _b = __values(this.readers), _c = _b.next(); !_c.done; _c = _b.next()) {
+                var reader = _c.value;
+                // Trying to decode with ${reader} reader.
+                try {
+                    return reader.decode(image, this.hints);
+                }
+                catch (ex) {
+                    if (ex instanceof ReaderException_1.default) {
+                        continue;
+                    }
+                    // Bad Exception.
+                }
+            }
+        }
+        catch (e_2_1) { e_2 = { error: e_2_1 }; }
+        finally {
+            try {
+                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
+            }
+            finally { if (e_2) throw e_2.error; }
+        }
+        throw new NotFoundException_1.default('No MultiFormat Readers were able to detect the code.');
+    };
+    return MultiFormatReader;
+}());
+exports.default = MultiFormatReader;

+ 13 - 0
node_modules/@zxing/library/cjs/core/MultiFormatWriter.d.ts

@@ -0,0 +1,13 @@
+import BitMatrix from './common/BitMatrix';
+import Writer from './Writer';
+import BarcodeFormat from './BarcodeFormat';
+import EncodeHintType from './EncodeHintType';
+/**
+ * This is a factory class which finds the appropriate Writer subclass for the BarcodeFormat
+ * requested and encodes the barcode with the supplied contents.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+export default class MultiFormatWriter implements Writer {
+    encode(contents: string, format: BarcodeFormat, width: number, height: number, hints: Map<EncodeHintType, any>): BitMatrix;
+}

+ 99 - 0
node_modules/@zxing/library/cjs/core/MultiFormatWriter.js

@@ -0,0 +1,99 @@
+"use strict";
+/*
+ * Copyright 2008 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+// import DataMatrixWriter from './datamatrix/DataMatrixWriter'
+// import CodaBarWriter from './oned/CodaBarWriter'
+// import Code128Writer from './oned/Code128Writer'
+// import Code39Writer from './oned/Code39Writer'
+// import Code93Writer from './oned/Code93Writer'
+// import EAN13Writer from './oned/EAN13Writer'
+// import EAN8Writer from './oned/EAN8Writer'
+// import ITFWriter from './oned/ITFWriter'
+// import UPCAWriter from './oned/UPCAWriter'
+// import UPCEWriter from './oned/UPCEWriter'
+// import PDF417Writer from './pdf417/PDF417Writer'
+var QRCodeWriter_1 = require("./qrcode/QRCodeWriter");
+var BarcodeFormat_1 = require("./BarcodeFormat");
+var IllegalArgumentException_1 = require("./IllegalArgumentException");
+/*import java.util.Map;*/
+/**
+ * This is a factory class which finds the appropriate Writer subclass for the BarcodeFormat
+ * requested and encodes the barcode with the supplied contents.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+var MultiFormatWriter = /** @class */ (function () {
+    function MultiFormatWriter() {
+    }
+    /*@Override*/
+    // public encode(contents: string,
+    //                         format: BarcodeFormat,
+    //                         width: number /*int*/,
+    //                         height: number /*int*/): BitMatrix /*throws WriterException */ {
+    //   return encode(contents, format, width, height, null)
+    // }
+    /*@Override*/
+    MultiFormatWriter.prototype.encode = function (contents, format, width /*int*/, height /*int*/, hints) {
+        var writer;
+        switch (format) {
+            // case BarcodeFormat.EAN_8:
+            //   writer = new EAN8Writer()
+            //   break
+            // case BarcodeFormat.UPC_E:
+            //   writer = new UPCEWriter()
+            //   break
+            // case BarcodeFormat.EAN_13:
+            //   writer = new EAN13Writer()
+            //   break
+            // case BarcodeFormat.UPC_A:
+            //   writer = new UPCAWriter()
+            //   break
+            case BarcodeFormat_1.default.QR_CODE:
+                writer = new QRCodeWriter_1.default();
+                break;
+            // case BarcodeFormat.CODE_39:
+            //   writer = new Code39Writer()
+            //   break
+            // case BarcodeFormat.CODE_93:
+            //   writer = new Code93Writer()
+            //   break
+            // case BarcodeFormat.CODE_128:
+            //   writer = new Code128Writer()
+            //   break
+            // case BarcodeFormat.ITF:
+            //   writer = new ITFWriter()
+            //   break
+            // case BarcodeFormat.PDF_417:
+            //   writer = new PDF417Writer()
+            //   break
+            // case BarcodeFormat.CODABAR:
+            //   writer = new CodaBarWriter()
+            //   break
+            // case BarcodeFormat.DATA_MATRIX:
+            //   writer = new DataMatrixWriter()
+            //   break
+            // case BarcodeFormat.AZTEC:
+            //   writer = new AztecWriter()
+            //   break
+            default:
+                throw new IllegalArgumentException_1.default('No encoder available for format ' + format);
+        }
+        return writer.encode(contents, format, width, height, hints);
+    };
+    return MultiFormatWriter;
+}());
+exports.default = MultiFormatWriter;

+ 8 - 0
node_modules/@zxing/library/cjs/core/NotFoundException.d.ts

@@ -0,0 +1,8 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class NotFoundException extends Exception {
+    static readonly kind: string;
+    static getNotFoundInstance(): NotFoundException;
+}

+ 31 - 0
node_modules/@zxing/library/cjs/core/NotFoundException.js

@@ -0,0 +1,31 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var NotFoundException = /** @class */ (function (_super) {
+    __extends(NotFoundException, _super);
+    function NotFoundException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    NotFoundException.getNotFoundInstance = function () {
+        return new NotFoundException();
+    };
+    NotFoundException.kind = 'NotFoundException';
+    return NotFoundException;
+}(Exception_1.default));
+exports.default = NotFoundException;

+ 7 - 0
node_modules/@zxing/library/cjs/core/NullPointerException.d.ts

@@ -0,0 +1,7 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class NullPointerException extends Exception {
+    static readonly kind: string;
+}

+ 28 - 0
node_modules/@zxing/library/cjs/core/NullPointerException.js

@@ -0,0 +1,28 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var NullPointerException = /** @class */ (function (_super) {
+    __extends(NullPointerException, _super);
+    function NullPointerException() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    NullPointerException.kind = 'NullPointerException';
+    return NullPointerException;
+}(Exception_1.default));
+exports.default = NullPointerException;

+ 6 - 0
node_modules/@zxing/library/cjs/core/OutOfMemoryError.d.ts

@@ -0,0 +1,6 @@
+import Exception from './Exception';
+/**
+ * Custom Error class of type Exception.
+ */
+export default class OutOfMemoryError extends Exception {
+}

+ 27 - 0
node_modules/@zxing/library/cjs/core/OutOfMemoryError.js

@@ -0,0 +1,27 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Exception_1 = require("./Exception");
+/**
+ * Custom Error class of type Exception.
+ */
+var OutOfMemoryError = /** @class */ (function (_super) {
+    __extends(OutOfMemoryError, _super);
+    function OutOfMemoryError() {
+        return _super !== null && _super.apply(this, arguments) || this;
+    }
+    return OutOfMemoryError;
+}(Exception_1.default));
+exports.default = OutOfMemoryError;

+ 35 - 0
node_modules/@zxing/library/cjs/core/PlanarYUVLuminanceSource.d.ts

@@ -0,0 +1,35 @@
+import LuminanceSource from './LuminanceSource';
+/**
+ * This object extends LuminanceSource around an array of YUV data returned from the camera driver,
+ * with the option to crop to a rectangle within the full data. This can be used to exclude
+ * superfluous pixels around the perimeter and speed up decoding.
+ *
+ * It works for any pixel format where the Y channel is planar and appears first, including
+ * YCbCr_420_SP and YCbCr_422_SP.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+export default class PlanarYUVLuminanceSource extends LuminanceSource {
+    private yuvData;
+    private dataWidth;
+    private dataHeight;
+    private left;
+    private top;
+    private static THUMBNAIL_SCALE_FACTOR;
+    constructor(yuvData: Uint8ClampedArray, dataWidth: number, dataHeight: number, left: number, top: number, width: number, height: number, reverseHorizontal: boolean);
+    getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
+    getMatrix(): Uint8ClampedArray;
+    isCropSupported(): boolean;
+    crop(left: number, top: number, width: number, height: number): LuminanceSource;
+    renderThumbnail(): Int32Array;
+    /**
+     * @return width of image from {@link #renderThumbnail()}
+     */
+    getThumbnailWidth(): number;
+    /**
+     * @return height of image from {@link #renderThumbnail()}
+     */
+    getThumbnailHeight(): number;
+    private reverseHorizontal;
+    invert(): LuminanceSource;
+}

+ 154 - 0
node_modules/@zxing/library/cjs/core/PlanarYUVLuminanceSource.js

@@ -0,0 +1,154 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+/*namespace com.google.zxing {*/
+var System_1 = require("./util/System");
+var LuminanceSource_1 = require("./LuminanceSource");
+var InvertedLuminanceSource_1 = require("./InvertedLuminanceSource");
+var IllegalArgumentException_1 = require("./IllegalArgumentException");
+/**
+ * This object extends LuminanceSource around an array of YUV data returned from the camera driver,
+ * with the option to crop to a rectangle within the full data. This can be used to exclude
+ * superfluous pixels around the perimeter and speed up decoding.
+ *
+ * It works for any pixel format where the Y channel is planar and appears first, including
+ * YCbCr_420_SP and YCbCr_422_SP.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+var PlanarYUVLuminanceSource = /** @class */ (function (_super) {
+    __extends(PlanarYUVLuminanceSource, _super);
+    function PlanarYUVLuminanceSource(yuvData, dataWidth /*int*/, dataHeight /*int*/, left /*int*/, top /*int*/, width /*int*/, height /*int*/, reverseHorizontal) {
+        var _this = _super.call(this, width, height) || this;
+        _this.yuvData = yuvData;
+        _this.dataWidth = dataWidth;
+        _this.dataHeight = dataHeight;
+        _this.left = left;
+        _this.top = top;
+        if (left + width > dataWidth || top + height > dataHeight) {
+            throw new IllegalArgumentException_1.default('Crop rectangle does not fit within image data.');
+        }
+        if (reverseHorizontal) {
+            _this.reverseHorizontal(width, height);
+        }
+        return _this;
+    }
+    /*@Override*/
+    PlanarYUVLuminanceSource.prototype.getRow = function (y /*int*/, row) {
+        if (y < 0 || y >= this.getHeight()) {
+            throw new IllegalArgumentException_1.default('Requested row is outside the image: ' + y);
+        }
+        var width = this.getWidth();
+        if (row === null || row === undefined || row.length < width) {
+            row = new Uint8ClampedArray(width);
+        }
+        var offset = (y + this.top) * this.dataWidth + this.left;
+        System_1.default.arraycopy(this.yuvData, offset, row, 0, width);
+        return row;
+    };
+    /*@Override*/
+    PlanarYUVLuminanceSource.prototype.getMatrix = function () {
+        var width = this.getWidth();
+        var height = this.getHeight();
+        // If the caller asks for the entire underlying image, save the copy and give them the
+        // original data. The docs specifically warn that result.length must be ignored.
+        if (width === this.dataWidth && height === this.dataHeight) {
+            return this.yuvData;
+        }
+        var area = width * height;
+        var matrix = new Uint8ClampedArray(area);
+        var inputOffset = this.top * this.dataWidth + this.left;
+        // If the width matches the full width of the underlying data, perform a single copy.
+        if (width === this.dataWidth) {
+            System_1.default.arraycopy(this.yuvData, inputOffset, matrix, 0, area);
+            return matrix;
+        }
+        // Otherwise copy one cropped row at a time.
+        for (var y = 0; y < height; y++) {
+            var outputOffset = y * width;
+            System_1.default.arraycopy(this.yuvData, inputOffset, matrix, outputOffset, width);
+            inputOffset += this.dataWidth;
+        }
+        return matrix;
+    };
+    /*@Override*/
+    PlanarYUVLuminanceSource.prototype.isCropSupported = function () {
+        return true;
+    };
+    /*@Override*/
+    PlanarYUVLuminanceSource.prototype.crop = function (left /*int*/, top /*int*/, width /*int*/, height /*int*/) {
+        return new PlanarYUVLuminanceSource(this.yuvData, this.dataWidth, this.dataHeight, this.left + left, this.top + top, width, height, false);
+    };
+    PlanarYUVLuminanceSource.prototype.renderThumbnail = function () {
+        var width = this.getWidth() / PlanarYUVLuminanceSource.THUMBNAIL_SCALE_FACTOR;
+        var height = this.getHeight() / PlanarYUVLuminanceSource.THUMBNAIL_SCALE_FACTOR;
+        var pixels = new Int32Array(width * height);
+        var yuv = this.yuvData;
+        var inputOffset = this.top * this.dataWidth + this.left;
+        for (var y = 0; y < height; y++) {
+            var outputOffset = y * width;
+            for (var x = 0; x < width; x++) {
+                var grey = yuv[inputOffset + x * PlanarYUVLuminanceSource.THUMBNAIL_SCALE_FACTOR] & 0xff;
+                pixels[outputOffset + x] = 0xFF000000 | (grey * 0x00010101);
+            }
+            inputOffset += this.dataWidth * PlanarYUVLuminanceSource.THUMBNAIL_SCALE_FACTOR;
+        }
+        return pixels;
+    };
+    /**
+     * @return width of image from {@link #renderThumbnail()}
+     */
+    PlanarYUVLuminanceSource.prototype.getThumbnailWidth = function () {
+        return this.getWidth() / PlanarYUVLuminanceSource.THUMBNAIL_SCALE_FACTOR;
+    };
+    /**
+     * @return height of image from {@link #renderThumbnail()}
+     */
+    PlanarYUVLuminanceSource.prototype.getThumbnailHeight = function () {
+        return this.getHeight() / PlanarYUVLuminanceSource.THUMBNAIL_SCALE_FACTOR;
+    };
+    PlanarYUVLuminanceSource.prototype.reverseHorizontal = function (width /*int*/, height /*int*/) {
+        var yuvData = this.yuvData;
+        for (var y = 0, rowStart = this.top * this.dataWidth + this.left; y < height; y++, rowStart += this.dataWidth) {
+            var middle = rowStart + width / 2;
+            for (var x1 = rowStart, x2 = rowStart + width - 1; x1 < middle; x1++, x2--) {
+                var temp = yuvData[x1];
+                yuvData[x1] = yuvData[x2];
+                yuvData[x2] = temp;
+            }
+        }
+    };
+    PlanarYUVLuminanceSource.prototype.invert = function () {
+        return new InvertedLuminanceSource_1.default(this);
+    };
+    PlanarYUVLuminanceSource.THUMBNAIL_SCALE_FACTOR = 2;
+    return PlanarYUVLuminanceSource;
+}(LuminanceSource_1.default));
+exports.default = PlanarYUVLuminanceSource;

+ 22 - 0
node_modules/@zxing/library/cjs/core/RGBLuminanceSource.d.ts

@@ -0,0 +1,22 @@
+import './InvertedLuminanceSource';
+import LuminanceSource from './LuminanceSource';
+/**
+ * This class is used to help decode images from files which arrive as RGB data from
+ * an ARGB pixel array. It does not support rotation.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ * @author Betaminos
+ */
+export default class RGBLuminanceSource extends LuminanceSource {
+    private dataWidth?;
+    private dataHeight?;
+    private left?;
+    private top?;
+    private luminances;
+    constructor(luminances: Uint8ClampedArray | Int32Array, width: number, height: number, dataWidth?: number, dataHeight?: number, left?: number, top?: number);
+    getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
+    getMatrix(): Uint8ClampedArray;
+    isCropSupported(): boolean;
+    crop(left: number, top: number, width: number, height: number): LuminanceSource;
+    invert(): LuminanceSource;
+}

+ 136 - 0
node_modules/@zxing/library/cjs/core/RGBLuminanceSource.js

@@ -0,0 +1,136 @@
+"use strict";
+/*
+ * Copyright 2009 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+/*namespace com.google.zxing {*/
+require("./InvertedLuminanceSource"); // required because of circular dependencies between LuminanceSource and InvertedLuminanceSource
+var InvertedLuminanceSource_1 = require("./InvertedLuminanceSource");
+var LuminanceSource_1 = require("./LuminanceSource");
+var System_1 = require("./util/System");
+var IllegalArgumentException_1 = require("./IllegalArgumentException");
+/**
+ * This class is used to help decode images from files which arrive as RGB data from
+ * an ARGB pixel array. It does not support rotation.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ * @author Betaminos
+ */
+var RGBLuminanceSource = /** @class */ (function (_super) {
+    __extends(RGBLuminanceSource, _super);
+    function RGBLuminanceSource(luminances, width /*int*/, height /*int*/, dataWidth /*int*/, dataHeight /*int*/, left /*int*/, top /*int*/) {
+        var _this = _super.call(this, width, height) || this;
+        _this.dataWidth = dataWidth;
+        _this.dataHeight = dataHeight;
+        _this.left = left;
+        _this.top = top;
+        if (luminances.BYTES_PER_ELEMENT === 4) { // Int32Array
+            var size = width * height;
+            var luminancesUint8Array = new Uint8ClampedArray(size);
+            for (var offset = 0; offset < size; offset++) {
+                var pixel = luminances[offset];
+                var r = (pixel >> 16) & 0xff; // red
+                var g2 = (pixel >> 7) & 0x1fe; // 2 * green
+                var b = pixel & 0xff; // blue
+                // Calculate green-favouring average cheaply
+                luminancesUint8Array[offset] = /*(byte) */ ((r + g2 + b) / 4) & 0xFF;
+            }
+            _this.luminances = luminancesUint8Array;
+        }
+        else {
+            _this.luminances = luminances;
+        }
+        if (undefined === dataWidth) {
+            _this.dataWidth = width;
+        }
+        if (undefined === dataHeight) {
+            _this.dataHeight = height;
+        }
+        if (undefined === left) {
+            _this.left = 0;
+        }
+        if (undefined === top) {
+            _this.top = 0;
+        }
+        if (_this.left + width > _this.dataWidth || _this.top + height > _this.dataHeight) {
+            throw new IllegalArgumentException_1.default('Crop rectangle does not fit within image data.');
+        }
+        return _this;
+    }
+    /*@Override*/
+    RGBLuminanceSource.prototype.getRow = function (y /*int*/, row) {
+        if (y < 0 || y >= this.getHeight()) {
+            throw new IllegalArgumentException_1.default('Requested row is outside the image: ' + y);
+        }
+        var width = this.getWidth();
+        if (row === null || row === undefined || row.length < width) {
+            row = new Uint8ClampedArray(width);
+        }
+        var offset = (y + this.top) * this.dataWidth + this.left;
+        System_1.default.arraycopy(this.luminances, offset, row, 0, width);
+        return row;
+    };
+    /*@Override*/
+    RGBLuminanceSource.prototype.getMatrix = function () {
+        var width = this.getWidth();
+        var height = this.getHeight();
+        // If the caller asks for the entire underlying image, save the copy and give them the
+        // original data. The docs specifically warn that result.length must be ignored.
+        if (width === this.dataWidth && height === this.dataHeight) {
+            return this.luminances;
+        }
+        var area = width * height;
+        var matrix = new Uint8ClampedArray(area);
+        var inputOffset = this.top * this.dataWidth + this.left;
+        // If the width matches the full width of the underlying data, perform a single copy.
+        if (width === this.dataWidth) {
+            System_1.default.arraycopy(this.luminances, inputOffset, matrix, 0, area);
+            return matrix;
+        }
+        // Otherwise copy one cropped row at a time.
+        for (var y = 0; y < height; y++) {
+            var outputOffset = y * width;
+            System_1.default.arraycopy(this.luminances, inputOffset, matrix, outputOffset, width);
+            inputOffset += this.dataWidth;
+        }
+        return matrix;
+    };
+    /*@Override*/
+    RGBLuminanceSource.prototype.isCropSupported = function () {
+        return true;
+    };
+    /*@Override*/
+    RGBLuminanceSource.prototype.crop = function (left /*int*/, top /*int*/, width /*int*/, height /*int*/) {
+        return new RGBLuminanceSource(this.luminances, width, height, this.dataWidth, this.dataHeight, this.left + left, this.top + top);
+    };
+    RGBLuminanceSource.prototype.invert = function () {
+        return new InvertedLuminanceSource_1.default(this);
+    };
+    return RGBLuminanceSource;
+}(LuminanceSource_1.default));
+exports.default = RGBLuminanceSource;

部分文件因文件數量過多而無法顯示