-
Notifications
You must be signed in to change notification settings - Fork 0
/
guten-templates.min.js
311 lines (253 loc) · 51.8 KB
/
guten-templates.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/js/index.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/tokenizr/lib/tokenizr.js":
/*!***********************************************!*\
!*** ./node_modules/tokenizr/lib/tokenizr.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){\n\"use strict\";function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function _possibleConstructorReturn(t,e){return!e||\"object\"!==_typeof(e)&&\"function\"!=typeof e?_assertThisInitialized(t):e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}function _inherits(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_setPrototypeOf(t,e)}function _wrapNativeSuper(t){var e=\"function\"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(t){if(null===t||!_isNativeFunction(t))return t;if(\"function\"!=typeof t)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(n,t)})(t)}function isNativeReflectConstruct(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function _construct(t,e,n){return(_construct=isNativeReflectConstruct()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&_setPrototypeOf(r,n.prototype),r}).apply(null,arguments)}function _isNativeFunction(t){return-1!==Function.toString.call(t).indexOf(\"[native code]\")}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),t}var excerpt=function(t,e){var n=t.length,i=e-20;i<0&&(i=0);var r=e+20;r>n&&(r=n);var o=function(t){return t.charCodeAt(0).toString(16).toUpperCase()},s=function(t,e,n){return t.substr(e,n).replace(/\\\\/g,\"\\\\\\\\\").replace(/\\x08/g,\"\\\\b\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\f/g,\"\\\\f\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x07\\x0B\\x0E\\x0F]/g,function(t){return\"\\\\x0\"+o(t)}).replace(/[\\x10-\\x1F\\x80-\\xFF]/g,function(t){return\"\\\\x\"+o(t)}).replace(/[\\u0100-\\u0FFF]/g,function(t){return\"\\\\u0\"+o(t)}).replace(/[\\u1000-\\uFFFF]/g,function(t){return\"\\\\u\"+o(t)})};return{prologTrunc:i>0,prologText:s(t,i,e-i),tokenText:s(t,e,1),epilogText:s(t,e+1,r-(e+1)),epilogTrunc:r<n}},Token=function(){function t(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;_classCallCheck(this,t),this.type=e,this.value=n,this.text=i,this.pos=r,this.line=o,this.column=s}return _createClass(t,[{key:\"toString\",value:function(){return\"<type: \".concat(this.type,\", \")+\"value: \".concat(JSON.stringify(this.value),\", \")+\"text: \".concat(JSON.stringify(this.text),\", \")+\"pos: \".concat(this.pos,\", \")+\"line: \".concat(this.line,\", \")+\"column: \".concat(this.column,\">\")}},{key:\"isA\",value:function(t,e){return t===this.type&&(2!==arguments.length||e===this.value)}}]),t}(),ParsingError=function(t){function e(t,n,i,r,o){var s;return _classCallCheck(this,e),(s=_possibleConstructorReturn(this,_getPrototypeOf(e).call(this,t))).name=\"ParsingError\",s.message=t,s.pos=n,s.line=i,s.column=r,s.input=o,s}return _inherits(e,_wrapNativeSuper(Error)),_createClass(e,[{key:\"toString\",value:function(){for(var t=excerpt(this.input,this.pos),e=\"line \".concat(this.line,\" (column \").concat(this.column,\"): \"),n=\"\",i=0;i<e.length+t.prologText.length;i++)n+=\" \";return\"Parsing Error: \"+this.message+\"\\n\"+e+t.prologText+t.tokenText+t.epilogText+\"\\n\"+n+\"^\"}}]),e}(),ActionContext=function(){function t(e){_classCallCheck(this,t),this._tokenizr=e,this._data={},this._repeat=!1,this._reject=!1,this._ignore=!1,this._match=null}return _createClass(t,[{key:\"data\",value:function(t,e){var n=this._data[t];return 2===arguments.length&&(this._data[t]=e),n}},{key:\"info\",value:function(){return{line:this._tokenizr._line,column:this._tokenizr._column,pos:this._tokenizr._pos,len:this._match[0].length}}},{key:\"push\",value:function(){var t;return(t=this._tokenizr).push.apply(t,arguments),this}},{key:\"pop\",value:function(){var t;return(t=this._tokenizr).pop.apply(t,arguments)}},{key:\"state\",value:function(){var t,e;return arguments.length>0?((e=this._tokenizr).state.apply(e,arguments),this):(t=this._tokenizr).state.apply(t,arguments)}},{key:\"tag\",value:function(){var t;return(t=this._tokenizr).tag.apply(t,arguments),this}},{key:\"tagged\",value:function(){var t;return(t=this._tokenizr).tagged.apply(t,arguments)}},{key:\"untag\",value:function(){var t;return(t=this._tokenizr).untag.apply(t,arguments),this}},{key:\"repeat\",value:function(){return this._tokenizr._log(\" REPEAT\"),this._repeat=!0,this}},{key:\"reject\",value:function(){return this._tokenizr._log(\" REJECT\"),this._reject=!0,this}},{key:\"ignore\",value:function(){return this._tokenizr._log(\" IGNORE\"),this._ignore=!0,this}},{key:\"accept\",value:function(t,e){return arguments.length<2&&(e=this._match[0]),this._tokenizr._log(\" ACCEPT: type: \".concat(t,\", value: \")+\"\".concat(JSON.stringify(e),\" (\").concat(_typeof(e),'), text: \"').concat(this._match[0],'\"')),this._tokenizr._pending.push(new Token(t,e,this._match[0],this._tokenizr._pos,this._tokenizr._line,this._tokenizr._column)),this}},{key:\"stop\",value:function(){return this._tokenizr._stopped=!0,this}}]),t}(),Tokenizr=function(){function t(){_classCallCheck(this,t),this._before=null,this._after=null,this._finish=null,this._rules=[],this._debug=!1,this.reset()}return _createClass(t,[{key:\"reset\",value:function(){return this._input=\"\",this._len=0,this._eof=!1,this._pos=0,this._line=1,this._column=1,this._state=[\"default\"],this._tag={},this._transaction=[],this._pending=[],this._stopped=!1,this._ctx=new ActionContext(this),this}},{key:\"error\",value:function(t){return new ParsingError(t,this._pos,this._line,this._column,this._input)}},{key:\"debug\",value:function(t){return this._debug=t,this}},{key:\"_log\",value:function(t){this._debug&&console.log(\"tokenizr: \".concat(t))}},{key:\"input\",value:function(t){if(\"string\"!=typeof t)throw new Error('parameter \"input\" not a String');return this.reset(),this._input=t,this._len=t.length,this}},{key:\"push\",value:function(t){if(1!==arguments.length)throw new Error(\"invalid number of arguments\");if(\"string\"!=typeof t)throw new Error('parameter \"state\" not a String');return this._log(\" STATE (PUSH): \"+\"old: <\".concat(this._state[this._state.length-1],\">, \")+\"new: <\".concat(t,\">\")),this._state.push(t),this}},{key:\"pop\",value:function(){if(0!==arguments.length)throw new Error(\"invalid number of arguments\");if(this._state.length<2)throw new Error(\"no more custom states to pop\");return this._log(\" STATE (POP): \"+\"old: <\".concat(this._state[this._state.length-1],\">, \")+\"new: <\".concat(this._state[this._state.length-2],\">\")),this._state.pop()}},{key:\"state\",value:function(t){if(1===arguments.length){if(\"string\"!=typeof t)throw new Error('parameter \"state\" not a String');return this._log(\" STATE (SET): \"+\"old: <\".concat(this._state[this._state.length-1],\">, \")+\"new: <\".concat(t,\">\")),this._state[this._state.length-1]=t,this}if(0===arguments.length)return this._state[this._state.length-1];throw new Error(\"invalid number of arguments\")}},{key:\"tag\",value:function(t){if(1!==arguments.length)throw new Error(\"invalid number of arguments\");if(\"string\"!=typeof t)throw new Error('parameter \"tag\" not a String');return this._log(\" TAG (ADD): \".concat(t)),this._tag[t]=!0,this}},{key:\"tagged\",value:function(t){if(1!==arguments.length)throw new Error(\"invalid number of arguments\");if(\"string\"!=typeof t)throw new Error('parameter \"tag\" not a String');return!0===this._tag[t]}},{key:\"untag\",value:function(t){if(1!==arguments.length)throw new Error(\"invalid number of arguments\");if(\"string\"!=typeof t)throw new Error('parameter \"tag\" not a String');return this._log(\" TAG (DEL): \".concat(t)),delete this._tag[t],this}},{key:\"before\",value:function(t){return this._before=t,this}},{key:\"after\",value:function(t){return this._after=t,this}},{key:\"finish\",value:function(t){return this._finish=t,this}},{key:\"rule\",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"unknown\";if(2===arguments.length&&\"function\"==typeof e){var r=[t,e];e=r[0],n=r[1],t=\"*\"}else if(3===arguments.length&&\"function\"==typeof e){var o=[t,e,n];e=o[0],n=o[1],i=o[2],t=\"*\"}if(\"string\"!=typeof t)throw new Error('parameter \"state\" not a String');if(!(\"object\"===_typeof(e)&&e instanceof RegExp))throw new Error('parameter \"pattern\" not a RegExp');if(\"function\"!=typeof n)throw new Error('parameter \"action\" not a Function');if(\"string\"!=typeof i)throw new Error('parameter \"name\" not a String');t=t.split(/\\s*,\\s*/g).map(function(t){var e=t.split(/\\s+/g),n=e.filter(function(t){return null===t.match(/^#/)}),i=e.filter(function(t){return null!==t.match(/^#/)}).map(function(t){return t.replace(/^#/,\"\")});if(1!==n.length)throw new Error(\"exactly one state required\");return{state:n[0],tags:i}});var s=\"g\";try{\"boolean\"==typeof new RegExp(\"\",\"y\").sticky&&(s=\"y\")}catch(t){}return\"boolean\"==typeof e.multiline&&e.multiline&&(s+=\"m\"),\"boolean\"==typeof e.dotAll&&e.dotAll&&(s+=\"s\"),\"boolean\"==typeof e.ignoreCase&&e.ignoreCase&&(s+=\"i\"),\"boolean\"==typeof e.unicode&&e.unicode&&(s+=\"u\"),e=new RegExp(e.source,s),this._log(\"rule: configure rule (state: \".concat(t,\", pattern: \").concat(e.source,\")\")),this._rules.push({state:t,pattern:e,action:n,name:i}),this}},{key:\"_progress\",value:function(t,e){for(var n=this._line,i=this._column,r=this._input,o=t;o<e;o++){var s=r.charAt(o);\"\\r\"===s?this._column=1:\"\\n\"===s?(this._line++,this._column=1):\"\\t\"===s?this._column+=8-this._column%8:this._column++}this._log(\" PROGRESS: characters: \".concat(e-t,\", \")+\"from: <line \".concat(n,\", column \").concat(i,\">, \")+\"to: <line \".concat(this._line,\", column \").concat(this._column,\">\"))}},{key:\"_tokenize\",value:function(){var t=this,e=function(){t._eof||(null!==t._finish&&t._finish.call(t._ctx,t._ctx),t._eof=!0,t._pending.push(new Token(\"EOF\",\"\",\"\",t._pos,t._line,t._column)))};if(!(this._stopped||this._pos>=this._len)){for(var n=!0;n;){if(n=!1,this._debug){var i=excerpt(this._input,this._pos),r=Object.keys(this._tag).map(function(t){return\"#\".concat(t)}).join(\" \");this._log(\"INPUT: state: <\".concat(this._state[this._state.length-1],\">, tags: <\").concat(r,\">, text: \")+(i.prologTrunc?\"...\":'\"')+\"\".concat(i.prologText,\"<\").concat(i.tokenText,\">\").concat(i.epilogText)+(i.epilogTrunc?\"...\":'\"')+\", at: <line \".concat(this._line,\", column \").concat(this._column,\">\"))}for(var o=0;o<this._rules.length;o++){if(this._debug){var s=this._rules[o].state.map(function(t){var e=t.state;return t.tags.length>0&&(e+=\" \"+t.tags.map(function(t){return\"#\".concat(t)}).join(\" \")),e}).join(\", \");this._log(\" RULE: state(s): <\".concat(s,\">, \")+\"pattern: \".concat(this._rules[o].pattern.source))}var a=!1,c=this._rules[o].state.map(function(t){return t.state}),u=c.indexOf(\"*\");if(u<0&&(u=c.indexOf(this._state[this._state.length-1])),u>=0){a=!0;var h=this._rules[o].state[u].tags;(h=h.filter(function(e){return!t._tag[e]})).length>0&&(a=!1)}if(a){this._rules[o].pattern.lastIndex=this._pos;var l=this._rules[o].pattern.exec(this._input);if(this._rules[o].pattern.lastIndex=this._pos,null!==(l=this._rules[o].pattern.exec(this._input))&&l.index===this._pos){if(this._debug&&this._log(\" MATCHED: \"+JSON.stringify(l)),this._ctx._match=l,this._ctx._repeat=!1,this._ctx._reject=!1,this._ctx._ignore=!1,null!==this._before&&this._before.call(this._ctx,this._ctx,l,this._rules[o]),this._rules[o].action.call(this._ctx,this._ctx,l),null!==this._after&&this._after.call(this._ctx,this._ctx,l,this._rules[o]),this._ctx._reject)continue;if(this._ctx._repeat){n=!0;break}if(this._ctx._ignore){if(this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,this._pos>=this._len)return void e();n=!0;break}if(this._pending.length>0)return this._progress(this._pos,this._rules[o].pattern.lastIndex),this._pos=this._rules[o].pattern.lastIndex,void(this._pos>=this._len&&e());throw new Error('action of pattern \"'+this._rules[o].pattern.source+'\" neither rejected nor accepted any token(s)')}}}}throw this.error(\"token not recognized\")}e()}},{key:\"token\",value:function(){if(0===this._pending.length&&this._tokenize(),this._pending.length>0){var t=this._pending.shift();return this._transaction.length>0&&this._transaction[0].push(t),this._log(\"TOKEN: \".concat(t.toString())),t}return null}},{key:\"tokens\",value:function(){for(var t,e=[];null!==(t=this.token());)e.push(t);return e}},{key:\"peek\",value:function(t){void 0===t&&(t=0);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>=this._pending.length)throw new Error(\"not enough tokens available for peek operation\");return this._log(\"PEEK: \".concat(this._pending[t].toString())),this._pending[t]}},{key:\"skip\",value:function(t){void 0===t&&(t=1);for(var e=0;e<this._pending.length+t;e++)this._tokenize();if(t>this._pending.length)throw new Error(\"not enough tokens available for skip operation\");for(;t-- >0;)this.token();return this}},{key:\"consume\",value:function(t,e){for(var n=this,i=0;i<this._pending.length+1;i++)this._tokenize();if(0===this._pending.length)throw new Error(\"not enough tokens available for consume operation\");var r=this.token();this._log(\"CONSUME: \".concat(r.toString()));var o=function(){throw new ParsingError(\"expected: <type: \".concat(t,\", value: \").concat(JSON.stringify(e),\" (\").concat(_typeof(e),\")>, \")+\"found: <type: \".concat(r.type,\", value: \").concat(JSON.stringify(r.value),\" (\").concat(_typeof(r.value),\")>\"),r.pos,r.line,r.column,n._input)};return 2!==arguments.length||r.isA(t,e)?r.isA(t)||o():o(JSON.stringify(e),_typeof(e)),r}},{key:\"begin\",value:function(){return this._log(\"BEGIN: level \".concat(this._transaction.length)),this._transaction.unshift([]),this}},{key:\"depth\",value:function(){if(0===this._transaction.length)throw new Error(\"cannot determine depth -- no active transaction\");return this._transaction[0].length}},{key:\"commit\",value:function(){if(0===this._transaction.length)throw new Error(\"cannot commit transaction -- no active transaction\");return this._transaction.shift(),this._log(\"COMMIT: level \".concat(this._transaction.length)),this}},{key:\"rollback\",value:function(){if(0===this._transaction.length)throw new Error(\"cannot rollback transaction -- no active transaction\");return this._pending=this._transaction[0].concat(this._pending),this._transaction.shift(),this._log(\"ROLLBACK: level \".concat(this._transaction.length)),this}},{key:\"alternatives\",value:function(){for(var t=null,e=[],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];for(var o=0;o<i.length;o++)try{this.begin(),t=i[o].call(this),this.commit();break}catch(t){this._log(\"EXCEPTION: \".concat(t.toString())),e.push({ex:t,depth:this.depth()}),this.rollback();continue}if(null===t&&e.length>0)throw(e=e.sort(function(t,e){return t.depth-e.depth}))[0].ex;return t}}]),t}();Tokenizr.Token=Token,Tokenizr.ParsingError=ParsingError,Tokenizr.ActionContext=ActionContext,module.exports=Tokenizr;\n},{}]},{},[1])(1)\n});\n\n\n//# sourceURL=webpack:///./node_modules/tokenizr/lib/tokenizr.js?");
/***/ }),
/***/ "./src/js/classes/Definition.js":
/*!**************************************!*\
!*** ./src/js/classes/Definition.js ***!
\**************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Definition; });\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ \"@wordpress/blocks\");\n/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\nclass Definition {\n constructor(values) {\n this.template = '';\n this.instructions = [];\n this.separator = '';\n this.tree = [];\n Object.assign(this, values);\n }\n\n render(mode, props) {\n const elements = this.tree.map((leaf, i) => leaf.render(mode, props, i)).filter(e => e !== null);\n\n if (mode === \"edit\") {\n const sidebarElements = this.instructions.map(instruction => instruction.sidebar(props)).filter(e => e !== null);\n\n if (sidebarElements.length > 0) {\n const sidebar = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__[\"InspectorControls\"], null, sidebarElements);\n elements.unshift(sidebar);\n }\n }\n\n if (elements.length === 1) {\n return elements[0];\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, elements);\n }\n\n register() {\n const configuration = this.instructions.reduce((config, instruction) => Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"merge\"])(config, instruction.configuration()), {});\n const name = configuration.name;\n delete configuration.name;\n\n configuration.edit = props => this.render(\"edit\", props);\n\n configuration.save = props => this.render(\"save\", props);\n\n Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__[\"registerBlockType\"])(name, configuration);\n }\n\n}\n\n//# sourceURL=webpack:///./src/js/classes/Definition.js?");
/***/ }),
/***/ "./src/js/classes/Instruction.js":
/*!***************************************!*\
!*** ./src/js/classes/Instruction.js ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Instruction; });\nconst registeredInstructions = [];\nclass Instruction {\n constructor(id, options) {\n this.id = id;\n this.options = options;\n }\n\n render(mode, props, leaf, i) {\n return null;\n }\n\n sidebar(props, i) {\n return null;\n }\n\n configuration() {\n return {};\n }\n\n static register(name, instruction) {\n registeredInstructions[name] = instruction;\n }\n\n static create(name, id, options = {}) {\n const klass = registeredInstructions[name];\n\n if (!klass) {\n console.error(\"Invalid instruction: \", instruction);\n }\n\n return new klass(id, options);\n }\n\n}\n\n//# sourceURL=webpack:///./src/js/classes/Instruction.js?");
/***/ }),
/***/ "./src/js/classes/Leaf.js":
/*!********************************!*\
!*** ./src/js/classes/Leaf.js ***!
\********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Leaf; });\n/* harmony import */ var _Instruction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Instruction */ \"./src/js/classes/Instruction.js\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);\n\n\nconst attributeMap = {\n class: \"className\",\n for: \"htmlFor\"\n};\nclass Leaf {\n constructor(type, props) {\n Object.assign(this, props);\n this.type = type;\n }\n\n render(mode, props, i) {\n switch (this.type) {\n case Leaf.TYPE_TEXT:\n return this.value;\n\n case Leaf.TYPE_ELEMENT:\n const attributes = {};\n\n for (const key in this.attributes) {\n attributes[attributeMap[key] || key] = this.attributes[key].map((leaf, i) => leaf.render(mode, props, i)).join('');\n }\n\n if (mode === \"edit\" && [\"button\", \"a\"].includes(this.tag)) {\n attributes.onClick = e => e.preventDefault() && false;\n }\n\n this.rendered = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(this.tag, attributes, this.children && this.children.map((child, i) => child.render(mode, props, i)));\n return this.rendered;\n\n case Leaf.TYPE_INSTRUCTION:\n return this.instruction.render(mode, props, this, i);\n\n default:\n return null;\n }\n }\n\n static get TYPE_TEXT() {\n return 'text';\n }\n\n static Text(props) {\n return new Leaf(Leaf.TYPE_TEXT, props);\n }\n\n static get TYPE_INSTRUCTION() {\n return 'instruction';\n }\n\n static Instruction(props) {\n return new Leaf(Leaf.TYPE_INSTRUCTION, props);\n }\n\n static get TYPE_ELEMENT() {\n return 'element';\n }\n\n static Element(props) {\n return new Leaf(Leaf.TYPE_ELEMENT, props);\n }\n\n}\n\n//# sourceURL=webpack:///./src/js/classes/Leaf.js?");
/***/ }),
/***/ "./src/js/functions/parse.js":
/*!***********************************!*\
!*** ./src/js/functions/parse.js ***!
\***********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return parse; });\n/* harmony import */ var _classes_Leaf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../classes/Leaf */ \"./src/js/classes/Leaf.js\");\n\n/**\n * Parses text into leaves.\n * \n * @param {string} text The text. \n * @param {Definition} definition The block definition.\n * \n * @returns {Leaf[]} The parsed leaves. \n */\n\nfunction parseText(text, {\n separator,\n instructions\n}) {\n const parts = text.split(separator);\n return parts.map((value, i) => i % 2 ? _classes_Leaf__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Instruction({\n instruction: instructions[value]\n }) : _classes_Leaf__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Text({\n value\n })).filter(leaf => !(leaf.type === _classes_Leaf__WEBPACK_IMPORTED_MODULE_0__[\"default\"].TYPE_TEXT && leaf.value === ''));\n}\n/**\n * \n * @param {Node} node \n * @param {Definition} definition \n * \n * @returns {Leaf[]} The parsed leaves.\n */\n\n\nfunction parseNode(node, definition) {\n switch (node.nodeType) {\n case 3:\n // TEXT_NODE\n return parseText(node.nodeValue, definition);\n\n case 1:\n // ELEMENT_NODE\n const leaf = _classes_Leaf__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Element({\n tag: node.nodeName.toLowerCase(),\n attributes: {}\n });\n\n for (let i = 0; i < node.attributes.length; i++) {\n const attribute = node.attributes[i];\n leaf.attributes[attribute.name] = parseText(attribute.value, definition);\n }\n\n leaf.children = parseNodes(node.childNodes, definition);\n\n if (leaf.children) {\n leaf.children.forEach(child => child.parent = leaf);\n }\n\n return leaf;\n }\n\n return [];\n}\n\nfunction parseNodes(nodes, definition) {\n const parsed = Array.prototype.flatMap.call(nodes, node => parseNode(node, definition));\n\n if (parsed.length === 0) {\n return null;\n }\n\n return parsed;\n}\n\nfunction parse(definition) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(definition.template, \"text/html\");\n definition.tree = parseNodes(doc.body.childNodes, definition);\n return definition;\n}\n\n//# sourceURL=webpack:///./src/js/functions/parse.js?");
/***/ }),
/***/ "./src/js/functions/process.js":
/*!*************************************!*\
!*** ./src/js/functions/process.js ***!
\*************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return process; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _classes_Definition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../classes/Definition */ \"./src/js/classes/Definition.js\");\n/* harmony import */ var _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../classes/Instruction */ \"./src/js/classes/Instruction.js\");\n\n\n\n/**\n * Transforms an array of tokens into a template definition.\n *\n * @param {array} tokens The tokens.\n * @param {string} separator A unique separator that isn't contained in any strings.\n *\n * @return {Definition} The template definition.\n */\n\nfunction process(tokens, separator) {\n const definition = new _classes_Definition__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n separator\n });\n let id = 0;\n\n while (true) {\n const token = tokens.shift();\n\n if (!token) {\n break;\n }\n\n if (token.type === 'constant') {\n definition.template += token.value;\n continue;\n }\n\n if (token.type === 'definition') {\n const instruction = _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].create(token.value, id++);\n\n while (tokens[0] && tokens[0].type === 'key') {\n const key = Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"camelCase\"])(tokens.shift().value);\n let value;\n\n if (tokens[0].type === 'array-open') {\n tokens.shift(); // Consume the array-open token.\n\n value = [];\n\n while (tokens[0].type !== 'array-close') {\n value.push(tokens.shift().value);\n }\n\n tokens.shift(); // Consume the array-close token.\n } else if (tokens[0].type === 'value') {\n value = tokens.shift().value;\n }\n\n instruction.options[key] = value;\n }\n\n definition.instructions.push(instruction);\n definition.template += separator + instruction.id + separator;\n }\n }\n\n return definition;\n}\n;\n\n//# sourceURL=webpack:///./src/js/functions/process.js?");
/***/ }),
/***/ "./src/js/functions/separator.js":
/*!***************************************!*\
!*** ./src/js/functions/separator.js ***!
\***************************************/
/*! exports provided: generateSeparator, generateUniqueSeparator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generateSeparator\", function() { return generateSeparator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generateUniqueSeparator\", function() { return generateUniqueSeparator; });\n/**\n * Generates a random separator of a given length.\n * \n * @param {int} length The length.\n * \n * @returns {string} The separator.\n */\nfunction generateSeparator(length) {\n const chars = ['@', '#', '$', '%', '^', '&', '*', '(', ')', '{', '}', '[', ']'];\n let output = '';\n\n for (let i = 0; i < length; i++) {\n output += chars[Math.floor(Math.random() * chars.length)];\n }\n\n return output;\n}\n/**\n * Generates a unique separator for a given text. \n * \n * @param {string} text The text.\n * \n * @returns {string} The separator.\n */\n\nfunction generateUniqueSeparator(text) {\n let length = 2;\n\n while (true) {\n const separator = generateSeparator(Math.floor(length));\n\n if (!text.includes(separator)) {\n return separator;\n }\n\n length += 0.2;\n }\n}\n\n//# sourceURL=webpack:///./src/js/functions/separator.js?");
/***/ }),
/***/ "./src/js/functions/tokenize.js":
/*!**************************************!*\
!*** ./src/js/functions/tokenize.js ***!
\**************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return tokenize; });\nconst Tokenizr = __webpack_require__(/*! tokenizr */ \"./node_modules/tokenizr/lib/tokenizr.js\");\n\nconst lexer = new Tokenizr();\nlexer.rule(\"default\", /(.*?)({{[a-zA-Z\\-]+|$)/, (ctx, matches) => {\n if (matches[1] && matches[1].length > 0) {\n ctx.accept(\"constant\", matches[1]);\n }\n\n if (matches[2] && matches[2].slice(0, 2) === '{{') {\n ctx.state(\"definition\");\n ctx.accept(\"definition\", matches[2].slice(2));\n }\n});\nlexer.rule(\"definition\", /\\s*}}/, ctx => {\n ctx.untag(\"undefined\");\n ctx.state(\"default\");\n ctx.ignore();\n}); // Options object key\n\nlexer.rule(\"definition\", /\\s*([a-zA-Z][a-zA-Z0-9-_]*)=/, (ctx, matches) => {\n ctx.accept(\"key\", matches[1]);\n ctx.state(\"definition-value\");\n}); // Open array\n\nlexer.rule(\"definition-value\", /\\s*\\[/, ctx => {\n ctx.tag(\"array\");\n ctx.accept(\"array-open\");\n}); // Close array\n\nlexer.rule(\"definition-value #array\", /\\s*]/, ctx => {\n ctx.untag(\"array\");\n ctx.accept(\"array-close\");\n ctx.state(\"definition\");\n}); // Comma in array\n\nlexer.rule(\"definition-value #array\", /\\s*,/, ctx => {\n ctx.ignore();\n}); // Number values\n\nlexer.rule(\"definition-value\", /\\s*(\\d+)/, (ctx, matches) => {\n ctx.accept(\"value\", parseInt(matches[1], 10));\n\n if (!ctx.tagged(\"array\")) {\n ctx.state(\"definition\");\n }\n}); // Boolean values\n\nlexer.rule(\"definition-value\", /\\s*(true|false)/, (ctx, matches) => {\n ctx.accept(\"value\", matches[1] === \"true\");\n\n if (!ctx.tagged(\"array\")) {\n ctx.state(\"definition\");\n }\n}); // String values\n\nlexer.rule(\"definition-value\", /\\s*\"([^\"\\\\]+|\\\\.)*\"/, (ctx, matches) => {\n ctx.accept(\"value\", matches[1]);\n\n if (!ctx.tagged(\"array\")) {\n ctx.state(\"definition\");\n }\n});\n/**\n * Tokenizes a given text.\n * \n * @param {string} text The text.\n * \n * @returns {{type: string, value: string}[]} An array of tokens.\n */\n\nfunction tokenize(text) {\n lexer.reset();\n lexer.input(text);\n return lexer.tokens();\n}\n\n//# sourceURL=webpack:///./src/js/functions/tokenize.js?");
/***/ }),
/***/ "./src/js/index.js":
/*!*************************!*\
!*** ./src/js/index.js ***!
\*************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _instructions_RichText__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instructions/RichText */ \"./src/js/instructions/RichText.js\");\n/* harmony import */ var _instructions_Block__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instructions/Block */ \"./src/js/instructions/Block.js\");\n/* harmony import */ var _instructions_SidebarSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./instructions/SidebarSelect */ \"./src/js/instructions/SidebarSelect.js\");\n/* harmony import */ var _instructions_SidebarInput__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./instructions/SidebarInput */ \"./src/js/instructions/SidebarInput.js\");\n/* harmony import */ var _instructions_InnerBlocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./instructions/InnerBlocks */ \"./src/js/instructions/InnerBlocks.js\");\n/* harmony import */ var _functions_tokenize_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./functions/tokenize.js */ \"./src/js/functions/tokenize.js\");\n/* harmony import */ var _functions_process_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions/process.js */ \"./src/js/functions/process.js\");\n/* harmony import */ var _functions_parse_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./functions/parse.js */ \"./src/js/functions/parse.js\");\n/* harmony import */ var _functions_separator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./functions/separator.js */ \"./src/js/functions/separator.js\");\n\n\n\n\n\n\n\n\n // const template = `\n// <?block name=\"my/block\" category=\"whatever\" ?>\n// <div class=\"whatever\">\n// <?rich-text tag=\"p\" name=\"content\" ?>\n// <div class=\"<?field array=[1,2,3] name=\"imageWrapperClass\" type=\"text\" label=\"Mooi\" bool=false other=true ?>\">TEST!</div>\n// </div>\n// <span class=\"<?post-meta name=\"bla\" ?>\"></span>\n// `.split( \"\\n\" ).map( s => s.trim() ).join( \"\" );\n\njQuery('script[type=\"text/guten-template\"]').each(function () {\n try {\n const template = this.innerHTML.split(\"\\n\").map(s => s.trim()).join(\"\");\n const tokens = Object(_functions_tokenize_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(template);\n const separator = Object(_functions_separator_js__WEBPACK_IMPORTED_MODULE_8__[\"generateUniqueSeparator\"])(template);\n const definition = Object(_functions_parse_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(Object(_functions_process_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(tokens, separator));\n definition.register();\n } catch (e) {\n console.error(\"Failed parsing guten-template\", e, this);\n }\n});\n\n//# sourceURL=webpack:///./src/js/index.js?");
/***/ }),
/***/ "./src/js/instructions/Block.js":
/*!**************************************!*\
!*** ./src/js/instructions/Block.js ***!
\**************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _classes_Instruction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../classes/Instruction */ \"./src/js/classes/Instruction.js\");\n\n\nclass Block extends _classes_Instruction__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n configuration() {\n return this.options;\n }\n\n}\n\n_classes_Instruction__WEBPACK_IMPORTED_MODULE_0__[\"default\"].register('block', Block);\n\n//# sourceURL=webpack:///./src/js/instructions/Block.js?");
/***/ }),
/***/ "./src/js/instructions/InnerBlocks.js":
/*!********************************************!*\
!*** ./src/js/instructions/InnerBlocks.js ***!
\********************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../classes/Instruction */ \"./src/js/classes/Instruction.js\");\n\n\n\n\nclass InnerBlocks extends _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n render(mode) {\n if (mode === 'edit') {\n const attributes = {};\n\n if (this.options.appender === 'button') {\n attributes.renderAppender = () => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__[\"InnerBlocks\"].ButtonBlockerAppender);\n }\n\n if (this.options.appender === 'default') {\n attributes.renderAppender = () => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__[\"InnerBlocks\"].DefaultBlockAppender);\n }\n\n if (this.options.allowedBlocks) {\n attributes.allowedBlocks = this.options.allowedBlocks;\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__[\"InnerBlocks\"], attributes);\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__[\"InnerBlocks\"].Content);\n }\n\n}\n\n_classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].register('inner-blocks', InnerBlocks);\n\n//# sourceURL=webpack:///./src/js/instructions/InnerBlocks.js?");
/***/ }),
/***/ "./src/js/instructions/RichText.js":
/*!*****************************************!*\
!*** ./src/js/instructions/RichText.js ***!
\*****************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../classes/Instruction */ \"./src/js/classes/Instruction.js\");\n\n\n\n\nclass RichText extends _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n render(mode, props, leaf, i) {\n let Element = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__[\"RichText\"].Content;\n const attributes = {\n tagName: this.options.tag,\n value: props.attributes[this.options.name],\n className: this.options.class,\n placeholder: this.options.placeholder,\n 'data-id': this.options.name,\n key: i\n };\n\n if (this.options.multiline) {\n attributes.multiline = this.options.multiline;\n }\n\n if (mode === 'edit') {\n Element = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__[\"RichText\"];\n\n attributes.onChange = value => props.setAttributes({\n [this.options.name]: value\n });\n\n if (this.options.placeholder) {\n attributes.placeholder = this.options.placeholder;\n }\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(Element, attributes);\n }\n\n configuration() {\n return {\n attributes: {\n [this.options.name]: {\n type: 'string',\n source: 'html',\n selector: `[data-id=${this.options.name}]`\n }\n }\n };\n }\n\n}\n\n_classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].register('rich-text', RichText);\n\n//# sourceURL=webpack:///./src/js/instructions/RichText.js?");
/***/ }),
/***/ "./src/js/instructions/SidebarInput.js":
/*!*********************************************!*\
!*** ./src/js/instructions/SidebarInput.js ***!
\*********************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../classes/Instruction */ \"./src/js/classes/Instruction.js\");\n\n\n\n\nclass SidebarInput extends _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n render(mode, props) {\n return props.attributes[this.options.name] || this.options.default;\n }\n\n sidebar(props, i) {\n const attributes = {\n label: this.options.label,\n value: props[this.options.name],\n onChange: value => props.setAttributes({\n [this.options.name]: value\n }),\n key: i\n };\n\n if (this.options.help) {\n attributes.help = this.options.help;\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__[\"TextControl\"], attributes);\n }\n\n configuration() {\n return {\n attributes: {\n [this.options.name]: {\n type: 'string'\n }\n }\n };\n }\n\n}\n\n_classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].register('sidebar-input', SidebarInput);\n\n//# sourceURL=webpack:///./src/js/instructions/SidebarInput.js?");
/***/ }),
/***/ "./src/js/instructions/SidebarSelect.js":
/*!**********************************************!*\
!*** ./src/js/instructions/SidebarSelect.js ***!
\**********************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../classes/Instruction */ \"./src/js/classes/Instruction.js\");\n\n\n\n\nclass SidebarSelect extends _classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n render(mode, props) {\n return props.attributes[this.options.name] || this.options.values[0];\n }\n\n sidebar(props, i) {\n const options = [];\n\n for (let i = 0; i < this.options.values.length; i++) {\n const value = this.options.values[i];\n const label = this.options.labels && this.options.labels[i] || this.options.values[i];\n options.push({\n label,\n value\n });\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__[\"SelectControl\"], {\n label: this.options.label,\n value: props[this.options.name],\n options,\n onChange: value => props.setAttributes({\n [this.options.name]: value\n }),\n key: i\n });\n }\n\n configuration() {\n return {\n attributes: {\n [this.options.name]: {\n type: 'string'\n }\n }\n };\n }\n\n}\n\n_classes_Instruction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].register('sidebar-select', SidebarSelect);\n\n//# sourceURL=webpack:///./src/js/instructions/SidebarSelect.js?");
/***/ }),
/***/ "@wordpress/block-editor":
/*!****************************************!*\
!*** external "window.wp.blockEditor" ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = window.wp.blockEditor;\n\n//# sourceURL=webpack:///external_%22window.wp.blockEditor%22?");
/***/ }),
/***/ "@wordpress/blocks":
/*!***********************************!*\
!*** external "window.wp.blocks" ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = window.wp.blocks;\n\n//# sourceURL=webpack:///external_%22window.wp.blocks%22?");
/***/ }),
/***/ "@wordpress/components":
/*!***************************************!*\
!*** external "window.wp.components" ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = window.wp.components;\n\n//# sourceURL=webpack:///external_%22window.wp.components%22?");
/***/ }),
/***/ "@wordpress/element":
/*!************************************!*\
!*** external "window.wp.element" ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = window.wp.element;\n\n//# sourceURL=webpack:///external_%22window.wp.element%22?");
/***/ }),
/***/ "lodash":
/*!********************************!*\
!*** external "window.lodash" ***!
\********************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = window.lodash;\n\n//# sourceURL=webpack:///external_%22window.lodash%22?");
/***/ })
/******/ });