;(function(){function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;ispan{display:block;color:#212121;font-size:16px;padding-bottom:15px}._operation_107z7_44{font-size:24px;display:flex;align-items:center;margin-top:20px}._operation_107z7_44>i{margin-left:12px;cursor:pointer}._operation_107z7_44 ._icon-rate_107z7_54{display:inline-block;width:20px;height:20px;background:url(./images/icon_rate.png) no-repeat center;background-size:contain}._vue-cropper_107z7_61{border-radius:5px;overflow:hidden}:deep(._el-dialog_107z7_65){margin-bottom:10vh}:deep(._el-dialog_107z7_65) ._el-dialog__header_107z7_68{background:#fff;padding:15px 20px}:deep(._el-dialog_107z7_65) ._el-dialog__header_107z7_68 ._el-dialog__title_107z7_72{color:#212121}:deep(._el-dialog_107z7_65) ._el-dialog__header_107z7_68 ._el-dialog__headerbtn_107z7_75 ._el-dialog__close_107z7_75{color:#212121}:deep(._el-dialog_107z7_65) ._el-dialog__body_107z7_78{padding-top:0}.before{max-width:400px!important;max-height:400px!important;overflow:hidden}#_myImages_107z7_1{max-width:400px;display:block;width:400px;min-height:400px}.vue-cropper[data-v-be5e5ddc]{position:relative;width:100%;height:100%;box-sizing:border-box;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;direction:ltr;touch-action:none;text-align:left;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-box[data-v-be5e5ddc],.cropper-box-canvas[data-v-be5e5ddc],.cropper-drag-box[data-v-be5e5ddc],.cropper-crop-box[data-v-be5e5ddc],.cropper-face[data-v-be5e5ddc]{position:absolute;top:0;right:0;bottom:0;left:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cropper-box-canvas img[data-v-be5e5ddc]{position:relative;text-align:left;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:none;max-width:none;max-height:none}.cropper-box[data-v-be5e5ddc]{overflow:hidden}.cropper-move[data-v-be5e5ddc]{cursor:move}.cropper-crop[data-v-be5e5ddc]{cursor:crosshair}.cropper-modal[data-v-be5e5ddc]{background:rgba(0,0,0,.5)}.cropper-view-box[data-v-be5e5ddc]{display:block;overflow:hidden;width:100%;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);-webkit-user-select:none;-moz-user-select:none;user-select:none}.cropper-view-box img[data-v-be5e5ddc]{-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:left;max-width:none;max-height:none}.cropper-face[data-v-be5e5ddc]{top:0;left:0;background-color:#fff;opacity:.1}.crop-info[data-v-be5e5ddc]{position:absolute;left:0px;min-width:65px;text-align:center;color:#fff;line-height:20px;background-color:rgba(0,0,0,.8);font-size:12px}.crop-line[data-v-be5e5ddc]{position:absolute;display:block;width:100%;height:100%;opacity:.1}.line-w[data-v-be5e5ddc]{top:-3px;left:0;height:5px;cursor:n-resize}.line-a[data-v-be5e5ddc]{top:0;left:-3px;width:5px;cursor:w-resize}.line-s[data-v-be5e5ddc]{bottom:-3px;left:0;height:5px;cursor:s-resize}.line-d[data-v-be5e5ddc]{top:0;right:-3px;width:5px;cursor:e-resize}.crop-point[data-v-be5e5ddc]{position:absolute;width:8px;height:8px;opacity:.75;background-color:#39f;border-radius:100%}.point1[data-v-be5e5ddc]{top:-4px;left:-4px;cursor:nw-resize}.point2[data-v-be5e5ddc]{top:-5px;left:50%;margin-left:-3px;cursor:n-resize}.point3[data-v-be5e5ddc]{top:-4px;right:-4px;cursor:ne-resize}.point4[data-v-be5e5ddc]{top:50%;left:-4px;margin-top:-3px;cursor:w-resize}.point5[data-v-be5e5ddc]{top:50%;right:-4px;margin-top:-3px;cursor:e-resize}.point6[data-v-be5e5ddc]{bottom:-5px;left:-4px;cursor:sw-resize}.point7[data-v-be5e5ddc]{bottom:-5px;left:50%;margin-left:-3px;cursor:s-resize}.point8[data-v-be5e5ddc]{bottom:-5px;right:-4px;cursor:se-resize}@media screen and (max-width: 500px){.crop-point[data-v-be5e5ddc]{position:absolute;width:20px;height:20px;opacity:.45;background-color:#39f;border-radius:100%}.point1[data-v-be5e5ddc]{top:-10px;left:-10px}.point2[data-v-be5e5ddc],.point4[data-v-be5e5ddc],.point5[data-v-be5e5ddc],.point7[data-v-be5e5ddc]{display:none}.point3[data-v-be5e5ddc]{top:-10px;right:-10px}.point4[data-v-be5e5ddc]{top:0;left:0}.point6[data-v-be5e5ddc]{bottom:-10px;left:-10px}.point8[data-v-be5e5ddc]{bottom:-10px;right:-10px}}/*!\n * Cropper.js v1.5.12\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2021-06-12T08:00:11.623Z\n */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:before,.cropper-center:after{background-color:#eee;content:\" \";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width: 768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width: 992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width: 1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:\" \";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}\n";document.head.appendChild(__vite_style__);System.register(['./index-legacy.ae6b81dc.js','./vendor-legacy.7f609859.js'],function(exports){'use strict';var request,commonjsGlobal,getDefaultExportFromCjs,defineComponent,ElMessage,createVNode,ElDialog,ElRow,ElCol,createTextVNode,ElButton,ElUpload,ElImage;return{setters:[function(module){request=module.r;},function(module){commonjsGlobal=module.af;getDefaultExportFromCjs=module.ag;defineComponent=module.d;ElMessage=module.E;createVNode=module.c;ElDialog=module.K;ElRow=module.q;ElCol=module.v;createTextVNode=module.a;ElButton=module.k;ElUpload=module.ah;ElImage=module.x;}],execute:function execute(){var uploadSection="_uploadSection_107z7_1";var uploadClass="_uploadClass_107z7_11";var previewImg="_previewImg_107z7_34";var operation="_operation_107z7_44";var myImages="_myImages_107z7_1";var styles={uploadSection:uploadSection,uploadClass:uploadClass,"avatar-upload-preview_range":"_avatar-upload-preview_range_107z7_19","avatar-upload-preview":"_avatar-upload-preview_107z7_19",previewImg:previewImg,operation:operation,"icon-rate":"_icon-rate_107z7_54","vue-cropper":"_vue-cropper_107z7_61","el-dialog":"_el-dialog_107z7_65","el-dialog__header":"_el-dialog__header_107z7_68","el-dialog__title":"_el-dialog__title_107z7_72","el-dialog__headerbtn":"_el-dialog__headerbtn_107z7_75","el-dialog__close":"_el-dialog__close_107z7_75","el-dialog__body":"_el-dialog__body_107z7_78",myImages:myImages};var iconUpload=exports('i',"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAA4CAMAAAB6xg5AAAAAAXNSR0IArs4c6QAAAsRQTFRFAAAAAP8AAP//AICAAP+AAP//AKqqVaqqVf+qAL+/QL+/M8yZKqqqKtWqJNu2IN+/HMaqM8yZM8yzLtGiLtG5Kr+qJMikML+fMM+vM8ymLMixKcKjKcKtKcytJ8SnJ86xMcSnL8aqLsitLMqwKsOqKcWtMMenMMevLsmqLcOtLcutLMWoK8aqKcilKcisMMisL8moLsSqLcysLMeuK8iqL8qsLcaqLMisK8moK8muMMqqL8usLMmsL8yqLsmrLcqpLcqtLcaqK8ipLcepK8apK8msLcerLMmqLMaoLMmrLsepLcWoLcapLMaqLsipLsisLsWqLMepLMeqLsirLcerLsarLsmrLceqLcqqLMisLsmqLserLcesLciqLcmrLcipLcisLcaqLMepLMesLMaqLsiqLsirLMirLMipLcerLcmrLciqLMepLseqLsmqLcipLcirLMepLcapLcepLMeqLMiqLsiqLsipLceqLcerLcipLsiqLsepLcepLceqLcirLMirLMeqLcerLcirLcepLcisLserLsiqLcerLceqLcirLMepLcerLciqLMeqLceqLciqLcirLceqLMepLseqLserLcaqLciqLceqLceqLceqLMiqLsiqLcirLceqLcepLceqLcaqLciqLsaqLMepLsiqLceqLcerLceqLciqLseqLcerLceqLceqLciqLceqLceqLciqLceqLcaqLcirLMeqLceqLceqLcerLciqLcepLceqLciqLMeqLMeqLceqLceqLcirLceqLciqLceqLMeqLMerLMaqLceqLcirLceqLceqLceqLceqLceqLMiqLMeqLceqLcepLceqLceqLMeqLMeqLcaqLceqLceqLceqLceqLMepLMeqLceqLcaqLceqLciqLcepLceqLcerLceqLMeqLMiqLciqLceqLcirLceqkeY/1AAAAOt0Uk5TAAEBAgICAwMDBAQFBgYHCAkKCgsLDA4QEBQXGRkZGhoaGxwdHh8gICEiIiMkJSUlJicoKSorLS4vLzAxNDw9Pj4/QURHR0lLTExNT1BRU1NUVldYW15eYGBiY2RlZmdra2xubm9vcHN0dnZ4ent7fX2AgoOEioqMjY6PkJGSk5SVlpqdnp+goqSlpqepqqyur7CxsrOztLS1tre4uLm6u7y9vb2+vr+/wMLExcrMzM3O0NLU1NXV1tfY2dnZ2tvb3N3e3t/g4OHj4+Tl5+jq6+zt7u7w8fLz8/T19vf39/j5+fr6+/z9/f3+/ne0wvQAAAMbSURBVEjHnZb5W0xRGMdfyVjSqMiSfUsGCZUoS4WyZkkiS6Hs+55s2RIp+74rW5aIsmUP2WWUBoWS6fwT7n3vzG3uzD1z79z3p3M+53w/zzxz3nOeC2BrheUVHfME5RVYSQh55krf0Hz2xkTL2jS3nWF9J2FrODU/vYSI14853IZ0nEXT8lFVhFozcEeGVYHTJ3qeFDeWFowk1ipcWrCVltUu9XWpZScpUH2g5O958HusCgZQ8jqmcTRRMVgPkaTgOHp0Iz5bz5WptRRBAkBEqejK066YDk5+W2nt3wsCN1p7nGDiTfcTidJAKG2pFKDJHak88Qc/2lIeQJpknsQB7BBfqQyDgdJ58kQNqtiDGelsFSJ5wA4z0ncFAmyWISDbVfQ+eEyPVRSXG4fnfKmCn+Lh16uHtGZWWw5akY/zqpzDqWlp86oF9vUNAtF4waTq32w/Pp/nqdWCOi5WBBucBB2uXlVlKahNF/yeanFJjI3MC2KsCSaKXLNxelw6AnAUBxPAmSqIN75OwxasWTjCuG05d60BZmIDdwFvmuCRA+IGi7XcO7asIfdU3MJpb1AxPVkSAbCEJhiLtEUmD7LaIxnK9QNzOn6hbgAeWorgdg0WutwwQdn4mMJVrifVOPG8TyiC+QhXCk8VWazhXsT5a4ISdIQmCGBZs+/Cc23Lwl5mO8UF5Y4sizTbO42Fdjo5glfI1psJtiC9K0eQiyzFTHAI6XU5gufIEs0ESUiz5Qh0NVk2y0ywCHd+liMg3VjWXS+EfVjYRtYpkCkIUwXsOLJweYLTCDt9NEFfeiDbJ0+gx06CfoU8+RqMxKdCnoCc5bDXBcP8sg8HDhCZAu4zgqn+8Weyzq8Lon56UAW6AJEXybdIvoC86WuR935JbBCQb6PM8iFaYpOA6Hd7mcQ7J/8jNgoI+ZMUwn29OA/eVia+xbqAdeSe2nMy5xd1XVIgVUZBmcK83sEgeKFQ8N74HycrFOzlz1ihYAx/zBcV5TPteEGrAgX5d+4mndbhms35mxrhR3rkpQob0n+vTK5rcd0cO/aUW+5qQfI/vbBmnVf4WssAAAAASUVORK5CYII=");var index='';/*! * Cropper.js v1.5.12 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2021-06-12T08:00:17.411Z */function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});}keys.push.apply(keys,symbols);}return keys;}function _objectSpread2(target){for(var i=1;iarr.length)len=arr.length;for(var i=0,arr2=new Array(len);i'+'
'+''+'
'+'
'+''+''+''+''+''+''+''+''+''+''+''+''+''+''+''+''+''+'
'+'';/** * Check if the given value is not a number. */var isNaN=Number.isNaN||WINDOW.isNaN;/** * Check if the given value is a number. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a number, else `false`. */function isNumber(value){return typeof value==='number'&&!isNaN(value);}/** * Check if the given value is a positive number. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given value is a positive number, else `false`. */var isPositiveNumber=function isPositiveNumber(value){return value>0&&value1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}if(isObject(target)&&args.length>0){args.forEach(function(arg){if(isObject(arg)){Object.keys(arg).forEach(function(key){target[key]=arg[key];});}});}return target;};var REGEXP_DECIMALS=/\.\d*(?:0|9){12}\d*$/;/** * Normalize decimal number. * Check out {@link https://0.30000000000000004.com/} * @param {number} value - The value to normalize. * @param {number} [times=100000000000] - The times for normalizing. * @returns {number} Returns the normalized number. */function normalizeDecimalNumber(value){var times=arguments.length>1&&arguments[1]!==undefined?arguments[1]:100000000000;return REGEXP_DECIMALS.test(value)?Math.round(value*times)/times:value;}var REGEXP_SUFFIX=/^width|height|left|top|marginLeft|marginTop$/;/** * Apply styles to the given element. * @param {Element} element - The target element. * @param {Object} styles - The styles for applying. */function setStyle(element,styles){var style=element.style;forEach(styles,function(value,property){if(REGEXP_SUFFIX.test(property)&&isNumber(value)){value="".concat(value,"px");}style[property]=value;});}/** * Check if the given element has a special class. * @param {Element} element - The element to check. * @param {string} value - The class to search. * @returns {boolean} Returns `true` if the special class was found. */function hasClass(element,value){return element.classList?element.classList.contains(value):element.className.indexOf(value)>-1;}/** * Add classes to the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be added. */function addClass(element,value){if(!value){return;}if(isNumber(element.length)){forEach(element,function(elem){addClass(elem,value);});return;}if(element.classList){element.classList.add(value);return;}var className=element.className.trim();if(!className){element.className=value;}else if(className.indexOf(value)<0){element.className="".concat(className," ").concat(value);}}/** * Remove classes from the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be removed. */function removeClass(element,value){if(!value){return;}if(isNumber(element.length)){forEach(element,function(elem){removeClass(elem,value);});return;}if(element.classList){element.classList.remove(value);return;}if(element.className.indexOf(value)>=0){element.className=element.className.replace(value,'');}}/** * Add or remove classes from the given element. * @param {Element} element - The target element. * @param {string} value - The classes to be toggled. * @param {boolean} added - Add only. */function toggleClass(element,value,added){if(!value){return;}if(isNumber(element.length)){forEach(element,function(elem){toggleClass(elem,value,added);});return;}// IE10-11 doesn't support the second parameter of `classList.toggle` if(added){addClass(element,value);}else{removeClass(element,value);}}var REGEXP_CAMEL_CASE=/([a-z\d])([A-Z])/g;/** * Transform the given string from camelCase to kebab-case * @param {string} value - The value to transform. * @returns {string} The transformed value. */function toParamCase(value){return value.replace(REGEXP_CAMEL_CASE,'$1-$2').toLowerCase();}/** * Get data from the given element. * @param {Element} element - The target element. * @param {string} name - The data key to get. * @returns {string} The data value. */function getData(element,name){if(isObject(element[name])){return element[name];}if(element.dataset){return element.dataset[name];}return element.getAttribute("data-".concat(toParamCase(name)));}/** * Set data to the given element. * @param {Element} element - The target element. * @param {string} name - The data key to set. * @param {string} data - The data value. */function setData(element,name,data){if(isObject(data)){element[name]=data;}else if(element.dataset){element.dataset[name]=data;}else{element.setAttribute("data-".concat(toParamCase(name)),data);}}/** * Remove data from the given element. * @param {Element} element - The target element. * @param {string} name - The data key to remove. */function removeData(element,name){if(isObject(element[name])){try{delete element[name];}catch(error){element[name]=undefined;}}else if(element.dataset){// #128 Safari not allows to delete dataset property try{delete element.dataset[name];}catch(error){element.dataset[name]=undefined;}}else{element.removeAttribute("data-".concat(toParamCase(name)));}}var REGEXP_SPACES=/\s\s*/;var onceSupported=function(){var supported=false;if(IS_BROWSER){var once=false;var listener=function listener(){};var options=Object.defineProperty({},'once',{get:function get(){supported=true;return once;},/** * This setter can fix a `TypeError` in strict mode * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only} * @param {boolean} value - The value to set */set:function set(value){once=value;}});WINDOW.addEventListener('test',listener,options);WINDOW.removeEventListener('test',listener,options);}return supported;}();/** * Remove event listener from the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Function} listener - The event listener. * @param {Object} options - The event options. */function removeListener(element,type,listener){var options=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var handler=listener;type.trim().split(REGEXP_SPACES).forEach(function(event){if(!onceSupported){var listeners=element.listeners;if(listeners&&listeners[event]&&listeners[event][listener]){handler=listeners[event][listener];delete listeners[event][listener];if(Object.keys(listeners[event]).length===0){delete listeners[event];}if(Object.keys(listeners).length===0){delete element.listeners;}}}element.removeEventListener(event,handler,options);});}/** * Add event listener to the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Function} listener - The event listener. * @param {Object} options - The event options. */function addListener(element,type,listener){var options=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var _handler=listener;type.trim().split(REGEXP_SPACES).forEach(function(event){if(options.once&&!onceSupported){var _element$listeners=element.listeners,listeners=_element$listeners===void 0?{}:_element$listeners;_handler=function handler(){delete listeners[event][listener];element.removeEventListener(event,_handler,options);for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}listener.apply(element,args);};if(!listeners[event]){listeners[event]={};}if(listeners[event][listener]){element.removeEventListener(event,listeners[event][listener],options);}listeners[event][listener]=_handler;element.listeners=listeners;}element.addEventListener(event,_handler,options);});}/** * Dispatch event on the target element. * @param {Element} element - The event target. * @param {string} type - The event type(s). * @param {Object} data - The additional event data. * @returns {boolean} Indicate if the event is default prevented or not. */function dispatchEvent(element,type,data){var event;// Event and CustomEvent on IE9-11 are global objects, not constructors if(isFunction(Event)&&isFunction(CustomEvent)){event=new CustomEvent(type,{detail:data,bubbles:true,cancelable:true});}else{event=document.createEvent('CustomEvent');event.initCustomEvent(type,true,true,data);}return element.dispatchEvent(event);}/** * Get the offset base on the document. * @param {Element} element - The target element. * @returns {Object} The offset data. */function getOffset(element){var box=element.getBoundingClientRect();return{left:box.left+(window.pageXOffset-document.documentElement.clientLeft),top:box.top+(window.pageYOffset-document.documentElement.clientTop)};}var location$1=WINDOW.location;var REGEXP_ORIGINS=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;/** * Check if the given URL is a cross origin URL. * @param {string} url - The target URL. * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`. */function isCrossOriginURL(url){var parts=url.match(REGEXP_ORIGINS);return parts!==null&&(parts[1]!==location$1.protocol||parts[2]!==location$1.hostname||parts[3]!==location$1.port);}/** * Add timestamp to the given URL. * @param {string} url - The target URL. * @returns {string} The result URL. */function addTimestamp(url){var timestamp="timestamp=".concat(new Date().getTime());return url+(url.indexOf('?')===-1?'?':'&')+timestamp;}/** * Get transforms base on the given object. * @param {Object} obj - The target object. * @returns {string} A string contains transform values. */function getTransforms(_ref){var rotate=_ref.rotate,scaleX=_ref.scaleX,scaleY=_ref.scaleY,translateX=_ref.translateX,translateY=_ref.translateY;var values=[];if(isNumber(translateX)&&translateX!==0){values.push("translateX(".concat(translateX,"px)"));}if(isNumber(translateY)&&translateY!==0){values.push("translateY(".concat(translateY,"px)"));}// Rotate should come first before scale to match orientation transform if(isNumber(rotate)&&rotate!==0){values.push("rotate(".concat(rotate,"deg)"));}if(isNumber(scaleX)&&scaleX!==1){values.push("scaleX(".concat(scaleX,")"));}if(isNumber(scaleY)&&scaleY!==1){values.push("scaleY(".concat(scaleY,")"));}var transform=values.length?values.join(' '):'none';return{WebkitTransform:transform,msTransform:transform,transform:transform};}/** * Get the max ratio of a group of pointers. * @param {string} pointers - The target pointers. * @returns {number} The result ratio. */function getMaxZoomRatio(pointers){var pointers2=_objectSpread2({},pointers);var maxRatio=0;forEach(pointers,function(pointer,pointerId){delete pointers2[pointerId];forEach(pointers2,function(pointer2){var x1=Math.abs(pointer.startX-pointer2.startX);var y1=Math.abs(pointer.startY-pointer2.startY);var x2=Math.abs(pointer.endX-pointer2.endX);var y2=Math.abs(pointer.endY-pointer2.endY);var z1=Math.sqrt(x1*x1+y1*y1);var z2=Math.sqrt(x2*x2+y2*y2);var ratio=(z2-z1)/z1;if(Math.abs(ratio)>Math.abs(maxRatio)){maxRatio=ratio;}});});return maxRatio;}/** * Get a pointer from an event object. * @param {Object} event - The target event object. * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not. * @returns {Object} The result pointer contains start and/or end point coordinates. */function getPointer(_ref2,endOnly){var pageX=_ref2.pageX,pageY=_ref2.pageY;var end={endX:pageX,endY:pageY};return endOnly?end:_objectSpread2({startX:pageX,startY:pageY},end);}/** * Get the center point coordinate of a group of pointers. * @param {Object} pointers - The target pointers. * @returns {Object} The center point coordinate. */function getPointersCenter(pointers){var pageX=0;var pageY=0;var count=0;forEach(pointers,function(_ref3){var startX=_ref3.startX,startY=_ref3.startY;pageX+=startX;pageY+=startY;count+=1;});pageX/=count;pageY/=count;return{pageX:pageX,pageY:pageY};}/** * Get the max sizes in a rectangle under the given aspect ratio. * @param {Object} data - The original sizes. * @param {string} [type='contain'] - The adjust type. * @returns {Object} The result sizes. */function getAdjustedSizes(_ref4)// or 'cover' {var aspectRatio=_ref4.aspectRatio,height=_ref4.height,width=_ref4.width;var type=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'contain';var isValidWidth=isPositiveNumber(width);var isValidHeight=isPositiveNumber(height);if(isValidWidth&&isValidHeight){var adjustedWidth=height*aspectRatio;if(type==='contain'&&adjustedWidth>width||type==='cover'&&adjustedWidth90?{width:newHeight,height:newWidth}:{width:newWidth,height:newHeight};}/** * Get a canvas which drew the given image. * @param {HTMLImageElement} image - The image for drawing. * @param {Object} imageData - The image data. * @param {Object} canvasData - The canvas data. * @param {Object} options - The options. * @returns {HTMLCanvasElement} The result canvas. */function getSourceCanvas(image,_ref6,_ref7,_ref8){var imageAspectRatio=_ref6.aspectRatio,imageNaturalWidth=_ref6.naturalWidth,imageNaturalHeight=_ref6.naturalHeight,_ref6$rotate=_ref6.rotate,rotate=_ref6$rotate===void 0?0:_ref6$rotate,_ref6$scaleX=_ref6.scaleX,scaleX=_ref6$scaleX===void 0?1:_ref6$scaleX,_ref6$scaleY=_ref6.scaleY,scaleY=_ref6$scaleY===void 0?1:_ref6$scaleY;var aspectRatio=_ref7.aspectRatio,naturalWidth=_ref7.naturalWidth,naturalHeight=_ref7.naturalHeight;var _ref8$fillColor=_ref8.fillColor,fillColor=_ref8$fillColor===void 0?'transparent':_ref8$fillColor,_ref8$imageSmoothingE=_ref8.imageSmoothingEnabled,imageSmoothingEnabled=_ref8$imageSmoothingE===void 0?true:_ref8$imageSmoothingE,_ref8$imageSmoothingQ=_ref8.imageSmoothingQuality,imageSmoothingQuality=_ref8$imageSmoothingQ===void 0?'low':_ref8$imageSmoothingQ,_ref8$maxWidth=_ref8.maxWidth,maxWidth=_ref8$maxWidth===void 0?Infinity:_ref8$maxWidth,_ref8$maxHeight=_ref8.maxHeight,maxHeight=_ref8$maxHeight===void 0?Infinity:_ref8$maxHeight,_ref8$minWidth=_ref8.minWidth,minWidth=_ref8$minWidth===void 0?0:_ref8$minWidth,_ref8$minHeight=_ref8.minHeight,minHeight=_ref8$minHeight===void 0?0:_ref8$minHeight;var canvas=document.createElement('canvas');var context=canvas.getContext('2d');var maxSizes=getAdjustedSizes({aspectRatio:aspectRatio,width:maxWidth,height:maxHeight});var minSizes=getAdjustedSizes({aspectRatio:aspectRatio,width:minWidth,height:minHeight},'cover');var width=Math.min(maxSizes.width,Math.max(minSizes.width,naturalWidth));var height=Math.min(maxSizes.height,Math.max(minSizes.height,naturalHeight));// Note: should always use image's natural sizes for drawing as // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90 var destMaxSizes=getAdjustedSizes({aspectRatio:imageAspectRatio,width:maxWidth,height:maxHeight});var destMinSizes=getAdjustedSizes({aspectRatio:imageAspectRatio,width:minWidth,height:minHeight},'cover');var destWidth=Math.min(destMaxSizes.width,Math.max(destMinSizes.width,imageNaturalWidth));var destHeight=Math.min(destMaxSizes.height,Math.max(destMinSizes.height,imageNaturalHeight));var params=[-destWidth/2,-destHeight/2,destWidth,destHeight];canvas.width=normalizeDecimalNumber(width);canvas.height=normalizeDecimalNumber(height);context.fillStyle=fillColor;context.fillRect(0,0,width,height);context.save();context.translate(width/2,height/2);context.rotate(rotate*Math.PI/180);context.scale(scaleX,scaleY);context.imageSmoothingEnabled=imageSmoothingEnabled;context.imageSmoothingQuality=imageSmoothingQuality;context.drawImage.apply(context,[image].concat(_toConsumableArray(params.map(function(param){return Math.floor(normalizeDecimalNumber(param));}))));context.restore();return canvas;}var fromCharCode=String.fromCharCode;/** * Get string from char code in data view. * @param {DataView} dataView - The data view for read. * @param {number} start - The start index. * @param {number} length - The read length. * @returns {string} The read result. */function getStringFromCharCode(dataView,start,length){var str='';length+=start;for(var i=start;i0){// XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9 // eslint-disable-next-line prefer-spread chunks.push(fromCharCode.apply(null,toArray(uint8.subarray(0,chunkSize))));uint8=uint8.subarray(chunkSize);}return"data:".concat(mimeType,";base64,").concat(btoa(chunks.join('')));}/** * Get orientation value from given array buffer. * @param {ArrayBuffer} arrayBuffer - The array buffer to read. * @returns {number} The read orientation value. */function resetAndGetOrientation(arrayBuffer){var dataView=new DataView(arrayBuffer);var orientation;// Ignores range error when the image does not have correct Exif information try{var littleEndian;var app1Start;var ifdStart;// Only handle JPEG image (start by 0xFFD8) if(dataView.getUint8(0)===0xFF&&dataView.getUint8(1)===0xD8){var length=dataView.byteLength;var offset=2;while(offset+1=0x00000008){ifdStart=tiffOffset+firstIFDOffset;}}}}}if(ifdStart){var _length=dataView.getUint16(ifdStart,littleEndian);var _offset;var i;for(i=0;i<_length;i+=1){_offset=ifdStart+i*12+2;if(dataView.getUint16(_offset,littleEndian)===0x0112/* Orientation */){// 8 is the offset of the current tag's value _offset+=8;// Get the original orientation value orientation=dataView.getUint16(_offset,littleEndian);// Override the orientation with its default value dataView.setUint16(_offset,1,littleEndian);break;}}}}catch(error){orientation=1;}return orientation;}/** * Parse Exif Orientation value. * @param {number} orientation - The orientation to parse. * @returns {Object} The parsed result. */function parseOrientation(orientation){var rotate=0;var scaleX=1;var scaleY=1;switch(orientation){// Flip horizontal case 2:scaleX=-1;break;// Rotate left 180° case 3:rotate=-180;break;// Flip vertical case 4:scaleY=-1;break;// Flip vertical and rotate right 90° case 5:rotate=90;scaleY=-1;break;// Rotate right 90° case 6:rotate=90;break;// Flip horizontal and rotate right 90° case 7:rotate=90;scaleX=-1;break;// Rotate left 90° case 8:rotate=-90;break;}return{rotate:rotate,scaleX:scaleX,scaleY:scaleY};}var render={render:function render(){this.initContainer();this.initCanvas();this.initCropBox();this.renderCanvas();if(this.cropped){this.renderCropBox();}},initContainer:function initContainer(){var element=this.element,options=this.options,container=this.container,cropper=this.cropper;var minWidth=Number(options.minContainerWidth);var minHeight=Number(options.minContainerHeight);addClass(cropper,CLASS_HIDDEN);removeClass(element,CLASS_HIDDEN);var containerData={width:Math.max(container.offsetWidth,minWidth>=0?minWidth:MIN_CONTAINER_WIDTH),height:Math.max(container.offsetHeight,minHeight>=0?minHeight:MIN_CONTAINER_HEIGHT)};this.containerData=containerData;setStyle(cropper,{width:containerData.width,height:containerData.height});addClass(element,CLASS_HIDDEN);removeClass(cropper,CLASS_HIDDEN);},// Canvas (image wrapper) initCanvas:function initCanvas(){var containerData=this.containerData,imageData=this.imageData;var viewMode=this.options.viewMode;var rotated=Math.abs(imageData.rotate)%180===90;var naturalWidth=rotated?imageData.naturalHeight:imageData.naturalWidth;var naturalHeight=rotated?imageData.naturalWidth:imageData.naturalHeight;var aspectRatio=naturalWidth/naturalHeight;var canvasWidth=containerData.width;var canvasHeight=containerData.height;if(containerData.height*aspectRatio>containerData.width){if(viewMode===3){canvasWidth=containerData.height*aspectRatio;}else{canvasHeight=containerData.width/aspectRatio;}}else if(viewMode===3){canvasHeight=containerData.width/aspectRatio;}else{canvasWidth=containerData.height*aspectRatio;}var canvasData={aspectRatio:aspectRatio,naturalWidth:naturalWidth,naturalHeight:naturalHeight,width:canvasWidth,height:canvasHeight};this.canvasData=canvasData;this.limited=viewMode===1||viewMode===2;this.limitCanvas(true,true);canvasData.width=Math.min(Math.max(canvasData.width,canvasData.minWidth),canvasData.maxWidth);canvasData.height=Math.min(Math.max(canvasData.height,canvasData.minHeight),canvasData.maxHeight);canvasData.left=(containerData.width-canvasData.width)/2;canvasData.top=(containerData.height-canvasData.height)/2;canvasData.oldLeft=canvasData.left;canvasData.oldTop=canvasData.top;this.initialCanvasData=assign({},canvasData);},limitCanvas:function limitCanvas(sizeLimited,positionLimited){var options=this.options,containerData=this.containerData,canvasData=this.canvasData,cropBoxData=this.cropBoxData;var viewMode=options.viewMode;var aspectRatio=canvasData.aspectRatio;var cropped=this.cropped&&cropBoxData;if(sizeLimited){var minCanvasWidth=Number(options.minCanvasWidth)||0;var minCanvasHeight=Number(options.minCanvasHeight)||0;if(viewMode>1){minCanvasWidth=Math.max(minCanvasWidth,containerData.width);minCanvasHeight=Math.max(minCanvasHeight,containerData.height);if(viewMode===3){if(minCanvasHeight*aspectRatio>minCanvasWidth){minCanvasWidth=minCanvasHeight*aspectRatio;}else{minCanvasHeight=minCanvasWidth/aspectRatio;}}}else if(viewMode>0){if(minCanvasWidth){minCanvasWidth=Math.max(minCanvasWidth,cropped?cropBoxData.width:0);}else if(minCanvasHeight){minCanvasHeight=Math.max(minCanvasHeight,cropped?cropBoxData.height:0);}else if(cropped){minCanvasWidth=cropBoxData.width;minCanvasHeight=cropBoxData.height;if(minCanvasHeight*aspectRatio>minCanvasWidth){minCanvasWidth=minCanvasHeight*aspectRatio;}else{minCanvasHeight=minCanvasWidth/aspectRatio;}}}var _getAdjustedSizes=getAdjustedSizes({aspectRatio:aspectRatio,width:minCanvasWidth,height:minCanvasHeight});minCanvasWidth=_getAdjustedSizes.width;minCanvasHeight=_getAdjustedSizes.height;canvasData.minWidth=minCanvasWidth;canvasData.minHeight=minCanvasHeight;canvasData.maxWidth=Infinity;canvasData.maxHeight=Infinity;}if(positionLimited){if(viewMode>(cropped?0:1)){var newCanvasLeft=containerData.width-canvasData.width;var newCanvasTop=containerData.height-canvasData.height;canvasData.minLeft=Math.min(0,newCanvasLeft);canvasData.minTop=Math.min(0,newCanvasTop);canvasData.maxLeft=Math.max(0,newCanvasLeft);canvasData.maxTop=Math.max(0,newCanvasTop);if(cropped&&this.limited){canvasData.minLeft=Math.min(cropBoxData.left,cropBoxData.left+(cropBoxData.width-canvasData.width));canvasData.minTop=Math.min(cropBoxData.top,cropBoxData.top+(cropBoxData.height-canvasData.height));canvasData.maxLeft=cropBoxData.left;canvasData.maxTop=cropBoxData.top;if(viewMode===2){if(canvasData.width>=containerData.width){canvasData.minLeft=Math.min(0,newCanvasLeft);canvasData.maxLeft=Math.max(0,newCanvasLeft);}if(canvasData.height>=containerData.height){canvasData.minTop=Math.min(0,newCanvasTop);canvasData.maxTop=Math.max(0,newCanvasTop);}}}}else{canvasData.minLeft=-canvasData.width;canvasData.minTop=-canvasData.height;canvasData.maxLeft=containerData.width;canvasData.maxTop=containerData.height;}}},renderCanvas:function renderCanvas(changed,transformed){var canvasData=this.canvasData,imageData=this.imageData;if(transformed){var _getRotatedSizes=getRotatedSizes({width:imageData.naturalWidth*Math.abs(imageData.scaleX||1),height:imageData.naturalHeight*Math.abs(imageData.scaleY||1),degree:imageData.rotate||0}),naturalWidth=_getRotatedSizes.width,naturalHeight=_getRotatedSizes.height;var width=canvasData.width*(naturalWidth/canvasData.naturalWidth);var height=canvasData.height*(naturalHeight/canvasData.naturalHeight);canvasData.left-=(width-canvasData.width)/2;canvasData.top-=(height-canvasData.height)/2;canvasData.width=width;canvasData.height=height;canvasData.aspectRatio=naturalWidth/naturalHeight;canvasData.naturalWidth=naturalWidth;canvasData.naturalHeight=naturalHeight;this.limitCanvas(true,false);}if(canvasData.width>canvasData.maxWidth||canvasData.widthcanvasData.maxHeight||canvasData.heightcanvasData.width){cropBoxData.height=cropBoxData.width/aspectRatio;}else{cropBoxData.width=cropBoxData.height*aspectRatio;}}this.cropBoxData=cropBoxData;this.limitCropBox(true,true);// Initialize auto crop area cropBoxData.width=Math.min(Math.max(cropBoxData.width,cropBoxData.minWidth),cropBoxData.maxWidth);cropBoxData.height=Math.min(Math.max(cropBoxData.height,cropBoxData.minHeight),cropBoxData.maxHeight);// The width/height of auto crop area must large than "minWidth/Height" cropBoxData.width=Math.max(cropBoxData.minWidth,cropBoxData.width*autoCropArea);cropBoxData.height=Math.max(cropBoxData.minHeight,cropBoxData.height*autoCropArea);cropBoxData.left=canvasData.left+(canvasData.width-cropBoxData.width)/2;cropBoxData.top=canvasData.top+(canvasData.height-cropBoxData.height)/2;cropBoxData.oldLeft=cropBoxData.left;cropBoxData.oldTop=cropBoxData.top;this.initialCropBoxData=assign({},cropBoxData);},limitCropBox:function limitCropBox(sizeLimited,positionLimited){var options=this.options,containerData=this.containerData,canvasData=this.canvasData,cropBoxData=this.cropBoxData,limited=this.limited;var aspectRatio=options.aspectRatio;if(sizeLimited){var minCropBoxWidth=Number(options.minCropBoxWidth)||0;var minCropBoxHeight=Number(options.minCropBoxHeight)||0;var maxCropBoxWidth=limited?Math.min(containerData.width,canvasData.width,canvasData.width+canvasData.left,containerData.width-canvasData.left):containerData.width;var maxCropBoxHeight=limited?Math.min(containerData.height,canvasData.height,canvasData.height+canvasData.top,containerData.height-canvasData.top):containerData.height;// The min/maxCropBoxWidth/Height must be less than container's width/height minCropBoxWidth=Math.min(minCropBoxWidth,containerData.width);minCropBoxHeight=Math.min(minCropBoxHeight,containerData.height);if(aspectRatio){if(minCropBoxWidth&&minCropBoxHeight){if(minCropBoxHeight*aspectRatio>minCropBoxWidth){minCropBoxHeight=minCropBoxWidth/aspectRatio;}else{minCropBoxWidth=minCropBoxHeight*aspectRatio;}}else if(minCropBoxWidth){minCropBoxHeight=minCropBoxWidth/aspectRatio;}else if(minCropBoxHeight){minCropBoxWidth=minCropBoxHeight*aspectRatio;}if(maxCropBoxHeight*aspectRatio>maxCropBoxWidth){maxCropBoxHeight=maxCropBoxWidth/aspectRatio;}else{maxCropBoxWidth=maxCropBoxHeight*aspectRatio;}}// The minWidth/Height must be less than maxWidth/Height cropBoxData.minWidth=Math.min(minCropBoxWidth,maxCropBoxWidth);cropBoxData.minHeight=Math.min(minCropBoxHeight,maxCropBoxHeight);cropBoxData.maxWidth=maxCropBoxWidth;cropBoxData.maxHeight=maxCropBoxHeight;}if(positionLimited){if(limited){cropBoxData.minLeft=Math.max(0,canvasData.left);cropBoxData.minTop=Math.max(0,canvasData.top);cropBoxData.maxLeft=Math.min(containerData.width,canvasData.left+canvasData.width)-cropBoxData.width;cropBoxData.maxTop=Math.min(containerData.height,canvasData.top+canvasData.height)-cropBoxData.height;}else{cropBoxData.minLeft=0;cropBoxData.minTop=0;cropBoxData.maxLeft=containerData.width-cropBoxData.width;cropBoxData.maxTop=containerData.height-cropBoxData.height;}}},renderCropBox:function renderCropBox(){var options=this.options,containerData=this.containerData,cropBoxData=this.cropBoxData;if(cropBoxData.width>cropBoxData.maxWidth||cropBoxData.widthcropBoxData.maxHeight||cropBoxData.height=containerData.width&&cropBoxData.height>=containerData.height?ACTION_MOVE:ACTION_ALL);}setStyle(this.cropBox,assign({width:cropBoxData.width,height:cropBoxData.height},getTransforms({translateX:cropBoxData.left,translateY:cropBoxData.top})));if(this.cropped&&this.limited){this.limitCanvas(true,true);}if(!this.disabled){this.output();}},output:function output(){this.preview();dispatchEvent(this.element,EVENT_CROP,this.getData());}};var preview={initPreview:function initPreview(){var element=this.element,crossOrigin=this.crossOrigin;var preview=this.options.preview;var url=crossOrigin?this.crossOriginUrl:this.url;var alt=element.alt||'The image to preview';var image=document.createElement('img');if(crossOrigin){image.crossOrigin=crossOrigin;}image.src=url;image.alt=alt;this.viewBox.appendChild(image);this.viewBoxImage=image;if(!preview){return;}var previews=preview;if(typeof preview==='string'){previews=element.ownerDocument.querySelectorAll(preview);}else if(preview.querySelector){previews=[preview];}this.previews=previews;forEach(previews,function(el){var img=document.createElement('img');// Save the original size for recover setData(el,DATA_PREVIEW,{width:el.offsetWidth,height:el.offsetHeight,html:el.innerHTML});if(crossOrigin){img.crossOrigin=crossOrigin;}img.src=url;img.alt=alt;/** * Override img element styles * Add `display:block` to avoid margin top issue * Add `height:auto` to override `height` attribute on IE8 * (Occur only when margin-top <= -height) */img.style.cssText='display:block;'+'width:100%;'+'height:auto;'+'min-width:0!important;'+'min-height:0!important;'+'max-width:none!important;'+'max-height:none!important;'+'image-orientation:0deg!important;"';el.innerHTML='';el.appendChild(img);});},resetPreview:function resetPreview(){forEach(this.previews,function(element){var data=getData(element,DATA_PREVIEW);setStyle(element,{width:data.width,height:data.height});element.innerHTML=data.html;removeData(element,DATA_PREVIEW);});},preview:function preview(){var imageData=this.imageData,canvasData=this.canvasData,cropBoxData=this.cropBoxData;var cropBoxWidth=cropBoxData.width,cropBoxHeight=cropBoxData.height;var width=imageData.width,height=imageData.height;var left=cropBoxData.left-canvasData.left-imageData.left;var top=cropBoxData.top-canvasData.top-imageData.top;if(!this.cropped||this.disabled){return;}setStyle(this.viewBoxImage,assign({width:width,height:height},getTransforms(assign({translateX:-left,translateY:-top},imageData))));forEach(this.previews,function(element){var data=getData(element,DATA_PREVIEW);var originalWidth=data.width;var originalHeight=data.height;var newWidth=originalWidth;var newHeight=originalHeight;var ratio=1;if(cropBoxWidth){ratio=originalWidth/cropBoxWidth;newHeight=cropBoxHeight*ratio;}if(cropBoxHeight&&newHeight>originalHeight){ratio=originalHeight/cropBoxHeight;newWidth=cropBoxWidth*ratio;newHeight=originalHeight;}setStyle(element,{width:newWidth,height:newHeight});setStyle(element.getElementsByTagName('img')[0],assign({width:width*ratio,height:height*ratio},getTransforms(assign({translateX:-left*ratio,translateY:-top*ratio},imageData))));});}};var events={bind:function bind(){var element=this.element,options=this.options,cropper=this.cropper;if(isFunction(options.cropstart)){addListener(element,EVENT_CROP_START,options.cropstart);}if(isFunction(options.cropmove)){addListener(element,EVENT_CROP_MOVE,options.cropmove);}if(isFunction(options.cropend)){addListener(element,EVENT_CROP_END,options.cropend);}if(isFunction(options.crop)){addListener(element,EVENT_CROP,options.crop);}if(isFunction(options.zoom)){addListener(element,EVENT_ZOOM,options.zoom);}addListener(cropper,EVENT_POINTER_DOWN,this.onCropStart=this.cropStart.bind(this));if(options.zoomable&&options.zoomOnWheel){addListener(cropper,EVENT_WHEEL,this.onWheel=this.wheel.bind(this),{passive:false,capture:true});}if(options.toggleDragModeOnDblclick){addListener(cropper,EVENT_DBLCLICK,this.onDblclick=this.dblclick.bind(this));}addListener(element.ownerDocument,EVENT_POINTER_MOVE,this.onCropMove=this.cropMove.bind(this));addListener(element.ownerDocument,EVENT_POINTER_UP,this.onCropEnd=this.cropEnd.bind(this));if(options.responsive){addListener(window,EVENT_RESIZE,this.onResize=this.resize.bind(this));}},unbind:function unbind(){var element=this.element,options=this.options,cropper=this.cropper;if(isFunction(options.cropstart)){removeListener(element,EVENT_CROP_START,options.cropstart);}if(isFunction(options.cropmove)){removeListener(element,EVENT_CROP_MOVE,options.cropmove);}if(isFunction(options.cropend)){removeListener(element,EVENT_CROP_END,options.cropend);}if(isFunction(options.crop)){removeListener(element,EVENT_CROP,options.crop);}if(isFunction(options.zoom)){removeListener(element,EVENT_ZOOM,options.zoom);}removeListener(cropper,EVENT_POINTER_DOWN,this.onCropStart);if(options.zoomable&&options.zoomOnWheel){removeListener(cropper,EVENT_WHEEL,this.onWheel,{passive:false,capture:true});}if(options.toggleDragModeOnDblclick){removeListener(cropper,EVENT_DBLCLICK,this.onDblclick);}removeListener(element.ownerDocument,EVENT_POINTER_MOVE,this.onCropMove);removeListener(element.ownerDocument,EVENT_POINTER_UP,this.onCropEnd);if(options.responsive){removeListener(window,EVENT_RESIZE,this.onResize);}}};var handlers={resize:function resize(){if(this.disabled){return;}var options=this.options,container=this.container,containerData=this.containerData;var ratioX=container.offsetWidth/containerData.width;var ratioY=container.offsetHeight/containerData.height;var ratio=Math.abs(ratioX-1)>Math.abs(ratioY-1)?ratioX:ratioY;// Resize when width changed or height changed if(ratio!==1){var canvasData;var cropBoxData;if(options.restore){canvasData=this.getCanvasData();cropBoxData=this.getCropBoxData();}this.render();if(options.restore){this.setCanvasData(forEach(canvasData,function(n,i){canvasData[i]=n*ratio;}));this.setCropBoxData(forEach(cropBoxData,function(n,i){cropBoxData[i]=n*ratio;}));}}},dblclick:function dblclick(){if(this.disabled||this.options.dragMode===DRAG_MODE_NONE){return;}this.setDragMode(hasClass(this.dragBox,CLASS_CROP)?DRAG_MODE_MOVE:DRAG_MODE_CROP);},wheel:function wheel(event){var _this=this;var ratio=Number(this.options.wheelZoomRatio)||0.1;var delta=1;if(this.disabled){return;}event.preventDefault();// Limit wheel speed to prevent zoom too fast (#21) if(this.wheeling){return;}this.wheeling=true;setTimeout(function(){_this.wheeling=false;},50);if(event.deltaY){delta=event.deltaY>0?1:-1;}else if(event.wheelDelta){delta=-event.wheelDelta/120;}else if(event.detail){delta=event.detail>0?1:-1;}this.zoom(-delta*ratio,event);},cropStart:function cropStart(event){var buttons=event.buttons,button=event.button;if(this.disabled// Handle mouse event and pointer event and ignore touch event ||(event.type==='mousedown'||event.type==='pointerdown'&&event.pointerType==='mouse')&&(// No primary button (Usually the left button) isNumber(buttons)&&buttons!==1||isNumber(button)&&button!==0// Open context menu ||event.ctrlKey)){return;}var options=this.options,pointers=this.pointers;var action;if(event.changedTouches){// Handle touch event forEach(event.changedTouches,function(touch){pointers[touch.identifier]=getPointer(touch);});}else{// Handle mouse event and pointer event pointers[event.pointerId||0]=getPointer(event);}if(Object.keys(pointers).length>1&&options.zoomable&&options.zoomOnTouch){action=ACTION_ZOOM;}else{action=getData(event.target,DATA_ACTION);}if(!REGEXP_ACTIONS.test(action)){return;}if(dispatchEvent(this.element,EVENT_CROP_START,{originalEvent:event,action:action})===false){return;}// This line is required for preventing page zooming in iOS browsers event.preventDefault();this.action=action;this.cropping=false;if(action===ACTION_CROP){this.cropping=true;addClass(this.dragBox,CLASS_MODAL);}},cropMove:function cropMove(event){var action=this.action;if(this.disabled||!action){return;}var pointers=this.pointers;event.preventDefault();if(dispatchEvent(this.element,EVENT_CROP_MOVE,{originalEvent:event,action:action})===false){return;}if(event.changedTouches){forEach(event.changedTouches,function(touch){// The first parameter should not be undefined (#432) assign(pointers[touch.identifier]||{},getPointer(touch,true));});}else{assign(pointers[event.pointerId||0]||{},getPointer(event,true));}this.change(event);},cropEnd:function cropEnd(event){if(this.disabled){return;}var action=this.action,pointers=this.pointers;if(event.changedTouches){forEach(event.changedTouches,function(touch){delete pointers[touch.identifier];});}else{delete pointers[event.pointerId||0];}if(!action){return;}event.preventDefault();if(!Object.keys(pointers).length){this.action='';}if(this.cropping){this.cropping=false;toggleClass(this.dragBox,CLASS_MODAL,this.cropped&&this.options.modal);}dispatchEvent(this.element,EVENT_CROP_END,{originalEvent:event,action:action});}};var change={change:function change(event){var options=this.options,canvasData=this.canvasData,containerData=this.containerData,cropBoxData=this.cropBoxData,pointers=this.pointers;var action=this.action;var aspectRatio=options.aspectRatio;var left=cropBoxData.left,top=cropBoxData.top,width=cropBoxData.width,height=cropBoxData.height;var right=left+width;var bottom=top+height;var minLeft=0;var minTop=0;var maxWidth=containerData.width;var maxHeight=containerData.height;var renderable=true;var offset;// Locking aspect ratio in "free mode" by holding shift key if(!aspectRatio&&event.shiftKey){aspectRatio=width&&height?width/height:1;}if(this.limited){minLeft=cropBoxData.minLeft;minTop=cropBoxData.minTop;maxWidth=minLeft+Math.min(containerData.width,canvasData.width,canvasData.left+canvasData.width);maxHeight=minTop+Math.min(containerData.height,canvasData.height,canvasData.top+canvasData.height);}var pointer=pointers[Object.keys(pointers)[0]];var range={x:pointer.endX-pointer.startX,y:pointer.endY-pointer.startY};var check=function check(side){switch(side){case ACTION_EAST:if(right+range.x>maxWidth){range.x=maxWidth-right;}break;case ACTION_WEST:if(left+range.xmaxHeight){range.y=maxHeight-bottom;}break;}};switch(action){// Move crop box case ACTION_ALL:left+=range.x;top+=range.y;break;// Resize crop box case ACTION_EAST:if(range.x>=0&&(right>=maxWidth||aspectRatio&&(top<=minTop||bottom>=maxHeight))){renderable=false;break;}check(ACTION_EAST);width+=range.x;if(width<0){action=ACTION_WEST;width=-width;left-=width;}if(aspectRatio){height=width/aspectRatio;top+=(cropBoxData.height-height)/2;}break;case ACTION_NORTH:if(range.y<=0&&(top<=minTop||aspectRatio&&(left<=minLeft||right>=maxWidth))){renderable=false;break;}check(ACTION_NORTH);height-=range.y;top+=range.y;if(height<0){action=ACTION_SOUTH;height=-height;top-=height;}if(aspectRatio){width=height*aspectRatio;left+=(cropBoxData.width-width)/2;}break;case ACTION_WEST:if(range.x<=0&&(left<=minLeft||aspectRatio&&(top<=minTop||bottom>=maxHeight))){renderable=false;break;}check(ACTION_WEST);width-=range.x;left+=range.x;if(width<0){action=ACTION_EAST;width=-width;left-=width;}if(aspectRatio){height=width/aspectRatio;top+=(cropBoxData.height-height)/2;}break;case ACTION_SOUTH:if(range.y>=0&&(bottom>=maxHeight||aspectRatio&&(left<=minLeft||right>=maxWidth))){renderable=false;break;}check(ACTION_SOUTH);height+=range.y;if(height<0){action=ACTION_NORTH;height=-height;top-=height;}if(aspectRatio){width=height*aspectRatio;left+=(cropBoxData.width-width)/2;}break;case ACTION_NORTH_EAST:if(aspectRatio){if(range.y<=0&&(top<=minTop||right>=maxWidth)){renderable=false;break;}check(ACTION_NORTH);height-=range.y;top+=range.y;width=height*aspectRatio;}else{check(ACTION_NORTH);check(ACTION_EAST);if(range.x>=0){if(rightminTop){height-=range.y;top+=range.y;}}else{height-=range.y;top+=range.y;}}if(width<0&&height<0){action=ACTION_SOUTH_WEST;height=-height;width=-width;top-=height;left-=width;}else if(width<0){action=ACTION_NORTH_WEST;width=-width;left-=width;}else if(height<0){action=ACTION_SOUTH_EAST;height=-height;top-=height;}break;case ACTION_NORTH_WEST:if(aspectRatio){if(range.y<=0&&(top<=minTop||left<=minLeft)){renderable=false;break;}check(ACTION_NORTH);height-=range.y;top+=range.y;width=height*aspectRatio;left+=cropBoxData.width-width;}else{check(ACTION_NORTH);check(ACTION_WEST);if(range.x<=0){if(left>minLeft){width-=range.x;left+=range.x;}else if(range.y<=0&&top<=minTop){renderable=false;}}else{width-=range.x;left+=range.x;}if(range.y<=0){if(top>minTop){height-=range.y;top+=range.y;}}else{height-=range.y;top+=range.y;}}if(width<0&&height<0){action=ACTION_SOUTH_EAST;height=-height;width=-width;top-=height;left-=width;}else if(width<0){action=ACTION_NORTH_EAST;width=-width;left-=width;}else if(height<0){action=ACTION_SOUTH_WEST;height=-height;top-=height;}break;case ACTION_SOUTH_WEST:if(aspectRatio){if(range.x<=0&&(left<=minLeft||bottom>=maxHeight)){renderable=false;break;}check(ACTION_WEST);width-=range.x;left+=range.x;height=width/aspectRatio;}else{check(ACTION_SOUTH);check(ACTION_WEST);if(range.x<=0){if(left>minLeft){width-=range.x;left+=range.x;}else if(range.y>=0&&bottom>=maxHeight){renderable=false;}}else{width-=range.x;left+=range.x;}if(range.y>=0){if(bottom=0&&(right>=maxWidth||bottom>=maxHeight)){renderable=false;break;}check(ACTION_EAST);width+=range.x;height=width/aspectRatio;}else{check(ACTION_SOUTH);check(ACTION_EAST);if(range.x>=0){if(right=0&&bottom>=maxHeight){renderable=false;}}else{width+=range.x;}if(range.y>=0){if(bottom0){action=range.y>0?ACTION_SOUTH_EAST:ACTION_NORTH_EAST;}else if(range.x<0){left-=width;action=range.y>0?ACTION_SOUTH_WEST:ACTION_NORTH_WEST;}if(range.y<0){top-=height;}// Show the crop box if is hidden if(!this.cropped){removeClass(this.cropBox,CLASS_HIDDEN);this.cropped=true;if(this.limited){this.limitCropBox(true,true);}}break;}if(renderable){cropBoxData.width=width;cropBoxData.height=height;cropBoxData.left=left;cropBoxData.top=top;this.action=action;this.renderCropBox();}// Override forEach(pointers,function(p){p.startX=p.endX;p.startY=p.endY;});}};var methods={// Show the crop box manually crop:function crop(){if(this.ready&&!this.cropped&&!this.disabled){this.cropped=true;this.limitCropBox(true,true);if(this.options.modal){addClass(this.dragBox,CLASS_MODAL);}removeClass(this.cropBox,CLASS_HIDDEN);this.setCropBoxData(this.initialCropBoxData);}return this;},// Reset the image and crop box to their initial states reset:function reset(){if(this.ready&&!this.disabled){this.imageData=assign({},this.initialImageData);this.canvasData=assign({},this.initialCanvasData);this.cropBoxData=assign({},this.initialCropBoxData);this.renderCanvas();if(this.cropped){this.renderCropBox();}}return this;},// Clear the crop box clear:function clear(){if(this.cropped&&!this.disabled){assign(this.cropBoxData,{left:0,top:0,width:0,height:0});this.cropped=false;this.renderCropBox();this.limitCanvas(true,true);// Render canvas after crop box rendered this.renderCanvas();removeClass(this.dragBox,CLASS_MODAL);addClass(this.cropBox,CLASS_HIDDEN);}return this;},/** * Replace the image's src and rebuild the cropper * @param {string} url - The new URL. * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one. * @returns {Cropper} this */replace:function replace(url){var hasSameSize=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!this.disabled&&url){if(this.isImg){this.element.src=url;}if(hasSameSize){this.url=url;this.image.src=url;if(this.ready){this.viewBoxImage.src=url;forEach(this.previews,function(element){element.getElementsByTagName('img')[0].src=url;});}}else{if(this.isImg){this.replaced=true;}this.options.data=null;this.uncreate();this.load(url);}}return this;},// Enable (unfreeze) the cropper enable:function enable(){if(this.ready&&this.disabled){this.disabled=false;removeClass(this.cropper,CLASS_DISABLED);}return this;},// Disable (freeze) the cropper disable:function disable(){if(this.ready&&!this.disabled){this.disabled=true;addClass(this.cropper,CLASS_DISABLED);}return this;},/** * Destroy the cropper and remove the instance from the image * @returns {Cropper} this */destroy:function destroy(){var element=this.element;if(!element[NAMESPACE]){return this;}element[NAMESPACE]=undefined;if(this.isImg&&this.replaced){element.src=this.originalUrl;}this.uncreate();return this;},/** * Move the canvas with relative offsets * @param {number} offsetX - The relative offset distance on the x-axis. * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis. * @returns {Cropper} this */move:function move(offsetX){var offsetY=arguments.length>1&&arguments[1]!==undefined?arguments[1]:offsetX;var _this$canvasData=this.canvasData,left=_this$canvasData.left,top=_this$canvasData.top;return this.moveTo(isUndefined(offsetX)?offsetX:left+Number(offsetX),isUndefined(offsetY)?offsetY:top+Number(offsetY));},/** * Move the canvas to an absolute point * @param {number} x - The x-axis coordinate. * @param {number} [y=x] - The y-axis coordinate. * @returns {Cropper} this */moveTo:function moveTo(x){var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:x;var canvasData=this.canvasData;var changed=false;x=Number(x);y=Number(y);if(this.ready&&!this.disabled&&this.options.movable){if(isNumber(x)){canvasData.left=x;changed=true;}if(isNumber(y)){canvasData.top=y;changed=true;}if(changed){this.renderCanvas(true);}}return this;},/** * Zoom the canvas with a relative ratio * @param {number} ratio - The target ratio. * @param {Event} _originalEvent - The original event if any. * @returns {Cropper} this */zoom:function zoom(ratio,_originalEvent){var canvasData=this.canvasData;ratio=Number(ratio);if(ratio<0){ratio=1/(1-ratio);}else{ratio=1+ratio;}return this.zoomTo(canvasData.width*ratio/canvasData.naturalWidth,null,_originalEvent);},/** * Zoom the canvas to an absolute ratio * @param {number} ratio - The target ratio. * @param {Object} pivot - The zoom pivot point coordinate. * @param {Event} _originalEvent - The original event if any. * @returns {Cropper} this */zoomTo:function zoomTo(ratio,pivot,_originalEvent){var options=this.options,canvasData=this.canvasData;var width=canvasData.width,height=canvasData.height,naturalWidth=canvasData.naturalWidth,naturalHeight=canvasData.naturalHeight;ratio=Number(ratio);if(ratio>=0&&this.ready&&!this.disabled&&options.zoomable){var newWidth=naturalWidth*ratio;var newHeight=naturalHeight*ratio;if(dispatchEvent(this.element,EVENT_ZOOM,{ratio:ratio,oldRatio:width/naturalWidth,originalEvent:_originalEvent})===false){return this;}if(_originalEvent){var pointers=this.pointers;var offset=getOffset(this.cropper);var center=pointers&&Object.keys(pointers).length?getPointersCenter(pointers):{pageX:_originalEvent.pageX,pageY:_originalEvent.pageY};// Zoom from the triggering point of the event canvasData.left-=(newWidth-width)*((center.pageX-offset.left-canvasData.left)/width);canvasData.top-=(newHeight-height)*((center.pageY-offset.top-canvasData.top)/height);}else if(isPlainObject(pivot)&&isNumber(pivot.x)&&isNumber(pivot.y)){canvasData.left-=(newWidth-width)*((pivot.x-canvasData.left)/width);canvasData.top-=(newHeight-height)*((pivot.y-canvasData.top)/height);}else{// Zoom from the center of the canvas canvasData.left-=(newWidth-width)/2;canvasData.top-=(newHeight-height)/2;}canvasData.width=newWidth;canvasData.height=newHeight;this.renderCanvas(true);}return this;},/** * Rotate the canvas with a relative degree * @param {number} degree - The rotate degree. * @returns {Cropper} this */rotate:function rotate(degree){return this.rotateTo((this.imageData.rotate||0)+Number(degree));},/** * Rotate the canvas to an absolute degree * @param {number} degree - The rotate degree. * @returns {Cropper} this */rotateTo:function rotateTo(degree){degree=Number(degree);if(isNumber(degree)&&this.ready&&!this.disabled&&this.options.rotatable){this.imageData.rotate=degree%360;this.renderCanvas(true,true);}return this;},/** * Scale the image on the x-axis. * @param {number} scaleX - The scale ratio on the x-axis. * @returns {Cropper} this */scaleX:function scaleX(_scaleX){var scaleY=this.imageData.scaleY;return this.scale(_scaleX,isNumber(scaleY)?scaleY:1);},/** * Scale the image on the y-axis. * @param {number} scaleY - The scale ratio on the y-axis. * @returns {Cropper} this */scaleY:function scaleY(_scaleY){var scaleX=this.imageData.scaleX;return this.scale(isNumber(scaleX)?scaleX:1,_scaleY);},/** * Scale the image * @param {number} scaleX - The scale ratio on the x-axis. * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis. * @returns {Cropper} this */scale:function scale(scaleX){var scaleY=arguments.length>1&&arguments[1]!==undefined?arguments[1]:scaleX;var imageData=this.imageData;var transformed=false;scaleX=Number(scaleX);scaleY=Number(scaleY);if(this.ready&&!this.disabled&&this.options.scalable){if(isNumber(scaleX)){imageData.scaleX=scaleX;transformed=true;}if(isNumber(scaleY)){imageData.scaleY=scaleY;transformed=true;}if(transformed){this.renderCanvas(true,true);}}return this;},/** * Get the cropped area position and size data (base on the original image) * @param {boolean} [rounded=false] - Indicate if round the data values or not. * @returns {Object} The result cropped data. */getData:function getData(){var rounded=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var options=this.options,imageData=this.imageData,canvasData=this.canvasData,cropBoxData=this.cropBoxData;var data;if(this.ready&&this.cropped){data={x:cropBoxData.left-canvasData.left,y:cropBoxData.top-canvasData.top,width:cropBoxData.width,height:cropBoxData.height};var ratio=imageData.width/imageData.naturalWidth;forEach(data,function(n,i){data[i]=n/ratio;});if(rounded){// In case rounding off leads to extra 1px in right or bottom border // we should round the top-left corner and the dimension (#343). var bottom=Math.round(data.y+data.height);var right=Math.round(data.x+data.width);data.x=Math.round(data.x);data.y=Math.round(data.y);data.width=right-data.x;data.height=bottom-data.y;}}else{data={x:0,y:0,width:0,height:0};}if(options.rotatable){data.rotate=imageData.rotate||0;}if(options.scalable){data.scaleX=imageData.scaleX||1;data.scaleY=imageData.scaleY||1;}return data;},/** * Set the cropped area position and size with new data * @param {Object} data - The new data. * @returns {Cropper} this */setData:function setData(data){var options=this.options,imageData=this.imageData,canvasData=this.canvasData;var cropBoxData={};if(this.ready&&!this.disabled&&isPlainObject(data)){var transformed=false;if(options.rotatable){if(isNumber(data.rotate)&&data.rotate!==imageData.rotate){imageData.rotate=data.rotate;transformed=true;}}if(options.scalable){if(isNumber(data.scaleX)&&data.scaleX!==imageData.scaleX){imageData.scaleX=data.scaleX;transformed=true;}if(isNumber(data.scaleY)&&data.scaleY!==imageData.scaleY){imageData.scaleY=data.scaleY;transformed=true;}}if(transformed){this.renderCanvas(true,true);}var ratio=imageData.width/imageData.naturalWidth;if(isNumber(data.x)){cropBoxData.left=data.x*ratio+canvasData.left;}if(isNumber(data.y)){cropBoxData.top=data.y*ratio+canvasData.top;}if(isNumber(data.width)){cropBoxData.width=data.width*ratio;}if(isNumber(data.height)){cropBoxData.height=data.height*ratio;}this.setCropBoxData(cropBoxData);}return this;},/** * Get the container size data. * @returns {Object} The result container data. */getContainerData:function getContainerData(){return this.ready?assign({},this.containerData):{};},/** * Get the image position and size data. * @returns {Object} The result image data. */getImageData:function getImageData(){return this.sized?assign({},this.imageData):{};},/** * Get the canvas position and size data. * @returns {Object} The result canvas data. */getCanvasData:function getCanvasData(){var canvasData=this.canvasData;var data={};if(this.ready){forEach(['left','top','width','height','naturalWidth','naturalHeight'],function(n){data[n]=canvasData[n];});}return data;},/** * Set the canvas position and size with new data. * @param {Object} data - The new canvas data. * @returns {Cropper} this */setCanvasData:function setCanvasData(data){var canvasData=this.canvasData;var aspectRatio=canvasData.aspectRatio;if(this.ready&&!this.disabled&&isPlainObject(data)){if(isNumber(data.left)){canvasData.left=data.left;}if(isNumber(data.top)){canvasData.top=data.top;}if(isNumber(data.width)){canvasData.width=data.width;canvasData.height=data.width/aspectRatio;}else if(isNumber(data.height)){canvasData.height=data.height;canvasData.width=data.height*aspectRatio;}this.renderCanvas(true);}return this;},/** * Get the crop box position and size data. * @returns {Object} The result crop box data. */getCropBoxData:function getCropBoxData(){var cropBoxData=this.cropBoxData;var data;if(this.ready&&this.cropped){data={left:cropBoxData.left,top:cropBoxData.top,width:cropBoxData.width,height:cropBoxData.height};}return data||{};},/** * Set the crop box position and size with new data. * @param {Object} data - The new crop box data. * @returns {Cropper} this */setCropBoxData:function setCropBoxData(data){var cropBoxData=this.cropBoxData;var aspectRatio=this.options.aspectRatio;var widthChanged;var heightChanged;if(this.ready&&this.cropped&&!this.disabled&&isPlainObject(data)){if(isNumber(data.left)){cropBoxData.left=data.left;}if(isNumber(data.top)){cropBoxData.top=data.top;}if(isNumber(data.width)&&data.width!==cropBoxData.width){widthChanged=true;cropBoxData.width=data.width;}if(isNumber(data.height)&&data.height!==cropBoxData.height){heightChanged=true;cropBoxData.height=data.height;}if(aspectRatio){if(widthChanged){cropBoxData.height=cropBoxData.width/aspectRatio;}else if(heightChanged){cropBoxData.width=cropBoxData.height*aspectRatio;}}this.renderCropBox();}return this;},/** * Get a canvas drawn the cropped image. * @param {Object} [options={}] - The config options. * @returns {HTMLCanvasElement} - The result canvas. */getCroppedCanvas:function getCroppedCanvas(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement){return null;}var canvasData=this.canvasData;var source=getSourceCanvas(this.image,this.imageData,canvasData,options);// Returns the source canvas if it is not cropped. if(!this.cropped){return source;}var _this$getData=this.getData(),initialX=_this$getData.x,initialY=_this$getData.y,initialWidth=_this$getData.width,initialHeight=_this$getData.height;var ratio=source.width/Math.floor(canvasData.naturalWidth);if(ratio!==1){initialX*=ratio;initialY*=ratio;initialWidth*=ratio;initialHeight*=ratio;}var aspectRatio=initialWidth/initialHeight;var maxSizes=getAdjustedSizes({aspectRatio:aspectRatio,width:options.maxWidth||Infinity,height:options.maxHeight||Infinity});var minSizes=getAdjustedSizes({aspectRatio:aspectRatio,width:options.minWidth||0,height:options.minHeight||0},'cover');var _getAdjustedSizes=getAdjustedSizes({aspectRatio:aspectRatio,width:options.width||(ratio!==1?source.width:initialWidth),height:options.height||(ratio!==1?source.height:initialHeight)}),width=_getAdjustedSizes.width,height=_getAdjustedSizes.height;width=Math.min(maxSizes.width,Math.max(minSizes.width,width));height=Math.min(maxSizes.height,Math.max(minSizes.height,height));var canvas=document.createElement('canvas');var context=canvas.getContext('2d');canvas.width=normalizeDecimalNumber(width);canvas.height=normalizeDecimalNumber(height);context.fillStyle=options.fillColor||'transparent';context.fillRect(0,0,width,height);var _options$imageSmoothi=options.imageSmoothingEnabled,imageSmoothingEnabled=_options$imageSmoothi===void 0?true:_options$imageSmoothi,imageSmoothingQuality=options.imageSmoothingQuality;context.imageSmoothingEnabled=imageSmoothingEnabled;if(imageSmoothingQuality){context.imageSmoothingQuality=imageSmoothingQuality;}// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage var sourceWidth=source.width;var sourceHeight=source.height;// Source canvas parameters var srcX=initialX;var srcY=initialY;var srcWidth;var srcHeight;// Destination canvas parameters var dstX;var dstY;var dstWidth;var dstHeight;if(srcX<=-initialWidth||srcX>sourceWidth){srcX=0;srcWidth=0;dstX=0;dstWidth=0;}else if(srcX<=0){dstX=-srcX;srcX=0;srcWidth=Math.min(sourceWidth,initialWidth+srcX);dstWidth=srcWidth;}else if(srcX<=sourceWidth){dstX=0;srcWidth=Math.min(initialWidth,sourceWidth-srcX);dstWidth=srcWidth;}if(srcWidth<=0||srcY<=-initialHeight||srcY>sourceHeight){srcY=0;srcHeight=0;dstY=0;dstHeight=0;}else if(srcY<=0){dstY=-srcY;srcY=0;srcHeight=Math.min(sourceHeight,initialHeight+srcY);dstHeight=srcHeight;}else if(srcY<=sourceHeight){dstY=0;srcHeight=Math.min(initialHeight,sourceHeight-srcY);dstHeight=srcHeight;}var params=[srcX,srcY,srcWidth,srcHeight];// Avoid "IndexSizeError" if(dstWidth>0&&dstHeight>0){var scale=width/initialWidth;params.push(dstX*scale,dstY*scale,dstWidth*scale,dstHeight*scale);}// All the numerical parameters should be integer for `drawImage` // https://github.com/fengyuanchen/cropper/issues/476 context.drawImage.apply(context,[source].concat(_toConsumableArray(params.map(function(param){return Math.floor(normalizeDecimalNumber(param));}))));return canvas;},/** * Change the aspect ratio of the crop box. * @param {number} aspectRatio - The new aspect ratio. * @returns {Cropper} this */setAspectRatio:function setAspectRatio(aspectRatio){var options=this.options;if(!this.disabled&&!isUndefined(aspectRatio)){// 0 -> NaN options.aspectRatio=Math.max(0,aspectRatio)||NaN;if(this.ready){this.initCropBox();if(this.cropped){this.renderCropBox();}}}return this;},/** * Change the drag mode. * @param {string} mode - The new drag mode. * @returns {Cropper} this */setDragMode:function setDragMode(mode){var options=this.options,dragBox=this.dragBox,face=this.face;if(this.ready&&!this.disabled){var croppable=mode===DRAG_MODE_CROP;var movable=options.movable&&mode===DRAG_MODE_MOVE;mode=croppable||movable?mode:DRAG_MODE_NONE;options.dragMode=mode;setData(dragBox,DATA_ACTION,mode);toggleClass(dragBox,CLASS_CROP,croppable);toggleClass(dragBox,CLASS_MOVE,movable);if(!options.cropBoxMovable){// Sync drag mode to crop box when it is not movable setData(face,DATA_ACTION,mode);toggleClass(face,CLASS_CROP,croppable);toggleClass(face,CLASS_MOVE,movable);}}return this;}};var AnotherCropper=WINDOW.Cropper;var Cropper$1=/*#__PURE__*/function(){/** * Create a new Cropper. * @param {Element} element - The target element for cropping. * @param {Object} [options={}] - The configuration options. */function Cropper(element){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Cropper);if(!element||!REGEXP_TAG_NAME.test(element.tagName)){throw new Error('The first argument is required and must be an or element.');}this.element=element;this.options=assign({},DEFAULTS,isPlainObject(options)&&options);this.cropped=false;this.disabled=false;this.pointers={};this.ready=false;this.reloading=false;this.replaced=false;this.sized=false;this.sizing=false;this.init();}_createClass(Cropper,[{key:"init",value:function init(){var element=this.element;var tagName=element.tagName.toLowerCase();var url;if(element[NAMESPACE]){return;}element[NAMESPACE]=this;if(tagName==='img'){this.isImg=true;// e.g.: "img/picture.jpg" url=element.getAttribute('src')||'';this.originalUrl=url;// Stop when it's a blank image if(!url){return;}// e.g.: "https://example.com/img/picture.jpg" url=element.src;}else if(tagName==='canvas'&&window.HTMLCanvasElement){url=element.toDataURL();}this.load(url);}},{key:"load",value:function load(url){var _this=this;if(!url){return;}this.url=url;this.imageData={};var element=this.element,options=this.options;if(!options.rotatable&&!options.scalable){options.checkOrientation=false;}// Only IE10+ supports Typed Arrays if(!options.checkOrientation||!window.ArrayBuffer){this.clone();return;}// Detect the mime type of the image directly if it is a Data URL if(REGEXP_DATA_URL.test(url)){// Read ArrayBuffer from Data URL of JPEG images directly for better performance if(REGEXP_DATA_URL_JPEG.test(url)){this.read(dataURLToArrayBuffer(url));}else{// Only a JPEG image may contains Exif Orientation information, // the rest types of Data URLs are not necessary to check orientation at all. this.clone();}return;}// 1. Detect the mime type of the image by a XMLHttpRequest. // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image. var xhr=new XMLHttpRequest();var clone=this.clone.bind(this);this.reloading=true;this.xhr=xhr;// 1. Cross origin requests are only supported for protocol schemes: // http, https, data, chrome, chrome-extension. // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy // in some browsers as IE11 and Safari. xhr.onabort=clone;xhr.onerror=clone;xhr.ontimeout=clone;xhr.onprogress=function(){// Abort the request directly if it not a JPEG image for better performance if(xhr.getResponseHeader('content-type')!==MIME_TYPE_JPEG){xhr.abort();}};xhr.onload=function(){_this.read(xhr.response);};xhr.onloadend=function(){_this.reloading=false;_this.xhr=null;};// Bust cache when there is a "crossOrigin" property to avoid browser cache error if(options.checkCrossOrigin&&isCrossOriginURL(url)&&element.crossOrigin){url=addTimestamp(url);}// The third parameter is required for avoiding side-effect (#682) xhr.open('GET',url,true);xhr.responseType='arraybuffer';xhr.withCredentials=element.crossOrigin==='use-credentials';xhr.send();}},{key:"read",value:function read(arrayBuffer){var options=this.options,imageData=this.imageData;// Reset the orientation value to its default value 1 // as some iOS browsers will render image with its orientation var orientation=resetAndGetOrientation(arrayBuffer);var rotate=0;var scaleX=1;var scaleY=1;if(orientation>1){// Generate a new URL which has the default orientation value this.url=arrayBufferToDataURL(arrayBuffer,MIME_TYPE_JPEG);var _parseOrientation=parseOrientation(orientation);rotate=_parseOrientation.rotate;scaleX=_parseOrientation.scaleX;scaleY=_parseOrientation.scaleY;}if(options.rotatable){imageData.rotate=rotate;}if(options.scalable){imageData.scaleX=scaleX;imageData.scaleY=scaleY;}this.clone();}},{key:"clone",value:function clone(){var element=this.element,url=this.url;var crossOrigin=element.crossOrigin;var crossOriginUrl=url;if(this.options.checkCrossOrigin&&isCrossOriginURL(url)){if(!crossOrigin){crossOrigin='anonymous';}// Bust cache when there is not a "crossOrigin" property (#519) crossOriginUrl=addTimestamp(url);}this.crossOrigin=crossOrigin;this.crossOriginUrl=crossOriginUrl;var image=document.createElement('img');if(crossOrigin){image.crossOrigin=crossOrigin;}image.src=crossOriginUrl||url;image.alt=element.alt||'The image to crop';this.image=image;image.onload=this.start.bind(this);image.onerror=this.stop.bind(this);addClass(image,CLASS_HIDE);element.parentNode.insertBefore(image,element.nextSibling);}},{key:"start",value:function start(){var _this2=this;var image=this.image;image.onload=null;image.onerror=null;this.sizing=true;// Match all browsers that use WebKit as the layout engine in iOS devices, // such as Safari for iOS, Chrome for iOS, and in-app browsers. var isIOSWebKit=WINDOW.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);var done=function done(naturalWidth,naturalHeight){assign(_this2.imageData,{naturalWidth:naturalWidth,naturalHeight:naturalHeight,aspectRatio:naturalWidth/naturalHeight});_this2.initialImageData=assign({},_this2.imageData);_this2.sizing=false;_this2.sized=true;_this2.build();};// Most modern browsers (excepts iOS WebKit) if(image.naturalWidth&&!isIOSWebKit){done(image.naturalWidth,image.naturalHeight);return;}var sizingImage=document.createElement('img');var body=document.body||document.documentElement;this.sizingImage=sizingImage;sizingImage.onload=function(){done(sizingImage.width,sizingImage.height);if(!isIOSWebKit){body.removeChild(sizingImage);}};sizingImage.src=image.src;// iOS WebKit will convert the image automatically // with its orientation once append it into DOM (#279) if(!isIOSWebKit){sizingImage.style.cssText='left:0;'+'max-height:none!important;'+'max-width:none!important;'+'min-height:0!important;'+'min-width:0!important;'+'opacity:0;'+'position:absolute;'+'top:0;'+'z-index:-1;';body.appendChild(sizingImage);}}},{key:"stop",value:function stop(){var image=this.image;image.onload=null;image.onerror=null;image.parentNode.removeChild(image);this.image=null;}},{key:"build",value:function build(){if(!this.sized||this.ready){return;}var element=this.element,options=this.options,image=this.image;// Create cropper elements var container=element.parentNode;var template=document.createElement('div');template.innerHTML=TEMPLATE;var cropper=template.querySelector(".".concat(NAMESPACE,"-container"));var canvas=cropper.querySelector(".".concat(NAMESPACE,"-canvas"));var dragBox=cropper.querySelector(".".concat(NAMESPACE,"-drag-box"));var cropBox=cropper.querySelector(".".concat(NAMESPACE,"-crop-box"));var face=cropBox.querySelector(".".concat(NAMESPACE,"-face"));this.container=container;this.cropper=cropper;this.canvas=canvas;this.dragBox=dragBox;this.cropBox=cropBox;this.viewBox=cropper.querySelector(".".concat(NAMESPACE,"-view-box"));this.face=face;canvas.appendChild(image);// Hide the original image addClass(element,CLASS_HIDDEN);// Inserts the cropper after to the current image container.insertBefore(cropper,element.nextSibling);// Show the image if is hidden if(!this.isImg){removeClass(image,CLASS_HIDE);}this.initPreview();this.bind();options.initialAspectRatio=Math.max(0,options.initialAspectRatio)||NaN;options.aspectRatio=Math.max(0,options.aspectRatio)||NaN;options.viewMode=Math.max(0,Math.min(3,Math.round(options.viewMode)))||0;addClass(cropBox,CLASS_HIDDEN);if(!options.guides){addClass(cropBox.getElementsByClassName("".concat(NAMESPACE,"-dashed")),CLASS_HIDDEN);}if(!options.center){addClass(cropBox.getElementsByClassName("".concat(NAMESPACE,"-center")),CLASS_HIDDEN);}if(options.background){addClass(cropper,"".concat(NAMESPACE,"-bg"));}if(!options.highlight){addClass(face,CLASS_INVISIBLE);}if(options.cropBoxMovable){addClass(face,CLASS_MOVE);setData(face,DATA_ACTION,ACTION_ALL);}if(!options.cropBoxResizable){addClass(cropBox.getElementsByClassName("".concat(NAMESPACE,"-line")),CLASS_HIDDEN);addClass(cropBox.getElementsByClassName("".concat(NAMESPACE,"-point")),CLASS_HIDDEN);}this.render();this.ready=true;this.setDragMode(options.dragMode);if(options.autoCrop){this.crop();}this.setData(options.data);if(isFunction(options.ready)){addListener(element,EVENT_READY,options.ready,{once:true});}dispatchEvent(element,EVENT_READY);}},{key:"unbuild",value:function unbuild(){if(!this.ready){return;}this.ready=false;this.unbind();this.resetPreview();this.cropper.parentNode.removeChild(this.cropper);removeClass(this.element,CLASS_HIDDEN);}},{key:"uncreate",value:function uncreate(){if(this.ready){this.unbuild();this.ready=false;this.cropped=false;}else if(this.sizing){this.sizingImage.onload=null;this.sizing=false;this.sized=false;}else if(this.reloading){this.xhr.onabort=null;this.xhr.abort();}else if(this.image){this.stop();}}/** * Get the no conflict cropper class. * @returns {Cropper} The cropper class. */}],[{key:"noConflict",value:function noConflict(){window.Cropper=AnotherCropper;return Cropper;}/** * Change the default options. * @param {Object} options - The new default options. */},{key:"setDefaults",value:function setDefaults(options){assign(DEFAULTS,isPlainObject(options)&&options);}}]);return Cropper;}();assign(Cropper$1.prototype,render,preview,events,handlers,change,methods);var cropper='';var cosJsSdkV5={exports:{}};(function(module,exports){(function webpackUniversalModuleDefinition(root,factory){module.exports=factory();})(commonjsGlobal,function(){return(/******/function(modules){// webpackBootstrap /******/ // The module cache /******/var installedModules={};/******/ /******/ // The require function /******/function __webpack_require__(moduleId){/******/ /******/ // Check if module is in cache /******/if(installedModules[moduleId]){/******/return installedModules[moduleId].exports;/******/}/******/ // Create a new module (and put it into the cache) /******/var module=installedModules[moduleId]={/******/i:moduleId,/******/l:false,/******/exports:{}/******/};/******/ /******/ // Execute the module function /******/modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);/******/ /******/ // Flag the module as loaded /******/module.l=true;/******/ /******/ // Return the exports of the module /******/return module.exports;/******/}/******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/__webpack_require__.m=modules;/******/ /******/ // expose the module cache /******/__webpack_require__.c=installedModules;/******/ /******/ // define getter function for harmony exports /******/__webpack_require__.d=function(exports,name,getter){/******/if(!__webpack_require__.o(exports,name)){/******/Object.defineProperty(exports,name,{enumerable:true,get:getter});/******/}/******/};/******/ /******/ // define __esModule on exports /******/__webpack_require__.r=function(exports){/******/if(typeof Symbol!=='undefined'&&Symbol.toStringTag){/******/Object.defineProperty(exports,Symbol.toStringTag,{value:'Module'});/******/}/******/Object.defineProperty(exports,'__esModule',{value:true});/******/};/******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/__webpack_require__.t=function(value,mode){/******/if(mode&1)value=__webpack_require__(value);/******/if(mode&8)return value;/******/if(mode&4&&_typeof2(value)==='object'&&value&&value.__esModule)return value;/******/var ns=Object.create(null);/******/__webpack_require__.r(ns);/******/Object.defineProperty(ns,'default',{enumerable:true,value:value});/******/if(mode&2&&typeof value!='string')for(var key in value){__webpack_require__.d(ns,key,function(key){return value[key];}.bind(null,key));}/******/return ns;/******/};/******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/__webpack_require__.n=function(module){/******/var getter=module&&module.__esModule?/******/function getDefault(){return module['default'];}:/******/function getModuleExports(){return module;};/******/__webpack_require__.d(getter,'a',getter);/******/return getter;/******/};/******/ /******/ // Object.prototype.hasOwnProperty.call /******/__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property);};/******/ /******/ // __webpack_public_path__ /******/__webpack_require__.p="/dist/";/******/ /******/ /******/ // Load entry module and return exports /******/return __webpack_require__(__webpack_require__.s="./index.js");/******/}/************************************************************************/ /******/({/***/"./index.js":/*!******************!*\ !*** ./index.js ***! \******************/ /*! no static exports found */ /***/function indexJs(module,exports,__webpack_require__){var COS=__webpack_require__(/*! ./src/cos */"./src/cos.js");module.exports=COS;/***/},/***/"./lib/base64.js":/*!***********************!*\ !*** ./lib/base64.js ***! \***********************/ /*! no static exports found */ /***/function libBase64Js(module,exports){/* * $Id: base64.js,v 2.15 2014/04/05 12:58:57 dankogai Exp dankogai $ * * Licensed under the BSD 3-Clause License. * http://opensource.org/licenses/BSD-3-Clause * * References: * http://en.wikipedia.org/wiki/Base64 */var Base64=function(global){global=global||{};// existing version for noConflict() var _Base64=global.Base64;var version="2.1.9";// constants var b64chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';var b64tab=function(bin){var t={};for(var i=0,l=bin.length;i>>6)+fromCharCode(0x80|cc&0x3f):fromCharCode(0xe0|cc>>>12&0x0f)+fromCharCode(0x80|cc>>>6&0x3f)+fromCharCode(0x80|cc&0x3f);}else{var cc=0x10000+(c.charCodeAt(0)-0xD800)*0x400+(c.charCodeAt(1)-0xDC00);return fromCharCode(0xf0|cc>>>18&0x07)+fromCharCode(0x80|cc>>>12&0x3f)+fromCharCode(0x80|cc>>>6&0x3f)+fromCharCode(0x80|cc&0x3f);}};var re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;var utob=function utob(u){return u.replace(re_utob,cb_utob);};var cb_encode=function cb_encode(ccc){var padlen=[0,2,1][ccc.length%3],ord=ccc.charCodeAt(0)<<16|(ccc.length>1?ccc.charCodeAt(1):0)<<8|(ccc.length>2?ccc.charCodeAt(2):0),chars=[b64chars.charAt(ord>>>18),b64chars.charAt(ord>>>12&63),padlen>=2?'=':b64chars.charAt(ord>>>6&63),padlen>=1?'=':b64chars.charAt(ord&63)];return chars.join('');};var btoa=global.btoa?function(b){return global.btoa(b);}:function(b){return b.replace(/[\s\S]{1,3}/g,cb_encode);};var _encode=function _encode(u){return btoa(utob(u));};var encode=function encode(u,urisafe){return!urisafe?_encode(String(u)):_encode(String(u)).replace(/[+\/]/g,function(m0){return m0=='+'?'-':'_';}).replace(/=/g,'');};var encodeURI=function encodeURI(u){return encode(u,true);};// decoder stuff var re_btou=new RegExp(['[\xC0-\xDF][\x80-\xBF]','[\xE0-\xEF][\x80-\xBF]{2}','[\xF0-\xF7][\x80-\xBF]{3}'].join('|'),'g');var cb_btou=function cb_btou(cccc){switch(cccc.length){case 4:var cp=(0x07&cccc.charCodeAt(0))<<18|(0x3f&cccc.charCodeAt(1))<<12|(0x3f&cccc.charCodeAt(2))<<6|0x3f&cccc.charCodeAt(3),offset=cp-0x10000;return fromCharCode((offset>>>10)+0xD800)+fromCharCode((offset&0x3FF)+0xDC00);case 3:return fromCharCode((0x0f&cccc.charCodeAt(0))<<12|(0x3f&cccc.charCodeAt(1))<<6|0x3f&cccc.charCodeAt(2));default:return fromCharCode((0x1f&cccc.charCodeAt(0))<<6|0x3f&cccc.charCodeAt(1));}};var btou=function btou(b){return b.replace(re_btou,cb_btou);};var cb_decode=function cb_decode(cccc){var len=cccc.length,padlen=len%4,n=(len>0?b64tab[cccc.charAt(0)]<<18:0)|(len>1?b64tab[cccc.charAt(1)]<<12:0)|(len>2?b64tab[cccc.charAt(2)]<<6:0)|(len>3?b64tab[cccc.charAt(3)]:0),chars=[fromCharCode(n>>>16),fromCharCode(n>>>8&0xff),fromCharCode(n&0xff)];chars.length-=[0,0,2,1][padlen];return chars.join('');};var atob=global.atob?function(a){return global.atob(a);}:function(a){return a.replace(/[\s\S]{1,4}/g,cb_decode);};var _decode=function _decode(a){return btou(atob(a));};var decode=function decode(a){return _decode(String(a).replace(/[-_]/g,function(m0){return m0=='-'?'+':'/';}).replace(/[^A-Za-z0-9\+\/]/g,''));};var noConflict=function noConflict(){var Base64=global.Base64;global.Base64=_Base64;return Base64;};// export Base64 var Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict};return Base64;}();module.exports=Base64;/***/},/***/"./lib/beacon.min.js":/*!***************************!*\ !*** ./lib/beacon.min.js ***! \***************************/ /*! no static exports found */ /***/function libBeaconMinJs(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__;var _typeof=__webpack_require__(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");!function(t,e){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=e():!(__WEBPACK_AMD_DEFINE_FACTORY__=e,__WEBPACK_AMD_DEFINE_RESULT__=typeof __WEBPACK_AMD_DEFINE_FACTORY__==='function'?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__!==undefined&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__));}(this,function(){var _t=function t(e,n){return _t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var n in e){Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);}},_t(e,n);};var _e=function e(){return _e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue;}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]60*this.strategy.requestInterval*1e3;},t.prototype.getUploadUrl=function(){return this.strategy.httpsUploadUrl+"?appkey="+this.appkey;},t.prototype.isBlackEvent=function(t){return-1!=this.strategy.blacklist.indexOf(t);},t.prototype.isEventUpOnOff=function(){return this.strategy.isEventUpOnOff;},t.prototype.isSampleEvent=function(t){return!!Object.prototype.hasOwnProperty.call(this.realSample,t)&&this.realSample[t]this.duration)return this.createSession();e=r.sessionId,n=r.sessionStart,this.getSessionStackDepth=0;}catch(t){}return{sessionId:e,sessionStart:n};},t.prototype.createSession=function(){var t=Date.now(),e={sessionId:this.appkey+"_"+t.toString(),sessionStart:t};this.storage.setItem(m,JSON.stringify(e)),this.storage.setItem(s,t.toString());var n="is_new_user",r=this.storage.getItem(n);return this.getSessionStackDepth<=1&&this.beacon.onDirectUserAction("rqd_applaunched",{A21:r?"N":"Y"}),this.storage.setItem(n,JSON.stringify(!1)),e;},t;}();function b(){var t=navigator.userAgent,e=t.indexOf("compatible")>-1&&t.indexOf("MSIE")>-1,n=t.indexOf("Edge")>-1&&!e,r=t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1;if(e){new RegExp("MSIE (\\d+\\.\\d+);").test(t);var o=parseFloat(RegExp.$1);return 7==o?7:8==o?8:9==o?9:10==o?10:6;}return n?-2:r?11:-1;}function S(t,e){var n,r;return(n="https://tun-cos-1258344701.file.myqcloud.com/fp.js",void 0===r&&(r=Date.now()+"-"+Math.random()),new Promise(function(t,e){if(document.getElementById(r))t(void 0);else{var o=document.getElementsByTagName("head")[0],i=document.createElement("script");i.onload=function(){return function(){i.onload=null,t(void 0);};},i.onerror=function(t){i.onerror=null,o.removeChild(i),e(t);},i.src=n,i.id=r,o.appendChild(i);}})).then(function(){new Fingerprint().getQimei36(t,e);}).catch(function(t){}),"";}var _I=function I(){return(_I=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0||!window.indexedDB||/X5Lite/.test(navigator.userAgent)?(this.store=new x(e),this.dbEventCount=this.store.getCount()):(this.store=new D(t),this.getCount().then(function(t){n.dbEventCount=t;}).catch(function(t){}));}return t.prototype.getCount=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.store.getCount()];case 1:return[2,t.sent()];case 2:return t.sent(),[2,Promise.reject()];case 3:return[2];}});});},t.prototype.insertEvent=function(t,e){return n(this,void 0,void 0,function(){var n,o;return r(this,function(r){switch(r.label){case 0:if(this.dbEventCount>=1e4)return[2,Promise.reject()];n=f(t.mapValue),r.label=1;case 1:return r.trys.push([1,3,,4]),this.dbEventCount++,[4,this.store.setItem(n,t)];case 2:return[2,r.sent()];case 3:return o=r.sent(),e&&e(o,t),this.dbEventCount--,[2,Promise.reject()];case 4:return[2];}});});},t.prototype.getEvents=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:t=[],e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.store.iterate(function(e){t.push(e);})];case 2:return e.sent(),[2,Promise.all(t)];case 3:return e.sent(),[2,Promise.all(t)];case 4:return[2];}});});},t.prototype.removeEvent=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:e=f(t.mapValue),n.label=1;case 1:return n.trys.push([1,3,,4]),this.dbEventCount--,[4,this.store.removeItem(e)];case 2:return[2,n.sent()];case 3:return n.sent(),this.dbEventCount++,[2,Promise.reject()];case 4:return[2];}});});},t;}(),_P=function P(){return(_P=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue;}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&i<8,e.isUnderIE8||(e.isUnderIE=i>0,t.needInitQimei&&S(t.appkey,function(t){e.qimei36=t.q36;}),e.network=new F(t),e.storage=new G(t.appkey),e.initCommonInfo(t),e.store=new _(t.appkey,e.storage),e.errorReport=new g(e.config,e.commonInfo,"web",e.network),e.strategy=new y(null==t.needQueryConfig||t.needQueryConfig,e.config,e.commonInfo,e.storage,e.network),e.logidStartTime=e.storage.getItem(z),e.logidStartTime||(e.logidStartTime=Date.now().toString(),e.storage.setItem(z,e.logidStartTime)),r=e.logidStartTime,o=Date.now()-Number.parseFloat(r),Math.floor(o/864e5)>=365&&e.storage.clear(),e.initSession(t),e.onDirectUserAction("rqd_js_init",{}),setTimeout(function(){return e.lifeCycle.emit("init");},0),e.initDelayTime=t.delay?t.delay:1e3,e.cycleTask(e.initDelayTime)),e;}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e;}_t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r());}(r,n),r.prototype.initSession=function(t){var e=18e5;t.sessionDuration&&t.sessionDuration>3e4&&(e=t.sessionDuration),this.beaconSession=new w(this.storage,e,this);},r.prototype.initCommonInfo=function(t){var e=Number(this.storage.getItem(s));try{var n=JSON.parse(this.storage.getItem(a));(Date.now()-e>3e4||!n)&&this.storage.setItem(a,JSON.stringify([]));}catch(t){}t.uploadUrl&&(this.uploadUrl=t.uploadUrl+"?appkey="+t.appkey);var r=[window.screen.width,window.screen.height];window.devicePixelRatio&&r.push(window.devicePixelRatio),this.commonInfo={deviceId:this.storage.createDeviceId(),language:navigator&&navigator.language||"zh_CN",query:window.location.search,userAgent:navigator.userAgent,pixel:r.join("*"),channelID:t.channelID?String(t.channelID):"",openid:t.openid?String(t.openid):"",unid:t.unionid?String(t.unionid):"",sdkVersion:W},this.config.appVersion=t.versionCode?String(t.versionCode):"",this.config.strictMode=t.strictMode;},r.prototype.cycleTask=function(t){var e=this;this.intervalID=window.setInterval(function(){e.pauseSearching||e.store.getEvents().then(function(t){0==t.length&&(e.pauseSearching=!0);var n=[],r=JSON.parse(e.storage.getItem(a));r||(r=[]),t&&t.forEach(function(t){var e=f(t.mapValue);-1==r.indexOf(e)&&(n.push(t),r.push(e));}),0!=n.length&&(e.storage.setItem(a,JSON.stringify(r)),e._normalLogPipeline(e.assembleData(n)));}).catch(function(t){});},t);},r.prototype.onReport=function(t,e,n){var r=this;if(this.isUnderIE8)this.errorReport.reportError("601","UnderIE8");else{this.pauseSearching=!1;var o=this.generateData(t,e,n);if(n&&0==this.delayTime&&!this.underWeakNet)this._normalLogPipeline(this.assembleData(o));else{var i=o.shift();i&&this.store.insertEvent(i,function(t){t&&r.errorReport.reportError("604","insertEvent fail!");}).catch(function(t){r._normalLogPipeline(r.assembleData(o));});}}},r.prototype.onSendBeacon=function(t,e){if(this.isUnderIE)this.errorReport.reportError("605","UnderIE");else{this.pauseSearching=!1;var n=this.assembleData(this.generateData(t,e,!0));"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(this.uploadUrl||this.strategy.getUploadUrl(),JSON.stringify(n));}},r.prototype.generateData=function(t,n,r){var o=[],i="4.5.14-web_"+(r?"direct_log_id":"normal_log_id"),s=Number(this.storage.getItem(i));return s=s||1,n=_e(_e({},n),{A99:r?"Y":"N",A100:s.toString(),A72:W,A88:this.logidStartTime}),s++,this.storage.setItem(i,s.toString()),o.push({eventCode:t,eventTime:Date.now().toString(),mapValue:p(n,this.config.strictMode)}),o;},r.prototype.assembleData=function(t){var n=this.beaconSession.getSession();return{appVersion:this.config.appVersion?h(this.config.appVersion):"",sdkId:"js",sdkVersion:W,mainAppKey:this.config.appkey,platformId:3,common:p(_e(_e({},this.additionalParams),{A2:this.commonInfo.deviceId,A8:this.commonInfo.openid,A12:this.commonInfo.language,A17:this.commonInfo.pixel,A23:this.commonInfo.channelID,A50:this.commonInfo.unid,A76:n.sessionId,A101:this.commonInfo.userAgent,A102:window.location.href,A104:document.referrer,A119:this.commonInfo.query,A153:this.qimei36}),!1),events:t};},r.prototype.monitorUploadFailed=function(){this.uselessCycleTaskNum++,this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(6e4),this.underWeakNet=!0);},r.prototype.doCustomCycleTask=function(){this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(this.initDelayTime)),this.uselessCycleTaskNum=0,this.underWeakNet=!1;},r;}(v);});/***/},/***/"./lib/crypto.js":/*!***********************!*\ !*** ./lib/crypto.js ***! \***********************/ /*! no static exports found */ /***/function libCryptoJs(module,exports,__webpack_require__){/* WEBPACK VAR INJECTION */(function(module){var _typeof=__webpack_require__(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");/* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */var CryptoJS=CryptoJS||function(g,l){var e={},d=e.lib={},m=function m(){},k=d.Base={extend:function extend(a){m.prototype=this;var c=new m();a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments);});c.init.prototype=c;c.$super=this;return c;},create:function create(){var a=this.extend();a.init.apply(a,arguments);return a;},init:function init(){},mixIn:function mixIn(a){for(var c in a){a.hasOwnProperty(c)&&(this[c]=a[c]);}a.hasOwnProperty("toString")&&(this.toString=a.toString);},clone:function clone(){return this.init.prototype.extend(this);}},p=d.WordArray=k.extend({init:function init(a,c){a=this.words=a||[];this.sigBytes=c!=l?c:4*a.length;},toString:function toString(a){return(a||n).stringify(this);},concat:function concat(a){var c=this.words,q=a.words,f=this.sigBytes;a=a.sigBytes;this.clamp();if(f%4)for(var b=0;b>>2]|=(q[b>>>2]>>>24-8*(b%4)&255)<<24-8*((f+b)%4);}else if(65535>>2]=q[b>>>2];}else c.push.apply(c,q);this.sigBytes+=a;return this;},clamp:function clamp(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<32-8*(c%4);a.length=g.ceil(c/4);},clone:function clone(){var a=k.clone.call(this);a.words=this.words.slice(0);return a;},random:function random(a){for(var c=[],b=0;b>>2]>>>24-8*(f%4)&255;b.push((d>>>4).toString(16));b.push((d&15).toString(16));}return b.join("");},parse:function parse(a){for(var c=a.length,b=[],f=0;f>>3]|=parseInt(a.substr(f,2),16)<<24-4*(f%8);}return new p.init(b,c/2);}},j=b.Latin1={stringify:function stringify(a){var c=a.words;a=a.sigBytes;for(var b=[],f=0;f>>2]>>>24-8*(f%4)&255));}return b.join("");},parse:function parse(a){for(var c=a.length,b=[],f=0;f>>2]|=(a.charCodeAt(f)&255)<<24-8*(f%4);}return new p.init(b,c);}},h=b.Utf8={stringify:function stringify(a){try{return decodeURIComponent(escape(j.stringify(a)));}catch(c){throw Error("Malformed UTF-8 data");}},parse:function parse(a){return j.parse(unescape(encodeURIComponent(a)));}},r=d.BufferedBlockAlgorithm=k.extend({reset:function reset(){this._data=new p.init();this._nDataBytes=0;},_append:function _append(a){"string"==typeof a&&(a=h.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes;},_process:function _process(a){var c=this._data,b=c.words,f=c.sigBytes,d=this.blockSize,e=f/(4*d),e=a?g.ceil(e):g.max((e|0)-this._minBufferSize,0);a=e*d;f=g.min(4*a,f);if(a){for(var k=0;ka;a++){if(16>a)m[a]=d[e+a]|0;else{var c=m[a-3]^m[a-8]^m[a-14]^m[a-16];m[a]=c<<1|c>>>31;}c=(n<<5|n>>>27)+l+m[a];c=20>a?c+((j&h|~j&g)+1518500249):40>a?c+((j^h^g)+1859775393):60>a?c+((j&h|j&g|h&g)-1894007588):c+((j^h^g)-899497514);l=g;g=h;h=j<<30|j>>>2;j=n;n=c;}b[0]=b[0]+n|0;b[1]=b[1]+j|0;b[2]=b[2]+h|0;b[3]=b[3]+g|0;b[4]=b[4]+l|0;},_doFinalize:function _doFinalize(){var d=this._data,e=d.words,b=8*this._nDataBytes,g=8*d.sigBytes;e[g>>>5]|=128<<24-g%32;e[(g+64>>>9<<4)+14]=Math.floor(b/4294967296);e[(g+64>>>9<<4)+15]=b;d.sigBytes=4*e.length;this._process();return this._hash;},clone:function clone(){var e=d.clone.call(this);e._hash=this._hash.clone();return e;}});g.SHA1=d._createHelper(l);g.HmacSHA1=d._createHmacHelper(l);})();(function(){var g=CryptoJS,l=g.enc.Utf8;g.algo.HMAC=g.lib.Base.extend({init:function init(e,d){e=this._hasher=new e.init();"string"==typeof d&&(d=l.parse(d));var g=e.blockSize,k=4*g;d.sigBytes>k&&(d=e.finalize(d));d.clamp();for(var p=this._oKey=d.clone(),b=this._iKey=d.clone(),n=p.words,j=b.words,h=0;h>>2]>>>24-i%4*8&0xff;var byte2=words[i+1>>>2]>>>24-(i+1)%4*8&0xff;var byte3=words[i+2>>>2]>>>24-(i+2)%4*8&0xff;var triplet=byte1<<16|byte2<<8|byte3;for(var j=0;j<4&&i+j*0.75>>6*(3-j)&0x3f));}}// Add padding var paddingChar=map.charAt(64);if(paddingChar){while(base64Chars.length%4){base64Chars.push(paddingChar);}}return base64Chars.join('');},/** * Converts a Base64 string to a word array. * * @param {string} base64Str The Base64 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Base64.parse(base64String); */parse:function parse(base64Str){// Shortcuts var base64StrLength=base64Str.length;var map=this._map;// Ignore padding var paddingChar=map.charAt(64);if(paddingChar){var paddingIndex=base64Str.indexOf(paddingChar);if(paddingIndex!=-1){base64StrLength=paddingIndex;}}// Convert var words=[];var nBytes=0;for(var i=0;i>>6-i%4*2;words[nBytes>>>2]|=(bits1|bits2)<<24-nBytes%4*8;nBytes++;}}return WordArray.create(words,nBytes);},_map:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='};})();if(_typeof(module)==='object'){module.exports=CryptoJS;}else{window.CryptoJS=CryptoJS;}/* WEBPACK VAR INJECTION */}).call(this,__webpack_require__(/*! ./../node_modules/webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(module));/***/},/***/"./lib/json2xml.js":/*!*************************!*\ !*** ./lib/json2xml.js ***! \*************************/ /*! no static exports found */ /***/function libJson2xmlJs(module,exports,__webpack_require__){var _typeof=__webpack_require__(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");//copyright Ryan Day 2010 , Joscha Feth 2013 [MIT Licensed] var element_start_char="a-zA-Z_\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FFF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD";var element_non_start_char="-.0-9\xB7\u0300-\u036F\u203F\u2040";var element_replace=new RegExp("^([^"+element_start_char+"])|^((x|X)(m|M)(l|L))|([^"+element_start_char+element_non_start_char+"])","g");var not_safe_in_xml=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm;var objKeys=function objKeys(obj){var l=[];if(obj instanceof Object){for(var k in obj){if(obj.hasOwnProperty(k)){l.push(k);}}}return l;};var process_to_xml=function process_to_xml(node_data,options){var makeNode=function makeNode(name,content,attributes,level,hasSubNodes){var indent_value=options.indent!==undefined?options.indent:"\t";var indent=options.prettyPrint?'\n'+new Array(level).join(indent_value):'';if(options.removeIllegalNameCharacters){name=name.replace(element_replace,'_');}var node=[indent,'<',name,attributes||''];if(content&&content.length>0){node.push('>');node.push(content);hasSubNodes&&node.push(indent);node.push('');}else{node.push('/>');}return node.join('');};return function fn(node_data,node_descriptor,level){var type=_typeof(node_data);if(Array.isArray?Array.isArray(node_data):node_data instanceof Array){type='array';}else if(node_data instanceof Date){type='date';}switch(type){//if value is an array create child nodes from values case'array':var ret=[];node_data.map(function(v){ret.push(fn(v,1,level+1));//entries that are values of an array are the only ones that can be special node descriptors });options.prettyPrint&&ret.push('\n');return ret.join('');case'date':// cast dates to ISO 8601 date (soap likes it) return node_data.toJSON?node_data.toJSON():node_data+'';case'object':var nodes=[];for(var name in node_data){if(node_data.hasOwnProperty(name)){if(node_data[name]instanceof Array){for(var j=0;j0&&nodes.push('\n');return nodes.join('');case'function':return node_data();default:return options.escape?esc(node_data):''+node_data;}}(node_data,0,0);};var xml_header=function xml_header(standalone){var ret=['');return ret.join('');};function esc(str){return(''+str).replace(/&/g,'&').replace(//g,'>').replace(/'/g,''').replace(/"/g,'"').replace(not_safe_in_xml,'');}module.exports=function(obj,options){if(!options){options={xmlHeader:{standalone:true},prettyPrint:true,indent:" ",escape:true};}if(typeof obj=='string'){try{obj=JSON.parse(obj.toString());}catch(e){return false;}}var xmlheader='';var docType='';if(options){if(_typeof(options)=='object'){// our config is an object if(options.xmlHeader){// the user wants an xml header xmlheader=xml_header(!!options.xmlHeader.standalone);}if(typeof options.docType!='undefined'){docType='';}}else{// our config is a boolean value, so just add xml header xmlheader=xml_header();}}options=options||{};var ret=[xmlheader,options.prettyPrint&&docType?'\n':'',docType,process_to_xml(obj,options)];return ret.join('').replace(/\n{2,}/g,'\n').replace(/\s+$/g,'');};/***/},/***/"./lib/md5.js":/*!********************!*\ !*** ./lib/md5.js ***! \********************/ /*! no static exports found */ /***/function libMd5Js(module,exports,__webpack_require__){/* WEBPACK VAR INJECTION */(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__;var _typeof=__webpack_require__(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");/* https://github.com/emn178/js-md5 */(function(){var ERROR='input is invalid type';var WINDOW=(typeof window==="undefined"?"undefined":_typeof(window))==='object';var root=WINDOW?window:{};if(root.JS_MD5_NO_WINDOW){WINDOW=false;}var WEB_WORKER=!WINDOW&&(typeof self==="undefined"?"undefined":_typeof(self))==='object';var NODE_JS=!root.JS_MD5_NO_NODE_JS&&(typeof process==="undefined"?"undefined":_typeof(process))==='object'&&process.versions&&process.versions.node;if(NODE_JS){root=global;}else if(WEB_WORKER){root=self;}var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&_typeof(module)==='object'&&module.exports;var AMD=__webpack_require__(/*! !webpack amd options */"./node_modules/webpack/buildin/amd-options.js");var ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer!=='undefined';var HEX_CHARS='0123456789abcdef'.split('');var EXTRA=[128,32768,8388608,-2147483648];var SHIFT=[0,8,16,24];var OUTPUT_TYPES=['hex','array','digest','buffer','arrayBuffer','base64'];var BASE64_ENCODE_CHAR='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');var blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer);blocks=new Uint32Array(buffer);}if(root.JS_MD5_NO_NODE_JS||!Array.isArray){Array.isArray=function(obj){return Object.prototype.toString.call(obj)==='[object Array]';};}if(ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)){ArrayBuffer.isView=function(obj){return _typeof(obj)==='object'&&obj.buffer&&obj.buffer.constructor===ArrayBuffer;};}/** * @method hex * @memberof md5 * @description Output hash as hex string * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash * @returns {String} Hex string * @example * md5.hex('The quick brown fox jumps over the lazy dog'); * // equal to * md5('The quick brown fox jumps over the lazy dog'); */ /** * @method digest * @memberof md5 * @description Output hash as bytes array * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash * @returns {Array} Bytes array * @example * md5.digest('The quick brown fox jumps over the lazy dog'); */ /** * @method array * @memberof md5 * @description Output hash as bytes array * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash * @returns {Array} Bytes array * @example * md5.array('The quick brown fox jumps over the lazy dog'); */ /** * @method arrayBuffer * @memberof md5 * @description Output hash as ArrayBuffer * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash * @returns {ArrayBuffer} ArrayBuffer * @example * md5.arrayBuffer('The quick brown fox jumps over the lazy dog'); */ /** * @method buffer * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. * @memberof md5 * @description Output hash as ArrayBuffer * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash * @returns {ArrayBuffer} ArrayBuffer * @example * md5.buffer('The quick brown fox jumps over the lazy dog'); */ /** * @method base64 * @memberof md5 * @description Output hash as base64 string * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash * @returns {String} base64 string * @example * md5.base64('The quick brown fox jumps over the lazy dog'); */var createOutputMethod=function createOutputMethod(outputType){return function(message,isBinStr){return new Md5(true).update(message,isBinStr)[outputType]();};};/** * @method create * @memberof md5 * @description Create Md5 object * @returns {Md5} Md5 object. * @example * var hash = md5.create(); */ /** * @method update * @memberof md5 * @description Create and update Md5 object * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash * @returns {Md5} Md5 object. * @example * var hash = md5.update('The quick brown fox jumps over the lazy dog'); * // equal to * var hash = md5.create(); * hash.update('The quick brown fox jumps over the lazy dog'); */var createMethod=function createMethod(){var method=createOutputMethod('hex');if(NODE_JS){method=nodeWrap(method);}method.getCtx=method.create=function(){return new Md5();};method.update=function(message){return method.create().update(message);};for(var i=0;i>6;buffer8[i++]=0x80|code&0x3f;}else if(code<0xd800||code>=0xe000){buffer8[i++]=0xe0|code>>12;buffer8[i++]=0x80|code>>6&0x3f;buffer8[i++]=0x80|code&0x3f;}else{code=0x10000+((code&0x3ff)<<10|message.charCodeAt(++index)&0x3ff);buffer8[i++]=0xf0|code>>18;buffer8[i++]=0x80|code>>12&0x3f;buffer8[i++]=0x80|code>>6&0x3f;buffer8[i++]=0x80|code&0x3f;}}}else{for(i=this.start;index>2]|=code<>2]|=(0xc0|code>>6)<>2]|=(0x80|code&0x3f)<=0xe000){blocks[i>>2]|=(0xe0|code>>12)<>2]|=(0x80|code>>6&0x3f)<>2]|=(0x80|code&0x3f)<>2]|=(0xf0|code>>18)<>2]|=(0x80|code>>12&0x3f)<>2]|=(0x80|code>>6&0x3f)<>2]|=(0x80|code&0x3f)<=64){this.start=i-64;this.hash();this.hashed=true;}else{this.start=i;}}if(this.bytes>4294967295){this.hBytes+=this.bytes/4294967296<<0;this.bytes=this.bytes%4294967296;}return this;};Md5.prototype.finalize=function(){if(this.finalized){return;}this.finalized=true;var blocks=this.blocks,i=this.lastByteIndex;blocks[i>>2]|=EXTRA[i&3];if(i>=56){if(!this.hashed){this.hash();}blocks[0]=blocks[16];blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0;}blocks[14]=this.bytes<<3;blocks[15]=this.hBytes<<3|this.bytes>>>29;this.hash();};Md5.prototype.hash=function(){var a,b,c,d,bc,da,blocks=this.blocks;if(this.first){a=blocks[0]-680876937;a=(a<<7|a>>>25)-271733879<<0;d=(-1732584194^a&2004318071)+blocks[1]-117830708;d=(d<<12|d>>>20)+a<<0;c=(-271733879^d&(a^-271733879))+blocks[2]-1126478375;c=(c<<17|c>>>15)+d<<0;b=(a^c&(d^a))+blocks[3]-1316259209;b=(b<<22|b>>>10)+c<<0;}else{a=this.h0;b=this.h1;c=this.h2;d=this.h3;a+=(d^b&(c^d))+blocks[0]-680876936;a=(a<<7|a>>>25)+b<<0;d+=(c^a&(b^c))+blocks[1]-389564586;d=(d<<12|d>>>20)+a<<0;c+=(b^d&(a^b))+blocks[2]+606105819;c=(c<<17|c>>>15)+d<<0;b+=(a^c&(d^a))+blocks[3]-1044525330;b=(b<<22|b>>>10)+c<<0;}a+=(d^b&(c^d))+blocks[4]-176418897;a=(a<<7|a>>>25)+b<<0;d+=(c^a&(b^c))+blocks[5]+1200080426;d=(d<<12|d>>>20)+a<<0;c+=(b^d&(a^b))+blocks[6]-1473231341;c=(c<<17|c>>>15)+d<<0;b+=(a^c&(d^a))+blocks[7]-45705983;b=(b<<22|b>>>10)+c<<0;a+=(d^b&(c^d))+blocks[8]+1770035416;a=(a<<7|a>>>25)+b<<0;d+=(c^a&(b^c))+blocks[9]-1958414417;d=(d<<12|d>>>20)+a<<0;c+=(b^d&(a^b))+blocks[10]-42063;c=(c<<17|c>>>15)+d<<0;b+=(a^c&(d^a))+blocks[11]-1990404162;b=(b<<22|b>>>10)+c<<0;a+=(d^b&(c^d))+blocks[12]+1804603682;a=(a<<7|a>>>25)+b<<0;d+=(c^a&(b^c))+blocks[13]-40341101;d=(d<<12|d>>>20)+a<<0;c+=(b^d&(a^b))+blocks[14]-1502002290;c=(c<<17|c>>>15)+d<<0;b+=(a^c&(d^a))+blocks[15]+1236535329;b=(b<<22|b>>>10)+c<<0;a+=(c^d&(b^c))+blocks[1]-165796510;a=(a<<5|a>>>27)+b<<0;d+=(b^c&(a^b))+blocks[6]-1069501632;d=(d<<9|d>>>23)+a<<0;c+=(a^b&(d^a))+blocks[11]+643717713;c=(c<<14|c>>>18)+d<<0;b+=(d^a&(c^d))+blocks[0]-373897302;b=(b<<20|b>>>12)+c<<0;a+=(c^d&(b^c))+blocks[5]-701558691;a=(a<<5|a>>>27)+b<<0;d+=(b^c&(a^b))+blocks[10]+38016083;d=(d<<9|d>>>23)+a<<0;c+=(a^b&(d^a))+blocks[15]-660478335;c=(c<<14|c>>>18)+d<<0;b+=(d^a&(c^d))+blocks[4]-405537848;b=(b<<20|b>>>12)+c<<0;a+=(c^d&(b^c))+blocks[9]+568446438;a=(a<<5|a>>>27)+b<<0;d+=(b^c&(a^b))+blocks[14]-1019803690;d=(d<<9|d>>>23)+a<<0;c+=(a^b&(d^a))+blocks[3]-187363961;c=(c<<14|c>>>18)+d<<0;b+=(d^a&(c^d))+blocks[8]+1163531501;b=(b<<20|b>>>12)+c<<0;a+=(c^d&(b^c))+blocks[13]-1444681467;a=(a<<5|a>>>27)+b<<0;d+=(b^c&(a^b))+blocks[2]-51403784;d=(d<<9|d>>>23)+a<<0;c+=(a^b&(d^a))+blocks[7]+1735328473;c=(c<<14|c>>>18)+d<<0;b+=(d^a&(c^d))+blocks[12]-1926607734;b=(b<<20|b>>>12)+c<<0;bc=b^c;a+=(bc^d)+blocks[5]-378558;a=(a<<4|a>>>28)+b<<0;d+=(bc^a)+blocks[8]-2022574463;d=(d<<11|d>>>21)+a<<0;da=d^a;c+=(da^b)+blocks[11]+1839030562;c=(c<<16|c>>>16)+d<<0;b+=(da^c)+blocks[14]-35309556;b=(b<<23|b>>>9)+c<<0;bc=b^c;a+=(bc^d)+blocks[1]-1530992060;a=(a<<4|a>>>28)+b<<0;d+=(bc^a)+blocks[4]+1272893353;d=(d<<11|d>>>21)+a<<0;da=d^a;c+=(da^b)+blocks[7]-155497632;c=(c<<16|c>>>16)+d<<0;b+=(da^c)+blocks[10]-1094730640;b=(b<<23|b>>>9)+c<<0;bc=b^c;a+=(bc^d)+blocks[13]+681279174;a=(a<<4|a>>>28)+b<<0;d+=(bc^a)+blocks[0]-358537222;d=(d<<11|d>>>21)+a<<0;da=d^a;c+=(da^b)+blocks[3]-722521979;c=(c<<16|c>>>16)+d<<0;b+=(da^c)+blocks[6]+76029189;b=(b<<23|b>>>9)+c<<0;bc=b^c;a+=(bc^d)+blocks[9]-640364487;a=(a<<4|a>>>28)+b<<0;d+=(bc^a)+blocks[12]-421815835;d=(d<<11|d>>>21)+a<<0;da=d^a;c+=(da^b)+blocks[15]+530742520;c=(c<<16|c>>>16)+d<<0;b+=(da^c)+blocks[2]-995338651;b=(b<<23|b>>>9)+c<<0;a+=(c^(b|~d))+blocks[0]-198630844;a=(a<<6|a>>>26)+b<<0;d+=(b^(a|~c))+blocks[7]+1126891415;d=(d<<10|d>>>22)+a<<0;c+=(a^(d|~b))+blocks[14]-1416354905;c=(c<<15|c>>>17)+d<<0;b+=(d^(c|~a))+blocks[5]-57434055;b=(b<<21|b>>>11)+c<<0;a+=(c^(b|~d))+blocks[12]+1700485571;a=(a<<6|a>>>26)+b<<0;d+=(b^(a|~c))+blocks[3]-1894986606;d=(d<<10|d>>>22)+a<<0;c+=(a^(d|~b))+blocks[10]-1051523;c=(c<<15|c>>>17)+d<<0;b+=(d^(c|~a))+blocks[1]-2054922799;b=(b<<21|b>>>11)+c<<0;a+=(c^(b|~d))+blocks[8]+1873313359;a=(a<<6|a>>>26)+b<<0;d+=(b^(a|~c))+blocks[15]-30611744;d=(d<<10|d>>>22)+a<<0;c+=(a^(d|~b))+blocks[6]-1560198380;c=(c<<15|c>>>17)+d<<0;b+=(d^(c|~a))+blocks[13]+1309151649;b=(b<<21|b>>>11)+c<<0;a+=(c^(b|~d))+blocks[4]-145523070;a=(a<<6|a>>>26)+b<<0;d+=(b^(a|~c))+blocks[11]-1120210379;d=(d<<10|d>>>22)+a<<0;c+=(a^(d|~b))+blocks[2]+718787259;c=(c<<15|c>>>17)+d<<0;b+=(d^(c|~a))+blocks[9]-343485551;b=(b<<21|b>>>11)+c<<0;if(this.first){this.h0=a+1732584193<<0;this.h1=b-271733879<<0;this.h2=c-1732584194<<0;this.h3=d+271733878<<0;this.first=false;}else{this.h0=this.h0+a<<0;this.h1=this.h1+b<<0;this.h2=this.h2+c<<0;this.h3=this.h3+d<<0;}};/** * @method hex * @memberof Md5 * @instance * @description Output hash as hex string * @returns {String} Hex string * @see {@link md5.hex} * @example * hash.hex(); */Md5.prototype.hex=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3;return HEX_CHARS[h0>>4&0x0F]+HEX_CHARS[h0&0x0F]+HEX_CHARS[h0>>12&0x0F]+HEX_CHARS[h0>>8&0x0F]+HEX_CHARS[h0>>20&0x0F]+HEX_CHARS[h0>>16&0x0F]+HEX_CHARS[h0>>28&0x0F]+HEX_CHARS[h0>>24&0x0F]+HEX_CHARS[h1>>4&0x0F]+HEX_CHARS[h1&0x0F]+HEX_CHARS[h1>>12&0x0F]+HEX_CHARS[h1>>8&0x0F]+HEX_CHARS[h1>>20&0x0F]+HEX_CHARS[h1>>16&0x0F]+HEX_CHARS[h1>>28&0x0F]+HEX_CHARS[h1>>24&0x0F]+HEX_CHARS[h2>>4&0x0F]+HEX_CHARS[h2&0x0F]+HEX_CHARS[h2>>12&0x0F]+HEX_CHARS[h2>>8&0x0F]+HEX_CHARS[h2>>20&0x0F]+HEX_CHARS[h2>>16&0x0F]+HEX_CHARS[h2>>28&0x0F]+HEX_CHARS[h2>>24&0x0F]+HEX_CHARS[h3>>4&0x0F]+HEX_CHARS[h3&0x0F]+HEX_CHARS[h3>>12&0x0F]+HEX_CHARS[h3>>8&0x0F]+HEX_CHARS[h3>>20&0x0F]+HEX_CHARS[h3>>16&0x0F]+HEX_CHARS[h3>>28&0x0F]+HEX_CHARS[h3>>24&0x0F];};/** * @method toString * @memberof Md5 * @instance * @description Output hash as hex string * @returns {String} Hex string * @see {@link md5.hex} * @example * hash.toString(); */Md5.prototype.toString=Md5.prototype.hex;/** * @method digest * @memberof Md5 * @instance * @description Output hash as bytes array * @returns {Array} Bytes array * @see {@link md5.digest} * @example * hash.digest(); */Md5.prototype.digest=function(format){if(format==='hex')return this.hex();this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3;var res=[h0&0xFF,h0>>8&0xFF,h0>>16&0xFF,h0>>24&0xFF,h1&0xFF,h1>>8&0xFF,h1>>16&0xFF,h1>>24&0xFF,h2&0xFF,h2>>8&0xFF,h2>>16&0xFF,h2>>24&0xFF,h3&0xFF,h3>>8&0xFF,h3>>16&0xFF,h3>>24&0xFF];return res;};/** * @method array * @memberof Md5 * @instance * @description Output hash as bytes array * @returns {Array} Bytes array * @see {@link md5.array} * @example * hash.array(); */Md5.prototype.array=Md5.prototype.digest;/** * @method arrayBuffer * @memberof Md5 * @instance * @description Output hash as ArrayBuffer * @returns {ArrayBuffer} ArrayBuffer * @see {@link md5.arrayBuffer} * @example * hash.arrayBuffer(); */Md5.prototype.arrayBuffer=function(){this.finalize();var buffer=new ArrayBuffer(16);var blocks=new Uint32Array(buffer);blocks[0]=this.h0;blocks[1]=this.h1;blocks[2]=this.h2;blocks[3]=this.h3;return buffer;};/** * @method buffer * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. * @memberof Md5 * @instance * @description Output hash as ArrayBuffer * @returns {ArrayBuffer} ArrayBuffer * @see {@link md5.buffer} * @example * hash.buffer(); */Md5.prototype.buffer=Md5.prototype.arrayBuffer;/** * @method base64 * @memberof Md5 * @instance * @description Output hash as base64 string * @returns {String} base64 string * @see {@link md5.base64} * @example * hash.base64(); */Md5.prototype.base64=function(){var v1,v2,v3,base64Str='',bytes=this.array();for(var i=0;i<15;){v1=bytes[i++];v2=bytes[i++];v3=bytes[i++];base64Str+=BASE64_ENCODE_CHAR[v1>>>2]+BASE64_ENCODE_CHAR[(v1<<4|v2>>>4)&63]+BASE64_ENCODE_CHAR[(v2<<2|v3>>>6)&63]+BASE64_ENCODE_CHAR[v3&63];}v1=bytes[i];base64Str+=BASE64_ENCODE_CHAR[v1>>>2]+BASE64_ENCODE_CHAR[v1<<4&63]+'==';return base64Str;};var exports=createMethod();if(COMMON_JS){module.exports=exports;}else{/** * @method md5 * @description Md5 hash function, export to global in browsers. * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash * @returns {String} md5 hashes * @example * md5(''); // d41d8cd98f00b204e9800998ecf8427e * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6 * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0 * * // It also supports UTF-8 encoding * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07 * * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` * md5([]); // d41d8cd98f00b204e9800998ecf8427e * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e */root.md5=exports;if(AMD){!(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports;}.call(exports,__webpack_require__,exports,module),__WEBPACK_AMD_DEFINE_RESULT__!==undefined&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__));}}})();/* WEBPACK VAR INJECTION */}).call(this,__webpack_require__(/*! ./../node_modules/process/browser.js */"./node_modules/process/browser.js"),__webpack_require__(/*! ./../node_modules/webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"),__webpack_require__(/*! ./../node_modules/webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(module));/***/},/***/"./lib/request.js":/*!************************!*\ !*** ./lib/request.js ***! \************************/ /*! no static exports found */ /***/function libRequestJs(module,exports,__webpack_require__){var _typeof=__webpack_require__(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");var stringifyPrimitive=function stringifyPrimitive(v){switch(_typeof(v)){case'string':return v;case'boolean':return v?'true':'false';case'number':return isFinite(v)?v:'';default:return'';}};var queryStringify=function queryStringify(obj,sep,eq,name){sep=sep||'&';eq=eq||'=';if(obj===null){obj=undefined;}if(_typeof(obj)==='object'){return Object.keys(obj).map(function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(Array.isArray(obj[k])){return obj[k].map(function(v){return ks+encodeURIComponent(stringifyPrimitive(v));}).join(sep);}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]));}}).filter(Boolean).join(sep);}if(!name)return'';return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj));};var xhrRes=function xhrRes(err,xhr,body){var headers={};xhr.getAllResponseHeaders().trim().split('\n').forEach(function(item){if(item){var index=item.indexOf(':');var key=item.substr(0,index).trim().toLowerCase();var val=item.substr(index+1).trim();headers[key]=val;}});return{error:err,statusCode:xhr.status,statusMessage:xhr.statusText,headers:headers,body:body};};var xhrBody=function xhrBody(xhr,dataType){return!dataType&&dataType==='text'?xhr.responseText:xhr.response;};var request=function request(opt,callback){// method var method=(opt.method||'GET').toUpperCase();// url、qs var url=opt.url;if(opt.qs){var qsStr=queryStringify(opt.qs);if(qsStr){url+=(url.indexOf('?')===-1?'?':'&')+qsStr;}}// 创建 ajax 实例 var xhr=new XMLHttpRequest();xhr.open(method,url,true);xhr.responseType=opt.dataType||'text';// 处理 xhrFields 属性 if(opt.xhrFields){for(var xhrField in opt.xhrFields){xhr[xhrField]=opt.xhrFields[xhrField];}}// 处理 headers var headers=opt.headers;if(headers){for(var key in headers){if(headers.hasOwnProperty(key)&&key.toLowerCase()!=='content-length'&&key.toLowerCase()!=='user-agent'&&key.toLowerCase()!=='origin'&&key.toLowerCase()!=='host'){xhr.setRequestHeader(key,headers[key]);}}}// onprogress if(opt.onProgress&&xhr.upload)xhr.upload.onprogress=opt.onProgress;if(opt.onDownloadProgress)xhr.onprogress=opt.onDownloadProgress;// timeout if(opt.timeout)xhr.timeout=opt.timeout;xhr.ontimeout=function(event){var error=new Error('timeout');callback(xhrRes(error,xhr));};// success 2xx/3xx/4xx xhr.onload=function(){callback(xhrRes(null,xhr,xhrBody(xhr,opt.dataType)));};// error 5xx/0 (网络错误、跨域报错、Https connect-src 限制的报错时 statusCode 为 0) xhr.onerror=function(err){var body=xhrBody(xhr,opt.dataType);if(body){// 5xx callback(xhrRes(null,xhr,body));}else{// 0 var error=xhr.statusText;if(!error&&xhr.status===0)error=new Error('CORS blocked or network error');callback(xhrRes(error,xhr,body));}};// send xhr.send(opt.body||'');// 返回 ajax 实例,用于外部调用 xhr.abort return xhr;};module.exports=request;/***/},/***/"./lib/xml2json.js":/*!*************************!*\ !*** ./lib/xml2json.js ***! \*************************/ /*! no static exports found */ /***/function libXml2jsonJs(module,exports,__webpack_require__){/* Copyright 2015 William Summers, MetaTribal LLC * adapted from https://developer.mozilla.org/en-US/docs/JXON * * Licensed under the MIT License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://opensource.org/licenses/MIT * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author William Summers * https://github.com/metatribal/xmlToJSON */var DOMParser=__webpack_require__(/*! @xmldom/xmldom */"./node_modules/@xmldom/xmldom/lib/index.js").DOMParser;var xmlToJSON=function(){this.version="1.3.5";var options={// set up the default options mergeCDATA:true,// extract cdata and merge with text normalize:true,// collapse multiple spaces to single space stripElemPrefix:true// for elements of same name in diff namespaces, you can enable namespaces and access the nskey property };var prefixMatch=new RegExp(/(?!xmlns)^.*:/);this.grokType=function(sValue){if(/^\s*$/.test(sValue)){return null;}if(/^(?:true|false)$/i.test(sValue)){return sValue.toLowerCase()==="true";}if(isFinite(sValue)){return parseFloat(sValue);}return sValue;};this.parseString=function(xmlString,opt){if(xmlString){var xml=this.stringToXML(xmlString);if(xml.getElementsByTagName('parsererror').length){return null;}else{return this.parseXML(xml,opt);}}else{return null;}};this.parseXML=function(oXMLParent,opt){// initialize options for(var key in opt){options[key]=opt[key];}var vResult={},nLength=0,sCollectedTxt="";// iterate over the children var childNum=oXMLParent.childNodes.length;if(childNum){for(var oNode,sProp,vContent,nItem=0;nItem | ({length:number, [number]: T})} list * @param {function (item: T, index: number, list:Array | ({length:number, [number]: T})):boolean} predicate * @param {Partial>?} ac `Array.prototype` by default, * allows injecting a custom implementation in tests * @returns {T | undefined} * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find */function find(list,predicate,ac){if(ac===undefined){ac=Array.prototype;}if(list&&typeof ac.find==='function'){return ac.find.call(list,predicate);}for(var i=0;i = Object} oc `Object` by default, * allows to inject custom object constructor for tests * @returns {Readonly} * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze */function freeze(object,oc){if(oc===undefined){oc=Object;}return oc&&typeof oc.freeze==='function'?oc.freeze(object):object;}/** * Since we can not rely on `Object.assign` we provide a simplified version * that is sufficient for our needs. * * @param {Object} target * @param {Object | null | undefined} source * * @returns {Object} target * @throws TypeError if target is not an object * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign */function assign(target,source){if(target===null||_typeof2(target)!=='object'){throw new TypeError('target is not an object');}for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}return target;}/** * All mime types that are allowed as input to `DOMParser.parseFromString` * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec * @see DOMParser.prototype.parseFromString */var MIME_TYPE=freeze({/** * `text/html`, the only mime type that triggers treating an XML document as HTML. * * @see DOMParser.SupportedType.isHTML * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration * @see https://en.wikipedia.org/wiki/HTML Wikipedia * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec */HTML:'text/html',/** * Helper method to check a mime type if it indicates an HTML document * * @param {string} [value] * @returns {boolean} * * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration * @see https://en.wikipedia.org/wiki/HTML Wikipedia * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring */isHTML:function isHTML(value){return value===MIME_TYPE.HTML;},/** * `application/xml`, the standard mime type for XML documents. * * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303 * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia */XML_APPLICATION:'application/xml',/** * `text/html`, an alias for `application/xml`. * * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303 * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia */XML_TEXT:'text/xml',/** * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace, * but is parsed as an XML document. * * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec * @see https://en.wikipedia.org/wiki/XHTML Wikipedia */XML_XHTML_APPLICATION:'application/xhtml+xml',/** * `image/svg+xml`, * * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1 * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia */XML_SVG_IMAGE:'image/svg+xml'});/** * Namespaces that are used in this code base. * * @see http://www.w3.org/TR/REC-xml-names */var NAMESPACE=freeze({/** * The XHTML namespace. * * @see http://www.w3.org/1999/xhtml */HTML:'http://www.w3.org/1999/xhtml',/** * Checks if `uri` equals `NAMESPACE.HTML`. * * @param {string} [uri] * * @see NAMESPACE.HTML */isHTML:function isHTML(uri){return uri===NAMESPACE.HTML;},/** * The SVG namespace. * * @see http://www.w3.org/2000/svg */SVG:'http://www.w3.org/2000/svg',/** * The `xml:` namespace. * * @see http://www.w3.org/XML/1998/namespace */XML:'http://www.w3.org/XML/1998/namespace',/** * The `xmlns:` namespace * * @see https://www.w3.org/2000/xmlns/ */XMLNS:'http://www.w3.org/2000/xmlns/'});exports.assign=assign;exports.find=find;exports.freeze=freeze;exports.MIME_TYPE=MIME_TYPE;exports.NAMESPACE=NAMESPACE;/***/},/***/"./node_modules/@xmldom/xmldom/lib/dom-parser.js":/*!*******************************************************!*\ !*** ./node_modules/@xmldom/xmldom/lib/dom-parser.js ***! \*******************************************************/ /*! no static exports found */ /***/function node_modulesXmldomXmldomLibDomParserJs(module,exports,__webpack_require__){var conventions=__webpack_require__(/*! ./conventions */"./node_modules/@xmldom/xmldom/lib/conventions.js");var dom=__webpack_require__(/*! ./dom */"./node_modules/@xmldom/xmldom/lib/dom.js");var entities=__webpack_require__(/*! ./entities */"./node_modules/@xmldom/xmldom/lib/entities.js");var sax=__webpack_require__(/*! ./sax */"./node_modules/@xmldom/xmldom/lib/sax.js");var DOMImplementation=dom.DOMImplementation;var NAMESPACE=conventions.NAMESPACE;var ParseError=sax.ParseError;var XMLReader=sax.XMLReader;/** * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends: * * > XML parsed entities are often stored in computer files which, * > for editing convenience, are organized into lines. * > These lines are typically separated by some combination * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA). * > * > To simplify the tasks of applications, the XML processor must behave * > as if it normalized all line breaks in external parsed entities (including the document entity) * > on input, before parsing, by translating all of the following to a single #xA character: * > * > 1. the two-character sequence #xD #xA * > 2. the two-character sequence #xD #x85 * > 3. the single character #x85 * > 4. the single character #x2028 * > 5. any #xD character that is not immediately followed by #xA or #x85. * * @param {string} input * @returns {string} */function normalizeLineEndings(input){return input.replace(/\r[\n\u0085]/g,'\n').replace(/[\r\u0085\u2028]/g,'\n');}/** * @typedef Locator * @property {number} [columnNumber] * @property {number} [lineNumber] */ /** * @typedef DOMParserOptions * @property {DOMHandler} [domBuilder] * @property {Function} [errorHandler] * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing * defaults to `normalizeLineEndings` * @property {Locator} [locator] * @property {Record} [xmlns] * * @see normalizeLineEndings */ /** * The DOMParser interface provides the ability to parse XML or HTML source code * from a string into a DOM `Document`. * * _xmldom is different from the spec in that it allows an `options` parameter, * to override the default behavior._ * * @param {DOMParserOptions} [options] * @constructor * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization */function DOMParser(options){this.options=options||{locator:{}};}DOMParser.prototype.parseFromString=function(source,mimeType){var options=this.options;var sax=new XMLReader();var domBuilder=options.domBuilder||new DOMHandler();//contentHandler and LexicalHandler var errorHandler=options.errorHandler;var locator=options.locator;var defaultNSMap=options.xmlns||{};var isHTML=/\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1; var entityMap=isHTML?entities.HTML_ENTITIES:entities.XML_ENTITIES;if(locator){domBuilder.setDocumentLocator(locator);}sax.errorHandler=buildErrorHandler(errorHandler,domBuilder,locator);sax.domBuilder=options.domBuilder||domBuilder;if(isHTML){defaultNSMap['']=NAMESPACE.HTML;}defaultNSMap.xml=defaultNSMap.xml||NAMESPACE.XML;var normalize=options.normalizeLineEndings||normalizeLineEndings;if(source&&typeof source==='string'){sax.parse(normalize(source),defaultNSMap,entityMap);}else{sax.errorHandler.error('invalid doc source');}return domBuilder.doc;};function buildErrorHandler(errorImpl,domBuilder,locator){if(!errorImpl){if(domBuilder instanceof DOMHandler){return domBuilder;}errorImpl=domBuilder;}var errorHandler={};var isCallback=errorImpl instanceof Function;locator=locator||{};function build(key){var fn=errorImpl[key];if(!fn&&isCallback){fn=errorImpl.length==2?function(msg){errorImpl(key,msg);}:errorImpl;}errorHandler[key]=fn&&function(msg){fn('[xmldom '+key+']\t'+msg+_locator(locator));}||function(){};}build('warning');build('error');build('fatalError');return errorHandler;}//console.log('#\n\n\n\n\n\n\n####') /** * +ContentHandler+ErrorHandler * +LexicalHandler+EntityResolver2 * -DeclHandler-DTDHandler * * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2 * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html */function DOMHandler(){this.cdata=false;}function position(locator,node){node.lineNumber=locator.lineNumber;node.columnNumber=locator.columnNumber;}/** * @see org.xml.sax.ContentHandler#startDocument * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html */DOMHandler.prototype={startDocument:function startDocument(){this.doc=new DOMImplementation().createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId;}},startElement:function startElement(namespaceURI,localName,qName,attrs){var doc=this.doc;var el=doc.createElementNS(namespaceURI,qName||localName);var len=attrs.length;appendElement(this,el);this.currentElement=el;this.locator&&position(this.locator,el);for(var i=0;i=start+length||start){return new java.lang.String(chars,start,length)+'';}return chars;}}/* * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html * used method of org.xml.sax.ext.LexicalHandler: * #comment(chars, start, length) * #startCDATA() * #endCDATA() * #startDTD(name, publicId, systemId) * * * IGNORED method of org.xml.sax.ext.LexicalHandler: * #endDTD() * #startEntity(name) * #endEntity(name) * * * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html * IGNORED method of org.xml.sax.ext.DeclHandler * #attributeDecl(eName, aName, type, mode, value) * #elementDecl(name, model) * #externalEntityDecl(name, publicId, systemId) * #internalEntityDecl(name, value) * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html * IGNORED method of org.xml.sax.EntityResolver2 * #resolveEntity(String name,String publicId,String baseURI,String systemId) * #resolveEntity(publicId, systemId) * #getExternalSubset(name, baseURI) * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html * IGNORED method of org.xml.sax.DTDHandler * #notationDecl(name, publicId, systemId) {}; * #unparsedEntityDecl(name, publicId, systemId, notationName) {}; */"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){DOMHandler.prototype[key]=function(){return null;};});/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */function appendElement(hander,node){if(!hander.currentElement){hander.doc.appendChild(node);}else{hander.currentElement.appendChild(node);}}//appendChild and setAttributeNS are preformance key exports.__DOMHandler=DOMHandler;exports.normalizeLineEndings=normalizeLineEndings;exports.DOMParser=DOMParser;/***/},/***/"./node_modules/@xmldom/xmldom/lib/dom.js":/*!************************************************!*\ !*** ./node_modules/@xmldom/xmldom/lib/dom.js ***! \************************************************/ /*! no static exports found */ /***/function node_modulesXmldomXmldomLibDomJs(module,exports,__webpack_require__){var conventions=__webpack_require__(/*! ./conventions */"./node_modules/@xmldom/xmldom/lib/conventions.js");var find=conventions.find;var NAMESPACE=conventions.NAMESPACE;/** * A prerequisite for `[].filter`, to drop elements that are empty * @param {string} input * @returns {boolean} */function notEmptyString(input){return input!=='';}/** * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace * @see https://infra.spec.whatwg.org/#ascii-whitespace * * @param {string} input * @returns {string[]} (can be empty) */function splitOnASCIIWhitespace(input){// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE return input?input.split(/[\t\n\f\r ]+/).filter(notEmptyString):[];}/** * Adds element as a key to current if it is not already present. * * @param {Record} current * @param {string} element * @returns {Record} */function orderedSetReducer(current,element){if(!current.hasOwnProperty(element)){current[element]=true;}return current;}/** * @see https://infra.spec.whatwg.org/#ordered-set * @param {string} input * @returns {string[]} */function toOrderedSet(input){if(!input)return[];var list=splitOnASCIIWhitespace(input);return Object.keys(list.reduce(orderedSetReducer,{}));}/** * Uses `list.indexOf` to implement something like `Array.prototype.includes`, * which we can not rely on being available. * * @param {any[]} list * @returns {function(any): boolean} */function arrayIncludes(list){return function(element){return list&&list.indexOf(element)!==-1;};}function copy(src,dest){for(var p in src){if(Object.prototype.hasOwnProperty.call(src,p)){dest[p]=src[p];}}}/** ^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));? ^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));? */function _extends(Class,Super){var pt=Class.prototype;if(!(pt instanceof Super)){function t(){}t.prototype=Super.prototype;t=new t();copy(pt,t);Class.prototype=pt=t;}if(pt.constructor!=Class){if(typeof Class!='function'){console.error("unknown Class:"+Class);}pt.constructor=Class;}}// Node Types var NodeType={};var ELEMENT_NODE=NodeType.ELEMENT_NODE=1;var ATTRIBUTE_NODE=NodeType.ATTRIBUTE_NODE=2;var TEXT_NODE=NodeType.TEXT_NODE=3;var CDATA_SECTION_NODE=NodeType.CDATA_SECTION_NODE=4;var ENTITY_REFERENCE_NODE=NodeType.ENTITY_REFERENCE_NODE=5;var ENTITY_NODE=NodeType.ENTITY_NODE=6;var PROCESSING_INSTRUCTION_NODE=NodeType.PROCESSING_INSTRUCTION_NODE=7;var COMMENT_NODE=NodeType.COMMENT_NODE=8;var DOCUMENT_NODE=NodeType.DOCUMENT_NODE=9;var DOCUMENT_TYPE_NODE=NodeType.DOCUMENT_TYPE_NODE=10;var DOCUMENT_FRAGMENT_NODE=NodeType.DOCUMENT_FRAGMENT_NODE=11;var NOTATION_NODE=NodeType.NOTATION_NODE=12;// ExceptionCode var ExceptionCode={};var ExceptionMessage={};ExceptionCode.INDEX_SIZE_ERR=(ExceptionMessage[1]="Index size error",1);ExceptionCode.DOMSTRING_SIZE_ERR=(ExceptionMessage[2]="DOMString size error",2);var HIERARCHY_REQUEST_ERR=ExceptionCode.HIERARCHY_REQUEST_ERR=(ExceptionMessage[3]="Hierarchy request error",3);ExceptionCode.WRONG_DOCUMENT_ERR=(ExceptionMessage[4]="Wrong document",4);ExceptionCode.INVALID_CHARACTER_ERR=(ExceptionMessage[5]="Invalid character",5);ExceptionCode.NO_DATA_ALLOWED_ERR=(ExceptionMessage[6]="No data allowed",6);ExceptionCode.NO_MODIFICATION_ALLOWED_ERR=(ExceptionMessage[7]="No modification allowed",7);var NOT_FOUND_ERR=ExceptionCode.NOT_FOUND_ERR=(ExceptionMessage[8]="Not found",8);ExceptionCode.NOT_SUPPORTED_ERR=(ExceptionMessage[9]="Not supported",9);var INUSE_ATTRIBUTE_ERR=ExceptionCode.INUSE_ATTRIBUTE_ERR=(ExceptionMessage[10]="Attribute in use",10);//level2 ExceptionCode.INVALID_STATE_ERR=(ExceptionMessage[11]="Invalid state",11);ExceptionCode.SYNTAX_ERR=(ExceptionMessage[12]="Syntax error",12);ExceptionCode.INVALID_MODIFICATION_ERR=(ExceptionMessage[13]="Invalid modification",13);ExceptionCode.NAMESPACE_ERR=(ExceptionMessage[14]="Invalid namespace",14);ExceptionCode.INVALID_ACCESS_ERR=(ExceptionMessage[15]="Invalid access",15);/** * DOM Level 2 * Object DOMException * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html */function DOMException(code,message){if(message instanceof Error){var error=message;}else{error=this;Error.call(this,ExceptionMessage[code]);this.message=ExceptionMessage[code];if(Error.captureStackTrace)Error.captureStackTrace(this,DOMException);}error.code=code;if(message)this.message=this.message+": "+message;return error;}DOMException.prototype=Error.prototype;copy(ExceptionCode,DOMException);/** * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177 * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live. * The items in the NodeList are accessible via an integral index, starting from 0. */function NodeList(){}NodeList.prototype={/** * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive. * @standard level1 */length:0,/** * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null. * @standard level1 * @param index unsigned long * Index into the collection. * @return Node * The node at the indexth position in the NodeList, or null if that is not a valid index. */item:function item(index){return index>=0&&index=0){var lastIndex=list.length-1;while(i0 || key == 'xmlns'){ // return null; // } //console.log() var i=this.length;while(i--){var attr=this[i];//console.log(attr.nodeName,key) if(attr.nodeName==key){return attr;}}},setNamedItem:function setNamedItem(attr){var el=attr.ownerElement;if(el&&el!=this._ownerElement){throw new DOMException(INUSE_ATTRIBUTE_ERR);}var oldAttr=this.getNamedItem(attr.nodeName);_addNamedNode(this._ownerElement,this,attr,oldAttr);return oldAttr;},/* returns Node */setNamedItemNS:function setNamedItemNS(attr){// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR var el=attr.ownerElement,oldAttr;if(el&&el!=this._ownerElement){throw new DOMException(INUSE_ATTRIBUTE_ERR);}oldAttr=this.getNamedItemNS(attr.namespaceURI,attr.localName);_addNamedNode(this._ownerElement,this,attr,oldAttr);return oldAttr;},/* returns Node */removeNamedItem:function removeNamedItem(key){var attr=this.getNamedItem(key);_removeNamedNode(this._ownerElement,this,attr);return attr;},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR //for level2 removeNamedItemNS:function removeNamedItemNS(namespaceURI,localName){var attr=this.getNamedItemNS(namespaceURI,localName);_removeNamedNode(this._ownerElement,this,attr);return attr;},getNamedItemNS:function getNamedItemNS(namespaceURI,localName){var i=this.length;while(i--){var node=this[i];if(node.localName==localName&&node.namespaceURI==namespaceURI){return node;}}return null;}};/** * The DOMImplementation interface represents an object providing methods * which are not dependent on any particular document. * Such an object is returned by the `Document.implementation` property. * * __The individual methods describe the differences compared to the specs.__ * * @constructor * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial) * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard */function DOMImplementation(){}DOMImplementation.prototype={/** * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported. * The different implementations fairly diverged in what kind of features were reported. * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use. * * @deprecated It is deprecated and modern browsers return true in all cases. * * @param {string} feature * @param {string} [version] * @returns {boolean} always true * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard */hasFeature:function hasFeature(feature,version){return true;},/** * Creates an XML Document object of the specified type with its document element. * * __It behaves slightly different from the description in the living standard__: * - There is no interface/class `XMLDocument`, it returns a `Document` instance. * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared. * - this implementation is not validating names or qualified names * (when parsing XML strings, the SAX parser takes care of that) * * @param {string|null} namespaceURI * @param {string} qualifiedName * @param {DocumentType=null} doctype * @returns {Document} * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial) * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core * * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names */createDocument:function createDocument(namespaceURI,qualifiedName,doctype){var doc=new Document();doc.implementation=this;doc.childNodes=new NodeList();doc.doctype=doctype||null;if(doctype){doc.appendChild(doctype);}if(qualifiedName){var root=doc.createElementNS(namespaceURI,qualifiedName);doc.appendChild(root);}return doc;},/** * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`. * * __This behavior is slightly different from the in the specs__: * - this implementation is not validating names or qualified names * (when parsing XML strings, the SAX parser takes care of that) * * @param {string} qualifiedName * @param {string} [publicId] * @param {string} [systemId] * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()` * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard * * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names */createDocumentType:function createDocumentType(qualifiedName,publicId,systemId){var node=new DocumentType();node.name=qualifiedName;node.nodeName=qualifiedName;node.publicId=publicId||'';node.systemId=systemId||'';return node;}};/** * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 */function Node(){}Node.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,// Modified in DOM Level 2: insertBefore:function insertBefore(newChild,refChild){//raises return _insertBefore(this,newChild,refChild);},replaceChild:function replaceChild(newChild,oldChild){//raises _insertBefore(this,newChild,oldChild,assertPreReplacementValidityInDocument);if(oldChild){this.removeChild(oldChild);}},removeChild:function removeChild(oldChild){return _removeChild(this,oldChild);},appendChild:function appendChild(newChild){return this.insertBefore(newChild,null);},hasChildNodes:function hasChildNodes(){return this.firstChild!=null;},cloneNode:function cloneNode(deep){return _cloneNode(this.ownerDocument||this,this,deep);},// Modified in DOM Level 2: normalize:function normalize(){var child=this.firstChild;while(child){var next=child.nextSibling;if(next&&next.nodeType==TEXT_NODE&&child.nodeType==TEXT_NODE){this.removeChild(next);child.appendData(next.data);}else{child.normalize();child=next;}}},// Introduced in DOM Level 2: isSupported:function isSupported(feature,version){return this.ownerDocument.implementation.hasFeature(feature,version);},// Introduced in DOM Level 2: hasAttributes:function hasAttributes(){return this.attributes.length>0;},/** * Look up the prefix associated to the given namespace URI, starting from this node. * **The default namespace declarations are ignored by this method.** * See Namespace Prefix Lookup for details on the algorithm used by this method. * * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._ * * @param {string | null} namespaceURI * @returns {string | null} * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix * @see https://github.com/xmldom/xmldom/issues/322 */lookupPrefix:function lookupPrefix(namespaceURI){var el=this;while(el){var map=el._nsMap;//console.dir(map) if(map){for(var n in map){if(Object.prototype.hasOwnProperty.call(map,n)&&map[n]===namespaceURI){return n;}}}el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode;}return null;},// Introduced in DOM Level 3: lookupNamespaceURI:function lookupNamespaceURI(prefix){var el=this;while(el){var map=el._nsMap;//console.dir(map) if(map){if(Object.prototype.hasOwnProperty.call(map,prefix)){return map[prefix];}}el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode;}return null;},// Introduced in DOM Level 3: isDefaultNamespace:function isDefaultNamespace(namespaceURI){var prefix=this.lookupPrefix(namespaceURI);return prefix==null;}};function _xmlEncoder(c){return c=='<'&&'<'||c=='>'&&'>'||c=='&'&&'&'||c=='"'&&'"'||'&#'+c.charCodeAt()+';';}copy(NodeType,Node);copy(NodeType,Node.prototype);/** * @param callback return true for continue,false for break * @return boolean true: break visit; */function _visitNode(node,callback){if(callback(node)){return true;}if(node=node.firstChild){do{if(_visitNode(node,callback)){return true;}}while(node=node.nextSibling);}}function Document(){this.ownerDocument=this;}function _onAddAttribute(doc,el,newAttr){doc&&doc._inc++;var ns=newAttr.namespaceURI;if(ns===NAMESPACE.XMLNS){//update namespace el._nsMap[newAttr.prefix?newAttr.localName:'']=newAttr.value;}}function _onRemoveAttribute(doc,el,newAttr,remove){doc&&doc._inc++;var ns=newAttr.namespaceURI;if(ns===NAMESPACE.XMLNS){//update namespace delete el._nsMap[newAttr.prefix?newAttr.localName:''];}}/** * Updates `el.childNodes`, updating the indexed items and it's `length`. * Passing `newChild` means it will be appended. * Otherwise it's assumed that an item has been removed, * and `el.firstNode` and it's `.nextSibling` are used * to walk the current list of child nodes. * * @param {Document} doc * @param {Node} el * @param {Node} [newChild] * @private */function _onUpdateChild(doc,el,newChild){if(doc&&doc._inc){doc._inc++;//update childNodes var cs=el.childNodes;if(newChild){cs[cs.length++]=newChild;}else{var child=el.firstChild;var i=0;while(child){cs[i++]=child;child=child.nextSibling;}cs.length=i;delete cs[cs.length];}}}/** * Removes the connections between `parentNode` and `child` * and any existing `child.previousSibling` or `child.nextSibling`. * * @see https://github.com/xmldom/xmldom/issues/135 * @see https://github.com/xmldom/xmldom/issues/145 * * @param {Node} parentNode * @param {Node} child * @returns {Node} the child that was removed. * @private */function _removeChild(parentNode,child){var previous=child.previousSibling;var next=child.nextSibling;if(previous){previous.nextSibling=next;}else{parentNode.firstChild=next;}if(next){next.previousSibling=previous;}else{parentNode.lastChild=previous;}child.parentNode=null;child.previousSibling=null;child.nextSibling=null;_onUpdateChild(parentNode.ownerDocument,parentNode);return child;}/** * Returns `true` if `node` can be a parent for insertion. * @param {Node} node * @returns {boolean} */function hasValidParentNodeType(node){return node&&(node.nodeType===Node.DOCUMENT_NODE||node.nodeType===Node.DOCUMENT_FRAGMENT_NODE||node.nodeType===Node.ELEMENT_NODE);}/** * Returns `true` if `node` can be inserted according to it's `nodeType`. * @param {Node} node * @returns {boolean} */function hasInsertableNodeType(node){return node&&(isElementNode(node)||isTextNode(node)||isDocTypeNode(node)||node.nodeType===Node.DOCUMENT_FRAGMENT_NODE||node.nodeType===Node.COMMENT_NODE||node.nodeType===Node.PROCESSING_INSTRUCTION_NODE);}/** * Returns true if `node` is a DOCTYPE node * @param {Node} node * @returns {boolean} */function isDocTypeNode(node){return node&&node.nodeType===Node.DOCUMENT_TYPE_NODE;}/** * Returns true if the node is an element * @param {Node} node * @returns {boolean} */function isElementNode(node){return node&&node.nodeType===Node.ELEMENT_NODE;}/** * Returns true if `node` is a text node * @param {Node} node * @returns {boolean} */function isTextNode(node){return node&&node.nodeType===Node.TEXT_NODE;}/** * Check if en element node can be inserted before `child`, or at the end if child is falsy, * according to the presence and position of a doctype node on the same level. * * @param {Document} doc The document node * @param {Node} child the node that would become the nextSibling if the element would be inserted * @returns {boolean} `true` if an element can be inserted before child * @private * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity */function isElementInsertionPossible(doc,child){var parentChildNodes=doc.childNodes||[];if(find(parentChildNodes,isElementNode)||isDocTypeNode(child)){return false;}var docTypeNode=find(parentChildNodes,isDocTypeNode);return!(child&&docTypeNode&&parentChildNodes.indexOf(docTypeNode)>parentChildNodes.indexOf(child));}/** * Check if en element node can be inserted before `child`, or at the end if child is falsy, * according to the presence and position of a doctype node on the same level. * * @param {Node} doc The document node * @param {Node} child the node that would become the nextSibling if the element would be inserted * @returns {boolean} `true` if an element can be inserted before child * @private * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity */function isElementReplacementPossible(doc,child){var parentChildNodes=doc.childNodes||[];function hasElementChildThatIsNotChild(node){return isElementNode(node)&&node!==child;}if(find(parentChildNodes,hasElementChildThatIsNotChild)){return false;}var docTypeNode=find(parentChildNodes,isDocTypeNode);return!(child&&docTypeNode&&parentChildNodes.indexOf(docTypeNode)>parentChildNodes.indexOf(child));}/** * @private * Steps 1-5 of the checks before inserting and before replacing a child are the same. * * @param {Node} parent the parent node to insert `node` into * @param {Node} node the node to insert * @param {Node=} child the node that should become the `nextSibling` of `node` * @returns {Node} * @throws DOMException for several node combinations that would create a DOM that is not well-formed. * @throws DOMException if `child` is provided but is not a child of `parent`. * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity * @see https://dom.spec.whatwg.org/#concept-node-replace */function assertPreInsertionValidity1to5(parent,node,child){// 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a "HierarchyRequestError" DOMException. if(!hasValidParentNodeType(parent)){throw new DOMException(HIERARCHY_REQUEST_ERR,'Unexpected parent node type '+parent.nodeType);}// 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a "HierarchyRequestError" DOMException. // not implemented! // 3. If `child` is non-null and its parent is not `parent`, then throw a "NotFoundError" DOMException. if(child&&child.parentNode!==parent){throw new DOMException(NOT_FOUND_ERR,'child not in parent');}if(// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException. !hasInsertableNodeType(node)||// 5. If either `node` is a Text node and `parent` is a document, // the sax parser currently adds top level text nodes, this will be fixed in 0.9.0 // || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE) // or `node` is a doctype and `parent` is not a document, then throw a "HierarchyRequestError" DOMException. isDocTypeNode(node)&&parent.nodeType!==Node.DOCUMENT_NODE){throw new DOMException(HIERARCHY_REQUEST_ERR,'Unexpected node type '+node.nodeType+' for parent node type '+parent.nodeType);}}/** * @private * Step 6 of the checks before inserting and before replacing a child are different. * * @param {Document} parent the parent node to insert `node` into * @param {Node} node the node to insert * @param {Node | undefined} child the node that should become the `nextSibling` of `node` * @returns {Node} * @throws DOMException for several node combinations that would create a DOM that is not well-formed. * @throws DOMException if `child` is provided but is not a child of `parent`. * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity * @see https://dom.spec.whatwg.org/#concept-node-replace */function assertPreInsertionValidityInDocument(parent,node,child){var parentChildNodes=parent.childNodes||[];var nodeChildNodes=node.childNodes||[];// DocumentFragment if(node.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var nodeChildElements=nodeChildNodes.filter(isElementNode);// If node has more than one element child or has a Text node child. if(nodeChildElements.length>1||find(nodeChildNodes,isTextNode)){throw new DOMException(HIERARCHY_REQUEST_ERR,'More than one element or text in fragment');}// Otherwise, if `node` has one element child and either `parent` has an element child, // `child` is a doctype, or `child` is non-null and a doctype is following `child`. if(nodeChildElements.length===1&&!isElementInsertionPossible(parent,child)){throw new DOMException(HIERARCHY_REQUEST_ERR,'Element in fragment can not be inserted before doctype');}}// Element if(isElementNode(node)){// `parent` has an element child, `child` is a doctype, // or `child` is non-null and a doctype is following `child`. if(!isElementInsertionPossible(parent,child)){throw new DOMException(HIERARCHY_REQUEST_ERR,'Only one element can be added and only after doctype');}}// DocumentType if(isDocTypeNode(node)){// `parent` has a doctype child, if(find(parentChildNodes,isDocTypeNode)){throw new DOMException(HIERARCHY_REQUEST_ERR,'Only one doctype is allowed');}var parentElementChild=find(parentChildNodes,isElementNode);// `child` is non-null and an element is preceding `child`, if(child&&parentChildNodes.indexOf(parentElementChild)1||find(nodeChildNodes,isTextNode)){throw new DOMException(HIERARCHY_REQUEST_ERR,'More than one element or text in fragment');}// Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`. if(nodeChildElements.length===1&&!isElementReplacementPossible(parent,child)){throw new DOMException(HIERARCHY_REQUEST_ERR,'Element in fragment can not be inserted before doctype');}}// Element if(isElementNode(node)){// `parent` has an element child that is not `child` or a doctype is following `child`. if(!isElementReplacementPossible(parent,child)){throw new DOMException(HIERARCHY_REQUEST_ERR,'Only one element can be added and only after doctype');}}// DocumentType if(isDocTypeNode(node)){function hasDoctypeChildThatIsNotChild(node){return isDocTypeNode(node)&&node!==child;}// `parent` has a doctype child that is not `child`, if(find(parentChildNodes,hasDoctypeChildThatIsNotChild)){throw new DOMException(HIERARCHY_REQUEST_ERR,'Only one doctype is allowed');}var parentElementChild=find(parentChildNodes,isElementNode);// or an element is preceding `child`. if(child&&parentChildNodes.indexOf(parentElementChild)0){_visitNode(base.documentElement,function(node){if(node!==base&&node.nodeType===ELEMENT_NODE){var nodeClassNames=node.getAttribute('class');// can be null if the attribute does not exist if(nodeClassNames){// before splitting and iterating just compare them for the most common case var matches=classNames===nodeClassNames;if(!matches){var nodeClassNamesSet=toOrderedSet(nodeClassNames);matches=classNamesSet.every(arrayIncludes(nodeClassNamesSet));}if(matches){ls.push(node);}}}});}return ls;});},//document factory method: createElement:function createElement(tagName){var node=new Element();node.ownerDocument=this;node.nodeName=tagName;node.tagName=tagName;node.localName=tagName;node.childNodes=new NodeList();var attrs=node.attributes=new NamedNodeMap();attrs._ownerElement=node;return node;},createDocumentFragment:function createDocumentFragment(){var node=new DocumentFragment();node.ownerDocument=this;node.childNodes=new NodeList();return node;},createTextNode:function createTextNode(data){var node=new Text();node.ownerDocument=this;node.appendData(data);return node;},createComment:function createComment(data){var node=new Comment();node.ownerDocument=this;node.appendData(data);return node;},createCDATASection:function createCDATASection(data){var node=new CDATASection();node.ownerDocument=this;node.appendData(data);return node;},createProcessingInstruction:function createProcessingInstruction(target,data){var node=new ProcessingInstruction();node.ownerDocument=this;node.tagName=node.nodeName=node.target=target;node.nodeValue=node.data=data;return node;},createAttribute:function createAttribute(name){var node=new Attr();node.ownerDocument=this;node.name=name;node.nodeName=name;node.localName=name;node.specified=true;return node;},createEntityReference:function createEntityReference(name){var node=new EntityReference();node.ownerDocument=this;node.nodeName=name;return node;},// Introduced in DOM Level 2: createElementNS:function createElementNS(namespaceURI,qualifiedName){var node=new Element();var pl=qualifiedName.split(':');var attrs=node.attributes=new NamedNodeMap();node.childNodes=new NodeList();node.ownerDocument=this;node.nodeName=qualifiedName;node.tagName=qualifiedName;node.namespaceURI=namespaceURI;if(pl.length==2){node.prefix=pl[0];node.localName=pl[1];}else{//el.prefix = null; node.localName=qualifiedName;}attrs._ownerElement=node;return node;},// Introduced in DOM Level 2: createAttributeNS:function createAttributeNS(namespaceURI,qualifiedName){var node=new Attr();var pl=qualifiedName.split(':');node.ownerDocument=this;node.nodeName=qualifiedName;node.name=qualifiedName;node.namespaceURI=namespaceURI;node.specified=true;if(pl.length==2){node.prefix=pl[0];node.localName=pl[1];}else{//el.prefix = null; node.localName=qualifiedName;}return node;}};_extends(Document,Node);function Element(){this._nsMap={};}Element.prototype={nodeType:ELEMENT_NODE,hasAttribute:function hasAttribute(name){return this.getAttributeNode(name)!=null;},getAttribute:function getAttribute(name){var attr=this.getAttributeNode(name);return attr&&attr.value||'';},getAttributeNode:function getAttributeNode(name){return this.attributes.getNamedItem(name);},setAttribute:function setAttribute(name,value){var attr=this.ownerDocument.createAttribute(name);attr.value=attr.nodeValue=""+value;this.setAttributeNode(attr);},removeAttribute:function removeAttribute(name){var attr=this.getAttributeNode(name);attr&&this.removeAttributeNode(attr);},//four real opeartion method appendChild:function appendChild(newChild){if(newChild.nodeType===DOCUMENT_FRAGMENT_NODE){return this.insertBefore(newChild,null);}else{return _appendSingleChild(this,newChild);}},setAttributeNode:function setAttributeNode(newAttr){return this.attributes.setNamedItem(newAttr);},setAttributeNodeNS:function setAttributeNodeNS(newAttr){return this.attributes.setNamedItemNS(newAttr);},removeAttributeNode:function removeAttributeNode(oldAttr){//console.log(this == oldAttr.ownerElement) return this.attributes.removeNamedItem(oldAttr.nodeName);},//get real attribute name,and remove it by removeAttributeNode removeAttributeNS:function removeAttributeNS(namespaceURI,localName){var old=this.getAttributeNodeNS(namespaceURI,localName);old&&this.removeAttributeNode(old);},hasAttributeNS:function hasAttributeNS(namespaceURI,localName){return this.getAttributeNodeNS(namespaceURI,localName)!=null;},getAttributeNS:function getAttributeNS(namespaceURI,localName){var attr=this.getAttributeNodeNS(namespaceURI,localName);return attr&&attr.value||'';},setAttributeNS:function setAttributeNS(namespaceURI,qualifiedName,value){var attr=this.ownerDocument.createAttributeNS(namespaceURI,qualifiedName);attr.value=attr.nodeValue=""+value;this.setAttributeNode(attr);},getAttributeNodeNS:function getAttributeNodeNS(namespaceURI,localName){return this.attributes.getNamedItemNS(namespaceURI,localName);},getElementsByTagName:function getElementsByTagName(tagName){return new LiveNodeList(this,function(base){var ls=[];_visitNode(base,function(node){if(node!==base&&node.nodeType==ELEMENT_NODE&&(tagName==='*'||node.tagName==tagName)){ls.push(node);}});return ls;});},getElementsByTagNameNS:function getElementsByTagNameNS(namespaceURI,localName){return new LiveNodeList(this,function(base){var ls=[];_visitNode(base,function(node){if(node!==base&&node.nodeType===ELEMENT_NODE&&(namespaceURI==='*'||node.namespaceURI===namespaceURI)&&(localName==='*'||node.localName==localName)){ls.push(node);}});return ls;});}};Document.prototype.getElementsByTagName=Element.prototype.getElementsByTagName;Document.prototype.getElementsByTagNameNS=Element.prototype.getElementsByTagNameNS;_extends(Element,Node);function Attr(){}Attr.prototype.nodeType=ATTRIBUTE_NODE;_extends(Attr,Node);function CharacterData(){}CharacterData.prototype={data:'',substringData:function substringData(offset,count){return this.data.substring(offset,offset+count);},appendData:function appendData(text){text=this.data+text;this.nodeValue=this.data=text;this.length=text.length;},insertData:function insertData(offset,text){this.replaceData(offset,0,text);},appendChild:function appendChild(newChild){throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]);},deleteData:function deleteData(offset,count){this.replaceData(offset,count,"");},replaceData:function replaceData(offset,count,text){var start=this.data.substring(0,offset);var end=this.data.substring(offset+count);text=start+text+end;this.nodeValue=this.data=text;this.length=text.length;}};_extends(CharacterData,Node);function Text(){}Text.prototype={nodeName:"#text",nodeType:TEXT_NODE,splitText:function splitText(offset){var text=this.data;var newText=text.substring(offset);text=text.substring(0,offset);this.data=this.nodeValue=text;this.length=text.length;var newNode=this.ownerDocument.createTextNode(newText);if(this.parentNode){this.parentNode.insertBefore(newNode,this.nextSibling);}return newNode;}};_extends(Text,CharacterData);function Comment(){}Comment.prototype={nodeName:"#comment",nodeType:COMMENT_NODE};_extends(Comment,CharacterData);function CDATASection(){}CDATASection.prototype={nodeName:"#cdata-section",nodeType:CDATA_SECTION_NODE};_extends(CDATASection,CharacterData);function DocumentType(){}DocumentType.prototype.nodeType=DOCUMENT_TYPE_NODE;_extends(DocumentType,Node);function Notation(){}Notation.prototype.nodeType=NOTATION_NODE;_extends(Notation,Node);function Entity(){}Entity.prototype.nodeType=ENTITY_NODE;_extends(Entity,Node);function EntityReference(){}EntityReference.prototype.nodeType=ENTITY_REFERENCE_NODE;_extends(EntityReference,Node);function DocumentFragment(){}DocumentFragment.prototype.nodeName="#document-fragment";DocumentFragment.prototype.nodeType=DOCUMENT_FRAGMENT_NODE;_extends(DocumentFragment,Node);function ProcessingInstruction(){}ProcessingInstruction.prototype.nodeType=PROCESSING_INSTRUCTION_NODE;_extends(ProcessingInstruction,Node);function XMLSerializer(){}XMLSerializer.prototype.serializeToString=function(node,isHtml,nodeFilter){return nodeSerializeToString.call(node,isHtml,nodeFilter);};Node.prototype.toString=nodeSerializeToString;function nodeSerializeToString(isHtml,nodeFilter){var buf=[];var refNode=this.nodeType==9&&this.documentElement||this;var prefix=refNode.prefix;var uri=refNode.namespaceURI;if(uri&&prefix==null){//console.log(prefix) var prefix=refNode.lookupPrefix(uri);if(prefix==null){//isHTML = true; var visibleNamespaces=[{namespace:uri,prefix:null}//{namespace:uri,prefix:''} ];}}serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);//console.log('###',this.nodeType,uri,prefix,buf.join('')) return buf.join('');}function needNamespaceDefine(node,isHTML,visibleNamespaces){var prefix=node.prefix||'';var uri=node.namespaceURI;// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) , // and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl : // > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty. // in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using) // and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared : // > [...] Furthermore, the attribute value [...] must not be an empty string. // so serializing empty namespace value like xmlns:ds="" would produce an invalid XML document. if(!uri){return false;}if(prefix==="xml"&&uri===NAMESPACE.XML||uri===NAMESPACE.XMLNS){return false;}var i=visibleNamespaces.length;while(i--){var ns=visibleNamespaces[i];// get namespace prefix if(ns.prefix===prefix){return ns.namespace!==uri;}}return true;}/** * Well-formed constraint: No < in Attribute Values * > The replacement text of any entity referred to directly or indirectly * > in an attribute value must not contain a <. * @see https://www.w3.org/TR/xml11/#CleanAttrVals * @see https://www.w3.org/TR/xml11/#NT-AttValue * * Literal whitespace other than space that appear in attribute values * are serialized as their entity references, so they will be preserved. * (In contrast to whitespace literals in the input which are normalized to spaces) * @see https://www.w3.org/TR/xml11/#AVNormalize * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes */function addSerializedAttribute(buf,qualifiedName,value){buf.push(' ',qualifiedName,'="',value.replace(/[<>&"\t\n\r]/g,_xmlEncoder),'"');}function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){if(!visibleNamespaces){visibleNamespaces=[];}if(nodeFilter){node=nodeFilter(node);if(node){if(typeof node=='string'){buf.push(node);return;}}else{return;}//buf.sort.apply(attrs, attributeSorter); }switch(node.nodeType){case ELEMENT_NODE:var attrs=node.attributes;var len=attrs.length;var child=node.firstChild;var nodeName=node.tagName;isHTML=NAMESPACE.isHTML(node.namespaceURI)||isHTML;var prefixedNodeName=nodeName;if(!isHTML&&!node.prefix&&node.namespaceURI){var defaultNS;// lookup current default ns from `xmlns` attribute for(var ai=0;ai=0;nsi--){var namespace=visibleNamespaces[nsi];if(namespace.prefix===''&&namespace.namespace===node.namespaceURI){defaultNS=namespace.namespace;break;}}}if(defaultNS!==node.namespaceURI){for(var nsi=visibleNamespaces.length-1;nsi>=0;nsi--){var namespace=visibleNamespaces[nsi];if(namespace.namespace===node.namespaceURI){if(namespace.prefix){prefixedNodeName=namespace.prefix+':'+nodeName;}break;}}}}buf.push('<',prefixedNodeName);for(var i=0;i');//if is cdata child node if(isHTML&&/^script$/i.test(nodeName)){while(child){if(child.data){buf.push(child.data);}else{serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice());}child=child.nextSibling;}}else{while(child){serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice());child=child.nextSibling;}}buf.push('');}else{buf.push('/>');}// remove added visible namespaces //visibleNamespaces.length = startVisibleNamespaces; return;case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:var child=node.firstChild;while(child){serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice());child=child.nextSibling;}return;case ATTRIBUTE_NODE:return addSerializedAttribute(buf,node.name,node.value);case TEXT_NODE:/** * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. * If they are needed elsewhere, they must be escaped using either numeric character references or the strings * `&` and `<` respectively. * The right angle bracket (>) may be represented using the string " > ", and must, for compatibility, * be escaped using either `>` or a character reference when it appears in the string `]]>` in content, * when that string is not marking the end of a CDATA section. * * In the content of elements, character data is any string of characters * which does not contain the start-delimiter of any markup * and does not include the CDATA-section-close delimiter, `]]>`. * * @see https://www.w3.org/TR/xml/#NT-CharData * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node */return buf.push(node.data.replace(/[<&>]/g,_xmlEncoder));case CDATA_SECTION_NODE:return buf.push('');case COMMENT_NODE:return buf.push("");case DOCUMENT_TYPE_NODE:var pubid=node.publicId;var sysid=node.systemId;buf.push('');}else if(sysid&&sysid!='.'){buf.push(' SYSTEM ',sysid,'>');}else{var sub=node.internalSubset;if(sub){buf.push(" [",sub,"]");}buf.push(">");}return;case PROCESSING_INSTRUCTION_NODE:return buf.push("");case ENTITY_REFERENCE_NODE:return buf.push('&',node.nodeName,';');//case ENTITY_NODE: //case NOTATION_NODE: default:buf.push('??',node.nodeName);}}function _importNode(doc,node,deep){var node2;switch(node.nodeType){case ELEMENT_NODE:node2=node.cloneNode(false);node2.ownerDocument=doc;//var attrs = node2.attributes; //var len = attrs.length; //for(var i=0;i',lt:'<',quot:'"'});/** * A map of all entities that are detected in an HTML document. * They contain all entries from `XML_ENTITIES`. * * @see XML_ENTITIES * @see DOMParser.parseFromString * @see DOMImplementation.prototype.createHTMLDocument * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec * @see https://html.spec.whatwg.org/entities.json JSON * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML) * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML) */exports.HTML_ENTITIES=freeze({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\uD835\uDD04",afr:"\uD835\uDD1E",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\uD835\uDD38",aopf:"\uD835\uDD52",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\uD835\uDC9C",ascr:"\uD835\uDCB6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\uD835\uDD05",bfr:"\uD835\uDD1F",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\uD835\uDD39",bopf:"\uD835\uDD53",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\uD835\uDCB7",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\uD835\uDD20",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\uD835\uDD54",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\uD835\uDC9E",cscr:"\uD835\uDCB8",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\uD835\uDD07",dfr:"\uD835\uDD21",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\uD835\uDD3B",dopf:"\uD835\uDD55",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\uD835\uDC9F",dscr:"\uD835\uDCB9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\uD835\uDD08",efr:"\uD835\uDD22",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\uD835\uDD3C",eopf:"\uD835\uDD56",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\uD835\uDD09",ffr:"\uD835\uDD23",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\uD835\uDD3D",fopf:"\uD835\uDD57",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\uD835\uDCBB",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\uD835\uDD0A",gfr:"\uD835\uDD24",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\uD835\uDD3E",gopf:"\uD835\uDD58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\uD835\uDCA2",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\uD835\uDD25",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\uD835\uDD59",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\uD835\uDCBD",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\uD835\uDD26",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\uD835\uDD40",iopf:"\uD835\uDD5A",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\uD835\uDCBE",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\uD835\uDD0D",jfr:"\uD835\uDD27",jmath:"\u0237",Jopf:"\uD835\uDD41",jopf:"\uD835\uDD5B",Jscr:"\uD835\uDCA5",jscr:"\uD835\uDCBF",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\uD835\uDD0E",kfr:"\uD835\uDD28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\uD835\uDD42",kopf:"\uD835\uDD5C",Kscr:"\uD835\uDCA6",kscr:"\uD835\uDCC0",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\uD835\uDD0F",lfr:"\uD835\uDD29",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\uD835\uDD43",lopf:"\uD835\uDD5D",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\uD835\uDCC1",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\uD835\uDD10",mfr:"\uD835\uDD2A",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\uD835\uDD44",mopf:"\uD835\uDD5E",mp:"\u2213",Mscr:"\u2133",mscr:"\uD835\uDCC2",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\uD835\uDD11",nfr:"\uD835\uDD2B",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\uD835\uDD5F",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\uD835\uDCA9",nscr:"\uD835\uDCC3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\uD835\uDD12",ofr:"\uD835\uDD2C",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\uD835\uDD46",oopf:"\uD835\uDD60",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\uD835\uDCAA",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\uD835\uDD13",pfr:"\uD835\uDD2D",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\uD835\uDD61",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\uD835\uDCAB",pscr:"\uD835\uDCC5",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\uD835\uDD14",qfr:"\uD835\uDD2E",qint:"\u2A0C",Qopf:"\u211A",qopf:"\uD835\uDD62",qprime:"\u2057",Qscr:"\uD835\uDCAC",qscr:"\uD835\uDCC6",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:"\"",quot:"\"",rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\uD835\uDD2F",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\uD835\uDD63",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\uD835\uDCC7",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\uD835\uDD16",sfr:"\uD835\uDD30",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\uD835\uDD4A",sopf:"\uD835\uDD64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\uD835\uDCAE",sscr:"\uD835\uDCC8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:"\t",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\uD835\uDD17",tfr:"\uD835\uDD31",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\uD835\uDD4B",topf:"\uD835\uDD65",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\uD835\uDCAF",tscr:"\uD835\uDCC9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\uD835\uDD18",ufr:"\uD835\uDD32",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\uD835\uDD4C",uopf:"\uD835\uDD66",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\uD835\uDCB0",uscr:"\uD835\uDCCA",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\uD835\uDD19",vfr:"\uD835\uDD33",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\uD835\uDD4D",vopf:"\uD835\uDD67",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\uD835\uDCB1",vscr:"\uD835\uDCCB",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\uD835\uDD1A",wfr:"\uD835\uDD34",Wopf:"\uD835\uDD4E",wopf:"\uD835\uDD68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\uD835\uDCB2",wscr:"\uD835\uDCCC",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\uD835\uDD1B",xfr:"\uD835\uDD35",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\uD835\uDD4F",xopf:"\uD835\uDD69",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\uD835\uDCB3",xscr:"\uD835\uDCCD",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\uD835\uDD1C",yfr:"\uD835\uDD36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\uD835\uDD50",yopf:"\uD835\uDD6A",Yscr:"\uD835\uDCB4",yscr:"\uD835\uDCCE",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\uD835\uDD37",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\uD835\uDD6B",Zscr:"\uD835\uDCB5",zscr:"\uD835\uDCCF",zwj:"\u200D",zwnj:"\u200C"});/** * @deprecated use `HTML_ENTITIES` instead * @see HTML_ENTITIES */exports.entityMap=exports.HTML_ENTITIES;/***/},/***/"./node_modules/@xmldom/xmldom/lib/index.js":/*!**************************************************!*\ !*** ./node_modules/@xmldom/xmldom/lib/index.js ***! \**************************************************/ /*! no static exports found */ /***/function node_modulesXmldomXmldomLibIndexJs(module,exports,__webpack_require__){var dom=__webpack_require__(/*! ./dom */"./node_modules/@xmldom/xmldom/lib/dom.js");exports.DOMImplementation=dom.DOMImplementation;exports.XMLSerializer=dom.XMLSerializer;exports.DOMParser=__webpack_require__(/*! ./dom-parser */"./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser;/***/},/***/"./node_modules/@xmldom/xmldom/lib/sax.js":/*!************************************************!*\ !*** ./node_modules/@xmldom/xmldom/lib/sax.js ***! \************************************************/ /*! no static exports found */ /***/function node_modulesXmldomXmldomLibSaxJs(module,exports,__webpack_require__){var NAMESPACE=__webpack_require__(/*! ./conventions */"./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE;//[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] //[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] //[5] Name ::= NameStartChar (NameChar)* var nameStartChar=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;//\u10000-\uEFFFF var nameChar=new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var tagNamePattern=new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/ //var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',') //S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE //S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE var S_TAG=0;//tag name offerring var S_ATTR=1;//attr name offerring var S_ATTR_SPACE=2;//attr name end and space offer var S_EQ=3;//=space? var S_ATTR_NOQUOT_VALUE=4;//attr value(no quot value only) var S_ATTR_END=5;//attr value end and no space(quot end) var S_TAG_SPACE=6;//(attr value end || tag end ) && (space offer) var S_TAG_CLOSE=7;//closed el /** * Creates an error that will not be caught by XMLReader aka the SAX parser. * * @param {string} message * @param {any?} locator Optional, can provide details about the location in the source * @constructor */function ParseError(message,locator){this.message=message;this.locator=locator;if(Error.captureStackTrace)Error.captureStackTrace(this,ParseError);}ParseError.prototype=new Error();ParseError.prototype.name=ParseError.name;function XMLReader(){}XMLReader.prototype={parse:function parse(source,defaultNSMap,entityMap){var domBuilder=this.domBuilder;domBuilder.startDocument();_copy(defaultNSMap,defaultNSMap={});_parse(source,defaultNSMap,entityMap,domBuilder,this.errorHandler);domBuilder.endDocument();}};function _parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){function fixedFromCharCode(code){// String.prototype.fromCharCode does not supports // > 2 bytes unicode chars directly if(code>0xffff){code-=0x10000;var surrogate1=0xd800+(code>>10),surrogate2=0xdc00+(code&0x3ff);return String.fromCharCode(surrogate1,surrogate2);}else{return String.fromCharCode(code);}}function entityReplacer(a){var k=a.slice(1,-1);if(Object.hasOwnProperty.call(entityMap,k)){return entityMap[k];}else if(k.charAt(0)==='#'){return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')));}else{errorHandler.error('entity not found:'+a);return a;}}function appendText(end){//has some bugs if(end>start){var xt=source.substring(start,end).replace(/&#?\w+;/g,entityReplacer);locator&&position(start);domBuilder.characters(xt,0,end-start);start=end;}}function position(p,m){while(p>=lineEnd&&(m=linePattern.exec(source))){lineStart=m.index;lineEnd=lineStart+m[0].length;locator.lineNumber++;//console.log('line++:',locator,startPos,endPos) }locator.columnNumber=p-lineStart+1;}var lineStart=0;var lineEnd=0;var linePattern=/.*(?:\r\n?|\n)|.*$/g;var locator=domBuilder.locator;var parseStack=[{currentNSMap:defaultNSMapCopy}];var closeMap={};var start=0;while(true){try{var tagStart=source.indexOf('<',start);if(tagStart<0){if(!source.substr(start).match(/^\s*$/)){var doc=domBuilder.doc;var text=doc.createTextNode(source.substr(start));doc.appendChild(text);domBuilder.currentElement=text;}return;}if(tagStart>start){appendText(tagStart);}switch(source.charAt(tagStart+1)){case'/':var end=source.indexOf('>',tagStart+3);var tagName=source.substring(tagStart+2,end).replace(/[ \t\n\r]+$/g,'');var config=parseStack.pop();if(end<0){tagName=source.substring(tagStart+2).replace(/[\s<].*/,'');errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);end=tagStart+1+tagName.length;}else if(tagName.match(/\s locator&&position(tagStart);end=parseInstruction(source,tagStart,domBuilder);break;case'!':// start){start=end;}else{//TODO: 这里有可能sax回退,有位置错误风险 appendText(Math.max(tagStart,start)+1);}}}function copyLocator(f,t){t.lineNumber=f.lineNumber;t.columnNumber=f.columnNumber;return t;}/** * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack); * @return end of the elementStartPart(end of elementEndPart for selfClosed el) */function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){/** * @param {string} qname * @param {string} value * @param {number} startIndex */function addAttribute(qname,value,startIndex){if(el.attributeNames.hasOwnProperty(qname)){errorHandler.fatalError('Attribute '+qname+' redefined');}el.addValue(qname,// @see https://www.w3.org/TR/xml/#AVNormalize // since the xmldom sax parser does not "interpret" DTD the following is not implemented: // - recursive replacement of (DTD) entity references // - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA value.replace(/[\t\n\r]/g,' ').replace(/&#?\w+;/g,entityReplacer),startIndex);}var attrName;var value;var p=++start;var s=S_TAG;//status while(true){var c=source.charAt(p);switch(c){case'=':if(s===S_ATTR){//attrName attrName=source.slice(start,p);s=S_EQ;}else if(s===S_ATTR_SPACE){s=S_EQ;}else{//fatalError: equal must after attrName or space after attrName throw new Error('attribute equal must after attrName');// No known test case }break;case'\'':case'"':if(s===S_EQ||s===S_ATTR//|| s == S_ATTR_SPACE ){//equal if(s===S_ATTR){errorHandler.warning('attribute value must after "="');attrName=source.slice(start,p);}start=p+1;p=source.indexOf(c,start);if(p>0){value=source.slice(start,p);addAttribute(attrName,value,start-1);s=S_ATTR_END;}else{//fatalError: no end quot match throw new Error('attribute value no end \''+c+'\' match');}}else if(s==S_ATTR_NOQUOT_VALUE){value=source.slice(start,p);addAttribute(attrName,value,start);errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');start=p+1;s=S_ATTR_END;}else{//fatalError: no equal before throw new Error('attribute value must after "="');// No known test case }break;case'/':switch(s){case S_TAG:el.setTagName(source.slice(start,p));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:s=S_TAG_CLOSE;el.closed=true;case S_ATTR_NOQUOT_VALUE:case S_ATTR:break;case S_ATTR_SPACE:el.closed=true;break;//case S_EQ: default:throw new Error("attribute invalid close char('/')");// No known test case }break;case''://end document errorHandler.error('unexpected end of input');if(s==S_TAG){el.setTagName(source.slice(start,p));}return p;case'>':switch(s){case S_TAG:el.setTagName(source.slice(start,p));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:break;//normal case S_ATTR_NOQUOT_VALUE://Compatible state case S_ATTR:value=source.slice(start,p);if(value.slice(-1)==='/'){el.closed=true;value=value.slice(0,-1);}case S_ATTR_SPACE:if(s===S_ATTR_SPACE){value=attrName;}if(s==S_ATTR_NOQUOT_VALUE){errorHandler.warning('attribute "'+value+'" missed quot(")!');addAttribute(attrName,value,start);}else{if(!NAMESPACE.isHTML(currentNSMap[''])||!value.match(/^(?:disabled|checked|selected)$/i)){errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!');}addAttribute(value,value,start);}break;case S_EQ:throw new Error('attribute value missed!!');}// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName)) return p;/*xml space '\x20' | #x9 | #xD | #xA; */case"\x80":c=' ';default:if(c<=' '){//space switch(s){case S_TAG:el.setTagName(source.slice(start,p));//tagName s=S_TAG_SPACE;break;case S_ATTR:attrName=source.slice(start,p);s=S_ATTR_SPACE;break;case S_ATTR_NOQUOT_VALUE:var value=source.slice(start,p);errorHandler.warning('attribute "'+value+'" missed quot(")!!');addAttribute(attrName,value,start);case S_ATTR_END:s=S_TAG_SPACE;break;//case S_TAG_SPACE: //case S_EQ: //case S_ATTR_SPACE: // void();break; //case S_TAG_CLOSE: //ignore warning }}else{//not space //S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE //S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE switch(s){//case S_TAG:void();break; //case S_ATTR:void();break; //case S_ATTR_NOQUOT_VALUE:void();break; case S_ATTR_SPACE:el.tagName;if(!NAMESPACE.isHTML(currentNSMap[''])||!attrName.match(/^(?:disabled|checked|selected)$/i)){errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!');}addAttribute(attrName,attrName,start);start=p;s=S_ATTR;break;case S_ATTR_END:errorHandler.warning('attribute space is required"'+attrName+'"!!');case S_TAG_SPACE:s=S_ATTR;start=p;break;case S_EQ:s=S_ATTR_NOQUOT_VALUE;start=p;break;case S_TAG_CLOSE:throw new Error("elements closed character '/' and '>' must be connected to");}}}//end outer switch //console.log('p++',p) p++;}}/** * @return true if has new namespace define */function appendElement(el,domBuilder,currentNSMap){var tagName=el.tagName;var localNSMap=null;//var currentNSMap = parseStack[parseStack.length-1].currentNSMap; var i=el.length;while(i--){var a=el[i];var qName=a.qName;var value=a.value;var nsp=qName.indexOf(':');if(nsp>0){var prefix=a.prefix=qName.slice(0,nsp);var localName=qName.slice(nsp+1);var nsPrefix=prefix==='xmlns'&&localName;}else{localName=qName;prefix=null;nsPrefix=qName==='xmlns'&&'';}//can not set prefix,because prefix !== '' a.localName=localName;//prefix == null for no ns prefix attribute if(nsPrefix!==false){//hack!! if(localNSMap==null){localNSMap={};//console.log(currentNSMap,0) _copy(currentNSMap,currentNSMap={});//console.log(currentNSMap,1) }currentNSMap[nsPrefix]=localNSMap[nsPrefix]=value;a.uri=NAMESPACE.XMLNS;domBuilder.startPrefixMapping(nsPrefix,value);}}var i=el.length;while(i--){a=el[i];var prefix=a.prefix;if(prefix){//no prefix attribute has no namespace if(prefix==='xml'){a.uri=NAMESPACE.XML;}if(prefix!=='xmlns'){a.uri=currentNSMap[prefix||''];//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)} }}}var nsp=tagName.indexOf(':');if(nsp>0){prefix=el.prefix=tagName.slice(0,nsp);localName=el.localName=tagName.slice(nsp+1);}else{prefix=null;//important!! localName=el.localName=tagName;}//no prefix element has default namespace var ns=el.uri=currentNSMap[prefix||''];domBuilder.startElement(ns,localName,tagName,el);//endPrefixMapping and startPrefixMapping have not any help for dom builder //localNSMap = null if(el.closed){domBuilder.endElement(ns,localName,tagName);if(localNSMap){for(prefix in localNSMap){if(Object.prototype.hasOwnProperty.call(localNSMap,prefix)){domBuilder.endPrefixMapping(prefix);}}}}else{el.currentNSMap=currentNSMap;el.localNSMap=localNSMap;//parseStack.push(el); return true;}}function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){if(/^(?:script|textarea)$/i.test(tagName)){var elEndStart=source.indexOf('',elStartEnd);var text=source.substring(elStartEnd+1,elEndStart);if(/[&<]/.test(text)){if(/^script$/i.test(tagName)){//if(!/\]\]>/.test(text)){ //lexHandler.startCDATA(); domBuilder.characters(text,0,text.length);//lexHandler.endCDATA(); return elEndStart;//} }//}else{//text area text=text.replace(/&#?\w+;/g,entityReplacer);domBuilder.characters(text,0,text.length);return elEndStart;//} }}return elStartEnd+1;}function fixSelfClosed(source,elStartEnd,tagName,closeMap){//if(tagName in closeMap){ var pos=closeMap[tagName];if(pos==null){//console.log(tagName) pos=source.lastIndexOf('');if(pos',start+4);//append comment source.substring(4,end)//