@builder.io/sdk-vue 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/_vue2/dist/{block-styles.982735c2.js → block-styles.59ab7031.js} +5 -5
- package/packages/_vue2/dist/{block-styles.6a14fec4.cjs → block-styles.e65d44f5.cjs} +1 -1
- package/packages/_vue2/dist/{block-wrapper.701626ff.cjs → block-wrapper.9745ba6c.cjs} +1 -1
- package/packages/_vue2/dist/{block-wrapper.fbaeab1b.js → block-wrapper.cce236ce.js} +5 -5
- package/packages/_vue2/dist/{block.a18a495f.cjs → block.01a27eab.cjs} +2 -2
- package/packages/_vue2/dist/{block.e9484073.js → block.63da4044.js} +7 -7
- package/packages/_vue2/dist/{blocks-wrapper.4afaccc5.js → blocks-wrapper.2b797dc9.js} +1 -1
- package/packages/_vue2/dist/{blocks-wrapper.e0086c60.cjs → blocks-wrapper.ba2cd603.cjs} +1 -1
- package/packages/_vue2/dist/{component-ref.8772e5f7.cjs → component-ref.2f39178c.cjs} +1 -1
- package/packages/_vue2/dist/{component-ref.ad8ecffe.js → component-ref.4f7cf332.js} +6 -6
- package/packages/_vue2/dist/{content.697b2fbd.js → content.6382aeb4.js} +66 -58
- package/packages/_vue2/dist/{content.fb93079e.cjs → content.7c8b076b.cjs} +1 -1
- package/packages/_vue2/dist/{css.daac46ac.cjs → css.2e7fbfd1.cjs} +1 -1
- package/packages/_vue2/dist/{css.1aff1efe.js → css.8dff19fe.js} +1 -1
- package/packages/_vue2/dist/enable-editor.23d6d28b.cjs +1 -0
- package/packages/_vue2/dist/{enable-editor.8d1c24b0.js → enable-editor.e9efcd2b.js} +9 -10
- package/packages/_vue2/dist/{evaluate.b0496c3f.js → evaluate.df5fb75e.js} +1 -1
- package/packages/_vue2/dist/{evaluate.d1bef2c5.cjs → evaluate.f450642c.cjs} +1 -1
- package/packages/_vue2/dist/{get-block-actions.a39f0f6b.js → get-block-actions.19a0ecef.js} +2 -2
- package/packages/_vue2/dist/get-block-actions.6ca6c225.cjs +1 -0
- package/packages/_vue2/dist/{get-block-properties.3ab4b67f.cjs → get-block-properties.88fdcf9e.cjs} +1 -1
- package/packages/_vue2/dist/{get-block-properties.316bbdf9.js → get-block-properties.d589f252.js} +2 -2
- package/packages/_vue2/dist/{get-processed-block.2c6787e1.js → get-processed-block.23166082.js} +2 -2
- package/packages/_vue2/dist/get-processed-block.5831b148.cjs +1 -0
- package/packages/_vue2/dist/index.d33db46c.cjs +32 -0
- package/packages/_vue2/dist/{index.8352d880.js → index.e6fc80c7.js} +234 -211
- package/packages/_vue2/dist/{inlined-script.874c7b5a.cjs → inlined-script.b449adc4.cjs} +1 -1
- package/packages/_vue2/dist/{inlined-script.b4595308.js → inlined-script.ed4af994.js} +1 -1
- package/packages/_vue2/dist/{inlined-styles.d8b2af39.cjs → inlined-styles.73a58431.cjs} +1 -1
- package/packages/_vue2/dist/{inlined-styles.dd4a079a.js → inlined-styles.e3020f6b.js} +1 -1
- package/packages/_vue2/dist/interactive-element.165bdd65.cjs +1 -0
- package/packages/_vue2/dist/{interactive-element.e2f7ca88.js → interactive-element.6bd49ec9.js} +5 -5
- package/packages/_vue2/dist/{repeated-block.c74334c2.js → repeated-block.0f2faa8d.js} +4 -5
- package/packages/_vue2/dist/repeated-block.1c865156.cjs +1 -0
- package/packages/_vue2/dist/sdk.cjs +1 -1
- package/packages/_vue2/dist/sdk.js +6 -6
- package/packages/_vue2/dist/src/components/blocks/blocks.vue.d.ts +2 -2
- package/packages/_vue2/dist/src/constants/sdk-version.d.ts +1 -1
- package/packages/_vue2/dist/src/context/components.context.d.ts +7 -0
- package/packages/_vue2/dist/{styles.367c17da.js → styles.06e1be5f.js} +2 -2
- package/packages/_vue2/dist/{styles.716893e3.cjs → styles.ab30731d.cjs} +3 -3
- package/packages/_vue3/dist/{block-wrapper.caa27b4d.cjs → block-wrapper.8543e3fe.cjs} +1 -1
- package/packages/_vue3/dist/{block-wrapper.0590efed.js → block-wrapper.fa25d8d3.js} +2 -2
- package/packages/_vue3/dist/{component-ref.7c88b254.cjs → component-ref.448dc8fb.cjs} +1 -1
- package/packages/_vue3/dist/{component-ref.9039745a.js → component-ref.72eb813f.js} +2 -2
- package/packages/_vue3/dist/{get-block-actions.cc5999ea.js → get-block-actions.27d7ef56.js} +1 -1
- package/packages/_vue3/dist/{get-block-actions.a8cbb712.cjs → get-block-actions.f8f272df.cjs} +1 -1
- package/packages/_vue3/dist/{index.52e5e57e.js → index.4a0c8828.js} +584 -569
- package/packages/_vue3/dist/{index.a789f147.cjs → index.95dacfa2.cjs} +26 -26
- package/packages/_vue3/dist/{repeated-block.1eba0fc4.js → repeated-block.11b2de7c.js} +2 -2
- package/packages/_vue3/dist/{repeated-block.e0f9db51.cjs → repeated-block.f55959d7.cjs} +1 -1
- package/packages/_vue3/dist/sdk.cjs +1 -1
- package/packages/_vue3/dist/sdk.js +1 -1
- package/packages/_vue3/dist/src/blocks/columns/columns.vue.d.ts +3 -3
- package/packages/_vue3/dist/src/blocks/symbol/symbol.vue.d.ts +3 -3
- package/packages/_vue3/dist/src/components/blocks/blocks.vue.d.ts +2 -2
- package/packages/_vue3/dist/src/constants/sdk-version.d.ts +1 -1
- package/packages/_vue3/dist/src/context/components.context.d.ts +7 -0
- package/packages/_vue3/dist/style.css +1 -1
- package/packages/_vue2/dist/builder.context.29ec27bd.js +0 -18
- package/packages/_vue2/dist/builder.context.e22f06a0.cjs +0 -1
- package/packages/_vue2/dist/enable-editor.12c3716b.cjs +0 -1
- package/packages/_vue2/dist/get-block-actions.88b6dbbf.cjs +0 -1
- package/packages/_vue2/dist/get-processed-block.deb6b33a.cjs +0 -1
- package/packages/_vue2/dist/index.051a3d7b.cjs +0 -32
- package/packages/_vue2/dist/interactive-element.12db10c4.cjs +0 -1
- package/packages/_vue2/dist/repeated-block.0343c63e.cjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";const h=require("vue");function fe(e={},t,i){const r={};for(const n in e){if(!e[n]||i&&!n.startsWith(t))continue;const s=i?n.replace(t,""):n;r[s]=e[n]}return r}const Ni=h.defineComponent({name:"builder-button",props:["attributes","text","link","openLinkInNewTab"],data(){return{filterAttrs:fe}},methods:{_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}});const w=(e,t)=>{const i=e.__vccOpts||e;for(const[r,n]of t)i[r]=n;return i},Pi=["href","target"];function Ti(e,t,i,r,n,s){return e.link?(h.openBlock(),h.createElementBlock("a",h.mergeProps({key:0,role:"button",href:e.link,target:e.openLinkInNewTab?"_blank":void 0},e.filterAttrs(e.attributes,"v-on:",!1),h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),h.toDisplayString(e.text),17,Pi)):(h.openBlock(),h.createElementBlock("button",h.mergeProps({key:1,style:e.attributes.style,class:e._classStringToObject(e.attributes.class+" button-2btisl9m7v3")},e.filterAttrs(e.attributes,"v-on:",!1),h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),h.toDisplayString(e.text),17))}const ct=w(Ni,[["render",Ti],["__scopeId","data-v-f2ef3d85"]]),de=e=>JSON.parse(JSON.stringify(e)),lt={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},qe=(e,t=lt)=>`@media (max-width: ${t[e].max}px)`,ht=({small:e,medium:t})=>{const i=de(lt);if(!e||!t)return i;const r=Math.floor(e/2);i.small={max:e,min:r,default:r+1};const n=i.small.max+1;i.medium={max:t,min:n,default:n+1};const s=i.medium.max+1;return i.large={max:2e3,min:s,default:s+1},i},G="vue3",ue="[Builder.io]: ",B={log:(...e)=>console.log(ue,...e),error:(...e)=>console.error(ue,...e),warn:(...e)=>console.warn(ue,...e),debug:(...e)=>console.debug(ue,...e)};function T(){return typeof window<"u"&&typeof document<"u"}function Oi(){return T()&&window.self!==window.top}function j(){return Oi()&&window.location.search.indexOf("builder.frameEditing=")!==-1}function Ii(){const e=()=>{var t;return typeof process<"u"&&((t=process==null?void 0:process.versions)==null?void 0:t.node)};return!T()&&!e()}const pt=(e,t,i)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((n,s,a)=>Object(n[s])===n[s]?n[s]:n[s]=Math.abs(Number(r[a+1]))>>0===+r[a+1]?[]:{},e)[r[r.length-1]]=i,e};var Ai=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],ft=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],Bi="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F",dt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Ee={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},xe="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Li={5:xe,"5module":xe+" export import",6:xe+" const class extends export import super"},Vi=/^in(stanceof)?$/,Fi=new RegExp("["+dt+"]"),Mi=new RegExp("["+dt+Bi+"]");function Re(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return!1;if(i+=t[r+1],i>=e)return!0}return!1}function Y(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Fi.test(String.fromCharCode(e)):t===!1?!1:Re(e,ft)}function J(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Mi.test(String.fromCharCode(e)):t===!1?!1:Re(e,ft)||Re(e,Ai)}var C=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function L(e,t){return new C(e,{beforeExpr:!0,binop:t})}var V={beforeExpr:!0},A={startsExpr:!0},Ie={};function _(e,t){return t===void 0&&(t={}),t.keyword=e,Ie[e]=new C(e,t)}var c={num:new C("num",A),regexp:new C("regexp",A),string:new C("string",A),name:new C("name",A),privateId:new C("privateId",A),eof:new C("eof"),bracketL:new C("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new C("]"),braceL:new C("{",{beforeExpr:!0,startsExpr:!0}),braceR:new C("}"),parenL:new C("(",{beforeExpr:!0,startsExpr:!0}),parenR:new C(")"),comma:new C(",",V),semi:new C(";",V),colon:new C(":",V),dot:new C("."),question:new C("?",V),questionDot:new C("?."),arrow:new C("=>",V),template:new C("template"),invalidTemplate:new C("invalidTemplate"),ellipsis:new C("...",V),backQuote:new C("`",A),dollarBraceL:new C("${",{beforeExpr:!0,startsExpr:!0}),eq:new C("=",{beforeExpr:!0,isAssign:!0}),assign:new C("_=",{beforeExpr:!0,isAssign:!0}),incDec:new C("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new C("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:L("||",1),logicalAND:L("&&",2),bitwiseOR:L("|",3),bitwiseXOR:L("^",4),bitwiseAND:L("&",5),equality:L("==/!=/===/!==",6),relational:L("</>/<=/>=",7),bitShift:L("<</>>/>>>",8),plusMin:new C("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:L("%",10),star:L("*",10),slash:L("/",10),starstar:new C("**",{beforeExpr:!0}),coalesce:L("??",1),_break:_("break"),_case:_("case",V),_catch:_("catch"),_continue:_("continue"),_debugger:_("debugger"),_default:_("default",V),_do:_("do",{isLoop:!0,beforeExpr:!0}),_else:_("else",V),_finally:_("finally"),_for:_("for",{isLoop:!0}),_function:_("function",A),_if:_("if"),_return:_("return",V),_switch:_("switch"),_throw:_("throw",V),_try:_("try"),_var:_("var"),_const:_("const"),_while:_("while",{isLoop:!0}),_with:_("with"),_new:_("new",{beforeExpr:!0,startsExpr:!0}),_this:_("this",A),_super:_("super",A),_class:_("class",A),_extends:_("extends",V),_export:_("export"),_import:_("import",A),_null:_("null",A),_true:_("true",A),_false:_("false",A),_in:_("in",{beforeExpr:!0,binop:7}),_instanceof:_("instanceof",{beforeExpr:!0,binop:7}),_typeof:_("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},M=/\r\n?|\n|\u2028|\u2029/,Ui=new RegExp(M.source,"g");function Q(e){return e===10||e===13||e===8232||e===8233}function mt(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var n=e.charCodeAt(r);if(Q(n))return r<i-1&&n===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var gt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,F=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,vt=Object.prototype,Di=vt.hasOwnProperty,ji=vt.toString,se=Object.hasOwn||function(e,t){return Di.call(e,t)},ze=Array.isArray||function(e){return ji.call(e)==="[object Array]"};function X(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function z(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var $i=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ie=function(t,i){this.line=t,this.column=i};ie.prototype.offset=function(t){return new ie(this.line,this.column+t)};var me=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function yt(e,t){for(var i=1,r=0;;){var n=mt(e,r,t);if(n<0)return new ie(i,t-r);++i,r=n}}var ke={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Ke=!1;function Gi(e){var t={};for(var i in ke)t[i]=e&&se(e,i)?e[i]:ke[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Ke&&typeof console=="object"&&console.warn&&(Ke=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ze(t.onToken)){var r=t.onToken;t.onToken=function(n){return r.push(n)}}return ze(t.onComment)&&(t.onComment=
|
|
3
|
-
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(M).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=c.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(re),this.regexpState=null,this.privateNameStack=[]},W={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};N.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};W.inFunction.get=function(){return(this.currentVarScope().flags&Z)>0};W.inGenerator.get=function(){return(this.currentVarScope().flags&bt)>0&&!this.currentVarScope().inClassFieldInit};W.inAsync.get=function(){return(this.currentVarScope().flags&Ae)>0&&!this.currentVarScope().inClassFieldInit};W.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&ae)return!1;if(t.flags&Z)return(t.flags&Ae)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};W.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&Be)>0||i||this.options.allowSuperOutsideMethod};W.allowDirectSuper.get=function(){return(this.currentThisScope().flags&St)>0};W.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};W.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(Z|ae))>0||i};W.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ae)>0};N.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,n=0;n<t.length;n++)r=t[n](r);return r};N.parse=function(t,i){return new this(i,t).parse()};N.parseExpressionAt=function(t,i,r){var n=new this(r,t,i);return n.nextToken(),n.parseExpression()};N.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(N.prototype,W);var I=N.prototype,Hi=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;I.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){F.lastIndex=e,e+=F.exec(this.input)[0].length;var t=Hi.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){F.lastIndex=e+t[0].length;var i=F.exec(this.input),r=i.index+i[0].length,n=this.input.charAt(r);return n===";"||n==="}"||M.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||n==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,F.lastIndex=e,e+=F.exec(this.input)[0].length,this.input[e]===";"&&e++}};I.eat=function(e){return this.type===e?(this.next(),!0):!1};I.isContextual=function(e){return this.type===c.name&&this.value===e&&!this.containsEsc};I.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};I.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};I.canInsertSemicolon=function(){return this.type===c.eof||this.type===c.braceR||M.test(this.input.slice(this.lastTokEnd,this.start))};I.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};I.semicolon=function(){!this.eat(c.semi)&&!this.insertSemicolon()&&this.unexpected()};I.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};I.expect=function(e){this.eat(e)||this.unexpected()};I.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var ge=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};I.checkPatternErrors=function(e,t){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};I.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};I.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};I.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var b=N.prototype;b.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==c.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,n=Object.keys(this.undefinedExports);r<n.length;r+=1){var s=n[r];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Me={kind:"loop"},Yi={kind:"switch"};b.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;F.lastIndex=this.pos;var t=F.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(Y(r,!0)){for(var n=i+1;J(r=this.input.charCodeAt(n),!0);)++n;if(r===92||r>55295&&r<56320)return!0;var s=this.input.slice(i,n);if(!Vi.test(s))return!0}return!1};b.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;F.lastIndex=this.pos;var e=F.exec(this.input),t=this.pos+e[0].length,i;return!M.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(J(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};b.parseStatement=function(e,t,i){var r=this.type,n=this.startNode(),s;switch(this.isLet(e)&&(r=c._var,s="let"),r){case c._break:case c._continue:return this.parseBreakContinueStatement(n,r.keyword);case c._debugger:return this.parseDebuggerStatement(n);case c._do:return this.parseDoStatement(n);case c._for:return this.parseForStatement(n);case c._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(n,!1,!e);case c._class:return e&&this.unexpected(),this.parseClass(n,!0);case c._if:return this.parseIfStatement(n);case c._return:return this.parseReturnStatement(n);case c._switch:return this.parseSwitchStatement(n);case c._throw:return this.parseThrowStatement(n);case c._try:return this.parseTryStatement(n);case c._const:case c._var:return s=s||this.value,e&&s!=="var"&&this.unexpected(),this.parseVarStatement(n,s);case c._while:return this.parseWhileStatement(n);case c._with:return this.parseWithStatement(n);case c.braceL:return this.parseBlock(!0,n);case c.semi:return this.parseEmptyStatement(n);case c._export:case c._import:if(this.options.ecmaVersion>10&&r===c._import){F.lastIndex=this.pos;var a=F.exec(this.input),u=this.pos+a[0].length,l=this.input.charCodeAt(u);if(l===40||l===46)return this.parseExpressionStatement(n,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===c._import?this.parseImport(n):this.parseExport(n,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(n,!0,!e);var p=this.value,f=this.parseExpression();return r===c.name&&f.type==="Identifier"&&this.eat(c.colon)?this.parseLabeledStatement(n,p,f,e):this.parseExpressionStatement(n,f)}};b.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(c.semi)||this.insertSemicolon()?e.label=null:this.type!==c.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var n=this.labels[r];if((e.label==null||n.name===e.label.name)&&(n.kind!=null&&(i||n.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};b.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};b.parseDoStatement=function(e){return this.next(),this.labels.push(Me),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(c._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(c.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};b.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Me),this.enterScope(0),this.expect(c.parenL),this.type===c.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===c._var||this.type===c._const||i){var r=this.startNode(),n=i?"let":this.value;return this.next(),this.parseVar(r,!0,n),this.finishNode(r,"VariableDeclaration"),(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=this.isContextual("let"),a=!1,u=new ge,l=this.parseExpression(t>-1?"await":!0,u);return this.type===c._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),s&&a&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,u),this.checkLValPattern(l),this.parseForIn(e,l)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,l))};b.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,te|(i?0:we),!1,t)};b.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(c._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};b.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(c.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};b.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(c.braceL),this.labels.push(Yi),this.enterScope(0);for(var t,i=!1;this.type!==c.braceR;)if(this.type===c._case||this.type===c._default){var r=this.type===c._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(c.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};b.parseThrowStatement=function(e){return this.next(),M.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var qi=[];b.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===c._catch){var t=this.startNode();if(this.next(),this.eat(c.parenL)){t.param=this.parseBindingAtom();var i=t.param.type==="Identifier";this.enterScope(i?xt:0),this.checkLValPattern(t.param,i?Ct:H),this.expect(c.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(c._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};b.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};b.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Me),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};b.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};b.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};b.parseLabeledStatement=function(e,t,i,r){for(var n=0,s=this.labels;n<s.length;n+=1){var a=s[n];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var u=this.type.isLoop?"loop":this.type===c._switch?"switch":null,l=this.labels.length-1;l>=0;l--){var p=this.labels[l];if(p.statementStart===e.start)p.statementStart=this.start,p.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};b.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};b.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(c.braceL),e&&this.enterScope(0);this.type!==c.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};b.parseFor=function(e,t){return e.init=t,this.expect(c.semi),e.test=this.type===c.semi?null:this.parseExpression(),this.expect(c.semi),e.update=this.type===c.parenR?null:this.parseExpression(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};b.parseForIn=function(e,t){var i=this.type===c._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};b.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(c.eq)?r.init=this.parseMaybeAssign(t):i==="const"&&!(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():r.id.type!=="Identifier"&&!(t&&(this.type===c._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(c.comma))break}return e};b.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Fe:H,!1)};var te=1,we=2,kt=4;b.parseFunction=function(e,t,i,r,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===c.star&&t&we&&this.unexpected(),e.generator=this.eat(c.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&te&&(e.id=t&kt&&this.type!==c.name?null:this.parseIdent(),e.id&&!(t&we)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Fe:H:_t));var s=this.yieldPos,a=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ve(e.async,e.generator)),t&te||(e.id=this.type===c.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,n),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=u,this.finishNode(e,t&te?"FunctionDeclaration":"FunctionExpression")};b.parseFunctionParams=function(e){this.expect(c.parenL),e.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};b.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),n=this.startNode(),s=!1;for(n.body=[],this.expect(c.braceL);this.type!==c.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(n.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(s&&this.raise(a.start,"Duplicate constructor in the same class"),s=!0):a.key&&a.key.type==="PrivateIdentifier"&&zi(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};b.parseClassElement=function(e){if(this.eat(c.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",n=!1,s=!1,a="method",u=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(c.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===c.star?u=!0:r="static"}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===c.star)&&!this.canInsertSemicolon()?s=!0:r="async"),!r&&(t>=9||!s)&&this.eat(c.star)&&(n=!0),!r&&!s&&!n){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=l:r=l)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===c.parenL||a!=="method"||n||s){var p=!i.static&&he(i,"constructor"),f=p&&e;p&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=p?"constructor":a,this.parseClassMethod(i,n,s,f)}else this.parseClassField(i);return i};b.isClassElementNameStart=function(){return this.type===c.name||this.type===c.privateId||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword};b.parseClassElementName=function(e){this.type===c.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};b.parseClassMethod=function(e,t,i,r){var n=e.key;e.kind==="constructor"?(t&&this.raise(n.start,"Constructor can't be a generator"),i&&this.raise(n.start,"Constructor can't be an async method")):e.static&&he(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&s.params.length!==0&&this.raiseRecoverable(s.start,"getter should have no params"),e.kind==="set"&&s.params.length!==1&&this.raiseRecoverable(s.start,"setter should have exactly one param"),e.kind==="set"&&s.params[0].type==="RestElement"&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};b.parseClassField=function(e){if(he(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&he(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(c.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};b.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ae|Be);this.type!==c.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};b.parseClassId=function(e,t){this.type===c.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,H,!1)):(t===!0&&this.unexpected(),e.id=null)};b.parseClassSuper=function(e){e.superClass=this.eat(c._extends)?this.parseExprSubscripts(null,!1):null};b.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};b.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,i=e.used,r=this.privateNameStack.length,n=r===0?null:this.privateNameStack[r-1],s=0;s<i.length;++s){var a=i[s];se(t,a.name)||(n?n.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function zi(e,t){var i=t.key.name,r=e[i],n="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(n=(t.static?"s":"i")+t.kind),r==="iget"&&n==="iset"||r==="iset"&&n==="iget"||r==="sget"&&n==="sset"||r==="sset"&&n==="sget"?(e[i]="true",!1):r?!0:(e[i]=n,!1)}function he(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}b.parseExport=function(e,t){if(this.next(),this.eat(c.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(c._default)){this.checkExport(t,"default",this.lastTokStart);var i;if(this.type===c._function||(i=this.isAsyncFunction())){var r=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(r,te|kt,!1,i)}else if(this.type===c._class){var n=this.startNode();e.declaration=this.parseClass(n,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s<a.length;s+=1){var u=a[s];this.checkUnreserved(u.local),this.checkLocalExport(u.local),u.local.type==="Literal"&&this.raise(u.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};b.checkExport=function(e,t,i){!e||(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),se(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};b.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,n=t.properties;r<n.length;r+=1){var s=n[r];this.checkPatternExport(e,s)}else if(i==="ArrayPattern")for(var a=0,u=t.elements;a<u.length;a+=1){var l=u[a];l&&this.checkPatternExport(e,l)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"?this.checkPatternExport(e,t.argument):i==="ParenthesizedExpression"&&this.checkPatternExport(e,t.expression)};b.checkVariableExport=function(e,t){if(!!e)for(var i=0,r=t;i<r.length;i+=1){var n=r[i];this.checkPatternExport(e,n.id)}};b.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};b.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(c.braceL);!this.eat(c.braceR);){if(i)i=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var r=this.startNode();r.local=this.parseModuleExportName(),r.exported=this.eatContextual("as")?this.parseModuleExportName():r.local,this.checkExport(e,r.exported,r.exported.start),t.push(this.finishNode(r,"ExportSpecifier"))}return t};b.parseImport=function(e){return this.next(),this.type===c.string?(e.specifiers=qi,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===c.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};b.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===c.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLValSimple(i.local,H),e.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(c.comma))return e}if(this.type===c.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLValSimple(r.local,H),e.push(this.finishNode(r,"ImportNamespaceSpecifier")),e}for(this.expect(c.braceL);!this.eat(c.braceR);){if(t)t=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var n=this.startNode();n.imported=this.parseModuleExportName(),this.eatContextual("as")?n.local=this.parseIdent():(this.checkUnreserved(n.imported),n.local=n.imported),this.checkLValSimple(n.local,H),e.push(this.finishNode(n,"ImportSpecifier"))}return e};b.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===c.string){var e=this.parseLiteral(this.value);return $i.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};b.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};b.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var D=N.prototype;D.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,n=e.properties;r<n.length;r+=1){var s=n[r];this.toAssignable(s,t),s.type==="RestElement"&&(s.argument.type==="ArrayPattern"||s.argument.type==="ObjectPattern")&&this.raise(s.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};D.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var n=e[r];n&&this.toAssignable(n,t)}if(i){var s=e[i-1];this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return e};D.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};D.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==c.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};D.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case c.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(c.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case c.braceL:return this.parseObj(!0)}return this.parseIdent()};D.parseBindingList=function(e,t,i){for(var r=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(c.comma),t&&this.type===c.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===c.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),r.push(s),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else{var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),r.push(a)}}return r};D.parseBindingListItem=function(e){return e};D.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(c.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};D.checkLValSimple=function(e,t,i){t===void 0&&(t=le);var r=t!==le;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===H&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(se(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Rt&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};D.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=le),e.type){case"ObjectPattern":for(var r=0,n=e.properties;r<n.length;r+=1){var s=n[r];this.checkLValInnerPattern(s,t,i)}break;case"ArrayPattern":for(var a=0,u=e.elements;a<u.length;a+=1){var l=u[a];l&&this.checkLValInnerPattern(l,t,i)}break;default:this.checkLValSimple(e,t,i)}};D.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=le),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var U=function(t,i,r,n,s){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=n,this.generator=!!s},k={b_stat:new U("{",!1),b_expr:new U("{",!0),b_tmpl:new U("${",!1),p_stat:new U("(",!1),p_expr:new U("(",!0),q_tmpl:new U("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new U("function",!1),f_expr:new U("function",!0),f_expr_gen:new U("function",!0,!1,null,!0),f_gen:new U("function",!1,!1,null,!0)},ee=N.prototype;ee.initialContext=function(){return[k.b_stat]};ee.curContext=function(){return this.context[this.context.length-1]};ee.braceIsBlock=function(e){var t=this.curContext();return t===k.f_expr||t===k.f_stat?!0:e===c.colon&&(t===k.b_stat||t===k.b_expr)?!t.isExpr:e===c._return||e===c.name&&this.exprAllowed?M.test(this.input.slice(this.lastTokEnd,this.start)):e===c._else||e===c.semi||e===c.eof||e===c.parenR||e===c.arrow?!0:e===c.braceL?t===k.b_stat:e===c._var||e===c._const||e===c.name?!1:!this.exprAllowed};ee.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};ee.updateContext=function(e){var t,i=this.type;i.keyword&&e===c.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};ee.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};c.parenR.updateContext=c.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===k.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};c.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?k.b_stat:k.b_expr),this.exprAllowed=!0};c.dollarBraceL.updateContext=function(){this.context.push(k.b_tmpl),this.exprAllowed=!0};c.parenL.updateContext=function(e){var t=e===c._if||e===c._for||e===c._with||e===c._while;this.context.push(t?k.p_stat:k.p_expr),this.exprAllowed=!0};c.incDec.updateContext=function(){};c._function.updateContext=c._class.updateContext=function(e){e.beforeExpr&&e!==c._else&&!(e===c.semi&&this.curContext()!==k.p_stat)&&!(e===c._return&&M.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===c.colon||e===c.braceL)&&this.curContext()===k.b_stat)?this.context.push(k.f_expr):this.context.push(k.f_stat),this.exprAllowed=!1};c.backQuote.updateContext=function(){this.curContext()===k.q_tmpl?this.context.pop():this.context.push(k.q_tmpl),this.exprAllowed=!1};c.star.updateContext=function(e){if(e===c._function){var t=this.context.length-1;this.context[t]===k.f_expr?this.context[t]=k.f_expr_gen:this.context[t]=k.f_gen}this.exprAllowed=!0};c.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==c.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var E=N.prototype;E.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,n;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6){n==="__proto__"&&s==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}n="$"+n;var a=t[n];if(a){var u;s==="init"?u=this.strict&&a.init||a.get||a.set:u=a.init||a[s],u&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[n]={init:!1,get:!1,set:!1};a[s]=!0}};E.parseExpression=function(e,t){var i=this.start,r=this.startLoc,n=this.parseMaybeAssign(e,t);if(this.type===c.comma){var s=this.startNodeAt(i,r);for(s.expressions=[n];this.eat(c.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return n};E.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,n=-1,s=-1,a=-1;t?(n=t.parenthesizedAssign,s=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ge,r=!0);var u=this.start,l=this.startLoc;(this.type===c.parenL||this.type===c.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var p=this.parseMaybeConditional(e,t);if(i&&(p=i.call(this,p,u,l)),this.type.isAssign){var f=this.startNodeAt(u,l);return f.operator=this.value,this.type===c.eq&&(p=this.toAssignable(p,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=p.start&&(t.shorthandAssign=-1),this.type===c.eq?this.checkLValPattern(p):this.checkLValSimple(p),f.left=p,this.next(),f.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(f,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return n>-1&&(t.parenthesizedAssign=n),s>-1&&(t.trailingComma=s),p};E.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return n;if(this.eat(c.question)){var s=this.startNodeAt(i,r);return s.test=n,s.consequent=this.parseMaybeAssign(),this.expect(c.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return n};E.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,n=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||n.start===i&&n.type==="ArrowFunctionExpression"?n:this.parseExprOp(n,i,r,-1,e)};E.parseExprOp=function(e,t,i,r,n){var s=this.type.binop;if(s!=null&&(!n||this.type!==c._in)&&s>r){var a=this.type===c.logicalOR||this.type===c.logicalAND,u=this.type===c.coalesce;u&&(s=c.logicalAND.binop);var l=this.value;this.next();var p=this.start,f=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,n),p,f,s,n),m=this.buildBinary(t,i,e,d,l,a||u);return(a&&this.type===c.coalesce||u&&(this.type===c.logicalOR||this.type===c.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(m,t,i,r,n)}return e};E.buildBinary=function(e,t,i,r,n,s){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=n,a.right=r,this.finishNode(a,s?"LogicalExpression":"BinaryExpression")};E.parseMaybeUnary=function(e,t,i,r){var n=this.start,s=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),t=!0;else if(this.type.prefix){var u=this.startNode(),l=this.type===c.incDec;u.operator=this.value,u.prefix=!0,this.next(),u.argument=this.parseMaybeUnary(null,!0,l,r),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&u.argument.type==="Identifier"?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&wt(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(u,l?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===c.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==c._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var p=this.startNodeAt(n,s);p.operator=this.value,p.prefix=!1,p.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(p,"UpdateExpression")}}if(!i&&this.eat(c.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(n,s,a,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return a};function wt(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&wt(e.expression)}E.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,n=this.parseExprAtom(e,t);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return n;var s=this.parseSubscripts(n,i,r,!1,t);return e&&s.type==="MemberExpression"&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),s};E.parseSubscripts=function(e,t,i,r,n){for(var s=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var u=this.parseSubscript(e,t,i,r,s,a,n);if(u.optional&&(a=!0),u===e||u.type==="ArrowFunctionExpression"){if(a){var l=this.startNodeAt(t,i);l.expression=u,u=this.finishNode(l,"ChainExpression")}return u}e=u}};E.parseSubscript=function(e,t,i,r,n,s,a){var u=this.options.ecmaVersion>=11,l=u&&this.eat(c.questionDot);r&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var p=this.eat(c.bracketL);if(p||l&&this.type!==c.parenL&&this.type!==c.backQuote||this.eat(c.dot)){var f=this.startNodeAt(t,i);f.object=e,p?(f.property=this.parseExpression(),this.expect(c.bracketR)):this.type===c.privateId&&e.type!=="Super"?f.property=this.parsePrivateIdent():f.property=this.parseIdent(this.options.allowReserved!=="never"),f.computed=!!p,u&&(f.optional=l),e=this.finishNode(f,"MemberExpression")}else if(!r&&this.eat(c.parenL)){var d=new ge,m=this.yieldPos,v=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var S=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1,d);if(n&&!l&&!this.canInsertSemicolon()&&this.eat(c.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=m,this.awaitPos=v,this.awaitIdentPos=g,this.parseArrowExpression(this.startNodeAt(t,i),S,!0,a);this.checkExpressionErrors(d,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=v||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var R=this.startNodeAt(t,i);R.callee=e,R.arguments=S,u&&(R.optional=l),e=this.finishNode(R,"CallExpression")}else if(this.type===c.backQuote){(l||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var P=this.startNodeAt(t,i);P.tag=e,P.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(P,"TaggedTemplateExpression")}return e};E.parseExprAtom=function(e,t){this.type===c.slash&&this.readRegexp();var i,r=this.potentialArrowAt===this.start;switch(this.type){case c._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type===c.parenL&&!this.allowDirectSuper&&this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==c.dot&&this.type!==c.bracketL&&this.type!==c.parenL&&this.unexpected(),this.finishNode(i,"Super");case c._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case c.name:var n=this.start,s=this.startLoc,a=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(c._function))return this.overrideContext(k.f_expr),this.parseFunction(this.startNodeAt(n,s),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(c.arrow))return this.parseArrowExpression(this.startNodeAt(n,s),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===c.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(c.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,s),[u],!0,t)}return u;case c.regexp:var l=this.value;return i=this.parseLiteral(l.value),i.regex={pattern:l.pattern,flags:l.flags},i;case c.num:case c.string:return this.parseLiteral(this.value);case c._null:case c._true:case c._false:return i=this.startNode(),i.value=this.type===c._null?null:this.type===c._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case c.parenL:var p=this.start,f=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),f;case c.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(c.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case c.braceL:return this.overrideContext(k.b_expr),this.parseObj(!1,e);case c._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case c._class:return this.parseClass(this.startNode(),!1);case c._new:return this.parseNew();case c.backQuote:return this.parseTemplate();case c._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};E.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case c.parenL:return this.parseDynamicImport(e);case c.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}};E.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(c.parenR)){var t=this.start;this.eat(c.comma)&&this.eat(c.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};E.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};E.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};E.parseParenExpression=function(){this.expect(c.parenL);var e=this.parseExpression();return this.expect(c.parenR),e};E.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,n,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,u=this.startLoc,l=[],p=!0,f=!1,d=new ge,m=this.yieldPos,v=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==c.parenR;)if(p?p=!1:this.expect(c.comma),s&&this.afterTrailingComma(c.parenR,!0)){f=!0;break}else if(this.type===c.ellipsis){g=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else l.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var S=this.lastTokEnd,R=this.lastTokEndLoc;if(this.expect(c.parenR),e&&!this.canInsertSemicolon()&&this.eat(c.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=v,this.parseParenArrowList(i,r,l,t);(!l.length||f)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(d,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=v||this.awaitPos,l.length>1?(n=this.startNodeAt(a,u),n.expressions=l,this.finishNodeAt(n,"SequenceExpression",S,R)):n=l[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var P=this.startNodeAt(i,r);return P.expression=n,this.finishNode(P,"ParenthesizedExpression")}else return n};E.parseParenItem=function(e){return e};E.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var Ki=[];E.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(c.dot)){e.meta=t;var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,n=this.startLoc,s=this.type===c._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,n,!0,!1),s&&e.callee.type==="ImportExpression"&&this.raise(r,"Cannot use new with import()"),this.eat(c.parenL)?e.arguments=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ki,this.finishNode(e,"NewExpression")};E.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===c.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
4
|
-
`),cooked:this.value},this.next(),i.tail=this.type===c.backQuote,this.finishNode(i,"TemplateElement")};E.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===c.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(c.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(c.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};E.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===c.name||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===c.star)&&!M.test(this.input.slice(this.lastTokEnd,this.start))};E.parseObj=function(e,t){var i=this.startNode(),r=!0,n={};for(i.properties=[],this.next();!this.eat(c.braceR);){if(r)r=!1;else if(this.expect(c.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(c.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,n,t),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};E.parseProperty=function(e,t){var i=this.startNode(),r,n,s,a;if(this.options.ecmaVersion>=9&&this.eat(c.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===c.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(s=this.start,a=this.startLoc),e||(r=this.eat(c.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(c.star),this.parsePropertyName(i)):n=!1,this.parsePropertyValue(i,e,r,n,s,a,t,u),this.finishNode(i,"Property")};E.parsePropertyValue=function(e,t,i,r,n,s,a,u){if((i||r)&&this.type===c.colon&&this.unexpected(),this.eat(c.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===c.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r);else if(!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==c.comma&&this.type!==c.braceR&&this.type!==c.eq){(i||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var l=e.kind==="get"?0:1;if(e.value.params.length!==l){var p=e.value.start;e.kind==="get"?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=n),e.kind="init",t?e.value=this.parseMaybeDefault(n,s,this.copyNode(e.key)):this.type===c.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};E.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(c.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(c.bracketR),e.key;e.computed=!1}return e.key=this.type===c.num||this.type===c.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};E.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};E.parseMethod=function(e,t,i){var r=this.startNode(),n=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ve(t,r.generator)|Be|(i?St:0)),this.expect(c.parenL),r.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")};E.parseArrowExpression=function(e,t,i,r){var n=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(Ve(i,!1)|Et),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};E.parseFunctionBody=function(e,t,i,r){var n=t&&this.type!==c.braceL,s=this.strict,a=!1;if(n)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!s||u)&&(a=this.strictDirective(this.end),a&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var l=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!s&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Rt),e.body=this.parseBlock(!1,void 0,a&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()};E.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0};E.checkParams=function(e,t){for(var i=Object.create(null),r=0,n=e.params;r<n.length;r+=1){var s=n[r];this.checkLValInnerPattern(s,Fe,t?null:i)}};E.parseExprList=function(e,t,i,r){for(var n=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(c.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===c.comma?a=null:this.type===c.ellipsis?(a=this.parseSpread(r),r&&this.type===c.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),n.push(a)}return n};E.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var n=this.strict?this.reservedWordsStrict:this.reservedWords;n.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}};E.parseIdent=function(e){var t=this.startNode();return this.type===c.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};E.parsePrivateIdent=function(){var e=this.startNode();return this.type===c.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e),e};E.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===c.semi||this.canInsertSemicolon()||this.type!==c.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(c.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};E.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var pe=N.prototype;pe.raise=function(e,t){var i=yt(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};pe.raiseRecoverable=pe.raise;pe.curPosition=function(){if(this.options.locations)return new ie(this.curLine,this.pos-this.lineStart)};var K=N.prototype,Xi=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};K.enterScope=function(e){this.scopeStack.push(new Xi(e))};K.exitScope=function(){this.scopeStack.pop()};K.treatFunctionsAsVarInScope=function(e){return e.flags&Z||!this.inModule&&e.flags&re};K.declareName=function(e,t,i){var r=!1;if(t===H){var n=this.currentScope();r=n.lexical.indexOf(e)>-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&n.flags&re&&delete this.undefinedExports[e]}else if(t===Ct){var s=this.currentScope();s.lexical.push(e)}else if(t===_t){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var u=this.scopeStack.length-1;u>=0;--u){var l=this.scopeStack[u];if(l.lexical.indexOf(e)>-1&&!(l.flags&xt&&l.lexical[0]===e)||!this.treatFunctionsAsVarInScope(l)&&l.functions.indexOf(e)>-1){r=!0;break}if(l.var.push(e),this.inModule&&l.flags&re&&delete this.undefinedExports[e],l.flags&Le)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};K.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};K.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};K.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Le)return t}};K.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Le&&!(t.flags&Et))return t}};var ve=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new me(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},oe=N.prototype;oe.startNode=function(){return new ve(this,this.start,this.startLoc)};oe.startNodeAt=function(e,t){return new ve(this,e,t)};function Nt(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}oe.finishNode=function(e,t){return Nt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};oe.finishNodeAt=function(e,t,i,r){return Nt.call(this,e,t,i,r)};oe.copyNode=function(e){var t=new ve(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Pt="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Tt=Pt+" Extended_Pictographic",Ot=Tt,It=Ot+" EBase EComp EMod EPres ExtPict",At=It,Ji=At,Qi={9:Pt,10:Tt,11:Ot,12:It,13:At,14:Ji},Xe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Bt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Lt=Bt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Vt=Lt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ft=Vt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Mt=Ft+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Zi=Mt+" Kawi Nag_Mundari Nagm",er={9:Bt,10:Lt,11:Vt,12:Ft,13:Mt,14:Zi},Ut={};function tr(e){var t=Ut[e]={binary:X(Qi[e]+" "+Xe),nonBinary:{General_Category:X(Xe),Script:X(er[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Se=0,Je=[9,10,11,12,13,14];Se<Je.length;Se+=1){var ir=Je[Se];tr(ir)}var y=N.prototype,q=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":""),this.unicodeProperties=Ut[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};q.prototype.reset=function(t,i,r){var n=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9};q.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};q.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,n=r.length;if(t>=n)return-1;var s=r.charCodeAt(t);if(!(i||this.switchU)||s<=55295||s>=57344||t+1>=n)return s;var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(s<<10)+a-56613888:s};q.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,n=r.length;if(t>=n)return n;var s=r.charCodeAt(t),a;return!(i||this.switchU)||s<=55295||s>=57344||t+1>=n||(a=r.charCodeAt(t+1))<56320||a>57343?t+1:t+2};q.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};q.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};q.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};q.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};y.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=0;r<i.length;r++){var n=i.charAt(r);t.indexOf(n)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(n,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}};y.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};y.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames.indexOf(r)===-1&&e.raise("Invalid named capture referenced")}};y.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};y.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};y.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};y.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};y.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};y.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};y.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return n!==-1&&n<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};y.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};y.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};y.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1};y.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};y.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};y.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};y.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Dt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Dt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}y.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Dt(i);)e.advance();return e.pos!==t};y.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};y.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};y.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};y.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=z(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=z(e.lastIntValue);return!0}return!1};y.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),rr(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function rr(e){return Y(e,!0)||e===36||e===95}y.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),nr(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function nr(e){return J(e,!0)||e===36||e===95||e===8204||e===8205}y.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};y.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};y.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};y.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};y.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};y.regexp_eatZero=function(e){return e.current()===48&&!ye(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};y.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};y.regexp_eatControlLetter=function(e){var t=e.current();return jt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function jt(e){return e>=65&&e<=90||e>=97&&e<=122}y.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(r&&n>=55296&&n<=56319){var s=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(n-55296)*1024+(a-56320)+65536,!0}e.pos=s,e.lastIntValue=n}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&sr(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function sr(e){return e>=0&&e<=1114111}y.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};y.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};y.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(ar(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1};function ar(e){return e===100||e===68||e===115||e===83||e===119||e===87}y.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n),!0}return!1};y.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){se(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};y.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")};y.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";$t(t=e.current());)e.lastStringValue+=z(t),e.advance();return e.lastStringValue!==""};function $t(e){return jt(e)||e===95}y.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";or(t=e.current());)e.lastStringValue+=z(t),e.advance();return e.lastStringValue!==""};function or(e){return $t(e)||ye(e)}y.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};y.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1};y.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};y.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||Ht(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};y.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};y.regexp_eatClassControlLetter=function(e){var t=e.current();return ye(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};y.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};y.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ye(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function ye(e){return e>=48&&e<=57}y.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Gt(i=e.current());)e.lastIntValue=16*e.lastIntValue+Wt(i),e.advance();return e.pos!==t};function Gt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Wt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}y.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};y.regexp_eatOctalDigit=function(e){var t=e.current();return Ht(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Ht(e){return e>=48&&e<=55}y.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var n=e.current();if(!Gt(n))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Wt(n),e.advance()}return!0};var Ue=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new me(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},x=N.prototype;x.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ue(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};x.getToken=function(){return this.next(),new Ue(this)};typeof Symbol<"u"&&(x[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===c.eof,value:t}}}});x.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(c.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};x.readToken=function(e){return Y(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};x.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};x.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,n=t;(r=mt(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};x.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Q(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};x.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&>.test(String.fromCharCode(e)))++this.pos;else break e}}};x.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};x.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(c.ellipsis)):(++this.pos,this.finishToken(c.dot))};x.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(c.assign,2):this.finishOp(c.slash,1)};x.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?c.star:c.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=c.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(c.assign,i+1):this.finishOp(r,i)};x.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(c.assign,3)}return this.finishOp(e===124?c.logicalOR:c.logicalAND,2)}return t===61?this.finishOp(c.assign,2):this.finishOp(e===124?c.bitwiseOR:c.bitwiseAND,1)};x.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(c.assign,2):this.finishOp(c.bitwiseXOR,1)};x.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||M.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(c.incDec,2):t===61?this.finishOp(c.assign,2):this.finishOp(c.plusMin,1)};x.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(c.assign,i+1):this.finishOp(c.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(c.relational,i))};x.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(c.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(c.arrow)):this.finishOp(e===61?c.eq:c.prefix,1)};x.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(c.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(c.assign,3)}return this.finishOp(c.coalesce,2)}}return this.finishOp(c.question,1)};x.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Y(t,!0)||t===92))return this.finishToken(c.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+z(t)+"'")};x.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(c.parenL);case 41:return++this.pos,this.finishToken(c.parenR);case 59:return++this.pos,this.finishToken(c.semi);case 44:return++this.pos,this.finishToken(c.comma);case 91:return++this.pos,this.finishToken(c.bracketL);case 93:return++this.pos,this.finishToken(c.bracketR);case 123:return++this.pos,this.finishToken(c.braceL);case 125:return++this.pos,this.finishToken(c.braceR);case 58:return++this.pos,this.finishToken(c.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(c.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(c.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+z(e)+"'")};x.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};x.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(M.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var u=this.regexpState||(this.regexpState=new q(this));u.reset(i,n,a),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var l=null;try{l=new RegExp(n,a)}catch{}return this.finishToken(c.regexp,{pattern:n,flags:a,value:l})};x.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,n=i&&this.input.charCodeAt(this.pos)===48,s=this.pos,a=0,u=0,l=0,p=t==null?1/0:t;l<p;++l,++this.pos){var f=this.input.charCodeAt(this.pos),d=void 0;if(r&&f===95){n&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),l===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=f;continue}if(f>=97?d=f-97+10:f>=65?d=f-65+10:f>=48&&f<=57?d=f-48:d=1/0,d>=e)break;u=f,a=a*e+d}return r&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||t!=null&&this.pos-s!==t?null:a};function ur(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Yt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}x.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Yt(this.input.slice(t,this.pos)),++this.pos):Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,i)};x.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var n=Yt(this.input.slice(t,this.pos));return++this.pos,Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,n)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s=ur(this.input.slice(t,this.pos),i);return this.finishToken(c.num,s)};x.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};x.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Q(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(c.string,t)};var qt={};x.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===qt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};x.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw qt;this.raise(e,t)};x.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===c.template||this.type===c.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(c.dollarBraceL)):(++this.pos,this.finishToken(c.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(c.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Q(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
1
|
+
"use strict";const h=require("vue");function de(e={},t,i){const r={};for(const n in e){if(!e[n]||i&&!n.startsWith(t))continue;const s=i?n.replace(t,""):n;r[s]=e[n]}return r}const Pi=h.defineComponent({name:"builder-button",props:["attributes","text","link","openLinkInNewTab"],data(){return{filterAttrs:de}},methods:{_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}});const w=(e,t)=>{const i=e.__vccOpts||e;for(const[r,n]of t)i[r]=n;return i},Ti=["href","target"];function Oi(e,t,i,r,n,s){return e.link?(h.openBlock(),h.createElementBlock("a",h.mergeProps({key:0,role:"button",href:e.link,target:e.openLinkInNewTab?"_blank":void 0},e.filterAttrs(e.attributes,"v-on:",!1),h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),h.toDisplayString(e.text),17,Ti)):(h.openBlock(),h.createElementBlock("button",h.mergeProps({key:1,style:e.attributes.style,class:e._classStringToObject(e.attributes.class+" button-2btisl9m7v3")},e.filterAttrs(e.attributes,"v-on:",!1),h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),h.toDisplayString(e.text),17))}const ct=w(Pi,[["render",Oi],["__scopeId","data-v-f2ef3d85"]]),me=e=>JSON.parse(JSON.stringify(e)),lt={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},qe=(e,t=lt)=>`@media (max-width: ${t[e].max}px)`,ht=({small:e,medium:t})=>{const i=me(lt);if(!e||!t)return i;const r=Math.floor(e/2);i.small={max:e,min:r,default:r+1};const n=i.small.max+1;i.medium={max:t,min:n,default:n+1};const s=i.medium.max+1;return i.large={max:2e3,min:s,default:s+1},i},G="vue3",ue="[Builder.io]: ",B={log:(...e)=>console.log(ue,...e),error:(...e)=>console.error(ue,...e),warn:(...e)=>console.warn(ue,...e),debug:(...e)=>console.debug(ue,...e)};function T(){return typeof window<"u"&&typeof document<"u"}function Ii(){return T()&&window.self!==window.top}function j(){return Ii()&&window.location.search.indexOf("builder.frameEditing=")!==-1}function Ai(){const e=()=>{var t;return typeof process<"u"&&((t=process==null?void 0:process.versions)==null?void 0:t.node)};return!T()&&!e()}const pt=(e,t,i)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((n,s,a)=>Object(n[s])===n[s]?n[s]:n[s]=Math.abs(Number(r[a+1]))>>0===+r[a+1]?[]:{},e)[r[r.length-1]]=i,e};var Bi=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],ft=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],Li="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F",dt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",xe={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Se="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Vi={5:Se,"5module":Se+" export import",6:Se+" const class extends export import super"},Fi=/^in(stanceof)?$/,Mi=new RegExp("["+dt+"]"),Ui=new RegExp("["+dt+Li+"]");function ke(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return!1;if(i+=t[r+1],i>=e)return!0}return!1}function Y(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Mi.test(String.fromCharCode(e)):t===!1?!1:ke(e,ft)}function J(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ui.test(String.fromCharCode(e)):t===!1?!1:ke(e,ft)||ke(e,Bi)}var C=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function L(e,t){return new C(e,{beforeExpr:!0,binop:t})}var V={beforeExpr:!0},A={startsExpr:!0},Ie={};function _(e,t){return t===void 0&&(t={}),t.keyword=e,Ie[e]=new C(e,t)}var c={num:new C("num",A),regexp:new C("regexp",A),string:new C("string",A),name:new C("name",A),privateId:new C("privateId",A),eof:new C("eof"),bracketL:new C("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new C("]"),braceL:new C("{",{beforeExpr:!0,startsExpr:!0}),braceR:new C("}"),parenL:new C("(",{beforeExpr:!0,startsExpr:!0}),parenR:new C(")"),comma:new C(",",V),semi:new C(";",V),colon:new C(":",V),dot:new C("."),question:new C("?",V),questionDot:new C("?."),arrow:new C("=>",V),template:new C("template"),invalidTemplate:new C("invalidTemplate"),ellipsis:new C("...",V),backQuote:new C("`",A),dollarBraceL:new C("${",{beforeExpr:!0,startsExpr:!0}),eq:new C("=",{beforeExpr:!0,isAssign:!0}),assign:new C("_=",{beforeExpr:!0,isAssign:!0}),incDec:new C("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new C("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:L("||",1),logicalAND:L("&&",2),bitwiseOR:L("|",3),bitwiseXOR:L("^",4),bitwiseAND:L("&",5),equality:L("==/!=/===/!==",6),relational:L("</>/<=/>=",7),bitShift:L("<</>>/>>>",8),plusMin:new C("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:L("%",10),star:L("*",10),slash:L("/",10),starstar:new C("**",{beforeExpr:!0}),coalesce:L("??",1),_break:_("break"),_case:_("case",V),_catch:_("catch"),_continue:_("continue"),_debugger:_("debugger"),_default:_("default",V),_do:_("do",{isLoop:!0,beforeExpr:!0}),_else:_("else",V),_finally:_("finally"),_for:_("for",{isLoop:!0}),_function:_("function",A),_if:_("if"),_return:_("return",V),_switch:_("switch"),_throw:_("throw",V),_try:_("try"),_var:_("var"),_const:_("const"),_while:_("while",{isLoop:!0}),_with:_("with"),_new:_("new",{beforeExpr:!0,startsExpr:!0}),_this:_("this",A),_super:_("super",A),_class:_("class",A),_extends:_("extends",V),_export:_("export"),_import:_("import",A),_null:_("null",A),_true:_("true",A),_false:_("false",A),_in:_("in",{beforeExpr:!0,binop:7}),_instanceof:_("instanceof",{beforeExpr:!0,binop:7}),_typeof:_("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},M=/\r\n?|\n|\u2028|\u2029/,Di=new RegExp(M.source,"g");function Q(e){return e===10||e===13||e===8232||e===8233}function mt(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var n=e.charCodeAt(r);if(Q(n))return r<i-1&&n===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var gt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,F=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,vt=Object.prototype,ji=vt.hasOwnProperty,$i=vt.toString,se=Object.hasOwn||function(e,t){return ji.call(e,t)},ze=Array.isArray||function(e){return $i.call(e)==="[object Array]"};function X(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function z(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Gi=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ie=function(t,i){this.line=t,this.column=i};ie.prototype.offset=function(t){return new ie(this.line,this.column+t)};var ge=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function yt(e,t){for(var i=1,r=0;;){var n=mt(e,r,t);if(n<0)return new ie(i,t-r);++i,r=n}}var we={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Ke=!1;function Wi(e){var t={};for(var i in we)t[i]=e&&se(e,i)?e[i]:we[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Ke&&typeof console=="object"&&console.warn&&(Ke=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
+
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ze(t.onToken)){var r=t.onToken;t.onToken=function(n){return r.push(n)}}return ze(t.onComment)&&(t.onComment=Hi(t,t.onComment)),t}function Hi(e,t){return function(i,r,n,s,a,u){var l={type:i?"Block":"Line",value:r,start:n,end:s};e.locations&&(l.loc=new ge(this,a,u)),e.ranges&&(l.range=[n,s]),t.push(l)}}var re=1,Z=2,Ae=4,bt=8,Et=16,xt=32,Be=64,St=128,ae=256,Le=re|Z|ae;function Ve(e,t){return Z|(e?Ae:0)|(t?bt:0)}var le=0,Fe=1,H=2,_t=3,Ct=4,Rt=5,N=function(t,i,r){this.options=t=Wi(t),this.sourceFile=t.sourceFile,this.keywords=X(Vi[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var n="";t.allowReserved!==!0&&(n=xe[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(n+=" await")),this.reservedWords=X(n);var s=(n?n+" ":"")+xe.strict;this.reservedWordsStrict=X(s),this.reservedWordsStrictBind=X(s+" "+xe.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
|
|
3
|
+
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(M).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=c.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(re),this.regexpState=null,this.privateNameStack=[]},W={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};N.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};W.inFunction.get=function(){return(this.currentVarScope().flags&Z)>0};W.inGenerator.get=function(){return(this.currentVarScope().flags&bt)>0&&!this.currentVarScope().inClassFieldInit};W.inAsync.get=function(){return(this.currentVarScope().flags&Ae)>0&&!this.currentVarScope().inClassFieldInit};W.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&ae)return!1;if(t.flags&Z)return(t.flags&Ae)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};W.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&Be)>0||i||this.options.allowSuperOutsideMethod};W.allowDirectSuper.get=function(){return(this.currentThisScope().flags&St)>0};W.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};W.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(Z|ae))>0||i};W.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ae)>0};N.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,n=0;n<t.length;n++)r=t[n](r);return r};N.parse=function(t,i){return new this(i,t).parse()};N.parseExpressionAt=function(t,i,r){var n=new this(r,t,i);return n.nextToken(),n.parseExpression()};N.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(N.prototype,W);var I=N.prototype,Yi=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;I.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){F.lastIndex=e,e+=F.exec(this.input)[0].length;var t=Yi.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){F.lastIndex=e+t[0].length;var i=F.exec(this.input),r=i.index+i[0].length,n=this.input.charAt(r);return n===";"||n==="}"||M.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||n==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,F.lastIndex=e,e+=F.exec(this.input)[0].length,this.input[e]===";"&&e++}};I.eat=function(e){return this.type===e?(this.next(),!0):!1};I.isContextual=function(e){return this.type===c.name&&this.value===e&&!this.containsEsc};I.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};I.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};I.canInsertSemicolon=function(){return this.type===c.eof||this.type===c.braceR||M.test(this.input.slice(this.lastTokEnd,this.start))};I.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};I.semicolon=function(){!this.eat(c.semi)&&!this.insertSemicolon()&&this.unexpected()};I.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};I.expect=function(e){this.eat(e)||this.unexpected()};I.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var ve=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};I.checkPatternErrors=function(e,t){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};I.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};I.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};I.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var b=N.prototype;b.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==c.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,n=Object.keys(this.undefinedExports);r<n.length;r+=1){var s=n[r];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Me={kind:"loop"},qi={kind:"switch"};b.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;F.lastIndex=this.pos;var t=F.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(Y(r,!0)){for(var n=i+1;J(r=this.input.charCodeAt(n),!0);)++n;if(r===92||r>55295&&r<56320)return!0;var s=this.input.slice(i,n);if(!Fi.test(s))return!0}return!1};b.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;F.lastIndex=this.pos;var e=F.exec(this.input),t=this.pos+e[0].length,i;return!M.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(J(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};b.parseStatement=function(e,t,i){var r=this.type,n=this.startNode(),s;switch(this.isLet(e)&&(r=c._var,s="let"),r){case c._break:case c._continue:return this.parseBreakContinueStatement(n,r.keyword);case c._debugger:return this.parseDebuggerStatement(n);case c._do:return this.parseDoStatement(n);case c._for:return this.parseForStatement(n);case c._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(n,!1,!e);case c._class:return e&&this.unexpected(),this.parseClass(n,!0);case c._if:return this.parseIfStatement(n);case c._return:return this.parseReturnStatement(n);case c._switch:return this.parseSwitchStatement(n);case c._throw:return this.parseThrowStatement(n);case c._try:return this.parseTryStatement(n);case c._const:case c._var:return s=s||this.value,e&&s!=="var"&&this.unexpected(),this.parseVarStatement(n,s);case c._while:return this.parseWhileStatement(n);case c._with:return this.parseWithStatement(n);case c.braceL:return this.parseBlock(!0,n);case c.semi:return this.parseEmptyStatement(n);case c._export:case c._import:if(this.options.ecmaVersion>10&&r===c._import){F.lastIndex=this.pos;var a=F.exec(this.input),u=this.pos+a[0].length,l=this.input.charCodeAt(u);if(l===40||l===46)return this.parseExpressionStatement(n,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===c._import?this.parseImport(n):this.parseExport(n,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(n,!0,!e);var p=this.value,f=this.parseExpression();return r===c.name&&f.type==="Identifier"&&this.eat(c.colon)?this.parseLabeledStatement(n,p,f,e):this.parseExpressionStatement(n,f)}};b.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(c.semi)||this.insertSemicolon()?e.label=null:this.type!==c.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var n=this.labels[r];if((e.label==null||n.name===e.label.name)&&(n.kind!=null&&(i||n.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};b.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};b.parseDoStatement=function(e){return this.next(),this.labels.push(Me),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(c._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(c.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};b.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Me),this.enterScope(0),this.expect(c.parenL),this.type===c.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===c._var||this.type===c._const||i){var r=this.startNode(),n=i?"let":this.value;return this.next(),this.parseVar(r,!0,n),this.finishNode(r,"VariableDeclaration"),(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=this.isContextual("let"),a=!1,u=new ve,l=this.parseExpression(t>-1?"await":!0,u);return this.type===c._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),s&&a&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,u),this.checkLValPattern(l),this.parseForIn(e,l)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,l))};b.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,te|(i?0:Ne),!1,t)};b.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(c._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};b.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(c.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};b.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(c.braceL),this.labels.push(qi),this.enterScope(0);for(var t,i=!1;this.type!==c.braceR;)if(this.type===c._case||this.type===c._default){var r=this.type===c._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(c.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};b.parseThrowStatement=function(e){return this.next(),M.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var zi=[];b.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===c._catch){var t=this.startNode();if(this.next(),this.eat(c.parenL)){t.param=this.parseBindingAtom();var i=t.param.type==="Identifier";this.enterScope(i?xt:0),this.checkLValPattern(t.param,i?Ct:H),this.expect(c.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(c._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};b.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};b.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Me),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};b.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};b.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};b.parseLabeledStatement=function(e,t,i,r){for(var n=0,s=this.labels;n<s.length;n+=1){var a=s[n];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var u=this.type.isLoop?"loop":this.type===c._switch?"switch":null,l=this.labels.length-1;l>=0;l--){var p=this.labels[l];if(p.statementStart===e.start)p.statementStart=this.start,p.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};b.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};b.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(c.braceL),e&&this.enterScope(0);this.type!==c.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};b.parseFor=function(e,t){return e.init=t,this.expect(c.semi),e.test=this.type===c.semi?null:this.parseExpression(),this.expect(c.semi),e.update=this.type===c.parenR?null:this.parseExpression(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};b.parseForIn=function(e,t){var i=this.type===c._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};b.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(c.eq)?r.init=this.parseMaybeAssign(t):i==="const"&&!(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():r.id.type!=="Identifier"&&!(t&&(this.type===c._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(c.comma))break}return e};b.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Fe:H,!1)};var te=1,Ne=2,kt=4;b.parseFunction=function(e,t,i,r,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===c.star&&t&Ne&&this.unexpected(),e.generator=this.eat(c.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&te&&(e.id=t&kt&&this.type!==c.name?null:this.parseIdent(),e.id&&!(t&Ne)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Fe:H:_t));var s=this.yieldPos,a=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ve(e.async,e.generator)),t&te||(e.id=this.type===c.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,n),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=u,this.finishNode(e,t&te?"FunctionDeclaration":"FunctionExpression")};b.parseFunctionParams=function(e){this.expect(c.parenL),e.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};b.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),n=this.startNode(),s=!1;for(n.body=[],this.expect(c.braceL);this.type!==c.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(n.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(s&&this.raise(a.start,"Duplicate constructor in the same class"),s=!0):a.key&&a.key.type==="PrivateIdentifier"&&Ki(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};b.parseClassElement=function(e){if(this.eat(c.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",n=!1,s=!1,a="method",u=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(c.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===c.star?u=!0:r="static"}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===c.star)&&!this.canInsertSemicolon()?s=!0:r="async"),!r&&(t>=9||!s)&&this.eat(c.star)&&(n=!0),!r&&!s&&!n){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=l:r=l)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===c.parenL||a!=="method"||n||s){var p=!i.static&&he(i,"constructor"),f=p&&e;p&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=p?"constructor":a,this.parseClassMethod(i,n,s,f)}else this.parseClassField(i);return i};b.isClassElementNameStart=function(){return this.type===c.name||this.type===c.privateId||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword};b.parseClassElementName=function(e){this.type===c.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};b.parseClassMethod=function(e,t,i,r){var n=e.key;e.kind==="constructor"?(t&&this.raise(n.start,"Constructor can't be a generator"),i&&this.raise(n.start,"Constructor can't be an async method")):e.static&&he(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&s.params.length!==0&&this.raiseRecoverable(s.start,"getter should have no params"),e.kind==="set"&&s.params.length!==1&&this.raiseRecoverable(s.start,"setter should have exactly one param"),e.kind==="set"&&s.params[0].type==="RestElement"&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};b.parseClassField=function(e){if(he(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&he(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(c.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};b.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ae|Be);this.type!==c.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};b.parseClassId=function(e,t){this.type===c.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,H,!1)):(t===!0&&this.unexpected(),e.id=null)};b.parseClassSuper=function(e){e.superClass=this.eat(c._extends)?this.parseExprSubscripts(null,!1):null};b.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};b.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,i=e.used,r=this.privateNameStack.length,n=r===0?null:this.privateNameStack[r-1],s=0;s<i.length;++s){var a=i[s];se(t,a.name)||(n?n.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function Ki(e,t){var i=t.key.name,r=e[i],n="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(n=(t.static?"s":"i")+t.kind),r==="iget"&&n==="iset"||r==="iset"&&n==="iget"||r==="sget"&&n==="sset"||r==="sset"&&n==="sget"?(e[i]="true",!1):r?!0:(e[i]=n,!1)}function he(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}b.parseExport=function(e,t){if(this.next(),this.eat(c.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(c._default)){this.checkExport(t,"default",this.lastTokStart);var i;if(this.type===c._function||(i=this.isAsyncFunction())){var r=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(r,te|kt,!1,i)}else if(this.type===c._class){var n=this.startNode();e.declaration=this.parseClass(n,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s<a.length;s+=1){var u=a[s];this.checkUnreserved(u.local),this.checkLocalExport(u.local),u.local.type==="Literal"&&this.raise(u.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};b.checkExport=function(e,t,i){!e||(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),se(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};b.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,n=t.properties;r<n.length;r+=1){var s=n[r];this.checkPatternExport(e,s)}else if(i==="ArrayPattern")for(var a=0,u=t.elements;a<u.length;a+=1){var l=u[a];l&&this.checkPatternExport(e,l)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"?this.checkPatternExport(e,t.argument):i==="ParenthesizedExpression"&&this.checkPatternExport(e,t.expression)};b.checkVariableExport=function(e,t){if(!!e)for(var i=0,r=t;i<r.length;i+=1){var n=r[i];this.checkPatternExport(e,n.id)}};b.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};b.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(c.braceL);!this.eat(c.braceR);){if(i)i=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var r=this.startNode();r.local=this.parseModuleExportName(),r.exported=this.eatContextual("as")?this.parseModuleExportName():r.local,this.checkExport(e,r.exported,r.exported.start),t.push(this.finishNode(r,"ExportSpecifier"))}return t};b.parseImport=function(e){return this.next(),this.type===c.string?(e.specifiers=zi,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===c.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};b.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===c.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLValSimple(i.local,H),e.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(c.comma))return e}if(this.type===c.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLValSimple(r.local,H),e.push(this.finishNode(r,"ImportNamespaceSpecifier")),e}for(this.expect(c.braceL);!this.eat(c.braceR);){if(t)t=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var n=this.startNode();n.imported=this.parseModuleExportName(),this.eatContextual("as")?n.local=this.parseIdent():(this.checkUnreserved(n.imported),n.local=n.imported),this.checkLValSimple(n.local,H),e.push(this.finishNode(n,"ImportSpecifier"))}return e};b.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===c.string){var e=this.parseLiteral(this.value);return Gi.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};b.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};b.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var D=N.prototype;D.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,n=e.properties;r<n.length;r+=1){var s=n[r];this.toAssignable(s,t),s.type==="RestElement"&&(s.argument.type==="ArrayPattern"||s.argument.type==="ObjectPattern")&&this.raise(s.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};D.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var n=e[r];n&&this.toAssignable(n,t)}if(i){var s=e[i-1];this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return e};D.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};D.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==c.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};D.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case c.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(c.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case c.braceL:return this.parseObj(!0)}return this.parseIdent()};D.parseBindingList=function(e,t,i){for(var r=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(c.comma),t&&this.type===c.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===c.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),r.push(s),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else{var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),r.push(a)}}return r};D.parseBindingListItem=function(e){return e};D.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(c.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};D.checkLValSimple=function(e,t,i){t===void 0&&(t=le);var r=t!==le;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===H&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(se(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Rt&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};D.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=le),e.type){case"ObjectPattern":for(var r=0,n=e.properties;r<n.length;r+=1){var s=n[r];this.checkLValInnerPattern(s,t,i)}break;case"ArrayPattern":for(var a=0,u=e.elements;a<u.length;a+=1){var l=u[a];l&&this.checkLValInnerPattern(l,t,i)}break;default:this.checkLValSimple(e,t,i)}};D.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=le),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var U=function(t,i,r,n,s){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=n,this.generator=!!s},k={b_stat:new U("{",!1),b_expr:new U("{",!0),b_tmpl:new U("${",!1),p_stat:new U("(",!1),p_expr:new U("(",!0),q_tmpl:new U("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new U("function",!1),f_expr:new U("function",!0),f_expr_gen:new U("function",!0,!1,null,!0),f_gen:new U("function",!1,!1,null,!0)},ee=N.prototype;ee.initialContext=function(){return[k.b_stat]};ee.curContext=function(){return this.context[this.context.length-1]};ee.braceIsBlock=function(e){var t=this.curContext();return t===k.f_expr||t===k.f_stat?!0:e===c.colon&&(t===k.b_stat||t===k.b_expr)?!t.isExpr:e===c._return||e===c.name&&this.exprAllowed?M.test(this.input.slice(this.lastTokEnd,this.start)):e===c._else||e===c.semi||e===c.eof||e===c.parenR||e===c.arrow?!0:e===c.braceL?t===k.b_stat:e===c._var||e===c._const||e===c.name?!1:!this.exprAllowed};ee.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};ee.updateContext=function(e){var t,i=this.type;i.keyword&&e===c.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};ee.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};c.parenR.updateContext=c.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===k.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};c.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?k.b_stat:k.b_expr),this.exprAllowed=!0};c.dollarBraceL.updateContext=function(){this.context.push(k.b_tmpl),this.exprAllowed=!0};c.parenL.updateContext=function(e){var t=e===c._if||e===c._for||e===c._with||e===c._while;this.context.push(t?k.p_stat:k.p_expr),this.exprAllowed=!0};c.incDec.updateContext=function(){};c._function.updateContext=c._class.updateContext=function(e){e.beforeExpr&&e!==c._else&&!(e===c.semi&&this.curContext()!==k.p_stat)&&!(e===c._return&&M.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===c.colon||e===c.braceL)&&this.curContext()===k.b_stat)?this.context.push(k.f_expr):this.context.push(k.f_stat),this.exprAllowed=!1};c.backQuote.updateContext=function(){this.curContext()===k.q_tmpl?this.context.pop():this.context.push(k.q_tmpl),this.exprAllowed=!1};c.star.updateContext=function(e){if(e===c._function){var t=this.context.length-1;this.context[t]===k.f_expr?this.context[t]=k.f_expr_gen:this.context[t]=k.f_gen}this.exprAllowed=!0};c.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==c.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var E=N.prototype;E.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,n;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6){n==="__proto__"&&s==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}n="$"+n;var a=t[n];if(a){var u;s==="init"?u=this.strict&&a.init||a.get||a.set:u=a.init||a[s],u&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[n]={init:!1,get:!1,set:!1};a[s]=!0}};E.parseExpression=function(e,t){var i=this.start,r=this.startLoc,n=this.parseMaybeAssign(e,t);if(this.type===c.comma){var s=this.startNodeAt(i,r);for(s.expressions=[n];this.eat(c.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return n};E.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,n=-1,s=-1,a=-1;t?(n=t.parenthesizedAssign,s=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ve,r=!0);var u=this.start,l=this.startLoc;(this.type===c.parenL||this.type===c.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var p=this.parseMaybeConditional(e,t);if(i&&(p=i.call(this,p,u,l)),this.type.isAssign){var f=this.startNodeAt(u,l);return f.operator=this.value,this.type===c.eq&&(p=this.toAssignable(p,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=p.start&&(t.shorthandAssign=-1),this.type===c.eq?this.checkLValPattern(p):this.checkLValSimple(p),f.left=p,this.next(),f.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(f,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return n>-1&&(t.parenthesizedAssign=n),s>-1&&(t.trailingComma=s),p};E.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return n;if(this.eat(c.question)){var s=this.startNodeAt(i,r);return s.test=n,s.consequent=this.parseMaybeAssign(),this.expect(c.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return n};E.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,n=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||n.start===i&&n.type==="ArrowFunctionExpression"?n:this.parseExprOp(n,i,r,-1,e)};E.parseExprOp=function(e,t,i,r,n){var s=this.type.binop;if(s!=null&&(!n||this.type!==c._in)&&s>r){var a=this.type===c.logicalOR||this.type===c.logicalAND,u=this.type===c.coalesce;u&&(s=c.logicalAND.binop);var l=this.value;this.next();var p=this.start,f=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,n),p,f,s,n),m=this.buildBinary(t,i,e,d,l,a||u);return(a&&this.type===c.coalesce||u&&(this.type===c.logicalOR||this.type===c.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(m,t,i,r,n)}return e};E.buildBinary=function(e,t,i,r,n,s){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=n,a.right=r,this.finishNode(a,s?"LogicalExpression":"BinaryExpression")};E.parseMaybeUnary=function(e,t,i,r){var n=this.start,s=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),t=!0;else if(this.type.prefix){var u=this.startNode(),l=this.type===c.incDec;u.operator=this.value,u.prefix=!0,this.next(),u.argument=this.parseMaybeUnary(null,!0,l,r),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&u.argument.type==="Identifier"?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&wt(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(u,l?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===c.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==c._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var p=this.startNodeAt(n,s);p.operator=this.value,p.prefix=!1,p.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(p,"UpdateExpression")}}if(!i&&this.eat(c.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(n,s,a,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return a};function wt(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&wt(e.expression)}E.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,n=this.parseExprAtom(e,t);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return n;var s=this.parseSubscripts(n,i,r,!1,t);return e&&s.type==="MemberExpression"&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),s};E.parseSubscripts=function(e,t,i,r,n){for(var s=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var u=this.parseSubscript(e,t,i,r,s,a,n);if(u.optional&&(a=!0),u===e||u.type==="ArrowFunctionExpression"){if(a){var l=this.startNodeAt(t,i);l.expression=u,u=this.finishNode(l,"ChainExpression")}return u}e=u}};E.parseSubscript=function(e,t,i,r,n,s,a){var u=this.options.ecmaVersion>=11,l=u&&this.eat(c.questionDot);r&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var p=this.eat(c.bracketL);if(p||l&&this.type!==c.parenL&&this.type!==c.backQuote||this.eat(c.dot)){var f=this.startNodeAt(t,i);f.object=e,p?(f.property=this.parseExpression(),this.expect(c.bracketR)):this.type===c.privateId&&e.type!=="Super"?f.property=this.parsePrivateIdent():f.property=this.parseIdent(this.options.allowReserved!=="never"),f.computed=!!p,u&&(f.optional=l),e=this.finishNode(f,"MemberExpression")}else if(!r&&this.eat(c.parenL)){var d=new ve,m=this.yieldPos,v=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var S=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1,d);if(n&&!l&&!this.canInsertSemicolon()&&this.eat(c.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=m,this.awaitPos=v,this.awaitIdentPos=g,this.parseArrowExpression(this.startNodeAt(t,i),S,!0,a);this.checkExpressionErrors(d,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=v||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var R=this.startNodeAt(t,i);R.callee=e,R.arguments=S,u&&(R.optional=l),e=this.finishNode(R,"CallExpression")}else if(this.type===c.backQuote){(l||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var P=this.startNodeAt(t,i);P.tag=e,P.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(P,"TaggedTemplateExpression")}return e};E.parseExprAtom=function(e,t){this.type===c.slash&&this.readRegexp();var i,r=this.potentialArrowAt===this.start;switch(this.type){case c._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type===c.parenL&&!this.allowDirectSuper&&this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==c.dot&&this.type!==c.bracketL&&this.type!==c.parenL&&this.unexpected(),this.finishNode(i,"Super");case c._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case c.name:var n=this.start,s=this.startLoc,a=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(c._function))return this.overrideContext(k.f_expr),this.parseFunction(this.startNodeAt(n,s),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(c.arrow))return this.parseArrowExpression(this.startNodeAt(n,s),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===c.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(c.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,s),[u],!0,t)}return u;case c.regexp:var l=this.value;return i=this.parseLiteral(l.value),i.regex={pattern:l.pattern,flags:l.flags},i;case c.num:case c.string:return this.parseLiteral(this.value);case c._null:case c._true:case c._false:return i=this.startNode(),i.value=this.type===c._null?null:this.type===c._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case c.parenL:var p=this.start,f=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),f;case c.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(c.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case c.braceL:return this.overrideContext(k.b_expr),this.parseObj(!1,e);case c._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case c._class:return this.parseClass(this.startNode(),!1);case c._new:return this.parseNew();case c.backQuote:return this.parseTemplate();case c._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};E.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case c.parenL:return this.parseDynamicImport(e);case c.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}};E.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(c.parenR)){var t=this.start;this.eat(c.comma)&&this.eat(c.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};E.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};E.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};E.parseParenExpression=function(){this.expect(c.parenL);var e=this.parseExpression();return this.expect(c.parenR),e};E.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,n,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,u=this.startLoc,l=[],p=!0,f=!1,d=new ve,m=this.yieldPos,v=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==c.parenR;)if(p?p=!1:this.expect(c.comma),s&&this.afterTrailingComma(c.parenR,!0)){f=!0;break}else if(this.type===c.ellipsis){g=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else l.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var S=this.lastTokEnd,R=this.lastTokEndLoc;if(this.expect(c.parenR),e&&!this.canInsertSemicolon()&&this.eat(c.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=v,this.parseParenArrowList(i,r,l,t);(!l.length||f)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(d,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=v||this.awaitPos,l.length>1?(n=this.startNodeAt(a,u),n.expressions=l,this.finishNodeAt(n,"SequenceExpression",S,R)):n=l[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var P=this.startNodeAt(i,r);return P.expression=n,this.finishNode(P,"ParenthesizedExpression")}else return n};E.parseParenItem=function(e){return e};E.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var Xi=[];E.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(c.dot)){e.meta=t;var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,n=this.startLoc,s=this.type===c._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,n,!0,!1),s&&e.callee.type==="ImportExpression"&&this.raise(r,"Cannot use new with import()"),this.eat(c.parenL)?e.arguments=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Xi,this.finishNode(e,"NewExpression")};E.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===c.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
4
|
+
`),cooked:this.value},this.next(),i.tail=this.type===c.backQuote,this.finishNode(i,"TemplateElement")};E.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===c.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(c.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(c.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};E.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===c.name||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===c.star)&&!M.test(this.input.slice(this.lastTokEnd,this.start))};E.parseObj=function(e,t){var i=this.startNode(),r=!0,n={};for(i.properties=[],this.next();!this.eat(c.braceR);){if(r)r=!1;else if(this.expect(c.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(c.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,n,t),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};E.parseProperty=function(e,t){var i=this.startNode(),r,n,s,a;if(this.options.ecmaVersion>=9&&this.eat(c.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===c.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(s=this.start,a=this.startLoc),e||(r=this.eat(c.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(c.star),this.parsePropertyName(i)):n=!1,this.parsePropertyValue(i,e,r,n,s,a,t,u),this.finishNode(i,"Property")};E.parsePropertyValue=function(e,t,i,r,n,s,a,u){if((i||r)&&this.type===c.colon&&this.unexpected(),this.eat(c.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===c.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r);else if(!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==c.comma&&this.type!==c.braceR&&this.type!==c.eq){(i||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var l=e.kind==="get"?0:1;if(e.value.params.length!==l){var p=e.value.start;e.kind==="get"?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=n),e.kind="init",t?e.value=this.parseMaybeDefault(n,s,this.copyNode(e.key)):this.type===c.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};E.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(c.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(c.bracketR),e.key;e.computed=!1}return e.key=this.type===c.num||this.type===c.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};E.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};E.parseMethod=function(e,t,i){var r=this.startNode(),n=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ve(t,r.generator)|Be|(i?St:0)),this.expect(c.parenL),r.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")};E.parseArrowExpression=function(e,t,i,r){var n=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(Ve(i,!1)|Et),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};E.parseFunctionBody=function(e,t,i,r){var n=t&&this.type!==c.braceL,s=this.strict,a=!1;if(n)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!s||u)&&(a=this.strictDirective(this.end),a&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var l=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!s&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Rt),e.body=this.parseBlock(!1,void 0,a&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()};E.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0};E.checkParams=function(e,t){for(var i=Object.create(null),r=0,n=e.params;r<n.length;r+=1){var s=n[r];this.checkLValInnerPattern(s,Fe,t?null:i)}};E.parseExprList=function(e,t,i,r){for(var n=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(c.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===c.comma?a=null:this.type===c.ellipsis?(a=this.parseSpread(r),r&&this.type===c.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),n.push(a)}return n};E.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var n=this.strict?this.reservedWordsStrict:this.reservedWords;n.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}};E.parseIdent=function(e){var t=this.startNode();return this.type===c.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};E.parsePrivateIdent=function(){var e=this.startNode();return this.type===c.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e),e};E.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===c.semi||this.canInsertSemicolon()||this.type!==c.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(c.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};E.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var pe=N.prototype;pe.raise=function(e,t){var i=yt(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};pe.raiseRecoverable=pe.raise;pe.curPosition=function(){if(this.options.locations)return new ie(this.curLine,this.pos-this.lineStart)};var K=N.prototype,Ji=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};K.enterScope=function(e){this.scopeStack.push(new Ji(e))};K.exitScope=function(){this.scopeStack.pop()};K.treatFunctionsAsVarInScope=function(e){return e.flags&Z||!this.inModule&&e.flags&re};K.declareName=function(e,t,i){var r=!1;if(t===H){var n=this.currentScope();r=n.lexical.indexOf(e)>-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&n.flags&re&&delete this.undefinedExports[e]}else if(t===Ct){var s=this.currentScope();s.lexical.push(e)}else if(t===_t){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var u=this.scopeStack.length-1;u>=0;--u){var l=this.scopeStack[u];if(l.lexical.indexOf(e)>-1&&!(l.flags&xt&&l.lexical[0]===e)||!this.treatFunctionsAsVarInScope(l)&&l.functions.indexOf(e)>-1){r=!0;break}if(l.var.push(e),this.inModule&&l.flags&re&&delete this.undefinedExports[e],l.flags&Le)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};K.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};K.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};K.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Le)return t}};K.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Le&&!(t.flags&Et))return t}};var ye=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new ge(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},oe=N.prototype;oe.startNode=function(){return new ye(this,this.start,this.startLoc)};oe.startNodeAt=function(e,t){return new ye(this,e,t)};function Nt(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}oe.finishNode=function(e,t){return Nt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};oe.finishNodeAt=function(e,t,i,r){return Nt.call(this,e,t,i,r)};oe.copyNode=function(e){var t=new ye(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Pt="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Tt=Pt+" Extended_Pictographic",Ot=Tt,It=Ot+" EBase EComp EMod EPres ExtPict",At=It,Qi=At,Zi={9:Pt,10:Tt,11:Ot,12:It,13:At,14:Qi},Xe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Bt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Lt=Bt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Vt=Lt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ft=Vt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Mt=Ft+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",er=Mt+" Kawi Nag_Mundari Nagm",tr={9:Bt,10:Lt,11:Vt,12:Ft,13:Mt,14:er},Ut={};function ir(e){var t=Ut[e]={binary:X(Zi[e]+" "+Xe),nonBinary:{General_Category:X(Xe),Script:X(tr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var _e=0,Je=[9,10,11,12,13,14];_e<Je.length;_e+=1){var rr=Je[_e];ir(rr)}var y=N.prototype,q=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":""),this.unicodeProperties=Ut[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};q.prototype.reset=function(t,i,r){var n=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9};q.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};q.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,n=r.length;if(t>=n)return-1;var s=r.charCodeAt(t);if(!(i||this.switchU)||s<=55295||s>=57344||t+1>=n)return s;var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(s<<10)+a-56613888:s};q.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,n=r.length;if(t>=n)return n;var s=r.charCodeAt(t),a;return!(i||this.switchU)||s<=55295||s>=57344||t+1>=n||(a=r.charCodeAt(t+1))<56320||a>57343?t+1:t+2};q.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};q.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};q.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};q.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};y.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=0;r<i.length;r++){var n=i.charAt(r);t.indexOf(n)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(n,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}};y.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};y.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames.indexOf(r)===-1&&e.raise("Invalid named capture referenced")}};y.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};y.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};y.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};y.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};y.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};y.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};y.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return n!==-1&&n<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};y.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};y.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};y.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1};y.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};y.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};y.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};y.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Dt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Dt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}y.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Dt(i);)e.advance();return e.pos!==t};y.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};y.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};y.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};y.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=z(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=z(e.lastIntValue);return!0}return!1};y.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),nr(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function nr(e){return Y(e,!0)||e===36||e===95}y.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),sr(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function sr(e){return J(e,!0)||e===36||e===95||e===8204||e===8205}y.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};y.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};y.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};y.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};y.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};y.regexp_eatZero=function(e){return e.current()===48&&!be(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};y.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};y.regexp_eatControlLetter=function(e){var t=e.current();return jt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function jt(e){return e>=65&&e<=90||e>=97&&e<=122}y.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(r&&n>=55296&&n<=56319){var s=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(n-55296)*1024+(a-56320)+65536,!0}e.pos=s,e.lastIntValue=n}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&ar(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function ar(e){return e>=0&&e<=1114111}y.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};y.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};y.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(or(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1};function or(e){return e===100||e===68||e===115||e===83||e===119||e===87}y.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n),!0}return!1};y.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){se(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};y.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")};y.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";$t(t=e.current());)e.lastStringValue+=z(t),e.advance();return e.lastStringValue!==""};function $t(e){return jt(e)||e===95}y.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ur(t=e.current());)e.lastStringValue+=z(t),e.advance();return e.lastStringValue!==""};function ur(e){return $t(e)||be(e)}y.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};y.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1};y.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};y.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||Ht(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};y.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};y.regexp_eatClassControlLetter=function(e){var t=e.current();return be(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};y.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};y.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;be(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function be(e){return e>=48&&e<=57}y.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Gt(i=e.current());)e.lastIntValue=16*e.lastIntValue+Wt(i),e.advance();return e.pos!==t};function Gt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Wt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}y.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};y.regexp_eatOctalDigit=function(e){var t=e.current();return Ht(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Ht(e){return e>=48&&e<=55}y.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var n=e.current();if(!Gt(n))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Wt(n),e.advance()}return!0};var Ue=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new ge(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},x=N.prototype;x.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ue(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};x.getToken=function(){return this.next(),new Ue(this)};typeof Symbol<"u"&&(x[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===c.eof,value:t}}}});x.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(c.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};x.readToken=function(e){return Y(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};x.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};x.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,n=t;(r=mt(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};x.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Q(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};x.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&>.test(String.fromCharCode(e)))++this.pos;else break e}}};x.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};x.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(c.ellipsis)):(++this.pos,this.finishToken(c.dot))};x.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(c.assign,2):this.finishOp(c.slash,1)};x.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?c.star:c.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=c.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(c.assign,i+1):this.finishOp(r,i)};x.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(c.assign,3)}return this.finishOp(e===124?c.logicalOR:c.logicalAND,2)}return t===61?this.finishOp(c.assign,2):this.finishOp(e===124?c.bitwiseOR:c.bitwiseAND,1)};x.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(c.assign,2):this.finishOp(c.bitwiseXOR,1)};x.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||M.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(c.incDec,2):t===61?this.finishOp(c.assign,2):this.finishOp(c.plusMin,1)};x.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(c.assign,i+1):this.finishOp(c.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(c.relational,i))};x.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(c.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(c.arrow)):this.finishOp(e===61?c.eq:c.prefix,1)};x.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(c.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(c.assign,3)}return this.finishOp(c.coalesce,2)}}return this.finishOp(c.question,1)};x.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Y(t,!0)||t===92))return this.finishToken(c.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+z(t)+"'")};x.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(c.parenL);case 41:return++this.pos,this.finishToken(c.parenR);case 59:return++this.pos,this.finishToken(c.semi);case 44:return++this.pos,this.finishToken(c.comma);case 91:return++this.pos,this.finishToken(c.bracketL);case 93:return++this.pos,this.finishToken(c.bracketR);case 123:return++this.pos,this.finishToken(c.braceL);case 125:return++this.pos,this.finishToken(c.braceR);case 58:return++this.pos,this.finishToken(c.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(c.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(c.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+z(e)+"'")};x.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};x.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(M.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var u=this.regexpState||(this.regexpState=new q(this));u.reset(i,n,a),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var l=null;try{l=new RegExp(n,a)}catch{}return this.finishToken(c.regexp,{pattern:n,flags:a,value:l})};x.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,n=i&&this.input.charCodeAt(this.pos)===48,s=this.pos,a=0,u=0,l=0,p=t==null?1/0:t;l<p;++l,++this.pos){var f=this.input.charCodeAt(this.pos),d=void 0;if(r&&f===95){n&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),l===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=f;continue}if(f>=97?d=f-97+10:f>=65?d=f-65+10:f>=48&&f<=57?d=f-48:d=1/0,d>=e)break;u=f,a=a*e+d}return r&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||t!=null&&this.pos-s!==t?null:a};function cr(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Yt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}x.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Yt(this.input.slice(t,this.pos)),++this.pos):Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,i)};x.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var n=Yt(this.input.slice(t,this.pos));return++this.pos,Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,n)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s=cr(this.input.slice(t,this.pos),i);return this.finishToken(c.num,s)};x.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};x.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Q(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(c.string,t)};var qt={};x.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===qt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};x.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw qt;this.raise(e,t)};x.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===c.template||this.type===c.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(c.dollarBraceL)):(++this.pos,this.finishToken(c.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(c.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Q(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
5
5
|
`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};x.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(c.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")};x.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
6
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return z(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(r,8);return n>255&&(r=r.slice(0,-1),n=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return Q(t)?"":String.fromCharCode(t)}};x.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};x.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var n=this.fullCharCodeAtPos();if(J(n,r))this.pos+=n<=65535?1:2;else if(n===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var s=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?Y:J)(a,r)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=z(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};x.readWord=function(){var e=this.readWord1(),t=c.name;return this.keywords.test(e)&&(t=Ie[e]),this.finishToken(t,e)};var
|
|
6
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return z(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(r,8);return n>255&&(r=r.slice(0,-1),n=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return Q(t)?"":String.fromCharCode(t)}};x.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};x.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var n=this.fullCharCodeAtPos();if(J(n,r))this.pos+=n<=65535?1:2;else if(n===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var s=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?Y:J)(a,r)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=z(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};x.readWord=function(){var e=this.readWord1(),t=c.name;return this.keywords.test(e)&&(t=Ie[e]),this.finishToken(t,e)};var lr="8.8.2";N.acorn={Parser:N,version:lr,defaultOptions:we,Position:ie,SourceLocation:ge,getLineInfo:yt,Node:ye,TokenType:C,tokTypes:c,keywordTypes:Ie,TokContext:U,tokContexts:k,isIdentifierChar:J,isIdentifierStart:Y,Token:Ue,isNewLine:Q,lineBreak:M,lineBreakG:Di,nonASCIIwhitespace:gt};function hr(e,t){return N.parse(e,t)}/**
|
|
7
7
|
* @license
|
|
8
8
|
* Copyright 2013 Google LLC
|
|
9
9
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -12,30 +12,30 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
12
12
|
`,r=0;r<i.length;r++){var f=i[r].datumLoc,d=i[r].datumName,m=f.source+":"+f.start.line+":"+f.start.column;d?p+=" at "+d+" ("+m+`)
|
|
13
13
|
`:p+=" at "+m+`
|
|
14
14
|
`}this.setProperty(e,"stack",p.trim(),o.NONENUMERABLE_DESCRIPTOR)};o.prototype.createWorker=function(){var e=this.createWorker.blob_;return e||(e=new Blob([o.WORKER_CODE.join(`
|
|
15
|
-
`)],{type:"application/javascript"}),this.createWorker.blob_=e),new Worker(URL.createObjectURL(e))};o.prototype.vmCall=function(e,t,i,r){var n={timeout:this.REGEXP_THREAD_TIMEOUT};try{return o.vm.runInNewContext(e,t,n)}catch{r(null),this.throwException(this.ERROR,"RegExp Timeout: "+i)}return o.REGEXP_TIMEOUT};o.prototype.maybeThrowRegExp=function(e,t){var i;if(this.REGEXP_MODE===0)i=!1;else if(this.REGEXP_MODE===1)i=!0;else if(o.vm)i=!0;else if(typeof Worker=="function"&&typeof URL=="function")i=!0;else if(typeof require=="function"){try{o.vm=require("vm")}catch{}i=!!o.vm}else i=!1;i||(t(null),this.throwException(this.ERROR,"Regular expressions not supported: "+e))};o.prototype.regExpTimeout=function(e,t,i){var r=this;return setTimeout(function(){t.terminate(),i(null);try{r.throwException(r.ERROR,"RegExp Timeout: "+e)}catch{}},this.REGEXP_THREAD_TIMEOUT)};o.prototype.createObject=function(e){return this.createObjectProto(e&&e.properties.prototype)};o.prototype.createObjectProto=function(e){if(typeof e!="object")throw Error("Non object prototype");var t=new o.Object(e);return this.isa(t,this.ERROR)&&(t.class="Error"),t};o.prototype.createArray=function(){var e=this.createObjectProto(this.ARRAY_PROTO);return this.setProperty(e,"length",0,{configurable:!1,enumerable:!1,writable:!0}),e.class="Array",e};o.prototype.createFunctionBase_=function(e,t){var i=this.createObjectProto(this.FUNCTION_PROTO);if(t){var r=this.createObjectProto(this.OBJECT_PROTO);this.setProperty(i,"prototype",r,o.NONENUMERABLE_DESCRIPTOR),this.setProperty(r,"constructor",i,o.NONENUMERABLE_DESCRIPTOR)}else i.illegalConstructor=!0;return this.setProperty(i,"length",e,o.READONLY_NONENUMERABLE_DESCRIPTOR),i.class="Function",i};o.prototype.createFunction=function(e,t,i){var r=this.createFunctionBase_(e.params.length,!0);r.parentScope=t,r.node=e;var n=e.id?String(e.id.name):i||"";return this.setProperty(r,"name",n,o.READONLY_NONENUMERABLE_DESCRIPTOR),r};o.prototype.createNativeFunction=function(e,t){var i=this.createFunctionBase_(e.length,t);return i.nativeFunc=e,e.id=this.functionCounter_++,this.setProperty(i,"name",e.name,o.READONLY_NONENUMERABLE_DESCRIPTOR),i};o.prototype.createAsyncFunction=function(e){var t=this.createFunctionBase_(e.length,!0);return t.asyncFunc=e,e.id=this.functionCounter_++,this.setProperty(t,"name",e.name,o.READONLY_NONENUMERABLE_DESCRIPTOR),t};o.prototype.nativeToPseudo=function(e){if(e instanceof o.Object)throw Error("Object is already pseudo");if(e==null||e===!0||e===!1||typeof e=="string"||typeof e=="number")return e;if(e instanceof RegExp){var t=this.createObjectProto(this.REGEXP_PROTO);return this.populateRegExp(t,e),t}if(e instanceof Date){var i=this.createObjectProto(this.DATE_PROTO);return i.data=new Date(e.valueOf()),i}if(typeof e=="function"){var r=this,n=function(){var f=Array.prototype.slice.call(arguments).map(function(m){return r.pseudoToNative(m)}),d=e.apply(r,f);return r.nativeToPseudo(d)},s=Object.getOwnPropertyDescriptor(e,"prototype");return this.createNativeFunction(n,!!s)}if(Array.isArray(e)){for(var a=this.createArray(),u=0;u<e.length;u++)u in e&&this.setProperty(a,u,this.nativeToPseudo(e[u]));return a}var l=this.createObjectProto(this.OBJECT_PROTO);for(var p in e)this.setProperty(l,p,this.nativeToPseudo(e[p]));return l};o.prototype.pseudoToNative=function(e,t){if(typeof e!="object"&&typeof e!="function"||e===null)return e;if(!(e instanceof o.Object))throw Error("Object is not pseudo");if(this.isa(e,this.REGEXP)){var i=new RegExp(e.data.source,e.data.flags);return i.lastIndex=e.data.lastIndex,i}if(this.isa(e,this.DATE))return new Date(e.data.valueOf());var r=t||{pseudo:[],native:[]},n=r.pseudo.indexOf(e);if(n!==-1)return r.native[n];r.pseudo.push(e);var s;if(this.isa(e,this.ARRAY)){s=[],r.native.push(s);for(var a=this.getProperty(e,"length"),u=0;u<a;u++)this.hasProperty(e,u)&&(s[u]=this.pseudoToNative(this.getProperty(e,u),r))}else{s={},r.native.push(s);var l;for(var p in e.properties)l=this.pseudoToNative(e.properties[p],r),Object.defineProperty(s,p,{value:l,writable:!0,enumerable:!0,configurable:!0})}return r.pseudo.pop(),r.native.pop(),s};o.prototype.arrayNativeToPseudo=function(e){for(var t=this.createArray(),i=Object.getOwnPropertyNames(e),r=0;r<i.length;r++)this.setProperty(t,i[r],e[i[r]]);return t};o.prototype.arrayPseudoToNative=function(e){var t=[];for(var i in e.properties)t[i]=this.getProperty(e,i);return t.length=o.legalArrayLength(this.getProperty(e,"length"))||0,t};o.prototype.getPrototype=function(e){switch(typeof e){case"number":return this.NUMBER.properties.prototype;case"boolean":return this.BOOLEAN.properties.prototype;case"string":return this.STRING.properties.prototype}return e?e.proto:null};o.prototype.getProperty=function(e,t){if(this.getterStep_)throw Error("Getter not supported in that context");if(t=String(t),e==null&&this.throwException(this.TYPE_ERROR,"Cannot read property '"+t+"' of "+e),typeof e=="object"&&!(e instanceof o.Object))throw TypeError("Expecting native value or pseudo object");if(t==="length"){if(this.isa(e,this.STRING))return String(e).length}else if(t.charCodeAt(0)<64&&this.isa(e,this.STRING)){var i=o.legalArrayIndex(t);if(!isNaN(i)&&i<String(e).length)return String(e)[i]}do if(e.properties&&t in e.properties){var r=e.getter[t];return r?(this.getterStep_=!0,r):e.properties[t]}while(e=this.getPrototype(e))};o.prototype.hasProperty=function(e,t){if(!(e instanceof o.Object))throw TypeError("Primitive data type has no properties");if(t=String(t),t==="length"&&this.isa(e,this.STRING))return!0;if(this.isa(e,this.STRING)){var i=o.legalArrayIndex(t);if(!isNaN(i)&&i<String(e).length)return!0}do if(e.properties&&t in e.properties)return!0;while(e=this.getPrototype(e));return!1};o.prototype.setProperty=function(e,t,i,r){if(this.setterStep_)throw Error("Setter not supported in that context");if(t=String(t),e==null&&this.throwException(this.TYPE_ERROR,"Cannot set property '"+t+"' of "+e),typeof e=="object"&&!(e instanceof o.Object))throw TypeError("Expecting native value or pseudo object");r&&("get"in r||"set"in r)&&("value"in r||"writable"in r)&&this.throwException(this.TYPE_ERROR,"Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");var n=!this.stateStack||this.getScope().strict;if(!(e instanceof o.Object)){n&&this.throwException(this.TYPE_ERROR,"Can't create property '"+t+"' on '"+e+"'");return}if(this.isa(e,this.STRING)){var s=o.legalArrayIndex(t);if(t==="length"||!isNaN(s)&&s<String(e).length){n&&this.throwException(this.TYPE_ERROR,"Cannot assign to read only property '"+t+"' of String '"+e.data+"'");return}}if(e.class==="Array"){var a=e.properties.length,u;if(t==="length"){if(r){if(!("value"in r))return;i=r.value}if(i=o.legalArrayLength(i),isNaN(i)&&this.throwException(this.RANGE_ERROR,"Invalid array length"),i<a)for(u in e.properties)u=o.legalArrayIndex(u),!isNaN(u)&&i<=u&&delete e.properties[u]}else isNaN(u=o.legalArrayIndex(t))||(e.properties.length=Math.max(a,u+1))}if(e.preventExtensions&&!(t in e.properties)){n&&this.throwException(this.TYPE_ERROR,"Can't add property '"+t+"', object is not extensible");return}if(r){var l={};"get"in r&&r.get&&(e.getter[t]=r.get,l.get=this.setProperty.placeholderGet_),"set"in r&&r.set&&(e.setter[t]=r.set,l.set=this.setProperty.placeholderSet_),"configurable"in r&&(l.configurable=r.configurable),"enumerable"in r&&(l.enumerable=r.enumerable),"writable"in r&&(l.writable=r.writable,delete e.getter[t],delete e.setter[t]),"value"in r?(l.value=r.value,delete e.getter[t],delete e.setter[t]):i!==o.VALUE_IN_DESCRIPTOR&&(l.value=i,delete e.getter[t],delete e.setter[t]);try{Object.defineProperty(e.properties,t,l)}catch{this.throwException(this.TYPE_ERROR,"Cannot redefine property: "+t)}"get"in r&&!r.get&&delete e.getter[t],"set"in r&&!r.set&&delete e.setter[t]}else{if(i===o.VALUE_IN_DESCRIPTOR)throw ReferenceError("Value not specified");for(var p=e;!(t in p.properties);)if(p=this.getPrototype(p),!p){p=e;break}if(p.setter&&p.setter[t])return this.setterStep_=!0,p.setter[t];if(p.getter&&p.getter[t])n&&this.throwException(this.TYPE_ERROR,"Cannot set property '"+t+"' of object '"+e+"' which only has a getter");else try{e.properties[t]=i}catch{n&&this.throwException(this.TYPE_ERROR,"Cannot assign to read only property '"+t+"' of object '"+e+"'")}}};o.prototype.setProperty.placeholderGet_=function(){throw Error("Placeholder getter")};o.prototype.setProperty.placeholderSet_=function(){throw Error("Placeholder setter")};o.prototype.setNativeFunctionPrototype=function(e,t,i){this.setProperty(e.properties.prototype,t,this.createNativeFunction(i,!1),o.NONENUMERABLE_DESCRIPTOR)};o.prototype.setAsyncFunctionPrototype=function(e,t,i){this.setProperty(e.properties.prototype,t,this.createAsyncFunction(i),o.NONENUMERABLE_DESCRIPTOR)};o.prototype.getScope=function(){var e=this.stateStack[this.stateStack.length-1].scope;if(!e)throw Error("No scope found");return e};o.prototype.createScope=function(e,t){var i=!1;if(t&&t.strict)i=!0;else{var r=e.body&&e.body[0];r&&r.expression&&r.expression.type==="Literal"&&r.expression.value==="use strict"&&(i=!0)}var n=this.createObjectProto(null),s=new o.Scope(t,i,n);return t||this.initGlobal(s.object),this.populateScope_(e,s),s};o.prototype.createSpecialScope=function(e,t){if(!e)throw Error("parentScope required");var i=t||this.createObjectProto(null);return new o.Scope(e,e.strict,i)};o.prototype.getValueFromScope=function(e){for(var t=this.getScope();t&&t!==this.globalScope;){if(e in t.object.properties)return t.object.properties[e];t=t.parentScope}if(t===this.globalScope&&this.hasProperty(t.object,e))return this.getProperty(t.object,e);var i=this.stateStack[this.stateStack.length-1].node;i.type==="UnaryExpression"&&i.operator==="typeof"||this.throwException(this.REFERENCE_ERROR,e+" is not defined")};o.prototype.setValueToScope=function(e,t){for(var i=this.getScope(),r=i.strict;i&&i!==this.globalScope;){if(e in i.object.properties){try{i.object.properties[e]=t}catch{r&&this.throwException(this.TYPE_ERROR,"Cannot assign to read only variable '"+e+"'")}return}i=i.parentScope}if(i===this.globalScope&&(!r||this.hasProperty(i.object,e)))return this.setProperty(i.object,e,t);this.throwException(this.REFERENCE_ERROR,e+" is not defined")};o.prototype.populateScope_=function(e,t){var i;if(e.variableCache_)i=e.variableCache_;else{switch(i=Object.create(null),e.type){case"VariableDeclaration":for(var r=0;r<e.declarations.length;r++)i[e.declarations[r].id.name]=!0;break;case"FunctionDeclaration":i[e.id.name]=e;break;case"BlockStatement":case"CatchClause":case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"Program":case"SwitchCase":case"SwitchStatement":case"TryStatement":case"WithStatement":case"WhileStatement":var n=e.constructor;for(var s in e)if(s!=="loc"){var a=e[s];if(a&&typeof a=="object"){var u;if(Array.isArray(a)){for(var r=0;r<a.length;r++)if(a[r]&&a[r].constructor===n){u=this.populateScope_(a[r],t);for(var s in u)i[s]=u[s]}}else if(a.constructor===n){u=this.populateScope_(a,t);for(var s in u)i[s]=u[s]}}}}e.variableCache_=i}for(var s in i)i[s]===!0?this.setProperty(t.object,s,void 0,o.VARIABLE_DESCRIPTOR):this.setProperty(t.object,s,this.createFunction(i[s],t),o.VARIABLE_DESCRIPTOR);return i};o.prototype.calledWithNew=function(){return this.stateStack[this.stateStack.length-1].isConstructor};o.prototype.getValue=function(e){return e[0]===o.SCOPE_REFERENCE?this.getValueFromScope(e[1]):this.getProperty(e[0],e[1])};o.prototype.setValue=function(e,t){return e[0]===o.SCOPE_REFERENCE?this.setValueToScope(e[1],t):this.setProperty(e[0],e[1],t)};o.prototype.throwException=function(e,t){if(!this.globalScope)throw t===void 0?e:t;if(t===void 0||!(e instanceof o.Object))var i=e;else{var i=this.createObject(e);this.populateError(i,t)}throw this.unwind(o.Completion.THROW,i,void 0),o.STEP_ERROR};o.prototype.unwind=function(e,t,i){if(e===o.Completion.NORMAL)throw TypeError("Should not unwind for NORMAL completions");e:for(var r=this.stateStack;r.length>0;r.pop()){var n=r[r.length-1];switch(n.node.type){case"TryStatement":n.cv={type:e,value:t,label:i};return;case"CallExpression":case"NewExpression":if(e===o.Completion.RETURN){n.value=t;return}else if(e!==o.Completion.THROW)throw Error("Unsynatctic break/continue not rejected by Acorn");break;case"Program":n.done=!0;break e}if(e===o.Completion.BREAK){if(i?n.labels&&n.labels.indexOf(i)!==-1:n.isLoop||n.isSwitch){r.pop();return}}else if(e===o.Completion.CONTINUE&&(i?n.labels&&n.labels.indexOf(i)!==-1:n.isLoop))return}var s;if(this.isa(t,this.ERROR)){var a={EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},u=String(this.getProperty(t,"name")),l=this.getProperty(t,"message").valueOf(),p=a[u]||Error;s=p(l),s.stack=String(this.getProperty(t,"stack"))}else s=String(t);throw this.value=s,s};o.prototype.nodeSummary=function(e){switch(e.type){case"ArrayExpression":return"[...]";case"BinaryExpression":case"LogicalExpression":return this.nodeSummary(e.left)+" "+e.operator+" "+this.nodeSummary(e.right);case"CallExpression":return this.nodeSummary(e.callee)+"(...)";case"ConditionalExpression":return this.nodeSummary(e.test)+" ? "+this.nodeSummary(e.consequent)+" : "+this.nodeSummary(e.alternate);case"Identifier":return e.name;case"Literal":return e.raw;case"MemberExpression":var t=this.nodeSummary(e.object),i=this.nodeSummary(e.property);return e.computed?t+"["+i+"]":t+"."+i;case"NewExpression":return"new "+this.nodeSummary(e.callee)+"(...)";case"ObjectExpression":return"{...}";case"ThisExpression":return"this";case"UnaryExpression":return e.operator+" "+this.nodeSummary(e.argument);case"UpdateExpression":var r=this.nodeSummary(e.argument);return e.prefix?e.operator+r:r+e.operator}return"???"};o.prototype.createGetter_=function(e,t){if(!this.getterStep_)throw Error("Unexpected call to createGetter");this.getterStep_=!1;var i=Array.isArray(t)?t[0]:t,r=this.newNode();r.type="CallExpression";var n=new o.State(r,this.stateStack[this.stateStack.length-1].scope);return n.doneCallee_=2,n.funcThis_=i,n.func_=e,n.doneArgs_=!0,n.arguments_=[],n};o.prototype.createSetter_=function(e,t,i){if(!this.setterStep_)throw Error("Unexpected call to createSetter");this.setterStep_=!1;var r=Array.isArray(t)?t[0]:this.globalObject,n=this.newNode();n.type="CallExpression";var s=new o.State(n,this.stateStack[this.stateStack.length-1].scope);return s.doneCallee_=2,s.funcThis_=r,s.func_=e,s.doneArgs_=!0,s.arguments_=[i],s};o.prototype.boxThis_=function(e){if(e==null)return this.globalObject;if(!(e instanceof o.Object)){var t=this.createObjectProto(this.getPrototype(e));return t.data=e,t}return e};o.prototype.getGlobalScope=function(){return this.globalScope};o.prototype.getStateStack=function(){return this.stateStack};o.prototype.setStateStack=function(e){this.stateStack=e};o.Value;o.State=function(e,t){this.node=e,this.scope=t};o.Scope=function(e,t,i){this.parentScope=e,this.strict=t,this.object=i};o.Object=function(e){this.getter=Object.create(null),this.setter=Object.create(null),this.properties=Object.create(null),this.proto=e};o.Object.prototype.proto=null;o.Object.prototype.class="Object";o.Object.prototype.data=null;o.Object.prototype.toString=function(){if(!o.currentInterpreter_)return"[object Interpreter.Object]";if(!(this instanceof o.Object))return String(this);if(this.class==="Array"){var e=o.toStringCycles_;e.push(this);try{var t=[],i=this.properties.length,r=!1;i>1024&&(i=1e3,r=!0);for(var n=0;n<i;n++){var s=this.properties[n];t[n]=s instanceof o.Object&&e.indexOf(s)!==-1?"...":s}r&&t.push("...")}finally{e.pop()}return t.join(",")}if(this.class==="Error"){var e=o.toStringCycles_;if(e.indexOf(this)!==-1)return"[object Error]";var a,u,l=this;do if("name"in l.properties){a=l.properties.name;break}while(l=l.proto);l=this;do if("message"in l.properties){u=l.properties.message;break}while(l=l.proto);e.push(this);try{a=a&&String(a),u=u&&String(u)}finally{e.pop()}return u?a+": "+u:String(a)}return this.data!==null?String(this.data):"[object "+this.class+"]"};o.Object.prototype.valueOf=function(){return o.currentInterpreter_?this.data===void 0||this.data===null||this.data instanceof RegExp?this:this.data instanceof Date?this.data.valueOf():this.data:this};o.prototype.stepArrayExpression=function(e,t,i){var r=i.elements,n=t.n_||0;for(t.array_?(this.setProperty(t.array_,n,t.value),n++):(t.array_=this.createArray(),t.array_.properties.length=r.length);n<r.length;){if(r[n])return t.n_=n,new o.State(r[n],t.scope);n++}e.pop(),e[e.length-1].value=t.array_};o.prototype.stepAssignmentExpression=function(e,t,i){if(!t.doneLeft_){t.doneLeft_=!0;var r=new o.State(i.left,t.scope);return r.components=!0,r}if(!t.doneRight_){if(t.leftReference_||(t.leftReference_=t.value),t.doneGetter_&&(t.leftValue_=t.value),!t.doneGetter_&&i.operator!=="="){var n=this.getValue(t.leftReference_);if(t.leftValue_=n,this.getterStep_){t.doneGetter_=!0;var s=n;return this.createGetter_(s,t.leftReference_)}}return t.doneRight_=!0,i.operator==="="&&i.left.type==="Identifier"&&(t.destinationName=i.left.name),new o.State(i.right,t.scope)}if(t.doneSetter_){e.pop(),e[e.length-1].value=t.setterValue_;return}var a=t.leftValue_,u=t.value;switch(i.operator){case"=":a=u;break;case"+=":a+=u;break;case"-=":a-=u;break;case"*=":a*=u;break;case"/=":a/=u;break;case"%=":a%=u;break;case"<<=":a<<=u;break;case">>=":a>>=u;break;case">>>=":a>>>=u;break;case"&=":a&=u;break;case"^=":a^=u;break;case"|=":a|=u;break;default:throw SyntaxError("Unknown assignment expression: "+i.operator)}var l=this.setValue(t.leftReference_,a);if(l)return t.doneSetter_=!0,t.setterValue_=a,this.createSetter_(l,t.leftReference_,a);e.pop(),e[e.length-1].value=a};o.prototype.stepBinaryExpression=function(e,t,i){if(!t.doneLeft_)return t.doneLeft_=!0,new o.State(i.left,t.scope);if(!t.doneRight_)return t.doneRight_=!0,t.leftValue_=t.value,new o.State(i.right,t.scope);e.pop();var r=t.leftValue_,n=t.value,s;switch(i.operator){case"==":s=r==n;break;case"!=":s=r!=n;break;case"===":s=r===n;break;case"!==":s=r!==n;break;case">":s=r>n;break;case">=":s=r>=n;break;case"<":s=r<n;break;case"<=":s=r<=n;break;case"+":s=r+n;break;case"-":s=r-n;break;case"*":s=r*n;break;case"/":s=r/n;break;case"%":s=r%n;break;case"&":s=r&n;break;case"|":s=r|n;break;case"^":s=r^n;break;case"<<":s=r<<n;break;case">>":s=r>>n;break;case">>>":s=r>>>n;break;case"in":n instanceof o.Object||this.throwException(this.TYPE_ERROR,"'in' expects an object, not '"+n+"'"),s=this.hasProperty(n,r);break;case"instanceof":this.isa(n,this.FUNCTION)||this.throwException(this.TYPE_ERROR,"'instanceof' expects an object, not '"+n+"'"),s=r instanceof o.Object?this.isa(r,n):!1;break;default:throw SyntaxError("Unknown binary operator: "+i.operator)}e[e.length-1].value=s};o.prototype.stepBlockStatement=function(e,t,i){var r=t.n_||0,n=i.body[r];if(n)return t.n_=r+1,new o.State(n,t.scope);e.pop()};o.prototype.stepBreakStatement=function(e,t,i){var r=i.label&&i.label.name;this.unwind(o.Completion.BREAK,void 0,r)};o.prototype.evalCodeNumber_=0;o.prototype.stepCallExpression=function(e,t,i){if(!t.doneCallee_){t.doneCallee_=1;var r=new o.State(i.callee,t.scope);return r.components=!0,r}if(t.doneCallee_===1){t.doneCallee_=2;var n=t.value;if(Array.isArray(n)){if(t.func_=this.getValue(n),n[0]===o.SCOPE_REFERENCE?t.directEval_=n[1]==="eval":t.funcThis_=n[0],n=t.func_,this.getterStep_)return t.doneCallee_=1,this.createGetter_(n,t.value)}else t.func_=n;t.arguments_=[],t.n_=0}var n=t.func_;if(!t.doneArgs_){if(t.n_!==0&&t.arguments_.push(t.value),i.arguments[t.n_])return new o.State(i.arguments[t.n_++],t.scope);if(i.type==="NewExpression"){if((!(n instanceof o.Object)||n.illegalConstructor)&&this.throwException(this.TYPE_ERROR,this.nodeSummary(i.callee)+" is not a constructor"),n===this.ARRAY)t.funcThis_=this.createArray();else{var s=n.properties.prototype;(typeof s!="object"||s===null)&&(s=this.OBJECT_PROTO),t.funcThis_=this.createObjectProto(s)}t.isConstructor=!0}t.doneArgs_=!0}if(t.doneExec_)e.pop(),t.isConstructor&&typeof t.value!="object"?e[e.length-1].value=t.funcThis_:e[e.length-1].value=t.value;else{t.doneExec_=!0,n instanceof o.Object||this.throwException(this.TYPE_ERROR,this.nodeSummary(i.callee)+" is not a function");var a=n.node;if(a){for(var u=this.createScope(a.body,n.parentScope),l=this.createArray(),p=0;p<t.arguments_.length;p++)this.setProperty(l,p,t.arguments_[p]);this.setProperty(u.object,"arguments",l);for(var p=0;p<a.params.length;p++){var f=a.params[p].name,d=t.arguments_.length>p?t.arguments_[p]:void 0;this.setProperty(u.object,f,d)}return u.strict||(t.funcThis_=this.boxThis_(t.funcThis_)),this.setProperty(u.object,"this",t.funcThis_,o.READONLY_DESCRIPTOR),t.value=void 0,new o.State(a.body,u)}else if(n.eval){var m=t.arguments_[0];if(typeof m!="string")t.value=m;else{try{var v=this.parse_(String(m),"eval"+this.evalCodeNumber_++)}catch(wi){this.throwException(this.SYNTAX_ERROR,"Invalid code: "+wi.message)}var g=this.newNode();g.type="EvalProgram_",g.body=v.body,o.stripLocations_(g,i.start,i.end);var u=t.directEval_?t.scope:this.globalScope;return u.strict?u=this.createScope(v,u):this.populateScope_(v,u),this.value=void 0,new o.State(g,u)}}else if(n.nativeFunc)t.scope.strict||(t.funcThis_=this.boxThis_(t.funcThis_)),t.value=n.nativeFunc.apply(t.funcThis_,t.arguments_);else if(n.asyncFunc){var S=this,R=function(ki){t.value=ki,S.paused_=!1},P=n.asyncFunc.length-1,O=t.arguments_.concat(new Array(P)).slice(0,P);O.push(R),this.paused_=!0,t.scope.strict||(t.funcThis_=this.boxThis_(t.funcThis_)),n.asyncFunc.apply(t.funcThis_,O);return}else this.throwException(this.TYPE_ERROR,this.nodeSummary(i.callee)+" is not callable")}};o.prototype.stepConditionalExpression=function(e,t,i){var r=t.mode_||0;if(r===0)return t.mode_=1,new o.State(i.test,t.scope);if(r===1){t.mode_=2;var n=Boolean(t.value);if(n&&i.consequent)return new o.State(i.consequent,t.scope);if(!n&&i.alternate)return new o.State(i.alternate,t.scope);this.value=void 0}e.pop(),i.type==="ConditionalExpression"&&(e[e.length-1].value=t.value)};o.prototype.stepContinueStatement=function(e,t,i){var r=i.label&&i.label.name;this.unwind(o.Completion.CONTINUE,void 0,r)};o.prototype.stepDebuggerStatement=function(e,t,i){e.pop()};o.prototype.stepDoWhileStatement=function(e,t,i){if(i.type==="DoWhileStatement"&&t.test_===void 0&&(t.value=!0,t.test_=!0),!t.test_)return t.test_=!0,new o.State(i.test,t.scope);if(!t.value)e.pop();else if(i.body)return t.test_=!1,t.isLoop=!0,new o.State(i.body,t.scope)};o.prototype.stepEmptyStatement=function(e,t,i){e.pop()};o.prototype.stepEvalProgram_=function(e,t,i){var r=t.n_||0,n=i.body[r];if(n)return t.n_=r+1,new o.State(n,t.scope);e.pop(),e[e.length-1].value=this.value};o.prototype.stepExpressionStatement=function(e,t,i){if(!t.done_)return this.value=void 0,t.done_=!0,new o.State(i.expression,t.scope);e.pop(),this.value=t.value};o.prototype.stepForInStatement=function(e,t,i){if(!t.doneInit_&&(t.doneInit_=!0,i.left.declarations&&i.left.declarations[0].init))return t.scope.strict&&this.throwException(this.SYNTAX_ERROR,"for-in loop variable declaration may not have an initializer"),new o.State(i.left,t.scope);if(!t.doneObject_)return t.doneObject_=!0,t.variable_||(t.variable_=t.value),new o.State(i.right,t.scope);if(t.isLoop||(t.isLoop=!0,t.object_=t.value,t.visited_=Object.create(null)),t.name_===void 0){e:for(;;){if(t.object_ instanceof o.Object)for(t.props_||(t.props_=Object.getOwnPropertyNames(t.object_.properties));;){var r=t.props_.shift();if(r===void 0)break;if(!!Object.prototype.hasOwnProperty.call(t.object_.properties,r)&&!t.visited_[r]&&(t.visited_[r]=!0,!!Object.prototype.propertyIsEnumerable.call(t.object_.properties,r))){t.name_=r;break e}}else if(t.object_!==null&&t.object_!==void 0)for(t.props_||(t.props_=Object.getOwnPropertyNames(t.object_));;){var r=t.props_.shift();if(r===void 0)break;if(t.visited_[r]=!0,!!Object.prototype.propertyIsEnumerable.call(t.object_,r)){t.name_=r;break e}}if(t.object_=this.getPrototype(t.object_),t.props_=null,t.object_===null){e.pop();return}}}if(!t.doneVariable_){t.doneVariable_=!0;var n=i.left;if(n.type==="VariableDeclaration")t.variable_=[o.SCOPE_REFERENCE,n.declarations[0].id.name];else{t.variable_=null;var s=new o.State(n,t.scope);return s.components=!0,s}}if(t.variable_||(t.variable_=t.value),!t.doneSetter_){t.doneSetter_=!0;var a=t.name_,u=this.setValue(t.variable_,a);if(u)return this.createSetter_(u,t.variable_,a)}if(t.name_=void 0,t.doneVariable_=!1,t.doneSetter_=!1,i.body)return new o.State(i.body,t.scope)};o.prototype.stepForStatement=function(e,t,i){switch(t.mode_){default:if(t.mode_=1,i.init)return new o.State(i.init,t.scope);break;case 1:if(t.mode_=2,i.test)return new o.State(i.test,t.scope);break;case 2:if(t.mode_=3,i.test&&!t.value)e.pop();else return t.isLoop=!0,new o.State(i.body,t.scope);break;case 3:if(t.mode_=1,i.update)return new o.State(i.update,t.scope);break}};o.prototype.stepFunctionDeclaration=function(e,t,i){e.pop()};o.prototype.stepFunctionExpression=function(e,t,i){e.pop(),t=e[e.length-1];var r=t.scope;i.id&&(r=this.createSpecialScope(r)),t.value=this.createFunction(i,r,t.destinationName),i.id&&this.setProperty(r.object,i.id.name,t.value,o.READONLY_DESCRIPTOR)};o.prototype.stepIdentifier=function(e,t,i){if(e.pop(),t.components){e[e.length-1].value=[o.SCOPE_REFERENCE,i.name];return}var r=this.getValueFromScope(i.name);if(this.getterStep_){var n=r;return this.createGetter_(n,this.globalObject)}e[e.length-1].value=r};o.prototype.stepIfStatement=o.prototype.stepConditionalExpression;o.prototype.stepLabeledStatement=function(e,t,i){e.pop();var r=t.labels||[];r.push(i.label.name);var n=new o.State(i.body,t.scope);return n.labels=r,n};o.prototype.stepLiteral=function(e,t,i){e.pop();var r=i.value;if(r instanceof RegExp){var n=this.createObjectProto(this.REGEXP_PROTO);this.populateRegExp(n,r),r=n}e[e.length-1].value=r};o.prototype.stepLogicalExpression=function(e,t,i){if(i.operator!=="&&"&&i.operator!=="||")throw SyntaxError("Unknown logical operator: "+i.operator);if(!t.doneLeft_)return t.doneLeft_=!0,new o.State(i.left,t.scope);if(t.doneRight_)e.pop(),e[e.length-1].value=t.value;else if(i.operator==="&&"&&!t.value||i.operator==="||"&&t.value)e.pop(),e[e.length-1].value=t.value;else return t.doneRight_=!0,new o.State(i.right,t.scope)};o.prototype.stepMemberExpression=function(e,t,i){if(!t.doneObject_)return t.doneObject_=!0,new o.State(i.object,t.scope);var r;if(!i.computed)t.object_=t.value,r=i.property.name;else if(t.doneProperty_)r=t.value;else return t.object_=t.value,t.doneProperty_=!0,new o.State(i.property,t.scope);if(e.pop(),t.components)e[e.length-1].value=[t.object_,r];else{var n=this.getProperty(t.object_,r);if(this.getterStep_){var s=n;return this.createGetter_(s,t.object_)}e[e.length-1].value=n}};o.prototype.stepNewExpression=o.prototype.stepCallExpression;o.prototype.stepObjectExpression=function(e,t,i){var r=t.n_||0,n=i.properties[r];if(!t.object_)t.object_=this.createObjectProto(this.OBJECT_PROTO),t.properties_=Object.create(null);else{var s=t.destinationName;t.properties_[s]||(t.properties_[s]={}),t.properties_[s][n.kind]=t.value,t.n_=++r,n=i.properties[r]}if(n){var a=n.key;if(a.type==="Identifier")var s=a.name;else if(a.type==="Literal")var s=a.value;else throw SyntaxError("Unknown object structure: "+a.type);return t.destinationName=s,new o.State(n.value,t.scope)}for(var a in t.properties_){var u=t.properties_[a];if("get"in u||"set"in u){var l={configurable:!0,enumerable:!0,get:u.get,set:u.set};this.setProperty(t.object_,a,o.VALUE_IN_DESCRIPTOR,l)}else this.setProperty(t.object_,a,u.init)}e.pop(),e[e.length-1].value=t.object_};o.prototype.stepProgram=function(e,t,i){var r=i.body.shift();if(r)return t.done=!1,new o.State(r,t.scope);t.done=!0};o.prototype.stepReturnStatement=function(e,t,i){if(i.argument&&!t.done_)return t.done_=!0,new o.State(i.argument,t.scope);this.unwind(o.Completion.RETURN,t.value,void 0)};o.prototype.stepSequenceExpression=function(e,t,i){var r=t.n_||0,n=i.expressions[r];if(n)return t.n_=r+1,new o.State(n,t.scope);e.pop(),e[e.length-1].value=t.value};o.prototype.stepSwitchStatement=function(e,t,i){if(!t.test_)return t.test_=1,new o.State(i.discriminant,t.scope);for(t.test_===1&&(t.test_=2,t.switchValue_=t.value,t.defaultCase_=-1);;){var r=t.index_||0,n=i.cases[r];if(!t.matched_&&n&&!n.test){t.defaultCase_=r,t.index_=r+1;continue}if(!n&&!t.matched_&&t.defaultCase_!==-1){t.matched_=!0,t.index_=t.defaultCase_;continue}if(n){if(!t.matched_&&!t.tested_&&n.test)return t.tested_=!0,new o.State(n.test,t.scope);if(t.matched_||t.value===t.switchValue_){t.matched_=!0;var s=t.n_||0;if(n.consequent[s])return t.isSwitch=!0,t.n_=s+1,new o.State(n.consequent[s],t.scope)}t.tested_=!1,t.n_=0,t.index_=r+1}else{e.pop();return}}};o.prototype.stepThisExpression=function(e,t,i){e.pop(),e[e.length-1].value=this.getValueFromScope("this")};o.prototype.stepThrowStatement=function(e,t,i){if(t.done_)this.throwException(t.value);else return t.done_=!0,new o.State(i.argument,t.scope)};o.prototype.stepTryStatement=function(e,t,i){if(!t.doneBlock_)return t.doneBlock_=!0,new o.State(i.block,t.scope);if(t.cv&&t.cv.type===o.Completion.THROW&&!t.doneHandler_&&i.handler){t.doneHandler_=!0;var r=this.createSpecialScope(t.scope);return this.setProperty(r.object,i.handler.param.name,t.cv.value),t.cv=void 0,new o.State(i.handler.body,r)}if(!t.doneFinalizer_&&i.finalizer)return t.doneFinalizer_=!0,new o.State(i.finalizer,t.scope);e.pop(),t.cv&&this.unwind(t.cv.type,t.cv.value,t.cv.label)};o.prototype.stepUnaryExpression=function(e,t,i){if(!t.done_){t.done_=!0;var r=new o.State(i.argument,t.scope);return r.components=i.operator==="delete",r}e.pop();var n=t.value;switch(i.operator){case"-":n=-n;break;case"+":n=+n;break;case"!":n=!n;break;case"~":n=~n;break;case"delete":var s=!0;if(Array.isArray(n)){var a=n[0];a===o.SCOPE_REFERENCE&&(a=t.scope);var u=String(n[1]);try{delete a.properties[u]}catch{t.scope.strict?this.throwException(this.TYPE_ERROR,"Cannot delete property '"+u+"' of '"+a+"'"):s=!1}}n=s;break;case"typeof":n=n&&n.class==="Function"?"function":typeof n;break;case"void":n=void 0;break;default:throw SyntaxError("Unknown unary operator: "+i.operator)}e[e.length-1].value=n};o.prototype.stepUpdateExpression=function(e,t,i){if(!t.doneLeft_){t.doneLeft_=!0;var r=new o.State(i.argument,t.scope);return r.components=!0,r}if(t.leftSide_||(t.leftSide_=t.value),t.doneGetter_&&(t.leftValue_=t.value),!t.doneGetter_){var s=this.getValue(t.leftSide_);if(t.leftValue_=s,this.getterStep_){t.doneGetter_=!0;var n=s;return this.createGetter_(n,t.leftSide_)}}if(t.doneSetter_){e.pop(),e[e.length-1].value=t.setterValue_;return}var s=Number(t.leftValue_),a;if(i.operator==="++")a=s+1;else if(i.operator==="--")a=s-1;else throw SyntaxError("Unknown update expression: "+i.operator);var u=i.prefix?a:s,l=this.setValue(t.leftSide_,a);if(l)return t.doneSetter_=!0,t.setterValue_=u,this.createSetter_(l,t.leftSide_,a);e.pop(),e[e.length-1].value=u};o.prototype.stepVariableDeclaration=function(e,t,i){var r=i.declarations,n=t.n_||0,s=r[n];for(t.init_&&s&&(this.setValueToScope(s.id.name,t.value),t.init_=!1,s=r[++n]);s;){if(s.init)return t.n_=n,t.init_=!0,t.destinationName=s.id.name,new o.State(s.init,t.scope);s=r[++n]}e.pop()};o.prototype.stepWithStatement=function(e,t,i){if(!t.doneObject_)return t.doneObject_=!0,new o.State(i.object,t.scope);e.pop();var r=this.createSpecialScope(t.scope,t.value);return new o.State(i.body,r)};o.prototype.stepWhileStatement=o.prototype.stepDoWhileStatement;o.nativeGlobal.Interpreter=o;o.prototype.step=o.prototype.step;o.prototype.run=o.prototype.run;o.prototype.appendCode=o.prototype.appendCode;o.prototype.createObject=o.prototype.createObject;o.prototype.createObjectProto=o.prototype.createObjectProto;o.prototype.createAsyncFunction=o.prototype.createAsyncFunction;o.prototype.createNativeFunction=o.prototype.createNativeFunction;o.prototype.getProperty=o.prototype.getProperty;o.prototype.setProperty=o.prototype.setProperty;o.prototype.nativeToPseudo=o.prototype.nativeToPseudo;o.prototype.pseudoToNative=o.prototype.pseudoToNative;o.prototype.getGlobalScope=o.prototype.getGlobalScope;o.prototype.getStateStack=o.prototype.getStateStack;o.prototype.setStateStack=o.prototype.setStateStack;o.VALUE_IN_DESCRIPTOR=o.VALUE_IN_DESCRIPTOR;o.nativeGlobal.acornParse=lr;const hr=e=>e.split(`
|
|
15
|
+
`)],{type:"application/javascript"}),this.createWorker.blob_=e),new Worker(URL.createObjectURL(e))};o.prototype.vmCall=function(e,t,i,r){var n={timeout:this.REGEXP_THREAD_TIMEOUT};try{return o.vm.runInNewContext(e,t,n)}catch{r(null),this.throwException(this.ERROR,"RegExp Timeout: "+i)}return o.REGEXP_TIMEOUT};o.prototype.maybeThrowRegExp=function(e,t){var i;if(this.REGEXP_MODE===0)i=!1;else if(this.REGEXP_MODE===1)i=!0;else if(o.vm)i=!0;else if(typeof Worker=="function"&&typeof URL=="function")i=!0;else if(typeof require=="function"){try{o.vm=require("vm")}catch{}i=!!o.vm}else i=!1;i||(t(null),this.throwException(this.ERROR,"Regular expressions not supported: "+e))};o.prototype.regExpTimeout=function(e,t,i){var r=this;return setTimeout(function(){t.terminate(),i(null);try{r.throwException(r.ERROR,"RegExp Timeout: "+e)}catch{}},this.REGEXP_THREAD_TIMEOUT)};o.prototype.createObject=function(e){return this.createObjectProto(e&&e.properties.prototype)};o.prototype.createObjectProto=function(e){if(typeof e!="object")throw Error("Non object prototype");var t=new o.Object(e);return this.isa(t,this.ERROR)&&(t.class="Error"),t};o.prototype.createArray=function(){var e=this.createObjectProto(this.ARRAY_PROTO);return this.setProperty(e,"length",0,{configurable:!1,enumerable:!1,writable:!0}),e.class="Array",e};o.prototype.createFunctionBase_=function(e,t){var i=this.createObjectProto(this.FUNCTION_PROTO);if(t){var r=this.createObjectProto(this.OBJECT_PROTO);this.setProperty(i,"prototype",r,o.NONENUMERABLE_DESCRIPTOR),this.setProperty(r,"constructor",i,o.NONENUMERABLE_DESCRIPTOR)}else i.illegalConstructor=!0;return this.setProperty(i,"length",e,o.READONLY_NONENUMERABLE_DESCRIPTOR),i.class="Function",i};o.prototype.createFunction=function(e,t,i){var r=this.createFunctionBase_(e.params.length,!0);r.parentScope=t,r.node=e;var n=e.id?String(e.id.name):i||"";return this.setProperty(r,"name",n,o.READONLY_NONENUMERABLE_DESCRIPTOR),r};o.prototype.createNativeFunction=function(e,t){var i=this.createFunctionBase_(e.length,t);return i.nativeFunc=e,e.id=this.functionCounter_++,this.setProperty(i,"name",e.name,o.READONLY_NONENUMERABLE_DESCRIPTOR),i};o.prototype.createAsyncFunction=function(e){var t=this.createFunctionBase_(e.length,!0);return t.asyncFunc=e,e.id=this.functionCounter_++,this.setProperty(t,"name",e.name,o.READONLY_NONENUMERABLE_DESCRIPTOR),t};o.prototype.nativeToPseudo=function(e){if(e instanceof o.Object)throw Error("Object is already pseudo");if(e==null||e===!0||e===!1||typeof e=="string"||typeof e=="number")return e;if(e instanceof RegExp){var t=this.createObjectProto(this.REGEXP_PROTO);return this.populateRegExp(t,e),t}if(e instanceof Date){var i=this.createObjectProto(this.DATE_PROTO);return i.data=new Date(e.valueOf()),i}if(typeof e=="function"){var r=this,n=function(){var f=Array.prototype.slice.call(arguments).map(function(m){return r.pseudoToNative(m)}),d=e.apply(r,f);return r.nativeToPseudo(d)},s=Object.getOwnPropertyDescriptor(e,"prototype");return this.createNativeFunction(n,!!s)}if(Array.isArray(e)){for(var a=this.createArray(),u=0;u<e.length;u++)u in e&&this.setProperty(a,u,this.nativeToPseudo(e[u]));return a}var l=this.createObjectProto(this.OBJECT_PROTO);for(var p in e)this.setProperty(l,p,this.nativeToPseudo(e[p]));return l};o.prototype.pseudoToNative=function(e,t){if(typeof e!="object"&&typeof e!="function"||e===null)return e;if(!(e instanceof o.Object))throw Error("Object is not pseudo");if(this.isa(e,this.REGEXP)){var i=new RegExp(e.data.source,e.data.flags);return i.lastIndex=e.data.lastIndex,i}if(this.isa(e,this.DATE))return new Date(e.data.valueOf());var r=t||{pseudo:[],native:[]},n=r.pseudo.indexOf(e);if(n!==-1)return r.native[n];r.pseudo.push(e);var s;if(this.isa(e,this.ARRAY)){s=[],r.native.push(s);for(var a=this.getProperty(e,"length"),u=0;u<a;u++)this.hasProperty(e,u)&&(s[u]=this.pseudoToNative(this.getProperty(e,u),r))}else{s={},r.native.push(s);var l;for(var p in e.properties)l=this.pseudoToNative(e.properties[p],r),Object.defineProperty(s,p,{value:l,writable:!0,enumerable:!0,configurable:!0})}return r.pseudo.pop(),r.native.pop(),s};o.prototype.arrayNativeToPseudo=function(e){for(var t=this.createArray(),i=Object.getOwnPropertyNames(e),r=0;r<i.length;r++)this.setProperty(t,i[r],e[i[r]]);return t};o.prototype.arrayPseudoToNative=function(e){var t=[];for(var i in e.properties)t[i]=this.getProperty(e,i);return t.length=o.legalArrayLength(this.getProperty(e,"length"))||0,t};o.prototype.getPrototype=function(e){switch(typeof e){case"number":return this.NUMBER.properties.prototype;case"boolean":return this.BOOLEAN.properties.prototype;case"string":return this.STRING.properties.prototype}return e?e.proto:null};o.prototype.getProperty=function(e,t){if(this.getterStep_)throw Error("Getter not supported in that context");if(t=String(t),e==null&&this.throwException(this.TYPE_ERROR,"Cannot read property '"+t+"' of "+e),typeof e=="object"&&!(e instanceof o.Object))throw TypeError("Expecting native value or pseudo object");if(t==="length"){if(this.isa(e,this.STRING))return String(e).length}else if(t.charCodeAt(0)<64&&this.isa(e,this.STRING)){var i=o.legalArrayIndex(t);if(!isNaN(i)&&i<String(e).length)return String(e)[i]}do if(e.properties&&t in e.properties){var r=e.getter[t];return r?(this.getterStep_=!0,r):e.properties[t]}while(e=this.getPrototype(e))};o.prototype.hasProperty=function(e,t){if(!(e instanceof o.Object))throw TypeError("Primitive data type has no properties");if(t=String(t),t==="length"&&this.isa(e,this.STRING))return!0;if(this.isa(e,this.STRING)){var i=o.legalArrayIndex(t);if(!isNaN(i)&&i<String(e).length)return!0}do if(e.properties&&t in e.properties)return!0;while(e=this.getPrototype(e));return!1};o.prototype.setProperty=function(e,t,i,r){if(this.setterStep_)throw Error("Setter not supported in that context");if(t=String(t),e==null&&this.throwException(this.TYPE_ERROR,"Cannot set property '"+t+"' of "+e),typeof e=="object"&&!(e instanceof o.Object))throw TypeError("Expecting native value or pseudo object");r&&("get"in r||"set"in r)&&("value"in r||"writable"in r)&&this.throwException(this.TYPE_ERROR,"Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");var n=!this.stateStack||this.getScope().strict;if(!(e instanceof o.Object)){n&&this.throwException(this.TYPE_ERROR,"Can't create property '"+t+"' on '"+e+"'");return}if(this.isa(e,this.STRING)){var s=o.legalArrayIndex(t);if(t==="length"||!isNaN(s)&&s<String(e).length){n&&this.throwException(this.TYPE_ERROR,"Cannot assign to read only property '"+t+"' of String '"+e.data+"'");return}}if(e.class==="Array"){var a=e.properties.length,u;if(t==="length"){if(r){if(!("value"in r))return;i=r.value}if(i=o.legalArrayLength(i),isNaN(i)&&this.throwException(this.RANGE_ERROR,"Invalid array length"),i<a)for(u in e.properties)u=o.legalArrayIndex(u),!isNaN(u)&&i<=u&&delete e.properties[u]}else isNaN(u=o.legalArrayIndex(t))||(e.properties.length=Math.max(a,u+1))}if(e.preventExtensions&&!(t in e.properties)){n&&this.throwException(this.TYPE_ERROR,"Can't add property '"+t+"', object is not extensible");return}if(r){var l={};"get"in r&&r.get&&(e.getter[t]=r.get,l.get=this.setProperty.placeholderGet_),"set"in r&&r.set&&(e.setter[t]=r.set,l.set=this.setProperty.placeholderSet_),"configurable"in r&&(l.configurable=r.configurable),"enumerable"in r&&(l.enumerable=r.enumerable),"writable"in r&&(l.writable=r.writable,delete e.getter[t],delete e.setter[t]),"value"in r?(l.value=r.value,delete e.getter[t],delete e.setter[t]):i!==o.VALUE_IN_DESCRIPTOR&&(l.value=i,delete e.getter[t],delete e.setter[t]);try{Object.defineProperty(e.properties,t,l)}catch{this.throwException(this.TYPE_ERROR,"Cannot redefine property: "+t)}"get"in r&&!r.get&&delete e.getter[t],"set"in r&&!r.set&&delete e.setter[t]}else{if(i===o.VALUE_IN_DESCRIPTOR)throw ReferenceError("Value not specified");for(var p=e;!(t in p.properties);)if(p=this.getPrototype(p),!p){p=e;break}if(p.setter&&p.setter[t])return this.setterStep_=!0,p.setter[t];if(p.getter&&p.getter[t])n&&this.throwException(this.TYPE_ERROR,"Cannot set property '"+t+"' of object '"+e+"' which only has a getter");else try{e.properties[t]=i}catch{n&&this.throwException(this.TYPE_ERROR,"Cannot assign to read only property '"+t+"' of object '"+e+"'")}}};o.prototype.setProperty.placeholderGet_=function(){throw Error("Placeholder getter")};o.prototype.setProperty.placeholderSet_=function(){throw Error("Placeholder setter")};o.prototype.setNativeFunctionPrototype=function(e,t,i){this.setProperty(e.properties.prototype,t,this.createNativeFunction(i,!1),o.NONENUMERABLE_DESCRIPTOR)};o.prototype.setAsyncFunctionPrototype=function(e,t,i){this.setProperty(e.properties.prototype,t,this.createAsyncFunction(i),o.NONENUMERABLE_DESCRIPTOR)};o.prototype.getScope=function(){var e=this.stateStack[this.stateStack.length-1].scope;if(!e)throw Error("No scope found");return e};o.prototype.createScope=function(e,t){var i=!1;if(t&&t.strict)i=!0;else{var r=e.body&&e.body[0];r&&r.expression&&r.expression.type==="Literal"&&r.expression.value==="use strict"&&(i=!0)}var n=this.createObjectProto(null),s=new o.Scope(t,i,n);return t||this.initGlobal(s.object),this.populateScope_(e,s),s};o.prototype.createSpecialScope=function(e,t){if(!e)throw Error("parentScope required");var i=t||this.createObjectProto(null);return new o.Scope(e,e.strict,i)};o.prototype.getValueFromScope=function(e){for(var t=this.getScope();t&&t!==this.globalScope;){if(e in t.object.properties)return t.object.properties[e];t=t.parentScope}if(t===this.globalScope&&this.hasProperty(t.object,e))return this.getProperty(t.object,e);var i=this.stateStack[this.stateStack.length-1].node;i.type==="UnaryExpression"&&i.operator==="typeof"||this.throwException(this.REFERENCE_ERROR,e+" is not defined")};o.prototype.setValueToScope=function(e,t){for(var i=this.getScope(),r=i.strict;i&&i!==this.globalScope;){if(e in i.object.properties){try{i.object.properties[e]=t}catch{r&&this.throwException(this.TYPE_ERROR,"Cannot assign to read only variable '"+e+"'")}return}i=i.parentScope}if(i===this.globalScope&&(!r||this.hasProperty(i.object,e)))return this.setProperty(i.object,e,t);this.throwException(this.REFERENCE_ERROR,e+" is not defined")};o.prototype.populateScope_=function(e,t){var i;if(e.variableCache_)i=e.variableCache_;else{switch(i=Object.create(null),e.type){case"VariableDeclaration":for(var r=0;r<e.declarations.length;r++)i[e.declarations[r].id.name]=!0;break;case"FunctionDeclaration":i[e.id.name]=e;break;case"BlockStatement":case"CatchClause":case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"Program":case"SwitchCase":case"SwitchStatement":case"TryStatement":case"WithStatement":case"WhileStatement":var n=e.constructor;for(var s in e)if(s!=="loc"){var a=e[s];if(a&&typeof a=="object"){var u;if(Array.isArray(a)){for(var r=0;r<a.length;r++)if(a[r]&&a[r].constructor===n){u=this.populateScope_(a[r],t);for(var s in u)i[s]=u[s]}}else if(a.constructor===n){u=this.populateScope_(a,t);for(var s in u)i[s]=u[s]}}}}e.variableCache_=i}for(var s in i)i[s]===!0?this.setProperty(t.object,s,void 0,o.VARIABLE_DESCRIPTOR):this.setProperty(t.object,s,this.createFunction(i[s],t),o.VARIABLE_DESCRIPTOR);return i};o.prototype.calledWithNew=function(){return this.stateStack[this.stateStack.length-1].isConstructor};o.prototype.getValue=function(e){return e[0]===o.SCOPE_REFERENCE?this.getValueFromScope(e[1]):this.getProperty(e[0],e[1])};o.prototype.setValue=function(e,t){return e[0]===o.SCOPE_REFERENCE?this.setValueToScope(e[1],t):this.setProperty(e[0],e[1],t)};o.prototype.throwException=function(e,t){if(!this.globalScope)throw t===void 0?e:t;if(t===void 0||!(e instanceof o.Object))var i=e;else{var i=this.createObject(e);this.populateError(i,t)}throw this.unwind(o.Completion.THROW,i,void 0),o.STEP_ERROR};o.prototype.unwind=function(e,t,i){if(e===o.Completion.NORMAL)throw TypeError("Should not unwind for NORMAL completions");e:for(var r=this.stateStack;r.length>0;r.pop()){var n=r[r.length-1];switch(n.node.type){case"TryStatement":n.cv={type:e,value:t,label:i};return;case"CallExpression":case"NewExpression":if(e===o.Completion.RETURN){n.value=t;return}else if(e!==o.Completion.THROW)throw Error("Unsynatctic break/continue not rejected by Acorn");break;case"Program":n.done=!0;break e}if(e===o.Completion.BREAK){if(i?n.labels&&n.labels.indexOf(i)!==-1:n.isLoop||n.isSwitch){r.pop();return}}else if(e===o.Completion.CONTINUE&&(i?n.labels&&n.labels.indexOf(i)!==-1:n.isLoop))return}var s;if(this.isa(t,this.ERROR)){var a={EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},u=String(this.getProperty(t,"name")),l=this.getProperty(t,"message").valueOf(),p=a[u]||Error;s=p(l),s.stack=String(this.getProperty(t,"stack"))}else s=String(t);throw this.value=s,s};o.prototype.nodeSummary=function(e){switch(e.type){case"ArrayExpression":return"[...]";case"BinaryExpression":case"LogicalExpression":return this.nodeSummary(e.left)+" "+e.operator+" "+this.nodeSummary(e.right);case"CallExpression":return this.nodeSummary(e.callee)+"(...)";case"ConditionalExpression":return this.nodeSummary(e.test)+" ? "+this.nodeSummary(e.consequent)+" : "+this.nodeSummary(e.alternate);case"Identifier":return e.name;case"Literal":return e.raw;case"MemberExpression":var t=this.nodeSummary(e.object),i=this.nodeSummary(e.property);return e.computed?t+"["+i+"]":t+"."+i;case"NewExpression":return"new "+this.nodeSummary(e.callee)+"(...)";case"ObjectExpression":return"{...}";case"ThisExpression":return"this";case"UnaryExpression":return e.operator+" "+this.nodeSummary(e.argument);case"UpdateExpression":var r=this.nodeSummary(e.argument);return e.prefix?e.operator+r:r+e.operator}return"???"};o.prototype.createGetter_=function(e,t){if(!this.getterStep_)throw Error("Unexpected call to createGetter");this.getterStep_=!1;var i=Array.isArray(t)?t[0]:t,r=this.newNode();r.type="CallExpression";var n=new o.State(r,this.stateStack[this.stateStack.length-1].scope);return n.doneCallee_=2,n.funcThis_=i,n.func_=e,n.doneArgs_=!0,n.arguments_=[],n};o.prototype.createSetter_=function(e,t,i){if(!this.setterStep_)throw Error("Unexpected call to createSetter");this.setterStep_=!1;var r=Array.isArray(t)?t[0]:this.globalObject,n=this.newNode();n.type="CallExpression";var s=new o.State(n,this.stateStack[this.stateStack.length-1].scope);return s.doneCallee_=2,s.funcThis_=r,s.func_=e,s.doneArgs_=!0,s.arguments_=[i],s};o.prototype.boxThis_=function(e){if(e==null)return this.globalObject;if(!(e instanceof o.Object)){var t=this.createObjectProto(this.getPrototype(e));return t.data=e,t}return e};o.prototype.getGlobalScope=function(){return this.globalScope};o.prototype.getStateStack=function(){return this.stateStack};o.prototype.setStateStack=function(e){this.stateStack=e};o.Value;o.State=function(e,t){this.node=e,this.scope=t};o.Scope=function(e,t,i){this.parentScope=e,this.strict=t,this.object=i};o.Object=function(e){this.getter=Object.create(null),this.setter=Object.create(null),this.properties=Object.create(null),this.proto=e};o.Object.prototype.proto=null;o.Object.prototype.class="Object";o.Object.prototype.data=null;o.Object.prototype.toString=function(){if(!o.currentInterpreter_)return"[object Interpreter.Object]";if(!(this instanceof o.Object))return String(this);if(this.class==="Array"){var e=o.toStringCycles_;e.push(this);try{var t=[],i=this.properties.length,r=!1;i>1024&&(i=1e3,r=!0);for(var n=0;n<i;n++){var s=this.properties[n];t[n]=s instanceof o.Object&&e.indexOf(s)!==-1?"...":s}r&&t.push("...")}finally{e.pop()}return t.join(",")}if(this.class==="Error"){var e=o.toStringCycles_;if(e.indexOf(this)!==-1)return"[object Error]";var a,u,l=this;do if("name"in l.properties){a=l.properties.name;break}while(l=l.proto);l=this;do if("message"in l.properties){u=l.properties.message;break}while(l=l.proto);e.push(this);try{a=a&&String(a),u=u&&String(u)}finally{e.pop()}return u?a+": "+u:String(a)}return this.data!==null?String(this.data):"[object "+this.class+"]"};o.Object.prototype.valueOf=function(){return o.currentInterpreter_?this.data===void 0||this.data===null||this.data instanceof RegExp?this:this.data instanceof Date?this.data.valueOf():this.data:this};o.prototype.stepArrayExpression=function(e,t,i){var r=i.elements,n=t.n_||0;for(t.array_?(this.setProperty(t.array_,n,t.value),n++):(t.array_=this.createArray(),t.array_.properties.length=r.length);n<r.length;){if(r[n])return t.n_=n,new o.State(r[n],t.scope);n++}e.pop(),e[e.length-1].value=t.array_};o.prototype.stepAssignmentExpression=function(e,t,i){if(!t.doneLeft_){t.doneLeft_=!0;var r=new o.State(i.left,t.scope);return r.components=!0,r}if(!t.doneRight_){if(t.leftReference_||(t.leftReference_=t.value),t.doneGetter_&&(t.leftValue_=t.value),!t.doneGetter_&&i.operator!=="="){var n=this.getValue(t.leftReference_);if(t.leftValue_=n,this.getterStep_){t.doneGetter_=!0;var s=n;return this.createGetter_(s,t.leftReference_)}}return t.doneRight_=!0,i.operator==="="&&i.left.type==="Identifier"&&(t.destinationName=i.left.name),new o.State(i.right,t.scope)}if(t.doneSetter_){e.pop(),e[e.length-1].value=t.setterValue_;return}var a=t.leftValue_,u=t.value;switch(i.operator){case"=":a=u;break;case"+=":a+=u;break;case"-=":a-=u;break;case"*=":a*=u;break;case"/=":a/=u;break;case"%=":a%=u;break;case"<<=":a<<=u;break;case">>=":a>>=u;break;case">>>=":a>>>=u;break;case"&=":a&=u;break;case"^=":a^=u;break;case"|=":a|=u;break;default:throw SyntaxError("Unknown assignment expression: "+i.operator)}var l=this.setValue(t.leftReference_,a);if(l)return t.doneSetter_=!0,t.setterValue_=a,this.createSetter_(l,t.leftReference_,a);e.pop(),e[e.length-1].value=a};o.prototype.stepBinaryExpression=function(e,t,i){if(!t.doneLeft_)return t.doneLeft_=!0,new o.State(i.left,t.scope);if(!t.doneRight_)return t.doneRight_=!0,t.leftValue_=t.value,new o.State(i.right,t.scope);e.pop();var r=t.leftValue_,n=t.value,s;switch(i.operator){case"==":s=r==n;break;case"!=":s=r!=n;break;case"===":s=r===n;break;case"!==":s=r!==n;break;case">":s=r>n;break;case">=":s=r>=n;break;case"<":s=r<n;break;case"<=":s=r<=n;break;case"+":s=r+n;break;case"-":s=r-n;break;case"*":s=r*n;break;case"/":s=r/n;break;case"%":s=r%n;break;case"&":s=r&n;break;case"|":s=r|n;break;case"^":s=r^n;break;case"<<":s=r<<n;break;case">>":s=r>>n;break;case">>>":s=r>>>n;break;case"in":n instanceof o.Object||this.throwException(this.TYPE_ERROR,"'in' expects an object, not '"+n+"'"),s=this.hasProperty(n,r);break;case"instanceof":this.isa(n,this.FUNCTION)||this.throwException(this.TYPE_ERROR,"'instanceof' expects an object, not '"+n+"'"),s=r instanceof o.Object?this.isa(r,n):!1;break;default:throw SyntaxError("Unknown binary operator: "+i.operator)}e[e.length-1].value=s};o.prototype.stepBlockStatement=function(e,t,i){var r=t.n_||0,n=i.body[r];if(n)return t.n_=r+1,new o.State(n,t.scope);e.pop()};o.prototype.stepBreakStatement=function(e,t,i){var r=i.label&&i.label.name;this.unwind(o.Completion.BREAK,void 0,r)};o.prototype.evalCodeNumber_=0;o.prototype.stepCallExpression=function(e,t,i){if(!t.doneCallee_){t.doneCallee_=1;var r=new o.State(i.callee,t.scope);return r.components=!0,r}if(t.doneCallee_===1){t.doneCallee_=2;var n=t.value;if(Array.isArray(n)){if(t.func_=this.getValue(n),n[0]===o.SCOPE_REFERENCE?t.directEval_=n[1]==="eval":t.funcThis_=n[0],n=t.func_,this.getterStep_)return t.doneCallee_=1,this.createGetter_(n,t.value)}else t.func_=n;t.arguments_=[],t.n_=0}var n=t.func_;if(!t.doneArgs_){if(t.n_!==0&&t.arguments_.push(t.value),i.arguments[t.n_])return new o.State(i.arguments[t.n_++],t.scope);if(i.type==="NewExpression"){if((!(n instanceof o.Object)||n.illegalConstructor)&&this.throwException(this.TYPE_ERROR,this.nodeSummary(i.callee)+" is not a constructor"),n===this.ARRAY)t.funcThis_=this.createArray();else{var s=n.properties.prototype;(typeof s!="object"||s===null)&&(s=this.OBJECT_PROTO),t.funcThis_=this.createObjectProto(s)}t.isConstructor=!0}t.doneArgs_=!0}if(t.doneExec_)e.pop(),t.isConstructor&&typeof t.value!="object"?e[e.length-1].value=t.funcThis_:e[e.length-1].value=t.value;else{t.doneExec_=!0,n instanceof o.Object||this.throwException(this.TYPE_ERROR,this.nodeSummary(i.callee)+" is not a function");var a=n.node;if(a){for(var u=this.createScope(a.body,n.parentScope),l=this.createArray(),p=0;p<t.arguments_.length;p++)this.setProperty(l,p,t.arguments_[p]);this.setProperty(u.object,"arguments",l);for(var p=0;p<a.params.length;p++){var f=a.params[p].name,d=t.arguments_.length>p?t.arguments_[p]:void 0;this.setProperty(u.object,f,d)}return u.strict||(t.funcThis_=this.boxThis_(t.funcThis_)),this.setProperty(u.object,"this",t.funcThis_,o.READONLY_DESCRIPTOR),t.value=void 0,new o.State(a.body,u)}else if(n.eval){var m=t.arguments_[0];if(typeof m!="string")t.value=m;else{try{var v=this.parse_(String(m),"eval"+this.evalCodeNumber_++)}catch(Ni){this.throwException(this.SYNTAX_ERROR,"Invalid code: "+Ni.message)}var g=this.newNode();g.type="EvalProgram_",g.body=v.body,o.stripLocations_(g,i.start,i.end);var u=t.directEval_?t.scope:this.globalScope;return u.strict?u=this.createScope(v,u):this.populateScope_(v,u),this.value=void 0,new o.State(g,u)}}else if(n.nativeFunc)t.scope.strict||(t.funcThis_=this.boxThis_(t.funcThis_)),t.value=n.nativeFunc.apply(t.funcThis_,t.arguments_);else if(n.asyncFunc){var S=this,R=function(wi){t.value=wi,S.paused_=!1},P=n.asyncFunc.length-1,O=t.arguments_.concat(new Array(P)).slice(0,P);O.push(R),this.paused_=!0,t.scope.strict||(t.funcThis_=this.boxThis_(t.funcThis_)),n.asyncFunc.apply(t.funcThis_,O);return}else this.throwException(this.TYPE_ERROR,this.nodeSummary(i.callee)+" is not callable")}};o.prototype.stepConditionalExpression=function(e,t,i){var r=t.mode_||0;if(r===0)return t.mode_=1,new o.State(i.test,t.scope);if(r===1){t.mode_=2;var n=Boolean(t.value);if(n&&i.consequent)return new o.State(i.consequent,t.scope);if(!n&&i.alternate)return new o.State(i.alternate,t.scope);this.value=void 0}e.pop(),i.type==="ConditionalExpression"&&(e[e.length-1].value=t.value)};o.prototype.stepContinueStatement=function(e,t,i){var r=i.label&&i.label.name;this.unwind(o.Completion.CONTINUE,void 0,r)};o.prototype.stepDebuggerStatement=function(e,t,i){e.pop()};o.prototype.stepDoWhileStatement=function(e,t,i){if(i.type==="DoWhileStatement"&&t.test_===void 0&&(t.value=!0,t.test_=!0),!t.test_)return t.test_=!0,new o.State(i.test,t.scope);if(!t.value)e.pop();else if(i.body)return t.test_=!1,t.isLoop=!0,new o.State(i.body,t.scope)};o.prototype.stepEmptyStatement=function(e,t,i){e.pop()};o.prototype.stepEvalProgram_=function(e,t,i){var r=t.n_||0,n=i.body[r];if(n)return t.n_=r+1,new o.State(n,t.scope);e.pop(),e[e.length-1].value=this.value};o.prototype.stepExpressionStatement=function(e,t,i){if(!t.done_)return this.value=void 0,t.done_=!0,new o.State(i.expression,t.scope);e.pop(),this.value=t.value};o.prototype.stepForInStatement=function(e,t,i){if(!t.doneInit_&&(t.doneInit_=!0,i.left.declarations&&i.left.declarations[0].init))return t.scope.strict&&this.throwException(this.SYNTAX_ERROR,"for-in loop variable declaration may not have an initializer"),new o.State(i.left,t.scope);if(!t.doneObject_)return t.doneObject_=!0,t.variable_||(t.variable_=t.value),new o.State(i.right,t.scope);if(t.isLoop||(t.isLoop=!0,t.object_=t.value,t.visited_=Object.create(null)),t.name_===void 0){e:for(;;){if(t.object_ instanceof o.Object)for(t.props_||(t.props_=Object.getOwnPropertyNames(t.object_.properties));;){var r=t.props_.shift();if(r===void 0)break;if(!!Object.prototype.hasOwnProperty.call(t.object_.properties,r)&&!t.visited_[r]&&(t.visited_[r]=!0,!!Object.prototype.propertyIsEnumerable.call(t.object_.properties,r))){t.name_=r;break e}}else if(t.object_!==null&&t.object_!==void 0)for(t.props_||(t.props_=Object.getOwnPropertyNames(t.object_));;){var r=t.props_.shift();if(r===void 0)break;if(t.visited_[r]=!0,!!Object.prototype.propertyIsEnumerable.call(t.object_,r)){t.name_=r;break e}}if(t.object_=this.getPrototype(t.object_),t.props_=null,t.object_===null){e.pop();return}}}if(!t.doneVariable_){t.doneVariable_=!0;var n=i.left;if(n.type==="VariableDeclaration")t.variable_=[o.SCOPE_REFERENCE,n.declarations[0].id.name];else{t.variable_=null;var s=new o.State(n,t.scope);return s.components=!0,s}}if(t.variable_||(t.variable_=t.value),!t.doneSetter_){t.doneSetter_=!0;var a=t.name_,u=this.setValue(t.variable_,a);if(u)return this.createSetter_(u,t.variable_,a)}if(t.name_=void 0,t.doneVariable_=!1,t.doneSetter_=!1,i.body)return new o.State(i.body,t.scope)};o.prototype.stepForStatement=function(e,t,i){switch(t.mode_){default:if(t.mode_=1,i.init)return new o.State(i.init,t.scope);break;case 1:if(t.mode_=2,i.test)return new o.State(i.test,t.scope);break;case 2:if(t.mode_=3,i.test&&!t.value)e.pop();else return t.isLoop=!0,new o.State(i.body,t.scope);break;case 3:if(t.mode_=1,i.update)return new o.State(i.update,t.scope);break}};o.prototype.stepFunctionDeclaration=function(e,t,i){e.pop()};o.prototype.stepFunctionExpression=function(e,t,i){e.pop(),t=e[e.length-1];var r=t.scope;i.id&&(r=this.createSpecialScope(r)),t.value=this.createFunction(i,r,t.destinationName),i.id&&this.setProperty(r.object,i.id.name,t.value,o.READONLY_DESCRIPTOR)};o.prototype.stepIdentifier=function(e,t,i){if(e.pop(),t.components){e[e.length-1].value=[o.SCOPE_REFERENCE,i.name];return}var r=this.getValueFromScope(i.name);if(this.getterStep_){var n=r;return this.createGetter_(n,this.globalObject)}e[e.length-1].value=r};o.prototype.stepIfStatement=o.prototype.stepConditionalExpression;o.prototype.stepLabeledStatement=function(e,t,i){e.pop();var r=t.labels||[];r.push(i.label.name);var n=new o.State(i.body,t.scope);return n.labels=r,n};o.prototype.stepLiteral=function(e,t,i){e.pop();var r=i.value;if(r instanceof RegExp){var n=this.createObjectProto(this.REGEXP_PROTO);this.populateRegExp(n,r),r=n}e[e.length-1].value=r};o.prototype.stepLogicalExpression=function(e,t,i){if(i.operator!=="&&"&&i.operator!=="||")throw SyntaxError("Unknown logical operator: "+i.operator);if(!t.doneLeft_)return t.doneLeft_=!0,new o.State(i.left,t.scope);if(t.doneRight_)e.pop(),e[e.length-1].value=t.value;else if(i.operator==="&&"&&!t.value||i.operator==="||"&&t.value)e.pop(),e[e.length-1].value=t.value;else return t.doneRight_=!0,new o.State(i.right,t.scope)};o.prototype.stepMemberExpression=function(e,t,i){if(!t.doneObject_)return t.doneObject_=!0,new o.State(i.object,t.scope);var r;if(!i.computed)t.object_=t.value,r=i.property.name;else if(t.doneProperty_)r=t.value;else return t.object_=t.value,t.doneProperty_=!0,new o.State(i.property,t.scope);if(e.pop(),t.components)e[e.length-1].value=[t.object_,r];else{var n=this.getProperty(t.object_,r);if(this.getterStep_){var s=n;return this.createGetter_(s,t.object_)}e[e.length-1].value=n}};o.prototype.stepNewExpression=o.prototype.stepCallExpression;o.prototype.stepObjectExpression=function(e,t,i){var r=t.n_||0,n=i.properties[r];if(!t.object_)t.object_=this.createObjectProto(this.OBJECT_PROTO),t.properties_=Object.create(null);else{var s=t.destinationName;t.properties_[s]||(t.properties_[s]={}),t.properties_[s][n.kind]=t.value,t.n_=++r,n=i.properties[r]}if(n){var a=n.key;if(a.type==="Identifier")var s=a.name;else if(a.type==="Literal")var s=a.value;else throw SyntaxError("Unknown object structure: "+a.type);return t.destinationName=s,new o.State(n.value,t.scope)}for(var a in t.properties_){var u=t.properties_[a];if("get"in u||"set"in u){var l={configurable:!0,enumerable:!0,get:u.get,set:u.set};this.setProperty(t.object_,a,o.VALUE_IN_DESCRIPTOR,l)}else this.setProperty(t.object_,a,u.init)}e.pop(),e[e.length-1].value=t.object_};o.prototype.stepProgram=function(e,t,i){var r=i.body.shift();if(r)return t.done=!1,new o.State(r,t.scope);t.done=!0};o.prototype.stepReturnStatement=function(e,t,i){if(i.argument&&!t.done_)return t.done_=!0,new o.State(i.argument,t.scope);this.unwind(o.Completion.RETURN,t.value,void 0)};o.prototype.stepSequenceExpression=function(e,t,i){var r=t.n_||0,n=i.expressions[r];if(n)return t.n_=r+1,new o.State(n,t.scope);e.pop(),e[e.length-1].value=t.value};o.prototype.stepSwitchStatement=function(e,t,i){if(!t.test_)return t.test_=1,new o.State(i.discriminant,t.scope);for(t.test_===1&&(t.test_=2,t.switchValue_=t.value,t.defaultCase_=-1);;){var r=t.index_||0,n=i.cases[r];if(!t.matched_&&n&&!n.test){t.defaultCase_=r,t.index_=r+1;continue}if(!n&&!t.matched_&&t.defaultCase_!==-1){t.matched_=!0,t.index_=t.defaultCase_;continue}if(n){if(!t.matched_&&!t.tested_&&n.test)return t.tested_=!0,new o.State(n.test,t.scope);if(t.matched_||t.value===t.switchValue_){t.matched_=!0;var s=t.n_||0;if(n.consequent[s])return t.isSwitch=!0,t.n_=s+1,new o.State(n.consequent[s],t.scope)}t.tested_=!1,t.n_=0,t.index_=r+1}else{e.pop();return}}};o.prototype.stepThisExpression=function(e,t,i){e.pop(),e[e.length-1].value=this.getValueFromScope("this")};o.prototype.stepThrowStatement=function(e,t,i){if(t.done_)this.throwException(t.value);else return t.done_=!0,new o.State(i.argument,t.scope)};o.prototype.stepTryStatement=function(e,t,i){if(!t.doneBlock_)return t.doneBlock_=!0,new o.State(i.block,t.scope);if(t.cv&&t.cv.type===o.Completion.THROW&&!t.doneHandler_&&i.handler){t.doneHandler_=!0;var r=this.createSpecialScope(t.scope);return this.setProperty(r.object,i.handler.param.name,t.cv.value),t.cv=void 0,new o.State(i.handler.body,r)}if(!t.doneFinalizer_&&i.finalizer)return t.doneFinalizer_=!0,new o.State(i.finalizer,t.scope);e.pop(),t.cv&&this.unwind(t.cv.type,t.cv.value,t.cv.label)};o.prototype.stepUnaryExpression=function(e,t,i){if(!t.done_){t.done_=!0;var r=new o.State(i.argument,t.scope);return r.components=i.operator==="delete",r}e.pop();var n=t.value;switch(i.operator){case"-":n=-n;break;case"+":n=+n;break;case"!":n=!n;break;case"~":n=~n;break;case"delete":var s=!0;if(Array.isArray(n)){var a=n[0];a===o.SCOPE_REFERENCE&&(a=t.scope);var u=String(n[1]);try{delete a.properties[u]}catch{t.scope.strict?this.throwException(this.TYPE_ERROR,"Cannot delete property '"+u+"' of '"+a+"'"):s=!1}}n=s;break;case"typeof":n=n&&n.class==="Function"?"function":typeof n;break;case"void":n=void 0;break;default:throw SyntaxError("Unknown unary operator: "+i.operator)}e[e.length-1].value=n};o.prototype.stepUpdateExpression=function(e,t,i){if(!t.doneLeft_){t.doneLeft_=!0;var r=new o.State(i.argument,t.scope);return r.components=!0,r}if(t.leftSide_||(t.leftSide_=t.value),t.doneGetter_&&(t.leftValue_=t.value),!t.doneGetter_){var s=this.getValue(t.leftSide_);if(t.leftValue_=s,this.getterStep_){t.doneGetter_=!0;var n=s;return this.createGetter_(n,t.leftSide_)}}if(t.doneSetter_){e.pop(),e[e.length-1].value=t.setterValue_;return}var s=Number(t.leftValue_),a;if(i.operator==="++")a=s+1;else if(i.operator==="--")a=s-1;else throw SyntaxError("Unknown update expression: "+i.operator);var u=i.prefix?a:s,l=this.setValue(t.leftSide_,a);if(l)return t.doneSetter_=!0,t.setterValue_=u,this.createSetter_(l,t.leftSide_,a);e.pop(),e[e.length-1].value=u};o.prototype.stepVariableDeclaration=function(e,t,i){var r=i.declarations,n=t.n_||0,s=r[n];for(t.init_&&s&&(this.setValueToScope(s.id.name,t.value),t.init_=!1,s=r[++n]);s;){if(s.init)return t.n_=n,t.init_=!0,t.destinationName=s.id.name,new o.State(s.init,t.scope);s=r[++n]}e.pop()};o.prototype.stepWithStatement=function(e,t,i){if(!t.doneObject_)return t.doneObject_=!0,new o.State(i.object,t.scope);e.pop();var r=this.createSpecialScope(t.scope,t.value);return new o.State(i.body,r)};o.prototype.stepWhileStatement=o.prototype.stepDoWhileStatement;o.nativeGlobal.Interpreter=o;o.prototype.step=o.prototype.step;o.prototype.run=o.prototype.run;o.prototype.appendCode=o.prototype.appendCode;o.prototype.createObject=o.prototype.createObject;o.prototype.createObjectProto=o.prototype.createObjectProto;o.prototype.createAsyncFunction=o.prototype.createAsyncFunction;o.prototype.createNativeFunction=o.prototype.createNativeFunction;o.prototype.getProperty=o.prototype.getProperty;o.prototype.setProperty=o.prototype.setProperty;o.prototype.nativeToPseudo=o.prototype.nativeToPseudo;o.prototype.pseudoToNative=o.prototype.pseudoToNative;o.prototype.getGlobalScope=o.prototype.getGlobalScope;o.prototype.getStateStack=o.prototype.getStateStack;o.prototype.setStateStack=o.prototype.setStateStack;o.VALUE_IN_DESCRIPTOR=o.VALUE_IN_DESCRIPTOR;o.nativeGlobal.acornParse=hr;const pr=e=>e.split(`
|
|
16
16
|
`).map(t=>{const i=t.trim();if(t.includes("__awaiter"))return;if(!i.startsWith("state."))return t;const[n,s]=i.split("="),u=`setRootState('${n.replace("state.","").trim()}', ${s.trim()})`;return`
|
|
17
17
|
${t}
|
|
18
18
|
${u}
|
|
19
19
|
`}).filter(Boolean).join(`
|
|
20
|
-
`),Qe=e=>e+"JSON",
|
|
21
|
-
`),f=
|
|
20
|
+
`),Qe=e=>e+"JSON",fr=({builder:e,context:t,event:i,rootState:r,localState:n,rootSetState:s,useCode:a})=>{const u={...r,...n},l={state:u,Builder:e,builder:e,context:t,event:i},p=Object.keys(l).map(g=>`var ${g} = JSON.parse(${Qe(g)});`).join(`
|
|
21
|
+
`),f=pr(a);if(f===""){B.warn("Skipping evaluation of empty code block.");return}const d=`
|
|
22
22
|
function theFunction() {
|
|
23
23
|
${p}
|
|
24
24
|
|
|
25
25
|
${f}
|
|
26
26
|
}
|
|
27
27
|
theFunction();
|
|
28
|
-
`,m=(g,S)=>{const R=pt(u,g,S);s==null||s(R)},v=function(g,S){Object.keys(l).forEach(R=>{const P=l[R]||{},O=JSON.stringify(P);g.setProperty(S,Qe(R),O)}),g.setProperty(S,"setRootState",g.createNativeFunction(m))};try{const g=new o(d,v);return g.run(),g.pseudoToNative(g.value)}catch(g){B.warn("Custom code error in non-node runtime. SDK can only execute ES5 JavaScript.",{e:g});return}};function ne({code:e,context:t,localState:i,rootState:r,rootSetState:n,event:s,isExpression:a=!0}){if(e===""){B.warn("Skipping evaluation of empty code block.");return}const u={isEditing:j(),isBrowser:T(),isServer:!T()},f={useCode:a&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,builder:u,context:t,event:s,rootSetState:n,rootState:r,localState:i};return T()?zt(f):
|
|
28
|
+
`,m=(g,S)=>{const R=pt(u,g,S);s==null||s(R)},v=function(g,S){Object.keys(l).forEach(R=>{const P=l[R]||{},O=JSON.stringify(P);g.setProperty(S,Qe(R),O)}),g.setProperty(S,"setRootState",g.createNativeFunction(m))};try{const g=new o(d,v);return g.run(),g.pseudoToNative(g.value)}catch(g){B.warn("Custom code error in non-node runtime. SDK can only execute ES5 JavaScript.",{e:g});return}};function ne({code:e,context:t,localState:i,rootState:r,rootSetState:n,event:s,isExpression:a=!0}){if(e===""){B.warn("Skipping evaluation of empty code block.");return}const u={isEditing:j(),isBrowser:T(),isServer:!T()},f={useCode:a&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,builder:u,context:t,event:s,rootSetState:n,rootState:r,localState:i};return T()?zt(f):Ai()?fr(f):dr(f)}const zt=({useCode:e,builder:t,context:i,event:r,localState:n,rootSetState:s,rootState:a})=>{const u=mr(a,n,s);try{return new Function("builder","Builder","state","context","event",e)(t,t,u,i,r)}catch(l){B.warn(`Builder custom code error:
|
|
29
29
|
While Evaluating:
|
|
30
30
|
`,e,`
|
|
31
|
-
`,l)}},
|
|
32
|
-
`),
|
|
33
|
-
${
|
|
31
|
+
`,l)}},dr=e=>zt(e);function mr(e,t,i){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(r,n)=>t&&n in t?t[n]:e[n],set:(r,n,s)=>{if(t&&n in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[n]=s,i==null||i(e),!0}})}const gr=({block:e,context:t,localState:i,rootState:r,rootSetState:n})=>{if(!e.bindings)return e;const s=me(e),a={...s,properties:{...s.properties},actions:{...s.actions}};for(const u in e.bindings){const l=e.bindings[u],p=ne({code:l,localState:i,rootState:r,rootSetState:n,context:t});pt(a,u,p)}return a};function De({block:e,context:t,shouldEvaluateBindings:i,localState:r,rootState:n,rootSetState:s}){const a=e;return i?gr({block:a,localState:r,rootState:n,rootSetState:s,context:t}):a}const vr=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),$=e=>e!=null,Kt=e=>Object.entries(e).map(([i,r])=>{if(typeof r=="string")return`${vr(i)}: ${r};`}).filter($),yr=e=>Kt(e).join(`
|
|
32
|
+
`),Ce=({mediaQuery:e,className:t,styles:i})=>{const r=`.${t} {
|
|
33
|
+
${yr(i)}
|
|
34
34
|
}`;return e?`${e} {
|
|
35
35
|
${r}
|
|
36
|
-
}`:r},
|
|
36
|
+
}`:r},Ee=h.defineComponent({render(){return h.h("style",{id:this.id,innerHTML:this.styles})},name:"inlined-styles",props:["styles","id"]}),br=h.defineComponent({name:"block-styles",components:{InlinedStyles:Ee},props:["block","context"],data(){return{processedBlock:De({block:this.block,localState:this.context.localState,rootState:this.context.rootState,rootSetState:this.context.rootSetState,context:this.context.context,shouldEvaluateBindings:!0}),TARGET:G}},computed:{canShowBlock(){return $(this.processedBlock.hide)?!this.processedBlock.hide:$(this.processedBlock.show)?this.processedBlock.show:!0},css(){var f;const e=this.processedBlock.responsiveStyles,t=this.context.content,i=ht(((f=t==null?void 0:t.meta)==null?void 0:f.breakpoints)||{}),r=e==null?void 0:e.large,n=e==null?void 0:e.medium,s=e==null?void 0:e.small,a=this.processedBlock.id;if(!a)return"";const u=r?Ce({className:a,styles:r}):"",l=n?Ce({className:a,styles:n,mediaQuery:qe("medium",i)}):"",p=s?Ce({className:a,styles:s,mediaQuery:qe("small",i)}):"";return[u,l,p].join(" ")}}});function Er(e,t,i,r,n,s){const a=h.resolveComponent("inlined-styles");return e.TARGET!=="reactNative"&&e.css&&e.canShowBlock?(h.openBlock(),h.createBlock(a,{key:0,styles:e.css},null,8,["styles"])):h.createCommentVNode("",!0)}const je=w(br,[["render",Er]]),xr=Object.freeze(Object.defineProperty({__proto__:null,default:je},Symbol.toStringTag,{value:"Module"}));function Sr(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const _r=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Cr=e=>typeof e=="string"&&_r.includes(e.toLowerCase()),Rr=({block:e,context:t,registeredComponents:i})=>{var s;const r=(s=De({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:s.name;if(!r)return null;const n=i[r];if(n)return n;console.warn(`
|
|
37
37
|
Could not find a registered component named "${r}".
|
|
38
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},
|
|
38
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},kr=({block:e,context:t})=>{const{repeat:i,...r}=e;if(!(i!=null&&i.collection))return;const n=ne({code:i.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(n))return;const s=i.collection.split(".").pop(),a=i.itemName||(s?s+"Item":"item");return n.map((l,p)=>({context:{...t,localState:{...t.localState,$index:p,$item:l,[a]:l,[`$${a}Index`]:p}},block:r}))},wr=()=>Promise.resolve().then(()=>xr).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component BlockStyles at ./components/block-styles.vue",e),e}),Nr=()=>Promise.resolve().then(()=>require("./repeated-block.f55959d7.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component RepeatedBlock at ./components/repeated-block.vue",e),e}),Pr=()=>Promise.resolve().then(()=>require("./component-ref.448dc8fb.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component ComponentRef at ./components/component-ref/component-ref.vue",e),e}),Tr=()=>Promise.resolve().then(()=>require("./block-wrapper.8543e3fe.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component BlockWrapper at ./components/block-wrapper.vue",e),e}),Or=h.defineComponent({name:"block",components:{ComponentRef:h.defineAsyncComponent(Pr),BlockWrapper:h.defineAsyncComponent(Tr),RepeatedBlock:h.defineAsyncComponent(Nr),BlockStyles:h.defineAsyncComponent(wr)},props:["block","context","registeredComponents"],data(){return{childrenContext:this.context,isEmptyHtmlElement:Cr}},computed:{blockComponent(){return Rr({block:this.block,context:this.context,registeredComponents:this.registeredComponents})},repeatItem(){return kr({block:this.block,context:this.context})},processedBlock(){return this.repeatItem?this.block:De({block:this.block,localState:this.context.localState,rootState:this.context.rootState,rootSetState:this.context.rootSetState,context:this.context.context,shouldEvaluateBindings:!0})},Tag(){return this.block.tagName||"div"},canShowBlock(){return"hide"in this.processedBlock?!this.processedBlock.hide:"show"in this.processedBlock?this.processedBlock.show:!0},childrenWithoutParentComponent(){var t,i;return!((t=this.blockComponent)!=null&&t.component)&&!this.repeatItem?(i=this.processedBlock.children)!=null?i:[]:[]},componentRefProps(){var e,t,i,r,n,s;return{blockChildren:(e=this.processedBlock.children)!=null?e:[],componentRef:(t=this.blockComponent)==null?void 0:t.component,componentOptions:{...Sr(this.processedBlock),builderContext:this.context,...((i=this.blockComponent)==null?void 0:i.name)==="Symbol"||((r=this.blockComponent)==null?void 0:r.name)==="Columns"?{builderComponents:this.registeredComponents}:{}},context:this.childrenContext,registeredComponents:this.registeredComponents,builderBlock:this.processedBlock,includeBlockProps:((n=this.blockComponent)==null?void 0:n.noWrap)===!0,isInteractive:!((s=this.blockComponent)!=null&&s.isRSC)}}}});function Ir(e,t,i,r,n,s){var d;const a=h.resolveComponent("block-wrapper"),u=h.resolveComponent("repeated-block"),l=h.resolveComponent("component-ref"),p=h.resolveComponent("block",!0),f=h.resolveComponent("block-styles");return e.canShowBlock?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(d=e.blockComponent)!=null&&d.noWrap?(h.openBlock(),h.createBlock(l,h.normalizeProps(h.mergeProps({key:1},e.componentRefProps)),null,16)):(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[e.isEmptyHtmlElement(e.Tag)?(h.openBlock(),h.createBlock(a,{key:0,Wrapper:e.Tag,block:e.processedBlock,context:e.context,hasChildren:!1},null,8,["Wrapper","block","context"])):h.createCommentVNode("",!0),!e.isEmptyHtmlElement(e.Tag)&&e.repeatItem?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:1},h.renderList(e.repeatItem,(m,v)=>(h.openBlock(),h.createBlock(u,{key:v,repeatContext:m.context,block:m.block,registeredComponents:e.registeredComponents},null,8,["repeatContext","block","registeredComponents"]))),128)):h.createCommentVNode("",!0),!e.isEmptyHtmlElement(e.Tag)&&!e.repeatItem?(h.openBlock(),h.createBlock(a,{key:2,Wrapper:e.Tag,block:e.processedBlock,context:e.context,hasChildren:!0},{default:h.withCtx(()=>[h.createVNode(l,h.normalizeProps(h.guardReactiveProps(e.componentRefProps)),null,16),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.childrenWithoutParentComponent,(m,v)=>(h.openBlock(),h.createBlock(p,{key:"block-"+m.id,block:m,context:e.childrenContext,registeredComponents:e.registeredComponents},null,8,["block","context","registeredComponents"]))),128)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.childrenWithoutParentComponent,(m,v)=>(h.openBlock(),h.createBlock(f,{key:"block-style-"+m.id,block:m,context:e.childrenContext},null,8,["block","context"]))),128))]),_:1},8,["Wrapper","block","context"])):h.createCommentVNode("",!0)],64))],64)):h.createCommentVNode("",!0)}const $e=w(Or,[["render",Ir]]),Ar=Object.freeze(Object.defineProperty({__proto__:null,default:$e},Symbol.toStringTag,{value:"Module"})),Br=h.defineComponent({name:"builder-blocks-wrapper",props:["blocks","parent","path","styleProp"],computed:{className(){var e;return"builder-blocks"+((e=this.blocks)!=null&&e.length?"":" no-blocks")}},methods:{onClick(){var e,t;j()&&!((e=this.blocks)!=null&&e.length)&&((t=window.parent)==null||t.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:this.parent,dataPath:this.path}},"*"))},onMouseEnter(){var e,t;j()&&!((e=this.blocks)!=null&&e.length)&&((t=window.parent)==null||t.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:this.parent,dataPath:this.path}},"*"))},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}});const Lr=["builder-path","builder-parent-id"];function Vr(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("div",h.mergeProps({class:e._classStringToObject(e.className+" div-3r2aeezxrt8"),"builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t[0]||(t[0]=a=>e.onClick()),onMouseenter:t[1]||(t[1]=a=>e.onMouseEnter()),onKeypress:t[2]||(t[2]=a=>e.onClick())},{}),[h.renderSlot(e.$slots,"default",{},void 0,!0)],16,Lr)}const Fr=w(Br,[["render",Vr],["__scopeId","data-v-e3cb0645"]]),Mr=Symbol(),fe={Builder:{content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}},key:Mr},Ur=Symbol(),Xt={Components:{registeredComponents:{}},key:Ur},Dr=h.defineComponent({name:"builder-blocks",components:{BlocksWrapper:Fr,Block:$e,BlockStyles:je},props:["blocks","parent","path","styleProp","context","registeredComponents"],inject:{builderContext:fe.key,componentsContext:Xt.key}});function jr(e,t,i,r,n,s){const a=h.resolveComponent("block"),u=h.resolveComponent("block-styles"),l=h.resolveComponent("blocks-wrapper");return h.openBlock(),h.createBlock(l,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp},{default:h.withCtx(()=>[e.blocks?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(e.blocks,(p,f)=>(h.openBlock(),h.createBlock(a,{key:"render-block-"+p.id,block:p,context:e.context||e.builderContext,registeredComponents:e.registeredComponents||e.componentsContext.registeredComponents},null,8,["block","context","registeredComponents"]))),128)):h.createCommentVNode("",!0),e.blocks?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:1},h.renderList(e.blocks,(p,f)=>(h.openBlock(),h.createBlock(u,{key:"block-style-"+p.id,block:p,context:e.context||e.builderContext},null,8,["block","context"]))),128)):h.createCommentVNode("",!0)]),_:1},8,["blocks","parent","path","styleProp"])}const Ge=w(Dr,[["render",jr]]),$r=h.defineComponent({name:"builder-columns",components:{InlinedStyles:Ee,Blocks:Ge},props:["js","space","columns","stackColumnsAt","reverseColumnsWhenStacked","builderContext","builderBlock","builderComponents"],data(){return{gutterSize:typeof this.space=="number"?this.space||0:20,cols:this.columns||[],stackAt:this.stackColumnsAt||"tablet",flexDir:this.stackColumnsAt==="never"?"row":this.reverseColumnsWhenStacked?"column-reverse":"column",TARGET:G}},computed:{columnsCssVars(){return{"--flex-dir":this.flexDir,"--flex-dir-tablet":this.getTabletStyle({stackedStyle:this.flexDir,desktopStyle:"row"})}},columnsStyles(){return`
|
|
39
39
|
@media (max-width: ${this.getWidthForBreakpointSize("medium")}px) {
|
|
40
40
|
.${this.builderBlock.id}-breakpoints {
|
|
41
41
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -59,13 +59,13 @@ theFunction();
|
|
|
59
59
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
`}},methods:{getWidth(e){var t;return((t=this.cols[e])==null?void 0:t.width)||100/this.cols.length},getColumnCssWidth(e){const t=this.gutterSize*(this.cols.length-1)/this.cols.length;return`calc(${this.getWidth(e)}% - ${t}px)`},getTabletStyle({stackedStyle:e,desktopStyle:t}){return this.stackAt==="tablet"?e:t},getMobileStyle({stackedStyle:e,desktopStyle:t}){return this.stackAt==="never"?t:e},columnCssVars(e){const t=e===0?0:this.gutterSize,i=this.getColumnCssWidth(e),r=`${t}px`,n="100%",s=0;return{width:i,["margin-left"]:r,"--column-width-mobile":this.getMobileStyle({stackedStyle:n,desktopStyle:i}),"--column-margin-left-mobile":this.getMobileStyle({stackedStyle:s,desktopStyle:r}),"--column-width-tablet":this.getTabletStyle({stackedStyle:n,desktopStyle:i}),"--column-margin-left-tablet":this.getTabletStyle({stackedStyle:s,desktopStyle:r})}},getWidthForBreakpointSize(e){var i,r;return ht(((r=(i=this.builderContext.content)==null?void 0:i.meta)==null?void 0:r.breakpoints)||{})[e].max},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}});function
|
|
63
|
-
`).join("");s.innerHTML=u}}function
|
|
64
|
-
window.${
|
|
65
|
-
window.${
|
|
66
|
-
`},
|
|
67
|
-
window.${
|
|
68
|
-
window.${ii}("${t}", "${e}", ${ei})`,an={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},on={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){i.forEach(r=>{r.delete("width")})}const i=e.get("columns");Array.isArray(i)&&!!i.find(n=>n.get("width"))&&(!!i.find(s=>!s.get("width"))||i.reduce((u,l)=>u+l.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},un={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},cn={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function i(a,u=6e4){return new Promise((l,p)=>{const f=document.createElement("img");let d=!1;f.onload=()=>{d=!0,l(f)},f.addEventListener("error",m=>{console.warn("Image load failed",m.error),p(m.error)}),f.src=a,setTimeout(()=>{d||p(new Error("Image load timed out"))},u)})}function r(a){return Math.round(a*1e3)/1e3}const n=e.get("image"),s=e.get("aspectRatio");if(fetch(n).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),n&&(!s||s===.7041))return i(n).then(a=>{const u=e.get("aspectRatio");e.get("image")===n&&(!u||u===.7041)&&a.width&&a.height&&(e.set("aspectRatio",r(a.height/a.width)),e.set("height",a.height),e.set("width",a.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},ln={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},hn={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},pn={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}},fn=h.defineComponent({name:"builder-text",props:["text"]}),dn=["innerHTML"];function mn(e,t,i,r,n,s){var a;return h.openBlock(),h.createElementBlock("span",{class:"builder-text",innerHTML:((a=e.text)==null?void 0:a.toString())||"",style:{outline:"none"}},null,8,dn)}const ri=w(fn,[["render",mn]]),gn={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]},vn=h.defineComponent({name:"builder-video",props:["autoPlay","muted","controls","loop","playsInline","attributes","preload","fit","position","video","posterImage"],computed:{videoProps(){return{...this.autoPlay===!0?{autoPlay:!0}:{},...this.muted===!0?{muted:!0}:{},...this.controls===!0?{controls:!0}:{},...this.loop===!0?{loop:!0}:{},...this.playsInline===!0?{playsInline:!0}:{}}},spreadProps(){return{...this.attributes,...this.videoProps}}}}),yn=["preload","src","poster"];function bn(e,t,i,r,n,s){var a;return h.openBlock(),h.createElementBlock("video",h.mergeProps({preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(a=e.attributes)==null?void 0:a.style,objectFit:e.fit,objectPosition:e.position,borderRadius:1},src:e.video||"no-src",poster:e.posterImage},e.spreadProps),null,16,yn)}const ni=w(vn,[["render",bn]]),En={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(r=>r.json()).then(r=>{e.get("url")===t&&(r.html?e.set("content",r.html):e.set("content","Invalid url, please try another"))}).catch(r=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},xn=["text/javascript","application/javascript","application/ecmascript"],Sn=e=>xn.includes(e.type),_n=h.defineComponent({name:"builder-embed",props:["content"],data(){return{scriptsInserted:[],scriptsRun:[],ranInitFn:!1}},watch:{onUpdateHook0:{handler(){this.$refs.elem&&!this.ranInitFn&&(this.ranInitFn=!0,this.findAndRunScripts())},immediate:!0}},computed:{onUpdateHook0(){return{0:this.$refs.elem,1:this.ranInitFn}}},methods:{findAndRunScripts(){if(!this.$refs.elem||!this.$refs.elem.getElementsByTagName)return;const e=this.$refs.elem.getElementsByTagName("script");for(let t=0;t<e.length;t++){const i=e[t];if(i.src&&!this.scriptsInserted.includes(i.src)){this.scriptsInserted.push(i.src);const r=document.createElement("script");r.async=!0,r.src=i.src,document.head.appendChild(r)}else if(Sn(i)&&!this.scriptsRun.includes(i.innerText))try{this.scriptsRun.push(i.innerText),new Function(i.innerText)()}catch(r){console.warn("`Embed`: Error running script:",r)}}}}}),Cn=["innerHTML"];function Rn(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("div",{class:"builder-embed",ref:"elem",innerHTML:e.content},null,8,Cn)}const kn=w(_n,[["render",Rn]]),wn=h.defineComponent({name:"builder-img-component",props:["backgroundSize","backgroundPosition","imgSrc","altText","image","attributes"],data(){return{isEditing:j,filterAttrs:fe}}}),Nn=["alt","src"];function Pn(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("img",h.mergeProps({style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},key:e.isEditing()&&e.imgSrc||"default-key",alt:e.altText,src:e.imgSrc||e.image},e.filterAttrs(e.attributes,"v-on:",!1),h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),null,16,Nn)}const Tn=w(wn,[["render",Pn]]),On={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0},In=h.defineComponent({name:"builder-custom-code",props:["replaceNodes","code"],data(){return{scriptsInserted:[],scriptsRun:[]}},mounted(){this.findAndRunScripts()},methods:{findAndRunScripts(){if(this.$refs.elem&&this.$refs.elem.getElementsByTagName&&typeof window<"u"){const e=this.$refs.elem.getElementsByTagName("script");for(let t=0;t<e.length;t++){const i=e[t];if(i.src){if(this.scriptsInserted.includes(i.src))continue;this.scriptsInserted.push(i.src);const r=document.createElement("script");r.async=!0,r.src=i.src,document.head.appendChild(r)}else if(!i.type||["text/javascript","application/javascript","application/ecmascript"].includes(i.type)){if(this.scriptsRun.includes(i.innerText))continue;try{this.scriptsRun.push(i.innerText),new Function(i.innerText)()}catch(r){console.warn("`CustomCode`: Error running script:",r)}}}}},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}}),An=["innerHTML"];function Bn(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("div",{ref:"elem",class:h.normalizeClass(e._classStringToObject("builder-custom-code"+(e.replaceNodes?" replace-nodes":""))),innerHTML:e.code},null,10,An)}const Ln=w(In,[["render",Bn]]),Vn={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]},et=()=>[{component:ct,...an},{component:Xt,...on},{component:Ln,...Vn},{component:kn,...En},{component:Jt,...un},{component:Qt,...cn},{component:Tn,...On},{component:Zt,...ln},{component:Ri,...hn},{component:ri,...pn},{component:ni,...gn}],tt=[],si=e=>({type:"builder.registerComponent",data:e}),Fn=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},Mn=e=>typeof e=="function"?Fn(e):de(e),it=({inputs:e,...t})=>({...de(t),inputs:e==null?void 0:e.map(i=>Object.entries(i).reduce((r,[n,s])=>({...r,[n]:Mn(s)}),{}))}),Un=e=>{var s,a;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),i=t.split(",")[0],r=(a=e.fileUrl)!=null?a:(s=e==null?void 0:e.files)==null?void 0:s.regular;let n="";if(r&&t&&i&&(n+=`
|
|
62
|
+
`}},methods:{getWidth(e){var t;return((t=this.cols[e])==null?void 0:t.width)||100/this.cols.length},getColumnCssWidth(e){const t=this.gutterSize*(this.cols.length-1)/this.cols.length;return`calc(${this.getWidth(e)}% - ${t}px)`},getTabletStyle({stackedStyle:e,desktopStyle:t}){return this.stackAt==="tablet"?e:t},getMobileStyle({stackedStyle:e,desktopStyle:t}){return this.stackAt==="never"?t:e},columnCssVars(e){const t=e===0?0:this.gutterSize,i=this.getColumnCssWidth(e),r=`${t}px`,n="100%",s=0;return{width:i,["margin-left"]:r,"--column-width-mobile":this.getMobileStyle({stackedStyle:n,desktopStyle:i}),"--column-margin-left-mobile":this.getMobileStyle({stackedStyle:s,desktopStyle:r}),"--column-width-tablet":this.getTabletStyle({stackedStyle:n,desktopStyle:i}),"--column-margin-left-tablet":this.getTabletStyle({stackedStyle:s,desktopStyle:r})}},getWidthForBreakpointSize(e){var i,r;return ht(((r=(i=this.builderContext.content)==null?void 0:i.meta)==null?void 0:r.breakpoints)||{})[e].max},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}});function Gr(e,t,i,r,n,s){const a=h.resolveComponent("inlined-styles"),u=h.resolveComponent("blocks");return h.openBlock(),h.createElementBlock("div",h.mergeProps({class:e._classStringToObject(`builder-columns ${e.builderBlock.id}-breakpoints div-20vehov4ay6`),style:e.columnsCssVars},{}),[e.TARGET!=="reactNative"?(h.openBlock(),h.createBlock(a,{key:0,styles:e.columnsStyles},null,8,["styles"])):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.columns,(l,p)=>(h.openBlock(),h.createElementBlock("div",h.mergeProps({key:p,class:"builder-column div-20vehov4ay6-2",style:e.columnCssVars(p)},{}),[h.createVNode(u,{blocks:l.blocks,path:`component.options.columns.${p}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents},null,8,["blocks","path","parent","context","registeredComponents"])],16))),128))],16)}const Jt=w($r,[["render",Gr],["__scopeId","data-v-23ad84c1"]]),Wr=h.defineComponent({name:"builder-fragment-component",props:[]});function Hr(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("span",null,[h.renderSlot(e.$slots,"default")])}const Qt=w(Wr,[["render",Hr]]);function Ze(e){return e.replace(/http(s)?:/,"")}function Yr(e="",t,i){const r=new RegExp("([?&])"+t+"=.*?(&|$)","i"),n=e.indexOf("?")!==-1?"&":"?";return e.match(r)?e.replace(r,"$1"+t+"="+encodeURIComponent(i)+"$2"):e+n+t+"="+encodeURIComponent(i)}function qr(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Ze(e);const i=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(i){const r=e.split(i[0]),n=i[3],s=t.match("x")?t:`${t}x`;return Ze(`${r[0]}_${s}${n}`)}return null}function Re(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let i=e;const r=Number(e.split("?width=")[1]);return isNaN(r)||(i=`${i} ${r}w`),t.filter(n=>n!==r).map(n=>`${Yr(e,"width",n)} ${n}w`).concat([i]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(i=>[qr(e,`${i}x${i}`),i]).filter(([i])=>!!i).map(([i,r])=>`${i} ${r}w`).concat([e]).join(", "):e}const zr=h.defineComponent({name:"builder-image",props:["image","src","srcset","noWebp","aspectRatio","altText","backgroundPosition","backgroundSize","className","sizes","builderBlock","fitContent"],computed:{srcSetToUse(){var i;const t=this.image||this.src;if(!t||!(t.match(/builder\.io/)||t.match(/cdn\.shopify\.com/)))return this.srcset;if(this.srcset&&((i=this.image)==null?void 0:i.includes("builder.io/api/v1/image"))){if(!this.srcset.includes(this.image.split("?")[0]))return console.debug("Removed given srcset"),Re(t)}else if(this.image&&!this.srcset)return Re(t);return Re(t)},webpSrcSet(){var e;return((e=this.srcSetToUse)==null?void 0:e.match(/builder\.io/))&&!this.noWebp?this.srcSetToUse.replace(/\?/g,"?format=webp&"):""},aspectRatioCss(){const e={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return this.aspectRatio?e:void 0}},methods:{_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}});const Kr=["srcset"],Xr=["alt","role","src","srcset","sizes"],Jr={key:2,class:"div-2oob28krk0a-2"};function Qr(e,t,i,r,n,s){var a,u,l,p;return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("picture",null,[e.webpSrcSet?(h.openBlock(),h.createElementBlock("source",{key:0,type:"image/webp",srcset:e.webpSrcSet},null,8,Kr)):h.createCommentVNode("",!0),h.createElementVNode("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:h.normalizeStyle({objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...e.aspectRatioCss}),class:h.normalizeClass(e._classStringToObject("builder-image"+(e.className?" "+e.className:"")+" img-2oob28krk0a")),src:e.image,srcset:e.srcSetToUse,sizes:e.sizes},null,14,Xr)]),e.aspectRatio&&!(((u=(a=e.builderBlock)==null?void 0:a.children)==null?void 0:u.length)&&e.fitContent)?(h.openBlock(),h.createElementBlock("div",{key:0,class:"builder-image-sizer div-2oob28krk0a",style:h.normalizeStyle({paddingTop:e.aspectRatio*100+"%"})},null,4)):h.createCommentVNode("",!0),((p=(l=e.builderBlock)==null?void 0:l.children)==null?void 0:p.length)&&e.fitContent?h.renderSlot(e.$slots,"default",{key:1},void 0,!0):h.createCommentVNode("",!0),!e.fitContent&&e.$slots.default?(h.openBlock(),h.createElementBlock("div",Jr,[h.renderSlot(e.$slots,"default",{},void 0,!0)])):h.createCommentVNode("",!0)],64)}const Zt=w(zr,[["render",Qr],["__scopeId","data-v-a7ebd355"]]),Zr=h.defineComponent({name:"builder-section-component",props:["attributes","maxWidth"],data(){return{filterAttrs:de}}});function en(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("section",h.mergeProps({style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"}},e.filterAttrs(e.attributes,"v-on:",!1),h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),[h.renderSlot(e.$slots,"default")],16)}const ei=w(Zr,[["render",en]]),ce=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),tn=({canTrack:e,content:t})=>!(!(ce(t).length>0)||!e);function rn(e,t,i){var a;function r(){function u(g,S,R){let P="";if(R){const O=new Date;O.setTime(O.getTime()+R*24*60*60*1e3),P="; expires="+O.toUTCString()}document.cookie=g+"="+(S||"")+P+"; path=/; Secure; SameSite=None"}function l(g){const S=g+"=",R=document.cookie.split(";");for(let P=0;P<R.length;P++){let O=R[P];for(;O.charAt(0)===" ";)O=O.substring(1,O.length);if(O.indexOf(S)===0)return O.substring(S.length,O.length)}return null}const p=`builder.tests.${e}`,f=l(p),d=t.map(g=>g.id).concat(e);if(f&&d.includes(f))return f;let m=0;const v=Math.random();for(let g=0;g<t.length;g++){const S=t[g],R=S.testRatio;if(m+=R,v<m)return u(p,S.id),S.id}return u(p,e),e}const n=r(),s=(a=document.currentScript)==null?void 0:a.previousElementSibling;if(i){s.remove();const u=document.currentScript;u==null||u.remove()}else{const u=t.concat({id:e}).filter(l=>l.id!==n).map(l=>`.variant-${l.id} { display: none; }
|
|
63
|
+
`).join("");s.innerHTML=u}}function nn(e,t,i){var l;if(!navigator.cookieEnabled)return;function r(p){const f=p+"=",d=document.cookie.split(";");for(let m=0;m<d.length;m++){let v=d[m];for(;v.charAt(0)===" ";)v=v.substring(1,v.length);if(v.indexOf(f)===0)return v.substring(f.length,v.length)}return null}const n=`builder.tests.${t}`,s=r(n),a=(l=document.currentScript)==null?void 0:l.parentElement,u=e===t;if(s===e){if(u)return;a==null||a.removeAttribute("hidden"),a==null||a.removeAttribute("aria-hidden")}else{u&&(i?a==null||a.remove():(a==null||a.setAttribute("hidden","true"),a==null||a.setAttribute("aria-hidden","true")));return}}const sn=e=>e==="react"||e==="reactNative",ti=sn(G),ii="builderIoAbTest",ri="builderIoRenderContent",an=()=>{const e=rn.toString().replace(/\s+/g," "),t=nn.toString().replace(/\s+/g," ");return`
|
|
64
|
+
window.${ii} = ${e}
|
|
65
|
+
window.${ri} = ${t}
|
|
66
|
+
`},on=(e,t)=>`
|
|
67
|
+
window.${ii}("${t}",${JSON.stringify(e)}, ${ti})`,un=({contentId:e,variationId:t})=>`
|
|
68
|
+
window.${ri}("${t}", "${e}", ${ti})`,cn={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},ln={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){i.forEach(r=>{r.delete("width")})}const i=e.get("columns");Array.isArray(i)&&!!i.find(n=>n.get("width"))&&(!!i.find(s=>!s.get("width"))||i.reduce((u,l)=>u+l.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},hn={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},pn={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function i(a,u=6e4){return new Promise((l,p)=>{const f=document.createElement("img");let d=!1;f.onload=()=>{d=!0,l(f)},f.addEventListener("error",m=>{console.warn("Image load failed",m.error),p(m.error)}),f.src=a,setTimeout(()=>{d||p(new Error("Image load timed out"))},u)})}function r(a){return Math.round(a*1e3)/1e3}const n=e.get("image"),s=e.get("aspectRatio");if(fetch(n).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),n&&(!s||s===.7041))return i(n).then(a=>{const u=e.get("aspectRatio");e.get("image")===n&&(!u||u===.7041)&&a.width&&a.height&&(e.set("aspectRatio",r(a.height/a.width)),e.set("height",a.height),e.set("width",a.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},fn={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},dn={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},mn={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}},gn=h.defineComponent({name:"builder-text",props:["text"]}),vn=["innerHTML"];function yn(e,t,i,r,n,s){var a;return h.openBlock(),h.createElementBlock("span",{class:"builder-text",innerHTML:((a=e.text)==null?void 0:a.toString())||"",style:{outline:"none"}},null,8,vn)}const ni=w(gn,[["render",yn]]),bn={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]},En=h.defineComponent({name:"builder-video",props:["autoPlay","muted","controls","loop","playsInline","attributes","preload","fit","position","video","posterImage"],computed:{videoProps(){return{...this.autoPlay===!0?{autoPlay:!0}:{},...this.muted===!0?{muted:!0}:{},...this.controls===!0?{controls:!0}:{},...this.loop===!0?{loop:!0}:{},...this.playsInline===!0?{playsInline:!0}:{}}},spreadProps(){return{...this.attributes,...this.videoProps}}}}),xn=["preload","src","poster"];function Sn(e,t,i,r,n,s){var a;return h.openBlock(),h.createElementBlock("video",h.mergeProps({preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(a=e.attributes)==null?void 0:a.style,objectFit:e.fit,objectPosition:e.position,borderRadius:1},src:e.video||"no-src",poster:e.posterImage},e.spreadProps),null,16,xn)}const si=w(En,[["render",Sn]]),_n={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(r=>r.json()).then(r=>{e.get("url")===t&&(r.html?e.set("content",r.html):e.set("content","Invalid url, please try another"))}).catch(r=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Cn=["text/javascript","application/javascript","application/ecmascript"],Rn=e=>Cn.includes(e.type),kn=h.defineComponent({name:"builder-embed",props:["content"],data(){return{scriptsInserted:[],scriptsRun:[],ranInitFn:!1}},watch:{onUpdateHook0:{handler(){this.$refs.elem&&!this.ranInitFn&&(this.ranInitFn=!0,this.findAndRunScripts())},immediate:!0}},computed:{onUpdateHook0(){return{0:this.$refs.elem,1:this.ranInitFn}}},methods:{findAndRunScripts(){if(!this.$refs.elem||!this.$refs.elem.getElementsByTagName)return;const e=this.$refs.elem.getElementsByTagName("script");for(let t=0;t<e.length;t++){const i=e[t];if(i.src&&!this.scriptsInserted.includes(i.src)){this.scriptsInserted.push(i.src);const r=document.createElement("script");r.async=!0,r.src=i.src,document.head.appendChild(r)}else if(Rn(i)&&!this.scriptsRun.includes(i.innerText))try{this.scriptsRun.push(i.innerText),new Function(i.innerText)()}catch(r){console.warn("`Embed`: Error running script:",r)}}}}}),wn=["innerHTML"];function Nn(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("div",{class:"builder-embed",ref:"elem",innerHTML:e.content},null,8,wn)}const Pn=w(kn,[["render",Nn]]),Tn=h.defineComponent({name:"builder-img-component",props:["backgroundSize","backgroundPosition","imgSrc","altText","image","attributes"],data(){return{isEditing:j,filterAttrs:de}}}),On=["alt","src"];function In(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("img",h.mergeProps({style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},key:e.isEditing()&&e.imgSrc||"default-key",alt:e.altText,src:e.imgSrc||e.image},e.filterAttrs(e.attributes,"v-on:",!1),h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),null,16,On)}const An=w(Tn,[["render",In]]),Bn={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0},Ln=h.defineComponent({name:"builder-custom-code",props:["replaceNodes","code"],data(){return{scriptsInserted:[],scriptsRun:[]}},mounted(){this.findAndRunScripts()},methods:{findAndRunScripts(){if(this.$refs.elem&&this.$refs.elem.getElementsByTagName&&typeof window<"u"){const e=this.$refs.elem.getElementsByTagName("script");for(let t=0;t<e.length;t++){const i=e[t];if(i.src){if(this.scriptsInserted.includes(i.src))continue;this.scriptsInserted.push(i.src);const r=document.createElement("script");r.async=!0,r.src=i.src,document.head.appendChild(r)}else if(!i.type||["text/javascript","application/javascript","application/ecmascript"].includes(i.type)){if(this.scriptsRun.includes(i.innerText))continue;try{this.scriptsRun.push(i.innerText),new Function(i.innerText)()}catch(r){console.warn("`CustomCode`: Error running script:",r)}}}}},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}}),Vn=["innerHTML"];function Fn(e,t,i,r,n,s){return h.openBlock(),h.createElementBlock("div",{ref:"elem",class:h.normalizeClass(e._classStringToObject("builder-custom-code"+(e.replaceNodes?" replace-nodes":""))),innerHTML:e.code},null,10,Vn)}const Mn=w(Ln,[["render",Fn]]),Un={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]},et=()=>[{component:ct,...cn},{component:Jt,...ln},{component:Mn,...Un},{component:Pn,..._n},{component:Qt,...hn},{component:Zt,...pn},{component:An,...Bn},{component:ei,...fn},{component:ki,...dn},{component:ni,...mn},{component:si,...bn}],tt=[],ai=e=>({type:"builder.registerComponent",data:e}),Dn=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},jn=e=>typeof e=="function"?Dn(e):me(e),it=({inputs:e,...t})=>({...me(t),inputs:e==null?void 0:e.map(i=>Object.entries(i).reduce((r,[n,s])=>({...r,[n]:jn(s)}),{}))}),$n=e=>{var s,a;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),i=t.split(",")[0],r=(a=e.fileUrl)!=null?a:(s=e==null?void 0:e.files)==null?void 0:s.regular;let n="";if(r&&t&&i&&(n+=`
|
|
69
69
|
@font-face {
|
|
70
70
|
font-family: "${t}";
|
|
71
71
|
src: local("${i}"), url('${r}') format('woff2');
|
|
@@ -79,9 +79,9 @@ src: url('${p}') format('woff2');
|
|
|
79
79
|
font-display: fallback;
|
|
80
80
|
font-weight: ${u};
|
|
81
81
|
}
|
|
82
|
-
`.trim())}return n},
|
|
83
|
-
${
|
|
84
|
-
${
|
|
82
|
+
`.trim())}return n},Gn=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(i=>$n(i)))==null?void 0:t.join(" "))||""},Wn=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",Hn=h.defineComponent({name:"content-styles",components:{InlinedStyles:Ee},props:["cssCode","contentId","customFonts"],data(){return{injectedStyles:`
|
|
83
|
+
${Wn({cssCode:this.cssCode,contentId:this.contentId})}
|
|
84
|
+
${Gn({customFonts:this.customFonts})}
|
|
85
85
|
|
|
86
86
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
87
87
|
margin: 0;
|
|
@@ -95,5 +95,5 @@ ${Dn({customFonts:this.customFonts})}
|
|
|
95
95
|
text-align: inherit;
|
|
96
96
|
font-family: inherit;
|
|
97
97
|
}
|
|
98
|
-
`.trim()}}});function
|
|
99
|
-
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const ai=zn(),Kn=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},oi=({name:e,canTrack:t})=>{var i;try{return t?(i=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:i.split("=")[1]:void 0}catch(r){B.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},ui=async e=>oi(e),Xn=e=>e.map(([t,i])=>i?`${t}=${i}`:t).filter($).join("; "),Jn=[["secure",""],["SameSite","None"]],Qn=({name:e,value:t,expires:i})=>{const n=(T()?location.protocol==="https:":!0)?Jn:[[]],s=i?[["expires",i.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",Kn(window.location.hostname)],...n];return Xn(a)},ci=async({name:e,value:t,expires:i,canTrack:r})=>{try{if(!r)return;const n=Qn({name:e,value:t,expires:i});document.cookie=n}catch(n){B.warn("[COOKIE] SET error: ",(n==null?void 0:n.message)||n)}};function Zn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function li(){return Zn().replace(/-/g,"")}const hi="builderSessionId",es=async({canTrack:e})=>{if(!e)return;const t=await ui({name:hi,canTrack:e});if($(t))return t;{const i=ts();return is({id:i,canTrack:e}),i}},ts=()=>li(),is=({id:e,canTrack:t})=>ci({name:hi,value:e,canTrack:t}),pi=()=>T()&&typeof localStorage<"u"?localStorage:void 0,rs=({key:e,canTrack:t})=>{var i;try{return t?(i=pi())==null?void 0:i.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},ns=({key:e,canTrack:t,value:i})=>{var r;try{t&&((r=pi())==null||r.setItem(e,i))}catch(n){console.debug("[LocalStorage] SET error: ",n)}},fi="builderVisitorId",ss=({canTrack:e})=>{if(!e)return;const t=rs({key:fi,canTrack:e});if($(t))return t;{const i=as();return os({id:i,canTrack:e}),i}},as=()=>li(),os=({id:e,canTrack:t})=>ns({key:fi,value:e,canTrack:t}),us=()=>{if(T()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},cs=()=>typeof navigator=="object"&&navigator.userAgent||"",ls=()=>{const e=cs(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||G==="reactNative"}},i=e.match(/Tablet|iPad/i),r=us();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:i?"tablet":t.any()?"mobile":"desktop"}},hs=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await es({canTrack:e}),i=ss({canTrack:e});return{sessionId:t,visitorId:i}},ps=async({type:e,canTrack:t,apiKey:i,metadata:r,...n})=>({type:e,data:{...n,metadata:{url:location.href,...r},...await hs({canTrack:t}),userAttributes:ls(),ownerId:i}});async function Ne(e){if(!e.apiKey){B.error("Missing API key for track call. Please provide your API key.");return}if(!!e.canTrack&&!j()&&!!(T()||G==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ps(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const fs=e=>Ne({...e,canTrack:!0}),ds=Symbol(),Pe={Builder:{content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}},key:ds},ms="0.5.0",rt={};function di(e,t){let i=rt[e];if(i||(i=rt[e]=[]),i.push(t),T()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(n){console.debug("Could not postmessage",n)}}}const gs=()=>{di("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let nt=!1;const vs=(e={})=>{var t,i;nt||(nt=!0,T()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:G,version:ms,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(i=window.parent)==null||i.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:r})=>{var n,s;if(!!(r!=null&&r.type))switch(r.type){case"builder.evaluate":{const a=r.data.text,u=r.data.arguments||[],l=r.data.id,p=new Function(a);let f,d=null;try{f=p.apply(null,u)}catch(m){d=m}d?(n=window.parent)==null||n.postMessage({type:"builder.evaluateError",data:{id:l,error:d.message}},"*"):f&&typeof f.then=="function"?f.then(m=>{var v;(v=window.parent)==null||v.postMessage({type:"builder.evaluateResult",data:{id:l,result:m}},"*")}).catch(console.error):(s=window.parent)==null||s.postMessage({type:"builder.evaluateResult",data:{result:f,id:l}},"*");break}}})))};function st(e){return Math.round(e*1e3)/1e3}const ys=(e,t,i=!0)=>{if(!(e instanceof HTMLElement))return null;let r=i?e:e.parentElement;do{if(!r)return null;if(t(r))return r}while(r=r.parentElement);return null},bs=e=>ys(e,t=>{const i=t.getAttribute("builder-id")||t.id;return Boolean((i==null?void 0:i.indexOf("builder-"))===0)}),at=({event:e,target:t})=>{const i=t.getBoundingClientRect(),r=e.clientX-i.left,n=e.clientY-i.top,s=st(r/i.width),a=st(n/i.height);return{x:s,y:a}},Es=e=>{const t=e.target,i=t&&bs(t),r=(i==null?void 0:i.getAttribute("builder-id"))||(i==null?void 0:i.id);return{targetBuilderElement:r||void 0,metadata:{targetOffset:t?at({event:e,target:t}):void 0,builderTargetOffset:i?at({event:e,target:i}):void 0,builderElementIndex:i&&r?[].slice.call(document.getElementsByClassName(r)).indexOf(i):void 0}}},xs="builder.tests",We=e=>`${xs}.${e}`,Ss=({contentId:e})=>ui({name:We(e),canTrack:!0}),_s=({contentId:e})=>oi({name:We(e),canTrack:!0}),Cs=({contentId:e,value:t})=>ci({name:We(e),value:t,canTrack:!0}),mi=e=>$(e.id)&&$(e.variations)&&Object.keys(e.variations).length>0,Rs=({id:e,variations:t})=>{var n;let i=0;const r=Math.random();for(const s in t){const a=(n=t[s])==null?void 0:n.testRatio;if(i+=a,r<i)return s}return e},gi=e=>{const t=Rs(e);return Cs({contentId:e.id,value:t}).catch(i=>{B.error("could not store A/B test variation: ",i)}),t},vi=({item:e,testGroupId:t})=>{const i=e.variations[t];return t===e.id||!i?{testVariationId:e.id,testVariationName:"Default"}:{data:i.data,testVariationId:i.id,testVariationName:i.name||(i.id===e.id?"Default":"")}},ks=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!mi(e))return e;const i=_s({contentId:e.id})||gi({variations:e.variations,id:e.id}),r=vi({item:e,testGroupId:i});return{...e,...r}},ws=async({item:e,canTrack:t})=>{if(!t||!mi(e))return e;const r=await Ss({contentId:e.id})||gi({variations:e.variations,id:e.id}),n=vi({item:e,testGroupId:r});return{...e,...n}},Te=e=>$(e)?e:!0;function Oe(e,t=null,i="."){return Object.keys(e).reduce((r,n)=>{const s=e[n],a=[t,n].filter(Boolean).join(i);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...Oe(s,a,i)}:{...r,[a]:s}},{})}const ot="builder.",Ns="options.",Ps=e=>{const t={};return e.forEach((i,r)=>{t[r]=i}),t},yi=e=>{if(!e)return{};const t=bi(e),i={};return Object.keys(t).forEach(r=>{if(r.startsWith(ot)){const n=r.replace(ot,"").replace(Ns,"");i[n]=t[r]}}),i},Ts=()=>{if(!T())return{};const e=new URLSearchParams(window.location.search);return yi(e)},bi=e=>e instanceof URLSearchParams?Ps(e):e,Os="v3",He=e=>{const{limit:t=30,userAttributes:i,query:r,noTraverse:n=!1,model:s,apiKey:a,includeRefs:u=!0,enrich:l,locale:p,apiVersion:f=Os}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(f))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);const d=new URL(`https://cdn.builder.io/api/${f}/content/${s}?apiKey=${a}&limit=${t}&noTraverse=${n}&includeRefs=${u}${p?`&locale=${p}`:""}${l?`&enrich=${l}`:""}`),m={...Ts(),...bi(e.options||{})},v=Oe(m);for(const g in v)d.searchParams.set(g,String(v[g]));if(i&&d.searchParams.set("userAttributes",JSON.stringify(i)),r){const g=Oe({query:r});for(const S in g)d.searchParams.set(S,JSON.stringify(g[S]))}return d},Is=e=>"results"in e;async function Ye(e){const t=await xi({...e,limit:1});return t&&t.results[0]||null}const As=async e=>{const t=He(e);return await(await ai(t.href)).json()},Ei=async(e,t,i=He(e))=>{const r=Te(e.canTrack);if(i.search.includes("preview="),!r||!(T()||G==="reactNative"))return t;try{const n=[];for(const s of t.results)n.push(await ws({item:s,canTrack:r}));t.results=n}catch(n){B.error("Could not process A/B tests. ",n)}return t};async function xi(e){try{const t=He(e),i=await As(e);return Is(i)?Ei(e,i):(B.error("Error fetching data. ",{url:t,content:i,options:e}),null)}catch(t){return B.error("Error fetching data. ",t),null}}function Si(){return!T()||j()?!1:Boolean(location.search.indexOf("builder.preview=")!==-1)}const Bs=h.defineComponent({name:"enable-editor",props:["canTrack","builderContextSignal","model","context","apiKey","showContent","classNameProp","content","locale","includeRefs","enrich"],data(){return{canTrackToUse:$(this.canTrack)?this.canTrack:!0,forceReRenderCount:0,lastUpdated:0,shouldSendResetCookie:!1,httpReqsData:{},clicked:!1,builderContext:Pe}},provide(){const e=this;return{[Pe.key]:e.builderContextSignal}},mounted(){var e,t;if(this.apiKey||B.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),T()){if(j()&&(this.forceReRenderCount=this.forceReRenderCount+1,window.addEventListener("message",this.processMessage),gs(),vs({...this.locale?{locale:this.locale}:{},...this.includeRefs?{includeRefs:this.includeRefs}:{},...this.enrich?{enrich:this.enrich}:{}}),Object.values(this.builderContextSignal.componentInfos).forEach(i=>{var n;const r=si(i);(n=window.parent)==null||n.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",this.emitStateUpdate)),this.builderContextSignal.content){const i=(e=this.builderContextSignal.content)==null?void 0:e.testVariationId,r=(t=this.builderContextSignal.content)==null?void 0:t.id;Ne({type:"impression",canTrack:this.canTrackToUse,contentId:r,apiKey:this.apiKey,variationId:i!==r?i:void 0})}if(Si()){const i=new URL(location.href).searchParams,r=i.get("builder.preview"),n=i.get(`builder.preview.${r}`),s=i.get("apiKey")||i.get("builder.space");r===this.model&&s===this.apiKey&&(!this.content||n===this.content.id)&&Ye({model:this.model,apiKey:this.apiKey,apiVersion:this.builderContextSignal.apiVersion}).then(a=>{a&&this.mergeNewContent(a)})}this.evaluateJsCode(),this.runHttpRequests(),this.emitStateUpdate()}},watch:{onUpdateHook0:{handler(){this.content&&this.mergeNewContent(this.content)},immediate:!0},onUpdateHook1:{handler(){},immediate:!0},onUpdateHook2:{handler(){this.evaluateJsCode()},immediate:!0},onUpdateHook3:{handler(){this.runHttpRequests()},immediate:!0},onUpdateHook4:{handler(){this.emitStateUpdate()},immediate:!0}},unmounted(){T()&&(window.removeEventListener("message",this.processMessage),window.removeEventListener("builder:component:stateChangeListenerActivated",this.emitStateUpdate))},computed:{onUpdateHook0(){return{0:this.content}},onUpdateHook1(){return{0:this.shouldSendResetCookie}},onUpdateHook2(){var e,t;return{0:(t=(e=this.builderContextSignal.content)==null?void 0:e.data)==null?void 0:t.jsCode,1:this.builderContextSignal.rootState}},onUpdateHook3(){var e,t;return{0:(t=(e=this.builderContextSignal.content)==null?void 0:e.data)==null?void 0:t.httpRequests}},onUpdateHook4(){return{0:this.builderContextSignal.rootState}}},methods:{mergeNewContent(e){var i,r,n,s,a;const t={...this.builderContextSignal.content,...e,data:{...(i=this.builderContextSignal.content)==null?void 0:i.data,...e==null?void 0:e.data},meta:{...(r=this.builderContextSignal.content)==null?void 0:r.meta,...e==null?void 0:e.meta,breakpoints:((n=e==null?void 0:e.meta)==null?void 0:n.breakpoints)||((a=(s=this.builderContextSignal.content)==null?void 0:s.meta)==null?void 0:a.breakpoints)}};this.builderContextSignal.content=t},processMessage(e){var i;const{data:t}=e;if(t)switch(t.type){case"builder.configureSdk":{const r=t.data,{breakpoints:n,contentId:s}=r;if(!s||s!==((i=this.builderContextSignal.content)==null?void 0:i.id))return;n&&this.mergeNewContent({meta:{breakpoints:n}}),this.forceReRenderCount=this.forceReRenderCount+1;break}case"builder.contentUpdate":{const r=t.data,n=r.key||r.alias||r.entry||r.modelName,s=r.data;n===this.model&&(this.mergeNewContent(s),this.forceReRenderCount=this.forceReRenderCount+1);break}}},evaluateJsCode(){var t,i;const e=(i=(t=this.builderContextSignal.content)==null?void 0:t.data)==null?void 0:i.jsCode;e&&ne({code:e,context:this.context||{},localState:void 0,rootState:this.builderContextSignal.rootState,rootSetState:this.builderContextSignal.rootSetState})},onClick(e){var t,i;if(this.builderContextSignal.content){const r=(t=this.builderContextSignal.content)==null?void 0:t.testVariationId,n=(i=this.builderContextSignal.content)==null?void 0:i.id;Ne({type:"click",canTrack:this.canTrackToUse,contentId:n,apiKey:this.apiKey,variationId:r!==n?r:void 0,...Es(e),unique:!this.clicked})}this.clicked||(this.clicked=!0)},evalExpression(e){return e.replace(/{{([^}]+)}}/g,(t,i)=>ne({code:i,context:this.context||{},localState:void 0,rootState:this.builderContextSignal.rootState,rootSetState:this.builderContextSignal.rootSetState}))},handleRequest({url:e,key:t}){ai(e).then(i=>i.json()).then(i=>{var n,s;const r={...this.builderContextSignal.rootState,[t]:i};(s=(n=this.builderContextSignal).rootSetState)==null||s.call(n,r),this.httpReqsData[t]=!0}).catch(i=>{console.error("error fetching dynamic data",e,i)})},runHttpRequests(){var t,i,r;const e=(r=(i=(t=this.builderContextSignal.content)==null?void 0:t.data)==null?void 0:i.httpRequests)!=null?r:{};Object.entries(e).forEach(([n,s])=>{if(s&&(!this.httpReqsData[n]||j())){const a=this.evalExpression(s);this.handleRequest({url:a,key:n})}})},emitStateUpdate(){j()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:this.builderContextSignal.rootState,ref:{name:this.model}}}))},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}}),Ls=["builder-content-id","builder-model"];function Vs(e,t,i,r,n,s){var a;return e.builderContextSignal.content?(h.openBlock(),h.createElementBlock("div",h.mergeProps({key:e.forceReRenderCount,ref:"elementRef",onClick:t[0]||(t[0]=u=>e.onClick(u)),"builder-content-id":(a=e.builderContextSignal.content)==null?void 0:a.id,"builder-model":e.model,class:e._classStringToObject(e.classNameProp)},{...e.showContent?{}:{hidden:!0,"aria-hidden":!0}}),[h.renderSlot(e.$slots,"default")],16,Ls)):h.createCommentVNode("",!0)}const Fs=w(Bs,[["render",Vs]]),_i=h.defineComponent({render(){return h.h("script",{id:this.id,innerHTML:this.scriptStr})},name:"inlined-script",props:["scriptStr","id"]}),Ms=h.markRaw,Us=h.defineComponent({name:"content-component",components:{EnableEditor:Fs,InlinedScript:_i,ContentStyles:Wn,Blocks:Ge},props:["content","customComponents","data","locale","context","apiKey","apiVersion","model","canTrack","includeRefs","enrich","classNameProp","showContent","isSsrAbTest"],data(){var e,t;return{scriptStr:sn({variationId:(e=this.content)==null?void 0:e.testVariationId,contentId:(t=this.content)==null?void 0:t.id}),registeredComponents:[...et(),...tt,...this.customComponents||[]].reduce((i,{component:r,...n})=>({...i,[n.name]:{component:Ms(r),...it(n)}}),{}),builderContextSignal:{content:Yn({content:this.content,data:this.data}),localState:void 0,rootState:Hn({content:this.content,data:this.data,locale:this.locale}),rootSetState:this.contentSetState,context:this.context||{},apiKey:this.apiKey,apiVersion:this.apiVersion,componentInfos:[...et(),...tt,...this.customComponents||[]].reduce((i,{component:r,...n})=>({...i,[n.name]:it(n)}),{}),inheritedStyles:{}},TARGET:G}},methods:{contentSetState(e){this.builderContextSignal.rootState=e}}});function Ds(e,t,i,r,n,s){const a=h.resolveComponent("inlined-script"),u=h.resolveComponent("content-styles"),l=h.resolveComponent("blocks"),p=h.resolveComponent("enable-editor");return h.openBlock(),h.createBlock(p,h.mergeProps({content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,classNameProp:e.classNameProp,showContent:e.showContent,builderContextSignal:e.builderContextSignal},{}),{default:h.withCtx(()=>{var f,d,m,v,g,S,R;return[e.isSsrAbTest?(h.openBlock(),h.createBlock(a,{key:0,scriptStr:e.scriptStr},null,8,["scriptStr"])):h.createCommentVNode("",!0),e.TARGET!=="reactNative"?(h.openBlock(),h.createBlock(u,{key:1,contentId:(f=e.builderContextSignal.content)==null?void 0:f.id,cssCode:(m=(d=e.builderContextSignal.content)==null?void 0:d.data)==null?void 0:m.cssCode,customFonts:(g=(v=e.builderContextSignal.content)==null?void 0:v.data)==null?void 0:g.customFonts},null,8,["contentId","cssCode","customFonts"])):h.createCommentVNode("",!0),h.createVNode(l,{blocks:(R=(S=e.builderContextSignal.content)==null?void 0:S.data)==null?void 0:R.blocks,context:e.builderContextSignal,registeredComponents:e.registeredComponents},null,8,["blocks","context","registeredComponents"])]}),_:1},16,["content","model","context","apiKey","canTrack","locale","includeRefs","enrich","classNameProp","showContent","builderContextSignal"])}const js=w(Us,[["render",Ds]]),$s=h.defineComponent({name:"content-variants",components:{InlinedScript:_i,InlinedStyles:be,ContentComponent:js},props:["canTrack","content","__isNestedRender","model","data","context","apiKey","apiVersion","customComponents","locale","includeRefs","enrich"],data(){return{shouldRenderVariants:Qr({canTrack:Te(this.canTrack),content:this.content}),getScriptString:rn,getVariants:ce,getDefaultCanTrack:Te,handleABTestingSync:ks,TARGET:G}},mounted(){this.shouldRenderVariants=!1},computed:{variantScriptStr(){var e;return nn(ce(this.content).map(t=>({id:t.testVariationId,testRatio:t.testRatio})),((e=this.content)==null?void 0:e.id)||"")},hideVariantsStyleString(){return ce(this.content).map(e=>`.variant-${e.testVariationId} { display: none; } `).join("")}}});function Gs(e,t,i,r,n,s){var p,f;const a=h.resolveComponent("inlined-script"),u=h.resolveComponent("inlined-styles"),l=h.resolveComponent("content-component");return h.openBlock(),h.createElementBlock(h.Fragment,null,[!e.__isNestedRender&&e.TARGET!=="reactNative"?(h.openBlock(),h.createBlock(a,{key:0,scriptStr:e.getScriptString()},null,8,["scriptStr"])):h.createCommentVNode("",!0),e.shouldRenderVariants?(h.openBlock(),h.createElementBlock(h.Fragment,{key:1},[h.createVNode(u,{id:`variants-styles-${(p=e.content)==null?void 0:p.id}`,styles:e.hideVariantsStyleString},null,8,["id","styles"]),h.createVNode(a,{scriptStr:e.variantScriptStr},null,8,["scriptStr"]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.getVariants(e.content),(d,m)=>(h.openBlock(),h.createBlock(l,{key:d.testVariationId,content:d,showContent:!1,classNameProp:void 0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:e.shouldRenderVariants},null,8,["content","model","data","context","apiKey","apiVersion","customComponents","canTrack","locale","includeRefs","enrich","isSsrAbTest"]))),128))],64)):h.createCommentVNode("",!0),h.createVNode(l,h.mergeProps({content:e.shouldRenderVariants?e.content:e.handleABTestingSync({item:e.content,canTrack:e.getDefaultCanTrack(e.canTrack)}),classNameProp:`variant-${(f=e.content)==null?void 0:f.id}`,showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:e.shouldRenderVariants},{key:e.shouldRenderVariants.toString()}),null,16,["content","classNameProp","model","data","context","apiKey","apiVersion","customComponents","canTrack","locale","includeRefs","enrich","isSsrAbTest"])],64)}const Ci=w($s,[["render",Gs]]),Ws=async({builderContextValue:e,symbol:t})=>{if((t==null?void 0:t.model)&&(e==null?void 0:e.apiKey))return Ye({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(i=>{B.error("Could not fetch symbol content: ",i)})},Hs=h.defineComponent({name:"builder-symbol",components:{ContentVariants:Ci},props:["js","attributes","symbol","dynamic","builderContext","builderComponents"],data(){var e;return{contentToUse:(e=this.symbol)==null?void 0:e.content,filterAttrs:fe}},mounted(){this.setContent()},watch:{onUpdateHook0:{handler(){this.setContent()},immediate:!0}},computed:{className(){var e,t;return[...Object.keys(this.attributes.class),"builder-symbol",(e=this.symbol)!=null&&e.inline?"builder-inline-symbol":void 0,((t=this.symbol)==null?void 0:t.dynamic)||this.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},onUpdateHook0(){return{0:this.symbol}}},methods:{setContent(){this.contentToUse||Ws({symbol:this.symbol,builderContextValue:this.builderContext}).then(e=>{e&&(this.contentToUse=e)})},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}});function Ys(e,t,i,r,n,s){var u,l,p,f;const a=h.resolveComponent("content-variants");return h.openBlock(),h.createElementBlock("div",h.mergeProps({class:e._classStringToObject(e.className)},{...e.filterAttrs(e.attributes,"v-on:",!1)},h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),[h.createVNode(a,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(u=e.symbol)==null?void 0:u.data,...e.builderContext.localState,...(p=(l=e.contentToUse)==null?void 0:l.data)==null?void 0:p.state},model:(f=e.symbol)==null?void 0:f.model,content:e.contentToUse},null,8,["apiVersion","apiKey","context","customComponents","data","model","content"])],16)}const Ri=w(Hs,[["render",Ys]]),ut={};function qs(e){if(T()){Object.assign(ut,e);const t={type:"builder.settingsChange",data:ut};parent.postMessage(t,"*")}}exports.Block=$e;exports.BlockStyles=je;exports.Blocks=Ge;exports.BuilderContext=Pe;exports.Button=ct;exports.Columns=Xt;exports.ContentVariants=Ci;exports.Fragment=Jt;exports.Image=Qt;exports.Section=Zt;exports.Symbol=Ri;exports.TARGET=G;exports.Text=ri;exports.Video=ni;exports._export_sfc=w;exports.block=Ir;exports.convertStyleMapToCSSArray=Kt;exports.createRegisterComponentMessage=si;exports.evaluate=ne;exports.getAllContent=xi;exports.getBuilderSearchParams=yi;exports.getContent=Ye;exports.isEditing=j;exports.isPreviewing=Si;exports.processContentResult=Ei;exports.register=di;exports.setEditorSettings=qs;exports.track=fs;
|
|
98
|
+
`.trim()}}});function Yn(e,t,i,r,n,s){const a=h.resolveComponent("inlined-styles");return h.openBlock(),h.createBlock(a,{styles:e.injectedStyles},null,8,["styles"])}const qn=w(Hn,[["render",Yn]]),zn=({content:e,data:t,locale:i})=>{var s,a,u;const r={};(a=(s=e==null?void 0:e.data)==null?void 0:s.inputs)==null||a.forEach(l=>{var p;l.name&&l.defaultValue!==void 0&&((p=e==null?void 0:e.data)==null?void 0:p.state)&&e.data.state[l.name]===void 0&&(r[l.name]=l.defaultValue)});const n={...(u=e==null?void 0:e.data)==null?void 0:u.state,...t,...i?{locale:i}:{}};return{...r,...n}},Kn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function Xn(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function Jn(){const e=Xn().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
99
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const oi=Jn(),Qn=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},ui=({name:e,canTrack:t})=>{var i;try{return t?(i=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:i.split("=")[1]:void 0}catch(r){B.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},ci=async e=>ui(e),Zn=e=>e.map(([t,i])=>i?`${t}=${i}`:t).filter($).join("; "),es=[["secure",""],["SameSite","None"]],ts=({name:e,value:t,expires:i})=>{const n=(T()?location.protocol==="https:":!0)?es:[[]],s=i?[["expires",i.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",Qn(window.location.hostname)],...n];return Zn(a)},li=async({name:e,value:t,expires:i,canTrack:r})=>{try{if(!r)return;const n=ts({name:e,value:t,expires:i});document.cookie=n}catch(n){B.warn("[COOKIE] SET error: ",(n==null?void 0:n.message)||n)}};function is(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function hi(){return is().replace(/-/g,"")}const pi="builderSessionId",rs=async({canTrack:e})=>{if(!e)return;const t=await ci({name:pi,canTrack:e});if($(t))return t;{const i=ns();return ss({id:i,canTrack:e}),i}},ns=()=>hi(),ss=({id:e,canTrack:t})=>li({name:pi,value:e,canTrack:t}),fi=()=>T()&&typeof localStorage<"u"?localStorage:void 0,as=({key:e,canTrack:t})=>{var i;try{return t?(i=fi())==null?void 0:i.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},os=({key:e,canTrack:t,value:i})=>{var r;try{t&&((r=fi())==null||r.setItem(e,i))}catch(n){console.debug("[LocalStorage] SET error: ",n)}},di="builderVisitorId",us=({canTrack:e})=>{if(!e)return;const t=as({key:di,canTrack:e});if($(t))return t;{const i=cs();return ls({id:i,canTrack:e}),i}},cs=()=>hi(),ls=({id:e,canTrack:t})=>os({key:di,value:e,canTrack:t}),hs=()=>{if(T()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},ps=()=>typeof navigator=="object"&&navigator.userAgent||"",fs=()=>{const e=ps(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||G==="reactNative"}},i=e.match(/Tablet|iPad/i),r=hs();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:i?"tablet":t.any()?"mobile":"desktop"}},ds=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await rs({canTrack:e}),i=us({canTrack:e});return{sessionId:t,visitorId:i}},ms=async({type:e,canTrack:t,apiKey:i,metadata:r,...n})=>({type:e,data:{...n,metadata:{url:location.href,...r},...await ds({canTrack:t}),userAttributes:fs(),ownerId:i}});async function Pe(e){if(!e.apiKey){B.error("Missing API key for track call. Please provide your API key.");return}if(!!e.canTrack&&!j()&&!!(T()||G==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ms(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const gs=e=>Pe({...e,canTrack:!0}),vs="0.5.2",rt={};function mi(e,t){let i=rt[e];if(i||(i=rt[e]=[]),i.push(t),T()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(n){console.debug("Could not postmessage",n)}}}const ys=()=>{mi("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let nt=!1;const bs=(e={})=>{var t,i;nt||(nt=!0,T()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:G,version:vs,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(i=window.parent)==null||i.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:r})=>{var n,s;if(!!(r!=null&&r.type))switch(r.type){case"builder.evaluate":{const a=r.data.text,u=r.data.arguments||[],l=r.data.id,p=new Function(a);let f,d=null;try{f=p.apply(null,u)}catch(m){d=m}d?(n=window.parent)==null||n.postMessage({type:"builder.evaluateError",data:{id:l,error:d.message}},"*"):f&&typeof f.then=="function"?f.then(m=>{var v;(v=window.parent)==null||v.postMessage({type:"builder.evaluateResult",data:{id:l,result:m}},"*")}).catch(console.error):(s=window.parent)==null||s.postMessage({type:"builder.evaluateResult",data:{result:f,id:l}},"*");break}}})))};function st(e){return Math.round(e*1e3)/1e3}const Es=(e,t,i=!0)=>{if(!(e instanceof HTMLElement))return null;let r=i?e:e.parentElement;do{if(!r)return null;if(t(r))return r}while(r=r.parentElement);return null},xs=e=>Es(e,t=>{const i=t.getAttribute("builder-id")||t.id;return Boolean((i==null?void 0:i.indexOf("builder-"))===0)}),at=({event:e,target:t})=>{const i=t.getBoundingClientRect(),r=e.clientX-i.left,n=e.clientY-i.top,s=st(r/i.width),a=st(n/i.height);return{x:s,y:a}},Ss=e=>{const t=e.target,i=t&&xs(t),r=(i==null?void 0:i.getAttribute("builder-id"))||(i==null?void 0:i.id);return{targetBuilderElement:r||void 0,metadata:{targetOffset:t?at({event:e,target:t}):void 0,builderTargetOffset:i?at({event:e,target:i}):void 0,builderElementIndex:i&&r?[].slice.call(document.getElementsByClassName(r)).indexOf(i):void 0}}},_s="builder.tests",We=e=>`${_s}.${e}`,Cs=({contentId:e})=>ci({name:We(e),canTrack:!0}),Rs=({contentId:e})=>ui({name:We(e),canTrack:!0}),ks=({contentId:e,value:t})=>li({name:We(e),value:t,canTrack:!0}),gi=e=>$(e.id)&&$(e.variations)&&Object.keys(e.variations).length>0,ws=({id:e,variations:t})=>{var n;let i=0;const r=Math.random();for(const s in t){const a=(n=t[s])==null?void 0:n.testRatio;if(i+=a,r<i)return s}return e},vi=e=>{const t=ws(e);return ks({contentId:e.id,value:t}).catch(i=>{B.error("could not store A/B test variation: ",i)}),t},yi=({item:e,testGroupId:t})=>{const i=e.variations[t];return t===e.id||!i?{testVariationId:e.id,testVariationName:"Default"}:{data:i.data,testVariationId:i.id,testVariationName:i.name||(i.id===e.id?"Default":"")}},Ns=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!gi(e))return e;const i=Rs({contentId:e.id})||vi({variations:e.variations,id:e.id}),r=yi({item:e,testGroupId:i});return{...e,...r}},Ps=async({item:e,canTrack:t})=>{if(!t||!gi(e))return e;const r=await Cs({contentId:e.id})||vi({variations:e.variations,id:e.id}),n=yi({item:e,testGroupId:r});return{...e,...n}},Te=e=>$(e)?e:!0;function Oe(e,t=null,i="."){return Object.keys(e).reduce((r,n)=>{const s=e[n],a=[t,n].filter(Boolean).join(i);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...Oe(s,a,i)}:{...r,[a]:s}},{})}const ot="builder.",Ts="options.",Os=e=>{const t={};return e.forEach((i,r)=>{t[r]=i}),t},bi=e=>{if(!e)return{};const t=Ei(e),i={};return Object.keys(t).forEach(r=>{if(r.startsWith(ot)){const n=r.replace(ot,"").replace(Ts,"");i[n]=t[r]}}),i},Is=()=>{if(!T())return{};const e=new URLSearchParams(window.location.search);return bi(e)},Ei=e=>e instanceof URLSearchParams?Os(e):e,As="v3",He=e=>{const{limit:t=30,userAttributes:i,query:r,noTraverse:n=!1,model:s,apiKey:a,includeRefs:u=!0,enrich:l,locale:p,apiVersion:f=As}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(f))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);const d=new URL(`https://cdn.builder.io/api/${f}/content/${s}?apiKey=${a}&limit=${t}&noTraverse=${n}&includeRefs=${u}${p?`&locale=${p}`:""}${l?`&enrich=${l}`:""}`),m={...Is(),...Ei(e.options||{})},v=Oe(m);for(const g in v)d.searchParams.set(g,String(v[g]));if(i&&d.searchParams.set("userAttributes",JSON.stringify(i)),r){const g=Oe({query:r});for(const S in g)d.searchParams.set(S,JSON.stringify(g[S]))}return d},Bs=e=>"results"in e;async function Ye(e){const t=await Si({...e,limit:1});return t&&t.results[0]||null}const Ls=async e=>{const t=He(e);return await(await oi(t.href)).json()},xi=async(e,t,i=He(e))=>{const r=Te(e.canTrack);if(i.search.includes("preview="),!r||!(T()||G==="reactNative"))return t;try{const n=[];for(const s of t.results)n.push(await Ps({item:s,canTrack:r}));t.results=n}catch(n){B.error("Could not process A/B tests. ",n)}return t};async function Si(e){try{const t=He(e),i=await Ls(e);return Bs(i)?xi(e,i):(B.error("Error fetching data. ",{url:t,content:i,options:e}),null)}catch(t){return B.error("Error fetching data. ",t),null}}function _i(){return!T()||j()?!1:Boolean(location.search.indexOf("builder.preview=")!==-1)}const Vs=h.defineComponent({name:"enable-editor",props:["canTrack","builderContextSignal","model","context","apiKey","showContent","classNameProp","content","locale","includeRefs","enrich"],data(){return{canTrackToUse:$(this.canTrack)?this.canTrack:!0,forceReRenderCount:0,lastUpdated:0,shouldSendResetCookie:!1,httpReqsData:{},clicked:!1,builderContext:fe}},provide(){const e=this;return{[fe.key]:e.builderContextSignal}},mounted(){var e,t;if(this.apiKey||B.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),T()){if(j()&&(this.forceReRenderCount=this.forceReRenderCount+1,window.addEventListener("message",this.processMessage),ys(),bs({...this.locale?{locale:this.locale}:{},...this.includeRefs?{includeRefs:this.includeRefs}:{},...this.enrich?{enrich:this.enrich}:{}}),Object.values(this.builderContextSignal.componentInfos).forEach(i=>{var n;const r=ai(i);(n=window.parent)==null||n.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",this.emitStateUpdate)),this.builderContextSignal.content){const i=(e=this.builderContextSignal.content)==null?void 0:e.testVariationId,r=(t=this.builderContextSignal.content)==null?void 0:t.id;Pe({type:"impression",canTrack:this.canTrackToUse,contentId:r,apiKey:this.apiKey,variationId:i!==r?i:void 0})}if(_i()){const i=new URL(location.href).searchParams,r=i.get("builder.preview"),n=i.get(`builder.preview.${r}`),s=i.get("apiKey")||i.get("builder.space");r===this.model&&s===this.apiKey&&(!this.content||n===this.content.id)&&Ye({model:this.model,apiKey:this.apiKey,apiVersion:this.builderContextSignal.apiVersion}).then(a=>{a&&this.mergeNewContent(a)})}this.evaluateJsCode(),this.runHttpRequests(),this.emitStateUpdate()}},watch:{onUpdateHook0:{handler(){this.content&&this.mergeNewContent(this.content)},immediate:!0},onUpdateHook1:{handler(){},immediate:!0},onUpdateHook2:{handler(){this.evaluateJsCode()},immediate:!0},onUpdateHook3:{handler(){this.runHttpRequests()},immediate:!0},onUpdateHook4:{handler(){this.emitStateUpdate()},immediate:!0}},unmounted(){T()&&(window.removeEventListener("message",this.processMessage),window.removeEventListener("builder:component:stateChangeListenerActivated",this.emitStateUpdate))},computed:{onUpdateHook0(){return{0:this.content}},onUpdateHook1(){return{0:this.shouldSendResetCookie}},onUpdateHook2(){var e,t;return{0:(t=(e=this.builderContextSignal.content)==null?void 0:e.data)==null?void 0:t.jsCode,1:this.builderContextSignal.rootState}},onUpdateHook3(){var e,t;return{0:(t=(e=this.builderContextSignal.content)==null?void 0:e.data)==null?void 0:t.httpRequests}},onUpdateHook4(){return{0:this.builderContextSignal.rootState}}},methods:{mergeNewContent(e){var i,r,n,s,a;const t={...this.builderContextSignal.content,...e,data:{...(i=this.builderContextSignal.content)==null?void 0:i.data,...e==null?void 0:e.data},meta:{...(r=this.builderContextSignal.content)==null?void 0:r.meta,...e==null?void 0:e.meta,breakpoints:((n=e==null?void 0:e.meta)==null?void 0:n.breakpoints)||((a=(s=this.builderContextSignal.content)==null?void 0:s.meta)==null?void 0:a.breakpoints)}};this.builderContextSignal.content=t},processMessage(e){var i;const{data:t}=e;if(t)switch(t.type){case"builder.configureSdk":{const r=t.data,{breakpoints:n,contentId:s}=r;if(!s||s!==((i=this.builderContextSignal.content)==null?void 0:i.id))return;n&&this.mergeNewContent({meta:{breakpoints:n}}),this.forceReRenderCount=this.forceReRenderCount+1;break}case"builder.contentUpdate":{const r=t.data,n=r.key||r.alias||r.entry||r.modelName,s=r.data;n===this.model&&(this.mergeNewContent(s),this.forceReRenderCount=this.forceReRenderCount+1);break}}},evaluateJsCode(){var t,i;const e=(i=(t=this.builderContextSignal.content)==null?void 0:t.data)==null?void 0:i.jsCode;e&&ne({code:e,context:this.context||{},localState:void 0,rootState:this.builderContextSignal.rootState,rootSetState:this.builderContextSignal.rootSetState})},onClick(e){var t,i;if(this.builderContextSignal.content){const r=(t=this.builderContextSignal.content)==null?void 0:t.testVariationId,n=(i=this.builderContextSignal.content)==null?void 0:i.id;Pe({type:"click",canTrack:this.canTrackToUse,contentId:n,apiKey:this.apiKey,variationId:r!==n?r:void 0,...Ss(e),unique:!this.clicked})}this.clicked||(this.clicked=!0)},evalExpression(e){return e.replace(/{{([^}]+)}}/g,(t,i)=>ne({code:i,context:this.context||{},localState:void 0,rootState:this.builderContextSignal.rootState,rootSetState:this.builderContextSignal.rootSetState}))},handleRequest({url:e,key:t}){oi(e).then(i=>i.json()).then(i=>{var n,s;const r={...this.builderContextSignal.rootState,[t]:i};(s=(n=this.builderContextSignal).rootSetState)==null||s.call(n,r),this.httpReqsData[t]=!0}).catch(i=>{console.error("error fetching dynamic data",e,i)})},runHttpRequests(){var t,i,r;const e=(r=(i=(t=this.builderContextSignal.content)==null?void 0:t.data)==null?void 0:i.httpRequests)!=null?r:{};Object.entries(e).forEach(([n,s])=>{if(s&&(!this.httpReqsData[n]||j())){const a=this.evalExpression(s);this.handleRequest({url:a,key:n})}})},emitStateUpdate(){j()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:this.builderContextSignal.rootState,ref:{name:this.model}}}))},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}}),Fs=["builder-content-id","builder-model"];function Ms(e,t,i,r,n,s){var a;return e.builderContextSignal.content?(h.openBlock(),h.createElementBlock("div",h.mergeProps({key:e.forceReRenderCount,ref:"elementRef",onClick:t[0]||(t[0]=u=>e.onClick(u)),"builder-content-id":(a=e.builderContextSignal.content)==null?void 0:a.id,"builder-model":e.model,class:e._classStringToObject(e.classNameProp)},{...e.showContent?{}:{hidden:!0,"aria-hidden":!0}}),[h.renderSlot(e.$slots,"default")],16,Fs)):h.createCommentVNode("",!0)}const Us=w(Vs,[["render",Ms]]),Ci=h.defineComponent({render(){return h.h("script",{id:this.id,innerHTML:this.scriptStr})},name:"inlined-script",props:["scriptStr","id"]}),Ds=h.markRaw,js=h.defineComponent({name:"content-component",components:{EnableEditor:Us,InlinedScript:Ci,ContentStyles:qn,Blocks:Ge},props:["content","customComponents","data","locale","context","apiKey","apiVersion","model","canTrack","includeRefs","enrich","classNameProp","showContent","isSsrAbTest"],data(){var e,t;return{scriptStr:un({variationId:(e=this.content)==null?void 0:e.testVariationId,contentId:(t=this.content)==null?void 0:t.id}),registeredComponents:[...et(),...tt,...this.customComponents||[]].reduce((i,{component:r,...n})=>({...i,[n.name]:{component:Ds(r),...it(n)}}),{}),builderContextSignal:{content:Kn({content:this.content,data:this.data}),localState:void 0,rootState:zn({content:this.content,data:this.data,locale:this.locale}),rootSetState:this.contentSetState,context:this.context||{},apiKey:this.apiKey,apiVersion:this.apiVersion,componentInfos:[...et(),...tt,...this.customComponents||[]].reduce((i,{component:r,...n})=>({...i,[n.name]:it(n)}),{}),inheritedStyles:{}},TARGET:G}},provide(){const e=this;return{[Xt.key]:{registeredComponents:e.registeredComponents}}},methods:{contentSetState(e){this.builderContextSignal.rootState=e}}});function $s(e,t,i,r,n,s){const a=h.resolveComponent("inlined-script"),u=h.resolveComponent("content-styles"),l=h.resolveComponent("blocks"),p=h.resolveComponent("enable-editor");return h.openBlock(),h.createBlock(p,h.mergeProps({content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,classNameProp:e.classNameProp,showContent:e.showContent,builderContextSignal:e.builderContextSignal},{}),{default:h.withCtx(()=>{var f,d,m,v,g,S,R;return[e.isSsrAbTest?(h.openBlock(),h.createBlock(a,{key:0,scriptStr:e.scriptStr},null,8,["scriptStr"])):h.createCommentVNode("",!0),e.TARGET!=="reactNative"?(h.openBlock(),h.createBlock(u,{key:1,contentId:(f=e.builderContextSignal.content)==null?void 0:f.id,cssCode:(m=(d=e.builderContextSignal.content)==null?void 0:d.data)==null?void 0:m.cssCode,customFonts:(g=(v=e.builderContextSignal.content)==null?void 0:v.data)==null?void 0:g.customFonts},null,8,["contentId","cssCode","customFonts"])):h.createCommentVNode("",!0),h.createVNode(l,{blocks:(R=(S=e.builderContextSignal.content)==null?void 0:S.data)==null?void 0:R.blocks,context:e.builderContextSignal,registeredComponents:e.registeredComponents},null,8,["blocks","context","registeredComponents"])]}),_:1},16,["content","model","context","apiKey","canTrack","locale","includeRefs","enrich","classNameProp","showContent","builderContextSignal"])}const Gs=w(js,[["render",$s]]),Ws=h.defineComponent({name:"content-variants",components:{InlinedScript:Ci,InlinedStyles:Ee,ContentComponent:Gs},props:["canTrack","content","__isNestedRender","model","data","context","apiKey","apiVersion","customComponents","locale","includeRefs","enrich"],data(){return{shouldRenderVariants:tn({canTrack:Te(this.canTrack),content:this.content}),getScriptString:an,getVariants:ce,getDefaultCanTrack:Te,handleABTestingSync:Ns,TARGET:G}},mounted(){this.shouldRenderVariants=!1},computed:{variantScriptStr(){var e;return on(ce(this.content).map(t=>({id:t.testVariationId,testRatio:t.testRatio})),((e=this.content)==null?void 0:e.id)||"")},hideVariantsStyleString(){return ce(this.content).map(e=>`.variant-${e.testVariationId} { display: none; } `).join("")}}});function Hs(e,t,i,r,n,s){var p,f;const a=h.resolveComponent("inlined-script"),u=h.resolveComponent("inlined-styles"),l=h.resolveComponent("content-component");return h.openBlock(),h.createElementBlock(h.Fragment,null,[!e.__isNestedRender&&e.TARGET!=="reactNative"?(h.openBlock(),h.createBlock(a,{key:0,scriptStr:e.getScriptString()},null,8,["scriptStr"])):h.createCommentVNode("",!0),e.shouldRenderVariants?(h.openBlock(),h.createElementBlock(h.Fragment,{key:1},[h.createVNode(u,{id:`variants-styles-${(p=e.content)==null?void 0:p.id}`,styles:e.hideVariantsStyleString},null,8,["id","styles"]),h.createVNode(a,{scriptStr:e.variantScriptStr},null,8,["scriptStr"]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.getVariants(e.content),(d,m)=>(h.openBlock(),h.createBlock(l,{key:d.testVariationId,content:d,showContent:!1,classNameProp:void 0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:e.shouldRenderVariants},null,8,["content","model","data","context","apiKey","apiVersion","customComponents","canTrack","locale","includeRefs","enrich","isSsrAbTest"]))),128))],64)):h.createCommentVNode("",!0),h.createVNode(l,h.mergeProps({content:e.shouldRenderVariants?e.content:e.handleABTestingSync({item:e.content,canTrack:e.getDefaultCanTrack(e.canTrack)}),classNameProp:`variant-${(f=e.content)==null?void 0:f.id}`,showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:e.shouldRenderVariants},{key:e.shouldRenderVariants.toString()}),null,16,["content","classNameProp","model","data","context","apiKey","apiVersion","customComponents","canTrack","locale","includeRefs","enrich","isSsrAbTest"])],64)}const Ri=w(Ws,[["render",Hs]]),Ys=async({builderContextValue:e,symbol:t})=>{if((t==null?void 0:t.model)&&(e==null?void 0:e.apiKey))return Ye({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(i=>{B.error("Could not fetch symbol content: ",i)})},qs=h.defineComponent({name:"builder-symbol",components:{ContentVariants:Ri},props:["js","attributes","symbol","dynamic","builderContext","builderComponents"],data(){var e;return{contentToUse:(e=this.symbol)==null?void 0:e.content,filterAttrs:de}},mounted(){this.setContent()},watch:{onUpdateHook0:{handler(){this.setContent()},immediate:!0}},computed:{className(){var e,t;return[...Object.keys(this.attributes.class),"builder-symbol",(e=this.symbol)!=null&&e.inline?"builder-inline-symbol":void 0,((t=this.symbol)==null?void 0:t.dynamic)||this.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},onUpdateHook0(){return{0:this.symbol}}},methods:{setContent(){this.contentToUse||Ys({symbol:this.symbol,builderContextValue:this.builderContext}).then(e=>{e&&(this.contentToUse=e)})},_classStringToObject(e){const t={};if(typeof e!="string")return t;const i=e.trim().split(/\s+/);for(const r of i)t[r]=!0;return t}}});function zs(e,t,i,r,n,s){var u,l,p,f;const a=h.resolveComponent("content-variants");return h.openBlock(),h.createElementBlock("div",h.mergeProps({class:e._classStringToObject(e.className)},{...e.filterAttrs(e.attributes,"v-on:",!1)},h.toHandlers(e.filterAttrs(e.attributes,"v-on:",!0),!0)),[h.createVNode(a,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(u=e.symbol)==null?void 0:u.data,...e.builderContext.localState,...(p=(l=e.contentToUse)==null?void 0:l.data)==null?void 0:p.state},model:(f=e.symbol)==null?void 0:f.model,content:e.contentToUse},null,8,["apiVersion","apiKey","context","customComponents","data","model","content"])],16)}const ki=w(qs,[["render",zs]]),ut={};function Ks(e){if(T()){Object.assign(ut,e);const t={type:"builder.settingsChange",data:ut};parent.postMessage(t,"*")}}exports.Block=$e;exports.BlockStyles=je;exports.Blocks=Ge;exports.BuilderContext=fe;exports.Button=ct;exports.Columns=Jt;exports.ContentVariants=Ri;exports.Fragment=Qt;exports.Image=Zt;exports.Section=ei;exports.Symbol=ki;exports.TARGET=G;exports.Text=ni;exports.Video=si;exports._export_sfc=w;exports.block=Ar;exports.convertStyleMapToCSSArray=Kt;exports.createRegisterComponentMessage=ai;exports.evaluate=ne;exports.getAllContent=Si;exports.getBuilderSearchParams=bi;exports.getContent=Ye;exports.isEditing=j;exports.isPreviewing=_i;exports.processContentResult=xi;exports.register=mi;exports.setEditorSettings=Ks;exports.track=gs;
|