index-legacy.af51d689.js 94 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. ;(function(){function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}var __vite_style__=document.createElement('style');__vite_style__.innerHTML="._roomHeader_13gb6_1{background:url(./assets/room_bg.498828a6.png) top center no-repeat;background-size:100%;overflow:hidden}._roomHeader_13gb6_1 .van-row{align-items:center}._countTimer_13gb6_9{padding:.85333rem .64rem .58667rem}._countTimer_13gb6_9 ._timer_13gb6_12{padding-left:.05333rem;font-size:.69333rem;font-weight:600;color:#333;padding-bottom:.26667rem}._countTimer_13gb6_9 ._timer_13gb6_12 span{color:#666;font-size:.37333rem}._countTimer_13gb6_9 ._title_13gb6_23{display:flex;align-items:center;font-size:.32rem;color:#333;line-height:.45333rem}._countTimer_13gb6_9 ._title_13gb6_23 img{width:.4rem;height:.4rem;margin-right:.13333rem}._chargeTimer_13gb6_35 .van-button__text{display:flex;align-items:center;font-weight:600}._chargeTimer_13gb6_35 .van-button__text img{margin-left:.05333rem;width:.26667rem;height:.26667rem}._studentList_13gb6_45{margin:0 .37333rem .4rem;background:#ffffff;border-radius:.26667rem;overflow:hidden}._studentCount_13gb6_51{font-size:.37333rem;font-weight:500;color:#333}._btnGroupInvite_13gb6_56{display:flex;align-items:center;justify-content:space-between;padding-bottom:.10667rem}._btnGroupInvite_13gb6_56 .van-button{width:48%;font-size:.37333rem;font-weight:500;color:#333!important}._btnGroupInvite_13gb6_56 .van-button img{margin-right:.21333rem;width:.53333rem;height:.53333rem}._btnGroupInvite_13gb6_56 .van-button__text{display:flex;align-items:center}._searchList_13gb6_77{display:flex;padding:.32rem .42667rem;background-color:#fff}._dataItem_13gb6_82{font-size:.37333rem;color:#333;padding-right:.64rem}._shareSection_146p0_1{width:8.13333rem;padding:.37333rem;background:url(./assets/share_bg.252c9956.png) center no-repeat #2dc7aa;background-size:cover;overflow:hidden}._shareSection_146p0_1 ._img_146p0_8{width:1.44rem;height:1.44rem;border-radius:50%;margin-right:.32rem}._shareSection_146p0_1 ._name_146p0_14{font-size:.48rem;font-weight:500;color:#1a1a1a;line-height:.48rem}._shareSection_146p0_1 ._titleTips_146p0_20{padding-top:.13333rem;font-size:.37333rem;color:#8a8a8a;line-height:.48rem}._section_146p0_26{background:#ffffff;border-radius:.29333rem;overflow:hidden;padding:.37333rem .42667rem .53333rem}._txt_146p0_32{font-size:.42667rem;color:#333;line-height:1.5}._txt_146p0_32 span{font-size:.48rem;font-weight:500;color:#2dc7aa}._teacherName_146p0_42{padding-top:.53333rem}._download_146p0_45{margin-top:.26667rem;display:flex;align-items:center;justify-content:space-between}._download_146p0_45 ._logo_146p0_51{font-size:.34667rem;color:#349784;line-height:.48rem}._download_146p0_45 ._logo_146p0_51 img{width:2.48rem;vertical-align:middle;margin-bottom:.29333rem}._download_146p0_45 ._qrcode_146p0_61{background:#ccc;width:2.02667rem;height:2.02667rem}._continue_146p0_66{position:absolute;right:.66667rem;top:.53333rem;z-index:2;background:rgba(0,0,0,.23);border-radius:.50667rem;font-size:.37333rem;color:#fff;background:linear-gradient(0deg,#2dc7aa 0%,#32e8c6 100%);padding:.16rem .48rem}._label_v8pn1_1{margin-right:.21333rem;font-size:.37333rem}._label_v8pn1_1 .van-list__loading,._label_v8pn1_1 .van-list__finished-text,._label_v8pn1_1 .van-list__error-text{width:100%}._label_v8pn1_1 .iconfont-down{margin-left:.10667rem}._studentList_v8pn1_13{height:55vh;overflow:auto}._studentList_v8pn1_13 .van-checkbox{justify-content:flex-end}._btnGroup_v8pn1_20{padding:0 .53333rem .37333rem}._confirmTitle_yqlm2_1{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem;padding:.58667rem .58667rem .32rem}._confirmTitle_yqlm2_1 ._timer_yqlm2_8{color:#2dc7aa}._addTitle_yqlm2_11,._calc_yqlm2_12{font-size:.42667rem;color:#666;line-height:.58667rem;padding:.32rem .58667rem 0}._addTitle_yqlm2_11 span,._calc_yqlm2_12 span{color:var(--van-primary)}._addTitle_yqlm2_11 .student,._calc_yqlm2_12 .student{margin:0}._studentList_yqlm2_26{max-height:45vh;overflow:auto}._btnGroup_yqlm2_30{padding:.37333rem .53333rem}\n";document.head.appendChild(__vite_style__);System.register(['./share_bg-legacy.c21b86fd.js','./icon_tips-legacy.4149807e.js','./index-legacy.6147e732.js','./index-legacy.9074a587.js','./vendor-legacy.5fbdeb0b.js','./index-legacy.637f3556.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a6.js','./index-legacy.f25f109a11.js','./index-legacy.f25f109a7.js','./index-legacy.637f35562.js','./index-legacy.f25f109a10.js','./index-legacy.156eff33.js','./icon_teacher-legacy.00e7cdce.js','./index-legacy.b4997d3b.js','./organ-search-legacy.3a5ef7e6.js','./index-legacy.f25f109a13.js','./index-legacy.f25f109a14.js','./index-legacy.0a0024d8.js','./index-legacy.bb1b241a.js','./icon_timer2-legacy.90431d1a.js','./index-legacy.901c4933.js','./index-legacy.f25f109a3.js','./index-legacy.f25f109a9.js','./index-legacy.f25f109a5.js','./icon_student-legacy.45be2fa9.js'],function(exports){'use strict';var logo$1,__glob_8_0,__glob_8_1,__glob_8_2,__glob_8_3,__glob_8_4,__glob_8_5,__glob_8_6,__glob_8_7,__glob_8_9,__glob_8_10,__glob_8_11,__glob_8_8,ColHeader,postMessage,state,request,ColResult,formatterDate,defineComponent,ref,onUpdated,h,onMounted,createVNode,Fragment,createTextVNode,Cell,Toast,Icon,List,Checkbox,isVNode,Popup,Button,dayjs,Dialog,Row,Col,CellGroup,DatetimePicker,ActionSheet,Course,iconTeacher,ColSearch,OrganSearch,Student,useEventListener,useWindowScroll;return{setters:[function(module){logo$1=module.l;__glob_8_0=module._;__glob_8_1=module.a;__glob_8_2=module.b;__glob_8_3=module.c;__glob_8_4=module.d;__glob_8_5=module.e;__glob_8_6=module.f;__glob_8_7=module.g;__glob_8_9=module.h;__glob_8_10=module.i;__glob_8_11=module.j;},function(module){__glob_8_8=module._;},function(module){ColHeader=module.C;},function(module){postMessage=module.p;state=module.s;request=module.r;ColResult=module.C;formatterDate=module.j;},function(module){defineComponent=module.d;ref=module.V;onUpdated=module.aD;h=module.aE;onMounted=module.a5;createVNode=module.a;Fragment=module.F;createTextVNode=module.j;Cell=module.q;Toast=module.T;Icon=module.u;List=module.w;Checkbox=module.a1;isVNode=module.x;Popup=module.P;Button=module.B;dayjs=module.g;Dialog=module.D;Row=module.k;Col=module.l;CellGroup=module.C;DatetimePicker=module.J;ActionSheet=module.A;},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(module){Course=module.C;},function(module){iconTeacher=module.i;},function(module){ColSearch=module.C;},function(module){OrganSearch=module.O;},function(){},function(){},function(module){Student=module.S;},function(module){useEventListener=module.u;useWindowScroll=module.a;},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var roomHeader="_roomHeader_13gb6_1";var countTimer="_countTimer_13gb6_9";var timer$1="_timer_13gb6_12";var title="_title_13gb6_23";var chargeTimer="_chargeTimer_13gb6_35";var studentList$2="_studentList_13gb6_45";var studentCount="_studentCount_13gb6_51";var btnGroupInvite="_btnGroupInvite_13gb6_56";var searchList="_searchList_13gb6_77";var dataItem="_dataItem_13gb6_82";var styles$3={roomHeader:roomHeader,countTimer:countTimer,timer:timer$1,title:title,chargeTimer:chargeTimer,studentList:studentList$2,studentCount:studentCount,btnGroupInvite:btnGroupInvite,searchList:searchList,dataItem:dataItem};var shareSection="_shareSection_146p0_1";var img="_img_146p0_8";var name="_name_146p0_14";var titleTips="_titleTips_146p0_20";var section="_section_146p0_26";var txt="_txt_146p0_32";var teacherName="_teacherName_146p0_42";var download="_download_146p0_45";var logo="_logo_146p0_51";var qrcode="_qrcode_146p0_61";var styles$2={shareSection:shareSection,img:img,name:name,titleTips:titleTips,section:section,txt:txt,teacherName:teacherName,download:download,logo:logo,qrcode:qrcode,"continue":"_continue_146p0_66"};/*!
  2. * qrcode.vue v3.3.3
  3. * A Vue.js component to generate QRCode.
  4. * © 2017-2021 @scopewu(https://github.com/scopewu)
  5. * MIT License.
  6. */ /*! *****************************************************************************
  7. Copyright (c) Microsoft Corporation.
  8. Permission to use, copy, modify, and/or distribute this software for any
  9. purpose with or without fee is hereby granted.
  10. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  11. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  12. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  13. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  14. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  15. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. PERFORMANCE OF THIS SOFTWARE.
  17. ***************************************************************************** */var _assign=function __assign(){_assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p];}}return t;};return _assign.apply(this,arguments);};var mode$1={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3};var mode=mode$1;function QR8bitByte(data){this.mode=mode.MODE_8BIT_BYTE;this.data=data;}QR8bitByte.prototype={getLength:function getLength(buffer){return this.data.length;},write:function write(buffer){for(var i=0;i<this.data.length;i++){// not JIS ...
  18. buffer.put(this.data.charCodeAt(i),8);}}};var _8BitByte=QR8bitByte;var ErrorCorrectLevel={L:1,M:0,Q:3,H:2};// ErrorCorrectLevel
  19. var ECL=ErrorCorrectLevel;function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount;this.dataCount=dataCount;}QRRSBlock.RS_BLOCK_TABLE=[// L
  20. // M
  21. // Q
  22. // H
  23. // 1
  24. [1,26,19],[1,26,16],[1,26,13],[1,26,9],// 2
  25. [1,44,34],[1,44,28],[1,44,22],[1,44,16],// 3
  26. [1,70,55],[1,70,44],[2,35,17],[2,35,13],// 4
  27. [1,100,80],[2,50,32],[2,50,24],[4,25,9],// 5
  28. [1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],// 6
  29. [2,86,68],[4,43,27],[4,43,19],[4,43,15],// 7
  30. [2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],// 8
  31. [2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],// 9
  32. [2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],// 10
  33. [2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],// 11
  34. [4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],// 12
  35. [2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],// 13
  36. [4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],// 14
  37. [3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],// 15
  38. [5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],// 16
  39. [5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],// 17
  40. [1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],// 18
  41. [5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],// 19
  42. [3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],// 20
  43. [3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],// 21
  44. [4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],// 22
  45. [2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],// 23
  46. [4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],// 24
  47. [6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],// 25
  48. [8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],// 26
  49. [10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],// 27
  50. [8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],// 28
  51. [3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],// 29
  52. [7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],// 30
  53. [5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],// 31
  54. [13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],// 32
  55. [17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],// 33
  56. [17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],// 34
  57. [13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],// 35
  58. [12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],// 36
  59. [6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],// 37
  60. [17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],// 38
  61. [4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],// 39
  62. [20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],// 40
  63. [19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=QRRSBlock.getRsBlockTable(typeNumber,errorCorrectLevel);if(rsBlock==undefined){throw new Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);}var length=rsBlock.length/3;var list=new Array();for(var i=0;i<length;i++){var count=rsBlock[i*3+0];var totalCount=rsBlock[i*3+1];var dataCount=rsBlock[i*3+2];for(var j=0;j<count;j++){list.push(new QRRSBlock(totalCount,dataCount));}}return list;};QRRSBlock.getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case ECL.L:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+0];case ECL.M:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+1];case ECL.Q:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+2];case ECL.H:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+3];default:return undefined;}};var RSBlock$1=QRRSBlock;function QRBitBuffer(){this.buffer=new Array();this.length=0;}QRBitBuffer.prototype={get:function get(index){var bufIndex=Math.floor(index/8);return(this.buffer[bufIndex]>>>7-index%8&1)==1;},put:function put(num,length){for(var i=0;i<length;i++){this.putBit((num>>>length-i-1&1)==1);}},getLengthInBits:function getLengthInBits(){return this.length;},putBit:function putBit(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);}if(bit){this.buffer[bufIndex]|=0x80>>>this.length%8;}this.length++;}};var BitBuffer$1=QRBitBuffer;var QRMath={glog:function glog(n){if(n<1){throw new Error("glog("+n+")");}return QRMath.LOG_TABLE[n];},gexp:function gexp(n){while(n<0){n+=255;}while(n>=256){n-=255;}return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<<i;}for(var i=8;i<256;i++){QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];}for(var i=0;i<255;i++){QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;}var math$2=QRMath;var math$1=math$2;function QRPolynomial(num,shift){if(num.length==undefined){throw new Error(num.length+"/"+shift);}var offset=0;while(offset<num.length&&num[offset]==0){offset++;}this.num=new Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++){this.num[i]=num[i+offset];}}QRPolynomial.prototype={get:function get(index){return this.num[index];},getLength:function getLength(){return this.num.length;},multiply:function multiply(e){var num=new Array(this.getLength()+e.getLength()-1);for(var i=0;i<this.getLength();i++){for(var j=0;j<e.getLength();j++){num[i+j]^=math$1.gexp(math$1.glog(this.get(i))+math$1.glog(e.get(j)));}}return new QRPolynomial(num,0);},mod:function mod(e){if(this.getLength()-e.getLength()<0){return this;}var ratio=math$1.glog(this.get(0))-math$1.glog(e.get(0));var num=new Array(this.getLength());for(var i=0;i<this.getLength();i++){num[i]=this.get(i);}for(var i=0;i<e.getLength();i++){num[i]^=math$1.gexp(math$1.glog(e.get(i))+ratio);}// recursive call
  64. return new QRPolynomial(num,0).mod(e);}};var Polynomial$2=QRPolynomial;var Mode=mode$1;var Polynomial$1=Polynomial$2;var math=math$2;var QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function getBCHTypeInfo(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0){d^=QRUtil.G15<<QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15);}return(data<<10|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function getBCHTypeNumber(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=QRUtil.G18<<QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18);}return data<<12|d;},getBCHDigit:function getBCHDigit(data){var digit=0;while(data!=0){digit++;data>>>=1;}return digit;},getPatternPosition:function getPatternPosition(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function getMask(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return i*j%2+i*j%3==0;case QRMaskPattern.PATTERN110:return(i*j%2+i*j%3)%2==0;case QRMaskPattern.PATTERN111:return(i*j%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function getErrorCorrectPolynomial(errorCorrectLength){var a=new Polynomial$1([1],0);for(var i=0;i<errorCorrectLength;i++){a=a.multiply(new Polynomial$1([1,math.gexp(i)],0));}return a;},getLengthInBits:function getLengthInBits(mode,type){if(1<=type&&type<10){// 1 - 9
  65. switch(mode){case Mode.MODE_NUMBER:return 10;case Mode.MODE_ALPHA_NUM:return 9;case Mode.MODE_8BIT_BYTE:return 8;case Mode.MODE_KANJI:return 8;default:throw new Error("mode:"+mode);}}else if(type<27){// 10 - 26
  66. switch(mode){case Mode.MODE_NUMBER:return 12;case Mode.MODE_ALPHA_NUM:return 11;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 10;default:throw new Error("mode:"+mode);}}else if(type<41){// 27 - 40
  67. switch(mode){case Mode.MODE_NUMBER:return 14;case Mode.MODE_ALPHA_NUM:return 13;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 12;default:throw new Error("mode:"+mode);}}else{throw new Error("type:"+type);}},getLostPoint:function getLostPoint(qrCode){var moduleCount=qrCode.getModuleCount();var lostPoint=0;// LEVEL1
  68. for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount;col++){var sameCount=0;var dark=qrCode.isDark(row,col);for(var r=-1;r<=1;r++){if(row+r<0||moduleCount<=row+r){continue;}for(var c=-1;c<=1;c++){if(col+c<0||moduleCount<=col+c){continue;}if(r==0&&c==0){continue;}if(dark==qrCode.isDark(row+r,col+c)){sameCount++;}}}if(sameCount>5){lostPoint+=3+sameCount-5;}}}// LEVEL2
  69. for(var row=0;row<moduleCount-1;row++){for(var col=0;col<moduleCount-1;col++){var count=0;if(qrCode.isDark(row,col))count++;if(qrCode.isDark(row+1,col))count++;if(qrCode.isDark(row,col+1))count++;if(qrCode.isDark(row+1,col+1))count++;if(count==0||count==4){lostPoint+=3;}}}// LEVEL3
  70. for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount-6;col++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row,col+1)&&qrCode.isDark(row,col+2)&&qrCode.isDark(row,col+3)&&qrCode.isDark(row,col+4)&&!qrCode.isDark(row,col+5)&&qrCode.isDark(row,col+6)){lostPoint+=40;}}}for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount-6;row++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row+1,col)&&qrCode.isDark(row+2,col)&&qrCode.isDark(row+3,col)&&qrCode.isDark(row+4,col)&&!qrCode.isDark(row+5,col)&&qrCode.isDark(row+6,col)){lostPoint+=40;}}}// LEVEL4
  71. var darkCount=0;for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount;row++){if(qrCode.isDark(row,col)){darkCount++;}}}var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;lostPoint+=ratio*10;return lostPoint;}};var util$1=QRUtil;var BitByte=_8BitByte;var RSBlock=RSBlock$1;var BitBuffer=BitBuffer$1;var util=util$1;var Polynomial=Polynomial$2;function QRCode$1(typeNumber,errorCorrectLevel){this.typeNumber=typeNumber;this.errorCorrectLevel=errorCorrectLevel;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[];}// for client side minification
  72. var proto=QRCode$1.prototype;proto.addData=function(data){var newData=new BitByte(data);this.dataList.push(newData);this.dataCache=null;};proto.isDark=function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);}return this.modules[row][col];};proto.getModuleCount=function(){return this.moduleCount;};proto.make=function(){// Calculate automatically typeNumber if provided is < 1
  73. if(this.typeNumber<1){var typeNumber=1;for(typeNumber=1;typeNumber<40;typeNumber++){var rsBlocks=RSBlock.getRSBlocks(typeNumber,this.errorCorrectLevel);var buffer=new BitBuffer();var totalDataCount=0;for(var i=0;i<rsBlocks.length;i++){totalDataCount+=rsBlocks[i].dataCount;}for(var i=0;i<this.dataList.length;i++){var data=this.dataList[i];buffer.put(data.mode,4);buffer.put(data.getLength(),util.getLengthInBits(data.mode,typeNumber));data.write(buffer);}if(buffer.getLengthInBits()<=totalDataCount*8)break;}this.typeNumber=typeNumber;}this.makeImpl(false,this.getBestMaskPattern());};proto.makeImpl=function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=new Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++){this.modules[row][col]=null;//(col + row) % 3;
  74. }}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(test,maskPattern);if(this.typeNumber>=7){this.setupTypeNumber(test);}if(this.dataCache==null){this.dataCache=QRCode$1.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);}this.mapData(this.dataCache,maskPattern);};proto.setupPositionProbePattern=function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if(0<=r&&r<=6&&(c==0||c==6)||0<=c&&c<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=c&&c<=4){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}};proto.getBestMaskPattern=function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=util.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}}return pattern;};proto.createMovieClip=function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row<this.modules.length;row++){var y=row*cs;for(var col=0;col<this.modules[row].length;col++){var x=col*cs;var dark=this.modules[row][col];if(dark){qr_mc.beginFill(0,100);qr_mc.moveTo(x,y);qr_mc.lineTo(x+cs,y);qr_mc.lineTo(x+cs,y+cs);qr_mc.lineTo(x,y+cs);qr_mc.endFill();}}}return qr_mc;};proto.setupTimingPattern=function(){for(var r=8;r<this.moduleCount-8;r++){if(this.modules[r][6]!=null){continue;}this.modules[r][6]=r%2==0;}for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!=null){continue;}this.modules[6][c]=c%2==0;}};proto.setupPositionAdjustPattern=function(){var pos=util.getPatternPosition(this.typeNumber);for(var i=0;i<pos.length;i++){for(var j=0;j<pos.length;j++){var row=pos[i];var col=pos[j];if(this.modules[row][col]!=null){continue;}for(var r=-2;r<=2;r++){for(var c=-2;c<=2;c++){if(r==-2||r==2||c==-2||c==2||r==0&&c==0){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}}}};proto.setupTypeNumber=function(test){var bits=util.getBCHTypeNumber(this.typeNumber);for(var i=0;i<18;i++){var mod=!test&&(bits>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;}for(var i=0;i<18;i++){var mod=!test&&(bits>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}};proto.setupTypeInfo=function(test,maskPattern){var data=this.errorCorrectLevel<<3|maskPattern;var bits=util.getBCHTypeInfo(data);// vertical
  75. for(var i=0;i<15;i++){var mod=!test&&(bits>>i&1)==1;if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}}// horizontal
  76. for(var i=0;i<15;i++){var mod=!test&&(bits>>i&1)==1;if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}}// fixed module
  77. this.modules[this.moduleCount-8][8]=!test;};proto.mapData=function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex<data.length){dark=(data[byteIndex]>>>bitIndex&1)==1;}var mask=util.getMask(maskPattern,row,col-c);if(mask){dark=!dark;}this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}}row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}};QRCode$1.PAD0=0xEC;QRCode$1.PAD1=0x11;QRCode$1.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=RSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new BitBuffer();for(var i=0;i<dataList.length;i++){var data=dataList[i];buffer.put(data.mode,4);buffer.put(data.getLength(),util.getLengthInBits(data.mode,typeNumber));data.write(buffer);}// calc num max data.
  78. var totalDataCount=0;for(var i=0;i<rsBlocks.length;i++){totalDataCount+=rsBlocks[i].dataCount;}if(buffer.getLengthInBits()>totalDataCount*8){throw new Error("code length overflow. ("+buffer.getLengthInBits()+">"+totalDataCount*8+")");}// end code
  79. if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);}// padding
  80. while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);}// padding
  81. while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;}buffer.put(QRCode$1.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;}buffer.put(QRCode$1.PAD1,8);}return QRCode$1.createBytes(buffer,rsBlocks);};QRCode$1.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r<rsBlocks.length;r++){var dcCount=rsBlocks[r].dataCount;var ecCount=rsBlocks[r].totalCount-dcCount;maxDcCount=Math.max(maxDcCount,dcCount);maxEcCount=Math.max(maxEcCount,ecCount);dcdata[r]=new Array(dcCount);for(var i=0;i<dcdata[r].length;i++){dcdata[r][i]=0xff&buffer.buffer[i+offset];}offset+=dcCount;var rsPoly=util.getErrorCorrectPolynomial(ecCount);var rawPoly=new Polynomial(dcdata[r],rsPoly.getLength()-1);var modPoly=rawPoly.mod(rsPoly);ecdata[r]=new Array(rsPoly.getLength()-1);for(var i=0;i<ecdata[r].length;i++){var modIndex=i+modPoly.getLength()-ecdata[r].length;ecdata[r][i]=modIndex>=0?modPoly.get(modIndex):0;}}var totalCodeCount=0;for(var i=0;i<rsBlocks.length;i++){totalCodeCount+=rsBlocks[i].totalCount;}var data=new Array(totalCodeCount);var index=0;for(var i=0;i<maxDcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<dcdata[r].length){data[index++]=dcdata[r][i];}}}for(var i=0;i<maxEcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<ecdata[r].length){data[index++]=ecdata[r][i];}}}return data;};var QRCode_1=QRCode$1;var defaultErrorCorrectLevel='H';// Thanks the `qrcode.react`
  82. var SUPPORTS_PATH2D=function(){try{new Path2D().addPath(new Path2D());}catch(e){return false;}return true;}();function QRCode(data,level){var errorCorrectLevel=ErrorCorrectLevel[level];// We'll use type===-1 to force QRCode to automatically pick the best type
  83. var qrcode=new QRCode_1(-1,errorCorrectLevel);qrcode.addData(toUTF8String(data));qrcode.make();return qrcode;}function validErrorCorrectLevel(level){return level in ErrorCorrectLevel;}/**
  84. * Encode UTF16 to UTF8.
  85. * See: http://jonisalonen.com/2012/from-utf-16-to-utf-8-in-javascript/
  86. * @param str {string}
  87. * @returns {string}
  88. */function toUTF8String(str){var utf8Str='';for(var i=0;i<str.length;i++){var charCode=str.charCodeAt(i);if(charCode<0x0080){utf8Str+=String.fromCharCode(charCode);}else if(charCode<0x0800){utf8Str+=String.fromCharCode(0xc0|charCode>>6);utf8Str+=String.fromCharCode(0x80|charCode&0x3f);}else if(charCode<0xd800||charCode>=0xe000){utf8Str+=String.fromCharCode(0xe0|charCode>>12);utf8Str+=String.fromCharCode(0x80|charCode>>6&0x3f);utf8Str+=String.fromCharCode(0x80|charCode&0x3f);}else{// surrogate pair
  89. i++;// UTF-16 encodes 0x10000-0x10FFFF by
  90. // subtracting 0x10000 and splitting the
  91. // 20 bits of 0x0-0xFFFFF into two halves
  92. charCode=0x10000+((charCode&0x3ff)<<10|str.charCodeAt(i)&0x3ff);utf8Str+=String.fromCharCode(0xf0|charCode>>18);utf8Str+=String.fromCharCode(0x80|charCode>>12&0x3f);utf8Str+=String.fromCharCode(0x80|charCode>>6&0x3f);utf8Str+=String.fromCharCode(0x80|charCode&0x3f);}}return utf8Str;}function generatePath(modules,margin){if(margin===void 0){margin=0;}var ops=[];modules.forEach(function(row,y){var start=null;row.forEach(function(cell,x){if(!cell&&start!==null){// M0 0h7v1H0z injects the space with the move and drops the comma,
  93. // saving a char per operation
  94. ops.push("M"+(start+margin)+" "+(y+margin)+"h"+(x-start)+"v1H"+(start+margin)+"z");start=null;return;}// end of row, clean up or skip
  95. if(x===row.length-1){if(!cell){// We would have closed the op above already so this can only mean
  96. // 2+ light modules in a row.
  97. return;}if(start===null){// Just a single dark module.
  98. ops.push("M"+(x+margin)+","+(y+margin)+" h1v1H"+(x+margin)+"z");}else{// Otherwise finish the current line.
  99. ops.push("M"+(start+margin)+","+(y+margin)+" h"+(x+1-start)+"v1H"+(start+margin)+"z");}return;}if(cell&&start===null){start=x;}});});return ops.join('');}var QRCodeProps={value:{type:String,required:true,"default":''},size:{type:Number,"default":100},level:{type:String,"default":defaultErrorCorrectLevel,validator:function validator(l){return validErrorCorrectLevel(l);}},background:{type:String,"default":'#fff'},foreground:{type:String,"default":'#000'},margin:{type:Number,required:false,"default":0}};var QRCodeVueProps=_assign(_assign({},QRCodeProps),{renderAs:{type:String,required:false,"default":'canvas',validator:function validator(as){return['canvas','svg'].indexOf(as)>-1;}}});var QRCodeSvg=defineComponent({name:'QRCodeSvg',props:QRCodeProps,setup:function setup(props){var numCells=ref(0);var fgPath=ref('');var generate=function generate(){var value=props.value,level=props.level,margin=props.margin;var cells=QRCode(value,level).modules;numCells.value=cells.length+margin*2;// Drawing strategy: instead of a rect per module, we're going to create a
  100. // single path for the dark modules and layer that on top of a light rect,
  101. // for a total of 2 DOM nodes. We pay a bit more in string concat but that's
  102. // way faster than DOM ops.
  103. // For level 1, 441 nodes -> 2
  104. // For level 40, 31329 -> 2
  105. fgPath.value=generatePath(cells,margin);};generate();onUpdated(generate);return function(){return h('svg',{width:props.size,height:props.size,'shape-rendering':"crispEdges",xmlns:'http://www.w3.org/2000/svg',viewBox:"0 0 "+numCells.value+" "+numCells.value},[h('path',{fill:props.background,d:"M0,0 h"+numCells.value+"v"+numCells.value+"H0z"}),h('path',{fill:props.foreground,d:fgPath.value})]);};}});var QRCodeCanvas=defineComponent({name:'QRCodeCanvas',props:QRCodeProps,setup:function setup(props){var canvasEl=ref(null);var generate=function generate(){var value=props.value,level=props.level,size=props.size,margin=props.margin,background=props.background,foreground=props.foreground;var cells=QRCode(value,level).modules;var numCells=cells.length+margin*2;var canvas=canvasEl.value;if(!canvas){return;}var ctx=canvas.getContext('2d');if(!ctx){return;}var devicePixelRatio=window.devicePixelRatio||1;var scale=size/numCells*devicePixelRatio;canvas.height=canvas.width=size*devicePixelRatio;ctx.scale(scale,scale);ctx.fillStyle=background;ctx.fillRect(0,0,numCells,numCells);ctx.fillStyle=foreground;if(SUPPORTS_PATH2D){ctx.fill(new Path2D(generatePath(cells,margin)));}else{cells.forEach(function(row,rdx){row.forEach(function(cell,cdx){if(cell){ctx.fillRect(cdx+margin,rdx+margin,1,1);}});});}};onMounted(generate);onUpdated(generate);return function(){return h('canvas',{ref:canvasEl,style:{width:props.size+"px",height:props.size+"px"}});};}});var QrcodeVue=defineComponent({name:'Qrcode',render:function render(){var _a=this.$props,renderAs=_a.renderAs,value=_a.value,_size=_a.size,_margin=_a.margin,_level=_a.level,background=_a.background,foreground=_a.foreground;var size=_size>>>0;var margin=_margin>>>0;var level=validErrorCorrectLevel(_level)?_level:defaultErrorCorrectLevel;return h(renderAs==='svg'?QRCodeSvg:QRCodeCanvas,{value:value,size:size,margin:margin,level:level,background:background,foreground:foreground});},props:QRCodeVueProps});var __awaiter$5=globalThis&&globalThis.__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 WOFF='application/font-woff';var JPEG='image/jpeg';var mimes={woff:WOFF,woff2:WOFF,ttf:'application/font-truetype',eot:'application/vnd.ms-fontobject',png:'image/png',jpg:JPEG,jpeg:JPEG,gif:'image/gif',tiff:'image/tiff',svg:'image/svg+xml'};function getExtension(url){var match=/\.([^./]*?)$/g.exec(url);return match?match[1]:'';}function getMimeType(url){var extension=getExtension(url).toLowerCase();return mimes[extension]||'';}function resolveUrl(url,baseUrl){// url is absolute already
  106. if(url.match(/^[a-z]+:\/\//i)){return url;}// url is absolute already, without protocol
  107. if(url.match(/^\/\//)){return window.location.protocol+url;}// dataURI, mailto:, tel:, etc.
  108. if(url.match(/^[a-z]+:/i)){return url;}var doc=document.implementation.createHTMLDocument();var base=doc.createElement('base');var a=doc.createElement('a');doc.head.appendChild(base);doc.body.appendChild(a);if(baseUrl){base.href=baseUrl;}a.href=url;return a.href;}function isDataUrl(url){return url.search(/^(data:)/)!==-1;}function makeDataUrl(content,mimeType){return"data:".concat(mimeType,";base64,").concat(content);}function parseDataUrlContent(dataURL){return dataURL.split(/,/)[1];}var uuid=function uuid(){// generate uuid for className of pseudo elements.
  109. // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.
  110. var counter=0;// ref: http://stackoverflow.com/a/6248722/2519373
  111. var random=function random(){return(// eslint-disable-next-line no-bitwise
  112. "0000".concat((Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4));};return function(){counter+=1;return"u".concat(random()).concat(counter);};}();function toArray(arrayLike){var arr=[];for(var _i=0,l=arrayLike.length;_i<l;_i+=1){arr.push(arrayLike[_i]);}return arr;}function px(node,styleProperty){var val=window.getComputedStyle(node).getPropertyValue(styleProperty);return parseFloat(val.replace('px',''));}function getNodeWidth(node){var leftBorder=px(node,'border-left-width');var rightBorder=px(node,'border-right-width');return node.clientWidth+leftBorder+rightBorder;}function getNodeHeight(node){var topBorder=px(node,'border-top-width');var bottomBorder=px(node,'border-bottom-width');return node.clientHeight+topBorder+bottomBorder;}function getPixelRatio(){var ratio;var FINAL_PROCESS;try{FINAL_PROCESS=process;}catch(e){// pass
  113. }var val=FINAL_PROCESS&&FINAL_PROCESS.env?FINAL_PROCESS.env.devicePixelRatio:null;if(val){ratio=parseInt(val,10);if(Number.isNaN(ratio)){ratio=1;}}return ratio||window.devicePixelRatio||1;}function createImage(url){return new Promise(function(resolve,reject){var img=new Image();img.onload=function(){return resolve(img);};img.onerror=reject;img.crossOrigin='anonymous';img.decoding='sync';img.src=url;});}function svgToDataURL(svg){return __awaiter$5(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee(){return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:return _context.abrupt("return",Promise.resolve().then(function(){return new XMLSerializer().serializeToString(svg);}).then(encodeURIComponent).then(function(html){return"data:image/svg+xml;charset=utf-8,".concat(html);}));case 1:case"end":return _context.stop();}}},_callee);}));}function nodeToDataURL(node,width,height){return __awaiter$5(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var xmlns,svg,foreignObject;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:xmlns='http://www.w3.org/2000/svg';svg=document.createElementNS(xmlns,'svg');foreignObject=document.createElementNS(xmlns,'foreignObject');svg.setAttribute('width',"".concat(width));svg.setAttribute('height',"".concat(height));svg.setAttribute('viewBox',"0 0 ".concat(width," ").concat(height));foreignObject.setAttribute('width','100%');foreignObject.setAttribute('height','100%');foreignObject.setAttribute('x','0');foreignObject.setAttribute('y','0');foreignObject.setAttribute('externalResourcesRequired','true');svg.appendChild(foreignObject);foreignObject.appendChild(node);return _context2.abrupt("return",svgToDataURL(svg));case 14:case"end":return _context2.stop();}}},_callee2);}));}var cache={};function getCacheKey(url){var key=url.replace(/\?.*/,'');// font resourse
  114. if(/ttf|otf|eot|woff2?/i.test(key)){key=key.replace(/.*\//,'');}return key;}function getBlobFromURL(url,options){var cacheKey=getCacheKey(url);if(cache[cacheKey]!=null){return cache[cacheKey];}// cache bypass so we dont have CORS issues with cached images
  115. // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
  116. if(options.cacheBust){// eslint-disable-next-line no-param-reassign
  117. url+=(/\?/.test(url)?'&':'?')+new Date().getTime();}var failed=function failed(reason){var placeholder='';if(options.imagePlaceholder){var parts=options.imagePlaceholder.split(/,/);if(parts&&parts[1]){placeholder=parts[1];}}var msg="Failed to fetch resource: ".concat(url);if(reason){msg=typeof reason==='string'?reason:reason.message;}if(msg){console.error(msg);}return{blob:placeholder,contentType:''};};var deferred=window.fetch(url).then(function(res){return(// eslint-disable-next-line promise/no-nesting
  118. res.blob().then(function(blob){return{blob:blob,contentType:res.headers.get('Content-Type')||''};}));}).then(function(_ref){var blob=_ref.blob,contentType=_ref.contentType;return new Promise(function(resolve,reject){var reader=new FileReader();reader.onloadend=function(){return resolve({contentType:contentType,blob:reader.result});};reader.onerror=reject;reader.readAsDataURL(blob);});}).then(function(_ref2){var blob=_ref2.blob,contentType=_ref2.contentType;return{contentType:contentType,blob:parseDataUrlContent(blob)};})// on failed
  119. .catch(failed);// cache result
  120. cache[cacheKey]=deferred;return deferred;}function formatCSSText(style){var content=style.getPropertyValue('content');return"".concat(style.cssText," content: '").concat(content.replace(/'|"/g,''),"';");}function formatCSSProperties(style){return toArray(style).map(function(name){var value=style.getPropertyValue(name);var priority=style.getPropertyPriority(name);return"".concat(name,": ").concat(value).concat(priority?' !important':'',";");}).join(' ');}function getPseudoElementStyle(className,pseudo,style){var selector=".".concat(className,":").concat(pseudo);var cssText=style.cssText?formatCSSText(style):formatCSSProperties(style);return document.createTextNode("".concat(selector,"{").concat(cssText,"}"));}function clonePseudoElement(nativeNode,clonedNode,pseudo){var style=window.getComputedStyle(nativeNode,pseudo);var content=style.getPropertyValue('content');if(content===''||content==='none'){return;}var className=uuid();try{clonedNode.className="".concat(clonedNode.className," ").concat(className);}catch(err){return;}var styleElement=document.createElement('style');styleElement.appendChild(getPseudoElementStyle(className,pseudo,style));clonedNode.appendChild(styleElement);}function clonePseudoElements(nativeNode,clonedNode){clonePseudoElement(nativeNode,clonedNode,':before');clonePseudoElement(nativeNode,clonedNode,':after');}var __awaiter$4=globalThis&&globalThis.__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());});};function cloneCanvasElement(node){return __awaiter$4(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){var dataURL;return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:dataURL=node.toDataURL();if(!(dataURL==='data:,')){_context3.next=3;break;}return _context3.abrupt("return",Promise.resolve(node.cloneNode(false)));case 3:return _context3.abrupt("return",createImage(dataURL));case 4:case"end":return _context3.stop();}}},_callee3);}));}function cloneVideoElement(node,options){return __awaiter$4(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee4(){return regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:return _context4.abrupt("return",Promise.resolve(node.poster).then(function(url){return getBlobFromURL(url,options);}).then(function(data){return makeDataUrl(data.blob,getMimeType(node.poster)||data.contentType);}).then(function(dataURL){return createImage(dataURL);}));case 1:case"end":return _context4.stop();}}},_callee4);}));}function cloneSingleNode(node,options){return __awaiter$4(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee5(){return regeneratorRuntime.wrap(function _callee5$(_context5){while(1){switch(_context5.prev=_context5.next){case 0:if(!(node instanceof HTMLCanvasElement)){_context5.next=2;break;}return _context5.abrupt("return",cloneCanvasElement(node));case 2:if(!(node instanceof HTMLVideoElement&&node.poster)){_context5.next=4;break;}return _context5.abrupt("return",cloneVideoElement(node,options));case 4:return _context5.abrupt("return",Promise.resolve(node.cloneNode(false)));case 5:case"end":return _context5.stop();}}},_callee5);}));}var isSlotElement=function isSlotElement(node){return node.tagName!=null&&node.tagName.toUpperCase()==='SLOT';};function cloneChildren(nativeNode,clonedNode,options){var _a;return __awaiter$4(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee6(){var children;return regeneratorRuntime.wrap(function _callee6$(_context6){while(1){switch(_context6.prev=_context6.next){case 0:children=isSlotElement(nativeNode)&&nativeNode.assignedNodes?toArray(nativeNode.assignedNodes()):toArray(((_a=nativeNode.shadowRoot)!==null&&_a!==void 0?_a:nativeNode).childNodes);if(!(children.length===0||nativeNode instanceof HTMLVideoElement)){_context6.next=3;break;}return _context6.abrupt("return",Promise.resolve(clonedNode));case 3:return _context6.abrupt("return",children.reduce(function(deferred,child){return deferred// eslint-disable-next-line no-use-before-define
  121. .then(function(){return cloneNode(child,options);}).then(function(clonedChild){// eslint-disable-next-line promise/always-return
  122. if(clonedChild){clonedNode.appendChild(clonedChild);}});},Promise.resolve()).then(function(){return clonedNode;}));case 4:case"end":return _context6.stop();}}},_callee6);}));}function cloneCSSStyle(nativeNode,clonedNode){var source=window.getComputedStyle(nativeNode);var target=clonedNode.style;if(!target){return;}if(source.cssText){target.cssText=source.cssText;}else{toArray(source).forEach(function(name){target.setProperty(name,source.getPropertyValue(name),source.getPropertyPriority(name));});}}function cloneInputValue(nativeNode,clonedNode){if(nativeNode instanceof HTMLTextAreaElement){clonedNode.innerHTML=nativeNode.value;}if(nativeNode instanceof HTMLInputElement){clonedNode.setAttribute('value',nativeNode.value);}}function decorate(nativeNode,clonedNode){return __awaiter$4(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee7(){return regeneratorRuntime.wrap(function _callee7$(_context7){while(1){switch(_context7.prev=_context7.next){case 0:if(clonedNode instanceof Element){_context7.next=2;break;}return _context7.abrupt("return",Promise.resolve(clonedNode));case 2:return _context7.abrupt("return",Promise.resolve().then(function(){return cloneCSSStyle(nativeNode,clonedNode);}).then(function(){return clonePseudoElements(nativeNode,clonedNode);}).then(function(){return cloneInputValue(nativeNode,clonedNode);}).then(function(){return clonedNode;}));case 3:case"end":return _context7.stop();}}},_callee7);}));}function cloneNode(node,options,isRoot){return __awaiter$4(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee8(){return regeneratorRuntime.wrap(function _callee8$(_context8){while(1){switch(_context8.prev=_context8.next){case 0:if(!(!isRoot&&options.filter&&!options.filter(node))){_context8.next=2;break;}return _context8.abrupt("return",Promise.resolve(null));case 2:return _context8.abrupt("return",Promise.resolve(node).then(function(clonedNode){return cloneSingleNode(clonedNode,options);}).then(function(clonedNode){return cloneChildren(node,clonedNode,options);}).then(function(clonedNode){return decorate(node,clonedNode);}));case 3:case"end":return _context8.stop();}}},_callee8);}));}var __awaiter$3=globalThis&&globalThis.__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 URL_REGEX=/url\((['"]?)([^'"]+?)\1\)/g;var URL_WITH_FORMAT_REGEX=/url\([^)]+\)\s*format\((["'])([^"']+)\1\)/g;var FONT_SRC_REGEX=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function toRegex(url){// eslint-disable-next-line no-useless-escape
  123. var escaped=url.replace(/([.*+?^${}()|\[\]\/\\])/g,'\\$1');return new RegExp("(url\\(['\"]?)(".concat(escaped,")(['\"]?\\))"),'g');}function parseURLs(cssText){var result=[];cssText.replace(URL_REGEX,function(raw,quotation,url){result.push(url);return raw;});return result.filter(function(url){return!isDataUrl(url);});}function embed(cssText,resourceURL,baseURL,options,get){var resolvedURL=baseURL?resolveUrl(resourceURL,baseURL):resourceURL;return Promise.resolve(resolvedURL).then(function(url){return get?get(url):getBlobFromURL(url,options);}).then(function(data){if(typeof data==='string'){return makeDataUrl(data,getMimeType(resourceURL));}return makeDataUrl(data.blob,getMimeType(resourceURL)||data.contentType);}).then(function(dataURL){return cssText.replace(toRegex(resourceURL),"$1".concat(dataURL,"$3"));}).then(function(content){return content;},function(){return resolvedURL;});}function filterPreferredFontFormat(str,_ref3){var preferredFontFormat=_ref3.preferredFontFormat;return!preferredFontFormat?str:str.replace(FONT_SRC_REGEX,function(match){// eslint-disable-next-line no-constant-condition
  124. while(true){var _ref4=URL_WITH_FORMAT_REGEX.exec(match)||[],_ref5=_slicedToArray(_ref4,3),src=_ref5[0],format=_ref5[2];if(!format){return'';}if(format===preferredFontFormat){return"src: ".concat(src,";");}}});}function shouldEmbed(url){return url.search(URL_REGEX)!==-1;}function embedResources(cssText,baseUrl,options){return __awaiter$3(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee9(){var filteredCSSText;return regeneratorRuntime.wrap(function _callee9$(_context9){while(1){switch(_context9.prev=_context9.next){case 0:if(shouldEmbed(cssText)){_context9.next=2;break;}return _context9.abrupt("return",Promise.resolve(cssText));case 2:filteredCSSText=filterPreferredFontFormat(cssText,options);return _context9.abrupt("return",Promise.resolve(filteredCSSText).then(parseURLs).then(function(urls){return urls.reduce(function(deferred,url){return(// eslint-disable-next-line promise/no-nesting
  125. deferred.then(function(css){return embed(css,url,baseUrl,options);}));},Promise.resolve(filteredCSSText));}));case 4:case"end":return _context9.stop();}}},_callee9);}));}var __awaiter$2=globalThis&&globalThis.__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());});};function embedBackground(clonedNode,options){var _a;return __awaiter$2(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee10(){var background;return regeneratorRuntime.wrap(function _callee10$(_context10){while(1){switch(_context10.prev=_context10.next){case 0:background=(_a=clonedNode.style)===null||_a===void 0?void 0:_a.getPropertyValue('background');if(background){_context10.next=3;break;}return _context10.abrupt("return",Promise.resolve(clonedNode));case 3:return _context10.abrupt("return",Promise.resolve(background).then(function(cssString){return embedResources(cssString,null,options);}).then(function(cssString){clonedNode.style.setProperty('background',cssString,clonedNode.style.getPropertyPriority('background'));return clonedNode;}));case 4:case"end":return _context10.stop();}}},_callee10);}));}function embedImageNode(clonedNode,options){return __awaiter$2(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee11(){var src;return regeneratorRuntime.wrap(function _callee11$(_context11){while(1){switch(_context11.prev=_context11.next){case 0:if(!(!(clonedNode instanceof HTMLImageElement&&!isDataUrl(clonedNode.src))&&!(clonedNode instanceof SVGImageElement&&!isDataUrl(clonedNode.href.baseVal)))){_context11.next=2;break;}return _context11.abrupt("return",Promise.resolve(clonedNode));case 2:src=clonedNode instanceof HTMLImageElement?clonedNode.src:clonedNode.href.baseVal;return _context11.abrupt("return",Promise.resolve(src).then(function(url){return getBlobFromURL(url,options);}).then(function(data){return makeDataUrl(data.blob,getMimeType(src)||data.contentType);}).then(function(dataURL){return new Promise(function(resolve,reject){clonedNode.onload=resolve;clonedNode.onerror=reject;if(clonedNode instanceof HTMLImageElement){clonedNode.srcset='';clonedNode.src=dataURL;}else{clonedNode.href.baseVal=dataURL;}});}).then(function(){return clonedNode;},function(){return clonedNode;}));case 4:case"end":return _context11.stop();}}},_callee11);}));}function embedChildren(clonedNode,options){return __awaiter$2(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee12(){var children,deferreds;return regeneratorRuntime.wrap(function _callee12$(_context12){while(1){switch(_context12.prev=_context12.next){case 0:children=toArray(clonedNode.childNodes);// eslint-disable-next-line no-use-before-define
  126. deferreds=children.map(function(child){return embedImages(child,options);});return _context12.abrupt("return",Promise.all(deferreds).then(function(){return clonedNode;}));case 3:case"end":return _context12.stop();}}},_callee12);}));}function embedImages(clonedNode,options){return __awaiter$2(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee13(){return regeneratorRuntime.wrap(function _callee13$(_context13){while(1){switch(_context13.prev=_context13.next){case 0:if(clonedNode instanceof Element){_context13.next=2;break;}return _context13.abrupt("return",Promise.resolve(clonedNode));case 2:return _context13.abrupt("return",Promise.resolve(clonedNode).then(function(node){return embedBackground(node,options);}).then(function(node){return embedImageNode(node,options);}).then(function(node){return embedChildren(node,options);}));case 3:case"end":return _context13.stop();}}},_callee13);}));}function applyStyleWithOptions(node,options){var style=node.style;if(options.backgroundColor){style.backgroundColor=options.backgroundColor;}if(options.width){style.width="".concat(options.width,"px");}if(options.height){style.height="".concat(options.height,"px");}var manual=options.style;if(manual!=null){Object.keys(manual).forEach(function(key){style[key]=manual[key];});}return node;}var __awaiter$1=globalThis&&globalThis.__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 cssFetchCache={};function fetchCSS(url){var cache=cssFetchCache[url];if(cache!=null){return cache;}var deferred=window.fetch(url).then(function(res){return{url:url,cssText:res.text()};});cssFetchCache[url]=deferred;return deferred;}function embedFonts(meta){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee14(){return regeneratorRuntime.wrap(function _callee14$(_context14){while(1){switch(_context14.prev=_context14.next){case 0:return _context14.abrupt("return",meta.cssText.then(function(raw){var cssText=raw;var regexUrl=/url\(["']?([^"')]+)["']?\)/g;var fontLocs=cssText.match(/url\([^)]+\)/g)||[];var loadFonts=fontLocs.map(function(location){var url=location.replace(regexUrl,'$1');if(!url.startsWith('https://')){url=new URL(url,meta.url).href;}// eslint-disable-next-line promise/no-nesting
  127. // eslint-disable-next-line promise/no-nesting
  128. return window.fetch(url).then(function(res){return res.blob();}).then(function(blob){return new Promise(function(resolve,reject){var reader=new FileReader();reader.onloadend=function(){// Side Effect
  129. cssText=cssText.replace(location,"url(".concat(reader.result,")"));resolve([location,reader.result]);};reader.onerror=reject;reader.readAsDataURL(blob);});});});// eslint-disable-next-line promise/no-nesting
  130. // eslint-disable-next-line promise/no-nesting
  131. return Promise.all(loadFonts).then(function(){return cssText;});}));case 1:case"end":return _context14.stop();}}},_callee14);}));}function parseCSS(source){if(source==null){return[];}var result=[];var commentsRegex=/(\/\*[\s\S]*?\*\/)/gi;// strip out comments
  132. var cssText=source.replace(commentsRegex,'');var keyframesRegex=new RegExp('((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})','gi');// eslint-disable-next-line no-constant-condition
  133. while(true){var matches=keyframesRegex.exec(cssText);if(matches===null){break;}result.push(matches[0]);}cssText=cssText.replace(keyframesRegex,'');var importRegex=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi;// to match css & media queries together
  134. var combinedCSSRegex='((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]'+'*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})';// unified regex
  135. var unifiedRegex=new RegExp(combinedCSSRegex,'gi');// eslint-disable-next-line no-constant-condition
  136. while(true){var _matches=importRegex.exec(cssText);if(_matches===null){_matches=unifiedRegex.exec(cssText);if(_matches===null){break;}else{importRegex.lastIndex=unifiedRegex.lastIndex;}}else{unifiedRegex.lastIndex=importRegex.lastIndex;}result.push(_matches[0]);}return result;}function getCSSRules(styleSheets){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee15(){var ret,deferreds;return regeneratorRuntime.wrap(function _callee15$(_context15){while(1){switch(_context15.prev=_context15.next){case 0:ret=[];deferreds=[];// First loop inlines imports
  137. styleSheets.forEach(function(sheet){if('cssRules'in sheet){try{toArray(sheet.cssRules).forEach(function(item,index){if(item.type===CSSRule.IMPORT_RULE){var importIndex=index+1;var url=item.href;var deferred=fetchCSS(url).then(function(metadata){return metadata?embedFonts(metadata):'';}).then(function(cssText){return parseCSS(cssText).forEach(function(rule){try{sheet.insertRule(rule,rule.startsWith('@import')?importIndex+=1:sheet.cssRules.length);}catch(error){console.error('Error inserting rule from remote css',{rule:rule,error:error});}});}).catch(function(e){console.error('Error loading remote css',e.toString());});deferreds.push(deferred);}});}catch(e){var inline=styleSheets.find(function(a){return a.href==null;})||document.styleSheets[0];if(sheet.href!=null){deferreds.push(fetchCSS(sheet.href).then(function(metadata){return metadata?embedFonts(metadata):'';}).then(function(cssText){return parseCSS(cssText).forEach(function(rule){inline.insertRule(rule,sheet.cssRules.length);});}).catch(function(err){console.error('Error loading remote stylesheet',err.toString());}));}console.error('Error inlining remote css file',e.toString());}}});return _context15.abrupt("return",Promise.all(deferreds).then(function(){// Second loop parses rules
  138. styleSheets.forEach(function(sheet){if('cssRules'in sheet){try{toArray(sheet.cssRules).forEach(function(item){ret.push(item);});}catch(e){console.error("Error while reading CSS rules from ".concat(sheet.href),e.toString());}}});return ret;}));case 4:case"end":return _context15.stop();}}},_callee15);}));}function getWebFontRules(cssRules){return cssRules.filter(function(rule){return rule.type===CSSRule.FONT_FACE_RULE;}).filter(function(rule){return shouldEmbed(rule.style.getPropertyValue('src'));});}function parseWebFontRules(node){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee16(){return regeneratorRuntime.wrap(function _callee16$(_context16){while(1){switch(_context16.prev=_context16.next){case 0:return _context16.abrupt("return",new Promise(function(resolve,reject){if(node.ownerDocument==null){reject(new Error('Provided element is not within a Document'));}resolve(toArray(node.ownerDocument.styleSheets));}).then(function(styleSheets){return getCSSRules(styleSheets);}).then(getWebFontRules));case 1:case"end":return _context16.stop();}}},_callee16);}));}function getWebFontCSS(node,options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee17(){return regeneratorRuntime.wrap(function _callee17$(_context17){while(1){switch(_context17.prev=_context17.next){case 0:return _context17.abrupt("return",parseWebFontRules(node).then(function(rules){return Promise.all(rules.map(function(rule){var baseUrl=rule.parentStyleSheet?rule.parentStyleSheet.href:null;return embedResources(rule.cssText,baseUrl,options);}));}).then(function(cssTexts){return cssTexts.join('\n');}));case 1:case"end":return _context17.stop();}}},_callee17);}));}function embedWebFonts(clonedNode,options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee18(){return regeneratorRuntime.wrap(function _callee18$(_context18){while(1){switch(_context18.prev=_context18.next){case 0:return _context18.abrupt("return",(options.fontEmbedCSS!=null?Promise.resolve(options.fontEmbedCSS):getWebFontCSS(clonedNode,options)).then(function(cssText){var styleNode=document.createElement('style');var sytleContent=document.createTextNode(cssText);styleNode.appendChild(sytleContent);if(clonedNode.firstChild){clonedNode.insertBefore(styleNode,clonedNode.firstChild);}else{clonedNode.appendChild(styleNode);}return clonedNode;}));case 1:case"end":return _context18.stop();}}},_callee18);}));}var __awaiter=globalThis&&globalThis.__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());});};function getImageSize(node){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var width=options.width||getNodeWidth(node);var height=options.height||getNodeHeight(node);return{width:width,height:height};}function toSvg(node){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return __awaiter(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee19(){var _getImageSize,width,height;return regeneratorRuntime.wrap(function _callee19$(_context19){while(1){switch(_context19.prev=_context19.next){case 0:_getImageSize=getImageSize(node,options),width=_getImageSize.width,height=_getImageSize.height;return _context19.abrupt("return",Promise.resolve(node).then(function(nativeNode){return cloneNode(nativeNode,options,true);}).then(function(clonedNode){return embedWebFonts(clonedNode,options);}).then(function(clonedNode){return embedImages(clonedNode,options);}).then(function(clonedNode){return applyStyleWithOptions(clonedNode,options);}).then(function(clonedNode){return nodeToDataURL(clonedNode,width,height);}));case 2:case"end":return _context19.stop();}}},_callee19);}));}var dimensionCanvasLimit=16384;// as per https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size
  139. function checkCanvasDimensions(canvas){if(canvas.width>dimensionCanvasLimit||canvas.height>dimensionCanvasLimit){if(canvas.width>dimensionCanvasLimit&&canvas.height>dimensionCanvasLimit){if(canvas.width>canvas.height){canvas.height*=dimensionCanvasLimit/canvas.width;canvas.width=dimensionCanvasLimit;}else{canvas.width*=dimensionCanvasLimit/canvas.height;canvas.height=dimensionCanvasLimit;}}else if(canvas.width>dimensionCanvasLimit){canvas.height*=dimensionCanvasLimit/canvas.width;canvas.width=dimensionCanvasLimit;}else{canvas.width*=dimensionCanvasLimit/canvas.height;canvas.height=dimensionCanvasLimit;}}}function toCanvas(node){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return __awaiter(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee20(){return regeneratorRuntime.wrap(function _callee20$(_context20){while(1){switch(_context20.prev=_context20.next){case 0:return _context20.abrupt("return",toSvg(node,options).then(createImage).then(function(img){var canvas=document.createElement('canvas');var context=canvas.getContext('2d');var ratio=options.pixelRatio||getPixelRatio();var _getImageSize2=getImageSize(node,options),width=_getImageSize2.width,height=_getImageSize2.height;var canvasWidth=options.canvasWidth||width;var canvasHeight=options.canvasHeight||height;canvas.width=canvasWidth*ratio;canvas.height=canvasHeight*ratio;if(!options.skipAutoScale){checkCanvasDimensions(canvas);}canvas.style.width="".concat(canvasWidth);canvas.style.height="".concat(canvasHeight);if(options.backgroundColor){context.fillStyle=options.backgroundColor;context.fillRect(0,0,canvas.width,canvas.height);}context.drawImage(img,0,0,canvas.width,canvas.height);return canvas;}));case 1:case"end":return _context20.stop();}}},_callee20);}));}function toPng(node){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return __awaiter(this,void 0,void 0,/*#__PURE__*/regeneratorRuntime.mark(function _callee21(){return regeneratorRuntime.wrap(function _callee21$(_context21){while(1){switch(_context21.prev=_context21.next){case 0:return _context21.abrupt("return",toCanvas(node,options).then(function(canvas){return canvas.toDataURL();}));case 1:case"end":return _context21.stop();}}},_callee21);}));}var Share=defineComponent({name:'share',props:{teacherId:{type:Number}},data:function data(){return{qrCode:'',image:null};},mounted:function mounted(){var _this=this;this.qrCode=location.origin+'/student/#/inviteTeacher?id='+this.teacherId;this.$nextTick(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee22(){var container,image;return regeneratorRuntime.wrap(function _callee22$(_context22){while(1){switch(_context22.prev=_context22.next){case 0:container=document.getElementById('share-preview-container');_context22.next=3;return toPng(container);case 3:image=_context22.sent;_context22.next=6;return toPng(container);case 6:image=_context22.sent;_this.image=image;case 8:case"end":return _context22.stop();}}},_callee22);})));},methods:{shareShow:function shareShow(){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee23(){var image;return regeneratorRuntime.wrap(function _callee23$(_context23){while(1){switch(_context23.prev=_context23.next){case 0:image=_this2.image;if(image){postMessage({api:'shareAchievements',content:{title:'我在管乐迷使用AI智能云教练练习乐器',desc:'管乐迷AI智能云教练帮助我自主练习乐器,真的太好用啦!每天都要坚持练习哦~',image:image,video:'',type:'image'}},function(res){if(res&&res.content){Toast(res.content.message||(res.content.status?'分享成功':'分享失败'));}});}case 2:case"end":return _context23.stop();}}},_callee23);}))();}},render:function render(){var _this3=this;return createVNode(Fragment,null,[createVNode("div",{"class":styles$2.continue,"onClick":function onClick(){_this3.shareShow();}},[createTextVNode("\u5206\u4EAB")]),createVNode("div",{"class":styles$2.shareSection,"id":"share-preview-container"},[createVNode("div",{"class":styles$2.section},[createVNode(Cell,{"center":true,"border":false,"style":{padding:0}},{icon:function icon(){return createVNode("img",{"src":state.user.data.heardUrl||iconTeacher,"class":styles$2.img,"crossorigin":"anonymous"},null);},title:function title(){return createVNode("div",null,[createVNode("p",{"class":styles$2.name},[state.user.data.username]),createVNode("p",{"class":styles$2.titleTips},[createTextVNode("\u9177\u4E50\u79C0\u5165\u9A7B\u8001\u5E08")])]);}}),createVNode("p",{"class":[styles$2.txt,styles$2.teacherName]},[createVNode("span",null,[state.user.data.username]),createTextVNode("\u9080\u8BF7\u60A8\u52A0\u5165\u9177\u4E50\u79C0")]),createVNode("p",{"class":styles$2.txt},[createTextVNode("\u6765\u4E0E\u6211\u4E00\u8D77\u8E0F\u5165\u97F3\u4E50\u6BBF\u5802\u5427\uFF01")])]),createVNode("div",{"class":[styles$2.section,styles$2.download]},[createVNode("div",{"class":styles$2.logo},[createVNode("img",{"src":logo$1},null),createVNode("p",null,[createTextVNode("\u626B\u7801\u4E0B\u8F7D\u9177\u4E50\u79C0\u5F00\u542F\u6559\u5B66\u4E4B\u65C5")])]),createVNode("div",{"class":styles$2.qrcode},[createVNode(QrcodeVue,{"value":this.qrCode,"style":{width:'100%',height:'100%'}},null)])])])]);}});var label="_label_v8pn1_1";var studentList$1="_studentList_v8pn1_13";var btnGroup$1="_btnGroup_v8pn1_20";var styles$1={label:label,studentList:studentList$1,btnGroup:btnGroup$1};function _isSlot$1(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var StudentInfo=defineComponent({name:'myStudent',props:{courseId:Number,onSubmit:{type:Function,default:function _default(item){}}},data:function data(){return{searchStatus:false,openStatus:false,subjectList:[],list:[],dataShow:true,// 判断是否有数据
  140. loading:false,finished:false,params:{userName:'',subjectName:'全部声部',subjectId:null,page:1,rows:20},interfaceIds:[],userIdList:[]};},mounted:function mounted(){var _this4=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee24(){var res;return regeneratorRuntime.wrap(function _callee24$(_context24){while(1){switch(_context24.prev=_context24.next){case 0:_context24.prev=0;_context24.next=3;return request.get('/api-teacher/subject/subjectSelect');case 3:res=_context24.sent;_this4.subjectList=res.data||[];_context24.next=9;break;case 7:_context24.prev=7;_context24.t0=_context24["catch"](0);case 9:_context24.next=11;return _this4.getExistList();case 11:_context24.next=13;return _this4.getList();case 13:case"end":return _context24.stop();}}},_callee24,null,[[0,7]]);}))();},methods:{onSort:function onSort(){this.params.page=1;this.list=[];this.dataShow=true;// 判断是否有数据
  141. this.loading=false;this.finished=false;this.searchStatus=false;this.getList();},onSearch:function onSearch(val){this.params.userName=val;this.onSort();},getExistList:function getExistList(){var _this5=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee25(){var res,rows,userIdList;return regeneratorRuntime.wrap(function _callee25$(_context25){while(1){switch(_context25.prev=_context25.next){case 0:_context25.prev=0;_context25.next=3;return request.post('/api-teacher/courseSchedule/selectStudent',{data:{courseId:_this5.courseId,page:1,rows:20}});case 3:res=_context25.sent;rows=res.data.rows||[];userIdList=rows.map(function(item){return item.userId;});_this5.interfaceIds=_toConsumableArray(userIdList);_this5.userIdList=_toConsumableArray(userIdList);_context25.next=12;break;case 10:_context25.prev=10;_context25.t0=_context25["catch"](0);case 12:case"end":return _context25.stop();}}},_callee25,null,[[0,10]]);}))();},getList:function getList(){var _this6=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee26(){var res,result,rows;return regeneratorRuntime.wrap(function _callee26$(_context26){while(1){switch(_context26.prev=_context26.next){case 0:_context26.prev=0;_context26.next=3;return request.post('/api-teacher/courseSchedule/selectStudent',{data:_this6.params});case 3:res=_context26.sent;_this6.loading=false;result=res.data||{};// 处理重复请求数据
  142. if(!(_this6.list.length>0&&result.pageNo===1)){_context26.next=8;break;}return _context26.abrupt("return");case 8:rows=result.rows||[];rows.forEach(function(n){if(_this6.userIdList.includes(n.userId)){n.checked=true;}else{n.checked=false;}});_this6.list=_this6.list.concat(rows||[]);_this6.finished=result.pageNo>=result.totalPage;_this6.params.page=result.pageNo+1;_this6.dataShow=_this6.list.length>0;_context26.next=20;break;case 16:_context26.prev=16;_context26.t0=_context26["catch"](0);_this6.dataShow=false;_this6.finished=true;case 20:case"end":return _context26.stop();}}},_callee26,null,[[0,16]]);}))();},equar:function equar(a,b){// 判断数组的长度
  143. if(a.length!==b.length){return false;}else{// 循环遍历数组的值进行比较
  144. for(var _i2=0;_i2<a.length;_i2++){if(a[_i2]!==b[_i2]){return false;}}return true;}},nextSubmit:function nextSubmit(){var _this7=this;if(this.userIdList.length<=0){return Toast('请至少选择一个学员');}if(this.equar(this.interfaceIds,this.userIdList)){return Toast('您未调整学员');}var addStudentIds=this.userIdList.filter(function(item){return!_this7.interfaceIds.includes(item)&&item;});var removeStudentIds=this.interfaceIds.filter(function(item){return!_this7.userIdList.includes(item)&&item;});console.log(addStudentIds,removeStudentIds);var addStudents=[];var removeStudents=[];this.list.forEach(function(item){if(addStudentIds.includes(item.userId)){addStudents.push(item);}if(removeStudentIds.includes(item.userId)){removeStudents.push(item);}});console.log(addStudents,removeStudents);this.onSubmit({addStudents:addStudents,removeStudents:removeStudents,userIdList:this.userIdList});},onCheckbox:function onCheckbox(item){if(!item.checked&&this.userIdList.length>=7){return Toast('学生已达上限');}item.checked=!item.checked;var isExist=this.userIdList.includes(item.userId);if(item.checked){!isExist&&this.userIdList.push(item.userId);}else{isExist&&this.userIdList.splice(this.userIdList.indexOf(item.userId),1);}}},render:function render(){var _this8=this;var _slot;return createVNode(Fragment,null,[createVNode(ColSearch,{"placeholder":"请输入学员名称","onSearch":this.onSearch},{left:function left(){return createVNode("div",{"class":styles$1.label,"onClick":function onClick(){_this8.searchStatus=!_this8.searchStatus;_this8.openStatus=!_this8.openStatus;}},[_this8.params.subjectName,createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":12,"color":"#333"},null)]);}}),createVNode("div",{"class":styles$1.studentList},[this.dataShow?createVNode(List,{"loading":this.loading,"onUpdate:loading":function onUpdateLoading($event){return _this8.loading=$event;},"finished":this.finished,"finishedText":" ","class":['mb12'],"immediateCheck":false,"onLoad":this.getList},_isSlot$1(_slot=this.list.map(function(item){return createVNode(Student,{"item":{userName:item.userName,subjectName:item.subjectName,avatar:item.avatar},"onClick":function onClick(){_this8.onCheckbox(item);}},{default:function _default(){return[createVNode(Checkbox,{"modelValue":item.checked,"onUpdate:modelValue":function onUpdateModelValue($event){return item.checked=$event;},"name":item.userId,"onClick":function onClick(){_this8.onCheckbox(item);}},null)];}});}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无学员"},null)]),createVNode(Popup,{"show":this.searchStatus,"position":"bottom","round":true,"closeable":true,"safe-area-inset-bottom":true,"onClose":function onClose(){return _this8.searchStatus=false;},"onClosed":function onClosed(){return _this8.openStatus=false;}},{default:function _default(){return[_this8.openStatus&&createVNode(OrganSearch,{"subjectList":_this8.subjectList,"onSort":_this8.onSort,"isReset":true,"modelValue":_this8.params.subjectId,"onUpdate:modelValue":function onUpdateModelValue($event){return _this8.params.subjectId=$event;},"subjectName":_this8.params.subjectName,"onUpdate:subjectName":function onUpdateSubjectName($event){return _this8.params.subjectName=$event;}},null)];}}),createVNode("div",{"class":styles$1.btnGroup},[createVNode(Button,{"type":"primary","round":true,"block":true,"onClick":this.nextSubmit},{default:function _default(){return[createTextVNode("\u4E0B\u4E00\u6B65")];}})])]);}});var confirmTitle="_confirmTitle_yqlm2_1";var timer="_timer_yqlm2_8";var addTitle="_addTitle_yqlm2_11";var calc="_calc_yqlm2_12";var studentList="_studentList_yqlm2_26";var btnGroup="_btnGroup_yqlm2_30";var styles={confirmTitle:confirmTitle,timer:timer,addTitle:addTitle,calc:calc,studentList:studentList,btnGroup:btnGroup};var StudentConfirm=defineComponent({name:'studentConfirm',props:{courseInfo:{type:Object,default:{}},studentObject:{type:Object,default:{}},onSubmit:{type:Function,default:function _default(item){}}},computed:{timer:function timer(){var item=this.courseInfo;return dayjs(item.startTime).format('YYYY/MM/DD HH:mm')+' ~ '+dayjs(item.endTime).format('HH:mm');},addStudents:function addStudents(){var addStudents=this.studentObject.addStudents;return addStudents||[];},removeStudents:function removeStudents(){var removeStudents=this.studentObject.removeStudents;return removeStudents||[];},calcTimer:function calcTimer(){var _this$studentObject=this.studentObject,addStudents=_this$studentObject.addStudents,removeStudents=_this$studentObject.removeStudents;var singleCourseTime=this.courseInfo.singleCourseTime;var suffix=addStudents.length-removeStudents.length;console.log(suffix,singleCourseTime);var type=suffix>=0?'add':'remove';return{type:type,mins:Math.abs(suffix*singleCourseTime)};}},render:function render(){var _this9=this;return createVNode("div",{"class":styles.studentConfirm},[createVNode("div",{"class":[styles.confirmTitle,'van-hairline--bottom']},[createVNode("p",null,[createTextVNode("\u60A8\u5C06\u4E3A"),this.courseInfo.groupName]),createVNode("p",{"class":styles.timer},[this.timer])]),createVNode("div",{"class":styles.studentList},[this.addStudents.length>0&&createVNode(Fragment,null,[createVNode("p",{"class":styles.addTitle},[createTextVNode("\u6DFB\u52A0\u5B66\u5458 "),createVNode("span",null,[this.addStudents.length]),createTextVNode(" \u540D")]),this.addStudents.map(function(item){return createVNode(Student,{"border":false,"item":item},null);})]),this.removeStudents.length>0&&createVNode(Fragment,null,[createVNode("p",{"class":styles.addTitle},[createTextVNode("\u79FB\u9664\u5B66\u5458 "),createVNode("span",null,[this.removeStudents.length]),createTextVNode(" \u540D")]),this.removeStudents.map(function(item){return createVNode(Student,{"border":false,"item":item},null);})])]),createVNode("p",{"class":styles.calc},[createTextVNode("\u8C03\u6574\u540E\u5C06"),this.calcTimer.type==='remove'?'释放':'冻结',' ',createVNode("span",null,[this.calcTimer.mins]),createTextVNode(" \u5206\u949F")]),createVNode("div",{"class":styles.btnGroup},[createVNode(Button,{"type":"primary","round":true,"block":true,"onClick":function onClick(){var userIdList=_this9.studentObject.userIdList;_this9.onSubmit(userIdList);}},{default:function _default(){return[createTextVNode("\u786E\u8BA4\u8C03\u6574")];}})])]);}});function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var getAssetsHomeFile=exports('getAssetsHomeFile',function(fileName){var path="./images/".concat(fileName);var modules={"./images/icon_arrow.png":__glob_8_0,"./images/icon_class_plan.png":__glob_8_1,"./images/icon_freeze_timer.png":__glob_8_2,"./images/icon_invite_student.png":__glob_8_3,"./images/icon_last_timer.png":__glob_8_4,"./images/icon_message.png":__glob_8_5,"./images/icon_music_account.png":__glob_8_6,"./images/icon_num.png":__glob_8_7,"./images/icon_tips.png":__glob_8_8,"./images/logo.png":__glob_8_9,"./images/room_bg.png":__glob_8_10,"./images/share_bg.png":__glob_8_11};return modules[path].default;});var index=exports('default',defineComponent({name:'PianoRoom',data:function data(){return{shareStatus:false,teacherId:0,typeStatus:false,courseTxt:'所有课程',actions:[{name:'所有课程'},{name:'未开始',status:'NOT_START'},{name:'进行中',status:'ING'},{name:'已完成',status:'COMPLETE'},{name:'已取消',status:'CANCEL'}],remain:{frozenTime:0,remainTime:0,studentCount:0},list:[],dataShow:true,// 判断是否有数据
  145. loading:false,finished:false,monthTxt:dayjs().format('YYYY年MM月'),month:new Date(),params:{status:'',month:dayjs().format('YYYY-MM'),page:1,rows:20},timeShow:false,timeUpdateStatus:false,timeUpdateInfo:{},timeUpdateTimer:new Date(),studentStatus:false,studentConfirm:false,studentChangeObject:{},background:'transparent',setLoading:false};},mounted:function mounted(){var _this10=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee27(){return regeneratorRuntime.wrap(function _callee27$(_context27){while(1){switch(_context27.prev=_context27.next){case 0:_context27.next=2;return _this10._init();case 2:_context27.next=4;return _this10.getList();case 4:useEventListener(document,'scroll',function(evt){var _useWindowScroll=useWindowScroll(),y=_useWindowScroll.y;if(y.value>45){_this10.background='#fff';}else{_this10.background='transparent';}});case 5:case"end":return _context27.stop();}}},_callee27);}))();},methods:{_init:function _init(){var _this11=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee28(){var res,_ref7,frozenTime,remainTime,_studentCount,teacherId;return regeneratorRuntime.wrap(function _callee28$(_context28){while(1){switch(_context28.prev=_context28.next){case 0:_context28.prev=0;_context28.next=3;return request.get('/api-teacher/courseSchedule/selectRemainTime');case 3:res=_context28.sent;// console.log(res)
  146. _ref7=res.data||{},frozenTime=_ref7.frozenTime,remainTime=_ref7.remainTime,_studentCount=_ref7.studentCount,teacherId=_ref7.teacherId;_this11.remain={frozenTime:frozenTime||0,remainTime:remainTime||0,studentCount:_studentCount||0};_this11.teacherId=teacherId;_context28.next=11;break;case 9:_context28.prev=9;_context28.t0=_context28["catch"](0);case 11:case"end":return _context28.stop();}}},_callee28,null,[[0,9]]);}))();},onSearch:function onSearch(){this.dataShow=true;this.loading=false;this.finished=false;this.list=[];this.params.page=1;this.getList();},onSelect:function onSelect(item){this.courseTxt=item.name;this.params.status=item.status||'';this.onSearch();},getList:function getList(){var _this12=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee29(){var res,result;return regeneratorRuntime.wrap(function _callee29$(_context29){while(1){switch(_context29.prev=_context29.next){case 0:_context29.prev=0;if(!_this12.setLoading){_context29.next=3;break;}return _context29.abrupt("return");case 3:_this12.setLoading=true;_context29.next=6;return request.post('/api-teacher/courseSchedule/selectCourseList',{data:_this12.params});case 6:res=_context29.sent;_this12.setLoading=false;_this12.loading=false;result=res.data||{};// 处理重复请求数据
  147. if(!(_this12.list.length>0&&result.pageNo===1)){_context29.next=12;break;}return _context29.abrupt("return");case 12:_this12.list=_this12.list.concat(result.rows||[]);_this12.finished=result.pageNo>=result.totalPage;_this12.params.page=result.pageNo+1;_this12.dataShow=_this12.list.length>0;_context29.next=22;break;case 18:_context29.prev=18;_context29.t0=_context29["catch"](0);_this12.dataShow=false;_this12.finished=true;case 22:case"end":return _context29.stop();}}},_callee29,null,[[0,18]]);}))();},onCourseDelete:function onCourseDelete(item){var _this13=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee31(){return regeneratorRuntime.wrap(function _callee31$(_context31){while(1){switch(_context31.prev=_context31.next){case 0:try{Dialog.confirm({title:'提示',message:'确定删除该课程吗?',confirmButtonColor:'var(--van-primary)'}).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee30(){return regeneratorRuntime.wrap(function _callee30$(_context30){while(1){switch(_context30.prev=_context30.next){case 0:_context30.next=2;return request.post('/api-teacher/courseSchedule/deleteCourse',{data:{courseId:item.courseId}});case 2:console.log('删除成功');Toast('课程删除成功');_this13.onSearch();case 5:case"end":return _context30.stop();}}},_callee30);})));}catch(_unused6){}case 1:case"end":return _context31.stop();}}},_callee31);}))();},onTimeUpdateChange:function onTimeUpdateChange(item){var _this14=this;try{Dialog.confirm({title:'提示',message:'确定调整该课程吗?',confirmButtonColor:'var(--van-primary)'}).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee32(){var _this14$timeUpdateInf,courseId,singleCourseTime,startTime,endTime;return regeneratorRuntime.wrap(function _callee32$(_context32){while(1){switch(_context32.prev=_context32.next){case 0:_this14$timeUpdateInf=_this14.timeUpdateInfo,courseId=_this14$timeUpdateInf.courseId,singleCourseTime=_this14$timeUpdateInf.singleCourseTime;startTime=dayjs(item).format('YYYY-MM-DD HH:mm:ss');endTime=dayjs(item).add(singleCourseTime,'minute').format('YYYY-MM-DD HH:mm:ss');_context32.next=5;return request.post('/api-teacher/courseSchedule/updateCourseTime',{data:{courseId:courseId,startTime:startTime,endTime:endTime}});case 5:_this14.timeUpdateStatus=false;Toast('课程调整成功');_this14.onSearch();case 8:case"end":return _context32.stop();}}},_callee32);})));}catch(_unused7){}},onStudentChange:function onStudentChange(item){var _this15=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee34(){var courseId;return regeneratorRuntime.wrap(function _callee34$(_context34){while(1){switch(_context34.prev=_context34.next){case 0:_context34.prev=0;courseId=_this15.timeUpdateInfo.courseId;_context34.next=4;return request.post('/api-teacher/courseSchedule/updateCourseStudent',{data:{studentIds:item,courseId:courseId}});case 4:_this15.studentConfirm=false;Toast('学生调整成功');setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee33(){return regeneratorRuntime.wrap(function _callee33$(_context33){while(1){switch(_context33.prev=_context33.next){case 0:_context33.next=2;return _this15._init();case 2:_this15.onSearch();case 3:case"end":return _context33.stop();}}},_callee33);})),1000);_context34.next=11;break;case 9:_context34.prev=9;_context34.t0=_context34["catch"](0);case 11:case"end":return _context34.stop();}}},_callee34,null,[[0,9]]);}))();},onTeacherAuth:function onTeacherAuth(callBack){// 是否老师认证
  148. // 老师入驻状态 0、未申请 UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过,可用值:UNPAALY,DOING,PASS,UNPASS
  149. var data=state.user.data;if(data.entryStatus==='PASS'){callBack&&callBack();}else if(data.entryStatus==='DOING'){Toast('认证审核中,请稍后再试');}else{this.$router.push('/teacherCert');}}},render:function render(){var _this16=this;var _slot;return createVNode(Fragment,null,[createVNode("div",{"class":styles$3.roomHeader},[createVNode(ColHeader,{"background":this.background,"rightText":"课程记录","onClickRight":function onClickRight(){_this16.$router.push('/courseRecord');},"border":false},null),createVNode(Row,{"class":styles$3.countTimer},{default:function _default(){return[createVNode(Col,{"span":9},{default:function _default(){return[createVNode("p",{"class":styles$3.timer},[_this16.remain.remainTime,createVNode("span",null,[createTextVNode("\u5206\u949F")])]),createVNode("p",{"class":styles$3.title},[createVNode("img",{"src":getAssetsHomeFile('icon_last_timer.png')},null),createVNode("span",null,[createTextVNode("\u7434\u623F\u5269\u4F59\u65F6\u957F")])])];}}),createVNode(Col,{"span":9},{default:function _default(){return[createVNode("p",{"class":styles$3.timer},[_this16.remain.frozenTime,createVNode("span",null,[createTextVNode("\u5206\u949F")])]),createVNode("p",{"class":styles$3.title},[createVNode("img",{"src":getAssetsHomeFile('icon_freeze_timer.png')},null),createVNode("span",null,[createTextVNode("\u51BB\u7ED3\u65F6\u957F")])])];}}),createVNode(Col,{"span":6},{default:function _default(){return[createVNode(Button,{"type":"primary","round":true,"size":"small","class":styles$3.chargeTimer,"onClick":function onClick(){_this16.onTeacherAuth(function(){_this16.$router.push({path:'/accountRechargeTimer'});});}},{default:function _default(){return[createTextVNode("\u65F6\u957F\u5145\u503C"),createVNode("img",{"src":getAssetsHomeFile('icon_arrow.png')},null)];}})];}})];}}),createVNode(CellGroup,{"class":styles$3.studentList,"border":false},{default:function _default(){return[createVNode(Cell,{"title":"\u6211\u7684\u5B66\u5458 ".concat(_this16.remain.studentCount," \u4EBA"),"titleClass":styles$3.studentCount,"isLink":true,"to":'/myStudent',"border":false},null),createVNode(Cell,{"valueClass":styles$3.btnGroupInvite},{default:function _default(){return[createVNode(Button,{"color":"#E0F7F3","round":true,"block":true,"onClick":function onClick(){_this16.onTeacherAuth(function(){_this16.shareStatus=true;});}},{default:function _default(){return[createVNode("img",{"src":getAssetsHomeFile('icon_invite_student.png')},null),createTextVNode("\u9080\u8BF7\u5B66\u5458")];}}),createVNode(Button,{"color":"#E0F7F3","round":true,"block":true,"onClick":function onClick(){_this16.onTeacherAuth(function(){_this16.$router.push('/classArrangement');});}},{default:function _default(){return[createVNode("img",{"src":getAssetsHomeFile('icon_class_plan.png')},null),createTextVNode("\u6392\u8BFE")];}})];}})];}})]),createVNode("div",{"class":styles$3.searchList},[createVNode("div",{"class":styles$3.dataItem,"onClick":function onClick(){_this16.timeShow=true;}},[this.monthTxt,createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":8,"style":{marginLeft:'4px'},"color":"#CCCCCC"},null)]),createVNode("div",{"class":styles$3.dataItem,"onClick":function onClick(){_this16.typeStatus=true;}},[this.courseTxt,createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":8,"style":{marginLeft:'4px'},"color":"#CCCCCC"},null)])]),this.dataShow?createVNode(List,{"loading":this.loading,"onUpdate:loading":function onUpdateLoading($event){return _this16.loading=$event;},"finished":this.finished,"finishedText":" ","class":[styles$3.liveList,'mb12'],"immediateCheck":false,"onLoad":this.getList},_isSlot(_slot=this.list.map(function(item){return createVNode(Course,{"item":item,"operation":item.status==='NOT_START'?true:false,"onCourseDelete":_this16.onCourseDelete,"onStudentAdjust":function onStudentAdjust(item){console.log(item);_this16.timeUpdateInfo=item;_this16.studentStatus=true;},"onTimeAdjust":function onTimeAdjust(item){_this16.timeUpdateInfo=item;_this16.timeUpdateTimer=dayjs(item.startTime).toDate();_this16.timeUpdateStatus=true;}},null);}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无课程"},null),createVNode(Popup,{"position":"bottom","show":this.timeShow,"onUpdate:show":function onUpdateShow($event){return _this16.timeShow=$event;},"round":true},{default:function _default(){return[createVNode("div",{"class":styles$3.picker},[createVNode(DatetimePicker,{"modelValue":_this16.month,"onUpdate:modelValue":function onUpdateModelValue($event){return _this16.month=$event;},"type":"year-month","formatter":formatterDate,"onConfirm":function onConfirm(item){_this16.monthTxt=dayjs(item).format('YYYY年MM月');_this16.params.month=dayjs(item).format('YYYY-MM');_this16.timeShow=false;_this16.onSearch();},"onCancel":function onCancel(){return _this16.timeShow=false;}},null)])];}}),createVNode(Popup,{"position":"bottom","show":this.timeUpdateStatus,"onUpdate:show":function onUpdateShow($event){return _this16.timeUpdateStatus=$event;},"round":true},{default:function _default(){return[createVNode("div",{"class":styles$3.picker},[createVNode(DatetimePicker,{"modelValue":_this16.timeUpdateTimer,"onUpdate:modelValue":function onUpdateModelValue($event){return _this16.timeUpdateTimer=$event;},"type":"datetime","formatter":formatterDate,"onConfirm":function onConfirm(item){_this16.onTimeUpdateChange(item);},"onCancel":function onCancel(){return _this16.timeUpdateStatus=false;}},null)])];}}),createVNode(ActionSheet,{"show":this.typeStatus,"onUpdate:show":function onUpdateShow($event){return _this16.typeStatus=$event;},"actions":this.actions,"closeOnClickAction":true,"cancelText":"取消","onSelect":this.onSelect,"onCancel":function onCancel(){_this16.typeStatus=false;}},null),createVNode(Popup,{"show":this.shareStatus,"onUpdate:show":function onUpdateShow($event){return _this16.shareStatus=$event;},"round":true},{default:function _default(){return[createVNode(Share,{"teacherId":_this16.teacherId},null)];}}),createVNode(Popup,{"show":this.studentStatus,"onUpdate:show":function onUpdateShow($event){return _this16.studentStatus=$event;},"position":"bottom","round":true},{default:function _default(){return[_this16.studentStatus&&createVNode(StudentInfo,{"courseId":_this16.timeUpdateInfo.courseId,"onSubmit":function onSubmit(item){_this16.studentChangeObject=item;_this16.studentStatus=false;_this16.studentConfirm=true;}},null)];}}),createVNode(Popup,{"show":this.studentConfirm,"onUpdate:show":function onUpdateShow($event){return _this16.studentConfirm=$event;},"position":"bottom","round":true,"closeable":true},{default:function _default(){return[createVNode(StudentConfirm,{"courseInfo":_this16.timeUpdateInfo,"studentObject":_this16.studentChangeObject,"onSubmit":function(){var _onSubmit=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee35(item){return regeneratorRuntime.wrap(function _callee35$(_context35){while(1){switch(_context35.prev=_context35.next){case 0:_context35.next=2;return _this16.onStudentChange(item);case 2:_context35.next=4;return _this16._init();case 4:case"end":return _context35.stop();}}},_callee35);}));function onSubmit(_x){return _onSubmit.apply(this,arguments);}return onSubmit;}()},null)];}})]);}}));}};});})();