UNPKG

@yungkei/print-table

Version:

A tiny javascript library to help printing table from the web.

3 lines 27.6 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.printTable=t():e.printTable=t()}(self,(()=>(()=>{var e={310:function(e){ /*! art-template@4.13.2 for browser | https://github.com/aui/art-template */ "undefined"!=typeof self&&self,e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){"use strict";var r=n(6),i=n(2),o=n(22),a=function(e,t){t.onerror(e,t);var n=function(){return"{Template Error}"};return n.mappings=[],n.sourcesContent=[],n},s=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof t?n=t:n.source=t,t=(n=i.$extend(n)).source,!0===n.debug&&(n.cache=!1,n.minimize=!1,n.compileDebug=!0),n.compileDebug&&(n.minimize=!1),n.filename&&(n.filename=n.resolveFilename(n.filename,n));var s=n.filename,c=n.cache,u=n.caches;if(c&&s){var l=u.get(s);if(l)return l}if(!t)try{t=n.loader(s,n),n.source=t}catch(e){var p=new o({name:"CompileError",path:s,message:"template not found: "+e.message,stack:e.stack});if(n.bail)throw p;return a(p,n)}var f=void 0,d=new r(n);try{f=d.build()}catch(p){if(p=new o(p),n.bail)throw p;return a(p,n)}var h=function(t,r){try{return f(t,r)}catch(i){if(!n.compileDebug)return n.cache=!1,n.compileDebug=!0,e(n)(t,r);if(i=new o(i),n.bail)throw i;return a(i,n)()}};return h.mappings=f.mappings,h.sourcesContent=f.sourcesContent,h.toString=function(){return f.toString()},c&&s&&u.set(s,h),h};s.Compiler=r,e.exports=s},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,t.matchToToken=function(e){var t={type:"invalid",value:e[0]};return e[1]?(t.type="string",t.closed=!(!e[3]&&!e[4])):e[5]?t.type="comment":e[6]?(t.type="comment",t.closed=!!e[7]):e[8]?t.type="regex":e[9]?t.type="number":e[10]?t.type="name":e[11]?t.type="punctuator":e[12]&&(t.type="whitespace"),t}},function(e,t,n){"use strict";function r(){this.$extend=function(e){return o(e=e||{},e instanceof r?e:this)}}var i=n(10),o=n(12),a=n(13),s=n(14),c=n(15),u=n(16),l=n(17),p=n(18),f=n(19),d=n(21),h={source:null,filename:null,rules:[p,l],escape:!0,debug:!1,bail:!0,cache:!0,minimize:!0,compileDebug:!1,resolveFilename:d,include:a,htmlMinifier:f,htmlMinifierOptions:{collapseWhitespace:!0,minifyCSS:!0,minifyJS:!0,ignoreCustomFragments:[]},onerror:s,loader:u,caches:c,root:"/",extname:".art",ignore:[],imports:i};r.prototype=h,e.exports=new r},function(e,t){},function(e,t,n){"use strict";var r=n(5),i=n(0),o=n(23),a=function(e,t){return t instanceof Object?r({filename:e},t):i({filename:e,source:t})};a.render=r,a.compile=i,a.defaults=o,e.exports=a},function(e,t,n){"use strict";var r=n(0),i=function(e,t,n){return r(e,n)(t)};e.exports=i},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(7),c=n(9),u="$data",l="$imports",p="print",f="include",d="extend",h="block",m="$$out",v="$$line",y="$$blocks",g="$$slice",b="$$from",w="$$options",x=function(e,t){return Object.hasOwnProperty.call(e,t)},k=JSON.stringify,E=function(){function e(t){var n,a,s=this;o(this,e);var x=t.source,k=t.minimize,E=t.htmlMinifier;if(this.options=t,this.stacks=[],this.context=[],this.scripts=[],this.CONTEXT_MAP={},this.ignore=[u,l,w].concat(i(t.ignore)),this.internal=(r(n={},m,"''"),r(n,v,"[0,0]"),r(n,y,"arguments[1]||{}"),r(n,b,"null"),r(n,p,"function(){var s=''.concat.apply('',arguments);"+m+"+=s;return s}"),r(n,f,"function(src,data){var s="+w+".include(src,data||"+u+",arguments[2]||"+y+","+w+");"+m+"+=s;return s}"),r(n,d,"function(from){"+b+"=from}"),r(n,g,"function(c,p,s){p="+m+";"+m+"='';c();s="+m+";"+m+"=p+s;return s}"),r(n,h,"function(){var a=arguments,s;if(typeof a[0]==='function'){return "+g+"(a[0])}else if("+b+"){if(!"+y+"[a[0]]){"+y+"[a[0]]="+g+"(a[1])}else{"+m+"+="+y+"[a[0]]}}else{s="+y+"[a[0]];if(typeof s==='string'){"+m+"+=s}else{s="+g+"(a[1])}return s}}"),n),this.dependencies=(r(a={},p,[m]),r(a,f,[m,w,u,y]),r(a,d,[b,f]),r(a,h,[g,b,m,y]),a),this.importContext(m),t.compileDebug&&this.importContext(v),k)try{x=E(x,t)}catch(e){}this.source=x,this.getTplTokens(x,t.rules,this).forEach((function(e){e.type===c.TYPE_STRING?s.parseString(e):s.parseExpression(e)}))}return a(e,[{key:"getTplTokens",value:function(){return c.apply(void 0,arguments)}},{key:"getEsTokens",value:function(e){return s(e)}},{key:"getVariables",value:function(e){var t=!1;return e.filter((function(e){return"whitespace"!==e.type&&"comment"!==e.type})).filter((function(e){return"name"===e.type&&!t||(t="punctuator"===e.type&&"."===e.value,!1)})).map((function(e){return e.value}))}},{key:"importContext",value:function(e){var t=this,n="",r=this.internal,i=this.dependencies,o=this.ignore,a=this.context,s=this.options.imports,c=this.CONTEXT_MAP;x(c,e)||-1!==o.indexOf(e)||(x(r,e)?(n=r[e],x(i,e)&&i[e].forEach((function(e){return t.importContext(e)}))):n="$escape"===e||"$each"===e||x(s,e)?l+"."+e:u+"."+e,c[e]=n,a.push({name:e,value:n}))}},{key:"parseString",value:function(e){var t=e.value;if(t){var n=m+"+="+k(t);this.scripts.push({source:t,tplToken:e,code:n})}}},{key:"parseExpression",value:function(e){var t=this,n=e.value,r=e.script,i=r.output,o=this.options.escape,a=r.code;i&&(a=!1===o||i===c.TYPE_RAW?m+"+="+r.code:m+"+=$escape("+r.code+")");var s=this.getEsTokens(a);this.getVariables(s).forEach((function(e){return t.importContext(e)})),this.scripts.push({source:n,tplToken:e,code:a})}},{key:"checkExpression",value:function(e){for(var t=[[/^\s*}[\w\W]*?{?[\s;]*$/,""],[/(^[\w\W]*?\([\w\W]*?(?:=>|\([\w\W]*?\))\s*{[\s;]*$)/,"$1})"],[/(^[\w\W]*?\([\w\W]*?\)\s*{[\s;]*$)/,"$1}"]],n=0;n<t.length;){if(t[n][0].test(e)){var r;e=(r=e).replace.apply(r,i(t[n]));break}n++}try{return new Function(e),!0}catch(e){return!1}}},{key:"build",value:function(){var e=this.options,t=this.context,n=this.scripts,r=this.stacks,i=this.source,o=e.filename,a=e.imports,s=[],p=x(this.CONTEXT_MAP,d),h=0,g=function(e,t){var n=t.line,i=t.start,o={generated:{line:r.length+h+1,column:1},original:{line:n+1,column:i+1}};return h+=e.split(/\n/).length-1,o},E=function(e){return e.replace(/^[\t ]+|[\t ]$/g,"")};r.push("function("+u+"){"),r.push("'use strict'"),r.push(u+"="+u+"||{}"),r.push("var "+t.map((function(e){return e.name+"="+e.value})).join(",")),e.compileDebug?(r.push("try{"),n.forEach((function(e){e.tplToken.type===c.TYPE_EXPRESSION&&r.push(v+"=["+[e.tplToken.line,e.tplToken.start].join(",")+"]"),s.push(g(e.code,e.tplToken)),r.push(E(e.code))})),r.push("}catch(error){"),r.push("throw {"+["name:'RuntimeError'","path:"+k(o),"message:error.message","line:"+v+"[0]+1","column:"+v+"[1]+1","source:"+k(i),"stack:error.stack"].join(",")+"}"),r.push("}")):n.forEach((function(e){s.push(g(e.code,e.tplToken)),r.push(E(e.code))})),p&&(r.push(m+"=''"),r.push(f+"("+b+","+u+","+y+")")),r.push("return "+m),r.push("}");var T=r.join("\n");try{var O=new Function(l,w,"return "+T)(a,e);return O.mappings=s,O.sourcesContent=[i],O}catch(e){for(var $=0,C=0,j=0,_=void 0;$<n.length;){var S=n[$];if(!this.checkExpression(S.code)){C=S.tplToken.line,j=S.tplToken.start,_=S.code;break}$++}throw{name:"CompileError",path:o,message:e.message,line:C+1,column:j+1,source:i,generated:_,stack:e.stack}}}}]),e}();E.CONSTS={DATA:u,IMPORTS:l,PRINT:p,INCLUDE:f,EXTEND:d,BLOCK:h,OPTIONS:w,OUT:m,LINE:v,BLOCKS:y,SLICE:g,FROM:b,ESCAPE:"$escape",EACH:"$each"},e.exports=E},function(e,t,n){"use strict";var r=n(8),i=n(1).default,o=n(1).matchToToken,a=function(e){return e.match(i).map((function(e){return i.lastIndex=0,o(i.exec(e))})).map((function(e){return"name"===e.type&&r(e.value)&&(e.type="keyword"),e}))};e.exports=a},function(e,t,n){"use strict";var r={abstract:!0,await:!0,boolean:!0,break:!0,byte:!0,case:!0,catch:!0,char:!0,class:!0,const:!0,continue:!0,debugger:!0,default:!0,delete:!0,do:!0,double:!0,else:!0,enum:!0,export:!0,extends:!0,false:!0,final:!0,finally:!0,float:!0,for:!0,function:!0,goto:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,int:!0,interface:!0,let:!0,long:!0,native:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,short:!0,static:!0,super:!0,switch:!0,synchronized:!0,this:!0,throw:!0,transient:!0,true:!0,try:!0,typeof:!0,var:!0,void:!0,volatile:!0,while:!0,with:!0,yield:!0};e.exports=function(e){return r.hasOwnProperty(e)}},function(e,t,n){"use strict";function r(e){var t=new String(e.value);return t.line=e.line,t.start=e.start,t.end=e.end,t}function i(e,t,n){this.type=e,this.value=t,this.script=null,n?(this.line=n.line+n.value.split(/\n/).length-1,this.line===n.line?this.start=n.end:this.start=n.value.length-n.value.lastIndexOf("\n")-1):(this.line=0,this.start=0),this.end=this.start+this.value.length}var o=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[new i("string",e)],a=0;a<t.length;a++)for(var s=t[a],c=s.test.ignoreCase?"ig":"g",u=new RegExp(s.test.source,c),l=0;l<o.length;l++){var p=o[l],f=o[l-1];if("string"===p.type){for(var d=void 0,h=0,m=[],v=p.value;null!==(d=u.exec(v));)d.index>h&&(f=new i("string",v.slice(h,d.index),f),m.push(f)),f=new i("expression",d[0],f),d[0]=r(f),f.script=s.use.apply(n,d),m.push(f),h=d.index+d[0].length;h<v.length&&(f=new i("string",v.slice(h),f),m.push(f)),o.splice.apply(o,[l,1].concat(m)),l+=m.length-1}}return o};o.TYPE_STRING="string",o.TYPE_EXPRESSION="expression",o.TYPE_RAW="raw",o.TYPE_ESCAPE="escape",e.exports=o},function(e,t,n){"use strict";(function(t){function n(e){return"string"!=typeof e&&(e=null==e?"":"function"==typeof e?n(e.call(e)):JSON.stringify(e)),e}function r(e){var t=""+e,n=a.exec(t);if(!n)return e;var r="",i=void 0,o=void 0,s=void 0;for(i=n.index,o=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:s="&#34;";break;case 38:s="&#38;";break;case 39:s="&#39;";break;case 60:s="&#60;";break;case 62:s="&#62;";break;default:continue}o!==i&&(r+=t.substring(o,i)),o=i+1,r+=s}return o!==i?r+t.substring(o,i):r}/*! art-template@runtime | https://github.com/aui/art-template */var i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},o=Object.create(i),a=/["&'<>]/;o.$escape=function(e){return r(n(e))},o.$each=function(e,t){if(Array.isArray(e))for(var n=0,r=e.length;n<r;n++)t(e[n],n);else for(var i in e)t(e[i],i)},e.exports=o}).call(t,n(11))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=Object.prototype.toString,i=function(e){return null===e?"Null":r.call(e).slice(8,-1)},o=function e(t,n){var r=void 0,o=i(t);if("Object"===o?r=Object.create(n||{}):"Array"===o&&(r=[].concat(n||[])),r){for(var a in t)Object.hasOwnProperty.call(t,a)&&(r[a]=e(t[a],r[a]));return r}return t};e.exports=o},function(e,t,n){"use strict";var r=function(e,t,r,i){return n(0)(i=i.$extend({filename:i.resolveFilename(e,i),bail:!0,source:null}))(t,r)};e.exports=r},function(e,t,n){"use strict";var r=function(e){console.error(e.name,e.message)};e.exports=r},function(e,t,n){"use strict";var r={__data:Object.create(null),set:function(e,t){this.__data[e]=t},get:function(e){return this.__data[e]},reset:function(){this.__data={}}};e.exports=r},function(e,t,n){"use strict";var r="undefined"==typeof window,i=function(e){if(r)return n(3).readFileSync(e,"utf8");var t=document.getElementById(e);return t.value||t.innerHTML};e.exports=i},function(e,t,n){"use strict";var r={test:/{{([@#]?)[ \t]*(\/?)([\w\W]*?)[ \t]*}}/,use:function(e,t,n,i){var o=this,a=o.options,s=o.getEsTokens(i),c=s.map((function(e){return e.value})),u={},l=void 0,p=!!t&&"raw",f=n+c.shift(),d=function(t,n){console.warn((a.filename||"anonymous")+":"+(e.line+1)+":"+(e.start+1)+"\nTemplate upgrade: {{"+t+"}} -> {{"+n+"}}")};switch("#"===t&&d("#value","@value"),f){case"set":i="var "+c.join("").trim();break;case"if":i="if("+c.join("").trim()+"){";break;case"else":var h=c.indexOf("if");~h?(c.splice(0,h+1),i="}else if("+c.join("").trim()+"){"):i="}else{";break;case"/if":i="}";break;case"each":(l=r._split(s)).shift(),"as"===l[1]&&(d("each object as value index","each object value index"),l.splice(1,1)),i="$each("+(l[0]||"$data")+",function("+(l[1]||"$value")+","+(l[2]||"$index")+"){";break;case"/each":i="})";break;case"block":(l=r._split(s)).shift(),i="block("+l.join(",").trim()+",function(){";break;case"/block":i="})";break;case"echo":f="print",d("echo value","value");case"print":case"include":case"extend":if(0!==c.join("").trim().indexOf("(")){(l=r._split(s)).shift(),i=f+"("+l.join(",")+")";break}default:if(~c.indexOf("|")){var m=s.reduce((function(e,t){var n=t.value,r=t.type;return"|"===n?e.push([]):"whitespace"!==r&&"comment"!==r&&(e.length||e.push([]),":"===n&&1===e[e.length-1].length?d("value | filter: argv","value | filter argv"):e[e.length-1].push(t)),e}),[]).map((function(e){return r._split(e)}));i=m.reduce((function(e,t){var n=t.shift();return t.unshift(e),"$imports."+n+"("+t.join(",")+")"}),m.shift().join(" ").trim())}p=p||"escape"}return u.code=i,u.output=p,u},_split:function(e){e=e.filter((function(e){var t=e.type;return"whitespace"!==t&&"comment"!==t}));for(var t=0,n=e.shift(),r=/\]|\)/,i=[[n]];t<e.length;){var o=e[t];"punctuator"===o.type||"punctuator"===n.type&&!r.test(n.value)?i[i.length-1].push(o):i.push([o]),n=o,t++}return i.map((function(e){return e.map((function(e){return e.value})).join("")}))}};e.exports=r},function(e,t,n){"use strict";var r={test:/<%(#?)((?:==|=#|[=-])?)[ \t]*([\w\W]*?)[ \t]*(-?)%>/,use:function(e,t,n,r){return n={"-":"raw","=":"escape","":!1,"==":"raw","=#":"raw"}[n],t&&(r="/*"+r+"*/",n=!1),{code:r,output:n}}};e.exports=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i="undefined"==typeof window,o=function(e,t){if(i){var o,a=n(20).minify,s=t.htmlMinifierOptions,c=t.rules.map((function(e){return e.test}));(o=s.ignoreCustomFragments).push.apply(o,r(c)),e=a(e,s)}return e};e.exports=o},function(e,t){!function(e){e.noop=function(){}}("object"==typeof e&&"object"==typeof e.exports?e.exports:window)},function(e,t,n){"use strict";var r="undefined"==typeof window,i=/^\.+\//,o=function(e,t){if(r){var o=n(3),a=t.root,s=t.extname;if(i.test(e)){var c=t.filename,u=c&&e!==c?o.dirname(c):a;e=o.resolve(u,e)}else e=o.resolve(a,e);o.extname(e)||(e+=s)}return e};e.exports=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){var t=e.name,n=e.source,r=e.path,i=e.line,o=e.column,a=e.generated,s=e.message;if(!n)return s;var c=n.split(/\n/),u=Math.max(i-3,0),l=Math.min(c.length,i+3),p=c.slice(u,l).map((function(e,t){var n=t+u+1;return(n===i?" >> ":" ")+n+"| "+e})).join("\n");return(r||"anonymous")+":"+i+":"+o+"\n"+p+"\n\n"+t+": "+s+(a?"\n generated: "+a:"")}var s=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.message));return n.name="TemplateError",n.message=a(e),Error.captureStackTrace&&Error.captureStackTrace(n,n.constructor),n}return o(t,Error),t}();e.exports=s},function(e,t,n){"use strict";e.exports=n(2)}])},340:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(81),i=n.n(r),o=n(645),a=n.n(o),s=n(778),c=n(820),u=n(206),l=n(191),p=n(413),f=n(990),d=a()(i());d.i(s.Z),d.i(c.Z),d.i(u.Z),d.i(l.Z),d.i(p.Z),d.i(f.Z),d.push([e.id,"",""]);const h=d},820:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),i=n.n(r),o=n(645),a=n.n(o)()(i());a.push([e.id,".yk-print-paper-a1 {\r\n margin: 25.4mm 31.8mm;\r\n}",""]);const s=a},206:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),i=n.n(r),o=n(645),a=n.n(o)()(i());a.push([e.id,".yk-print-paper-a2 {\r\n margin: 25.4mm 31.8mm;\r\n}",""]);const s=a},191:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),i=n.n(r),o=n(645),a=n.n(o)()(i());a.push([e.id,".yk-print-paper-a3 {\r\n size: a3;\r\n margin: 25.4mm 31.8mm;\r\n}",""]);const s=a},413:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),i=n.n(r),o=n(645),a=n.n(o)()(i());a.push([e.id,".yk-print-paper-a4 {\r\n size: a4;\r\n margin: 25.4mm 31.8mm;\r\n}",""]);const s=a},990:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),i=n.n(r),o=n(645),a=n.n(o)()(i());a.push([e.id,".yk-print-paper-a5 {\r\n size: a5;\r\n margin: 25.4mm 31.8mm;\r\n}",""]);const s=a},778:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),i=n.n(r),o=n(645),a=n.n(o)()(i());a.push([e.id,".yk-print {\r\n page-break-after: always;\r\n}\r\n\r\n.yk-print table {\r\n border: 1px;\r\n border-style: solid;\r\n border-collapse: collapse;\r\n}\r\n\r\n.yk-print table th {\r\n border: 1px;\r\n border-style: solid;\r\n height: 8mm;\r\n}\r\n\r\n.yk-print table td {\r\n border: 1px;\r\n border-style: solid;\r\n height: 8mm;\r\n}\r\n\r\n@page {\r\n margin: 0;\r\n}",""]);const s=a},645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);r&&a[l[0]]||(void 0!==o&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=o),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),i&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=i):l[4]="".concat(i)),t.push(l))}},t}},81:e=>{"use strict";e.exports=function(e){return e[1]}},379:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},a=[],s=0;s<e.length;s++){var c=e[s],u=r.base?c[0]+r.base:c[0],l=o[u]||0,p="".concat(u," ").concat(l);o[u]=l+1;var f=n(p),d={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==f)t[f].references++,t[f].updater(d);else{var h=i(d,r);r.byIndex=s,t.splice(s,0,{identifier:p,updater:h,references:1})}a.push(p)}return a}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var s=n(o[a]);t[s].references--}for(var c=r(e,i),u=0;u<o.length;u++){var l=n(o[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}o=c}}},569:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},216:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},575:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}},795:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{"use strict";n.d(r,{default:()=>M});var e=n(310),t=n.n(e);const i={columns:[],datasource:[]},o="portrait",a=246.2,s=146.4;const c={load:(e="basic",n=i,r="a4",c="portrait")=>function(e,n,r,i){const c=function(e,t){const n=function(e="a4"){switch(e){case"a1":return 790.2;case"a2":return 543.2;case"a3":return 369.2;case"a4":default:return a;case"a5":return 159.2}}(e),r=function(e="a4"){switch(e){case"a1":return 530.4;case"a2":return 356.4;case"a3":return 233.4;case"a4":default:return s;case"a5":return 84.4}}(e);return t===o?Math.floor(n/8):Math.floor(r/8)}(r,i),u=function(e){const{columns:t=[]}=e;return t.length}(n);c<=u&&console.error("ERROR>>LODD_DATA_ERROR>>COLUMN_ROWS_IS_NOT_EXPECTED");const l=c-u,p=function(e){const{datasource:t=[]}=e;return t.length}(n);let f="";try{const{columns:o=[],datasource:a=[]}=n;for(let s=0;s<p;s+=l){const c={...n,columns:o,datasource:a.slice(s,s+l+1),paper:r,orientation:i};f+=t().render(e,c)}}catch(e){console.error("ERROR>>LODD_DATA_ERROR",e)}return f}('<style>\r\n@page {\r\n size: {{if orientation == \'portrait\'}} portrait {{else if orientation == \'landscape\'}} landscape {{/if}}">;\r\n}\r\n</style>\r\n<div class = "yk-print \r\n{{if paper == \'a1\'}} yk-print-paper-a1\r\n{{else if paper == \'a2\'}} yk-print-paper-a2\r\n{{else if paper == \'a3\'}} yk-print-paper-a3\r\n{{else if paper == \'a4\'}} yk-print-paper-a4\r\n{{else if paper == \'a5\'}} yk-print-paper-a5{{/if}}">\r\n <table>\r\n {{each columns}}\r\n <tr>\r\n {{each $value}}\r\n {{if $value != null}}\r\n <th \r\n align="{{$value.align}}" \r\n valign="{{$value.valign}}" \r\n width="{{$value.width}}"\r\n colspan="{{$value.colspan}}"\r\n style = "{{$value.style}}"\r\n >\r\n {{$value.content}}\r\n </th>\r\n {{/if}}\r\n {{/each}}\r\n </tr>\r\n {{/each}}\r\n {{each datasource}}\r\n <tr>\r\n {{each $value}}\r\n {{if $value != null}}\r\n <td \r\n align="{{$value.align}}" \r\n valign="{{$value.valign}}" \r\n width="{{$value.width}}"\r\n colspan="{{$value.colspan}}"\r\n style = "{{$value.style}}"\r\n >\r\n {{$value.content}}\r\n </td>\r\n {{/if}}\r\n {{/each}}\r\n </tr>\r\n {{/each}}\r\n </table>\r\n</div>',n,r,c)};var u,l=new Uint8Array(16);function p(){if(!u&&!(u="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return u(l)}const f=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const d=function(e){return"string"==typeof e&&f.test(e)};for(var h=[],m=0;m<256;++m)h.push((m+256).toString(16).substr(1));const v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(h[e[t+0]]+h[e[t+1]]+h[e[t+2]]+h[e[t+3]]+"-"+h[e[t+4]]+h[e[t+5]]+"-"+h[e[t+6]]+h[e[t+7]]+"-"+h[e[t+8]]+h[e[t+9]]+"-"+h[e[t+10]]+h[e[t+11]]+h[e[t+12]]+h[e[t+13]]+h[e[t+14]]+h[e[t+15]]).toLowerCase();if(!d(n))throw TypeError("Stringified UUID is invalid");return n};const y=function(e,t,n){var r=(e=e||{}).random||(e.rng||p)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return v(r)};function g(e){return document.getElementById(e)}const b={print:(e,t,n,r)=>{const i=c.load(e,t,n,r),o=function(){var e=document.createElement("iframe");return e.id="print-table-"+y(),e.style.display="none",e.style.alignItems="center",document.body.appendChild(e),e.id}(),a=g(o);var s=a.contentWindow.document;s.write(i),s.close();const u=document.head.getElementsByClassName("yk-print-style")||[];for(const e of u)a.contentDocument.head.appendChild(e.cloneNode(!0));a.contentWindow.focus(),a.contentWindow.print(),function(e){const t=g(e);t.parentNode.removeChild(t)}(o)}};var w=n(379),x=n.n(w),k=n(795),E=n.n(k),T=n(569),O=n.n(T),$=n(575),C=n.n($),j=n(216),_=n.n(j),S=n(589),A=n.n(S),P=n(340),R={attributes:{class:"yk-print-style"}};R.styleTagTransform=A(),R.setAttributes=C(),R.insert=O().bind(null,"head"),R.domAPI=E(),R.insertStyleElement=_();x()(P.Z,R);P.Z&&P.Z.locals&&P.Z.locals;const F=b.print;"undefined"!=typeof window&&(window.printTable=F);const M=F})(),r=r.default})()));