Free javascript Hosting


html-to-docx-esm.js

Uploaded on Jan 23 2022 13:53 by vimerah178

import JSZip from"jszip";import{fragment,create}from"xmlbuilder2";import HTMLToVDOM from"html-to-vdom";import crypto from"crypto";import escape from"escape-html";import fs from"fs";import path from"path";import util from"util";import events from"events";import{VText}from"virtual-dom";import colorNames from"color-name";var isVnode=function(x){return x&&"VirtualNode"===x.type&&"2"===x.version};var isWidget_1=function(w){return w&&"Widget"===w.type};var isThunk_1=function(t){return t&&"Thunk"===t.type};var isVhook=function(hook){return hook&&("function"==typeof hook.hook&&!hook.hasOwnProperty("hook")||"function"==typeof hook.unhook&&!hook.hasOwnProperty("unhook"))};var vnode=VirtualNode,noProperties={},noChildren=[];function VirtualNode(tagName,properties,children,key,namespace){this.tagName=tagName,this.properties=properties||noProperties,this.children=children||noChildren,this.key=null!=key?String(key):void 0,this.namespace="string"==typeof namespace?namespace:null;var hooks,count=children&&children.length||0,descendants=0,hasWidgets=!1,hasThunks=!1,descendantHooks=!1;for(var propName in properties)if(properties.hasOwnProperty(propName)){var property=properties[propName];isVhook(property)&&property.unhook&&(hooks||(hooks={}),hooks[propName]=property)}for(var i=0;i<count;i++){var child=children[i];isVnode(child)?(descendants+=child.count||0,!hasWidgets&&child.hasWidgets&&(hasWidgets=!0),!hasThunks&&child.hasThunks&&(hasThunks=!0),descendantHooks||!child.hooks&&!child.descendantHooks||(descendantHooks=!0)):!hasWidgets&&isWidget_1(child)?"function"==typeof child.destroy&&(hasWidgets=!0):!hasThunks&&isThunk_1(child)&&(hasThunks=!0)}this.count=count+descendants,this.hasWidgets=hasWidgets,this.hasThunks=hasThunks,this.hooks=hooks,this.descendantHooks=descendantHooks}VirtualNode.prototype.version="2",VirtualNode.prototype.type="VirtualNode";var vtext=VirtualText;function VirtualText(text){this.text=String(text)}VirtualText.prototype.version="2",VirtualText.prototype.type="VirtualText";const namespaces_a="http://schemas.openxmlformats.org/drawingml/2006/main",namespaces_cdr="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing",namespaces_dc="http://purl.org/dc/elements/1.1/",namespaces_dcmitype="http://purl.org/dc/dcmitype/",namespaces_dcterms="http://purl.org/dc/terms/",namespaces_o="urn:schemas-microsoft-com:office:office",namespaces_pic="http://schemas.openxmlformats.org/drawingml/2006/picture",namespaces_r="http://schemas.openxmlformats.org/officeDocument/2006/relationships",namespaces_v="urn:schemas-microsoft-com:vml",namespaces_ve="http://schemas.openxmlformats.org/markup-compatibility/2006",namespaces_vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",namespaces_w="http://schemas.openxmlformats.org/wordprocessingml/2006/main",namespaces_w10="urn:schemas-microsoft-com:office:word",namespaces_wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",namespaces_wne="http://schemas.microsoft.com/office/word/2006/wordml",namespaces_xsi="http://www.w3.org/2001/XMLSchema-instance",namespaces_numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",namespaces_hyperlinks="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",namespaces_images="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",namespaces_styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",namespaces_headers="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",namespaces_footers="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",namespaces_themes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",namespaces_coreProperties="http://schemas.openxmlformats.org/package/2006/metadata/core-properties",namespaces_officeDocumentRelation="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",namespaces_corePropertiesRelation="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",namespaces_settingsRelation="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",namespaces_webSettingsRelation="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",namespaces_sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main",namespaces_contentTypes="http://schemas.openxmlformats.org/package/2006/content-types",namespaces_relationship="http://schemas.openxmlformats.org/package/2006/relationships";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}function createCommonjsModule(fn,basedir,module){return fn(module={path:basedir,exports:{},require:function(path,base){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==base&&module.path)}},module.exports),module.exports}var lodash=createCommonjsModule((function(module,exports){(function(){var FUNC_ERROR_TEXT="Expected a function",PLACEHOLDER="__lodash_placeholder__",wrapFlags=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g,reEscapedHtml=/&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml=/[&<>"']/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source),reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source),reTrimStart=/^\s+/,reWhitespace=/\s/,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /,reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,reForbiddenIdentifierChars=/[()=,{}\[\]\/\s]/,reEscapeChar=/\\(\\)?/g,reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,reFlags=/\w*$/,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,reNoMatch=/($^)/,reUnescapedString=/['\n\r\u2028\u2029\\]/g,rsComboRange="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",rsBreakRange="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rsAstral="[\\ud800-\\udfff]",rsBreak="["+rsBreakRange+"]",rsCombo="["+rsComboRange+"]",rsDigits="\\d+",rsDingbat="[\\u2700-\\u27bf]",rsLower="[a-z\\xdf-\\xf6\\xf8-\\xff]",rsMisc="[^\\ud800-\\udfff"+rsBreakRange+rsDigits+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsNonAstral="[^\\ud800-\\udfff]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsUpper="[A-Z\\xc0-\\xd6\\xd8-\\xde]",rsMiscLower="(?:"+rsLower+"|"+rsMisc+")",rsMiscUpper="(?:"+rsUpper+"|"+rsMisc+")",reOptMod="(?:"+rsCombo+"|"+rsFitz+")"+"?",rsSeq="[\\ufe0e\\ufe0f]?"+reOptMod+("(?:\\u200d(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")[\\ufe0e\\ufe0f]?"+reOptMod+")*"),rsEmoji="(?:"+[rsDingbat,rsRegional,rsSurrPair].join("|")+")"+rsSeq,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reApos=RegExp("['’]","g"),reComboMark=RegExp(rsCombo,"g"),reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reUnicodeWord=RegExp([rsUpper+"?"+rsLower+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[rsBreak,rsUpper,"$"].join("|")+")",rsMiscUpper+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[rsBreak,rsUpper+rsMiscLower,"$"].join("|")+")",rsUpper+"?"+rsMiscLower+"+(?:['’](?:d|ll|m|re|s|t|ve))?",rsUpper+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rsDigits,rsEmoji].join("|"),"g"),reHasUnicode=RegExp("[\\u200d\\ud800-\\udfff"+rsComboRange+"\\ufe0e\\ufe0f]"),reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,contextProps=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],templateCounter=-1,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags["[object Uint8ClampedArray]"]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},freeParseFloat=parseFloat,freeParseInt=parseInt,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;return types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayAggregator(array,setter,iteratee,accumulator){for(var index=-1,length=null==array?0:array.length;++index<length;){var value=array[index];setter(accumulator,value,iteratee(value),array)}return accumulator}function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function arrayEachRight(array,iteratee){for(var length=null==array?0:array.length;length--&&!1!==iteratee(array[length],length,array););return array}function arrayEvery(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(!predicate(array[index],index,array))return!1;return!0}function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function arrayIncludes(array,value){return!!(null==array?0:array.length)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=null==array?0:array.length;++index<length;)if(comparator(value,array[index]))return!0;return!1}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function arrayReduceRight(array,iteratee,accumulator,initAccum){var length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[--length]);length--;)accumulator=iteratee(accumulator,array[length],length,array);return accumulator}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}var asciiSize=baseProperty("length");function baseFindKey(collection,predicate,eachFunc){var result;return eachFunc(collection,(function(value,key,collection){if(predicate(value,key,collection))return result=key,!1})),result}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){return value==value?function(array,value,fromIndex){var index=fromIndex-1,length=array.length;for(;++index<length;)if(array[index]===value)return index;return-1}(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}function baseIndexOfWith(array,value,fromIndex,comparator){for(var index=fromIndex-1,length=array.length;++index<length;)if(comparator(array[index],value))return index;return-1}function baseIsNaN(value){return value!=value}function baseMean(array,iteratee){var length=null==array?0:array.length;return length?baseSum(array,iteratee)/length:NaN}function baseProperty(key){return function(object){return null==object?undefined:object[key]}}function basePropertyOf(object){return function(key){return null==object?undefined:object[key]}}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,(function(value,index,collection){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection)})),accumulator}function baseSum(array,iteratee){for(var result,index=-1,length=array.length;++index<length;){var current=iteratee(array[index]);undefined!==current&&(result=undefined===result?current:result+current)}return result}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function baseTrim(string){return string?string.slice(0,trimmedEndIndex(string)+1).replace(reTrimStart,""):string}function baseUnary(func){return function(value){return func(value)}}function baseValues(object,props){return arrayMap(props,(function(key){return object[key]}))}function cacheHas(cache,key){return cache.has(key)}function charsStartIndex(strSymbols,chrSymbols){for(var index=-1,length=strSymbols.length;++index<length&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function countHolders(array,placeholder){for(var length=array.length,result=0;length--;)array[length]===placeholder&&++result;return result}var deburrLetter=basePropertyOf({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),escapeHtmlChar=basePropertyOf({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function escapeStringChar(chr){return"\\"+stringEscapes[chr]}function hasUnicode(string){return reHasUnicode.test(string)}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach((function(value,key){result[++index]=[key,value]})),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function replaceHolders(array,placeholder){for(var index=-1,length=array.length,resIndex=0,result=[];++index<length;){var value=array[index];value!==placeholder&&value!==PLACEHOLDER||(array[index]=PLACEHOLDER,result[resIndex++]=index)}return result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach((function(value){result[++index]=value})),result}function setToPairs(set){var index=-1,result=Array(set.size);return set.forEach((function(value){result[++index]=[value,value]})),result}function stringSize(string){return hasUnicode(string)?function(string){var result=reUnicode.lastIndex=0;for(;reUnicode.test(string);)++result;return result}(string):asciiSize(string)}function stringToArray(string){return hasUnicode(string)?function(string){return string.match(reUnicode)||[]}(string):function(string){return string.split("")}(string)}function trimmedEndIndex(string){for(var index=string.length;index--&&reWhitespace.test(string.charAt(index)););return index}var unescapeHtmlChar=basePropertyOf({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var _=function runInContext(context){var uid,Array=(context=null==context?root:_.defaults(root.Object(),context,_.pick(root,contextProps))).Array,Date=context.Date,Error=context.Error,Function=context.Function,Math=context.Math,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=context["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,idCounter=0,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""))?"Symbol(src)_1."+uid:"",nativeObjectToString=objectProto.toString,objectCtorString=funcToString.call(Object),oldDash=root._,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?context.Buffer:undefined,Symbol=context.Symbol,Uint8Array=context.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:undefined,symIterator=Symbol?Symbol.iterator:undefined,symToStringTag=Symbol?Symbol.toStringTag:undefined,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),ctxClearTimeout=context.clearTimeout!==root.clearTimeout&&context.clearTimeout,ctxNow=Date&&Date.now!==root.Date.now&&Date.now,ctxSetTimeout=context.setTimeout!==root.setTimeout&&context.setTimeout,nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=context.isFinite,nativeJoin=arrayProto.join,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeParseInt=context.parseInt,nativeRandom=Math.random,nativeReverse=arrayProto.reverse,DataView=getNative(context,"DataView"),Map=getNative(context,"Map"),Promise=getNative(context,"Promise"),Set=getNative(context,"Set"),WeakMap=getNative(context,"WeakMap"),nativeCreate=getNative(Object,"create"),metaMap=WeakMap&&new WeakMap,realNames={},dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined;function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper)return value;if(hasOwnProperty.call(value,"__wrapped__"))return wrapperClone(value)}return new LodashWrapper(value)}var baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=undefined,result}}();function baseLodash(){}function LodashWrapper(value,chainAll){this.__wrapped__=value,this.__actions__=[],this.__chain__=!!chainAll,this.__index__=0,this.__values__=undefined}function LazyWrapper(value){this.__wrapped__=value,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function arraySample(array){var length=array.length;return length?array[baseRandom(0,length-1)]:undefined}function arraySampleSize(array,n){return shuffleSelf(copyArray(array),baseClamp(n,0,array.length))}function arrayShuffle(array){return shuffleSelf(copyArray(array))}function assignMergeValue(object,key,value){(undefined!==value&&!eq(object[key],value)||undefined===value&&!(key in object))&&baseAssignValue(object,key,value)}function assignValue(object,key,value){var objValue=object[key];hasOwnProperty.call(object,key)&&eq(objValue,value)&&(undefined!==value||key in object)||baseAssignValue(object,key,value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseAggregator(collection,setter,iteratee,accumulator){return baseEach(collection,(function(value,key,collection){setter(accumulator,value,iteratee(value),collection)})),accumulator}function baseAssign(object,source){return object&&copyObject(source,keys(source),object)}function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}function baseAt(object,paths){for(var index=-1,length=paths.length,result=Array(length),skip=null==object;++index<length;)result[index]=skip?undefined:get(object,paths[index]);return result}function baseClamp(number,lower,upper){return number==number&&(undefined!==upper&&(number=number<=upper?number:upper),undefined!==lower&&(number=number>=lower?number:lower)),number}function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=1&bitmask,isFlat=2&bitmask,isFull=4&bitmask;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),undefined!==result)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=function(array){var length=array.length,result=new array.constructor(length);length&&"string"==typeof array[0]&&hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input);return result}(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?function(source,object){return copyObject(source,getSymbolsIn(source),object)}(value,function(object,source){return object&&copyObject(source,keysIn(source),object)}(result,value)):function(source,object){return copyObject(source,getSymbols(source),object)}(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=function(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return function(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return new Ctor;case numberTag:case stringTag:return new Ctor(object);case regexpTag:return function(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}(object);case setTag:return new Ctor;case symbolTag:return symbol=object,symbolValueOf?Object(symbolValueOf.call(symbol)):{}}var symbol}(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;stack.set(value,result),isSet(value)?value.forEach((function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))})):isMap(value)&&value.forEach((function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack))}));var props=isArr?undefined:(isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys)(value);return arrayEach(props||value,(function(subValue,key){props&&(subValue=value[key=subValue]),assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack))})),result}function baseConformsTo(object,source,props){var length=props.length;if(null==object)return!length;for(object=Object(object);length--;){var key=props[length],predicate=source[key],value=object[key];if(undefined===value&&!(key in object)||!predicate(value))return!1}return!0}function baseDelay(func,wait,args){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return setTimeout((function(){func.apply(undefined,args)}),wait)}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=200&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index<length;){var value=array[index],computed=null==iteratee?value:iteratee(value);if(value=comparator||0!==value?value:0,isCommon&&computed==computed){for(var valuesIndex=valuesLength;valuesIndex--;)if(values[valuesIndex]===computed)continue outer;result.push(value)}else includes(values,computed,comparator)||result.push(value)}return result}lodash.templateSettings={escape:reEscape,evaluate:reEvaluate,interpolate:reInterpolate,variable:"",imports:{_:lodash}},lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=baseCreate(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=baseCreate(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=function(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0},Hash.prototype.delete=function(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result},Hash.prototype.get=function(key){var data=this.__data__;if(nativeCreate){var result=data[key];return"__lodash_hash_undefined__"===result?undefined:result}return hasOwnProperty.call(data,key)?data[key]:undefined},Hash.prototype.has=function(key){var data=this.__data__;return nativeCreate?undefined!==data[key]:hasOwnProperty.call(data,key)},Hash.prototype.set=function(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&undefined===value?"__lodash_hash_undefined__":value,this},ListCache.prototype.clear=function(){this.__data__=[],this.size=0},ListCache.prototype.delete=function(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)},ListCache.prototype.get=function(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?undefined:data[index][1]},ListCache.prototype.has=function(key){return assocIndexOf(this.__data__,key)>-1},ListCache.prototype.set=function(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this},MapCache.prototype.clear=function(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}},MapCache.prototype.delete=function(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result},MapCache.prototype.get=function(key){return getMapData(this,key).get(key)},MapCache.prototype.has=function(key){return getMapData(this,key).has(key)},MapCache.prototype.set=function(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this},SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)},Stack.prototype.clear=function(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result},Stack.prototype.get=function(key){return this.__data__.get(key)},Stack.prototype.has=function(key){return this.__data__.has(key)},Stack.prototype.set=function(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<199)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this};var baseEach=createBaseEach(baseForOwn),baseEachRight=createBaseEach(baseForOwnRight,!0);function baseEvery(collection,predicate){var result=!0;return baseEach(collection,(function(value,index,collection){return result=!!predicate(value,index,collection)})),result}function baseExtremum(array,iteratee,comparator){for(var index=-1,length=array.length;++index<length;){var value=array[index],current=iteratee(value);if(null!=current&&(undefined===computed?current==current&&!isSymbol(current):comparator(current,computed)))var computed=current,result=value}return result}function baseFilter(collection,predicate){var result=[];return baseEach(collection,(function(value,index,collection){predicate(value,index,collection)&&result.push(value)})),result}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}var baseFor=createBaseFor(),baseForRight=createBaseFor(!0);function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys)}function baseFunctions(object,props){return arrayFilter(props,(function(key){return isFunction(object[key])}))}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:undefined}function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function baseGetTag(value){return null==value?undefined===value?"[object Undefined]":"[object Null]":symToStringTag&&symToStringTag in Object(value)?function(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=undefined;var unmasked=!0}catch(e){}var result=nativeObjectToString.call(value);unmasked&&(isOwn?value[symToStringTag]=tag:delete value[symToStringTag]);return result}(value):function(value){return nativeObjectToString.call(value)}(value)}function baseGt(value,other){return value>other}function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function baseHasIn(object,key){return null!=object&&key in Object(object)}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++index<length&&result.length<maxLength;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,!(seen?cacheHas(seen,computed):includes(result,computed,comparator))){for(othIndex=othLength;--othIndex;){var cache=caches[othIndex];if(!(cache?cacheHas(cache,computed):includes(arrays[othIndex],computed,comparator)))continue outer}seen&&seen.push(computed),result.push(value)}}return result}function baseInvoke(object,path,args){var func=null==(object=parent(object,path=castPath(path,object)))?object:object[toKey(last(path))];return null==func?undefined:apply(func,object,args)}function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:function(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other),objIsObj=(objTag=objTag==argsTag?objectTag:objTag)==objectTag,othIsObj=(othTag=othTag==argsTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case arrayBufferTag:return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case boolTag:case dateTag:case numberTag:return eq(+object,+other);case errorTag:return object.name==other.name&&object.message==other.message;case regexpTag:case stringTag:return object==other+"";case mapTag:var convert=mapToArray;case setTag:var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case symbolTag:if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}if(!isSameTag)return!1;return stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length,othLength=getAllKeys(other).length;if(objLength!=othLength&&!isPartial)return!1;var index=objLength;for(;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;var result=!0;stack.set(object,other),stack.set(other,object);var skipCtor=isPartial;for(;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(undefined===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor==othCtor||!("constructor"in object)||!("constructor"in other)||"function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor||(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack)}(value,other,bitmask,customizer,baseIsEqual,stack))}function baseIsMatch(object,source,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){var key=(data=matchData[index])[0],objValue=object[key],srcValue=data[1];if(noCustomizer&&data[2]){if(undefined===objValue&&!(key in object))return!1}else{var stack=new Stack;if(customizer)var result=customizer(objValue,srcValue,key,object,source,stack);if(!(undefined===result?baseIsEqual(srcValue,objValue,3,customizer,stack):result))return!1}}return!0}function baseIsNative(value){return!(!isObject(value)||(func=value,maskSrcKey&&maskSrcKey in func))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value));var func}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&"constructor"!=key&&result.push(key);return result}function baseKeysIn(object){if(!isObject(object))return function(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}(object);var isProto=isPrototype(object),result=[];for(var key in object)("constructor"!=key||!isProto&&hasOwnProperty.call(object,key))&&result.push(key);return result}function baseLt(value,other){return value<other}function baseMap(collection,iteratee){var index=-1,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,(function(value,key,collection){result[++index]=iteratee(value,key,collection)})),result}function baseMatches(source){var matchData=getMatchData(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||baseIsMatch(object,source,matchData)}}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=get(object,path);return undefined===objValue&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,3)}}function baseMerge(object,source,srcIndex,customizer,stack){object!==source&&baseFor(source,(function(srcValue,key){if(stack||(stack=new Stack),isObject(srcValue))!function(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked)return void assignMergeValue(object,key,stacked);var newValue=customizer?customizer(objValue,srcValue,key+"",object,source,stack):undefined,isCommon=undefined===newValue;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue,isArr||isBuff||isTyped?isArray(objValue)?newValue=objValue:isArrayLikeObject(objValue)?newValue=copyArray(objValue):isBuff?(isCommon=!1,newValue=cloneBuffer(srcValue,!0)):isTyped?(isCommon=!1,newValue=cloneTypedArray(srcValue,!0)):newValue=[]:isPlainObject(srcValue)||isArguments(srcValue)?(newValue=objValue,isArguments(objValue)?newValue=toPlainObject(objValue):isObject(objValue)&&!isFunction(objValue)||(newValue=initCloneObject(srcValue))):isCommon=!1}isCommon&&(stack.set(srcValue,newValue),mergeFunc(newValue,srcValue,srcIndex,customizer,stack),stack.delete(srcValue));assignMergeValue(object,key,newValue)}(object,source,key,srcIndex,baseMerge,customizer,stack);else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+"",object,source,stack):undefined;undefined===newValue&&(newValue=srcValue),assignMergeValue(object,key,newValue)}}),keysIn)}function baseNth(array,n){var length=array.length;if(length)return isIndex(n+=n<0?length:0,length)?array[n]:undefined}function baseOrderBy(collection,iteratees,orders){iteratees=iteratees.length?arrayMap(iteratees,(function(iteratee){return isArray(iteratee)?function(value){return baseGet(value,1===iteratee.length?iteratee[0]:iteratee)}:iteratee})):[identity];var index=-1;iteratees=arrayMap(iteratees,baseUnary(getIteratee()));var result=baseMap(collection,(function(value,key,collection){var criteria=arrayMap(iteratees,(function(iteratee){return iteratee(value)}));return{criteria:criteria,index:++index,value:value}}));return function(array,comparer){var length=array.length;for(array.sort(comparer);length--;)array[length]=array[length].value;return array}(result,(function(object,other){return function(object,other,orders){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;for(;++index<length;){var result=compareAscending(objCriteria[index],othCriteria[index]);if(result)return index>=ordersLength?result:result*("desc"==orders[index]?-1:1)}return object.index-other.index}(object,other,orders)}))}function basePickBy(object,paths,predicate){for(var index=-1,length=paths.length,result={};++index<length;){var path=paths[index],value=baseGet(object,path);predicate(value,path)&&baseSet(result,castPath(path,object),value)}return result}function basePullAll(array,values,iteratee,comparator){var indexOf=comparator?baseIndexOfWith:baseIndexOf,index=-1,length=values.length,seen=array;for(array===values&&(values=copyArray(values)),iteratee&&(seen=arrayMap(array,baseUnary(iteratee)));++index<length;)for(var fromIndex=0,value=values[index],computed=iteratee?iteratee(value):value;(fromIndex=indexOf(seen,computed,fromIndex,comparator))>-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function basePullAt(array,indexes){for(var length=array?indexes.length:0,lastIndex=length-1;length--;){var index=indexes[length];if(length==lastIndex||index!==previous){var previous=index;isIndex(index)?splice.call(array,index,1):baseUnset(array,index)}}return array}function baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1))}function baseRepeat(string,n){var result="";if(!string||n<1||n>9007199254740991)return result;do{n%2&&(result+=string),(n=nativeFloor(n/2))&&(string+=string)}while(n);return result}function baseRest(func,start){return setToString(overRest(func,start,identity),func+"")}function baseSample(collection){return arraySample(values(collection))}function baseSampleSize(collection,n){var array=values(collection);return shuffleSelf(array,baseClamp(n,0,array.length))}function baseSet(object,path,value,customizer){if(!isObject(object))return object;for(var index=-1,length=(path=castPath(path,object)).length,lastIndex=length-1,nested=object;null!=nested&&++index<length;){var key=toKey(path[index]),newValue=value;if("__proto__"===key||"constructor"===key||"prototype"===key)return object;if(index!=lastIndex){var objValue=nested[key];undefined===(newValue=customizer?customizer(objValue,key,nested):undefined)&&(newValue=isObject(objValue)?objValue:isIndex(path[index+1])?[]:{})}assignValue(nested,key,newValue),nested=nested[key]}return object}var baseSetData=metaMap?function(func,data){return metaMap.set(func,data),func}:identity,baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity;function baseShuffle(collection){return shuffleSelf(values(collection))}function baseSlice(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),(end=end>length?length:end)<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}function baseSome(collection,predicate){var result;return baseEach(collection,(function(value,index,collection){return!(result=predicate(value,index,collection))})),!!result}function baseSortedIndex(array,value,retHighest){var low=0,high=null==array?low:array.length;if("number"==typeof value&&value==value&&high<=2147483647){for(;low<high;){var mid=low+high>>>1,computed=array[mid];null!==computed&&!isSymbol(computed)&&(retHighest?computed<=value:computed<value)?low=mid+1:high=mid}return high}return baseSortedIndexBy(array,value,identity,retHighest)}function baseSortedIndexBy(array,value,iteratee,retHighest){var low=0,high=null==array?0:array.length;if(0===high)return 0;for(var valIsNaN=(value=iteratee(value))!=value,valIsNull=null===value,valIsSymbol=isSymbol(value),valIsUndefined=undefined===value;low<high;){var mid=nativeFloor((low+high)/2),computed=iteratee(array[mid]),othIsDefined=undefined!==computed,othIsNull=null===computed,othIsReflexive=computed==computed,othIsSymbol=isSymbol(computed);if(valIsNaN)var setLow=retHighest||othIsReflexive;else setLow=valIsUndefined?othIsReflexive&&(retHighest||othIsDefined):valIsNull?othIsReflexive&&othIsDefined&&(retHighest||!othIsNull):valIsSymbol?othIsReflexive&&othIsDefined&&!othIsNull&&(retHighest||!othIsSymbol):!othIsNull&&!othIsSymbol&&(retHighest?computed<=value:computed<value);setLow?low=mid+1:high=mid}return nativeMin(high,4294967294)}function baseSortedUniq(array,iteratee){for(var index=-1,length=array.length,resIndex=0,result=[];++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(!index||!eq(computed,seen)){var seen=computed;result[resIndex++]=0===value?0:value}}return result}function baseToNumber(value){return"number"==typeof value?value:isSymbol(value)?NaN:+value}function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-Infinity?"-0":result}function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(comparator)isCommon=!1,includes=arrayIncludesWith;else if(length>=200){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed==computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}function baseUnset(object,path){return null==(object=parent(object,path=castPath(path,object)))||delete object[toKey(last(path))]}function baseUpdate(object,path,updater,customizer){return baseSet(object,path,updater(baseGet(object,path)),customizer)}function baseWhile(array,predicate,isDrop,fromRight){for(var length=array.length,index=fromRight?length:-1;(fromRight?index--:++index<length)&&predicate(array[index],index,array););return isDrop?baseSlice(array,fromRight?0:index,fromRight?index+1:length):baseSlice(array,fromRight?index+1:0,fromRight?length:index)}function baseWrapperValue(value,actions){var result=value;return result instanceof LazyWrapper&&(result=result.value()),arrayReduce(actions,(function(result,action){return action.func.apply(action.thisArg,arrayPush([result],action.args))}),result)}function baseXor(arrays,iteratee,comparator){var length=arrays.length;if(length<2)return length?baseUniq(arrays[0]):[];for(var index=-1,result=Array(length);++index<length;)for(var array=arrays[index],othIndex=-1;++othIndex<length;)othIndex!=index&&(result[index]=baseDifference(result[index]||array,arrays[othIndex],iteratee,comparator));return baseUniq(baseFlatten(result,1),iteratee,comparator)}function baseZipObject(props,values,assignFunc){for(var index=-1,length=props.length,valsLength=values.length,result={};++index<length;){var value=index<valsLength?values[index]:undefined;assignFunc(result,props[index],value)}return result}function castArrayLikeObject(value){return isArrayLikeObject(value)?value:[]}function castFunction(value){return"function"==typeof value?value:identity}function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}var castRest=baseRest;function castSlice(array,start,end){var length=array.length;return end=undefined===end?length:end,!start&&end>=length?array:baseSlice(array,start,end)}var clearTimeout=ctxClearTimeout||function(id){return root.clearTimeout(id)};function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)),result}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function compareAscending(value,other){if(value!==other){var valIsDefined=undefined!==value,valIsNull=null===value,valIsReflexive=value==value,valIsSymbol=isSymbol(value),othIsDefined=undefined!==other,othIsNull=null===other,othIsReflexive=other==other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value<other||othIsSymbol&&valIsDefined&&valIsReflexive&&!valIsNull&&!valIsSymbol||othIsNull&&valIsDefined&&valIsReflexive||!othIsDefined&&valIsReflexive||!othIsReflexive)return-1}return 0}function composeArgs(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;++leftIndex<leftLength;)result[leftIndex]=partials[leftIndex];for(;++argsIndex<holdersLength;)(isUncurried||argsIndex<argsLength)&&(result[holders[argsIndex]]=args[argsIndex]);for(;rangeLength--;)result[leftIndex++]=args[argsIndex++];return result}function composeArgsRight(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersIndex=-1,holdersLength=holders.length,rightIndex=-1,rightLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(rangeLength+rightLength),isUncurried=!isCurried;++argsIndex<rangeLength;)result[argsIndex]=args[argsIndex];for(var offset=argsIndex;++rightIndex<rightLength;)result[offset+rightIndex]=partials[rightIndex];for(;++holdersIndex<holdersLength;)(isUncurried||argsIndex<argsLength)&&(result[offset+holders[holdersIndex]]=args[argsIndex++]);return result}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=customizer?customizer(object[key],source[key],key,object,source):undefined;undefined===newValue&&(newValue=source[key]),isNew?baseAssignValue(object,key,newValue):assignValue(object,key,newValue)}return object}function createAggregator(setter,initializer){return function(collection,iteratee){var func=isArray(collection)?arrayAggregator:baseAggregator,accumulator=initializer?initializer():{};return func(collection,setter,getIteratee(iteratee,2),accumulator)}}function createAssigner(assigner){return baseRest((function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):undefined,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?undefined:customizer,length=1),object=Object(object);++index<length;){var source=sources[index];source&&assigner(object,source,index,customizer)}return object}))}function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index<length)&&!1!==iteratee(iterable[index],index,iterable););return collection}}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[fromRight?length:++index];if(!1===iteratee(iterable[key],key,iterable))break}return object}}function createCaseFirst(methodName){return function(string){var strSymbols=hasUnicode(string=toString(string))?stringToArray(string):undefined,chr=strSymbols?strSymbols[0]:string.charAt(0),trailing=strSymbols?castSlice(strSymbols,1).join(""):string.slice(1);return chr[methodName]()+trailing}}function createCompounder(callback){return function(string){return arrayReduce(words(deburr(string).replace(reApos,"")),callback,"")}}function createCtor(Ctor){return function(){var args=arguments;switch(args.length){case 0:return new Ctor;case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6])}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);return isObject(result)?result:thisBinding}}function createFind(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=getIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:undefined}}function createFlow(fromRight){return flatRest((function(funcs){var length=funcs.length,index=length,prereq=LodashWrapper.prototype.thru;for(fromRight&&funcs.reverse();index--;){var func=funcs[index];if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);if(prereq&&!wrapper&&"wrapper"==getFuncName(func))var wrapper=new LodashWrapper([],!0)}for(index=wrapper?index:length;++index<length;){var funcName=getFuncName(func=funcs[index]),data="wrapper"==funcName?getData(func):undefined;wrapper=data&&isLaziable(data[0])&&424==data[1]&&!data[4].length&&1==data[9]?wrapper[getFuncName(data[0])].apply(wrapper,data[3]):1==func.length&&isLaziable(func)?wrapper[funcName]():wrapper.thru(func)}return function(){var args=arguments,value=args[0];if(wrapper&&1==args.length&&isArray(value))return wrapper.plant(value).value();for(var index=0,result=length?funcs[index].apply(this,args):value;++index<length;)result=funcs[index].call(this,result);return result}}))}function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=128&bitmask,isBind=1&bitmask,isBindKey=2&bitmask,isCurried=24&bitmask,isFlip=512&bitmask,Ctor=isBindKey?undefined:createCtor(func);return function wrapper(){for(var length=arguments.length,args=Array(length),index=length;index--;)args[index]=arguments[index];if(isCurried)var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);if(partials&&(args=composeArgs(args,partials,holders,isCurried)),partialsRight&&(args=composeArgsRight(args,partialsRight,holdersRight,isCurried)),length-=holdersCount,isCurried&&length<arity){var newHolders=replaceHolders(args,placeholder);return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,thisArg,args,newHolders,argPos,ary,arity-length)}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;return length=args.length,argPos?args=reorder(args,argPos):isFlip&&length>1&&args.reverse(),isAry&&ary<length&&(args.length=ary),this&&this!==root&&this instanceof wrapper&&(fn=Ctor||createCtor(fn)),fn.apply(thisBinding,args)}}function createInverter(setter,toIteratee){return function(object,iteratee){return function(object,setter,iteratee,accumulator){return baseForOwn(object,(function(value,key,object){setter(accumulator,iteratee(value),key,object)})),accumulator}(object,setter,toIteratee(iteratee),{})}}function createMathOperation(operator,defaultValue){return function(value,other){var result;if(undefined===value&&undefined===other)return defaultValue;if(undefined!==value&&(result=value),undefined!==other){if(undefined===result)return other;"string"==typeof value||"string"==typeof other?(value=baseToString(value),other=baseToString(other)):(value=baseToNumber(value),other=baseToNumber(other)),result=operator(value,other)}return result}}function createOver(arrayFunc){return flatRest((function(iteratees){return iteratees=arrayMap(iteratees,baseUnary(getIteratee())),baseRest((function(args){var thisArg=this;return arrayFunc(iteratees,(function(iteratee){return apply(iteratee,thisArg,args)}))}))}))}function createPadding(length,chars){var charsLength=(chars=undefined===chars?" ":baseToString(chars)).length;if(charsLength<2)return charsLength?baseRepeat(chars,length):chars;var result=baseRepeat(chars,nativeCeil(length/stringSize(chars)));return hasUnicode(chars)?castSlice(stringToArray(result),0,length).join(""):result.slice(0,length)}function createRange(fromRight){return function(start,end,step){return step&&"number"!=typeof step&&isIterateeCall(start,end,step)&&(end=step=undefined),start=toFinite(start),undefined===end?(end=start,start=0):end=toFinite(end),function(start,end,step,fromRight){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[fromRight?length:++index]=start,start+=step;return result}(start,end,step=undefined===step?start<end?1:-1:toFinite(step),fromRight)}}function createRelationalOperation(operator){return function(value,other){return"string"==typeof value&&"string"==typeof other||(value=toNumber(value),other=toNumber(other)),operator(value,other)}}function createRecurry(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=8&bitmask;bitmask|=isCurry?32:64,4&(bitmask&=~(isCurry?64:32))||(bitmask&=-4);var newData=[func,bitmask,thisArg,isCurry?partials:undefined,isCurry?holders:undefined,isCurry?undefined:partials,isCurry?undefined:holders,argPos,ary,arity],result=wrapFunc.apply(undefined,newData);return isLaziable(func)&&setData(result,newData),result.placeholder=placeholder,setWrapToString(result,func,bitmask)}function createRound(methodName){var func=Math[methodName];return function(number,precision){if(number=toNumber(number),(precision=null==precision?0:nativeMin(toInteger(precision),292))&&nativeIsFinite(number)){var pair=(toString(number)+"e").split("e");return+((pair=(toString(func(pair[0]+"e"+(+pair[1]+precision)))+"e").split("e"))[0]+"e"+(+pair[1]-precision))}return func(number)}}var createSet=Set&&1/setToArray(new Set([,-0]))[1]==Infinity?function(values){return new Set(values)}:noop;function createToPairs(keysFunc){return function(object){var tag=getTag(object);return tag==mapTag?mapToArray(object):tag==setTag?setToPairs(object):function(object,props){return arrayMap(props,(function(key){return[key,object[key]]}))}(object,keysFunc(object))}}function createWrap(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=2&bitmask;if(!isBindKey&&"function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);var length=partials?partials.length:0;if(length||(bitmask&=-97,partials=holders=undefined),ary=undefined===ary?ary:nativeMax(toInteger(ary),0),arity=undefined===arity?arity:toInteger(arity),length-=holders?holders.length:0,64&bitmask){var partialsRight=partials,holdersRight=holders;partials=holders=undefined}var data=isBindKey?undefined:getData(func),newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];if(data&&function(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask<131,isCombo=128==srcBitmask&&8==bitmask||128==srcBitmask&&256==bitmask&&data[7].length<=source[8]||384==srcBitmask&&source[7].length<=source[8]&&8==bitmask;if(!isCommon&&!isCombo)return data;1&srcBitmask&&(data[2]=source[2],newBitmask|=1&bitmask?0:4);var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):value,data[4]=partials?replaceHolders(data[3],PLACEHOLDER):source[4]}(value=source[5])&&(partials=data[5],data[5]=partials?composeArgsRight(partials,value,source[6]):value,data[6]=partials?replaceHolders(data[5],PLACEHOLDER):source[6]);(value=source[7])&&(data[7]=value);128&srcBitmask&&(data[8]=null==data[8]?source[8]:nativeMin(data[8],source[8]));null==data[9]&&(data[9]=source[9]);data[0]=source[0],data[1]=newBitmask}(newData,data),func=newData[0],bitmask=newData[1],thisArg=newData[2],partials=newData[3],holders=newData[4],!(arity=newData[9]=undefined===newData[9]?isBindKey?0:func.length:nativeMax(newData[9]-length,0))&&24&bitmask&&(bitmask&=-25),bitmask&&1!=bitmask)result=8==bitmask||16==bitmask?function(func,bitmask,arity){var Ctor=createCtor(func);return function wrapper(){for(var length=arguments.length,args=Array(length),index=length,placeholder=getHolder(wrapper);index--;)args[index]=arguments[index];var holders=length<3&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);return(length-=holders.length)<arity?createRecurry(func,bitmask,createHybrid,wrapper.placeholder,void 0,args,holders,void 0,void 0,arity-length):apply(this&&this!==root&&this instanceof wrapper?Ctor:func,this,args)}}(func,bitmask,arity):32!=bitmask&&33!=bitmask||holders.length?createHybrid.apply(undefined,newData):function(func,bitmask,thisArg,partials){var isBind=1&bitmask,Ctor=createCtor(func);return function wrapper(){for(var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;++leftIndex<leftLength;)args[leftIndex]=partials[leftIndex];for(;argsLength--;)args[leftIndex++]=arguments[++argsIndex];return apply(fn,isBind?thisArg:this,args)}}(func,bitmask,thisArg,partials);else var result=function(func,bitmask,thisArg){var isBind=1&bitmask,Ctor=createCtor(func);return function wrapper(){return(this&&this!==root&&this instanceof wrapper?Ctor:func).apply(isBind?thisArg:this,arguments)}}(func,bitmask,thisArg);return setWrapToString((data?baseSetData:setData)(result,newData),func,bitmask)}function customDefaultsAssignIn(objValue,srcValue,key,object){return undefined===objValue||eq(objValue,objectProto[key])&&!hasOwnProperty.call(object,key)?srcValue:objValue}function customDefaultsMerge(objValue,srcValue,key,object,source,stack){return isObject(objValue)&&isObject(srcValue)&&(stack.set(srcValue,objValue),baseMerge(objValue,srcValue,undefined,customDefaultsMerge,stack),stack.delete(srcValue)),objValue}function customOmitClone(value){return isPlainObject(value)?undefined:value}function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:undefined;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(undefined!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,(function(othValue,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack)))return seen.push(othIndex)}))){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function flatRest(func){return setToString(overRest(func,undefined,flatten),func+"")}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}var getData=metaMap?function(func){return metaMap.get(func)}:noop;function getFuncName(func){for(var result=func.name+"",array=realNames[result],length=hasOwnProperty.call(realNames,result)?array.length:0;length--;){var data=array[length],otherFunc=data.func;if(null==otherFunc||otherFunc==func)return data.name}return result}function getHolder(func){return(hasOwnProperty.call(lodash,"placeholder")?lodash:func).placeholder}function getIteratee(){var result=lodash.iteratee||iteratee;return result=result===iteratee?baseIteratee:result,arguments.length?result(arguments[0],arguments[1]):result}function getMapData(map,key){var value,type,data=map.__data__;return("string"==(type=typeof(value=key))||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value)?data["string"==typeof key?"string":"hash"]:data.map}function getMatchData(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}function getNative(object,key){var value=function(object,key){return null==object?void 0:object[key]}(object,key);return baseIsNative(value)?value:undefined}var getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),(function(symbol){return propertyIsEnumerable.call(object,symbol)})))}:stubArray,getSymbolsIn=nativeGetSymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray,getTag=baseGetTag;function hasPath(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}function initCloneObject(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isIndex(value,length){var type=typeof value;return!!(length=null==length?9007199254740991:length)&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function isIterateeCall(value,index,object){if(!isObject(object))return!1;var type=typeof index;return!!("number"==type?isArrayLike(object)&&isIndex(index,object.length):"string"==type&&index in object)&&eq(object[index],value)}function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}function isLaziable(func){var funcName=getFuncName(func),other=lodash[funcName];if("function"!=typeof other||!(funcName in LazyWrapper.prototype))return!1;if(func===other)return!0;var data=getData(other);return!!data&&func===data[0]}(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var isMaskable=coreJsData?isFunction:stubFalse;function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto)}function isStrictComparable(value){return value==value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(undefined!==srcValue||key in Object(object)))}}function overRest(func,start,transform){return start=nativeMax(undefined===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),apply(func,this,otherArgs)}}function parent(object,path){return path.length<2?object:baseGet(object,baseSlice(path,0,-1))}function reorder(array,indexes){for(var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);length--;){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined}return array}function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}var setData=shortOut(baseSetData),setTimeout=ctxSetTimeout||function(func,wait){return root.setTimeout(func,wait)},setToString=shortOut(baseSetToString);function setWrapToString(wrapper,reference,bitmask){var source=reference+"";return setToString(wrapper,function(source,details){var length=details.length;if(!length)return source;var lastIndex=length-1;return details[lastIndex]=(length>1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}(source,function(details,bitmask){return arrayEach(wrapFlags,(function(pair){var value="_."+pair[0];bitmask&pair[1]&&!arrayIncludes(details,value)&&details.push(value)})),details.sort()}(function(source){var match=source.match(reWrapDetails);return match?match[1].split(reSplitDetails):[]}(source),bitmask)))}function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=16-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=800)return arguments[0]}else count=0;return func.apply(undefined,arguments)}}function shuffleSelf(array,size){var index=-1,length=array.length,lastIndex=length-1;for(size=undefined===size?length:size;++index<size;){var rand=baseRandom(index,lastIndex),value=array[rand];array[rand]=array[index],array[index]=value}return array.length=size,array}var stringToPath=function(func){var result=memoize(func,(function(key){return 500===cache.size&&cache.clear(),key})),cache=result.cache;return result}((function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,(function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)})),result}));function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-Infinity?"-0":result}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper)return wrapper.clone();var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);return result.__actions__=copyArray(wrapper.__actions__),result.__index__=wrapper.__index__,result.__values__=wrapper.__values__,result}var difference=baseRest((function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]})),differenceBy=baseRest((function(array,values){var iteratee=last(values);return isArrayLikeObject(iteratee)&&(iteratee=undefined),isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0),getIteratee(iteratee,2)):[]})),differenceWith=baseRest((function(array,values){var comparator=last(values);return isArrayLikeObject(comparator)&&(comparator=undefined),isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0),undefined,comparator):[]}));function findIndex(array,predicate,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=null==fromIndex?0:toInteger(fromIndex);return index<0&&(index=nativeMax(length+index,0)),baseFindIndex(array,getIteratee(predicate,3),index)}function findLastIndex(array,predicate,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=length-1;return undefined!==fromIndex&&(index=toInteger(fromIndex),index=fromIndex<0?nativeMax(length+index,0):nativeMin(index,length-1)),baseFindIndex(array,getIteratee(predicate,3),index,!0)}function flatten(array){return(null==array?0:array.length)?baseFlatten(array,1):[]}function head(array){return array&&array.length?array[0]:undefined}var intersection=baseRest((function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]})),intersectionBy=baseRest((function(arrays){var iteratee=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);return iteratee===last(mapped)?iteratee=undefined:mapped.pop(),mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,getIteratee(iteratee,2)):[]})),intersectionWith=baseRest((function(arrays){var comparator=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);return(comparator="function"==typeof comparator?comparator:undefined)&&mapped.pop(),mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,undefined,comparator):[]}));function last(array){var length=null==array?0:array.length;return length?array[length-1]:undefined}var pull=baseRest(pullAll);function pullAll(array,values){return array&&array.length&&values&&values.length?basePullAll(array,values):array}var pullAt=flatRest((function(array,indexes){var length=null==array?0:array.length,result=baseAt(array,indexes);return basePullAt(array,arrayMap(indexes,(function(index){return isIndex(index,length)?+index:index})).sort(compareAscending)),result}));function reverse(array){return null==array?array:nativeReverse.call(array)}var union=baseRest((function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))})),unionBy=baseRest((function(arrays){var iteratee=last(arrays);return isArrayLikeObject(iteratee)&&(iteratee=undefined),baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0),getIteratee(iteratee,2))})),unionWith=baseRest((function(arrays){var comparator=last(arrays);return comparator="function"==typeof comparator?comparator:undefined,baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0),undefined,comparator)}));function unzip(array){if(!array||!array.length)return[];var length=0;return array=arrayFilter(array,(function(group){if(isArrayLikeObject(group))return length=nativeMax(group.length,length),!0})),baseTimes(length,(function(index){return arrayMap(array,baseProperty(index))}))}function unzipWith(array,iteratee){if(!array||!array.length)return[];var result=unzip(array);return null==iteratee?result:arrayMap(result,(function(group){return apply(iteratee,undefined,group)}))}var without=baseRest((function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[]})),xor=baseRest((function(arrays){return baseXor(arrayFilter(arrays,isArrayLikeObject))})),xorBy=baseRest((function(arrays){var iteratee=last(arrays);return isArrayLikeObject(iteratee)&&(iteratee=undefined),baseXor(arrayFilter(arrays,isArrayLikeObject),getIteratee(iteratee,2))})),xorWith=baseRest((function(arrays){var comparator=last(arrays);return comparator="function"==typeof comparator?comparator:undefined,baseXor(arrayFilter(arrays,isArrayLikeObject),undefined,comparator)})),zip=baseRest(unzip);var zipWith=baseRest((function(arrays){var length=arrays.length,iteratee=length>1?arrays[length-1]:undefined;return iteratee="function"==typeof iteratee?(arrays.pop(),iteratee):undefined,unzipWith(arrays,iteratee)}));function chain(value){var result=lodash(value);return result.__chain__=!0,result}function thru(value,interceptor){return interceptor(value)}var wrapperAt=flatRest((function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths)};return!(length>1||this.__actions__.length)&&value instanceof LazyWrapper&&isIndex(start)?((value=value.slice(start,+start+(length?1:0))).__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(value,this.__chain__).thru((function(array){return length&&!array.length&&array.push(undefined),array}))):this.thru(interceptor)}));var countBy=createAggregator((function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:baseAssignValue(result,key,1)}));var find=createFind(findIndex),findLast=createFind(findLastIndex);function forEach(collection,iteratee){return(isArray(collection)?arrayEach:baseEach)(collection,getIteratee(iteratee,3))}function forEachRight(collection,iteratee){return(isArray(collection)?arrayEachRight:baseEachRight)(collection,getIteratee(iteratee,3))}var groupBy=createAggregator((function(result,value,key){hasOwnProperty.call(result,key)?result[key].push(value):baseAssignValue(result,key,[value])}));var invokeMap=baseRest((function(collection,path,args){var index=-1,isFunc="function"==typeof path,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,(function(value){result[++index]=isFunc?apply(path,value,args):baseInvoke(value,path,args)})),result})),keyBy=createAggregator((function(result,value,key){baseAssignValue(result,key,value)}));function map(collection,iteratee){return(isArray(collection)?arrayMap:baseMap)(collection,getIteratee(iteratee,3))}var partition=createAggregator((function(result,value,key){result[key?0:1].push(value)}),(function(){return[[],[]]}));var sortBy=baseRest((function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])})),now=ctxNow||function(){return root.Date.now()};function ary(func,n,guard){return n=guard?undefined:n,createWrap(func,128,undefined,undefined,undefined,undefined,n=func&&null==n?func.length:n)}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),n<=1&&(func=undefined),result}}var bind=baseRest((function(func,thisArg,partials){var bitmask=1;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=32}return createWrap(func,bitmask,thisArg,partials,holders)})),bindKey=baseRest((function(object,key,partials){var bitmask=3;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=32}return createWrap(key,bitmask,object,partials,holders)}));function debounce(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=undefined,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime;return undefined===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&time-lastInvokeTime>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,function(time){var timeWaiting=wait-(time-lastCallTime);return maxing?nativeMin(timeWaiting,maxWait-(time-lastInvokeTime)):timeWaiting}(time))}function trailingEdge(time){return timerId=undefined,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=undefined,result)}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(undefined===timerId)return leadingEdge(lastCallTime);if(maxing)return clearTimeout(timerId),timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return undefined===timerId&&(timerId=setTimeout(timerExpired,wait)),result}return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxWait=(maxing="maxWait"in options)?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=function(){undefined!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=undefined},debounced.flush=function(){return undefined===timerId?result:trailingEdge(now())},debounced}var defer=baseRest((function(func,args){return baseDelay(func,1,args)})),delay=baseRest((function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args)}));function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}memoize.Cache=MapCache;var overArgs=castRest((function(func,transforms){var funcsLength=(transforms=1==transforms.length&&isArray(transforms[0])?arrayMap(transforms[0],baseUnary(getIteratee())):arrayMap(baseFlatten(transforms,1),baseUnary(getIteratee()))).length;return baseRest((function(args){for(var index=-1,length=nativeMin(args.length,funcsLength);++index<length;)args[index]=transforms[index].call(this,args[index]);return apply(func,this,args)}))})),partial=baseRest((function(func,partials){return createWrap(func,32,undefined,partials,replaceHolders(partials,getHolder(partial)))})),partialRight=baseRest((function(func,partials){return createWrap(func,64,undefined,partials,replaceHolders(partials,getHolder(partialRight)))})),rearg=flatRest((function(func,indexes){return createWrap(func,256,undefined,undefined,undefined,indexes)}));function eq(value,other){return value===other||value!=value&&other!=other}var gt=createRelationalOperation(baseGt),gte=createRelationalOperation((function(value,other){return value>=other})),isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isArrayBuffer=nodeIsArrayBuffer?baseUnary(nodeIsArrayBuffer):function(value){return isObjectLike(value)&&baseGetTag(value)==arrayBufferTag};function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}var isBuffer=nativeIsBuffer||stubFalse,isDate=nodeIsDate?baseUnary(nodeIsDate):function(value){return isObjectLike(value)&&baseGetTag(value)==dateTag};function isError(value){if(!isObjectLike(value))return!1;var tag=baseGetTag(value);return tag==errorTag||"[object DOMException]"==tag||"string"==typeof value.message&&"string"==typeof value.name&&!isPlainObject(value)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||"[object AsyncFunction]"==tag||"[object Proxy]"==tag}function isInteger(value){return"number"==typeof value&&value==toInteger(value)}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=9007199254740991}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}var isMap=nodeIsMap?baseUnary(nodeIsMap):function(value){return isObjectLike(value)&&getTag(value)==mapTag};function isNumber(value){return"number"==typeof value||isObjectLike(value)&&baseGetTag(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}var isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):function(value){return isObjectLike(value)&&baseGetTag(value)==regexpTag};var isSet=nodeIsSet?baseUnary(nodeIsSet):function(value){return isObjectLike(value)&&getTag(value)==setTag};function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):function(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]};var lt=createRelationalOperation(baseLt),lte=createRelationalOperation((function(value,other){return value<=other}));function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(symIterator&&value[symIterator])return function(iterator){for(var data,result=[];!(data=iterator.next()).done;)result.push(data.value);return result}(value[symIterator]());var tag=getTag(value);return(tag==mapTag?mapToArray:tag==setTag?setToArray:values)(value)}function toFinite(value){return value?Infinity===(value=toNumber(value))||-Infinity===value?17976931348623157e292*(value<0?-1:1):value==value?value:0:0===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result==result?remainder?result-remainder:result:0}function toLength(value){return value?baseClamp(toInteger(value),0,4294967295):0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NaN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=baseTrim(value);var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NaN:+value}function toPlainObject(value){return copyObject(value,keysIn(value))}function toString(value){return null==value?"":baseToString(value)}var assign=createAssigner((function(object,source){if(isPrototype(source)||isArrayLike(source))copyObject(source,keys(source),object);else for(var key in source)hasOwnProperty.call(source,key)&&assignValue(object,key,source[key])})),assignIn=createAssigner((function(object,source){copyObject(source,keysIn(source),object)})),assignInWith=createAssigner((function(object,source,srcIndex,customizer){copyObject(source,keysIn(source),object,customizer)})),assignWith=createAssigner((function(object,source,srcIndex,customizer){copyObject(source,keys(source),object,customizer)})),at=flatRest(baseAt);var defaults=baseRest((function(object,sources){object=Object(object);var index=-1,length=sources.length,guard=length>2?sources[2]:undefined;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index<length;)for(var source=sources[index],props=keysIn(source),propsIndex=-1,propsLength=props.length;++propsIndex<propsLength;){var key=props[propsIndex],value=object[key];(undefined===value||eq(value,objectProto[key])&&!hasOwnProperty.call(object,key))&&(object[key]=source[key])}return object})),defaultsDeep=baseRest((function(args){return args.push(undefined,customDefaultsMerge),apply(mergeWith,undefined,args)}));function get(object,path,defaultValue){var result=null==object?undefined:baseGet(object,path);return undefined===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}var invert=createInverter((function(result,value,key){null!=value&&"function"!=typeof value.toString&&(value=nativeObjectToString.call(value)),result[value]=key}),constant(identity)),invertBy=createInverter((function(result,value,key){null!=value&&"function"!=typeof value.toString&&(value=nativeObjectToString.call(value)),hasOwnProperty.call(result,value)?result[value].push(key):result[value]=[key]}),getIteratee),invoke=baseRest(baseInvoke);function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}var merge=createAssigner((function(object,source,srcIndex){baseMerge(object,source,srcIndex)})),mergeWith=createAssigner((function(object,source,srcIndex,customizer){baseMerge(object,source,srcIndex,customizer)})),omit=flatRest((function(object,paths){var result={};if(null==object)return result;var isDeep=!1;paths=arrayMap(paths,(function(path){return path=castPath(path,object),isDeep||(isDeep=path.length>1),path})),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,7,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result}));var pick=flatRest((function(object,paths){return null==object?{}:function(object,paths){return basePickBy(object,paths,(function(value,path){return hasIn(object,path)}))}(object,paths)}));function pickBy(object,predicate){if(null==object)return{};var props=arrayMap(getAllKeysIn(object),(function(prop){return[prop]}));return predicate=getIteratee(predicate),basePickBy(object,props,(function(value,path){return predicate(value,path[0])}))}var toPairs=createToPairs(keys),toPairsIn=createToPairs(keysIn);function values(object){return null==object?[]:baseValues(object,keys(object))}var camelCase=createCompounder((function(result,word,index){return word=word.toLowerCase(),result+(index?capitalize(word):word)}));function capitalize(string){return upperFirst(toString(string).toLowerCase())}function deburr(string){return(string=toString(string))&&string.replace(reLatin,deburrLetter).replace(reComboMark,"")}var kebabCase=createCompounder((function(result,word,index){return result+(index?"-":"")+word.toLowerCase()})),lowerCase=createCompounder((function(result,word,index){return result+(index?" ":"")+word.toLowerCase()})),lowerFirst=createCaseFirst("toLowerCase");var snakeCase=createCompounder((function(result,word,index){return result+(index?"_":"")+word.toLowerCase()}));var startCase=createCompounder((function(result,word,index){return result+(index?" ":"")+upperFirst(word)}));var upperCase=createCompounder((function(result,word,index){return result+(index?" ":"")+word.toUpperCase()})),upperFirst=createCaseFirst("toUpperCase");function words(string,pattern,guard){return string=toString(string),undefined===(pattern=guard?undefined:pattern)?function(string){return reHasUnicodeWord.test(string)}(string)?function(string){return string.match(reUnicodeWord)||[]}(string):function(string){return string.match(reAsciiWord)||[]}(string):string.match(pattern)||[]}var attempt=baseRest((function(func,args){try{return apply(func,undefined,args)}catch(e){return isError(e)?e:new Error(e)}})),bindAll=flatRest((function(object,methodNames){return arrayEach(methodNames,(function(key){key=toKey(key),baseAssignValue(object,key,bind(object[key],object))})),object}));function constant(value){return function(){return value}}var flow=createFlow(),flowRight=createFlow(!0);function identity(value){return value}function iteratee(func){return baseIteratee("function"==typeof func?func:baseClone(func,1))}var method=baseRest((function(path,args){return function(object){return baseInvoke(object,path,args)}})),methodOf=baseRest((function(object,args){return function(path){return baseInvoke(object,path,args)}}));function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);null!=options||isObject(source)&&(methodNames.length||!props.length)||(options=source,source=object,object=this,methodNames=baseFunctions(source,keys(source)));var chain=!(isObject(options)&&"chain"in options&&!options.chain),isFunc=isFunction(object);return arrayEach(methodNames,(function(methodName){var func=source[methodName];object[methodName]=func,isFunc&&(object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);return actions.push({func:func,args:arguments,thisArg:object}),result.__chain__=chainAll,result}return func.apply(object,arrayPush([this.value()],arguments))})})),object}function noop(){}var over=createOver(arrayMap),overEvery=createOver(arrayEvery),overSome=createOver(arraySome);function property(path){return isKey(path)?baseProperty(toKey(path)):function(path){return function(object){return baseGet(object,path)}}(path)}var range=createRange(),rangeRight=createRange(!0);function stubArray(){return[]}function stubFalse(){return!1}var add=createMathOperation((function(augend,addend){return augend+addend}),0),ceil=createRound("ceil"),divide=createMathOperation((function(dividend,divisor){return dividend/divisor}),1),floor=createRound("floor");var source,multiply=createMathOperation((function(multiplier,multiplicand){return multiplier*multiplicand}),1),round=createRound("round"),subtract=createMathOperation((function(minuend,subtrahend){return minuend-subtrahend}),0);return lodash.after=function(n,func){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){if(--n<1)return func.apply(this,arguments)}},lodash.ary=ary,lodash.assign=assign,lodash.assignIn=assignIn,lodash.assignInWith=assignInWith,lodash.assignWith=assignWith,lodash.at=at,lodash.before=before,lodash.bind=bind,lodash.bindAll=bindAll,lodash.bindKey=bindKey,lodash.castArray=function(){if(!arguments.length)return[];var value=arguments[0];return isArray(value)?value:[value]},lodash.chain=chain,lodash.chunk=function(array,size,guard){size=(guard?isIterateeCall(array,size,guard):undefined===size)?1:nativeMax(toInteger(size),0);var length=null==array?0:array.length;if(!length||size<1)return[];for(var index=0,resIndex=0,result=Array(nativeCeil(length/size));index<length;)result[resIndex++]=baseSlice(array,index,index+=size);return result},lodash.compact=function(array){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];value&&(result[resIndex++]=value)}return result},lodash.concat=function(){var length=arguments.length;if(!length)return[];for(var args=Array(length-1),array=arguments[0],index=length;index--;)args[index-1]=arguments[index];return arrayPush(isArray(array)?copyArray(array):[array],baseFlatten(args,1))},lodash.cond=function(pairs){var length=null==pairs?0:pairs.length,toIteratee=getIteratee();return pairs=length?arrayMap(pairs,(function(pair){if("function"!=typeof pair[1])throw new TypeError(FUNC_ERROR_TEXT);return[toIteratee(pair[0]),pair[1]]})):[],baseRest((function(args){for(var index=-1;++index<length;){var pair=pairs[index];if(apply(pair[0],this,args))return apply(pair[1],this,args)}}))},lodash.conforms=function(source){return function(source){var props=keys(source);return function(object){return baseConformsTo(object,source,props)}}(baseClone(source,1))},lodash.constant=constant,lodash.countBy=countBy,lodash.create=function(prototype,properties){var result=baseCreate(prototype);return null==properties?result:baseAssign(result,properties)},lodash.curry=function curry(func,arity,guard){var result=createWrap(func,8,undefined,undefined,undefined,undefined,undefined,arity=guard?undefined:arity);return result.placeholder=curry.placeholder,result},lodash.curryRight=function curryRight(func,arity,guard){var result=createWrap(func,16,undefined,undefined,undefined,undefined,undefined,arity=guard?undefined:arity);return result.placeholder=curryRight.placeholder,result},lodash.debounce=debounce,lodash.defaults=defaults,lodash.defaultsDeep=defaultsDeep,lodash.defer=defer,lodash.delay=delay,lodash.difference=difference,lodash.differenceBy=differenceBy,lodash.differenceWith=differenceWith,lodash.drop=function(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,(n=guard||undefined===n?1:toInteger(n))<0?0:n,length):[]},lodash.dropRight=function(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,0,(n=length-(n=guard||undefined===n?1:toInteger(n)))<0?0:n):[]},lodash.dropRightWhile=function(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!0,!0):[]},lodash.dropWhile=function(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!0):[]},lodash.fill=function(array,value,start,end){var length=null==array?0:array.length;return length?(start&&"number"!=typeof start&&isIterateeCall(array,value,start)&&(start=0,end=length),function(array,value,start,end){var length=array.length;for((start=toInteger(start))<0&&(start=-start>length?0:length+start),(end=void 0===end||end>length?length:toInteger(end))<0&&(end+=length),end=start>end?0:toLength(end);start<end;)array[start++]=value;return array}(array,value,start,end)):[]},lodash.filter=function(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,getIteratee(predicate,3))},lodash.flatMap=function(collection,iteratee){return baseFlatten(map(collection,iteratee),1)},lodash.flatMapDeep=function(collection,iteratee){return baseFlatten(map(collection,iteratee),Infinity)},lodash.flatMapDepth=function(collection,iteratee,depth){return depth=undefined===depth?1:toInteger(depth),baseFlatten(map(collection,iteratee),depth)},lodash.flatten=flatten,lodash.flattenDeep=function(array){return(null==array?0:array.length)?baseFlatten(array,Infinity):[]},lodash.flattenDepth=function(array,depth){return(null==array?0:array.length)?baseFlatten(array,depth=undefined===depth?1:toInteger(depth)):[]},lodash.flip=function(func){return createWrap(func,512)},lodash.flow=flow,lodash.flowRight=flowRight,lodash.fromPairs=function(pairs){for(var index=-1,length=null==pairs?0:pairs.length,result={};++index<length;){var pair=pairs[index];result[pair[0]]=pair[1]}return result},lodash.functions=function(object){return null==object?[]:baseFunctions(object,keys(object))},lodash.functionsIn=function(object){return null==object?[]:baseFunctions(object,keysIn(object))},lodash.groupBy=groupBy,lodash.initial=function(array){return(null==array?0:array.length)?baseSlice(array,0,-1):[]},lodash.intersection=intersection,lodash.intersectionBy=intersectionBy,lodash.intersectionWith=intersectionWith,lodash.invert=invert,lodash.invertBy=invertBy,lodash.invokeMap=invokeMap,lodash.iteratee=iteratee,lodash.keyBy=keyBy,lodash.keys=keys,lodash.keysIn=keysIn,lodash.map=map,lodash.mapKeys=function(object,iteratee){var result={};return iteratee=getIteratee(iteratee,3),baseForOwn(object,(function(value,key,object){baseAssignValue(result,iteratee(value,key,object),value)})),result},lodash.mapValues=function(object,iteratee){var result={};return iteratee=getIteratee(iteratee,3),baseForOwn(object,(function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object))})),result},lodash.matches=function(source){return baseMatches(baseClone(source,1))},lodash.matchesProperty=function(path,srcValue){return baseMatchesProperty(path,baseClone(srcValue,1))},lodash.memoize=memoize,lodash.merge=merge,lodash.mergeWith=mergeWith,lodash.method=method,lodash.methodOf=methodOf,lodash.mixin=mixin,lodash.negate=negate,lodash.nthArg=function(n){return n=toInteger(n),baseRest((function(args){return baseNth(args,n)}))},lodash.omit=omit,lodash.omitBy=function(object,predicate){return pickBy(object,negate(getIteratee(predicate)))},lodash.once=function(func){return before(2,func)},lodash.orderBy=function(collection,iteratees,orders,guard){return null==collection?[]:(isArray(iteratees)||(iteratees=null==iteratees?[]:[iteratees]),isArray(orders=guard?undefined:orders)||(orders=null==orders?[]:[orders]),baseOrderBy(collection,iteratees,orders))},lodash.over=over,lodash.overArgs=overArgs,lodash.overEvery=overEvery,lodash.overSome=overSome,lodash.partial=partial,lodash.partialRight=partialRight,lodash.partition=partition,lodash.pick=pick,lodash.pickBy=pickBy,lodash.property=property,lodash.propertyOf=function(object){return function(path){return null==object?undefined:baseGet(object,path)}},lodash.pull=pull,lodash.pullAll=pullAll,lodash.pullAllBy=function(array,values,iteratee){return array&&array.length&&values&&values.length?basePullAll(array,values,getIteratee(iteratee,2)):array},lodash.pullAllWith=function(array,values,comparator){return array&&array.length&&values&&values.length?basePullAll(array,values,undefined,comparator):array},lodash.pullAt=pullAt,lodash.range=range,lodash.rangeRight=rangeRight,lodash.rearg=rearg,lodash.reject=function(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,negate(getIteratee(predicate,3)))},lodash.remove=function(array,predicate){var result=[];if(!array||!array.length)return result;var index=-1,indexes=[],length=array.length;for(predicate=getIteratee(predicate,3);++index<length;){var value=array[index];predicate(value,index,array)&&(result.push(value),indexes.push(index))}return basePullAt(array,indexes),result},lodash.rest=function(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return baseRest(func,start=undefined===start?start:toInteger(start))},lodash.reverse=reverse,lodash.sampleSize=function(collection,n,guard){return n=(guard?isIterateeCall(collection,n,guard):undefined===n)?1:toInteger(n),(isArray(collection)?arraySampleSize:baseSampleSize)(collection,n)},lodash.set=function(object,path,value){return null==object?object:baseSet(object,path,value)},lodash.setWith=function(object,path,value,customizer){return customizer="function"==typeof customizer?customizer:undefined,null==object?object:baseSet(object,path,value,customizer)},lodash.shuffle=function(collection){return(isArray(collection)?arrayShuffle:baseShuffle)(collection)},lodash.slice=function(array,start,end){var length=null==array?0:array.length;return length?(end&&"number"!=typeof end&&isIterateeCall(array,start,end)?(start=0,end=length):(start=null==start?0:toInteger(start),end=undefined===end?length:toInteger(end)),baseSlice(array,start,end)):[]},lodash.sortBy=sortBy,lodash.sortedUniq=function(array){return array&&array.length?baseSortedUniq(array):[]},lodash.sortedUniqBy=function(array,iteratee){return array&&array.length?baseSortedUniq(array,getIteratee(iteratee,2)):[]},lodash.split=function(string,separator,limit){return limit&&"number"!=typeof limit&&isIterateeCall(string,separator,limit)&&(separator=limit=undefined),(limit=undefined===limit?4294967295:limit>>>0)?(string=toString(string))&&("string"==typeof separator||null!=separator&&!isRegExp(separator))&&!(separator=baseToString(separator))&&hasUnicode(string)?castSlice(stringToArray(string),0,limit):string.split(separator,limit):[]},lodash.spread=function(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=null==start?0:nativeMax(toInteger(start),0),baseRest((function(args){var array=args[start],otherArgs=castSlice(args,0,start);return array&&arrayPush(otherArgs,array),apply(func,this,otherArgs)}))},lodash.tail=function(array){var length=null==array?0:array.length;return length?baseSlice(array,1,length):[]},lodash.take=function(array,n,guard){return array&&array.length?baseSlice(array,0,(n=guard||undefined===n?1:toInteger(n))<0?0:n):[]},lodash.takeRight=function(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,(n=length-(n=guard||undefined===n?1:toInteger(n)))<0?0:n,length):[]},lodash.takeRightWhile=function(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!1,!0):[]},lodash.takeWhile=function(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3)):[]},lodash.tap=function(value,interceptor){return interceptor(value),value},lodash.throttle=function(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})},lodash.thru=thru,lodash.toArray=toArray,lodash.toPairs=toPairs,lodash.toPairsIn=toPairsIn,lodash.toPath=function(value){return isArray(value)?arrayMap(value,toKey):isSymbol(value)?[value]:copyArray(stringToPath(toString(value)))},lodash.toPlainObject=toPlainObject,lodash.transform=function(object,iteratee,accumulator){var isArr=isArray(object),isArrLike=isArr||isBuffer(object)||isTypedArray(object);if(iteratee=getIteratee(iteratee,4),null==accumulator){var Ctor=object&&object.constructor;accumulator=isArrLike?isArr?new Ctor:[]:isObject(object)&&isFunction(Ctor)?baseCreate(getPrototype(object)):{}}return(isArrLike?arrayEach:baseForOwn)(object,(function(value,index,object){return iteratee(accumulator,value,index,object)})),accumulator},lodash.unary=function(func){return ary(func,1)},lodash.union=union,lodash.unionBy=unionBy,lodash.unionWith=unionWith,lodash.uniq=function(array){return array&&array.length?baseUniq(array):[]},lodash.uniqBy=function(array,iteratee){return array&&array.length?baseUniq(array,getIteratee(iteratee,2)):[]},lodash.uniqWith=function(array,comparator){return comparator="function"==typeof comparator?comparator:undefined,array&&array.length?baseUniq(array,undefined,comparator):[]},lodash.unset=function(object,path){return null==object||baseUnset(object,path)},lodash.unzip=unzip,lodash.unzipWith=unzipWith,lodash.update=function(object,path,updater){return null==object?object:baseUpdate(object,path,castFunction(updater))},lodash.updateWith=function(object,path,updater,customizer){return customizer="function"==typeof customizer?customizer:undefined,null==object?object:baseUpdate(object,path,castFunction(updater),customizer)},lodash.values=values,lodash.valuesIn=function(object){return null==object?[]:baseValues(object,keysIn(object))},lodash.without=without,lodash.words=words,lodash.wrap=function(value,wrapper){return partial(castFunction(wrapper),value)},lodash.xor=xor,lodash.xorBy=xorBy,lodash.xorWith=xorWith,lodash.zip=zip,lodash.zipObject=function(props,values){return baseZipObject(props||[],values||[],assignValue)},lodash.zipObjectDeep=function(props,values){return baseZipObject(props||[],values||[],baseSet)},lodash.zipWith=zipWith,lodash.entries=toPairs,lodash.entriesIn=toPairsIn,lodash.extend=assignIn,lodash.extendWith=assignInWith,mixin(lodash,lodash),lodash.add=add,lodash.attempt=attempt,lodash.camelCase=camelCase,lodash.capitalize=capitalize,lodash.ceil=ceil,lodash.clamp=function(number,lower,upper){return undefined===upper&&(upper=lower,lower=undefined),undefined!==upper&&(upper=(upper=toNumber(upper))==upper?upper:0),undefined!==lower&&(lower=(lower=toNumber(lower))==lower?lower:0),baseClamp(toNumber(number),lower,upper)},lodash.clone=function(value){return baseClone(value,4)},lodash.cloneDeep=function(value){return baseClone(value,5)},lodash.cloneDeepWith=function(value,customizer){return baseClone(value,5,customizer="function"==typeof customizer?customizer:undefined)},lodash.cloneWith=function(value,customizer){return baseClone(value,4,customizer="function"==typeof customizer?customizer:undefined)},lodash.conformsTo=function(object,source){return null==source||baseConformsTo(object,source,keys(source))},lodash.deburr=deburr,lodash.defaultTo=function(value,defaultValue){return null==value||value!=value?defaultValue:value},lodash.divide=divide,lodash.endsWith=function(string,target,position){string=toString(string),target=baseToString(target);var length=string.length,end=position=undefined===position?length:baseClamp(toInteger(position),0,length);return(position-=target.length)>=0&&string.slice(position,end)==target},lodash.eq=eq,lodash.escape=function(string){return(string=toString(string))&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string},lodash.escapeRegExp=function(string){return(string=toString(string))&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,"\\$&"):string},lodash.every=function(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,getIteratee(predicate,3))},lodash.find=find,lodash.findIndex=findIndex,lodash.findKey=function(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwn)},lodash.findLast=findLast,lodash.findLastIndex=findLastIndex,lodash.findLastKey=function(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwnRight)},lodash.floor=floor,lodash.forEach=forEach,lodash.forEachRight=forEachRight,lodash.forIn=function(object,iteratee){return null==object?object:baseFor(object,getIteratee(iteratee,3),keysIn)},lodash.forInRight=function(object,iteratee){return null==object?object:baseForRight(object,getIteratee(iteratee,3),keysIn)},lodash.forOwn=function(object,iteratee){return object&&baseForOwn(object,getIteratee(iteratee,3))},lodash.forOwnRight=function(object,iteratee){return object&&baseForOwnRight(object,getIteratee(iteratee,3))},lodash.get=get,lodash.gt=gt,lodash.gte=gte,lodash.has=function(object,path){return null!=object&&hasPath(object,path,baseHas)},lodash.hasIn=hasIn,lodash.head=head,lodash.identity=identity,lodash.includes=function(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection),fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;return fromIndex<0&&(fromIndex=nativeMax(length+fromIndex,0)),isString(collection)?fromIndex<=length&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1},lodash.indexOf=function(array,value,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=null==fromIndex?0:toInteger(fromIndex);return index<0&&(index=nativeMax(length+index,0)),baseIndexOf(array,value,index)},lodash.inRange=function(number,start,end){return start=toFinite(start),undefined===end?(end=start,start=0):end=toFinite(end),function(number,start,end){return number>=nativeMin(start,end)&&number<nativeMax(start,end)}(number=toNumber(number),start,end)},lodash.invoke=invoke,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isArrayBuffer=isArrayBuffer,lodash.isArrayLike=isArrayLike,lodash.isArrayLikeObject=isArrayLikeObject,lodash.isBoolean=function(value){return!0===value||!1===value||isObjectLike(value)&&baseGetTag(value)==boolTag},lodash.isBuffer=isBuffer,lodash.isDate=isDate,lodash.isElement=function(value){return isObjectLike(value)&&1===value.nodeType&&!isPlainObject(value)},lodash.isEmpty=function(value){if(null==value)return!0;if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if(tag==mapTag||tag==setTag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0},lodash.isEqual=function(value,other){return baseIsEqual(value,other)},lodash.isEqualWith=function(value,other,customizer){var result=(customizer="function"==typeof customizer?customizer:undefined)?customizer(value,other):undefined;return undefined===result?baseIsEqual(value,other,undefined,customizer):!!result},lodash.isError=isError,lodash.isFinite=function(value){return"number"==typeof value&&nativeIsFinite(value)},lodash.isFunction=isFunction,lodash.isInteger=isInteger,lodash.isLength=isLength,lodash.isMap=isMap,lodash.isMatch=function(object,source){return object===source||baseIsMatch(object,source,getMatchData(source))},lodash.isMatchWith=function(object,source,customizer){return customizer="function"==typeof customizer?customizer:undefined,baseIsMatch(object,source,getMatchData(source),customizer)},lodash.isNaN=function(value){return isNumber(value)&&value!=+value},lodash.isNative=function(value){if(isMaskable(value))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return baseIsNative(value)},lodash.isNil=function(value){return null==value},lodash.isNull=function(value){return null===value},lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isObjectLike=isObjectLike,lodash.isPlainObject=isPlainObject,lodash.isRegExp=isRegExp,lodash.isSafeInteger=function(value){return isInteger(value)&&value>=-9007199254740991&&value<=9007199254740991},lodash.isSet=isSet,lodash.isString=isString,lodash.isSymbol=isSymbol,lodash.isTypedArray=isTypedArray,lodash.isUndefined=function(value){return undefined===value},lodash.isWeakMap=function(value){return isObjectLike(value)&&getTag(value)==weakMapTag},lodash.isWeakSet=function(value){return isObjectLike(value)&&"[object WeakSet]"==baseGetTag(value)},lodash.join=function(array,separator){return null==array?"":nativeJoin.call(array,separator)},lodash.kebabCase=kebabCase,lodash.last=last,lodash.lastIndexOf=function(array,value,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=length;return undefined!==fromIndex&&(index=(index=toInteger(fromIndex))<0?nativeMax(length+index,0):nativeMin(index,length-1)),value==value?function(array,value,fromIndex){for(var index=fromIndex+1;index--;)if(array[index]===value)return index;return index}(array,value,index):baseFindIndex(array,baseIsNaN,index,!0)},lodash.lowerCase=lowerCase,lodash.lowerFirst=lowerFirst,lodash.lt=lt,lodash.lte=lte,lodash.max=function(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined},lodash.maxBy=function(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseGt):undefined},lodash.mean=function(array){return baseMean(array,identity)},lodash.meanBy=function(array,iteratee){return baseMean(array,getIteratee(iteratee,2))},lodash.min=function(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined},lodash.minBy=function(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseLt):undefined},lodash.stubArray=stubArray,lodash.stubFalse=stubFalse,lodash.stubObject=function(){return{}},lodash.stubString=function(){return""},lodash.stubTrue=function(){return!0},lodash.multiply=multiply,lodash.nth=function(array,n){return array&&array.length?baseNth(array,toInteger(n)):undefined},lodash.noConflict=function(){return root._===this&&(root._=oldDash),this},lodash.noop=noop,lodash.now=now,lodash.pad=function(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;if(!length||strLength>=length)return string;var mid=(length-strLength)/2;return createPadding(nativeFloor(mid),chars)+string+createPadding(nativeCeil(mid),chars)},lodash.padEnd=function(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;return length&&strLength<length?string+createPadding(length-strLength,chars):string},lodash.padStart=function(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;return length&&strLength<length?createPadding(length-strLength,chars)+string:string},lodash.parseInt=function(string,radix,guard){return guard||null==radix?radix=0:radix&&(radix=+radix),nativeParseInt(toString(string).replace(reTrimStart,""),radix||0)},lodash.random=function(lower,upper,floating){if(floating&&"boolean"!=typeof floating&&isIterateeCall(lower,upper,floating)&&(upper=floating=undefined),undefined===floating&&("boolean"==typeof upper?(floating=upper,upper=undefined):"boolean"==typeof lower&&(floating=lower,lower=undefined)),undefined===lower&&undefined===upper?(lower=0,upper=1):(lower=toFinite(lower),undefined===upper?(upper=lower,lower=0):upper=toFinite(upper)),lower>upper){var temp=lower;lower=upper,upper=temp}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat("1e-"+((rand+"").length-1))),upper)}return baseRandom(lower,upper)},lodash.reduce=function(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEach)},lodash.reduceRight=function(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduceRight:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEachRight)},lodash.repeat=function(string,n,guard){return n=(guard?isIterateeCall(string,n,guard):undefined===n)?1:toInteger(n),baseRepeat(toString(string),n)},lodash.replace=function(){var args=arguments,string=toString(args[0]);return args.length<3?string:string.replace(args[1],args[2])},lodash.result=function(object,path,defaultValue){var index=-1,length=(path=castPath(path,object)).length;for(length||(length=1,object=undefined);++index<length;){var value=null==object?undefined:object[toKey(path[index])];undefined===value&&(index=length,value=defaultValue),object=isFunction(value)?value.call(object):value}return object},lodash.round=round,lodash.runInContext=runInContext,lodash.sample=function(collection){return(isArray(collection)?arraySample:baseSample)(collection)},lodash.size=function(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length},lodash.snakeCase=snakeCase,lodash.some=function(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,getIteratee(predicate,3))},lodash.sortedIndex=function(array,value){return baseSortedIndex(array,value)},lodash.sortedIndexBy=function(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2))},lodash.sortedIndexOf=function(array,value){var length=null==array?0:array.length;if(length){var index=baseSortedIndex(array,value);if(index<length&&eq(array[index],value))return index}return-1},lodash.sortedLastIndex=function(array,value){return baseSortedIndex(array,value,!0)},lodash.sortedLastIndexBy=function(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2),!0)},lodash.sortedLastIndexOf=function(array,value){if(null==array?0:array.length){var index=baseSortedIndex(array,value,!0)-1;if(eq(array[index],value))return index}return-1},lodash.startCase=startCase,lodash.startsWith=function(string,target,position){return string=toString(string),position=null==position?0:baseClamp(toInteger(position),0,string.length),target=baseToString(target),string.slice(position,position+target.length)==target},lodash.subtract=subtract,lodash.sum=function(array){return array&&array.length?baseSum(array,identity):0},lodash.sumBy=function(array,iteratee){return array&&array.length?baseSum(array,getIteratee(iteratee,2)):0},lodash.template=function(string,options,guard){var settings=lodash.templateSettings;guard&&isIterateeCall(string,options,guard)&&(options=undefined),string=toString(string),options=assignInWith({},options,settings,customDefaultsAssignIn);var isEscaping,isEvaluating,imports=assignInWith({},options.imports,settings.imports,customDefaultsAssignIn),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys),index=0,interpolate=options.interpolate||reNoMatch,source="__p += '",reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g"),sourceURL="//# sourceURL="+(hasOwnProperty.call(options,"sourceURL")?(options.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++templateCounter+"]")+"\n";string.replace(reDelimiters,(function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){return interpolateValue||(interpolateValue=esTemplateValue),source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar),escapeValue&&(isEscaping=!0,source+="' +\n__e("+escapeValue+") +\n'"),evaluateValue&&(isEvaluating=!0,source+="';\n"+evaluateValue+";\n__p += '"),interpolateValue&&(source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"),index=offset+match.length,match})),source+="';\n";var variable=hasOwnProperty.call(options,"variable")&&options.variable;if(variable){if(reForbiddenIdentifierChars.test(variable))throw new Error("Invalid `variable` option passed into `_.template`")}else source="with (obj) {\n"+source+"\n}\n";source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;"),source="function("+(variable||"obj")+") {\n"+(variable?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(isEscaping?", __e = _.escape":"")+(isEvaluating?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var result=attempt((function(){return Function(importsKeys,sourceURL+"return "+source).apply(undefined,importsValues)}));if(result.source=source,isError(result))throw result;return result},lodash.times=function(n,iteratee){if((n=toInteger(n))<1||n>9007199254740991)return[];var index=4294967295,length=nativeMin(n,4294967295);n-=4294967295;for(var result=baseTimes(length,iteratee=getIteratee(iteratee));++index<n;)iteratee(index);return result},lodash.toFinite=toFinite,lodash.toInteger=toInteger,lodash.toLength=toLength,lodash.toLower=function(value){return toString(value).toLowerCase()},lodash.toNumber=toNumber,lodash.toSafeInteger=function(value){return value?baseClamp(toInteger(value),-9007199254740991,9007199254740991):0===value?value:0},lodash.toString=toString,lodash.toUpper=function(value){return toString(value).toUpperCase()},lodash.trim=function(string,chars,guard){if((string=toString(string))&&(guard||undefined===chars))return baseTrim(string);if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars);return castSlice(strSymbols,charsStartIndex(strSymbols,chrSymbols),charsEndIndex(strSymbols,chrSymbols)+1).join("")},lodash.trimEnd=function(string,chars,guard){if((string=toString(string))&&(guard||undefined===chars))return string.slice(0,trimmedEndIndex(string)+1);if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string);return castSlice(strSymbols,0,charsEndIndex(strSymbols,stringToArray(chars))+1).join("")},lodash.trimStart=function(string,chars,guard){if((string=toString(string))&&(guard||undefined===chars))return string.replace(reTrimStart,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string);return castSlice(strSymbols,charsStartIndex(strSymbols,stringToArray(chars))).join("")},lodash.truncate=function(string,options){var length=30,omission="...";if(isObject(options)){var separator="separator"in options?options.separator:separator;length="length"in options?toInteger(options.length):length,omission="omission"in options?baseToString(options.omission):omission}var strLength=(string=toString(string)).length;if(hasUnicode(string)){var strSymbols=stringToArray(string);strLength=strSymbols.length}if(length>=strLength)return string;var end=length-stringSize(omission);if(end<1)return omission;var result=strSymbols?castSlice(strSymbols,0,end).join(""):string.slice(0,end);if(undefined===separator)return result+omission;if(strSymbols&&(end+=result.length-end),isRegExp(separator)){if(string.slice(end).search(separator)){var match,substring=result;for(separator.global||(separator=RegExp(separator.source,toString(reFlags.exec(separator))+"g")),separator.lastIndex=0;match=separator.exec(substring);)var newEnd=match.index;result=result.slice(0,undefined===newEnd?end:newEnd)}}else if(string.indexOf(baseToString(separator),end)!=end){var index=result.lastIndexOf(separator);index>-1&&(result=result.slice(0,index))}return result+omission},lodash.unescape=function(string){return(string=toString(string))&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string},lodash.uniqueId=function(prefix){var id=++idCounter;return toString(prefix)+id},lodash.upperCase=upperCase,lodash.upperFirst=upperFirst,lodash.each=forEach,lodash.eachRight=forEachRight,lodash.first=head,mixin(lodash,(source={},baseForOwn(lodash,(function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)})),source),{chain:!1}),lodash.VERSION="4.17.21",arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(methodName){lodash[methodName].placeholder=lodash})),arrayEach(["drop","take"],(function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=undefined===n?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__filtered__?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,4294967295),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}})),arrayEach(["filter","map","takeWhile"],(function(methodName,index){var type=index+1,isFilter=1==type||3==type;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}})),arrayEach(["head","last"],(function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}})),arrayEach(["initial","tail"],(function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}})),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest((function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map((function(value){return baseInvoke(value,path,args)}))})),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),undefined!==end&&(result=(end=toInteger(end))<0?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(4294967295)},baseForOwn(LazyWrapper.prototype,(function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})})),arrayEach(["pop","push","shift","sort","splice","unshift"],(function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args)}return this[chainName]((function(value){return func.apply(isArray(value)?value:[],args)}))}})),baseForOwn(LazyWrapper.prototype,(function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+"";hasOwnProperty.call(realNames,key)||(realNames[key]=[]),realNames[key].push({name:methodName,func:lodashFunc})}})),realNames[createHybrid(undefined,2).name]=[{name:"wrapper",func:undefined}],LazyWrapper.prototype.clone=function(){var result=new LazyWrapper(this.__wrapped__);return result.__actions__=copyArray(this.__actions__),result.__dir__=this.__dir__,result.__filtered__=this.__filtered__,result.__iteratees__=copyArray(this.__iteratees__),result.__takeCount__=this.__takeCount__,result.__views__=copyArray(this.__views__),result},LazyWrapper.prototype.reverse=function(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1,result.__filtered__=!0}else(result=this.clone()).__dir__*=-1;return result},LazyWrapper.prototype.value=function(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=dir<0,arrLength=isArr?array.length:0,view=function(start,end,transforms){var index=-1,length=transforms.length;for(;++index<length;){var data=transforms[index],size=data.size;switch(data.type){case"drop":start+=size;break;case"dropRight":end-=size;break;case"take":end=nativeMin(end,start+size);break;case"takeRight":start=nativeMax(start,end-size)}}return{start:start,end:end}}(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||!isRight&&arrLength==length&&takeCount==length)return baseWrapperValue(array,this.__actions__);var result=[];outer:for(;length--&&resIndex<takeCount;){for(var iterIndex=-1,value=array[index+=dir];++iterIndex<iterLength;){var data=iteratees[iterIndex],iteratee=data.iteratee,type=data.type,computed=iteratee(value);if(2==type)value=computed;else if(!computed){if(1==type)continue outer;break outer}}result[resIndex++]=value}return result},lodash.prototype.at=wrapperAt,lodash.prototype.chain=function(){return chain(this)},lodash.prototype.commit=function(){return new LodashWrapper(this.value(),this.__chain__)},lodash.prototype.next=function(){undefined===this.__values__&&(this.__values__=toArray(this.value()));var done=this.__index__>=this.__values__.length;return{done:done,value:done?undefined:this.__values__[this.__index__++]}},lodash.prototype.plant=function(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=undefined,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result},lodash.prototype.reverse=function(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),(wrapped=wrapped.reverse()).__actions__.push({func:thru,args:[reverse],thisArg:undefined}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)},lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=function(){return baseWrapperValue(this.__wrapped__,this.__actions__)},lodash.prototype.first=lodash.prototype.head,symIterator&&(lodash.prototype[symIterator]=function(){return this}),lodash}();freeModule?((freeModule.exports=_)._=_,freeExports._=_):root._=_}).call(commonjsGlobal)}));const landscapeMargins={top:1800,right:1440,bottom:1800,left:1440,header:720,footer:720,gutter:0},portraitMargins={top:1440,right:1800,bottom:1440,left:1800,header:720,footer:720,gutter:0},defaultDocumentOptions={orientation:"portrait",margins:lodash.cloneDeep(portraitMargins),title:"",subject:"",creator:"html-to-docx",keywords:["html-to-docx"],description:"",lastModifiedBy:"html-to-docx",revision:1,createdAt:new Date,modifiedAt:new Date,headerType:"default",header:!1,footerType:"default",footer:!1,font:"Times New Roman",fontSize:22,complexScriptFontSize:22,table:{row:{cantSplit:!1}},pageNumber:!1,skipFirstHeaderFooter:!1,lineNumber:!1,lineNumberOptions:{countBy:1,start:0,restart:"continuous"}},paragraphBordersObject={top:{size:0,spacing:3,color:"FFFFFF"},left:{size:0,spacing:3,color:"FFFFFF"},bottom:{size:0,spacing:3,color:"FFFFFF"},right:{size:0,spacing:3,color:"FFFFFF"}},colorlessColors=["transparent","auto"],verticalAlignValues=["top","middle","bottom"],documentRelsXML=`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n <Relationship Id="rId1" Type="${namespaces_numbering}" Target="numbering.xml"/>\n <Relationship Id="rId2" Type="${namespaces_styles}" Target="styles.xml"/>\n <Relationship Id="rId3" Type="${namespaces_settingsRelation}" Target="settings.xml"/>\n <Relationship Id="rId4" Type="${namespaces_webSettingsRelation}" Target="webSettings.xml"/>\n </Relationships>\n`,relsXML=`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n <Relationship Id="rId1" Type="${namespaces_officeDocumentRelation}" Target="word/document.xml"/>\n <Relationship Id="rId2" Type="${namespaces_corePropertiesRelation}" Target="docProps/core.xml"/>\n </Relationships>\n`,fontTableXML=`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <w:fonts\n xmlns:r="${namespaces_r}"\n xmlns:w="${namespaces_w}"\n >\n <w:font w:name="Calibri">\n <w:panose1 w:val="020F0502020204030204"/>\n <w:charset w:val="00"/>\n <w:family w:val="swiss"/>\n <w:pitch w:val="variable"/>\n <w:sig w:usb0="E4002EFF" w:usb1="C000247B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>\n </w:font>\n <w:font w:name="Times New Roman">\n <w:panose1 w:val="02020603050405020304"/>\n <w:charset w:val="00"/>\n <w:family w:val="roman"/>\n <w:pitch w:val="variable"/>\n <w:sig w:usb0="E0002EFF" w:usb1="C000785B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>\n </w:font>\n <w:font w:name="Calibri Light">\n <w:panose1 w:val="020F0302020204030204"/>\n <w:charset w:val="00"/>\n <w:family w:val="swiss"/>\n <w:pitch w:val="variable"/>\n <w:sig w:usb0="E4002EFF" w:usb1="C000247B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>\n </w:font>\n </w:fonts>\n`,settingsXML=`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <w:settings xmlns:w="${namespaces_w}" xmlns:o="${namespaces_o}" xmlns:r="${namespaces_r}" xmlns:v="${namespaces_v}" xmlns:w10="${namespaces_w10}" xmlns:sl="${namespaces_sl}">\n <w:zoom w:percent="100"/>\n <w:defaultTabStop w:val="720"/>\n <w:decimalSymbol w:val="."/>\n <w:listSeparator w:val=","/>\n </w:settings>\n`,webSettingsXML=`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <w:webSettings xmlns:w="${namespaces_w}" xmlns:r="${namespaces_r}">\n </w:webSettings>\n`;let pool,poolOffset,nanoid=(size=21)=>{var bytes;bytes=size-=0,!pool||pool.length<bytes?(pool=Buffer.allocUnsafe(128*bytes),crypto.randomFillSync(pool),poolOffset=0):poolOffset+bytes>pool.length&&(crypto.randomFillSync(pool),poolOffset=0),poolOffset+=bytes;let id="";for(let i=poolOffset-size;i<poolOffset;i++)id+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&pool[i]];return id};var isVtext=function(x){return x&&"VirtualText"===x.type&&"2"===x.version};var inherits_browser=createCommonjsModule((function(module){"function"==typeof Object.create?module.exports=function(ctor,superCtor){superCtor&&(ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}}})),inherits=createCommonjsModule((function(module){try{var util$1=util;if("function"!=typeof util$1.inherits)throw"";module.exports=util$1.inherits}catch(e){module.exports=inherits_browser}})),EventEmitter=events.EventEmitter,queue=Queue,_default=Queue;function Queue(options){if(!(this instanceof Queue))return new Queue(options);EventEmitter.call(this),options=options||{},this.concurrency=options.concurrency||1/0,this.timeout=options.timeout||0,this.autostart=options.autostart||!1,this.results=options.results||null,this.pending=0,this.session=0,this.running=!1,this.jobs=[],this.timers={}}inherits(Queue,EventEmitter);["pop","shift","indexOf","lastIndexOf"].forEach((function(method){Queue.prototype[method]=function(){return Array.prototype[method].apply(this.jobs,arguments)}})),Queue.prototype.slice=function(begin,end){return this.jobs=this.jobs.slice(begin,end),this},Queue.prototype.reverse=function(){return this.jobs.reverse(),this};function clearTimers(){for(var key in this.timers){var timeoutId=this.timers[key];delete this.timers[key],clearTimeout(timeoutId)}}function callOnErrorOrEnd(cb){var self=this;function onerror(err){self.end(err)}this.on("error",onerror),this.on("end",(function onend(err){self.removeListener("error",onerror),self.removeListener("end",onend),cb(err,this.results)}))}function done(err){this.session++,this.running=!1,this.emit("end",err)}["push","unshift","splice"].forEach((function(method){Queue.prototype[method]=function(){var methodResult=Array.prototype[method].apply(this.jobs,arguments);return this.autostart&&this.start(),methodResult}})),Object.defineProperty(Queue.prototype,"length",{get:function(){return this.pending+this.jobs.length}}),Queue.prototype.start=function(cb){if(cb&&callOnErrorOrEnd.call(this,cb),this.running=!0,!(this.pending>=this.concurrency))if(0!==this.jobs.length){var self=this,job=this.jobs.shift(),once=!0,session=this.session,timeoutId=null,didTimeout=!1,resultIndex=null,timeout=job.hasOwnProperty("timeout")?job.timeout:this.timeout;timeout&&(timeoutId=setTimeout((function(){didTimeout=!0,self.listeners("timeout").length>0?self.emit("timeout",next,job):next()}),timeout),this.timers[timeoutId]=timeoutId),this.results&&(resultIndex=this.results.length,this.results[resultIndex]=null),this.pending++,self.emit("start",job);var promise=job(next);promise&&promise.then&&"function"==typeof promise.then&&promise.then((function(result){return next(null,result)})).catch((function(err){return next(err||!0)})),this.running&&this.jobs.length>0&&this.start()}else 0===this.pending&&done.call(this);function next(err,result){once&&self.session===session&&(once=!1,self.pending--,null!==timeoutId&&(delete self.timers[timeoutId],clearTimeout(timeoutId)),err?self.emit("error",err,job):!1===didTimeout&&(null!==resultIndex&&(self.results[resultIndex]=Array.prototype.slice.call(arguments,1)),self.emit("success",result,job)),self.session===session&&(0===self.pending&&0===self.jobs.length?done.call(self):self.running&&self.start()))}},Queue.prototype.stop=function(){this.running=!1},Queue.prototype.end=function(err){clearTimers.call(this),this.jobs.length=0,this.pending=0,done.call(this,err)},queue.default=_default;var bmp=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.BMP=void 0,exports.BMP={validate:buffer=>"BM"===buffer.toString("ascii",0,2),calculate:buffer=>({height:Math.abs(buffer.readInt32LE(22)),width:buffer.readUInt32LE(18)})}}));unwrapExports(bmp),bmp.BMP;var ico=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.ICO=void 0;function getSizeFromOffset(buffer,offset){const value=buffer.readUInt8(offset);return 0===value?256:value}function getImageSize(buffer,imageIndex){const offset=6+16*imageIndex;return{height:getSizeFromOffset(buffer,offset+1),width:getSizeFromOffset(buffer,offset)}}exports.ICO={validate:buffer=>0===buffer.readUInt16LE(0)&&1===buffer.readUInt16LE(2),calculate(buffer){const nbImages=buffer.readUInt16LE(4),imageSize=getImageSize(buffer,0);if(1===nbImages)return imageSize;const imgs=[imageSize];for(let imageIndex=1;imageIndex<nbImages;imageIndex+=1)imgs.push(getImageSize(buffer,imageIndex));return{height:imageSize.height,images:imgs,width:imageSize.width}}}}));unwrapExports(ico),ico.ICO;var cur=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.CUR=void 0;exports.CUR={validate:buffer=>0===buffer.readUInt16LE(0)&&2===buffer.readUInt16LE(2),calculate:buffer=>ico.ICO.calculate(buffer)}}));unwrapExports(cur),cur.CUR;var dds=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.DDS=void 0,exports.DDS={validate:buffer=>542327876===buffer.readUInt32LE(0),calculate:buffer=>({height:buffer.readUInt32LE(12),width:buffer.readUInt32LE(16)})}}));unwrapExports(dds),dds.DDS;var gif=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.GIF=void 0;const gifRegexp=/^GIF8[79]a/;exports.GIF={validate(buffer){const signature=buffer.toString("ascii",0,6);return gifRegexp.test(signature)},calculate:buffer=>({height:buffer.readUInt16LE(8),width:buffer.readUInt16LE(6)})}}));unwrapExports(gif),gif.GIF;var icns=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.ICNS=void 0;const ICON_TYPE_SIZE={ICON:32,"ICN#":32,"icm#":16,icm4:16,icm8:16,"ics#":16,ics4:16,ics8:16,is32:16,s8mk:16,icp4:16,icl4:32,icl8:32,il32:32,l8mk:32,icp5:32,ic11:32,ich4:48,ich8:48,ih32:48,h8mk:48,icp6:64,ic12:32,it32:128,t8mk:128,ic07:128,ic08:256,ic13:256,ic09:512,ic14:512,ic10:1024};function readImageHeader(buffer,imageOffset){const imageLengthOffset=imageOffset+4;return[buffer.toString("ascii",imageOffset,imageLengthOffset),buffer.readUInt32BE(imageLengthOffset)]}function getImageSize(type){const size=ICON_TYPE_SIZE[type];return{width:size,height:size,type:type}}exports.ICNS={validate:buffer=>"icns"===buffer.toString("ascii",0,4),calculate(buffer){const bufferLength=buffer.length,fileLength=buffer.readUInt32BE(4);let imageOffset=8,imageHeader=readImageHeader(buffer,imageOffset),imageSize=getImageSize(imageHeader[0]);if(imageOffset+=imageHeader[1],imageOffset===fileLength)return imageSize;const result={height:imageSize.height,images:[imageSize],width:imageSize.width};for(;imageOffset<fileLength&&imageOffset<bufferLength;)imageHeader=readImageHeader(buffer,imageOffset),imageSize=getImageSize(imageHeader[0]),imageOffset+=imageHeader[1],result.images.push(imageSize);return result}}}));unwrapExports(icns),icns.ICNS;var j2c=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.J2C=void 0,exports.J2C={validate:buffer=>"ff4fff51"===buffer.toString("hex",0,4),calculate:buffer=>({height:buffer.readUInt32BE(12),width:buffer.readUInt32BE(8)})}}));unwrapExports(j2c),j2c.J2C;var jp2=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.JP2=void 0;const BoxTypes_ftyp="66747970",BoxTypes_jp2h="6a703268",BoxTypes_jp__="6a502020",BoxTypes_rreq="72726571",parseIHDR=box=>({height:box.readUInt32BE(4),width:box.readUInt32BE(8)});exports.JP2={validate(buffer){const signature=buffer.toString("hex",4,8),signatureLength=buffer.readUInt32BE(0);if(signature!==BoxTypes_jp__||signatureLength<1)return!1;const ftypeBoxStart=signatureLength+4,ftypBoxLength=buffer.readUInt32BE(signatureLength);return buffer.slice(ftypeBoxStart,ftypeBoxStart+ftypBoxLength).toString("hex",0,4)===BoxTypes_ftyp},calculate(buffer){const signatureLength=buffer.readUInt32BE(0);let offset=signatureLength+4+buffer.readUInt16BE(signatureLength+2);switch(buffer.toString("hex",offset,offset+4)){case BoxTypes_rreq:return offset=offset+4+4+(box=>{const unit=box.readUInt8(0);let offset=1+2*unit;return offset=offset+2+box.readUInt16BE(offset)*(2+unit),offset+2+box.readUInt16BE(offset)*(16+unit)})(buffer.slice(offset+4)),parseIHDR(buffer.slice(offset+8,offset+24));case BoxTypes_jp2h:return parseIHDR(buffer.slice(offset+8,offset+24));default:throw new TypeError("Unsupported header found: "+buffer.toString("ascii",offset,offset+4))}}}}));unwrapExports(jp2),jp2.JP2;var readUInt_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.readUInt=void 0,exports.readUInt=function(buffer,bits,offset,isBigEndian){return offset=offset||0,buffer["readUInt"+bits+(isBigEndian?"BE":"LE")].call(buffer,offset)}}));unwrapExports(readUInt_1),readUInt_1.readUInt;var jpg=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.JPG=void 0;function isEXIF(buffer){return"45786966"===buffer.toString("hex",2,6)}function extractSize(buffer,index){return{height:buffer.readUInt16BE(index),width:buffer.readUInt16BE(index+2)}}function validateExifBlock(buffer,index){const exifBlock=buffer.slice(2,index),byteAlign=exifBlock.toString("hex",6,8),isBigEndian="4d4d"===byteAlign;if(isBigEndian||"4949"===byteAlign)return function(exifBlock,isBigEndian){const idfDirectoryEntries=(0,readUInt_1.readUInt)(exifBlock,16,14,isBigEndian);for(let directoryEntryNumber=0;directoryEntryNumber<idfDirectoryEntries;directoryEntryNumber++){const start=16+12*directoryEntryNumber,end=start+12;if(start>exifBlock.length)return;const block=exifBlock.slice(start,end);if(274===(0,readUInt_1.readUInt)(block,16,0,isBigEndian)){if(3!==(0,readUInt_1.readUInt)(block,16,2,isBigEndian))return;if(1!==(0,readUInt_1.readUInt)(block,32,4,isBigEndian))return;return(0,readUInt_1.readUInt)(block,16,8,isBigEndian)}}}(exifBlock,isBigEndian)}function validateBuffer(buffer,index){if(index>buffer.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(255!==buffer[index])throw new TypeError("Invalid JPG, marker table corrupted")}exports.JPG={validate:buffer=>"ffd8"===buffer.toString("hex",0,2),calculate(buffer){let orientation,next;for(buffer=buffer.slice(4);buffer.length;){const i=buffer.readUInt16BE(0);if(isEXIF(buffer)&&(orientation=validateExifBlock(buffer,i)),validateBuffer(buffer,i),next=buffer[i+1],192===next||193===next||194===next){const size=extractSize(buffer,i+5);return orientation?{height:size.height,orientation:orientation,width:size.width}:size}buffer=buffer.slice(i+2)}throw new TypeError("Invalid JPG, no size found")}}}));unwrapExports(jpg),jpg.JPG;var ktx=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.KTX=void 0;exports.KTX={validate:buffer=>"KTX 11"===buffer.toString("ascii",1,7),calculate:buffer=>({height:buffer.readUInt32LE(40),width:buffer.readUInt32LE(36)})}}));unwrapExports(ktx),ktx.KTX;var png=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.PNG=void 0;exports.PNG={validate(buffer){if("PNG\r\n\n"===buffer.toString("ascii",1,8)){let chunkName=buffer.toString("ascii",12,16);if("CgBI"===chunkName&&(chunkName=buffer.toString("ascii",28,32)),"IHDR"!==chunkName)throw new TypeError("Invalid PNG");return!0}return!1},calculate:buffer=>"CgBI"===buffer.toString("ascii",12,16)?{height:buffer.readUInt32BE(36),width:buffer.readUInt32BE(32)}:{height:buffer.readUInt32BE(20),width:buffer.readUInt32BE(16)}}}));unwrapExports(png),png.PNG;var pnm=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.PNM=void 0;const PNMTypes={P1:"pbm/ascii",P2:"pgm/ascii",P3:"ppm/ascii",P4:"pbm",P5:"pgm",P6:"ppm",P7:"pam",PF:"pfm"},Signatures=Object.keys(PNMTypes),handlers={default:lines=>{let dimensions=[];for(;lines.length>0;){const line=lines.shift();if("#"!==line[0]){dimensions=line.split(" ");break}}if(2===dimensions.length)return{height:parseInt(dimensions[1],10),width:parseInt(dimensions[0],10)};throw new TypeError("Invalid PNM")},pam:lines=>{const size={};for(;lines.length>0;){const line=lines.shift();if(line.length>16||line.charCodeAt(0)>128)continue;const[key,value]=line.split(" ");if(key&&value&&(size[key.toLowerCase()]=parseInt(value,10)),size.height&&size.width)break}if(size.height&&size.width)return{height:size.height,width:size.width};throw new TypeError("Invalid PAM")}};exports.PNM={validate(buffer){const signature=buffer.toString("ascii",0,2);return Signatures.includes(signature)},calculate(buffer){const signature=buffer.toString("ascii",0,2),type=PNMTypes[signature],lines=buffer.toString("ascii",3).split(/[\r\n]+/);return(handlers[type]||handlers.default)(lines)}}}));unwrapExports(pnm),pnm.PNM;var psd=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.PSD=void 0,exports.PSD={validate:buffer=>"8BPS"===buffer.toString("ascii",0,4),calculate:buffer=>({height:buffer.readUInt32BE(14),width:buffer.readUInt32BE(18)})}}));unwrapExports(psd),psd.PSD;var svg=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.SVG=void 0;const svgReg=/<svg\s([^>"']|"[^"]*"|'[^']*')*>/,extractorRegExps={height:/\sheight=(['"])([^%]+?)\1/,root:svgReg,viewbox:/\sviewBox=(['"])(.+?)\1/i,width:/\swidth=(['"])([^%]+?)\1/},units={in:96,cm:96/2.54,em:16,ex:8,m:96/2.54*100,mm:96/2.54/10,pc:96/72/12,pt:96/72,px:1},unitsReg=new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`);function parseLength(len){const m=unitsReg.exec(len);if(m)return Math.round(Number(m[1])*(units[m[2]]||1))}function parseViewbox(viewbox){const bounds=viewbox.split(" ");return{height:parseLength(bounds[3]),width:parseLength(bounds[2])}}exports.SVG={validate(buffer){const str=String(buffer);return svgReg.test(str)},calculate(buffer){const root=buffer.toString("utf8").match(extractorRegExps.root);if(root){const attrs=function(root){const width=root.match(extractorRegExps.width),height=root.match(extractorRegExps.height),viewbox=root.match(extractorRegExps.viewbox);return{height:height&&parseLength(height[2]),viewbox:viewbox&&parseViewbox(viewbox[2]),width:width&&parseLength(width[2])}}(root[0]);if(attrs.width&&attrs.height)return function(attrs){return{height:attrs.height,width:attrs.width}}(attrs);if(attrs.viewbox)return function(attrs,viewbox){const ratio=viewbox.width/viewbox.height;return attrs.width?{height:Math.floor(attrs.width/ratio),width:attrs.width}:attrs.height?{height:attrs.height,width:Math.floor(attrs.height*ratio)}:{height:viewbox.height,width:viewbox.width}}(attrs,attrs.viewbox)}throw new TypeError("Invalid SVG")}}}));unwrapExports(svg),svg.SVG;var tiff=createCommonjsModule((function(module,exports){function readValue(buffer,isBigEndian){const low=(0,readUInt_1.readUInt)(buffer,16,8,isBigEndian);return((0,readUInt_1.readUInt)(buffer,16,10,isBigEndian)<<16)+low}function nextTag(buffer){if(buffer.length>24)return buffer.slice(12)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TIFF=void 0;const signatures=["49492a00","4d4d002a"];exports.TIFF={validate:buffer=>signatures.includes(buffer.toString("hex",0,4)),calculate(buffer,filepath){if(!filepath)throw new TypeError("Tiff doesn't support buffer");const isBigEndian="BE"===function(buffer){const signature=buffer.toString("ascii",0,2);return"II"===signature?"LE":"MM"===signature?"BE":void 0}(buffer),ifdBuffer=function(buffer,filepath,isBigEndian){const ifdOffset=(0,readUInt_1.readUInt)(buffer,32,4,isBigEndian);let bufferSize=1024;const fileSize=fs.statSync(filepath).size;ifdOffset+bufferSize>fileSize&&(bufferSize=fileSize-ifdOffset-10);const endBuffer=Buffer.alloc(bufferSize),descriptor=fs.openSync(filepath,"r");return fs.readSync(descriptor,endBuffer,0,bufferSize,ifdOffset),fs.closeSync(descriptor),endBuffer.slice(2)}(buffer,filepath,isBigEndian),tags=function(buffer,isBigEndian){const tags={};let temp=buffer;for(;temp&&temp.length;){const code=(0,readUInt_1.readUInt)(temp,16,0,isBigEndian),type=(0,readUInt_1.readUInt)(temp,16,2,isBigEndian),length=(0,readUInt_1.readUInt)(temp,32,4,isBigEndian);if(0===code)break;1!==length||3!==type&&4!==type||(tags[code]=readValue(temp,isBigEndian)),temp=nextTag(temp)}return tags}(ifdBuffer,isBigEndian),width=tags[256],height=tags[257];if(!width||!height)throw new TypeError("Invalid Tiff. Missing tags");return{height:height,width:width}}}}));unwrapExports(tiff),tiff.TIFF;var webp=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.WEBP=void 0,exports.WEBP={validate(buffer){const riffHeader="RIFF"===buffer.toString("ascii",0,4),webpHeader="WEBP"===buffer.toString("ascii",8,12),vp8Header="VP8"===buffer.toString("ascii",12,15);return riffHeader&&webpHeader&&vp8Header},calculate(buffer){const chunkHeader=buffer.toString("ascii",12,16);if(buffer=buffer.slice(20,30),"VP8X"===chunkHeader){const extendedHeader=buffer[0],validEnd=0==(1&extendedHeader);if(0==(192&extendedHeader)&&validEnd)return function(buffer){return{height:1+buffer.readUIntLE(7,3),width:1+buffer.readUIntLE(4,3)}}(buffer);throw new TypeError("Invalid WebP")}if("VP8 "===chunkHeader&&47!==buffer[0])return function(buffer){return{height:16383&buffer.readInt16LE(8),width:16383&buffer.readInt16LE(6)}}(buffer);const signature=buffer.toString("hex",3,6);if("VP8L"===chunkHeader&&"9d012a"!==signature)return function(buffer){return{height:1+((15&buffer[4])<<10|buffer[3]<<2|(192&buffer[2])>>6),width:1+((63&buffer[2])<<8|buffer[1])}}(buffer);throw new TypeError("Invalid WebP")}}}));unwrapExports(webp),webp.WEBP;var types=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeHandlers=void 0,exports.typeHandlers={bmp:bmp.BMP,cur:cur.CUR,dds:dds.DDS,gif:gif.GIF,icns:icns.ICNS,ico:ico.ICO,j2c:j2c.J2C,jp2:jp2.JP2,jpg:jpg.JPG,ktx:ktx.KTX,png:png.PNG,pnm:pnm.PNM,psd:psd.PSD,svg:svg.SVG,tiff:tiff.TIFF,webp:webp.WEBP}}));unwrapExports(types),types.typeHandlers;var detector_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.detector=void 0;const keys=Object.keys(types.typeHandlers),firstBytes={56:"psd",66:"bmp",68:"dds",71:"gif",73:"tiff",77:"tiff",82:"webp",105:"icns",137:"png",255:"jpg"};exports.detector=function(buffer){const byte=buffer[0];if(byte in firstBytes){const type=firstBytes[byte];if(type&&types.typeHandlers[type].validate(buffer))return type}return keys.find((key=>types.typeHandlers[key].validate(buffer)))}}));unwrapExports(detector_1),detector_1.detector;var dist=createCommonjsModule((function(module,exports){var __awaiter=commonjsGlobal&&commonjsGlobal.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.types=exports.setConcurrency=exports.disableTypes=exports.disableFS=exports.imageSize=void 0;const queue$1=new queue.default({concurrency:100,autostart:!0}),globalOptions={disabledFS:!1,disabledTypes:[]};function lookup(buffer,filepath){const type=(0,detector_1.detector)(buffer);if(void 0!==type){if(globalOptions.disabledTypes.indexOf(type)>-1)throw new TypeError("disabled file type: "+type);if(type in types.typeHandlers){const size=types.typeHandlers[type].calculate(buffer,filepath);if(void 0!==size)return size.type=type,size}}throw new TypeError("unsupported file type: "+type+" (file: "+filepath+")")}function imageSize(input,callback){if(Buffer.isBuffer(input))return lookup(input);if("string"!=typeof input||globalOptions.disabledFS)throw new TypeError("invalid invocation. input should be a Buffer");const filepath=path.resolve(input);if("function"!=typeof callback){const buffer=function(filepath){const descriptor=fs.openSync(filepath,"r");try{const{size:size}=fs.fstatSync(descriptor);if(size<=0)throw new Error("Empty file");const bufferSize=Math.min(size,524288),buffer=Buffer.alloc(bufferSize);return fs.readSync(descriptor,buffer,0,bufferSize,0),buffer}finally{fs.closeSync(descriptor)}}(filepath);return lookup(buffer,filepath)}queue$1.push((()=>function(filepath){return __awaiter(this,void 0,void 0,(function*(){const handle=yield fs.promises.open(filepath,"r");try{const{size:size}=yield handle.stat();if(size<=0)throw new Error("Empty file");const bufferSize=Math.min(size,524288),buffer=Buffer.alloc(bufferSize);return yield handle.read(buffer,0,bufferSize,0),buffer}finally{yield handle.close()}}))}(filepath).then((buffer=>process.nextTick(callback,null,lookup(buffer,filepath)))).catch(callback)))}module.exports=exports=imageSize,exports.default=imageSize,exports.imageSize=imageSize;exports.disableFS=v=>{globalOptions.disabledFS=v};exports.disableTypes=types=>{globalOptions.disabledTypes=types};exports.setConcurrency=c=>{queue$1.concurrency=c},exports.types=Object.keys(types.typeHandlers)})),sizeOf=unwrapExports(dist);dist.types,dist.setConcurrency,dist.disableTypes,dist.disableFS,dist.imageSize;const rgbRegex=/rgb\((\d+),\s*([\d.]+),\s*([\d.]+)\)/i,hslRegex=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/i,hexRegex=/#([0-9A-F]{6})/i,hex3Regex=/#([0-9A-F])([0-9A-F])([0-9A-F])/i,rgbToHex=(red,green,blue)=>[red,green,blue].map((x=>1===(x=parseInt(x).toString(16)).length?`0${x}`:x)).join(""),pixelRegex=/([\d.]+)px/i,percentageRegex=/([\d.]+)%/i,pointRegex=/(\d+)pt/i,cmRegex=/([\d.]+)cm/i,inchRegex=/([\d.]+)in/i,pixelToEMU=pixelValue=>Math.round(9525*pixelValue),EMUToTWIP=EMUValue=>Math.round(EMUValue/635),pointToTWIP=pointValue=>Math.round(20*pointValue),pointToHIP=pointValue=>Math.round(2*pointValue),pixelToTWIP=pixelValue=>EMUToTWIP(pixelToEMU(pixelValue)),pixelToHIP=pixelValue=>{return TWIPValue=EMUToTWIP(pixelToEMU(pixelValue)),Math.round(TWIPValue/10);var TWIPValue},inchToTWIP=inchValue=>pointToTWIP((inchValue=>Math.round(72*inchValue))(inchValue)),pixelToPoint=pixelValue=>{return HIPValue=pixelToHIP(pixelValue),Math.round(HIPValue/2);var HIPValue},pointToEIP=PointValue=>Math.round(8*PointValue),vNodeHasChildren=vNode=>vNode&&vNode.children&&Array.isArray(vNode.children)&&vNode.children.length,fixupColorCode=colorCodeString=>{if(Object.prototype.hasOwnProperty.call(colorNames,colorCodeString.toLowerCase())){const[red,green,blue]=colorNames[colorCodeString.toLowerCase()];return rgbToHex(red,green,blue)}if(rgbRegex.test(colorCodeString)){const matchedParts=colorCodeString.match(rgbRegex),red=matchedParts[1],green=matchedParts[2],blue=matchedParts[3];return rgbToHex(red,green,blue)}if(hslRegex.test(colorCodeString)){const matchedParts=colorCodeString.match(hslRegex);return((hue,saturation,luminosity)=>{let red,green,blue;if(hue/=360,luminosity/=100,0==(saturation/=100))red=green=blue=luminosity;else{const hue2rgb=(p,q,t)=>(t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p),q=luminosity<.5?luminosity*(1+saturation):luminosity+saturation-luminosity*saturation,p=2*luminosity-q;red=hue2rgb(p,q,hue+1/3),green=hue2rgb(p,q,hue),blue=hue2rgb(p,q,hue-1/3)}return[red,green,blue].map((x=>{const hex=Math.round(255*x).toString(16);return 1===hex.length?`0${hex}`:hex})).join("")})(matchedParts[1],matchedParts[2],matchedParts[3])}if(hexRegex.test(colorCodeString)){return colorCodeString.match(hexRegex)[1]}if(hex3Regex.test(colorCodeString)){const matchedParts=colorCodeString.match(hex3Regex);return((red,green,blue)=>[red,green,blue].map((x=>`${x}${x}`)).join(""))(matchedParts[1],matchedParts[2],matchedParts[3])}return"000000"},buildRunFontFragment=(fontName="Times New Roman")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","rFonts").att("@w","ascii",fontName).att("@w","hAnsi",fontName).up(),buildShading=colorCode=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","shd").att("@w","val","clear").att("@w","fill",colorCode).up(),buildHighlight=(color="yellow")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","highlight").att("@w","val",color).up(),buildVertAlign=(type="baseline")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","vertAlign").att("@w","val",type).up(),buildBold=()=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","b").up(),buildItalics=()=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","i").up(),buildUnderline=(type="single")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","u").att("@w","val",type).up(),buildBorder=(borderSide="top",borderSize=0,borderSpacing=0,borderColor=fixupColorCode("black"),borderStroke="single")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w",borderSide).att("@w","val",borderStroke).att("@w","sz",borderSize).att("@w","space",borderSpacing).att("@w","color",borderColor).up(),buildTextElement=text=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","t").att("@xml","space","preserve").txt(text).up(),buildRunProperties=attributes=>{const runPropertiesFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","rPr");return attributes&&attributes.constructor===Object&&Object.keys(attributes).forEach((key=>{switch(key){case"strong":runPropertiesFragment.import(buildBold());break;case"i":runPropertiesFragment.import(buildItalics());break;case"u":runPropertiesFragment.import(buildUnderline());break;case"color":runPropertiesFragment.import((colorCode=attributes[key],fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","color").att("@w","val",colorCode).up()));break;case"backgroundColor":runPropertiesFragment.import(buildShading(attributes[key]));break;case"fontSize":runPropertiesFragment.import((fontSize=attributes[key],fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","sz").att("@w","val",fontSize).up()));break;case"hyperlink":runPropertiesFragment.import(((type="Hyperlink")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","rStyle").att("@w","val",type).up())("Hyperlink"));break;case"highlightColor":runPropertiesFragment.import(buildHighlight(attributes[key]));break;case"font":runPropertiesFragment.import(buildRunFontFragment("Courier"))}var fontSize,colorCode})),runPropertiesFragment.up(),runPropertiesFragment},buildTextFormatting=vNode=>{switch(vNode.tagName){case"strong":case"b":return buildBold();case"em":case"i":return buildItalics();case"ins":case"u":return buildUnderline();case"strike":case"del":case"s":return fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","strike").att("@w","val",!0).up();case"sub":return buildVertAlign("subscript");case"sup":return buildVertAlign("superscript");case"mark":return buildHighlight();case"code":return buildHighlight("lightGray");case"pre":return buildRunFontFragment("Courier")}},buildRun=(vNode,attributes)=>{const runFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","r"),runPropertiesFragment=buildRunProperties(attributes);if(isVnode(vNode)&&["span","strong","b","em","i","u","ins","strike","del","s","sub","sup","mark","blockquote","code","pre"].includes(vNode.tagName)){const textArray=[];let vNodes=[vNode];for(;vNodes.length;){const tempVNode=vNodes.shift();if(isVtext(tempVNode)&&textArray.push(tempVNode.text),isVnode(tempVNode)&&["strong","b","em","i","u","ins","strike","del","s","sub","sup","mark","code","pre"].includes(tempVNode.tagName)){const formattingFragment=buildTextFormatting(tempVNode);runPropertiesFragment.import(formattingFragment)}tempVNode.children&&tempVNode.children.length&&(vNodes=tempVNode.children.slice().concat(vNodes))}if(textArray.length){const combinedString=textArray.join("");vNode=new VText(combinedString)}}if(runFragment.import(runPropertiesFragment),isVtext(vNode)){const textFragment=buildTextElement(vNode.text);runFragment.import(textFragment)}else if(attributes&&"picture"===attributes.type){const{type:type,inlineOrAnchored:inlineOrAnchored,...otherAttributes}=attributes,imageFragment=buildDrawing(inlineOrAnchored,type,otherAttributes);runFragment.import(imageFragment)}else if(isVnode(vNode)&&"br"===vNode.tagName){const lineBreakFragment=((type="textWrapping")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","br").att("@w","type",type).up())();runFragment.import(lineBreakFragment)}return runFragment.up(),runFragment},fixupLineHeight=(lineHeight,fontSize)=>{if(isNaN(lineHeight))return 240;if(fontSize){return HIPValue=+lineHeight*fontSize,Math.round(10*HIPValue)}return 240*+lineHeight;var HIPValue},fixupFontSize$1=fontSizeString=>{if(pointRegex.test(fontSizeString)){const matchedParts=fontSizeString.match(pointRegex);return pointToHIP(matchedParts[1])}if(pixelRegex.test(fontSizeString)){const matchedParts=fontSizeString.match(pixelRegex);return pixelToHIP(matchedParts[1])}},fixupMargin=marginString=>{if(pointRegex.test(marginString)){const matchedParts=marginString.match(pointRegex);return pointToTWIP(matchedParts[1])}if(pixelRegex.test(marginString)){const matchedParts=marginString.match(pixelRegex);return pixelToTWIP(matchedParts[1])}},buildRunOrRuns=(vNode,attributes)=>{if(isVnode(vNode)&&"span"===vNode.tagName){const runFragments=[];for(let index=0;index<vNode.children.length;index++){const childVNode=vNode.children[index],modifiedAttributes={...attributes};isVnode(vNode)&&vNode.properties&&vNode.properties.style&&(vNode.properties.style.color&&!colorlessColors.includes(vNode.properties.style.color)&&(modifiedAttributes.color=fixupColorCode(vNode.properties.style.color)),vNode.properties.style["background-color"]&&!colorlessColors.includes(vNode.properties.style["background-color"])&&(modifiedAttributes.backgroundColor=fixupColorCode(vNode.properties.style["background-color"])),vNode.properties.style["font-size"]&&(modifiedAttributes.fontSize=fixupFontSize$1(vNode.properties.style["font-size"]))),runFragments.push(buildRun(childVNode,modifiedAttributes))}return runFragments}return buildRun(vNode,attributes)},buildRunOrHyperLink=(vNode,attributes,docxDocumentInstance)=>{if(isVnode(vNode)&&"a"===vNode.tagName){const relationshipId=docxDocumentInstance.createDocumentRelationships(docxDocumentInstance.relationshipFilename,"hyperlink",vNode.properties&&vNode.properties.href?vNode.properties.href:""),hyperlinkFragment=fragment({namespaceAlias:{w:namespaces_w,r:namespaces_r}}).ele("@w","hyperlink").att("@r","id",`rId${relationshipId}`),modifiedAttributes={...attributes};modifiedAttributes.hyperlink=!0;const runFragments=buildRunOrRuns(vNode.children[0],modifiedAttributes);if(Array.isArray(runFragments))for(let index=0;index<runFragments.length;index++){const runFragment=runFragments[index];hyperlinkFragment.import(runFragment)}else hyperlinkFragment.import(runFragments);return hyperlinkFragment.up(),hyperlinkFragment}return buildRunOrRuns(vNode,attributes)},buildHorizontalAlignment=horizontalAlignment=>("justify"===horizontalAlignment&&(horizontalAlignment="both"),fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","jc").att("@w","val",horizontalAlignment).up()),buildParagraphProperties=attributes=>{const paragraphPropertiesFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","pPr");if(attributes&&attributes.constructor===Object){Object.keys(attributes).forEach((key=>{switch(key){case"numbering":const{levelId:levelId,numberingId:numberingId}=attributes[key],numberingPropertiesFragment=((levelId,numberingId)=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","numPr").ele("@w","ilvl").att("@w","val",String(levelId)).up().ele("@w","numId").att("@w","val",String(numberingId)).up().up())(levelId,numberingId);paragraphPropertiesFragment.import(numberingPropertiesFragment),delete attributes.numbering;break;case"textAlign":const horizontalAlignmentFragment=buildHorizontalAlignment(attributes[key]);paragraphPropertiesFragment.import(horizontalAlignmentFragment),delete attributes.textAlign;break;case"backgroundColor":if("block"===attributes.display){const shadingFragment=buildShading(attributes[key]);paragraphPropertiesFragment.import(shadingFragment);const paragraphBorderFragment=(()=>{const paragraphBorderFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","pBdr"),bordersObject=lodash.cloneDeep(paragraphBordersObject);return Object.keys(bordersObject).forEach((borderName=>{if(bordersObject[borderName]){const{size:size,spacing:spacing,color:color}=bordersObject[borderName],borderFragment=buildBorder(borderName,size,spacing,color);paragraphBorderFragment.import(borderFragment)}})),paragraphBorderFragment.up(),paragraphBorderFragment})();paragraphPropertiesFragment.import(paragraphBorderFragment),delete attributes.backgroundColor}break;case"paragraphStyle":const pStyleFragment=((style="Normal")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","pStyle").att("@w","val",style).up())(attributes.paragraphStyle);paragraphPropertiesFragment.import(pStyleFragment),delete attributes.paragraphStyle;break;case"indentation":const indentationFragment=(({left:left,right:right})=>{const indentationFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","ind");return left&&indentationFragment.att("@w","left",left),right&&indentationFragment.att("@w","right",right),indentationFragment.up(),indentationFragment})(attributes[key]);paragraphPropertiesFragment.import(indentationFragment),delete attributes.indentation}}));const spacingFragment=((lineSpacing,beforeSpacing,afterSpacing)=>{const spacingFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","spacing");return lineSpacing&&spacingFragment.att("@w","line",lineSpacing),beforeSpacing&&spacingFragment.att("@w","before",beforeSpacing),afterSpacing&&spacingFragment.att("@w","after",afterSpacing),spacingFragment.att("@w","lineRule","exact").up(),spacingFragment})(attributes.lineHeight,attributes.beforeSpacing,attributes.afterSpacing);delete attributes.lineHeight,delete attributes.beforeSpacing,delete attributes.afterSpacing,paragraphPropertiesFragment.import(spacingFragment)}return paragraphPropertiesFragment.up(),paragraphPropertiesFragment},computeImageDimensions=(vNode,attributes)=>{const{maximumWidth:maximumWidth,originalWidth:originalWidth,originalHeight:originalHeight}=attributes,aspectRatio=originalWidth/originalHeight,maximumWidthInEMU=(TWIPValue=maximumWidth,Math.round(635*TWIPValue));var TWIPValue;let modifiedHeight,modifiedWidth,originalWidthInEMU=pixelToEMU(originalWidth),originalHeightInEMU=pixelToEMU(originalHeight);if(originalWidthInEMU>maximumWidthInEMU&&(originalWidthInEMU=maximumWidthInEMU,originalHeightInEMU=Math.round(originalWidthInEMU/aspectRatio)),vNode.properties&&vNode.properties.style){if(vNode.properties.style.width)if("auto"!==vNode.properties.style.width){if(pixelRegex.test(vNode.properties.style.width))modifiedWidth=pixelToEMU(vNode.properties.style.width.match(pixelRegex)[1]);else if(percentageRegex.test(vNode.properties.style.width)){const percentageValue=vNode.properties.style.width.match(percentageRegex)[1];modifiedWidth=Math.round(percentageValue/100*originalWidthInEMU)}}else vNode.properties.style.height&&"auto"===vNode.properties.style.height&&(modifiedWidth=originalWidthInEMU,modifiedHeight=originalHeightInEMU);if(vNode.properties.style.height)if("auto"!==vNode.properties.style.height){if(pixelRegex.test(vNode.properties.style.height))modifiedHeight=pixelToEMU(vNode.properties.style.height.match(pixelRegex)[1]);else if(percentageRegex.test(vNode.properties.style.height)){const percentageValue=vNode.properties.style.width.match(percentageRegex)[1];modifiedHeight=Math.round(percentageValue/100*originalHeightInEMU),modifiedWidth||(modifiedWidth=Math.round(modifiedHeight*aspectRatio))}}else modifiedWidth?modifiedHeight||(modifiedHeight=Math.round(modifiedWidth/aspectRatio)):(modifiedHeight=originalHeightInEMU,modifiedWidth=originalWidthInEMU);modifiedWidth&&!modifiedHeight?modifiedHeight=Math.round(modifiedWidth/aspectRatio):modifiedHeight&&!modifiedWidth&&(modifiedWidth=Math.round(modifiedHeight*aspectRatio))}else modifiedWidth=originalWidthInEMU,modifiedHeight=originalHeightInEMU;attributes.width=modifiedWidth,attributes.height=modifiedHeight},buildParagraph=(vNode,attributes,docxDocumentInstance)=>{const paragraphFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","p"),modifiedAttributes={...attributes};if(isVnode(vNode)&&vNode.properties&&vNode.properties.style){if(vNode.properties.style.color&&!colorlessColors.includes(vNode.properties.style.color)&&(modifiedAttributes.color=fixupColorCode(vNode.properties.style.color)),vNode.properties.style["background-color"]&&!colorlessColors.includes(vNode.properties.style["background-color"])&&(modifiedAttributes.backgroundColor=fixupColorCode(vNode.properties.style["background-color"])),vNode.properties.style["vertical-align"]&&verticalAlignValues.includes(vNode.properties.style["vertical-align"])&&(modifiedAttributes.verticalAlign=vNode.properties.style["vertical-align"]),vNode.properties.style["text-align"]&&["left","right","center","justify"].includes(vNode.properties.style["text-align"])&&(modifiedAttributes.textAlign=vNode.properties.style["text-align"]),vNode.properties.style["font-weight"]&&"bold"===vNode.properties.style["font-weight"]&&(modifiedAttributes.strong=vNode.properties.style["font-weight"]),vNode.properties.style["font-size"]&&(modifiedAttributes.fontSize=fixupFontSize$1(vNode.properties.style["font-size"])),vNode.properties.style["line-height"]&&(modifiedAttributes.lineHeight=fixupLineHeight(vNode.properties.style["line-height"],vNode.properties.style["font-size"]?fixupFontSize$1(vNode.properties.style["font-size"]):null)),vNode.properties.style["margin-left"]||vNode.properties.style["margin-right"]){const leftMargin=fixupMargin(vNode.properties.style["margin-left"]),rightMargin=fixupMargin(vNode.properties.style["margin-right"]),indentation={};leftMargin&&(indentation.left=leftMargin),rightMargin&&(indentation.right=rightMargin),(leftMargin||rightMargin)&&(modifiedAttributes.indentation=indentation)}vNode.properties.style.display&&(modifiedAttributes.display=vNode.properties.style.display)}isVnode(vNode)&&"blockquote"===vNode.tagName?(modifiedAttributes.indentation={left:284},modifiedAttributes.textAlign="justify"):isVnode(vNode)&&"code"===vNode.tagName?modifiedAttributes.highlightColor="lightGray":isVnode(vNode)&&"pre"===vNode.tagName&&(modifiedAttributes.font="Courier");const paragraphPropertiesFragment=buildParagraphProperties(modifiedAttributes);if(paragraphFragment.import(paragraphPropertiesFragment),isVnode(vNode)&&vNodeHasChildren(vNode))if(["span","strong","b","em","i","u","ins","strike","del","s","sub","sup","mark","a","code","pre"].includes(vNode.tagName)){const runOrHyperlinkFragments=buildRunOrHyperLink(vNode,modifiedAttributes,docxDocumentInstance);if(Array.isArray(runOrHyperlinkFragments))for(let iteratorIndex=0;iteratorIndex<runOrHyperlinkFragments.length;iteratorIndex++){const runOrHyperlinkFragment=runOrHyperlinkFragments[iteratorIndex];paragraphFragment.import(runOrHyperlinkFragment)}else paragraphFragment.import(runOrHyperlinkFragments)}else if("blockquote"===vNode.tagName){const runFragment=buildRun(vNode,attributes);paragraphFragment.import(runFragment)}else for(let index=0;index<vNode.children.length;index++){const childVNode=vNode.children[index],runOrHyperlinkFragments=buildRunOrHyperLink(childVNode,modifiedAttributes,docxDocumentInstance);if(Array.isArray(runOrHyperlinkFragments))for(let iteratorIndex=0;iteratorIndex<runOrHyperlinkFragments.length;iteratorIndex++){const runOrHyperlinkFragment=runOrHyperlinkFragments[iteratorIndex];paragraphFragment.import(runOrHyperlinkFragment)}else paragraphFragment.import(runOrHyperlinkFragments)}else{isVnode(vNode)&&"img"===vNode.tagName&&computeImageDimensions(vNode,modifiedAttributes);const runFragments=buildRunOrRuns(vNode,modifiedAttributes);if(Array.isArray(runFragments))for(let index=0;index<runFragments.length;index++){const runFragment=runFragments[index];paragraphFragment.import(runFragment)}else paragraphFragment.import(runFragments)}return paragraphFragment.up(),paragraphFragment},buildTableCellProperties=attributes=>{const tableCellPropertiesFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tcPr");return attributes&&attributes.constructor===Object&&Object.keys(attributes).forEach((key=>{switch(key){case"backgroundColor":const shadingFragment=buildShading(attributes[key]);tableCellPropertiesFragment.import(shadingFragment),delete attributes.backgroundColor;break;case"verticalAlign":const verticalAlignmentFragment=("middle"===(verticalAlignment=attributes[key]).toLowerCase()&&(verticalAlignment="center"),fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","vAlign").att("@w","val",verticalAlignment).up());tableCellPropertiesFragment.import(verticalAlignmentFragment),delete attributes.verticalAlign;break;case"colSpan":const gridSpanFragment=(spanValue=attributes[key],fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","gridSpan").att("@w","val",spanValue).up());tableCellPropertiesFragment.import(gridSpanFragment),delete attributes.colSpan;break;case"tableCellBorder":const tableCellBorderFragment=(tableCellBorder=>{const tableCellBordersFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tcBorders"),{color:color,stroke:stroke,...borders}=tableCellBorder;return Object.keys(borders).forEach((border=>{if(tableCellBorder[border]){const borderFragment=buildBorder(border,tableCellBorder[border],0,color,stroke);tableCellBordersFragment.import(borderFragment)}})),tableCellBordersFragment.up(),tableCellBordersFragment})(attributes[key]);tableCellPropertiesFragment.import(tableCellBorderFragment),delete attributes.tableCellBorder;break;case"rowSpan":const verticalMergeFragment=((verticalMerge="continue")=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","vMerge").att("@w","val",verticalMerge).up())(attributes[key]);tableCellPropertiesFragment.import(verticalMergeFragment),delete attributes.rowSpan}var spanValue,verticalAlignment})),tableCellPropertiesFragment.up(),tableCellPropertiesFragment},fixupTableCellBorder=(vNode,attributes)=>{if(Object.prototype.hasOwnProperty.call(vNode.properties.style,"border"))if("none"===vNode.properties.style.border||0===vNode.properties.style.border)attributes.tableCellBorder={};else{const[borderSize,borderStroke,borderColor]=cssBorderParser(vNode.properties.style.border);attributes.tableCellBorder={top:borderSize,left:borderSize,bottom:borderSize,right:borderSize,color:borderColor,stroke:borderStroke}}if(vNode.properties.style["border-top"]&&"0"===vNode.properties.style["border-top"])attributes.tableCellBorder={...attributes.tableCellBorder,top:0};else if(vNode.properties.style["border-top"]&&"0"!==vNode.properties.style["border-top"]){const[borderSize,borderStroke,borderColor]=cssBorderParser(vNode.properties.style["border-top"]);attributes.tableCellBorder={...attributes.tableCellBorder,top:borderSize,color:borderColor,stroke:borderStroke}}if(vNode.properties.style["border-left"]&&"0"===vNode.properties.style["border-left"])attributes.tableCellBorder={...attributes.tableCellBorder,left:0};else if(vNode.properties.style["border-left"]&&"0"!==vNode.properties.style["border-left"]){const[borderSize,borderStroke,borderColor]=cssBorderParser(vNode.properties.style["border-left"]);attributes.tableCellBorder={...attributes.tableCellBorder,left:borderSize,color:borderColor,stroke:borderStroke}}if(vNode.properties.style["border-bottom"]&&"0"===vNode.properties.style["border-bottom"])attributes.tableCellBorder={...attributes.tableCellBorder,bottom:0};else if(vNode.properties.style["border-bottom"]&&"0"!==vNode.properties.style["border-bottom"]){const[borderSize,borderStroke,borderColor]=cssBorderParser(vNode.properties.style["border-bottom"]);attributes.tableCellBorder={...attributes.tableCellBorder,bottom:borderSize,color:borderColor,stroke:borderStroke}}if(vNode.properties.style["border-right"]&&"0"===vNode.properties.style["border-right"])attributes.tableCellBorder={...attributes.tableCellBorder,right:0};else if(vNode.properties.style["border-right"]&&"0"!==vNode.properties.style["border-right"]){const[borderSize,borderStroke,borderColor]=cssBorderParser(vNode.properties.style["border-right"]);attributes.tableCellBorder={...attributes.tableCellBorder,right:borderSize,color:borderColor,stroke:borderStroke}}},buildTableCell=(vNode,attributes,rowSpanMap,columnIndex,docxDocumentInstance)=>{const tableCellFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tc"),modifiedAttributes={...attributes};if(isVnode(vNode)&&vNode.properties){if(vNode.properties.rowSpan)rowSpanMap.set(columnIndex.index,{rowSpan:vNode.properties.rowSpan-1,colSpan:0}),modifiedAttributes.rowSpan="restart";else{const previousSpanObject=rowSpanMap.get(columnIndex.index);rowSpanMap.set(columnIndex.index,Object.assign({},previousSpanObject,{rowSpan:0,colSpan:previousSpanObject&&previousSpanObject.colSpan||0}))}if(vNode.properties.colSpan||vNode.properties.style&&vNode.properties.style["column-span"]){modifiedAttributes.colSpan=vNode.properties.colSpan||vNode.properties.style&&vNode.properties.style["column-span"];const previousSpanObject=rowSpanMap.get(columnIndex.index);rowSpanMap.set(columnIndex.index,Object.assign({},previousSpanObject,{colSpan:parseInt(modifiedAttributes.colSpan)||0})),columnIndex.index+=parseInt(modifiedAttributes.colSpan)-1}vNode.properties.style&&(vNode.properties.style.color&&!colorlessColors.includes(vNode.properties.style.color)&&(modifiedAttributes.color=fixupColorCode(vNode.properties.style.color)),vNode.properties.style["background-color"]&&!colorlessColors.includes(vNode.properties.style["background-color"])&&(modifiedAttributes.backgroundColor=fixupColorCode(vNode.properties.style["background-color"])),vNode.properties.style["vertical-align"]&&verticalAlignValues.includes(vNode.properties.style["vertical-align"])&&(modifiedAttributes.verticalAlign=vNode.properties.style["vertical-align"]),fixupTableCellBorder(vNode,modifiedAttributes))}const tableCellPropertiesFragment=buildTableCellProperties(modifiedAttributes);if(tableCellFragment.import(tableCellPropertiesFragment),vNodeHasChildren(vNode))for(let index=0;index<vNode.children.length;index++){const childVNode=vNode.children[index];if(isVnode(childVNode)&&"img"===childVNode.tagName){const imageFragment=buildImage(docxDocumentInstance,childVNode,modifiedAttributes.maximumWidth);imageFragment&&tableCellFragment.import(imageFragment)}else if(isVnode(childVNode)&&"figure"===childVNode.tagName){if(vNodeHasChildren(childVNode))for(let iteratorIndex=0;iteratorIndex<childVNode.children.length;iteratorIndex++){const grandChildVNode=childVNode.children[iteratorIndex];if("img"===grandChildVNode.tagName){const imageFragment=buildImage(docxDocumentInstance,grandChildVNode,modifiedAttributes.maximumWidth);imageFragment&&tableCellFragment.import(imageFragment)}}}else if(isVnode(childVNode)&&["ul","ol"].includes(childVNode.tagName))vNodeHasChildren(childVNode)&&buildList(childVNode,docxDocumentInstance,tableCellFragment);else{const paragraphFragment=buildParagraph(childVNode,modifiedAttributes,docxDocumentInstance);tableCellFragment.import(paragraphFragment)}}else{const paragraphFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","p").up();tableCellFragment.import(paragraphFragment)}return tableCellFragment.up(),tableCellFragment},buildRowSpanCell=(rowSpanMap,columnIndex,attributes)=>{const rowSpanCellFragments=[];let spanObject=rowSpanMap.get(columnIndex.index);for(;spanObject&&spanObject.rowSpan;){const rowSpanCellFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tc"),tableCellPropertiesFragment=buildTableCellProperties({...attributes,rowSpan:"continue",colSpan:spanObject.colSpan?spanObject.colSpan:0});rowSpanCellFragment.import(tableCellPropertiesFragment);const paragraphFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","p").up();rowSpanCellFragment.import(paragraphFragment),rowSpanCellFragment.up(),rowSpanCellFragments.push(rowSpanCellFragment),spanObject.rowSpan-1==0?rowSpanMap.delete(columnIndex.index):rowSpanMap.set(columnIndex.index,{rowSpan:spanObject.rowSpan-1,colSpan:spanObject.colSpan||0}),columnIndex.index+=spanObject.colSpan||1,spanObject=rowSpanMap.get(columnIndex.index)}return rowSpanCellFragments},buildTableRowProperties=attributes=>{const tableRowPropertiesFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","trPr");return attributes&&attributes.constructor===Object&&Object.keys(attributes).forEach((key=>{switch(key){case"tableRowHeight":const tableRowHeightFragment=(tableRowHeight=attributes[key],fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","trHeight").att("@w","val",tableRowHeight).att("@w","hRule","atLeast").up());tableRowPropertiesFragment.import(tableRowHeightFragment),delete attributes.tableRowHeight;break;case"rowCantSplit":if(attributes.rowCantSplit){const cantSplitFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","cantSplit").up();tableRowPropertiesFragment.import(cantSplitFragment),delete attributes.rowCantSplit}}var tableRowHeight})),tableRowPropertiesFragment.up(),tableRowPropertiesFragment},buildTableRow=(vNode,attributes,rowSpanMap,docxDocumentInstance)=>{const tableRowFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tr"),modifiedAttributes={...attributes};isVnode(vNode)&&vNode.properties&&((vNode.properties.style&&vNode.properties.style.height||vNode.children[0]&&isVnode(vNode.children[0])&&vNode.children[0].properties.style&&vNode.children[0].properties.style.height)&&(modifiedAttributes.tableRowHeight=(rowHeightString=>{if(pointRegex.test(rowHeightString)){const matchedParts=rowHeightString.match(pointRegex);return pointToTWIP(matchedParts[1])}if(pixelRegex.test(rowHeightString)){const matchedParts=rowHeightString.match(pixelRegex);return pixelToTWIP(matchedParts[1])}})(vNode.properties.style&&vNode.properties.style.height||(vNode.children[0]&&isVnode(vNode.children[0])&&vNode.children[0].properties.style&&vNode.children[0].properties.style.height?vNode.children[0].properties.style.height:void 0))),vNode.properties.style&&fixupTableCellBorder(vNode,modifiedAttributes));const tableRowPropertiesFragment=buildTableRowProperties(modifiedAttributes);tableRowFragment.import(tableRowPropertiesFragment);const columnIndex={index:0};if(vNodeHasChildren(vNode)){const tableColumns=vNode.children.filter((childVNode=>["td","th"].includes(childVNode.tagName))),columnWidth=docxDocumentInstance.availableDocumentSpace/tableColumns.length;for(let index=0;index<vNode.children.length;index++){const childVNode=vNode.children[index];if(["td","th"].includes(childVNode.tagName)){const rowSpanCellFragments=buildRowSpanCell(rowSpanMap,columnIndex,modifiedAttributes);if(Array.isArray(rowSpanCellFragments))for(let iteratorIndex=0;iteratorIndex<rowSpanCellFragments.length;iteratorIndex++){const rowSpanCellFragment=rowSpanCellFragments[iteratorIndex];tableRowFragment.import(rowSpanCellFragment)}const tableCellFragment=buildTableCell(childVNode,{...modifiedAttributes,maximumWidth:columnWidth},rowSpanMap,columnIndex,docxDocumentInstance);columnIndex.index++,tableRowFragment.import(tableCellFragment)}}}if(columnIndex.index<rowSpanMap.size){const rowSpanCellFragments=buildRowSpanCell(rowSpanMap,columnIndex,modifiedAttributes);if(Array.isArray(rowSpanCellFragments))for(let iteratorIndex=0;iteratorIndex<rowSpanCellFragments.length;iteratorIndex++){const rowSpanCellFragment=rowSpanCellFragments[iteratorIndex];tableRowFragment.import(rowSpanCellFragment)}}return tableRowFragment.up(),tableRowFragment},buildTableGridCol=gridWidth=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","gridCol").att("@w","w",String(gridWidth)),buildTableGrid=(vNode,attributes)=>{const tableGridFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tblGrid");if(vNodeHasChildren(vNode)){const gridColumns=vNode.children.filter((childVNode=>"col"===childVNode.tagName)),gridWidth=attributes.maximumWidth/gridColumns.length;for(let index=0;index<gridColumns.length;index++){const tableGridColFragment=buildTableGridCol(gridWidth);tableGridFragment.import(tableGridColFragment)}}return tableGridFragment.up(),tableGridFragment},buildTableGridFromTableRow=(vNode,attributes)=>{const tableGridFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tblGrid");if(vNodeHasChildren(vNode)){const numberOfGridColumns=vNode.children.reduce(((accumulator,childVNode)=>{const colSpan=childVNode.properties.colSpan||childVNode.properties.style&&childVNode.properties.style["column-span"];return accumulator+(colSpan?parseInt(colSpan):1)}),0),gridWidth=attributes.maximumWidth/numberOfGridColumns;for(let index=0;index<numberOfGridColumns;index++){const tableGridColFragment=buildTableGridCol(gridWidth);tableGridFragment.import(tableGridColFragment)}}return tableGridFragment.up(),tableGridFragment},buildCellMargin=(side,margin)=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w",side).att("@w","type","dxa").att("@w","w",String(margin)).up(),buildTableProperties=attributes=>{const tablePropertiesFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tblPr");attributes&&attributes.constructor===Object&&Object.keys(attributes).forEach((key=>{switch(key){case"tableBorder":const tableBordersFragment=(tableBorder=>{const tableBordersFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tblBorders"),{color:color,stroke:stroke,...borders}=tableBorder;return Object.keys(borders).forEach((border=>{if(borders[border]){const borderFragment=buildBorder(border,borders[border],0,color,stroke);tableBordersFragment.import(borderFragment)}})),tableBordersFragment.up(),tableBordersFragment})(attributes[key]);tablePropertiesFragment.import(tableBordersFragment),delete attributes.tableBorder;break;case"tableCellSpacing":const tableCellSpacingFragment=((cellSpacing=0)=>fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tblCellSpacing").att("@w","w",cellSpacing).att("@w","type","dxa").up())(attributes[key]);tablePropertiesFragment.import(tableCellSpacingFragment),delete attributes.tableCellSpacing;break;case"width":if(attributes[key]){const tableWidthFragment=(tableWidth=attributes[key],fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tblW").att("@w","type","dxa").att("@w","w",String(tableWidth)).up());tablePropertiesFragment.import(tableWidthFragment)}delete attributes.width}var tableWidth}));const tableCellMarginFragment=(margin=>{const tableCellMarFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tblCellMar");return["top","bottom"].forEach((side=>{const marginFragment=buildCellMargin(side,margin/2);tableCellMarFragment.import(marginFragment)})),["left","right"].forEach((side=>{const marginFragment=buildCellMargin(side,margin);tableCellMarFragment.import(marginFragment)})),tableCellMarFragment})(160);tablePropertiesFragment.import(tableCellMarginFragment);const alignmentFragment=buildHorizontalAlignment("center");return tablePropertiesFragment.import(alignmentFragment),tablePropertiesFragment.up(),tablePropertiesFragment},cssBorderParser=borderString=>{let[size,stroke,color]=borderString.split(" ");if(pointRegex.test(size)){const matchedParts=size.match(pointRegex);size=pointToEIP(matchedParts[1])}else if(pixelRegex.test(size)){const matchedParts=size.match(pixelRegex);pixelValue=matchedParts[1],size=pointToEIP(pixelToPoint(pixelValue))}var pixelValue;return stroke=stroke&&["dashed","dotted","double"].includes(stroke)?stroke:"single",color=color&&fixupColorCode(color).toUpperCase(),[size,stroke,color]},buildTable=(vNode,attributes,docxDocumentInstance)=>{const tableFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","tbl"),modifiedAttributes={...attributes};if(isVnode(vNode)&&vNode.properties){const tableAttributes=vNode.properties.attributes||{},tableStyles=vNode.properties.style||{},tableBorders={},tableCellBorders={};let minimumWidth,maximumWidth,width,[borderSize,borderStrike,borderColor]=[2,"single","000000"];if(isNaN(tableAttributes.border)||(borderSize=parseInt(tableAttributes.border,10)),tableStyles.border){const[cssSize,cssStroke,cssColor]=cssBorderParser(tableStyles.border);borderSize=cssSize||borderSize,borderColor=cssColor||borderColor,borderStrike=cssStroke||borderStrike}if(tableBorders.top=borderSize,tableBorders.bottom=borderSize,tableBorders.left=borderSize,tableBorders.right=borderSize,tableBorders.stroke=borderStrike,tableBorders.color=borderColor,"collapse"===tableStyles["border-collapse"]?(tableBorders.insideV=borderSize,tableBorders.insideH=borderSize):(tableBorders.insideV=0,tableBorders.insideH=0,tableCellBorders.top=1,tableCellBorders.bottom=1,tableCellBorders.left=1,tableCellBorders.right=1),modifiedAttributes.tableBorder=tableBorders,modifiedAttributes.tableCellSpacing=0,Object.keys(tableCellBorders).length&&(modifiedAttributes.tableCellBorder=tableCellBorders),pixelRegex.test(tableStyles["min-width"]))minimumWidth=pixelToTWIP(tableStyles["min-width"].match(pixelRegex)[1]);else if(percentageRegex.test(tableStyles["min-width"])){const percentageValue=tableStyles["min-width"].match(percentageRegex)[1];minimumWidth=Math.round(percentageValue/100*attributes.maximumWidth)}if(pixelRegex.test(tableStyles["max-width"]))pixelRegex.lastIndex=0,maximumWidth=pixelToTWIP(tableStyles["max-width"].match(pixelRegex)[1]);else if(percentageRegex.test(tableStyles["max-width"])){percentageRegex.lastIndex=0;const percentageValue=tableStyles["max-width"].match(percentageRegex)[1];maximumWidth=Math.round(percentageValue/100*attributes.maximumWidth)}if(pixelRegex.test(tableStyles.width))pixelRegex.lastIndex=0,width=pixelToTWIP(tableStyles.width.match(pixelRegex)[1]);else if(percentageRegex.test(tableStyles.width)){percentageRegex.lastIndex=0;const percentageValue=tableStyles.width.match(percentageRegex)[1];width=Math.round(percentageValue/100*attributes.maximumWidth)}width?(modifiedAttributes.width=width,maximumWidth&&(modifiedAttributes.width=Math.min(modifiedAttributes.width,maximumWidth)),minimumWidth&&(modifiedAttributes.width=Math.max(modifiedAttributes.width,minimumWidth))):minimumWidth&&(modifiedAttributes.width=minimumWidth),modifiedAttributes.width&&(modifiedAttributes.width=Math.min(modifiedAttributes.width,attributes.maximumWidth))}const tablePropertiesFragment=buildTableProperties(modifiedAttributes);tableFragment.import(tablePropertiesFragment);const rowSpanMap=new Map;if(vNodeHasChildren(vNode))for(let index=0;index<vNode.children.length;index++){const childVNode=vNode.children[index];if("colgroup"===childVNode.tagName){const tableGridFragment=buildTableGrid(childVNode,modifiedAttributes);tableFragment.import(tableGridFragment)}else if("thead"===childVNode.tagName)for(let iteratorIndex=0;iteratorIndex<childVNode.children.length;iteratorIndex++){const grandChildVNode=childVNode.children[iteratorIndex];if("tr"===grandChildVNode.tagName){if(0===iteratorIndex){const tableGridFragment=buildTableGridFromTableRow(grandChildVNode,modifiedAttributes);tableFragment.import(tableGridFragment)}const tableRowFragment=buildTableRow(grandChildVNode,modifiedAttributes,rowSpanMap,docxDocumentInstance);tableFragment.import(tableRowFragment)}}else if("tbody"===childVNode.tagName)for(let iteratorIndex=0;iteratorIndex<childVNode.children.length;iteratorIndex++){const grandChildVNode=childVNode.children[iteratorIndex];if("tr"===grandChildVNode.tagName){if(0===iteratorIndex){const tableGridFragment=buildTableGridFromTableRow(grandChildVNode,modifiedAttributes);tableFragment.import(tableGridFragment)}const tableRowFragment=buildTableRow(grandChildVNode,modifiedAttributes,rowSpanMap,docxDocumentInstance);tableFragment.import(tableRowFragment)}}else if("tr"===childVNode.tagName){if(0===index){const tableGridFragment=buildTableGridFromTableRow(childVNode,modifiedAttributes);tableFragment.import(tableGridFragment)}const tableRowFragment=buildTableRow(childVNode,modifiedAttributes,rowSpanMap,docxDocumentInstance);tableFragment.import(tableRowFragment)}}return tableFragment.up(),tableFragment},buildGraphicFrameTransform=attributes=>{const graphicFrameTransformFragment=fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","xfrm"),offsetFragment=fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","off").att("x","0").att("y","0").up();graphicFrameTransformFragment.import(offsetFragment);const extentsFragment=(({width:width,height:height})=>fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","ext").att("cx",width).att("cy",height).up())(attributes);return graphicFrameTransformFragment.import(extentsFragment),graphicFrameTransformFragment.up(),graphicFrameTransformFragment},buildShapeProperties=attributes=>{const shapeProperties=fragment({namespaceAlias:{pic:namespaces_pic}}).ele("@pic","spPr"),graphicFrameTransformFragment=buildGraphicFrameTransform(attributes);shapeProperties.import(graphicFrameTransformFragment);const presetGeometryFragment=fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","prstGeom").att("prst","rect").up();return shapeProperties.import(presetGeometryFragment),shapeProperties.up(),shapeProperties},buildStretch=()=>{const stretchFragment=fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","stretch"),fillRectFragment=fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","fillRect").up();return stretchFragment.import(fillRectFragment),stretchFragment.up(),stretchFragment},buildBinaryLargeImageOrPictureFill=relationshipId=>{const binaryLargeImageOrPictureFillFragment=fragment({namespaceAlias:{pic:namespaces_pic}}).ele("@pic","blipFill"),binaryLargeImageOrPictureFragment=(relationshipId=>fragment({namespaceAlias:{a:namespaces_a,r:namespaces_r}}).ele("@a","blip").att("@r","embed",`rId${relationshipId}`).att("cstate","print").up())(relationshipId);binaryLargeImageOrPictureFillFragment.import(binaryLargeImageOrPictureFragment);const srcRectFragment=fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","srcRect").att("b","0").att("l","0").att("r","0").att("t","0").up();binaryLargeImageOrPictureFillFragment.import(srcRectFragment);const stretchFragment=buildStretch();return binaryLargeImageOrPictureFillFragment.import(stretchFragment),binaryLargeImageOrPictureFillFragment.up(),binaryLargeImageOrPictureFillFragment},buildNonVisualPictureProperties=(pictureId,pictureNameWithExtension,pictureDescription)=>{const nonVisualPicturePropertiesFragment=fragment({namespaceAlias:{pic:namespaces_pic}}).ele("@pic","nvPicPr"),nonVisualDrawingPropertiesFragment=((pictureId,pictureNameWithExtension,pictureDescription="")=>fragment({namespaceAlias:{pic:namespaces_pic}}).ele("@pic","cNvPr").att("id",pictureId).att("name",pictureNameWithExtension).att("descr",pictureDescription).up())(pictureId,pictureNameWithExtension,pictureDescription);nonVisualPicturePropertiesFragment.import(nonVisualDrawingPropertiesFragment);const nonVisualPictureDrawingPropertiesFragment=fragment({namespaceAlias:{pic:namespaces_pic}}).ele("@pic","cNvPicPr").up();return nonVisualPicturePropertiesFragment.import(nonVisualPictureDrawingPropertiesFragment),nonVisualPicturePropertiesFragment.up(),nonVisualPicturePropertiesFragment},buildGraphicData=(graphicType,attributes)=>{const graphicDataFragment=fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","graphicData").att("uri","http://schemas.openxmlformats.org/drawingml/2006/picture");if("picture"===graphicType){const pictureFragment=(({id:id,fileNameWithExtension:fileNameWithExtension,description:description,relationshipId:relationshipId,width:width,height:height})=>{const pictureFragment=fragment({namespaceAlias:{pic:namespaces_pic}}).ele("@pic","pic"),nonVisualPicturePropertiesFragment=buildNonVisualPictureProperties(id,fileNameWithExtension,description);pictureFragment.import(nonVisualPicturePropertiesFragment);const binaryLargeImageOrPictureFill=buildBinaryLargeImageOrPictureFill(relationshipId);pictureFragment.import(binaryLargeImageOrPictureFill);const shapeProperties=buildShapeProperties({width:width,height:height});return pictureFragment.import(shapeProperties),pictureFragment.up(),pictureFragment})(attributes);graphicDataFragment.import(pictureFragment)}return graphicDataFragment.up(),graphicDataFragment},buildGraphic=(graphicType,attributes)=>{const graphicFragment=fragment({namespaceAlias:{a:namespaces_a}}).ele("@a","graphic"),graphicDataFragment=buildGraphicData(graphicType,attributes);return graphicFragment.import(graphicDataFragment),graphicFragment.up(),graphicFragment},buildDrawingObjectNonVisualProperties=(pictureId,pictureName)=>fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","docPr").att("id",pictureId).att("name",pictureName).up(),buildEffectExtentFragment=()=>fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","effectExtent").att("b","0").att("l","0").att("r","0").att("t","0").up(),buildExtent=({width:width,height:height})=>fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","extent").att("cx",width).att("cy",height).up(),buildAnchoredDrawing=(graphicType,attributes)=>{const anchoredDrawingFragment=fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","anchor").att("distB","0").att("distL","0").att("distR","0").att("distT","0").att("relativeHeight","0").att("behindDoc","false").att("locked","true").att("layoutInCell","true").att("allowOverlap","false").att("simplePos","false"),simplePosFragment=fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","simplePos").att("x","0").att("y","0").up();anchoredDrawingFragment.import(simplePosFragment);const positionHFragment=fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","positionH").att("relativeFrom","column").ele("@wp","posOffset").txt("19050").up().up();anchoredDrawingFragment.import(positionHFragment);const positionVFragment=fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","positionV").att("relativeFrom","paragraph").ele("@wp","posOffset").txt("19050").up().up();anchoredDrawingFragment.import(positionVFragment);const extentFragment=buildExtent({width:attributes.width,height:attributes.height});anchoredDrawingFragment.import(extentFragment);const effectExtentFragment=buildEffectExtentFragment();anchoredDrawingFragment.import(effectExtentFragment);const wrapSquareFragment=fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","wrapSquare").att("wrapText","bothSides").att("distB","228600").att("distT","228600").att("distL","228600").att("distR","228600").up();anchoredDrawingFragment.import(wrapSquareFragment);const drawingObjectNonVisualPropertiesFragment=buildDrawingObjectNonVisualProperties(attributes.id,attributes.fileNameWithExtension);anchoredDrawingFragment.import(drawingObjectNonVisualPropertiesFragment);const graphicFragment=buildGraphic(graphicType,attributes);return anchoredDrawingFragment.import(graphicFragment),anchoredDrawingFragment.up(),anchoredDrawingFragment},buildDrawing=(inlineOrAnchored=!1,graphicType,attributes)=>{const drawingFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","drawing"),inlineOrAnchoredDrawingFragment=inlineOrAnchored?((graphicType,attributes)=>{const inlineDrawingFragment=fragment({namespaceAlias:{wp:namespaces_wp}}).ele("@wp","inline").att("distB","0").att("distL","0").att("distR","0").att("distT","0"),extentFragment=buildExtent({width:attributes.width,height:attributes.height});inlineDrawingFragment.import(extentFragment);const effectExtentFragment=buildEffectExtentFragment();inlineDrawingFragment.import(effectExtentFragment);const drawingObjectNonVisualPropertiesFragment=buildDrawingObjectNonVisualProperties(attributes.id,attributes.fileNameWithExtension);inlineDrawingFragment.import(drawingObjectNonVisualPropertiesFragment);const graphicFragment=buildGraphic(graphicType,attributes);return inlineDrawingFragment.import(graphicFragment),inlineDrawingFragment.up(),inlineDrawingFragment})(graphicType,attributes):buildAnchoredDrawing(graphicType,attributes);return drawingFragment.import(inlineOrAnchoredDrawingFragment),drawingFragment.up(),drawingFragment},convertHTML$1=HTMLToVDOM({VNode:vnode,VText:vtext}),buildImage=(docxDocumentInstance,vNode,maximumWidth=null)=>{let response=null;try{response=docxDocumentInstance.createMediaFile(decodeURIComponent(vNode.properties.src))}catch(error){}if(response){docxDocumentInstance.zip.folder("word").folder("media").file(response.fileNameWithExtension,Buffer.from(response.fileContent,"base64"),{createFolders:!1});const documentRelsId=docxDocumentInstance.createDocumentRelationships(docxDocumentInstance.relationshipFilename,"image",`media/${response.fileNameWithExtension}`,"Internal"),imageBuffer=Buffer.from(response.fileContent,"base64"),imageProperties=sizeOf(imageBuffer);return buildParagraph(vNode,{type:"picture",inlineOrAnchored:!0,relationshipId:documentRelsId,...response,maximumWidth:maximumWidth||docxDocumentInstance.availableDocumentSpace,originalWidth:imageProperties.width,originalHeight:imageProperties.height},docxDocumentInstance)}},buildList=(vNode,docxDocumentInstance,xmlFragment)=>{let vNodeObjects=[{node:vNode,level:0,type:vNode.tagName,numberingId:docxDocumentInstance.createNumbering(vNode.tagName,vNode.properties)}];for(;vNodeObjects.length;){const tempVNodeObject=vNodeObjects.shift();if(isVtext(tempVNodeObject.node)||isVnode(tempVNodeObject.node)&&!["ul","ol","li"].includes(tempVNodeObject.node.tagName)){const paragraphFragment=buildParagraph(tempVNodeObject.node,{numbering:{levelId:tempVNodeObject.level,numberingId:tempVNodeObject.numberingId}},docxDocumentInstance);xmlFragment.import(paragraphFragment)}if(tempVNodeObject.node.children&&tempVNodeObject.node.children.length&&["ul","ol","li"].includes(tempVNodeObject.node.tagName)){vNodeObjects=tempVNodeObject.node.children.reduce(((accumulator,childVNode)=>{if(["ul","ol"].includes(childVNode.tagName))accumulator.push({node:childVNode,level:tempVNodeObject.level+1,type:childVNode.tagName,numberingId:docxDocumentInstance.createNumbering(childVNode.tagName,childVNode.properties)});else if(accumulator.length>0&&isVnode(accumulator[accumulator.length-1].node)&&"p"===accumulator[accumulator.length-1].node.tagName.toLowerCase())accumulator[accumulator.length-1].node.children.push(childVNode);else{const paragraphVNode=new vnode("p",null,isVtext(childVNode)?[childVNode]:isVnode(childVNode)?"li"===childVNode.tagName.toLowerCase()?[...childVNode.children]:[childVNode]:[]);accumulator.push({node:isVnode(childVNode)?"li"===childVNode.tagName.toLowerCase()?childVNode:"p"!==childVNode.tagName.toLowerCase()?paragraphVNode:childVNode:paragraphVNode,level:tempVNodeObject.level,type:tempVNodeObject.type,numberingId:tempVNodeObject.numberingId})}return accumulator}),[]).concat(vNodeObjects)}}return[]};function convertVTreeToXML(docxDocumentInstance,vTree,xmlFragment){if(!vTree)return"";if(Array.isArray(vTree)&&vTree.length)for(let index=0;index<vTree.length;index++){convertVTreeToXML(docxDocumentInstance,vTree[index],xmlFragment)}else isVnode(vTree)?function(docxDocumentInstance,vNode,xmlFragment){if("div"===vNode.tagName&&("page-break"===vNode.properties.attributes.class||vNode.properties.style&&vNode.properties.style["page-break-after"])){const paragraphFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","p").ele("@w","r").ele("@w","br").att("@w","type","page").up().up().up();xmlFragment.import(paragraphFragment)}else{switch(vNode.tagName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":const headingFragment=buildParagraph(vNode,{paragraphStyle:`Heading${vNode.tagName[1]}`},docxDocumentInstance);return void xmlFragment.import(headingFragment);case"span":case"strong":case"b":case"em":case"i":case"u":case"ins":case"strike":case"del":case"s":case"sub":case"sup":case"mark":case"p":case"a":case"blockquote":case"code":case"pre":const paragraphFragment=buildParagraph(vNode,{},docxDocumentInstance);return void xmlFragment.import(paragraphFragment);case"figure":if(vNodeHasChildren(vNode))for(let index=0;index<vNode.children.length;index++){const childVNode=vNode.children[index];if("table"===childVNode.tagName){const tableFragment=buildTable(childVNode,{maximumWidth:docxDocumentInstance.availableDocumentSpace,rowCantSplit:docxDocumentInstance.tableRowCantSplit},docxDocumentInstance);xmlFragment.import(tableFragment);const emptyParagraphFragment=buildParagraph(null,{});xmlFragment.import(emptyParagraphFragment)}else if("img"===childVNode.tagName){const imageFragment=buildImage(docxDocumentInstance,childVNode);imageFragment&&xmlFragment.import(imageFragment)}}return;case"table":const tableFragment=buildTable(vNode,{maximumWidth:docxDocumentInstance.availableDocumentSpace,rowCantSplit:docxDocumentInstance.tableRowCantSplit},docxDocumentInstance);xmlFragment.import(tableFragment);const emptyParagraphFragment=buildParagraph(null,{});return void xmlFragment.import(emptyParagraphFragment);case"ol":case"ul":return void buildList(vNode,docxDocumentInstance,xmlFragment);case"img":const imageFragment=buildImage(docxDocumentInstance,vNode);return void(imageFragment&&xmlFragment.import(imageFragment));case"br":const linebreakFragment=buildParagraph(null,{});return void xmlFragment.import(linebreakFragment)}if(vNodeHasChildren(vNode))for(let index=0;index<vNode.children.length;index++)convertVTreeToXML(docxDocumentInstance,vNode.children[index],xmlFragment)}}(docxDocumentInstance,vTree,xmlFragment):isVtext(vTree)&&buildTextElement(xmlFragment,escape(String(vTree.text)));return xmlFragment}function generateContentTypesFragments(contentTypesXML,type,objects){objects&&Array.isArray(objects)&&objects.forEach((object=>{const contentTypesFragment=fragment({defaultNamespace:{ele:namespaces_contentTypes}}).ele("Override").att("PartName",`/word/${type}${object[`${type}Id`]}.xml`).att("ContentType",`application/vnd.openxmlformats-officedocument.wordprocessingml.${type}+xml`).up();contentTypesXML.root().import(contentTypesFragment)}))}function generateSectionReferenceXML(documentXML,documentSectionType,objects,isEnabled){if(isEnabled&&objects&&Array.isArray(objects)&&objects.length){const xmlFragment=fragment();objects.forEach((({relationshipId:relationshipId,type:type})=>{const objectFragment=fragment({namespaceAlias:{w:namespaces_w,r:namespaces_r}}).ele("@w",`${documentSectionType}Reference`).att("@r","id",`rId${relationshipId}`).att("@w","type",type).up();xmlFragment.import(objectFragment)})),documentXML.root().first().first().import(xmlFragment)}}function generateXMLString(xmlString){return create({encoding:"UTF-8",standalone:!0},xmlString).toString({prettyPrint:!0})}function generateSectionXML(vTree,type="header"){const sectionXML=create({encoding:"UTF-8",standalone:!0,namespaceAlias:{w:namespaces_w,ve:namespaces_ve,o:namespaces_o,r:namespaces_r,v:namespaces_v,wp:namespaces_wp,w10:namespaces_w10}}).ele("@w","header"===type?"hdr":"ftr"),XMLFragment=fragment();convertVTreeToXML(this,vTree,XMLFragment),"footer"===type&&"p"===XMLFragment.first().node.tagName&&this.pageNumber&&XMLFragment.first().import(fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","fldSimple").att("@w","instr","PAGE").ele("@w","r").up().up()),sectionXML.root().import(XMLFragment);const referenceName="header"===type?"Header":"Footer";return this[`last${referenceName}Id`]+=1,{[`${type}Id`]:this[`last${referenceName}Id`],[`${type}XML`]:sectionXML}}class DocxDocument{constructor(properties){this.zip=properties.zip,this.htmlString=properties.htmlString,this.orientation=properties.orientation;const isPortraitOrientation="portrait"===this.orientation;this.width=isPortraitOrientation?12240:15840,this.height=isPortraitOrientation?15840:12240;const marginsObject=properties.margins;this.margins=marginsObject&&Object.keys(marginsObject).length?marginsObject:isPortraitOrientation?portraitMargins:landscapeMargins,this.availableDocumentSpace=this.width-this.margins.left-this.margins.right,this.title=properties.title||"",this.subject=properties.subject||"",this.creator=properties.creator||"html-to-docx",this.keywords=properties.keywords||["html-to-docx"],this.description=properties.description||"",this.lastModifiedBy=properties.lastModifiedBy||"html-to-docx",this.revision=properties.revision||1,this.createdAt=properties.createdAt||new Date,this.modifiedAt=properties.modifiedAt||new Date,this.headerType=properties.headerType||"default",this.header=properties.header||!1,this.footerType=properties.footerType||"default",this.footer=properties.footer||!1,this.font=properties.font||"Times New Roman",this.fontSize=properties.fontSize||22,this.complexScriptFontSize=properties.complexScriptFontSize||22,this.tableRowCantSplit=properties.table&&properties.table.row&&properties.table.row.cantSplit||!1,this.pageNumber=properties.pageNumber||!1,this.skipFirstHeaderFooter=properties.skipFirstHeaderFooter||!1,this.lineNumber=properties.lineNumber?properties.lineNumberOptions:null,this.lastNumberingId=0,this.lastMediaId=0,this.lastHeaderId=0,this.lastFooterId=0,this.stylesObjects=[],this.numberingObjects=[],this.relationshipFilename="document",this.relationships=[{fileName:"document",lastRelsId:4,rels:[]}],this.mediaFiles=[],this.headerObjects=[],this.footerObjects=[],this.documentXML=null,this.generateContentTypesXML=this.generateContentTypesXML.bind(this),this.generateDocumentXML=this.generateDocumentXML.bind(this),this.generateCoreXML=this.generateCoreXML.bind(this),this.generateSettingsXML=this.generateSettingsXML.bind(this),this.generateWebSettingsXML=this.generateWebSettingsXML.bind(this),this.generateStylesXML=this.generateStylesXML.bind(this),this.generateFontTableXML=this.generateFontTableXML.bind(this),this.generateThemeXML=this.generateThemeXML.bind(this),this.generateNumberingXML=this.generateNumberingXML.bind(this),this.generateRelsXML=this.generateRelsXML.bind(this),this.createMediaFile=this.createMediaFile.bind(this),this.createDocumentRelationships=this.createDocumentRelationships.bind(this),this.generateHeaderXML=this.generateHeaderXML.bind(this),this.generateFooterXML=this.generateFooterXML.bind(this),this.generateSectionXML=generateSectionXML.bind(this)}generateContentTypesXML(){const contentTypesXML$1=create({encoding:"UTF-8",standalone:!0},'\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">\n <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />\n <Default Extension="jpeg" ContentType="image/jpeg"/>\n <Default Extension="png" ContentType="image/png"/>\n <Default Extension="xml" ContentType="application/xml"/>\n <Override PartName="/_rels/.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>\n <Override PartName="/word/_rels/document.xml.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>\n <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>\n <Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>\n <Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>\n <Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>\n <Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/>\n <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>\n <Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/>\n <Override PartName="/word/webSettings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"/>\n </Types>\n');return generateContentTypesFragments(contentTypesXML$1,"header",this.headerObjects),generateContentTypesFragments(contentTypesXML$1,"footer",this.footerObjects),contentTypesXML$1.toString({prettyPrint:!0})}generateDocumentXML(){const documentXML=create({encoding:"UTF-8",standalone:!0},(width=this.width,height=this.height,orientation=this.orientation,margins=this.margins,`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <w:document\n xmlns:a="${namespaces_a}"\n xmlns:cdr="${namespaces_cdr}"\n xmlns:o="${namespaces_o}"\n xmlns:pic="${namespaces_pic}"\n xmlns:r="${namespaces_r}"\n xmlns:v="${namespaces_v}"\n xmlns:ve="${namespaces_ve}"\n xmlns:vt="${namespaces_vt}"\n xmlns:w="${namespaces_w}"\n xmlns:w10="${namespaces_w10}"\n xmlns:wp="${namespaces_wp}"\n xmlns:wne="${namespaces_wne}"\n >\n <w:body>\n <w:sectPr>\n <w:pgSz w:w="${width}" w:h="${height}" w:orient="${orientation}" />\n <w:pgMar w:top="${margins.top}"\n w:right="${margins.right}"\n w:bottom="${margins.bottom}"\n w:left="${margins.left}"\n w:header="${margins.header}"\n w:footer="${margins.footer}"\n w:gutter="${margins.gutter}"/>\n </w:sectPr>\n </w:body>\n </w:document>\n `));var width,height,orientation,margins;if(documentXML.root().first().import(this.documentXML),generateSectionReferenceXML(documentXML,"header",this.headerObjects,this.header),generateSectionReferenceXML(documentXML,"footer",this.footerObjects,this.footer),(this.header||this.footer)&&this.skipFirstHeaderFooter&&documentXML.root().first().first().import(fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","titlePg")),this.lineNumber){const{countBy:countBy,start:start,restart:restart}=this.lineNumber;documentXML.root().first().first().import(fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","lnNumType").att("@w","countBy",countBy).att("@w","start",start).att("@w","restart",restart))}return documentXML.toString({prettyPrint:!0})}generateCoreXML(){return generateXMLString(((title="",subject="",creator="html-to-docx",keywords=["html-to-docx"],description="",lastModifiedBy="html-to-docx",revision=1,createdAt=new Date,modifiedAt=new Date)=>`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <cp:coreProperties\n xmlns:cp="${namespaces_coreProperties}"\n xmlns:dc="${namespaces_dc}"\n xmlns:dcterms="${namespaces_dcterms}"\n xmlns:dcmitype="${namespaces_dcmitype}"\n xmlns:xsi="${namespaces_xsi}"\n >\n <dc:title>${title}</dc:title>\n <dc:subject>${subject}</dc:subject>\n <dc:creator>${creator}</dc:creator>\n ${keywords&&Array.isArray(keywords)?`<cp:keywords>${keywords.join(", ")}</cp:keywords>`:""}\n <dc:description>${description}</dc:description>\n <cp:lastModifiedBy>${lastModifiedBy}</cp:lastModifiedBy>\n <cp:revision>${revision}</cp:revision>\n <dcterms:created xsi:type="dcterms:W3CDTF">${createdAt instanceof Date?createdAt.toISOString():(new Date).toISOString()}</dcterms:created>\n <dcterms:modified xsi:type="dcterms:W3CDTF">${modifiedAt instanceof Date?modifiedAt.toISOString():(new Date).toISOString()}</dcterms:modified>\n </cp:coreProperties>\n `)(this.title,this.subject,this.creator,this.keywords,this.description,this.lastModifiedBy,this.revision,this.createdAt,this.modifiedAt))}generateSettingsXML(){return generateXMLString(settingsXML)}generateWebSettingsXML(){return generateXMLString(webSettingsXML)}generateStylesXML(){return generateXMLString(((font="Times New Roman",fontSize=22,complexScriptFontSize=22)=>`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <w:styles xmlns:w="${namespaces_w}" xmlns:r="${namespaces_r}">\n\t<w:docDefaults>\n\t <w:rPrDefault>\n\t\t<w:rPr>\n\t\t <w:rFonts w:ascii="${font}" w:eastAsiaTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi" w:cstheme="minorBidi" />\n\t\t <w:sz w:val="${fontSize}" />\n\t\t <w:szCs w:val="${complexScriptFontSize}" />\n\t\t <w:lang w:val="en-US" w:eastAsia="en-US" w:bidi="ar-SA" />\n\t\t</w:rPr>\n\t </w:rPrDefault>\n\t <w:pPrDefault>\n\t\t<w:pPr>\n\t\t <w:spacing w:after="120" w:line="240" w:lineRule="atLeast" />\n\t\t</w:pPr>\n\t </w:pPrDefault>\n\t</w:docDefaults>\n\t<w:style w:type="character" w:styleId="Hyperlink">\n\t <w:name w:val="Hyperlink" />\n\t <w:rPr>\n\t\t<w:color w:val="0000FF" />\n\t\t<w:u w:val="single" />\n\t </w:rPr>\n\t</w:style>\n\t<w:style w:type="paragraph" w:styleId="Heading1">\n\t <w:name w:val="heading 1" />\n\t <w:basedOn w:val="Normal" />\n\t <w:next w:val="Normal" />\n\t <w:uiPriority w:val="9" />\n\t <w:qFormat />\n\t <w:pPr>\n\t\t<w:keepNext />\n\t\t<w:keepLines />\n\t\t<w:spacing w:before="480" />\n\t\t<w:outlineLvl w:val="0" />\n\t </w:pPr>\n\t <w:rPr>\n\t\t<w:b />\n\t\t<w:sz w:val="48" />\n\t\t<w:szCs w:val="48" />\n\t </w:rPr>\n\t</w:style>\n\t<w:style w:type="paragraph" w:styleId="Heading2">\n\t <w:name w:val="heading 2" />\n\t <w:basedOn w:val="Normal" />\n\t <w:next w:val="Normal" />\n\t <w:uiPriority w:val="9" />\n\t <w:unhideWhenUsed />\n\t <w:qFormat />\n\t <w:pPr>\n\t\t<w:keepNext />\n\t\t<w:keepLines />\n\t\t<w:spacing w:before="360" w:after="80" />\n\t\t<w:outlineLvl w:val="1" />\n\t </w:pPr>\n\t <w:rPr>\n\t\t<w:b />\n\t\t<w:sz w:val="36" />\n\t\t<w:szCs w:val="36" />\n\t </w:rPr>\n\t</w:style>\n\t<w:style w:type="paragraph" w:styleId="Heading3">\n\t <w:name w:val="heading 3" />\n\t <w:basedOn w:val="Normal" />\n\t <w:next w:val="Normal" />\n\t <w:uiPriority w:val="9" />\n\t <w:semiHidden />\n\t <w:unhideWhenUsed />\n\t <w:qFormat />\n\t <w:pPr>\n\t\t<w:keepNext />\n\t\t<w:keepLines />\n\t\t<w:spacing w:before="280" w:after="80" />\n\t\t<w:outlineLvl w:val="2" />\n\t </w:pPr>\n\t <w:rPr>\n\t\t<w:b />\n\t\t<w:sz w:val="28" />\n\t\t<w:szCs w:val="28" />\n\t </w:rPr>\n\t</w:style>\n\t<w:style w:type="paragraph" w:styleId="Heading4">\n\t <w:name w:val="heading 4" />\n\t <w:basedOn w:val="Normal" />\n\t <w:next w:val="Normal" />\n\t <w:uiPriority w:val="9" />\n\t <w:semiHidden />\n\t <w:unhideWhenUsed />\n\t <w:qFormat />\n\t <w:pPr>\n\t\t<w:keepNext />\n\t\t<w:keepLines />\n\t\t<w:spacing w:before="240" w:after="40" />\n\t\t<w:outlineLvl w:val="3" />\n\t </w:pPr>\n\t <w:rPr>\n\t\t<w:b />\n\t\t<w:sz w:val="24" />\n\t\t<w:szCs w:val="24" />\n\t </w:rPr>\n\t</w:style>\n\t<w:style w:type="paragraph" w:styleId="Heading5">\n\t <w:name w:val="heading 5" />\n\t <w:basedOn w:val="Normal" />\n\t <w:next w:val="Normal" />\n\t <w:uiPriority w:val="9" />\n\t <w:semiHidden />\n\t <w:unhideWhenUsed />\n\t <w:qFormat />\n\t <w:pPr>\n\t\t<w:keepNext />\n\t\t<w:keepLines />\n\t\t<w:spacing w:before="220" w:after="40" />\n\t\t<w:outlineLvl w:val="4" />\n\t </w:pPr>\n\t <w:rPr>\n\t\t<w:b />\n\t </w:rPr>\n\t</w:style>\n\t<w:style w:type="paragraph" w:styleId="Heading6">\n\t <w:name w:val="heading 6" />\n\t <w:basedOn w:val="Normal" />\n\t <w:next w:val="Normal" />\n\t <w:uiPriority w:val="9" />\n\t <w:semiHidden />\n\t <w:unhideWhenUsed />\n\t <w:qFormat />\n\t <w:pPr>\n\t\t<w:keepNext />\n\t\t<w:keepLines />\n\t\t<w:spacing w:before="200" w:after="40" />\n\t\t<w:outlineLvl w:val="5" />\n\t </w:pPr>\n\t <w:rPr>\n\t\t<w:b />\n\t\t<w:sz w:val="20" />\n\t\t<w:szCs w:val="20" />\n\t </w:rPr>\n\t</w:style>\n </w:styles>\n `)(this.font,this.fontSize,this.complexScriptFontSize))}generateFontTableXML(){return generateXMLString(fontTableXML)}generateThemeXML(){return generateXMLString(((font="Times New Roman")=>`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">\n <a:themeElements>\n <a:clrScheme name="Office">\n <a:dk1>\n <a:sysClr val="windowText" lastClr="000000"/>\n </a:dk1>\n <a:lt1>\n <a:sysClr val="window" lastClr="FFFFFF"/>\n </a:lt1>\n <a:dk2>\n <a:srgbClr val="44546A"/>\n </a:dk2>\n <a:lt2>\n <a:srgbClr val="E7E6E6"/>\n </a:lt2>\n <a:accent1>\n <a:srgbClr val="4472C4"/>\n </a:accent1>\n <a:accent2>\n <a:srgbClr val="ED7D31"/>\n </a:accent2>\n <a:accent3>\n <a:srgbClr val="A5A5A5"/>\n </a:accent3>\n <a:accent4>\n <a:srgbClr val="FFC000"/>\n </a:accent4>\n <a:accent5>\n <a:srgbClr val="5B9BD5"/>\n </a:accent5>\n <a:accent6>\n <a:srgbClr val="70AD47"/>\n </a:accent6>\n <a:hlink>\n <a:srgbClr val="0563C1"/>\n </a:hlink>\n <a:folHlink>\n <a:srgbClr val="954F72"/>\n </a:folHlink>\n </a:clrScheme>\n <a:fontScheme name="Office">\n <a:majorFont>\n <a:latin typeface="${font}"/>\n <a:ea typeface="${font}"/>\n <a:cs typeface=""/>\n </a:majorFont>\n <a:minorFont>\n <a:latin typeface="${font}"/>\n <a:ea typeface="${font}"/>\n <a:cs typeface=""/>\n </a:minorFont>\n </a:fontScheme>\n <a:fmtScheme name="Office">\n <a:fillStyleLst>\n <a:solidFill>\n <a:schemeClr val="phClr"/>\n </a:solidFill>\n <a:gradFill rotWithShape="1">\n <a:gsLst>\n <a:gs pos="0">\n <a:schemeClr val="phClr">\n <a:lumMod val="110000"/>\n <a:satMod val="105000"/>\n <a:tint val="67000"/>\n </a:schemeClr>\n </a:gs>\n <a:gs pos="50000">\n <a:schemeClr val="phClr">\n <a:lumMod val="105000"/>\n <a:satMod val="103000"/>\n <a:tint val="73000"/>\n </a:schemeClr>\n </a:gs>\n <a:gs pos="100000">\n <a:schemeClr val="phClr">\n <a:lumMod val="105000"/>\n <a:satMod val="109000"/>\n <a:tint val="81000"/>\n </a:schemeClr>\n </a:gs>\n </a:gsLst>\n <a:lin ang="5400000" scaled="0"/>\n </a:gradFill>\n <a:gradFill rotWithShape="1">\n <a:gsLst>\n <a:gs pos="0">\n <a:schemeClr val="phClr">\n <a:satMod val="103000"/>\n <a:lumMod val="102000"/>\n <a:tint val="94000"/>\n </a:schemeClr>\n </a:gs>\n <a:gs pos="50000">\n <a:schemeClr val="phClr">\n <a:satMod val="110000"/>\n <a:lumMod val="100000"/>\n <a:shade val="100000"/>\n </a:schemeClr>\n </a:gs>\n <a:gs pos="100000">\n <a:schemeClr val="phClr">\n <a:lumMod val="99000"/>\n <a:satMod val="120000"/>\n <a:shade val="78000"/>\n </a:schemeClr>\n </a:gs>\n </a:gsLst>\n <a:lin ang="5400000" scaled="0"/>\n </a:gradFill>\n </a:fillStyleLst>\n <a:lnStyleLst>\n <a:ln w="6350" cap="flat" cmpd="sng" algn="ctr">\n <a:solidFill>\n <a:schemeClr val="phClr"/>\n </a:solidFill>\n <a:prstDash val="solid"/>\n <a:miter lim="800000"/>\n </a:ln>\n <a:ln w="12700" cap="flat" cmpd="sng" algn="ctr">\n <a:solidFill>\n <a:schemeClr val="phClr"/>\n </a:solidFill>\n <a:prstDash val="solid"/>\n <a:miter lim="800000"/>\n </a:ln>\n <a:ln w="19050" cap="flat" cmpd="sng" algn="ctr">\n <a:solidFill>\n <a:schemeClr val="phClr"/>\n </a:solidFill>\n <a:prstDash val="solid"/>\n <a:miter lim="800000"/>\n </a:ln>\n </a:lnStyleLst>\n <a:effectStyleLst>\n <a:effectStyle>\n <a:effectLst/>\n </a:effectStyle>\n <a:effectStyle>\n <a:effectLst/>\n </a:effectStyle>\n <a:effectStyle>\n <a:effectLst>\n <a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0">\n <a:srgbClr val="000000">\n <a:alpha val="63000"/>\n </a:srgbClr>\n </a:outerShdw>\n </a:effectLst>\n </a:effectStyle>\n </a:effectStyleLst>\n <a:bgFillStyleLst>\n <a:solidFill>\n <a:schemeClr val="phClr"/>\n </a:solidFill>\n <a:solidFill>\n <a:schemeClr val="phClr">\n <a:tint val="95000"/>\n <a:satMod val="170000"/>\n </a:schemeClr>\n </a:solidFill>\n <a:gradFill rotWithShape="1">\n <a:gsLst>\n <a:gs pos="0">\n <a:schemeClr val="phClr">\n <a:tint val="93000"/>\n <a:satMod val="150000"/>\n <a:shade val="98000"/>\n <a:lumMod val="102000"/>\n </a:schemeClr>\n </a:gs>\n <a:gs pos="50000">\n <a:schemeClr val="phClr">\n <a:tint val="98000"/>\n <a:satMod val="130000"/>\n <a:shade val="90000"/>\n <a:lumMod val="103000"/>\n </a:schemeClr>\n </a:gs>\n <a:gs pos="100000">\n <a:schemeClr val="phClr">\n <a:shade val="63000"/>\n <a:satMod val="120000"/>\n </a:schemeClr>\n </a:gs>\n </a:gsLst>\n <a:lin ang="5400000" scaled="0"/>\n </a:gradFill>\n </a:bgFillStyleLst>\n </a:fmtScheme>\n </a:themeElements>\n </a:theme>\n`)(this.font))}generateNumberingXML(){const numberingXML=create({encoding:"UTF-8",standalone:!0},`\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <w:numbering\n xmlns:w="${namespaces_w}"\n xmlns:ve="${namespaces_ve}"\n xmlns:o="${namespaces_o}"\n xmlns:r="${namespaces_r}"\n xmlns:v="${namespaces_v}"\n xmlns:wp="${namespaces_wp}"\n xmlns:w10="${namespaces_w10}"\n xmlns:wne="${namespaces_wne}">\n </w:numbering>\n `),abstractNumberingFragments=fragment(),numberingFragments=fragment();return this.numberingObjects.forEach((({numberingId:numberingId,type:type,properties:properties})=>{const abstractNumberingFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","abstractNum").att("@w","abstractNumId",String(numberingId));[...Array(8).keys()].forEach((level=>{const levelFragment=fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","lvl").att("@w","ilvl",level).ele("@w","start").att("@w","val","ol"===type?properties.attributes&&properties.attributes["data-start"]||1:"1").up().ele("@w","numFmt").att("@w","val","ol"===type?(listType=>{switch(listType){case"upper-roman":return"upperRoman";case"lower-roman":return"lowerRoman";case"upper-alpha":case"upper-alpha-bracket-end":return"upperLetter";case"lower-alpha":case"lower-alpha-bracket-end":return"lowerLetter";default:return"decimal"}})(properties.style&&properties.style["list-style-type"]):"bullet").up().ele("@w","lvlText").att("@w","val","ol"===type?((style,lvl)=>{if(!style)return`%${lvl+1}`;switch(style["list-style-type"]){case"upper-roman":case"lower-roman":case"upper-alpha":case"lower-alpha":case"decimal":default:return`%${lvl+1}.`;case"upper-alpha-bracket-end":case"lower-alpha-bracket-end":case"decimal-bracket-end":return`%${lvl+1})`;case"decimal-bracket":return`(%${lvl+1})`}})(properties.style,level):"").up().ele("@w","lvlJc").att("@w","val","left").up().ele("@w","pPr").ele("@w","tabs").ele("@w","tab").att("@w","val","num").att("@w","pos",720*(level+1)).up().up().ele("@w","ind").att("@w","left",720*(level+1)).att("@w","hanging",360).up().up().up();"ul"===type&&levelFragment.last().import(fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","rPr").ele("@w","rFonts").att("@w","ascii","Wingdings").att("@w","hAnsi","Wingdings").att("@w","hint","default").up().up()),abstractNumberingFragment.import(levelFragment)})),abstractNumberingFragment.up(),abstractNumberingFragments.import(abstractNumberingFragment),numberingFragments.import(fragment({namespaceAlias:{w:namespaces_w}}).ele("@w","num").att("@w","numId",String(numberingId)).ele("@w","abstractNumId").att("@w","val",String(numberingId)).up().up())})),numberingXML.root().import(abstractNumberingFragments),numberingXML.root().import(numberingFragments),numberingXML.toString({prettyPrint:!0})}appendRelationships(xmlFragment,relationships){relationships.forEach((({relationshipId:relationshipId,type:type,target:target,targetMode:targetMode})=>{xmlFragment.import(fragment({defaultNamespace:{ele:namespaces_relationship}}).ele("Relationship").att("Id",`rId${relationshipId}`).att("Type",type).att("Target",target).att("TargetMode",targetMode).up())}))}generateRelsXML(){return this.relationships.map((({fileName:fileName,rels:rels})=>{const xmlFragment=create({encoding:"UTF-8",standalone:!0},"document"===fileName?documentRelsXML:'\n <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n\n <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n </Relationships>\n');return this.appendRelationships(xmlFragment.root(),rels),{fileName:fileName,xmlString:xmlFragment.toString({prettyPrint:!0})}}))}createNumbering(type,properties){return this.lastNumberingId+=1,this.numberingObjects.push({numberingId:this.lastNumberingId,type:type,properties:properties}),this.lastNumberingId}createMediaFile(base64String){const matches=base64String.match(/^data:([A-Za-z-+\/]+);base64,(.+)$/);if(3!==matches.length)throw new Error("Invalid base64 string");const base64FileContent=matches[2],fileExtension="octet-stream"===matches[1].match(/\/(.*?)$/)[1]?"png":matches[1].match(/\/(.*?)$/)[1],fileNameWithExtension=`image-${nanoid()}.${fileExtension}`;return this.lastMediaId+=1,{id:this.lastMediaId,fileContent:base64FileContent,fileNameWithExtension:fileNameWithExtension}}createDocumentRelationships(fileName="document",type,target,targetMode="External"){let relationshipType,relationshipObject=this.relationships.find((relationship=>relationship.fileName===fileName)),lastRelsId=1;switch(relationshipObject?(lastRelsId=relationshipObject.lastRelsId+1,relationshipObject.lastRelsId=lastRelsId):(relationshipObject={fileName:fileName,lastRelsId:lastRelsId,rels:[]},this.relationships.push(relationshipObject)),type){case"hyperlink":relationshipType=namespaces_hyperlinks;break;case"image":relationshipType=namespaces_images;break;case"header":relationshipType=namespaces_headers;break;case"footer":relationshipType=namespaces_footers;break;case"theme":relationshipType=namespaces_themes}return relationshipObject.rels.push({relationshipId:lastRelsId,type:relationshipType,target:target,targetMode:targetMode}),lastRelsId}generateHeaderXML(vTree){return this.generateSectionXML(vTree,"header")}generateFooterXML(vTree){return this.generateSectionXML(vTree,"footer")}}const convertHTML=HTMLToVDOM({VNode:vnode,VText:vtext}),fixupMargins=margins=>{let normalizedMargins={};return"object"==typeof margins&&null!==margins?Object.keys(margins).forEach((key=>{if(pixelRegex.test(margins[key])){const matchedParts=margins[key].match(pixelRegex);normalizedMargins[key]=pixelToTWIP(matchedParts[1])}else if(cmRegex.test(margins[key])){const matchedParts=margins[key].match(cmRegex);normalizedMargins[key]=(cmValue=matchedParts[1],inchToTWIP((cmValue=>.3937008*cmValue)(cmValue)))}else if(inchRegex.test(margins[key])){const matchedParts=margins[key].match(inchRegex);normalizedMargins[key]=inchToTWIP(matchedParts[1])}else margins[key]?normalizedMargins[key]=margins[key]:normalizedMargins[key]=defaultDocumentOptions.margins[key];var cmValue})):normalizedMargins=null,normalizedMargins},normalizeDocumentOptions=documentOptions=>{const normalizedDocumentOptions={...documentOptions};return Object.keys(documentOptions).forEach((key=>{switch(key){case"margins":normalizedDocumentOptions.margins=fixupMargins(documentOptions[key]);break;case"fontSize":case"complexScriptFontSize":normalizedDocumentOptions[key]=(fontSize=>{let normalizedFontSize;if(pointRegex.test(fontSize)){const matchedParts=fontSize.match(pointRegex);normalizedFontSize=pointToHIP(matchedParts[1])}else normalizedFontSize=fontSize||null;return normalizedFontSize})(documentOptions[key])}})),normalizedDocumentOptions};function addFilesToContainer(zip,htmlString,suppliedDocumentOptions,headerHTMLString,footerHTMLString){const normalizedDocumentOptions=normalizeDocumentOptions(suppliedDocumentOptions),documentOptions=(options=defaultDocumentOptions,patch=normalizedDocumentOptions,{...options,...patch});var options,patch;documentOptions.header&&!headerHTMLString&&(headerHTMLString="<p></p>"),documentOptions.footer&&!footerHTMLString&&(footerHTMLString="<p></p>");const docxDocument=new DocxDocument({zip:zip,htmlString:htmlString,...documentOptions});var docxDocumentInstance;if(docxDocument.documentXML=convertVTreeToXML(docxDocumentInstance=docxDocument,convertHTML$1(docxDocumentInstance.htmlString),fragment({namespaceAlias:{w:namespaces_w}})),zip.folder("_rels").file(".rels",create({encoding:"UTF-8",standalone:!0},relsXML).toString({prettyPrint:!0}),{createFolders:!1}),zip.folder("docProps").file("core.xml",docxDocument.generateCoreXML(),{createFolders:!1}),docxDocument.header&&headerHTMLString){const vTree=convertHTML(headerHTMLString);docxDocument.relationshipFilename="header1";const{headerId:headerId,headerXML:headerXML}=docxDocument.generateHeaderXML(vTree);docxDocument.relationshipFilename="document";const fileNameWithExt=`header${headerId}.xml`,relationshipId=docxDocument.createDocumentRelationships(docxDocument.relationshipFilename,"header",fileNameWithExt,"Internal");zip.folder("word").file(fileNameWithExt,headerXML.toString({prettyPrint:!0}),{createFolders:!1}),docxDocument.headerObjects.push({headerId:headerId,relationshipId:relationshipId,type:docxDocument.headerType})}if(docxDocument.footer&&footerHTMLString){const vTree=convertHTML(footerHTMLString);docxDocument.relationshipFilename="footer1";const{footerId:footerId,footerXML:footerXML}=docxDocument.generateFooterXML(vTree);docxDocument.relationshipFilename="document";const fileNameWithExt=`footer${footerId}.xml`,relationshipId=docxDocument.createDocumentRelationships(docxDocument.relationshipFilename,"footer",fileNameWithExt,"Internal");zip.folder("word").file(fileNameWithExt,footerXML.toString({prettyPrint:!0}),{createFolders:!1}),docxDocument.footerObjects.push({footerId:footerId,relationshipId:relationshipId,type:docxDocument.footerType})}docxDocument.createDocumentRelationships(docxDocument.relationshipFilename,"theme","theme/theme1.xml","Internal"),zip.folder("word").folder("theme").file("theme1.xml",docxDocument.generateThemeXML(),{createFolders:!1}),zip.folder("word").file("document.xml",docxDocument.generateDocumentXML(),{createFolders:!1}).file("fontTable.xml",docxDocument.generateFontTableXML(),{createFolders:!1}).file("styles.xml",docxDocument.generateStylesXML(),{createFolders:!1}).file("numbering.xml",docxDocument.generateNumberingXML(),{createFolders:!1}).file("settings.xml",docxDocument.generateSettingsXML(),{createFolders:!1}).file("webSettings.xml",docxDocument.generateWebSettingsXML(),{createFolders:!1});const relationshipXMLs=docxDocument.generateRelsXML();return relationshipXMLs&&Array.isArray(relationshipXMLs)&&relationshipXMLs.forEach((({fileName:fileName,xmlString:xmlString})=>{zip.folder("word").folder("_rels").file(`${fileName}.xml.rels`,xmlString,{createFolders:!1})})),zip.file("[Content_Types].xml",docxDocument.generateContentTypesXML(),{createFolders:!1}),zip}const minifyHTMLString=htmlString=>{try{if("string"==typeof htmlString||htmlString instanceof String){return htmlString.replace(/\n/g," ").replace(/\r/g," ").replace(/\r\n/g," ").replace(/[\t]+\</g,"<").replace(/\>[\t ]+\</g,"><").replace(/\>[\t ]+$/g,">")}throw new Error("invalid html string")}catch(error){return null}};async function generateContainer(htmlString,headerHTMLString,documentOptions={},footerHTMLString){const zip=new JSZip;let contentHTML=htmlString,headerHTML=headerHTMLString,footerHTML=footerHTMLString;htmlString&&(contentHTML=minifyHTMLString(contentHTML)),headerHTMLString&&(headerHTML=minifyHTMLString(headerHTML)),footerHTMLString&&(footerHTML=minifyHTMLString(footerHTML)),addFilesToContainer(zip,contentHTML,documentOptions,headerHTML,footerHTML);const buffer=await zip.generateAsync({type:"arraybuffer"});if(Object.prototype.hasOwnProperty.call(global,"Blob"))return new Blob([buffer],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"});if(Object.prototype.hasOwnProperty.call(global,"Buffer"))return Buffer.from(new Uint8Array(buffer));throw new Error("Add blob support using a polyfill eg https://github.com/bjornstar/blob-polyfill")}export{generateContainer as default};
//# sourceMappingURL=html-to-docx.esm.js.map

Back to list