function _AwaitValue(a){this.wrapped=a}function _AsyncGenerator(a){function t(a,t){return new Promise(function(r,d){var c={key:a,arg:t,resolve:r,reject:d,next:null};s?s=s.next=c:(b=s=c,e(a,t))})}function e(t,b){try{var s=a[t](b),d=s.value,c=d instanceof _AwaitValue;Promise.resolve(c?d.wrapped:d).then(function(a){if(c)return void e("next",a);r(s.done?"return":"normal",a)},function(a){e("throw",a)})}catch(a){r("throw",a)}}function r(a,t){switch(a){case"return":b.resolve({value:t,done:!0});break;case"throw":b.reject(t);break;default:b.resolve({value:t,done:!1})}(b=b.next)?e(b.key,b.arg):s=null}var b,s;this._invoke=t,"function"!=typeof a.return&&(this.return=void 0)}function _defineProperty(a,t,e){return t in a?Object.defineProperty(a,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[t]=e,a}function _objectSpread(a){for(var t=1;t-1}function listCacheSet(a,t){var e=this.__data__,r=_assocIndexOf(e,a);return r<0?(++this.size,e.push([a,t])):e[r][1]=t,this}function ListCache(a){var t=-1,e=null==a?0:a.length;for(this.clear();++t-1&&a%1==0&&a-1&&a%1==0&&a<=MAX_SAFE_INTEGER$1}function baseIsTypedArray(a){return isObjectLike_1(a)&&isLength_1(a.length)&&!!typedArrayTags[_baseGetTag(a)]}function baseUnary(a){return function(t){return a(t)}}function arrayLikeKeys(a,t){var e=isArray_1(a),r=!e&&isArguments_1(a),b=!e&&!r&&isBuffer_1(a),s=!e&&!r&&!b&&isTypedArray_1(a),d=e||r||b||s,c=d?_baseTimes(a.length,String):[],o=c.length;for(var n in a)!t&&!hasOwnProperty$5.call(a,n)||d&&("length"==n||b&&("offset"==n||"parent"==n)||s&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||_isIndex(n,o))||c.push(n);return c}function isPrototype(a){var t=a&&a.constructor;return a===("function"==typeof t&&t.prototype||objectProto$9)}function overArg(a,t){return function(e){return a(t(e))}}function baseKeys(a){if(!_isPrototype(a))return _nativeKeys(a);var t=[];for(var e in Object(a))hasOwnProperty$7.call(a,e)&&"constructor"!=e&&t.push(e);return t}function isArrayLike(a){return null!=a&&isLength_1(a.length)&&!isFunction_1(a)}function keys(a){return isArrayLike_1(a)?_arrayLikeKeys(a):_baseKeys(a)}function baseAssign(a,t){return a&&_copyObject(t,keys_1(t),a)}function nativeKeysIn(a){var t=[];if(null!=a)for(var e in Object(a))t.push(e);return t}function baseKeysIn(a){if(!isObject_1(a))return _nativeKeysIn(a);var t=_isPrototype(a),e=[];for(var r in a)("constructor"!=r||!t&&hasOwnProperty$8.call(a,r))&&e.push(r);return e}function keysIn$1(a){return isArrayLike_1(a)?_arrayLikeKeys(a,!0):_baseKeysIn(a)}function baseAssignIn(a,t){return a&&_copyObject(t,keysIn_1(t),a)}function copyArray(a,t){var e=-1,r=a.length;for(t||(t=Array(r));++e1&&void 0!==arguments[1]?arguments[1]:0}}function _toConsumableArray$1(a){if(Array.isArray(a)){for(var t=0,e=Array(a.length);t1&&void 0!==arguments[1]?arguments[1]:void 0;return isUndefined$1(t)&&(t=a),{a:a,c:0,e:0,b:0,d:t,f:0}}function toSVG(a){return toString$2(a)}function toString$2(a){return"matrix("+a.a+","+a.b+","+a.c+","+a.d+","+a.e+","+a.f+")"}function setCacheAdd(a){return this.__data__.set(a,HASH_UNDEFINED$2),this}function setCacheHas(a){return this.__data__.has(a)}function SetCache(a){var t=-1,e=null==a?0:a.length;for(this.__data__=new _MapCache;++tc))return!1;var n=s.get(a);if(n&&s.get(t))return n==t;var i=-1,f=!0,l=e&COMPARE_UNORDERED_FLAG$1?new _SetCache:void 0;for(s.set(a,t),s.set(t,a);++ir&&console.warn("sigil-js: margin cannot be larger than sigil size");var b=isNotMarginMode(e),s=b?.08*r:e,d=r-2*s,c=b||t>1?d/2:d,o={le:t,mm:b,tw:r,sw:c,rm:s,rp:c/128*2},n={1:[{x:dc(o),y:dc(o)}],2:[{x:d1(o),y:dc(o)},{x:d2(o),y:dc(o)}],4:[{x:d1(o),y:d1(o)},{x:d2(o),y:d1(o)},{x:d1(o),y:d2(o)},{x:d2(o),y:d2(o)}]};return _objectSpread({},o,{scale:o.sw/128,grid:n[t]})},isNotMarginMode=function(a){return"auto"===a||void 0===a},dc=function(a){var t=a.le,e=a.mm,r=a.tw,b=a.sw,s=a.rm;return t>1||!0===e?r-1.5*b-s:s},d1=function(a){a.tw,a.sw;return a.rm-a.rp/2},d2=function(a){return a.tw-a.sw-a.rm+a.rp/2},CW=[["#fff","#000000"]],prism=function(a,t){return t[0]},dyes=function(a,t,e){return isUndefined_1$1(e)?(e=isUndefined_1$1(t)?CW[0]:prism(t,CW),wash(a,e)):wash(a,e)},applyColor=function(a,t){return"FG"===a?t[0]:"BG"===a?t[1]:"TC"===a?t[2]:"NC"===a?"grey":last(t)},applyStyleAttrs=function(a,t){var e=a.fill;return{fill:applyColor(e,t)}},wash=function a(t,e){var r=get_1$1(t,["meta","style"],!1),b=get_1$1(t,"children",[]),s=get_1$1(t,"attr",{});return _objectSpread({},t,{attr:!1!==r?_objectSpread({},s,applyStyleAttrs(r,e)):_objectSpread({},s),children:b.map(function(t){return a(t,e)})})},HASH_UNDEFINED$2="__lodash_hash_undefined__",_setCacheAdd=setCacheAdd,_setCacheHas=setCacheHas;SetCache.prototype.add=SetCache.prototype.push=_setCacheAdd,SetCache.prototype.has=_setCacheHas;var _SetCache=SetCache,_arraySome=arraySome,_cacheHas=cacheHas,COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG$1=2,_equalArrays=equalArrays,_mapToArray=mapToArray,_setToArray=setToArray,COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$2=2,boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",mapTag$5="[object Map]",numberTag$3="[object Number]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$4="[object String]",symbolTag$3="[object Symbol]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",symbolProto$2=_Symbol?_Symbol.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0,_equalByTag=equalByTag,COMPARE_PARTIAL_FLAG$4=1,objectProto$14=Object.prototype,hasOwnProperty$11=objectProto$14.hasOwnProperty,_equalObjects=equalObjects,COMPARE_PARTIAL_FLAG$1=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$3="[object Object]",objectProto$13=Object.prototype,hasOwnProperty$10=objectProto$13.hasOwnProperty,_baseIsEqualDeep=baseIsEqualDeep,_baseIsEqual=baseIsEqual,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,_baseIsMatch=baseIsMatch,_isStrictComparable=isStrictComparable,_getMatchData=getMatchData,_matchesStrictComparable=matchesStrictComparable,_baseMatches=baseMatches,_baseHasIn=baseHasIn,_hasPath=hasPath,hasIn_1=hasIn,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2,_baseMatchesProperty=baseMatchesProperty,identity_1=identity$1,_baseProperty=baseProperty,_basePropertyDeep=basePropertyDeep,property_1=property,_baseIteratee=baseIteratee,_createBaseFor=createBaseFor,baseFor=_createBaseFor(),_baseFor=baseFor,_baseForOwn=baseForOwn,_createBaseEach=createBaseEach,baseEach=_createBaseEach(_baseForOwn),_baseEach=baseEach,_baseMap=baseMap,map_1=map,appendChildNodes=function(a,t){return map_1(get_1$1(a,"children",[]),function(a){return SVGComponents[a.tag](a)}).forEach(function(a){t.appendChild(a)}),t},createChildNode=function(a,t){var e=document.createElement(t);return Object.keys(a.attr).forEach(function(t){e.setAttribute(t,a.attr[t])}),appendChildNodes(a,e)},SVGComponents={svg:function(a){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("version","1.1"),t.setAttribute("xlmns","http://www.w3.org/2000/svg"),Object.keys(a.attr).forEach(function(e){t.setAttribute(e,a.attr[e])}),appendChildNodes(a,t)},circle:function(a){return createChildNode(a,"circle")},rect:function(a){return createChildNode(a,"rect")},path:function(a){return createChildNode(a,"path")},g:function(a){return createChildNode(a,"g")},polygon:function(a){return createChildNode(a,"polygon")},line:function(a){return createChildNode(a,"line")},polyline:function(a){return createChildNode(a,"polyline")}},p2s=function(a){if(void 0!==a)return Object.entries(a).reduce(function(a,t){var e=_slicedToArray(t,2),r=e[0],b=e[1];return"".concat(a).concat(c2k(r),"='").concat(b,"' ")},"")},c2k=function(a){return a.replace(/(^[A-Z])/,function(a){return _slicedToArray(a,1)[0].toLowerCase()}).replace(/([A-Z])/g,function(a){var t=_slicedToArray(a,1)[0];return"-".concat(t.toLowerCase())})},recurse=function(a){return get_1$1(a,"children",[]).reduce(function(a,t){return"".concat(a," ").concat(PlainSVGStringRenderer[t.tag](t))},"")},PlainSVGStringRenderer={svg:function(a){return"\n ").concat(recurse(a),"\n ")},circle:function(a){return"\n ").concat(recurse(a),"\n ")},rect:function(a){return"\n ").concat(recurse(a),"\n ")},path:function(a){return"\n ").concat(recurse(a),"\n ")},g:function(a){return"\n ").concat(recurse(a),"\n ")},polygon:function(a){return"\n ").concat(recurse(a),"\n ")},line:function(a){return"\n ").concat(recurse(a),"\n ")},polyline:function(a){return"\n ").concat(recurse(a),"\n ")}};export{pour,_pour,SVGComponents,PlainSVGStringRenderer};