!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("sheetrock",[],t):"object"==typeof exports?exports.sheetrock=t():e.sheetrock=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(){function e(e){if(e&&"SheetrockError"===e.name&&o&&o.update&&o.update({failed:!0}),t.callback)return void t.callback(e,n,s);if(e)throw e}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=null,o=null,s=null;try{n=new i.default(a({target:this},t),!!r),o=new l.default(n),s=new c.default(o)}catch(t){e(t)}return r?s.loadData(r,e):n&&o&&s&&(0,h.default)(s,e),this}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a(this,e),this.user=i(s(t)),this.request=u(this.user,r),this.requestIndex=this.request.key+"_"+this.request.gid+"_"+this.user.query};t.default=y,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={url:"",query:"",target:null,fetchSize:0,labels:[],rowTemplate:null,callback:null,reset:!1},n={sql:"query",resetStatus:"reset",chunkSize:"fetchSize",rowHandler:"rowTemplate"},o={2014:{apiEndpoint:"https://docs.google.com/spreadsheets/d/%key%/gviz/tq?",keyFormat:new RegExp("spreadsheets/d/([^/#]+)","i"),gidFormat:new RegExp("gid=([^/&#]+)","i")},2010:{apiEndpoint:"https://spreadsheets.google.com/tq?key=%key%&",keyFormat:new RegExp("key=([^&#]+)","i"),gidFormat:new RegExp("gid=([^/&#]+)","i")}};t.defaults=r,t.legacyOptions=n,t.sheetTypes=o},function(e,t){"use strict";function r(e){var t=e?e.f||e.v||e:"";return t instanceof Array&&(t=t.join("")),"object"===("undefined"==typeof t?"undefined":l(t))?"":(""+t).replace(/^\s+|\s+$/,"")}function n(e){var t=e;return"object"===("undefined"==typeof t?"undefined":l(t))&&t.jquery&&t.length&&(t=t[0]),t&&t.nodeType&&1===t.nodeType?t:null}function o(e,t){e&&e.insertAdjacentHTML&&e.insertAdjacentHTML("beforeEnd",t)}function a(e,t){var r=" "+e.className+" ";return r.indexOf(" "+t+" ")!==-1}function s(e){return e&&"TABLE"===e.tagName}function i(e,t){return"<"+t+">"+e+""}function u(e){var t=e.num?"td":"th",r="";return Object.keys(e.cells).forEach(function(n){r+=i(e.cells[n],t)}),i(r,"tr")}Object.defineProperty(t,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.append=o,t.extractElement=n,t.getCellValue=r,t.hasClass=a,t.isTable=s,t.toHTML=u,t.wrapTag=i},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r(this,t);var a=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.name="SheetrockError",a.code=o,a.message=e,a}return o(t,e),t}(Error);t.default=a,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};l.store[this.index]=a(this.state,e)}},{key:"state",get:function(){var e={}.hasOwnProperty.call(l.store,this.index),t=this.options.user.reset||this.options.request.data;if(!e||t){var r={labels:e?l.store[this.index].labels:null};l.store[this.index]=a({},l.defaults,r)}return l.store[this.index]}},{key:"url",get:function(){var e=this.options.user.fetchSize,t=e?" limit "+(e+1)+" offset "+this.state.offset:"",r=["gid="+encodeURIComponent(this.options.request.gid),"tq="+encodeURIComponent(this.options.user.query+t)];return this.options.request.apiEndpoint+r.join("&")}}]),e}();t.default=f,e.exports=t.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r