@builder.io/react
Advanced tools
Comparing version 3.0.14-0 to 3.0.14
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var sdk=require("@builder.io/sdk"),core=require("@emotion/core"),React=require("react"),ReactDOM=require("react-dom"),hash=require("hash-sum");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var React__default=_interopDefaultLegacy(React),React__namespace=_interopNamespace(React),ReactDOM__default=_interopDefaultLegacy(ReactDOM),hash__default=_interopDefaultLegacy(hash),version="3.0.13",_a;"undefined"!=typeof window&&(null===(_a=window.parent)||void 0===_a||_a.postMessage({type:"builder.isReactSdk",data:{value:!0,supportsPatchUpdates:"v4",supportsCustomBreakpoints:!0,supportsGlobalSymbols:!0,priorVersion:version}},"*"));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function __rest(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function __decorate(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var fastClone=function(e){return JSON.parse(JSON.stringify(e))},sizeNames=["xsmall","small","medium","large"],sizes={xsmall:{min:0,default:0,max:0},small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200},getWidthForSize:function(e){return this[e].default},getSizeForWidth:function(e){for(var t=0,n=sizeNames;t<n.length;t++){var r=n[t];if(e<=this[r].max)return r}return"large"}},getSizesForBreakpoints=function(e){var t=e.small,n=e.medium,r=__assign(__assign({},sizes),fastClone(sizes));if(!t||!n)return r;var i=Math.floor(t/2);r.small={max:t,min:i,default:i+1};var a=r.small.max+1;r.medium={max:n,min:a,default:a+1};var o=r.medium.max+1;return r.large={max:2e3,min:o,default:o+1},r},set=function(e,t,n){if(Object(e)!==e)return e;var r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((function(e,t,n){return Object(e[t])===e[t]?e[t]:e[t]=Math.abs(Number(r[n+1]))>>0==+r[n+1]?[]:{}}),e)[r[r.length-1]]=n,e},noop=function(){return null},safeDynamicRequire;if("function"==typeof(null===globalThis||void 0===globalThis?void 0:globalThis.require)||sdk.Builder.isServer&&"function"==typeof require)try{safeDynamicRequire=eval("require")}catch(e){safeDynamicRequire=(null===globalThis||void 0===globalThis?void 0:globalThis.require)?globalThis.require:noop}function isDebug(){return Boolean("undefined"!=typeof process&&void 0!==process.env&&process.env.DEBUG)}null!=safeDynamicRequire||(safeDynamicRequire=noop);var fnCache={},api=function(e){return sdk.builder};function stringToFunction(e,t,n,r){if(void 0===t&&(t=!0),!e||!e.trim())return function(){};var i=e+":"+t;if(fnCache[i])return fnCache[i];var a=t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))||e.trim().startsWith("builder.run"),o=function(){};try{sdk.Builder.isBrowser&&(o=new Function("state","event","block","builder","Device","update","Builder","context","\n var names = [\n 'state',\n 'event',\n 'block',\n 'builder',\n 'Device',\n 'update',\n 'Builder',\n 'context'\n ];\n var rootState = state;\n if (typeof Proxy !== 'undefined') {\n rootState = new Proxy(rootState, {\n set: function () {\n return false;\n },\n get: function (target, key) {\n if (names.includes(key)) {\n return undefined;\n }\n return target[key];\n }\n });\n }\n /* Alias */\n var ctx = context;\n var log = console.log.bind(console);\n with (rootState) {\n ".concat(a?"return (".concat(e,");"):e,";\n }\n ")))}catch(t){n&&n.push(t);var s=t&&t.message;s&&"string"==typeof s&&r&&-1===r.indexOf(s)&&r.push(s),sdk.Builder.isBrowser&&console.warn("Function compile error in ".concat(e),t)}var l=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if(sdk.Builder.isBrowser)return o.apply(void 0,t);var i=getIsolateContext(),s=safeDynamicRequire("isolated-vm"),l=i.evalClosureSync(makeFn(e,a),t.map((function(e,t){return"object"==typeof e?new s.Reference(t===indexOfBuilderInstance?__assign(__assign({},e),{getUserAttributes:function(){return e.getUserAttributes("")}}):e):null})));try{var u=JSON.parse(l);return u}catch(e){return l}}catch(t){return sdk.Builder.isBrowser?console.warn("Builder custom code error:",t.message||t,"in",e,t.stack||t):isDebug()&&console.debug("Builder custom code error:",t.message||t,"in",e,t.stack||t),n&&n.push(t),null}};return sdk.Builder.isBrowser&&(fnCache[i]=l),l}var indexOfBuilderInstance=3,makeFn=function(e,t,n){var r=n||["state","event","block","builder","Device","update","Builder","context"];return"\n".concat("\n var refToProxy = (obj) => {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n return new Proxy({}, {\n get(target, key) {\n if (key === 'copySync') {\n return () => obj.copySync();\n }\n const val = obj.getSync(key);\n if (typeof val?.getSync === 'function') {\n return refToProxy(val);\n }\n return val;\n },\n set(target, key, value) {\n obj.setSync(key, value);\n },\n deleteProperty(target, key) {\n obj.deleteSync(key);\n }\n })\n }\n","\n").concat("\n var stringify = (val) => {\n if (typeof val === 'object' && val !== null) {\n return JSON.stringify(val.copySync ? val.copySync() : val);\n }\n return val;\n }\n ","\n").concat(r.map((function(e,t){return"var ".concat(e," = refToProxy($").concat(t,");")})).join("\n")).concat("\n".concat(r.includes("context")?"var ctx = context;":"","\n").concat(t?"return stringify(".concat(e,");"):e,";\n"))},getIsolateContext=function(){var e=sdk.Builder.serverContext;e||(e=new(safeDynamicRequire("isolated-vm").Isolate)({memoryLimit:128}).createContextSync(),sdk.Builder.setServerContext(e));var t=e.global;return t.setSync("global",t.derefInto()),t.setSync("log",(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];isDebug()&&console.log.apply(console,e)})),e},isPromise=function(e){return"function"==typeof e.then},isRequestInfo=function(e){return!isPromise(e)},BuilderAsyncRequestsContext=React__default.default.createContext({requests:[],errors:[],logs:[]}),BuilderStoreContext=React__default.default.createContext({state:{},rootState:{},content:{},context:{},update:function(e){return null}}),applyPatchWithMinimalMutationChain=function(e,t,n){if(void 0===n&&(n=!1),Object(e)!==e)return e;var r=t.path,i=t.op,a=t.value,o=r.split(/\//);""===o[0]&&o.shift();for(var s=n?e:__assign({},e),l=s,u=0;u<o.length;u++){var c=u===o.length-1,d=o[u];if(c){if("replace"===i)l[d]=a;else if("add"===i){var p=Number(d);Array.isArray(l)?"-"===d?l.push(a):l.splice(p,0,a):l[d]=a}else if("remove"===i){p=Number(d);Array.isArray(l)?l.splice(p,1):delete l[d]}}else{var f=o[u+1],v=Object(l[d])===l[d]?l[d]:String(Number(f))===f?[]:{};l=l[d]=Array.isArray(v)?__spreadArray([],v,!0):__assign({},v)}}return s},htmlEscape=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},blockToHtmlString=function(e){var t;return"<".concat(htmlEscape(e.tagName||"div"),' \n class="builder-block ').concat(e.id," ").concat(e.class||"",'"\n builder-id="').concat(e.id,'"\n ').concat(Object.keys(e.properties||{}).map((function(t){return"".concat(htmlEscape(t),'="').concat(htmlEscape(e.properties[t]),'"')})).join(" "),"\n >").concat("Text"===(null===(t=null==e?void 0:e.component)||void 0===t?void 0:t.name)?e.component.options.text:e.children?e.children.map((function(e){return blockToHtmlString(e)})).join(""):"","</").concat(e.tagName||"div",">").replace(/\s+/g," ")},Link=function(e){return React__default.default.createElement(BuilderStoreContext.Consumer,null,(function(t){return t.renderLink?t.renderLink(e):React__default.default.createElement("a",__assign({},e))}))},camelCaseToKebabCase=function(e){return e?e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())})):""},kebabCaseToCamelCase=function(e){return void 0===e&&(e=""),e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))},Device={desktop:0,tablet:1,mobile:2},voidElements=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","textarea"]),last=function(e){return e[e.length-1]};function omit$1(e,t){for(var n=Object.assign({},e),r=0,i=t;r<i.length;r++){delete n[i[r]]}return n}var cssCase=function(e){if(!e)return e;var t=camelCaseToKebabCase(e);return e[0]===e[0].toUpperCase()&&(t="-"+t),t};function capitalize(e){if(e)return e[0].toUpperCase()+e.slice(1)}var BuilderBlock=function(_super){function BuilderBlock(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.state={hasError:!1,updates:0},_this.privateState={state:{},rootState:{},context:{},update:function(){}},_this.onWindowMessage=function(event){var message=event.data;if(message)switch(message.type){case"builder.selectionChange":var data=message.data;if(!data)break;var selection=data.selection,id=_this.block&&_this.block.id;id&&Array.isArray(selection)&&selection.indexOf(id)>-1&&setTimeout((function(){window.$block=_this,window.$blocks||(window.$blocks=[]),window.$blocks.push(_this)}));break;case"builder.patchUpdates":var data=message.data;if(!data||!data.data)break;var patches=data.data[_this.block.id];if(!patches)return;location.href.includes("builder.debug=true")&&eval("debugger");for(var _i=0,patches_1=patches;_i<patches_1.length;_i++){var patch=patches_1[_i];applyPatchWithMinimalMutationChain(_this.props.block,patch,!0)}_this.setState({updates:_this.state.updates+1})}},_this}return __extends(BuilderBlock,_super),Object.defineProperty(BuilderBlock.prototype,"store",{get:function(){return this.privateState},enumerable:!1,configurable:!0}),BuilderBlock.getDerivedStateFromError=function(e){return{hasError:!0}},BuilderBlock.prototype.componentDidCatch=function(e,t){console.error("Builder block error:",e,t)},BuilderBlock.prototype.stringToFunction=function(e,t){return void 0===t&&(t=!0),stringToFunction(e,t,this._errors,this._logs)},Object.defineProperty(BuilderBlock.prototype,"block",{get:function(){return this.props.block},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderBlock.prototype,"emotionCss",{get:function(){var e,t,n,r,i,a=this.block;if(sdk.Builder.isServer){var o=a.animations&&a.animations[0];if(o&&"hover"!==o.trigger){var s=o&&o.steps&&o.steps[0],l=s&&s.styles;l&&(i=l)}}var u=sizeNames.slice().reverse(),c=this.block,d={};if(c.responsiveStyles)for(var p=0,f=u;p<f.length;p++){var v=f[p];if("large"===v)this.props.emailMode||(d["&.builder-block"]=Object.assign({},c.responsiveStyles[v],i));else{var m=getSizesForBreakpoints((null===(t=null===(e=this.privateState.context.builderContent)||void 0===e?void 0:e.meta)||void 0===t?void 0:t.breakpoints)||{});d["@media only screen and (max-width: ".concat(m[v].max,"px)")]={"&.builder-block":c.responsiveStyles[v]}}}var h=a.animations&&a.animations.find((function(e){return"hover"===e.trigger}));return h&&(d[":hover"]=(null===(r=null===(n=h.steps)||void 0===n?void 0:n[1])||void 0===r?void 0:r.styles)||{},d.transition="all ".concat(h.duration,"s ").concat(camelCaseToKebabCase(h.easing)),h.delay&&(d.transitionDelay=h.delay+"s")),d},enumerable:!1,configurable:!0}),BuilderBlock.prototype.eval=function(e){return this.stringToFunction(e)(this.privateState.state,void 0,this.block,sdk.builder,Device,this.privateState.update,sdk.Builder,this.privateState.context)},BuilderBlock.prototype.componentWillUnmount=function(){sdk.Builder.isEditing&&removeEventListener("message",this.onWindowMessage)},BuilderBlock.prototype.componentDidMount=function(){var e,t=this,n=this.block,r=n&&n.animations;if(sdk.Builder.isEditing&&addEventListener("message",this.onWindowMessage),r){var i={animations:fastClone(r)};if(n.bindings)for(var a in n.bindings)if((null===(e=a.trim)||void 0===e?void 0:e.call(a))&&a.startsWith("animations.")){var o=this.stringToFunction(n.bindings[a]);void 0!==o&&set(i,a,o(this.privateState.state,null,n,sdk.builder,null,null,sdk.Builder,this.privateState.context))}sdk.Builder.animator.bindAnimations(i.animations.filter((function(e){return"hover"!==e.trigger})).map((function(e){return __assign(__assign({},e),{elementId:t.block.id})})))}},BuilderBlock.prototype.getElement=function(e,t){var n,r,i,a,o,s=this;void 0===e&&(e=0),void 0===t&&(t=this.privateState.state);var l=this.props;l.child,l.fieldName;var u,c=this.block,d=(c.tagName||"div").toLowerCase();if("template"===d){var p=c.children?c.children.map((function(e){return blockToHtmlString(e)})).join(" "):"";return console.debug("template html",p),core.jsx("template",__assign({},c.properties,{dangerouslySetInnerHTML:{__html:p}}))}var f=c.component&&(c.component.name||c.component.component),v=null;c.component&&!c.component.class&&(c.component&&c.component.tag?u=c.component.tag:(v=sdk.Builder.components.find((function(e){return e.name===f}))||null)&&v.class?u=v.class:v&&v.tag?u=v.tag:(null==f?void 0:f.startsWith("Builder:"))?console.warn("Missing @builder.io/widgets installation, please install and import @builder.io/widgets to use ".concat(f.split(":")[1]," in your content, more info here: https://github.com/BuilderIO/builder/tree/main/packages/widgets")):f&&console.warn("Missing registration for ".concat(f,", have you included the registration in your bundle?")));var m=__assign(__assign({},c.properties),{style:{}});if(m=__assign(__assign({},m.properties),m),c.component&&(m.component=fastClone(c.component)),c.bindings)for(var h in c.bindings)if(null===(r=h.trim)||void 0===r?void 0:r.call(h)){var g=this.stringToFunction(c.bindings[h]);set(m,h,g(t,null,c,api(),Device,null,sdk.Builder,this.privateState.context))}if(m.hide)return null;if(delete m.hide,("show"in m||c.bindings&&c.bindings.show)&&!m.show)return null;if(delete m.show,c.actions){var b=function(e){if(!(null===(i=e.trim)||void 0===i?void 0:i.call(e)))return"continue";var n=c.actions[e];m["on"+capitalize(e)]=function(e){var r=t;return"undefined"!=typeof Proxy&&(r=new Proxy(t,{set:function(e,t,n){return e[t]=n,s.privateState.rootState[t]=n,!0}})),s.stringToFunction(n,!1)(r,e,s.block,sdk.builder,Device,s.privateState.update,sdk.Builder,s.privateState.context)}};for(var h in c.actions)b(h)}var _=(m.component||m.options)&&__assign(__assign({},m.options),m.component.options||m.component.data),y=voidElements.has(d),k=v&&(v.fragment||v.noWrap),B=(null===(a=m.attr)||void 0===a?void 0:a.style)||("string"==typeof m.style?m.style:"")||"";if("string"==typeof B){"object"!=typeof m.style&&(m.style={});for(var C=0,S=B.split(";");C<S.length;C++){var w=S[C].split(":");if(!w.length)return;h=w[0],g=w[1];h&&(w.length>2&&(g=w.slice(1).join(":")),m.style[kebabCaseToCamelCase(h)]=g)}}var x=__assign(__assign(__assign({},omit$1(m,["class","component","attr"])),((n={})["string"!=typeof d||d.includes("-")?"class":"className"]="builder-block ".concat(this.id).concat(c.class?" ".concat(c.class):"").concat(!c.component||["Image","Video","Banner"].indexOf(f)>-1?"":" builder-has-component")+(m.class?" "+m.class:"")+(sdk.Builder.isEditing&&(null===(o=this.privateState.state._spacer)||void 0===o?void 0:o.parent)===c.id?" builder-spacer-parent":""),n.key=this.id+e,n["builder-id"]=this.id,n)),0!==e&&{"builder-index":e});sdk.Builder.isEditing&&(x["builder-inline-styles"]=m.attr&&m.attr.style?Object.keys(m.style).reduce((function(e,t){return(e?"".concat(e,";"):"")+"".concat(cssCase(t),":").concat(m.style[t],";")}),""):""),(x.properties&&x.properties.href||x.href)&&"div"===d&&(d="a"),"a"===d&&(d=Link);var E=c.children||x.children||[];return core.jsx(React__default.default.Fragment,null,core.jsx(core.ClassNames,null,(function(e){var t=e.css;if(e.cx,!s.props.emailMode){var n=" "+t(s.emotionCss);x.class&&(x.class+=n),x.className&&(x.className+=n)}return core.jsx(BuilderAsyncRequestsContext.Consumer,null,(function(e){return s._asyncRequests=e&&e.requests,s._errors=e&&e.errors,s._logs=e&&e.logs,y?core.jsx(d,__assign({},x)):u&&(k||s.props.emailMode)?core.jsx(u,__assign({},_,{attributes:x,builderBlock:c,builderState:s.privateState})):core.jsx(d,__assign({},x),u&&core.jsx(u,__assign({builderState:s.privateState,builderBlock:c},_)),c.text||m.text?m.text:!u&&E&&Array.isArray(E)&&E.length?E.map((function(e,t){return core.jsx(BuilderBlock,{key:(s.id||"")+t,block:e,index:t,size:s.props.size,fieldName:s.props.fieldName,child:s.props.child,emailMode:s.props.emailMode})})):null)}))})))},Object.defineProperty(BuilderBlock.prototype,"id",{get:function(){var e=this.block;return e.id.startsWith("builder")?e.id:"builder-"+e.id},enumerable:!1,configurable:!0}),BuilderBlock.prototype.contents=function(e){var t=this,n=this.block;if(this.privateState=e,n.repeat&&n.repeat.collection){var r=n.repeat.collection,i=last((r||"").trim().split("(")[0].trim().split(".")),a=n.repeat.itemName||(i?i+"Item":"item"),o=this.stringToFunction(r)(e.state,null,n,api(),Device,null,sdk.Builder,this.privateState.context);return Array.isArray(o)?o.map((function(n,r){var i,o=__assign(__assign({},e.state),((i={$index:r,$item:n})[a]=n,i["$".concat(a,"Index")]=r,i));return core.jsx(BuilderStoreContext.Provider,{key:r,value:__assign(__assign({},e),{state:o})},t.getElement(r,o))})):null}return this.getElement()},BuilderBlock.prototype.render=function(){var e=this;return this.state.hasError?core.jsx("span",{css:{display:"inline-block",padding:5,color:"#999",fontSize:11,fontStyle:"italic"}},"Builder block error :( Check console for details"):core.jsx(BuilderStoreContext.Consumer,null,(function(t){return e.contents(t)}))},BuilderBlock}(React__default.default.Component),BuilderBlocks=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClickEmptyBlocks=function(){var e;sdk.Builder.isIframe&&t.noBlocks&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:t.parentId,dataPath:t.path}},"*"))},t.onHoverEmptyBlocks=function(){var e;sdk.Builder.isEditing&&t.noBlocks&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:t.parentId,dataPath:t.path}},"*"))},t}return __extends(t,e),Object.defineProperty(t.prototype,"isRoot",{get:function(){return!this.props.child},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noBlocks",{get:function(){var e=this.props.blocks;return!(e&&e.length)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){var e=this.props.dataPath||"";return e.trim()&&(e.startsWith("this.")?e=e.replace("this.",""):e.startsWith("component.options.")||(e="component.options."+e)),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.props.parentElementId?this.props.parentElementId:this.props.parent&&this.props.parent.id},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props.blocks,n=this.props.emailMode?"span":"div";return core.jsx(n,__assign({className:"builder-blocks"+(this.noBlocks?" no-blocks":"")+(this.props.child?" builder-blocks-child":"")+(this.props.className?" "+this.props.className:""),"builder-type":"blocks","builder-path":sdk.Builder.isIframe?this.path:void 0,"builder-parent-id":this.parentId,css:__assign(__assign({},!this.props.emailMode&&{display:"flex",flexDirection:"column",alignItems:"stretch"}),this.props.style),onClick:function(){e.noBlocks&&e.onClickEmptyBlocks()}},sdk.Builder.isEditing&&{onMouseEnter:function(){return e.onHoverEmptyBlocks()}}),t&&Array.isArray(t)&&t.map((function(t,n){return t&&"@builder.io/sdk:Element"===t["@type"]?core.jsx(BuilderBlock,{key:t.id,block:t,index:n,fieldName:e.props.fieldName,child:e.props.child,emailMode:e.props.emailMode}):t}))||t)},t.renderInto=function(e,n,r){if(void 0===n&&(n={}),e){var i=null;return"string"==typeof e?i=document.querySelector(e):e instanceof Element&&(i=e),ReactDOM__default.default.render(core.jsx(BuilderStoreContext.Provider,{value:r},core.jsx(t,__assign({},n))),i)}},t}(React__default.default.Component),NoWrap=function(e){return e.children};function getData(e){if(void 0!==(null==e?void 0:e.data)){var t=e.data,n=t.blocks,r=t.blocksString,i=Array.isArray(n)||"string"==typeof r,a=__assign(__assign({},e.data),i&&{blocks:n||JSON.parse(r)});return delete a.blocksString,a}}var variantsScript=function(e,t){return"\n(function() {\n if (window.builderNoTrack || !navigator.cookieEnabled) {\n return;\n }\n\n var variants = ".concat(e,";\n function removeVariants() {\n variants.forEach(function (template) {\n document.querySelector('template[data-template-variant-id=\"' + template.id + '\"]').remove();\n });\n document.getElementById('variants-script-").concat(t,'\').remove();\n }\n\n if (typeof document.createElement("template").content === \'undefined\') {\n removeVariants();\n return ;\n }\n\n function setCookie(name,value,days) {\n var expires = "";\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days*24*60*60*1000));\n expires = "; expires=" + date.toUTCString();\n }\n document.cookie = name + "=" + (value || "") + expires + "; path=/" + "; Secure; SameSite=None";\n }\n\n function getCookie(name) {\n var nameEQ = name + "=";\n var ca = document.cookie.split(\';\');\n for(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==\' \') c = c.substring(1,c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);\n }\n return null;\n }\n var cookieName = \'builder.tests.').concat(t,"';\n var variantInCookie = getCookie(cookieName);\n var availableIDs = variants.map(function(vr) { return vr.id }).concat('").concat(t,"');\n var variantId;\n if (availableIDs.indexOf(variantInCookie) > -1) {\n variantId = variantInCookie;\n }\n if (!variantId) {\n var n = 0;\n var random = Math.random();\n for (var i = 0; i < variants.length; i++) {\n var variant = variants[i];\n var testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n variantId = variant.id;\n break;\n }\n }\n if (!variantId) {\n variantId = \"").concat(t,'";\n setCookie(cookieName, "').concat(t,'");\n }\n }\n if (variantId && variantId !== "').concat(t,"\") {\n var winningTemplate = document.querySelector('template[data-template-variant-id=\"' + variantId + '\"]');\n if (winningTemplate) {\n var parentNode = winningTemplate.parentNode;\n var newParent = parentNode.cloneNode(false);\n newParent.appendChild(winningTemplate.content.firstChild);\n parentNode.parentNode.replaceChild(newParent, parentNode);\n }\n } else if (variants.length > 0) {\n removeVariants();\n }\n})()").replace(/\s+/g," ")},VariantsProvider=function(e){var t=e.initialContent,n=e.children;if(sdk.Builder.isBrowser&&!sdk.builder.canTrack)return n([t]);if(!Boolean(Object.keys((null==t?void 0:t.variations)||{}).length))return n([t]);var r=Object.keys(t.variations).map((function(e){return __assign(__assign({id:e},t.variations[e]),{data:getData(t.variations[e])})})),i=__spreadArray(__spreadArray([],r,!0),[t],!1);if(sdk.Builder.isServer){var a=JSON.stringify(Object.keys(t.variations||{}).map((function(e){return{id:e,testRatio:t.variations[e].testRatio}})));return React__namespace.createElement(React__namespace.Fragment,null,n(i,(function(){return React__namespace.createElement("script",{id:"variants-script-".concat(t.id),dangerouslySetInnerHTML:{__html:variantsScript(a,t.id)}})})))}var o="builder.tests.".concat(t.id),s=sdk.builder.getCookie(o);if(!s&&sdk.Builder.isBrowser)for(var l=0,u=Math.random(),c=0;c<r.length;c++){var d=r[c];if(u<(l+=d.testRatio)){sdk.builder.setCookie(o,d.id),s=d.id;break}}return s||(s=t.id,sdk.builder.setCookie(o,s)),n([i.find((function(e){return e.id===s}))])},BuilderContent=function(_super){function BuilderContent(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.ref=null,_this.state={loading:!_this.props.content,data:getContentWithInfo(_this.props.content),updates:1},_this.onWindowMessage=function(event){var _a,_b,message=event.data;if(message)switch(message.type){case"builder.patchUpdates":if(null===(_a=_this.props.options)||void 0===_a?void 0:_a.noEditorUpdates)return;var data=message.data;if(!data||!data.data)break;var patches=data.data[null===(_b=_this.state.data)||void 0===_b?void 0:_b.id];if(!patches||!patches.length)return;location.href.includes("builder.debug=true")&&eval("debugger");for(var newData=_this.state.data,_i=0,patches_1=patches;_i<patches_1.length;_i++){var patch=patches_1[_i];newData=applyPatchWithMinimalMutationChain(newData,patch,!1)}_this.setState({updates:_this.state.updates+1,data:newData}),_this.props.contentLoaded&&_this.props.contentLoaded(newData.data,newData)}},_this.subscriptions=new sdk.Subscription,_this.firstLoad=!0,_this.clicked=!1,_this.trackedImpression=!1,_this.intersectionObserver=null,_this.onClick=function(e){var t=e.nativeEvent,n=_this.data;n&&(sdk.builder.autoTrack&&_this.builder.trackInteraction(n.id,_this.renderedVariantId,_this.clicked,t,{content:n}),_this.clicked||(_this.clicked=!0))},_this}return __extends(BuilderContent,_super),Object.defineProperty(BuilderContent.prototype,"builder",{get:function(){return this.props.builder||sdk.builder},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"name",{get:function(){var e=this.props;return"model"in e?e.model:e.modelName},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"renderedVariantId",{get:function(){var e,t,n=this.props.isStatic?this.builder.getCookie("builder.tests.".concat(null===(e=this.data)||void 0===e?void 0:e.id)):null===(t=this.data)||void 0===t?void 0:t.variationId;if(null!==n)return n},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"options",{get:function(){var e,t,n=__assign({},this.props.options||{});return n.key||!(null===(e=this.props.content)||void 0===e?void 0:e.id)||sdk.Builder.isEditing||sdk.Builder.isPreviewing||(n.key=this.props.content.id),!this.props.content||(null===(t=n.initialContent)||void 0===t?void 0:t.length)||!this.props.inline&&sdk.Builder.isPreviewing||(n.initialContent=[this.props.content]),n},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"data",{get:function(){var e=(this.props.inline||!sdk.Builder.isBrowser||this.firstLoad)&&this.options.initialContent&&this.options.initialContent[0]||this.state.data;return getContentWithInfo(e)},enumerable:!1,configurable:!0}),BuilderContent.prototype.componentDidMount=function(){var e,t;if(!this.props.inline||sdk.Builder.isEditing||sdk.Builder.isPreviewing)this.subscribeToContent();else if(this.props.inline&&(null===(t=null===(e=this.options)||void 0===e?void 0:e.initialContent)||void 0===t?void 0:t.length)){var n=this.options.initialContent[0];(null==n?void 0:n.id)&&this.builder.trackImpression(n.id,this.renderedVariantId,void 0,{content:n})}sdk.Builder.isEditing&&addEventListener("message",this.onWindowMessage)},BuilderContent.prototype.subscribeToContent=function(){var e=this;"_inline"!==this.name&&this.subscriptions.add(this.builder.queueGetContent(this.name,this.options).subscribe((function(t){var n=t&&t[0];e.setState({data:n,loading:!1});var r=(e.builder.editingModel||e.builder.previewingModel)===e.name;if(!e.props.inline&&e.props.content&&e.firstLoad&&r&&(e.firstLoad=!1,e.subscriptions.unsubscribe(),e.subscribeToContent()),n&&e.firstLoad&&(e.firstLoad=!1,sdk.builder.autoTrack&&!sdk.Builder.isEditing)){var i=!1;if("function"==typeof IntersectionObserver&&e.ref)try{(e.intersectionObserver=new IntersectionObserver((function(t,r){t.forEach((function(t){t.intersectionRatio>0&&!e.trackedImpression&&(e.builder.trackImpression(n.id,e.renderedVariantId,void 0,{content:e.data}),e.data,e.trackedImpression=!0,e.ref&&r.unobserve(e.ref))}))}))).observe(e.ref),i=!0}catch(e){console.warn("Could not bind intersection observer")}i||(e.trackedImpression=!0,e.builder.trackImpression(n.id,e.renderedVariantId,void 0,{content:n}))}e.props.contentLoaded&&e.props.contentLoaded(n&&n.data,n)}),(function(t){e.props.contentError&&(e.props.contentError(t),e.setState({loading:!1}))})))},BuilderContent.prototype.componentWillUnmount=function(){sdk.Builder.isEditing&&removeEventListener("message",this.onWindowMessage),this.subscriptions.unsubscribe(),this.intersectionObserver&&this.ref&&this.intersectionObserver.unobserve(this.ref)},BuilderContent.prototype.render=function(){var e=this;if(this.props.dataOnly)return null;var t=this.state.loading,n=this.data,r=this.props.dataOnly?NoWrap:"div";return React__default.default.createElement(VariantsProvider,{initialContent:n},(function(i,a){return React__default.default.createElement(React__default.default.Fragment,null,i.map((function(o,s){var l=s===i.length-1?React__default.default.Fragment:"template";return React__default.default.createElement(React__default.default.Fragment,{key:String((null==o?void 0:o.id)+s)},"template"!==l&&(null==a?void 0:a()),React__default.default.createElement(l,__assign({key:String((null==o?void 0:o.id)+s)},"template"===l&&{"data-template-variant-id":null==o?void 0:o.id}),React__default.default.createElement(r,__assign({},0===s&&!e.props.dataOnly&&{ref:function(t){return e.ref=t}},{className:"builder-content",onClick:e.onClick,"builder-content-id":null==o?void 0:o.id,"builder-model":e.name}),e.props.children(null==o?void 0:o.data,!e.props.inline&&t,n))))})))}))},BuilderContent}(React__default.default.Component),getContentWithInfo=function(e){var t;if(e){var n=sdk.builder.getCookie("builder.tests.".concat(e.id)),r=n===e.id?e:null===(t=e.variations)||void 0===t?void 0:t[n],i=(null==r?void 0:r.name)||((null==r?void 0:r.id)===e.id?"Default variation":"");return __assign(__assign({},e),{variationId:n,testVariationId:n,testVariationName:i})}return null};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var onChange_1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Symbol("target"),r=Symbol("unsubscribe"),i=function(e,t){return t&&t.toString&&(e&&(e+="."),e+=t.toString()),e},a=function(e){return Array.isArray(e)?e.slice():Object.assign({},e)},o=function(e,t,o){if("undefined"==typeof Proxy)return e;void 0===o&&(o={});var s,l,u=Symbol("ProxyTarget"),c=!1,d=!1,p=!1,f=o.equals||Object.is,v=new WeakMap,m=new WeakMap,h=new WeakMap,g=function(e,n,r,o){if(!p)if(c){if(c&&l&&void 0!==r&&void 0!==o&&"length"!==n){var u=l;e!==s&&function(e,t){for(var n;e;)-1===(n=e.indexOf("."))&&(n=e.length),t(e.slice(0,n)),e=e.slice(n+1)}(e=e.replace(s,"").slice(1),(function(e){u[e]=a(u[e]),u=u[e]})),u[n]=r}d=!0}else t(i(e,n),o,r)},b=function(e,t){var n=v?v.get(e):void 0;n&&n.delete(t)},_=function(e,t){if(p)return e;m.set(e,t);var n=h.get(e);return void 0===n&&(n=new Proxy(e,k),h.set(e,n)),n},y=function(e){return p||!0===o.ignoreSymbols&&"symbol"==typeof e},k={get:function(e,t,a){if(t===u||t===n)return e;if(t===r&&""===m.get(e))return function(e){return p=!0,v=null,m=null,h=null,e}(e);var s=Reflect.get(e,t,a);if(function(e){return null===e||"object"!=typeof e&&"function"!=typeof e}(s)||function(e){return e instanceof RegExp||e instanceof Number}(s)||"constructor"===t||!0===o.isShallow)return s;var l=function(e,t){var n=v?v.get(e):void 0;if(n)return n;n=new Map,v.set(e,n);var r=n.get(t);return r||(r=Reflect.getOwnPropertyDescriptor(e,t),n.set(t,r)),r}(e,t);if(l&&!l.configurable){if(l.set&&!l.get)return;if(!1===l.writable)return s}return _(s,i(m.get(e),t))},set:function(e,t,n,r){n&&void 0!==n[u]&&(n=n[u]);var i=y(t),a=i?null:Reflect.get(e,t,r),o=Reflect.set(e[u]||e,t,n);return i||f(a,n)||g(m.get(e),t,a,n),o},defineProperty:function(e,t,n){var r=Reflect.defineProperty(e,t,n);return y(t)||(b(e,t),g(m.get(e),t,void 0,n.value)),r},deleteProperty:function(e,t){if(!Reflect.has(e,t))return!0;var n=y(t),r=n?null:Reflect.get(e,t),i=Reflect.deleteProperty(e,t);return n||(b(e,t),g(m.get(e),t,r)),i},apply:function(e,t,n){var r=t instanceof Date;if(r&&(t=t[u]),!c){c=!0,r&&(l=t.valueOf()),(Array.isArray(t)||"[object Object]"===toString.call(t))&&(l=a(t[u])),s=(s=m.get(e)).slice(0,Math.max(s.lastIndexOf("."),0));var i=Reflect.apply(e,t,n);return c=!1,(d||r&&!f(l,t.valueOf()))&&(g(s,"",l,t[u]||t),l=null,d=!1),i}return Reflect.apply(e,t,n)}},B=_(e,"");return t=t.bind(B),B};o.target=function(e){return e[n]||e},o.unsubscribe=function(e){return e[r]||e},e.exports=o,t.default=o})),onChange=unwrapExports(onChange_1),nextTick=sdk.Builder.nextTick;function debounceNextTick(e,t,n){return void 0===t&&"function"==typeof e?debounceNextTickImpl(e):{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,t,{configurable:!0,enumerable:n.enumerable,value:debounceNextTickImpl(n.value)}),this[t]}}}function debounceNextTickImpl(e){var t=null,n=null;return function(){var e=t;if(t=[].slice.call(arguments),n=this,null!==e)return;nextTick(r)};function r(){e.apply(n,t),t=null,n=null}}function throttle(e,t,n){var r,i,a;void 0===n&&(n={});var o=null,s=0,l=function(){s=!1===n.leading?0:Date.now(),o=null,a=e.apply(r,i),o||(r=i=null)};return function(){var u=Date.now();s||!1!==n.leading||(s=u);var c=t-(u-s);return r=this,i=arguments,c<=0||c>t?(o&&(clearTimeout(o),o=null),s=u,a=e.apply(r,i),o||(r=i=null)):o||!1===n.trailing||(o=setTimeout(l,c)),a}}var BuilderMetaContext=React__default.default.createContext({emailMode:!1,ampMode:!1,isServer:!1}),tryEval=function(e,t,n){void 0===t&&(t={});var r=e;if("string"==typeof r&&r.trim()){var i=!(r.includes(";")||r.includes(" return ")),a=function(){};try{sdk.Builder.isBrowser&&(a=new Function("state","var rootState = state;\n if (typeof Proxy !== 'undefined') {\n rootState = new Proxy(rootState, {\n set: function () {\n return false;\n },\n get: function (target, key) {\n if (key === 'state') {\n return state;\n }\n return target[key]\n }\n });\n }\n with (rootState) {\n ".concat(i?"return (".concat(e,");"):e,";\n }")))}catch(e){sdk.Builder.isBrowser&&console.warn("Could not compile javascript",e)}try{if(sdk.Builder.isBrowser)return a(t||{});var o=safeDynamicRequire("isolated-vm"),s=getIsolateContext(),l=makeFn(e,i,["state"]),u=s.evalClosureSync(l,[new o.Reference(t||{})]);try{return JSON.parse(u)}catch(e){return u}}catch(t){n&&n.push(t),sdk.Builder.isBrowser?console.warn("Builder custom code error:",t.message,"in",e,t.stack):isDebug()&&console.debug("Builder custom code error:",t.message,"in",e,t.stack)}}};function toError(e){return e instanceof Error?e:new Error(String(e))}function getBuilderPixel(e){return{id:"builder-pixel-"+Math.random().toString(36).split(".")[1],"@type":"@builder.io/sdk:Element",tagName:"img",properties:{role:"presentation","aria-hidden":"true",src:"https://cdn.builder.io/api/v1/pixel?apiKey=".concat(e)},responsiveStyles:{large:{height:"0",width:"0",display:"inline-block",opacity:"0",overflow:"hidden",pointerEvents:"none"}}}}function pick(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r={};return t.forEach((function(t){r[t]=e[t]})),r}function omit(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=__assign({},e);return t.forEach((function(e){delete r[e]})),r}var instancesMap=new Map,wrapComponent=function(e){return function(t){var n,r=t.builderTag||"div",i=["children"].concat((null===(n=e.inputs)||void 0===n?void 0:n.map((function(e){return e.name})))||[]),a=omit.apply(void 0,__spreadArray(__spreadArray([t],i,!1),["attributes"],!1)),o=t;return e.noWrap?React__default.default.createElement(e.class,__assign({attributes:a},o)):React__default.default.createElement(r,__assign({},a),React__default.default.createElement(e.class,__assign({},o)))}},size=function(e){return Object.keys(e).length};function debounce(e,t,n){var r;return void 0===n&&(n=!1),function(){var i=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,n||e.apply(i,a)}),t),n&&!r&&e.apply(i,a)}}var fontsLoaded=new Set,fetch;globalThis.fetch&&(fetch=globalThis.fetch),null!=fetch||(fetch=require("node-fetch"));var sizeMap={desktop:"large",tablet:"medium",mobile:"small"},fetchCache={};function searchToObject(e){var t=(e.search||"").substring(1).split("&"),n={};for(var r in t)if(t[r]&&"string"==typeof t[r]){var i=t[r].split("=");n[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return n}var BuilderComponent=function(e){function t(t){var n,r,i=this;(i=e.call(this,t)||this).subscriptions=new sdk.Subscription,i.onStateChange=new sdk.BehaviorSubject(null),i.asServer=sdk.Builder.isServer,i.contentRef=null,i.styleRef=null,i.rootState=sdk.Builder.isServer?{}:onChange({},(function(){return i.updateState()})),i.lastJsCode="",i.lastHttpRequests={},i.httpSubscriptionPerKey={},i.firstLoad=!0,i.ref=null,i.messageListener=function(e){var t,n=e.data;switch(n.type){case"builder.configureSdk":var r=n.data;if(!r.contentId||r.contentId!==(null===(t=i.useContent)||void 0===t?void 0:t.id))return;i.sizes=getSizesForBreakpoints(r.breakpoints||{}),i.setState({state:Object.assign(i.rootState,{deviceSize:i.deviceSizeState,device:i.device}),updates:(i.state&&i.state.updates||0)+1,breakpoints:r.breakpoints});break;case"builder.updateSpacer":var a=n.data;i.rootState._spacer,i.updateState((function(e){e._spacer=a}));break;case"builder.resetState":var o=n.data,s=o.state;if(o.model===i.name){for(var l in i.rootState)"function"!=typeof i.rootState[l]&&delete i.rootState[l];Object.assign(i.rootState,s),i.setState(__assign(__assign({},i.state),{state:i.rootState,updates:(i.state&&i.state.updates||0)+1}))}break;case"builder.resetSymbolState":var u=n.data.state,c=(s=u.state,u.model,u.id);if(i.props.builderBlock&&i.props.builderBlock===c){for(var l in i.rootState)delete i.rootState[l];Object.assign(i.rootState,s),i.setState(__assign(__assign({},i.state),{state:i.rootState,updates:(i.state&&i.state.updates||0)+1}))}}},i.resizeFn=function(){var e=i.deviceSizeState;e!==i.state.state.deviceSize&&i.setState(__assign(__assign({},i.state),{updates:(i.state&&i.state.updates||0)+1,state:Object.assign(i.rootState,__assign(__assign({},i.state.state),{deviceSize:e}))}))},i.resizeListener=sdk.Builder.isEditing?throttle(i.resizeFn,200):debounce(i.resizeFn,400),i.mounted=!1,i.updateState=function(e){var t=i.rootState;e&&e(t),i.mounted?i.setState({update:i.updateState,state:t,updates:(i.state&&i.state.updates||0)+1}):i.state=__assign(__assign({},i.state),{update:i.updateState,state:t,updates:(i.state&&i.state.updates||0)+1}),i.notifyStateChange()},i.onContentLoaded=function(e,t){if("page"===i.name&&sdk.Builder.isBrowser&&e){var n=e.title,r=e.pageTitle,a=e.description,o=e.pageDescription;if((n||r)&&(document.title=n||r),a||o){var s=document.querySelector('meta[name="description"]');s||((s=document.createElement("meta")).setAttribute("name","description"),document.head.appendChild(s)),s.setAttribute("content",a||o)}}if(sdk.Builder.isEditing&&i.notifyStateChange(),i.props.contentLoaded&&i.props.contentLoaded(e,t),e&&e.inputs&&Array.isArray(e.inputs)&&e.inputs.length&&(e.state||(e.state={}),e.inputs.forEach((function(t){t&&t.name&&void 0!==t.defaultValue&&void 0===e.state[t.name]&&(e.state[t.name]=t.defaultValue)}))),e&&e.state){var l=__assign(__assign({},i.state),{updates:(i.state&&i.state.updates||0)+1,state:Object.assign(i.rootState,__assign(__assign(__assign(__assign({},i.state.state),{location:i.locationState,deviceSize:i.deviceSizeState,device:i.device}),e.state),i.externalState))});i.mounted?i.setState(l):i.state=l}if(e&&e.jsCode&&sdk.Builder.isBrowser&&!i.options.codegen){var u=!1;if(sdk.Builder.isEditing&&(i.lastJsCode===e.jsCode?u=!0:i.lastJsCode=e.jsCode),!u){var c=i.state.state;try{new Function("data","ref","state","update","element","Builder","builder","context",e.jsCode)(e,i,c,i.state.update,i.ref,sdk.Builder,sdk.builder,i.state.context)}catch(t){var d=toError(t);sdk.Builder.isBrowser?console.warn("Builder custom code error:",d.message,"in",e.jsCode,d.stack):isDebug()&&console.debug("Builder custom code error:",d.message,"in",e.jsCode,d.stack)}}}if(e&&e.httpRequests&&!i.props.noAsync&&!(u=!1)){var p=function(t){var n=e.httpRequests[t];if(n&&(!i.data[t]||sdk.Builder.isEditing))if(sdk.Builder.isBrowser){var r=i.evalExpression(n);if(sdk.Builder.isEditing&&i.lastHttpRequests[t]===r)return"continue";i.lastHttpRequests[t]=r;var a=n.match(/builder\.io\/api\/v2\/([^\/\?]+)/i);a&&a[1],i.handleRequest(t,r);var o=i.httpSubscriptionPerKey[t];o&&o.unsubscribe();var s=i.httpSubscriptionPerKey[t]=i.onStateChange.subscribe((function(){var e=i.evalExpression(n);e!==r&&(i.handleRequest(t,e),i.lastHttpRequests[t]=e)}));i.subscriptions.add(s)}else i.handleRequest(t,i.evalExpression(n))};for(var f in e.httpRequests)p(f)}};var a=i.inlinedContent;a&&a.content&&(a=a.content),i.sizes=getSizesForBreakpoints((null===(n=null==a?void 0:a.meta)||void 0===n?void 0:n.breakpoints)||{});var o=null===(r=i.inlinedContent)||void 0===r?void 0:r.data;if(o&&Array.isArray(o.inputs)&&o.inputs.length>0&&(o.state||(o.state={}),o.inputs.forEach((function(e){e&&e.name&&void 0!==e.defaultValue&&void 0===o.state[e.name]&&(o.state[e.name]=e.defaultValue)}))),i.state={context:__assign(__assign({},t.context),{apiKey:i.props.apiKey||sdk.builder.apiKey}),state:Object.assign(i.rootState,__assign(__assign(__assign(__assign({},i.inlinedContent&&i.inlinedContent.data&&i.inlinedContent.data.state),{isBrowser:sdk.Builder.isBrowser,isServer:!sdk.Builder.isBrowser,_hydrate:t.hydrate,location:i.locationState,deviceSize:i.deviceSizeState,device:i.device}),i.getHtmlData()),t.data)),updates:0,key:0,update:i.updateState},sdk.Builder.isBrowser){var s=i.props.apiKey;if(s&&s!==i.builder.apiKey&&!instancesMap.has(s)){var l=new sdk.Builder(s,void 0,void 0,!0);instancesMap.set(s,l)}if(i.inlinedContent){var u=i.inlinedContent.content||i.inlinedContent;i.onContentLoaded(null==u?void 0:u.data,getContentWithInfo(u))}}return i.registerCustomComponents(),i}return __extends(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return __assign(__assign({},t.defaults),this.props)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.props.model||this.props.modelName||this.props.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.ref},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inlinedContent",{get:function(){if(!this.isPreviewing||this.props.inlineContent)return this.props.content},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"builder",{get:function(){return this.props.apiKey&&instancesMap.get(this.props.apiKey)||this.props.builder||sdk.builder},enumerable:!1,configurable:!0}),t.prototype.getHtmlData=function(){var e=this.inlinedContent&&this.inlinedContent.id||this.props.entry,t=e&&sdk.Builder.isBrowser&&document.querySelector('script[data-builder-json="'.concat(e,'"],script[data-builder-state="').concat(e,'"]'));if(t)try{return JSON.parse(t.innerText)}catch(e){console.warn("Could not parse Builder.io HTML data transfer",e,t.innerText)}return{}},Object.defineProperty(t.prototype,"device",{get:function(){return this.builder.getUserAttributes().device||"desktop"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locationState",{get:function(){return __assign(__assign({},pick(this.location,"pathname","hostname","search","host")),{path:this.location.pathname&&this.location.pathname.split("/").slice(1)||"",query:searchToObject(this.location)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceSizeState",{get:function(){return sdk.Builder.isBrowser?this.sizes.getSizeForWidth(window.innerWidth):sizeMap[this.device]||"large"},enumerable:!1,configurable:!0}),t.renderInto=function(e,n,r,i){if(void 0===n&&(n={}),void 0===r&&(r=!0),void 0===i&&(i=!1),console.debug("BuilderPage.renderInto",e,n,r,this),e){var a=null;if("string"==typeof e?a=document.querySelector(e):e instanceof Element&&(a=e),a){var o=a.classList.contains("builder-hydrated");if(!o||i){a.classList.add("builder-hydrated");var s=r&&a.innerHTML.includes("builder-block");if(!a.classList.contains("builder-component")){var l=a.querySelector(".builder-api-styles")||(a.previousElementSibling&&a.previousElementSibling.matches(".builder-api-styles")?a.previousElementSibling:null),u="";if(l)l.innerHTML.replace(/\/\*start:([^\*]+?)\*\/([\s\S]*?)\/\*end:([^\*]+?)\*\//g,(function(e,t,n){var r=null;try{r=document.querySelector('[data-emotion-css="'.concat(t,'"]'))}catch(e){console.warn(e)}return r?r.innerHTML=n:sdk.Builder.isEditing||(u+=e),e})),sdk.Builder.nextTick((function(){l.innerHTML=u}));var c=a.querySelector(".builder-component");c?a=c:s=!1}location.search.includes("builder.debug=true")&&console.debug("hydrate",s,a);var d=a;if(!o){var p=document.createElement("div");a.insertAdjacentElement("beforebegin",p),p.appendChild(a),d=p}if((sdk.Builder.isEditing||sdk.Builder.isBrowser&&location.search.includes("builder.preview="))&&(s=!1),s&&a){var f=ReactDOM__default.default.render(React__default.default.createElement(t,__assign({},n)),d,d.builderRootRef);return d.builderRootRef=f,f}var v=ReactDOM__default.default.render(React__default.default.createElement(t,__assign({},n)),d,d.builderRootRef);return d.builderRootRef=v,v}console.debug("Tried to hydrate multiple times")}}},t.prototype.registerCustomComponents=function(){if(this.props.customComponents)for(var e=0,t=this.props.customComponents;e<t.length;e++){var n=t[e];if(n){var r=n.component,i=__rest(n,["component"]);sdk.Builder.registerComponent(r,i)}}},t.prototype.componentDidMount=function(){var e,t=this;this.mounted=!0,this.asServer&&(this.asServer=!1,this.updateState((function(e){e.isBrowser=!0,e.isServer=!1}))),sdk.Builder.isIframe&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.sdkInjected",data:{modelName:this.name}},"*")),sdk.Builder.isBrowser&&(window.addEventListener("resize",this.resizeListener),sdk.Builder.isEditing&&window.addEventListener("message",this.messageListener),(sdk.Builder.isEditing||sdk.Builder.isPreviewing)&&sdk.Builder.nextTick((function(){t.firstLoad=!1,t.reload()})),setTimeout((function(){window.dispatchEvent(new CustomEvent("builder:component:load",{detail:{ref:t}}))})))},Object.defineProperty(t.prototype,"isPreviewing",{get:function(){return(sdk.Builder.isServer||sdk.Builder.isBrowser&&sdk.Builder.isPreviewing&&!this.firstLoad)&&sdk.builder.previewingModel===this.name},enumerable:!1,configurable:!0}),t.prototype.notifyStateChange=function(){if(!sdk.Builder.isServer&&this&&this.state){var e=this.state.state;this.props.onStateChange&&this.props.onStateChange(e),sdk.Builder.isBrowser&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:e,ref:this}})),this.onStateChange.next(e)}},t.prototype.processStateFromApi=function(e){return e},Object.defineProperty(t.prototype,"location",{get:function(){return this.props.location||(sdk.Builder.isBrowser?location:{})},enumerable:!1,configurable:!0}),t.prototype.getCssFromFont=function(e,t){var n=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),r=n.split(",")[0],i=e.fileUrl?e.fileUrl:e.files&&e.files.regular,a="";if(i&&n&&r&&(a+='\n@font-face {\n font-family: "'.concat(n,'";\n src: local("').concat(r,"\"), url('").concat(i,"') format('woff2');\n font-display: fallback;\n font-weight: 400;\n}\n ").trim()),e.files)for(var o in e.files){if(String(Number(o))===o){var s=e.files[o];s&&s!==i&&(a+='\n@font-face {\n font-family: "'.concat(n,"\";\n src: url('").concat(s,"') format('woff2');\n font-display: fallback;\n font-weight: ").concat(o,";\n}\n ").trim())}}return a},t.prototype.componentWillUnmount=function(){this.unsubscribe(),sdk.Builder.isBrowser&&(window.removeEventListener("resize",this.resizeListener),window.removeEventListener("message",this.messageListener))},t.prototype.getFontCss=function(e){var t=this;return this.builder.allowCustomFonts&&(null==e?void 0:e.customFonts)&&e.customFonts.length&&e.customFonts.map((function(n){return t.getCssFromFont(n,e)})).join(" ")||""},t.prototype.ensureFontsLoaded=function(e){if(this.builder.allowCustomFonts&&(null==e?void 0:e.customFonts)&&Array.isArray(e.customFonts))for(var t=0,n=e.customFonts;t<n.length;t++){var r=n[t],i=r.fileUrl?r.fileUrl:r.files&&r.files.regular;if(!fontsLoaded.has(i)){var a=this.getCssFromFont(r,e);if(fontsLoaded.add(i),!a)continue;var o=document.createElement("style");o.className="builder-custom-font",o.setAttribute("data-builder-custom-font",i),o.innerHTML=a,document.head.appendChild(o)}}},t.prototype.getCss=function(e){var t,n=null===(t=this.useContent)||void 0===t?void 0:t.id,r=(null==e?void 0:e.cssCode)||"";return n&&(r=r.replace(/&/g,".builder-component-".concat(n))),r+this.getFontCss(e)},Object.defineProperty(t.prototype,"data",{get:function(){var e,t=__assign(__assign(__assign({},this.inlinedContent&&(null===(e=this.inlinedContent.data)||void 0===e?void 0:e.state)),this.externalState),this.state.state);return Object.assign(this.rootState,t),t},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(e){var t=this;this.props.data&&e.data!==this.props.data&&this.state.update((function(e){Object.assign(e,t.externalState)})),this.props.customComponents&&this.props.customComponents!==e.customComponents&&this.registerCustomComponents(),sdk.Builder.isEditing&&this.inlinedContent&&e.content!==this.inlinedContent&&this.onContentLoaded(this.inlinedContent.data,this.inlinedContent)},t.prototype.checkStyles=function(e){if(this.styleRef){var t=this.getCss(e);this.styleRef.innerHTML!==t&&(this.styleRef.innerHTML=t)}},t.prototype.reload=function(){this.setState({key:this.state.key+1})},Object.defineProperty(t.prototype,"content",{get:function(){var e=this.inlinedContent;return e&&e.content&&(e=__assign(__assign({},e),{data:e.content})),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"externalState",{get:function(){return __assign(__assign({},this.props.data),this.props.locale?{locale:this.props.locale}:{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useContent",{get:function(){return this.content||this.state.context.builderContent},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e,t=this,n=this.content,r=sdk.Builder.isBrowser&&this.externalState&&size(this.externalState)&&hash__default.default(this.externalState),i=sdk.Builder.isEditing?this.name:this.props.entry;i&&!sdk.Builder.isEditing&&r&&r.length<300&&(i+=":"+r);var a=this.props.dataOnly?React__default.default.Fragment:"div",o=null===(e=this.useContent)||void 0===e?void 0:e.id;return React__default.default.createElement(a,{onClick:function(e){!sdk.Builder.isEditing||t.props.isChild||t.props.stopClickPropagationWhenEditing||e.stopPropagation()},className:"builder-component ".concat(o?"builder-component-".concat(o):""),"data-name":this.name,"data-source":"Rendered by Builder.io",key:this.state.key,ref:function(e){return t.ref=e}},React__default.default.createElement(BuilderMetaContext.Consumer,null,(function(e){return React__default.default.createElement(BuilderMetaContext.Provider,{value:"boolean"==typeof t.props.ampMode?__assign(__assign({},e),{ampMode:t.props.ampMode}):e},React__default.default.createElement(BuilderAsyncRequestsContext.Consumer,null,(function(e){var r;return t._asyncRequests=e&&e.requests,t._errors=e&&e.errors,t._logs=e&&e.logs,React__default.default.createElement(BuilderContent,{isStatic:t.props.isStatic||sdk.Builder.isStatic,key:(null===(r=t.inlinedContent)||void 0===r?void 0:r.id)||("content"in t.props&&!t.isPreviewing?"null-content-prop":"no-content-prop"),builder:t.builder,ref:function(e){return t.contentRef=e},contentLoaded:function(e,n){return t.onContentLoaded(e,n)},options:__assign(__assign(__assign(__assign(__assign(__assign({key:i,entry:t.props.entry},n&&{initialContent:[n]}),!n&&"content"in t.props&&!t.isPreviewing&&{initialContent:[]}),t.props.url&&{url:t.props.url}),t.props.options),t.props.locale?{locale:t.props.locale}:{}),t.options.codegen&&{format:"react"}),inline:t.props.inlineContent||!t.isPreviewing&&"content"in t.props,contentError:t.props.contentError,modelName:t.name||"page"},(function(e,n,r){var i;if(t.props.dataOnly)return null;r&&r.id&&(t.state.breakpoints&&(r.meta=r.meta||{},r.meta.breakpoints=t.state.breakpoints),t.state.context.builderContent=r),sdk.Builder.isBrowser&&sdk.Builder.nextTick((function(){t.checkStyles(e)}));var a=t.options.codegen;if(a&&!t.Component&&(null==e?void 0:e.blocksJs)){var o=Array.from(new Set(sdk.Builder.components.map((function(e){return e.name})))),s=sdk.Builder.components.slice().reverse(),l=o.map((function(e){return s.find((function(t){return t.class&&t.name===e}))})),u=o.map((function(e){return(e||"").replace(/[^\w]+/gi,"")})),c=l.map((function(e){return wrapComponent(e)}));t.Component=(new(Function.bind.apply(Function,__spreadArray(__spreadArray([void 0,"jsx","_css","Builder","builder","React","useBuilderState"],u,!1),[e.blocksJs],!1)))).apply(void 0,__spreadArray([core.jsx,core.css,sdk.Builder,sdk.builder,React__default.default,function(e){var t=React__default.default.useState(0)[1];return React__default.default.useState((function(){return onChange(e,(function(){t((function(e){return e+1}))}))}))[0]}],c,!1))}var d=(null==e?void 0:e.blocks)||[],p=d.find((function(e){var t;return null===(t=e.id)||void 0===t?void 0:t.startsWith("builder-pixel")}));return e&&!p&&d.length>0&&d.push(getBuilderPixel(sdk.builder.apiKey)),e?React__default.default.createElement("div",__assign({"data-builder-component":t.name,"data-builder-content-id":r.id},t.isPreviewing?{"data-builder-variation-id":r.testVariationId||r.variationId||r.id}:{}),!a&&t.getCss(e)&&React__default.default.createElement("style",{ref:function(e){return t.styleRef=e},className:"builder-custom-styles",dangerouslySetInnerHTML:{__html:t.getCss(e)}}),React__default.default.createElement(BuilderStoreContext.Provider,{value:__assign(__assign({},t.state),{rootState:t.rootState,state:t.data,content:r,renderLink:t.props.renderLink})},a&&t.Component?React__default.default.createElement(t.Component,{data:t.data,context:t.state.context}):React__default.default.createElement(BuilderBlocks,{key:String(!!(null===(i=null==e?void 0:e.blocks)||void 0===i?void 0:i.length)),emailMode:t.props.emailMode,fieldName:"blocks",blocks:d}))):n?React__default.default.createElement("div",{"data-builder-component":t.name,className:"builder-loading"},t.props.children):React__default.default.createElement("div",{"data-builder-component":t.name,className:"builder-no-content"})}))})))})))},t.prototype.evalExpression=function(e){var t=this,n=this.data;return String(e).replace(/{{([^}]+)}}/g,(function(e,r){return tryEval(r,n,t._errors)}))},t.prototype.handleRequest=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,r,i,a,o=this;return __generator(this,(function(s){return sdk.Builder.isIframe&&fetchCache[t]?(this.updateState((function(n){n[e]=fetchCache[t]})),[2,fetchCache[t]]):(n=function(){return __awaiter(o,void 0,void 0,(function(){var n,r,i,a;return __generator(this,(function(o){switch(o.label){case 0:n=Date.now(),sdk.Builder.isBrowser||console.time("Fetch "+t),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,fetch(t)];case 2:return[4,o.sent().json()];case 3:return r=o.sent(),[3,6];case 4:return i=o.sent(),a=toError(i),this._errors&&this._errors.push(a),this._logs&&this._logs.push("Fetch to ".concat(t," errored in ").concat(Date.now()-n,"ms")),[2];case 5:return sdk.Builder.isBrowser||(console.timeEnd("Fetch "+t),this._logs&&this._logs.push("Fetched ".concat(t," in ").concat(Date.now()-n,"ms"))),[7];case 6:return r&&(sdk.Builder.isIframe&&(fetchCache[t]=r),this.updateState((function(t){t[e]=r}))),[2,r]}}))}))},(r=this._asyncRequests&&this._asyncRequests.find((function(e){return isRequestInfo(e)&&e.url===t})))?((i=r.promise).then((function(t){t&&o.updateState((function(n){n[e]=t}))})),[2,i]):(a=n(),sdk.Builder.nextTick((function(){o._asyncRequests&&o._asyncRequests.push(a)})),[2,a]))}))}))},t.prototype.unsubscribe=function(){this.subscriptions&&(this.subscriptions.unsubscribe(),this.subscriptions=new sdk.Subscription)},t.prototype.handleBuilderRequest=function(e,t){var n=this,r=tryEval(t,this.data,this._errors);this.subscriptions&&this.unsubscribe(),r&&this.subscriptions.add(this.builder.queueGetContent(r.model,r).subscribe((function(t){t&&n.updateState((function(n){n[e]=t}))})))},t.defaults={codegen:Boolean(sdk.Builder.isBrowser&&location.href.includes("builder.codegen=true"))},__decorate([debounceNextTick,__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],t.prototype,"notifyStateChange",null),t}(React__default.default.Component),withChildren=function(e){var t=React__default.default.forwardRef((function(t,n){var r=t.children||t.builderBlock&&t.builderBlock.children&&t.builderBlock.children.map((function(e){return React__default.default.createElement(BuilderBlock,{key:e.id,block:e})}));return React__default.default.createElement(e,__assign({},t,{ref:n}),r)}));return t.builderOptions={canHaveChildren:!0},t};function useIsPreviewing(){var e=React.useState(!1),t=e[0],n=e[1];return React.useEffect((function(){(sdk.Builder.isEditing||sdk.Builder.isPreviewing)&&n(!0)}),[]),t}sdk.Builder.isReact=!0,Object.defineProperty(exports,"Builder",{enumerable:!0,get:function(){return sdk.Builder}}),Object.defineProperty(exports,"builder",{enumerable:!0,get:function(){return sdk.builder}}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return sdk.builder}}),exports.BuilderAsyncRequestsContext=BuilderAsyncRequestsContext,exports.BuilderBlockComponent=BuilderBlock,exports.BuilderBlocks=BuilderBlocks,exports.BuilderComponent=BuilderComponent,exports.BuilderContent=BuilderContent,exports.BuilderMetaContext=BuilderMetaContext,exports.BuilderPage=BuilderComponent,exports.BuilderStoreContext=BuilderStoreContext,exports.stringToFunction=stringToFunction,exports.useIsPreviewing=useIsPreviewing,exports.withChildren=withChildren; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var sdk=require("@builder.io/sdk"),core=require("@emotion/core"),React=require("react"),ReactDOM=require("react-dom"),hash=require("hash-sum");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var React__default=_interopDefaultLegacy(React),React__namespace=_interopNamespace(React),ReactDOM__default=_interopDefaultLegacy(ReactDOM),hash__default=_interopDefaultLegacy(hash),version="3.0.14-0",_a;"undefined"!=typeof window&&(null===(_a=window.parent)||void 0===_a||_a.postMessage({type:"builder.isReactSdk",data:{value:!0,supportsPatchUpdates:"v4",supportsCustomBreakpoints:!0,supportsGlobalSymbols:!0,priorVersion:version}},"*"));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function __rest(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function __decorate(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var fastClone=function(e){return JSON.parse(JSON.stringify(e))},sizeNames=["xsmall","small","medium","large"],sizes={xsmall:{min:0,default:0,max:0},small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200},getWidthForSize:function(e){return this[e].default},getSizeForWidth:function(e){for(var t=0,n=sizeNames;t<n.length;t++){var r=n[t];if(e<=this[r].max)return r}return"large"}},getSizesForBreakpoints=function(e){var t=e.small,n=e.medium,r=__assign(__assign({},sizes),fastClone(sizes));if(!t||!n)return r;var i=Math.floor(t/2);r.small={max:t,min:i,default:i+1};var a=r.small.max+1;r.medium={max:n,min:a,default:a+1};var o=r.medium.max+1;return r.large={max:2e3,min:o,default:o+1},r},set=function(e,t,n){if(Object(e)!==e)return e;var r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((function(e,t,n){return Object(e[t])===e[t]?e[t]:e[t]=Math.abs(Number(r[n+1]))>>0==+r[n+1]?[]:{}}),e)[r[r.length-1]]=n,e},noop=function(){return null},safeDynamicRequire;if("function"==typeof(null===globalThis||void 0===globalThis?void 0:globalThis.require)||sdk.Builder.isServer&&"function"==typeof require)try{safeDynamicRequire=eval("require")}catch(e){safeDynamicRequire=(null===globalThis||void 0===globalThis?void 0:globalThis.require)?globalThis.require:noop}function isDebug(){return Boolean("undefined"!=typeof process&&void 0!==process.env&&process.env.DEBUG)}null!=safeDynamicRequire||(safeDynamicRequire=noop);var fnCache={},api=function(e){return sdk.builder};function stringToFunction(e,t,n,r){if(void 0===t&&(t=!0),!e||!e.trim())return function(){};var i=e+":"+t;if(fnCache[i])return fnCache[i];var a=t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))||e.trim().startsWith("builder.run"),o=function(){};try{sdk.Builder.isBrowser&&(o=new Function("state","event","block","builder","Device","update","Builder","context","\n var names = [\n 'state',\n 'event',\n 'block',\n 'builder',\n 'Device',\n 'update',\n 'Builder',\n 'context'\n ];\n var rootState = state;\n if (typeof Proxy !== 'undefined') {\n rootState = new Proxy(rootState, {\n set: function () {\n return false;\n },\n get: function (target, key) {\n if (names.includes(key)) {\n return undefined;\n }\n return target[key];\n }\n });\n }\n /* Alias */\n var ctx = context;\n var log = console.log.bind(console);\n with (rootState) {\n ".concat(a?"return (".concat(e,");"):e,";\n }\n ")))}catch(t){n&&n.push(t);var s=t&&t.message;s&&"string"==typeof s&&r&&-1===r.indexOf(s)&&r.push(s),sdk.Builder.isBrowser&&console.warn("Function compile error in ".concat(e),t)}var l=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if(sdk.Builder.isBrowser)return o.apply(void 0,t);var i=getIsolateContext(),s=safeDynamicRequire("isolated-vm"),l=i.evalClosureSync(makeFn(e,a),t.map((function(e,t){return"object"==typeof e?new s.Reference(t===indexOfBuilderInstance?__assign(__assign({},e),{getUserAttributes:function(){return e.getUserAttributes("")}}):e):null})));try{var u=JSON.parse(l);return u}catch(e){return l}}catch(t){return sdk.Builder.isBrowser?console.warn("Builder custom code error:",t.message||t,"in",e,t.stack||t):isDebug()&&console.debug("Builder custom code error:",t.message||t,"in",e,t.stack||t),n&&n.push(t),null}};return sdk.Builder.isBrowser&&(fnCache[i]=l),l}var indexOfBuilderInstance=3,makeFn=function(e,t,n){var r=n||["state","event","block","builder","Device","update","Builder","context"];return"\n".concat("\n var refToProxy = (obj) => {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n return new Proxy({}, {\n get(target, key) {\n if (key === 'copySync') {\n return () => obj.copySync();\n }\n const val = obj.getSync(key);\n if (typeof val?.getSync === 'function') {\n return refToProxy(val);\n }\n return val;\n },\n set(target, key, value) {\n obj.setSync(key, value);\n },\n deleteProperty(target, key) {\n obj.deleteSync(key);\n }\n })\n }\n","\n").concat("\n var stringify = (val) => {\n if (typeof val === 'object' && val !== null) {\n return JSON.stringify(val.copySync ? val.copySync() : val);\n }\n return val;\n }\n ","\n").concat(r.map((function(e,t){return"var ".concat(e," = refToProxy($").concat(t,");")})).join("\n")).concat("\n".concat(r.includes("context")?"var ctx = context;":"","\n").concat(t?"return stringify(".concat(e,");"):e,";\n"))},getIsolateContext=function(){var e=sdk.Builder.serverContext;e||(e=new(safeDynamicRequire("isolated-vm").Isolate)({memoryLimit:128}).createContextSync(),sdk.Builder.setServerContext(e));var t=e.global;return t.setSync("global",t.derefInto()),t.setSync("log",(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];isDebug()&&console.log.apply(console,e)})),e},isPromise=function(e){return"function"==typeof e.then},isRequestInfo=function(e){return!isPromise(e)},BuilderAsyncRequestsContext=React__default.default.createContext({requests:[],errors:[],logs:[]}),BuilderStoreContext=React__default.default.createContext({state:{},rootState:{},content:{},context:{},update:function(e){return null}}),applyPatchWithMinimalMutationChain=function(e,t,n){if(void 0===n&&(n=!1),Object(e)!==e)return e;var r=t.path,i=t.op,a=t.value,o=r.split(/\//);""===o[0]&&o.shift();for(var s=n?e:__assign({},e),l=s,u=0;u<o.length;u++){var c=u===o.length-1,d=o[u];if(c){if("replace"===i)l[d]=a;else if("add"===i){var p=Number(d);Array.isArray(l)?"-"===d?l.push(a):l.splice(p,0,a):l[d]=a}else if("remove"===i){p=Number(d);Array.isArray(l)?l.splice(p,1):delete l[d]}}else{var f=o[u+1],v=Object(l[d])===l[d]?l[d]:String(Number(f))===f?[]:{};l=l[d]=Array.isArray(v)?__spreadArray([],v,!0):__assign({},v)}}return s},htmlEscape=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},blockToHtmlString=function(e){var t;return"<".concat(htmlEscape(e.tagName||"div"),' \n class="builder-block ').concat(e.id," ").concat(e.class||"",'"\n builder-id="').concat(e.id,'"\n ').concat(Object.keys(e.properties||{}).map((function(t){return"".concat(htmlEscape(t),'="').concat(htmlEscape(e.properties[t]),'"')})).join(" "),"\n >").concat("Text"===(null===(t=null==e?void 0:e.component)||void 0===t?void 0:t.name)?e.component.options.text:e.children?e.children.map((function(e){return blockToHtmlString(e)})).join(""):"","</").concat(e.tagName||"div",">").replace(/\s+/g," ")},Link=function(e){return React__default.default.createElement(BuilderStoreContext.Consumer,null,(function(t){return t.renderLink?t.renderLink(e):React__default.default.createElement("a",__assign({},e))}))},camelCaseToKebabCase=function(e){return e?e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())})):""},kebabCaseToCamelCase=function(e){return void 0===e&&(e=""),e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))},Device={desktop:0,tablet:1,mobile:2},voidElements=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","textarea"]),last=function(e){return e[e.length-1]};function omit$1(e,t){for(var n=Object.assign({},e),r=0,i=t;r<i.length;r++){delete n[i[r]]}return n}var cssCase=function(e){if(!e)return e;var t=camelCaseToKebabCase(e);return e[0]===e[0].toUpperCase()&&(t="-"+t),t};function capitalize(e){if(e)return e[0].toUpperCase()+e.slice(1)}var BuilderBlock=function(_super){function BuilderBlock(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.state={hasError:!1,updates:0},_this.privateState={state:{},rootState:{},context:{},update:function(){}},_this.onWindowMessage=function(event){var message=event.data;if(message)switch(message.type){case"builder.selectionChange":var data=message.data;if(!data)break;var selection=data.selection,id=_this.block&&_this.block.id;id&&Array.isArray(selection)&&selection.indexOf(id)>-1&&setTimeout((function(){window.$block=_this,window.$blocks||(window.$blocks=[]),window.$blocks.push(_this)}));break;case"builder.patchUpdates":var data=message.data;if(!data||!data.data)break;var patches=data.data[_this.block.id];if(!patches)return;location.href.includes("builder.debug=true")&&eval("debugger");for(var _i=0,patches_1=patches;_i<patches_1.length;_i++){var patch=patches_1[_i];applyPatchWithMinimalMutationChain(_this.props.block,patch,!0)}_this.setState({updates:_this.state.updates+1})}},_this}return __extends(BuilderBlock,_super),Object.defineProperty(BuilderBlock.prototype,"store",{get:function(){return this.privateState},enumerable:!1,configurable:!0}),BuilderBlock.getDerivedStateFromError=function(e){return{hasError:!0}},BuilderBlock.prototype.componentDidCatch=function(e,t){console.error("Builder block error:",e,t)},BuilderBlock.prototype.stringToFunction=function(e,t){return void 0===t&&(t=!0),stringToFunction(e,t,this._errors,this._logs)},Object.defineProperty(BuilderBlock.prototype,"block",{get:function(){return this.props.block},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderBlock.prototype,"emotionCss",{get:function(){var e,t,n,r,i,a=this.block;if(sdk.Builder.isServer){var o=a.animations&&a.animations[0];if(o&&"hover"!==o.trigger){var s=o&&o.steps&&o.steps[0],l=s&&s.styles;l&&(i=l)}}var u=sizeNames.slice().reverse(),c=this.block,d={};if(c.responsiveStyles)for(var p=0,f=u;p<f.length;p++){var v=f[p];if("large"===v)this.props.emailMode||(d["&.builder-block"]=Object.assign({},c.responsiveStyles[v],i));else{var m=getSizesForBreakpoints((null===(t=null===(e=this.privateState.context.builderContent)||void 0===e?void 0:e.meta)||void 0===t?void 0:t.breakpoints)||{});d["@media only screen and (max-width: ".concat(m[v].max,"px)")]={"&.builder-block":c.responsiveStyles[v]}}}var h=a.animations&&a.animations.find((function(e){return"hover"===e.trigger}));return h&&(d[":hover"]=(null===(r=null===(n=h.steps)||void 0===n?void 0:n[1])||void 0===r?void 0:r.styles)||{},d.transition="all ".concat(h.duration,"s ").concat(camelCaseToKebabCase(h.easing)),h.delay&&(d.transitionDelay=h.delay+"s")),d},enumerable:!1,configurable:!0}),BuilderBlock.prototype.eval=function(e){return this.stringToFunction(e)(this.privateState.state,void 0,this.block,sdk.builder,Device,this.privateState.update,sdk.Builder,this.privateState.context)},BuilderBlock.prototype.componentWillUnmount=function(){sdk.Builder.isEditing&&removeEventListener("message",this.onWindowMessage)},BuilderBlock.prototype.componentDidMount=function(){var e,t=this,n=this.block,r=n&&n.animations;if(sdk.Builder.isEditing&&addEventListener("message",this.onWindowMessage),r){var i={animations:fastClone(r)};if(n.bindings)for(var a in n.bindings)if((null===(e=a.trim)||void 0===e?void 0:e.call(a))&&a.startsWith("animations.")){var o=this.stringToFunction(n.bindings[a]);void 0!==o&&set(i,a,o(this.privateState.state,null,n,sdk.builder,null,null,sdk.Builder,this.privateState.context))}sdk.Builder.animator.bindAnimations(i.animations.filter((function(e){return"hover"!==e.trigger})).map((function(e){return __assign(__assign({},e),{elementId:t.block.id})})))}},BuilderBlock.prototype.getElement=function(e,t){var n,r,i,a,o,s=this;void 0===e&&(e=0),void 0===t&&(t=this.privateState.state);var l=this.props;l.child,l.fieldName;var u,c=this.block,d=(c.tagName||"div").toLowerCase();if("template"===d){var p=c.children?c.children.map((function(e){return blockToHtmlString(e)})).join(" "):"";return console.debug("template html",p),core.jsx("template",__assign({},c.properties,{dangerouslySetInnerHTML:{__html:p}}))}var f=c.component&&(c.component.name||c.component.component),v=null;c.component&&!c.component.class&&(c.component&&c.component.tag?u=c.component.tag:(v=sdk.Builder.components.find((function(e){return e.name===f}))||null)&&v.class?u=v.class:v&&v.tag?u=v.tag:(null==f?void 0:f.startsWith("Builder:"))?console.warn("Missing @builder.io/widgets installation, please install and import @builder.io/widgets to use ".concat(f.split(":")[1]," in your content, more info here: https://github.com/BuilderIO/builder/tree/main/packages/widgets")):f&&console.warn("Missing registration for ".concat(f,", have you included the registration in your bundle?")));var m=__assign(__assign({},c.properties),{style:{}});if(m=__assign(__assign({},m.properties),m),c.component&&(m.component=fastClone(c.component)),c.bindings)for(var h in c.bindings)if(null===(r=h.trim)||void 0===r?void 0:r.call(h)){var g=this.stringToFunction(c.bindings[h]);set(m,h,g(t,null,c,api(),Device,null,sdk.Builder,this.privateState.context))}if(m.hide)return null;if(delete m.hide,("show"in m||c.bindings&&c.bindings.show)&&!m.show)return null;if(delete m.show,c.actions){var b=function(e){if(!(null===(i=e.trim)||void 0===i?void 0:i.call(e)))return"continue";var n=c.actions[e];m["on"+capitalize(e)]=function(e){var r=t;return"undefined"!=typeof Proxy&&(r=new Proxy(t,{set:function(e,t,n){return e[t]=n,s.privateState.rootState[t]=n,!0}})),s.stringToFunction(n,!1)(r,e,s.block,sdk.builder,Device,s.privateState.update,sdk.Builder,s.privateState.context)}};for(var h in c.actions)b(h)}var _=(m.component||m.options)&&__assign(__assign({},m.options),m.component.options||m.component.data),y=voidElements.has(d),k=v&&(v.fragment||v.noWrap),B=(null===(a=m.attr)||void 0===a?void 0:a.style)||("string"==typeof m.style?m.style:"")||"";if("string"==typeof B){"object"!=typeof m.style&&(m.style={});for(var C=0,S=B.split(";");C<S.length;C++){var w=S[C].split(":");if(!w.length)return;h=w[0],g=w[1];h&&(w.length>2&&(g=w.slice(1).join(":")),m.style[kebabCaseToCamelCase(h)]=g)}}var x=__assign(__assign(__assign({},omit$1(m,["class","component","attr"])),((n={})["string"!=typeof d||d.includes("-")?"class":"className"]="builder-block ".concat(this.id).concat(c.class?" ".concat(c.class):"").concat(!c.component||["Image","Video","Banner"].indexOf(f)>-1?"":" builder-has-component")+(m.class?" "+m.class:"")+(sdk.Builder.isEditing&&(null===(o=this.privateState.state._spacer)||void 0===o?void 0:o.parent)===c.id?" builder-spacer-parent":""),n.key=this.id+e,n["builder-id"]=this.id,n)),0!==e&&{"builder-index":e});sdk.Builder.isEditing&&(x["builder-inline-styles"]=m.attr&&m.attr.style?Object.keys(m.style).reduce((function(e,t){return(e?"".concat(e,";"):"")+"".concat(cssCase(t),":").concat(m.style[t],";")}),""):""),(x.properties&&x.properties.href||x.href)&&"div"===d&&(d="a"),"a"===d&&(d=Link);var E=c.children||x.children||[];return core.jsx(React__default.default.Fragment,null,core.jsx(core.ClassNames,null,(function(e){var t=e.css;if(e.cx,!s.props.emailMode){var n=" "+t(s.emotionCss);x.class&&(x.class+=n),x.className&&(x.className+=n)}return core.jsx(BuilderAsyncRequestsContext.Consumer,null,(function(e){return s._asyncRequests=e&&e.requests,s._errors=e&&e.errors,s._logs=e&&e.logs,y?core.jsx(d,__assign({},x)):u&&(k||s.props.emailMode)?core.jsx(u,__assign({},_,{attributes:x,builderBlock:c,builderState:s.privateState})):core.jsx(d,__assign({},x),u&&core.jsx(u,__assign({builderState:s.privateState,builderBlock:c},_)),c.text||m.text?m.text:!u&&E&&Array.isArray(E)&&E.length?E.map((function(e,t){return core.jsx(BuilderBlock,{key:(s.id||"")+t,block:e,index:t,size:s.props.size,fieldName:s.props.fieldName,child:s.props.child,emailMode:s.props.emailMode})})):null)}))})))},Object.defineProperty(BuilderBlock.prototype,"id",{get:function(){var e=this.block;return e.id.startsWith("builder")?e.id:"builder-"+e.id},enumerable:!1,configurable:!0}),BuilderBlock.prototype.contents=function(e){var t=this,n=this.block;if(this.privateState=e,n.repeat&&n.repeat.collection){var r=n.repeat.collection,i=last((r||"").trim().split("(")[0].trim().split(".")),a=n.repeat.itemName||(i?i+"Item":"item"),o=this.stringToFunction(r)(e.state,null,n,api(),Device,null,sdk.Builder,this.privateState.context);return Array.isArray(o)?o.map((function(n,r){var i,o=__assign(__assign({},e.state),((i={$index:r,$item:n})[a]=n,i["$".concat(a,"Index")]=r,i));return core.jsx(BuilderStoreContext.Provider,{key:r,value:__assign(__assign({},e),{state:o})},t.getElement(r,o))})):null}return this.getElement()},BuilderBlock.prototype.render=function(){var e=this;return this.state.hasError?core.jsx("span",{css:{display:"inline-block",padding:5,color:"#999",fontSize:11,fontStyle:"italic"}},"Builder block error :( Check console for details"):core.jsx(BuilderStoreContext.Consumer,null,(function(t){return e.contents(t)}))},BuilderBlock}(React__default.default.Component),BuilderBlocks=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClickEmptyBlocks=function(){var e;sdk.Builder.isIframe&&t.noBlocks&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:t.parentId,dataPath:t.path}},"*"))},t.onHoverEmptyBlocks=function(){var e;sdk.Builder.isEditing&&t.noBlocks&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:t.parentId,dataPath:t.path}},"*"))},t}return __extends(t,e),Object.defineProperty(t.prototype,"isRoot",{get:function(){return!this.props.child},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noBlocks",{get:function(){var e=this.props.blocks;return!(e&&e.length)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){var e=this.props.dataPath||"";return e.trim()&&(e.startsWith("this.")?e=e.replace("this.",""):e.startsWith("component.options.")||(e="component.options."+e)),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.props.parentElementId?this.props.parentElementId:this.props.parent&&this.props.parent.id},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props.blocks,n=this.props.emailMode?"span":"div";return core.jsx(n,__assign({className:"builder-blocks"+(this.noBlocks?" no-blocks":"")+(this.props.child?" builder-blocks-child":"")+(this.props.className?" "+this.props.className:""),"builder-type":"blocks","builder-path":sdk.Builder.isIframe?this.path:void 0,"builder-parent-id":this.parentId,css:__assign(__assign({},!this.props.emailMode&&{display:"flex",flexDirection:"column",alignItems:"stretch"}),this.props.style),onClick:function(){e.noBlocks&&e.onClickEmptyBlocks()}},sdk.Builder.isEditing&&{onMouseEnter:function(){return e.onHoverEmptyBlocks()}}),t&&Array.isArray(t)&&t.map((function(t,n){return t&&"@builder.io/sdk:Element"===t["@type"]?core.jsx(BuilderBlock,{key:t.id,block:t,index:n,fieldName:e.props.fieldName,child:e.props.child,emailMode:e.props.emailMode}):t}))||t)},t.renderInto=function(e,n,r){if(void 0===n&&(n={}),e){var i=null;return"string"==typeof e?i=document.querySelector(e):e instanceof Element&&(i=e),ReactDOM__default.default.render(core.jsx(BuilderStoreContext.Provider,{value:r},core.jsx(t,__assign({},n))),i)}},t}(React__default.default.Component),NoWrap=function(e){return e.children};function getData(e){if(void 0!==(null==e?void 0:e.data)){var t=e.data,n=t.blocks,r=t.blocksString,i=Array.isArray(n)||"string"==typeof r,a=__assign(__assign({},e.data),i&&{blocks:n||JSON.parse(r)});return delete a.blocksString,a}}var variantsScript=function(e,t){return"\n(function() {\n if (window.builderNoTrack || !navigator.cookieEnabled) {\n return;\n }\n\n var variants = ".concat(e,";\n function removeVariants() {\n variants.forEach(function (template) {\n document.querySelector('template[data-template-variant-id=\"' + template.id + '\"]').remove();\n });\n document.getElementById('variants-script-").concat(t,'\').remove();\n }\n\n if (typeof document.createElement("template").content === \'undefined\') {\n removeVariants();\n return ;\n }\n\n function setCookie(name,value,days) {\n var expires = "";\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days*24*60*60*1000));\n expires = "; expires=" + date.toUTCString();\n }\n document.cookie = name + "=" + (value || "") + expires + "; path=/" + "; Secure; SameSite=None";\n }\n\n function getCookie(name) {\n var nameEQ = name + "=";\n var ca = document.cookie.split(\';\');\n for(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==\' \') c = c.substring(1,c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);\n }\n return null;\n }\n var cookieName = \'builder.tests.').concat(t,"';\n var variantInCookie = getCookie(cookieName);\n var availableIDs = variants.map(function(vr) { return vr.id }).concat('").concat(t,"');\n var variantId;\n if (availableIDs.indexOf(variantInCookie) > -1) {\n variantId = variantInCookie;\n }\n if (!variantId) {\n var n = 0;\n var random = Math.random();\n for (var i = 0; i < variants.length; i++) {\n var variant = variants[i];\n var testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n variantId = variant.id;\n break;\n }\n }\n if (!variantId) {\n variantId = \"").concat(t,'";\n setCookie(cookieName, "').concat(t,'");\n }\n }\n if (variantId && variantId !== "').concat(t,"\") {\n var winningTemplate = document.querySelector('template[data-template-variant-id=\"' + variantId + '\"]');\n if (winningTemplate) {\n var parentNode = winningTemplate.parentNode;\n var newParent = parentNode.cloneNode(false);\n newParent.appendChild(winningTemplate.content.firstChild);\n parentNode.parentNode.replaceChild(newParent, parentNode);\n }\n } else if (variants.length > 0) {\n removeVariants();\n }\n})()").replace(/\s+/g," ")},VariantsProvider=function(e){var t=e.initialContent,n=e.children;if(sdk.Builder.isBrowser&&!sdk.builder.canTrack)return n([t]);if(!Boolean(Object.keys((null==t?void 0:t.variations)||{}).length))return n([t]);var r=Object.keys(t.variations).map((function(e){return __assign(__assign({id:e},t.variations[e]),{data:getData(t.variations[e])})})),i=__spreadArray(__spreadArray([],r,!0),[t],!1);if(sdk.Builder.isServer){var a=JSON.stringify(Object.keys(t.variations||{}).map((function(e){return{id:e,testRatio:t.variations[e].testRatio}})));return React__namespace.createElement(React__namespace.Fragment,null,n(i,(function(){return React__namespace.createElement("script",{id:"variants-script-".concat(t.id),dangerouslySetInnerHTML:{__html:variantsScript(a,t.id)}})})))}var o="builder.tests.".concat(t.id),s=sdk.builder.getCookie(o);if(!s&&sdk.Builder.isBrowser)for(var l=0,u=Math.random(),c=0;c<r.length;c++){var d=r[c];if(u<(l+=d.testRatio)){sdk.builder.setCookie(o,d.id),s=d.id;break}}return s||(s=t.id,sdk.builder.setCookie(o,s)),n([i.find((function(e){return e.id===s}))])},BuilderContent=function(_super){function BuilderContent(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.ref=null,_this.state={loading:!_this.props.content,data:getContentWithInfo(_this.props.content),updates:1},_this.onWindowMessage=function(event){var _a,_b,message=event.data;if(message)switch(message.type){case"builder.patchUpdates":if(null===(_a=_this.props.options)||void 0===_a?void 0:_a.noEditorUpdates)return;var data=message.data;if(!data||!data.data)break;var patches=data.data[null===(_b=_this.state.data)||void 0===_b?void 0:_b.id];if(!patches||!patches.length)return;location.href.includes("builder.debug=true")&&eval("debugger");for(var newData=_this.state.data,_i=0,patches_1=patches;_i<patches_1.length;_i++){var patch=patches_1[_i];newData=applyPatchWithMinimalMutationChain(newData,patch,!1)}_this.setState({updates:_this.state.updates+1,data:newData}),_this.props.contentLoaded&&_this.props.contentLoaded(newData.data,newData)}},_this.subscriptions=new sdk.Subscription,_this.firstLoad=!0,_this.clicked=!1,_this.trackedImpression=!1,_this.intersectionObserver=null,_this.onClick=function(e){var t=e.nativeEvent,n=_this.data;n&&(sdk.builder.autoTrack&&_this.builder.trackInteraction(n.id,_this.renderedVariantId,_this.clicked,t,{content:n}),_this.clicked||(_this.clicked=!0))},_this}return __extends(BuilderContent,_super),Object.defineProperty(BuilderContent.prototype,"builder",{get:function(){return this.props.builder||sdk.builder},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"name",{get:function(){var e=this.props;return"model"in e?e.model:e.modelName},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"renderedVariantId",{get:function(){var e,t,n=this.props.isStatic?this.builder.getCookie("builder.tests.".concat(null===(e=this.data)||void 0===e?void 0:e.id)):null===(t=this.data)||void 0===t?void 0:t.variationId;if(null!==n)return n},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"options",{get:function(){var e,t,n=__assign({},this.props.options||{});return n.key||!(null===(e=this.props.content)||void 0===e?void 0:e.id)||sdk.Builder.isEditing||sdk.Builder.isPreviewing||(n.key=this.props.content.id),!this.props.content||(null===(t=n.initialContent)||void 0===t?void 0:t.length)||!this.props.inline&&sdk.Builder.isPreviewing||(n.initialContent=[this.props.content]),n},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"data",{get:function(){var e=(this.props.inline||!sdk.Builder.isBrowser||this.firstLoad)&&this.options.initialContent&&this.options.initialContent[0]||this.state.data;return getContentWithInfo(e)},enumerable:!1,configurable:!0}),BuilderContent.prototype.componentDidMount=function(){var e,t;if(!this.props.inline||sdk.Builder.isEditing||sdk.Builder.isPreviewing)this.subscribeToContent();else if(this.props.inline&&(null===(t=null===(e=this.options)||void 0===e?void 0:e.initialContent)||void 0===t?void 0:t.length)){var n=this.options.initialContent[0];(null==n?void 0:n.id)&&this.builder.trackImpression(n.id,this.renderedVariantId,void 0,{content:n})}sdk.Builder.isEditing&&addEventListener("message",this.onWindowMessage)},BuilderContent.prototype.subscribeToContent=function(){var e=this;"_inline"!==this.name&&this.subscriptions.add(this.builder.queueGetContent(this.name,this.options).subscribe((function(t){var n=t&&t[0];e.setState({data:n,loading:!1});var r=(e.builder.editingModel||e.builder.previewingModel)===e.name;if(!e.props.inline&&e.props.content&&e.firstLoad&&r&&(e.firstLoad=!1,e.subscriptions.unsubscribe(),e.subscribeToContent()),n&&e.firstLoad&&(e.firstLoad=!1,sdk.builder.autoTrack&&!sdk.Builder.isEditing)){var i=!1;if("function"==typeof IntersectionObserver&&e.ref)try{(e.intersectionObserver=new IntersectionObserver((function(t,r){t.forEach((function(t){t.intersectionRatio>0&&!e.trackedImpression&&(e.builder.trackImpression(n.id,e.renderedVariantId,void 0,{content:e.data}),e.data,e.trackedImpression=!0,e.ref&&r.unobserve(e.ref))}))}))).observe(e.ref),i=!0}catch(e){console.warn("Could not bind intersection observer")}i||(e.trackedImpression=!0,e.builder.trackImpression(n.id,e.renderedVariantId,void 0,{content:n}))}e.props.contentLoaded&&e.props.contentLoaded(n&&n.data,n)}),(function(t){e.props.contentError&&(e.props.contentError(t),e.setState({loading:!1}))})))},BuilderContent.prototype.componentWillUnmount=function(){sdk.Builder.isEditing&&removeEventListener("message",this.onWindowMessage),this.subscriptions.unsubscribe(),this.intersectionObserver&&this.ref&&this.intersectionObserver.unobserve(this.ref)},BuilderContent.prototype.render=function(){var e=this;if(this.props.dataOnly)return null;var t=this.state.loading,n=this.data,r=this.props.dataOnly?NoWrap:"div";return React__default.default.createElement(VariantsProvider,{initialContent:n},(function(i,a){return React__default.default.createElement(React__default.default.Fragment,null,i.map((function(o,s){var l=s===i.length-1?React__default.default.Fragment:"template";return React__default.default.createElement(React__default.default.Fragment,{key:String((null==o?void 0:o.id)+s)},"template"!==l&&(null==a?void 0:a()),React__default.default.createElement(l,__assign({key:String((null==o?void 0:o.id)+s)},"template"===l&&{"data-template-variant-id":null==o?void 0:o.id}),React__default.default.createElement(r,__assign({},0===s&&!e.props.dataOnly&&{ref:function(t){return e.ref=t}},{className:"builder-content",onClick:e.onClick,"builder-content-id":null==o?void 0:o.id,"builder-model":e.name}),e.props.children(null==o?void 0:o.data,!e.props.inline&&t,n))))})))}))},BuilderContent}(React__default.default.Component),getContentWithInfo=function(e){var t;if(e){var n=sdk.builder.getCookie("builder.tests.".concat(e.id)),r=n===e.id?e:null===(t=e.variations)||void 0===t?void 0:t[n],i=(null==r?void 0:r.name)||((null==r?void 0:r.id)===e.id?"Default variation":"");return __assign(__assign({},e),{variationId:n,testVariationId:n,testVariationName:i})}return null};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var onChange_1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Symbol("target"),r=Symbol("unsubscribe"),i=function(e,t){return t&&t.toString&&(e&&(e+="."),e+=t.toString()),e},a=function(e){return Array.isArray(e)?e.slice():Object.assign({},e)},o=function(e,t,o){if("undefined"==typeof Proxy)return e;void 0===o&&(o={});var s,l,u=Symbol("ProxyTarget"),c=!1,d=!1,p=!1,f=o.equals||Object.is,v=new WeakMap,m=new WeakMap,h=new WeakMap,g=function(e,n,r,o){if(!p)if(c){if(c&&l&&void 0!==r&&void 0!==o&&"length"!==n){var u=l;e!==s&&function(e,t){for(var n;e;)-1===(n=e.indexOf("."))&&(n=e.length),t(e.slice(0,n)),e=e.slice(n+1)}(e=e.replace(s,"").slice(1),(function(e){u[e]=a(u[e]),u=u[e]})),u[n]=r}d=!0}else t(i(e,n),o,r)},b=function(e,t){var n=v?v.get(e):void 0;n&&n.delete(t)},_=function(e,t){if(p)return e;m.set(e,t);var n=h.get(e);return void 0===n&&(n=new Proxy(e,k),h.set(e,n)),n},y=function(e){return p||!0===o.ignoreSymbols&&"symbol"==typeof e},k={get:function(e,t,a){if(t===u||t===n)return e;if(t===r&&""===m.get(e))return function(e){return p=!0,v=null,m=null,h=null,e}(e);var s=Reflect.get(e,t,a);if(function(e){return null===e||"object"!=typeof e&&"function"!=typeof e}(s)||function(e){return e instanceof RegExp||e instanceof Number}(s)||"constructor"===t||!0===o.isShallow)return s;var l=function(e,t){var n=v?v.get(e):void 0;if(n)return n;n=new Map,v.set(e,n);var r=n.get(t);return r||(r=Reflect.getOwnPropertyDescriptor(e,t),n.set(t,r)),r}(e,t);if(l&&!l.configurable){if(l.set&&!l.get)return;if(!1===l.writable)return s}return _(s,i(m.get(e),t))},set:function(e,t,n,r){n&&void 0!==n[u]&&(n=n[u]);var i=y(t),a=i?null:Reflect.get(e,t,r),o=Reflect.set(e[u]||e,t,n);return i||f(a,n)||g(m.get(e),t,a,n),o},defineProperty:function(e,t,n){var r=Reflect.defineProperty(e,t,n);return y(t)||(b(e,t),g(m.get(e),t,void 0,n.value)),r},deleteProperty:function(e,t){if(!Reflect.has(e,t))return!0;var n=y(t),r=n?null:Reflect.get(e,t),i=Reflect.deleteProperty(e,t);return n||(b(e,t),g(m.get(e),t,r)),i},apply:function(e,t,n){var r=t instanceof Date;if(r&&(t=t[u]),!c){c=!0,r&&(l=t.valueOf()),(Array.isArray(t)||"[object Object]"===toString.call(t))&&(l=a(t[u])),s=(s=m.get(e)).slice(0,Math.max(s.lastIndexOf("."),0));var i=Reflect.apply(e,t,n);return c=!1,(d||r&&!f(l,t.valueOf()))&&(g(s,"",l,t[u]||t),l=null,d=!1),i}return Reflect.apply(e,t,n)}},B=_(e,"");return t=t.bind(B),B};o.target=function(e){return e[n]||e},o.unsubscribe=function(e){return e[r]||e},e.exports=o,t.default=o})),onChange=unwrapExports(onChange_1),nextTick=sdk.Builder.nextTick;function debounceNextTick(e,t,n){return void 0===t&&"function"==typeof e?debounceNextTickImpl(e):{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,t,{configurable:!0,enumerable:n.enumerable,value:debounceNextTickImpl(n.value)}),this[t]}}}function debounceNextTickImpl(e){var t=null,n=null;return function(){var e=t;if(t=[].slice.call(arguments),n=this,null!==e)return;nextTick(r)};function r(){e.apply(n,t),t=null,n=null}}function throttle(e,t,n){var r,i,a;void 0===n&&(n={});var o=null,s=0,l=function(){s=!1===n.leading?0:Date.now(),o=null,a=e.apply(r,i),o||(r=i=null)};return function(){var u=Date.now();s||!1!==n.leading||(s=u);var c=t-(u-s);return r=this,i=arguments,c<=0||c>t?(o&&(clearTimeout(o),o=null),s=u,a=e.apply(r,i),o||(r=i=null)):o||!1===n.trailing||(o=setTimeout(l,c)),a}}var BuilderMetaContext=React__default.default.createContext({emailMode:!1,ampMode:!1,isServer:!1}),tryEval=function(e,t,n){void 0===t&&(t={});var r=e;if("string"==typeof r&&r.trim()){var i=!(r.includes(";")||r.includes(" return ")),a=function(){};try{sdk.Builder.isBrowser&&(a=new Function("state","var rootState = state;\n if (typeof Proxy !== 'undefined') {\n rootState = new Proxy(rootState, {\n set: function () {\n return false;\n },\n get: function (target, key) {\n if (key === 'state') {\n return state;\n }\n return target[key]\n }\n });\n }\n with (rootState) {\n ".concat(i?"return (".concat(e,");"):e,";\n }")))}catch(e){sdk.Builder.isBrowser&&console.warn("Could not compile javascript",e)}try{if(sdk.Builder.isBrowser)return a(t||{});var o=safeDynamicRequire("isolated-vm"),s=getIsolateContext(),l=makeFn(e,i,["state"]),u=s.evalClosureSync(l,[new o.Reference(t||{})]);try{return JSON.parse(u)}catch(e){return u}}catch(t){n&&n.push(t),sdk.Builder.isBrowser?console.warn("Builder custom code error:",t.message,"in",e,t.stack):isDebug()&&console.debug("Builder custom code error:",t.message,"in",e,t.stack)}}};function toError(e){return e instanceof Error?e:new Error(String(e))}function getBuilderPixel(e){return{id:"builder-pixel-"+Math.random().toString(36).split(".")[1],"@type":"@builder.io/sdk:Element",tagName:"img",properties:{role:"presentation","aria-hidden":"true",src:"https://cdn.builder.io/api/v1/pixel?apiKey=".concat(e)},responsiveStyles:{large:{height:"0",width:"0",display:"inline-block",opacity:"0",overflow:"hidden",pointerEvents:"none"}}}}function pick(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r={};return t.forEach((function(t){r[t]=e[t]})),r}function omit(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=__assign({},e);return t.forEach((function(e){delete r[e]})),r}var instancesMap=new Map,wrapComponent=function(e){return function(t){var n,r=t.builderTag||"div",i=["children"].concat((null===(n=e.inputs)||void 0===n?void 0:n.map((function(e){return e.name})))||[]),a=omit.apply(void 0,__spreadArray(__spreadArray([t],i,!1),["attributes"],!1)),o=t;return e.noWrap?React__default.default.createElement(e.class,__assign({attributes:a},o)):React__default.default.createElement(r,__assign({},a),React__default.default.createElement(e.class,__assign({},o)))}},size=function(e){return Object.keys(e).length};function debounce(e,t,n){var r;return void 0===n&&(n=!1),function(){var i=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,n||e.apply(i,a)}),t),n&&!r&&e.apply(i,a)}}var fontsLoaded=new Set,fetch;globalThis.fetch&&(fetch=globalThis.fetch),null!=fetch||(fetch=require("node-fetch"));var sizeMap={desktop:"large",tablet:"medium",mobile:"small"},fetchCache={};function searchToObject(e){var t=(e.search||"").substring(1).split("&"),n={};for(var r in t)if(t[r]&&"string"==typeof t[r]){var i=t[r].split("=");n[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return n}var BuilderComponent=function(e){function t(t){var n,r,i=this;(i=e.call(this,t)||this).subscriptions=new sdk.Subscription,i.onStateChange=new sdk.BehaviorSubject(null),i.asServer=sdk.Builder.isServer,i.contentRef=null,i.styleRef=null,i.rootState=sdk.Builder.isServer?{}:onChange({},(function(){return i.updateState()})),i.lastJsCode="",i.lastHttpRequests={},i.httpSubscriptionPerKey={},i.firstLoad=!0,i.ref=null,i.messageListener=function(e){var t,n=e.data;switch(n.type){case"builder.configureSdk":var r=n.data;if(!r.contentId||r.contentId!==(null===(t=i.useContent)||void 0===t?void 0:t.id))return;i.sizes=getSizesForBreakpoints(r.breakpoints||{}),i.setState({state:Object.assign(i.rootState,{deviceSize:i.deviceSizeState,device:i.device}),updates:(i.state&&i.state.updates||0)+1,breakpoints:r.breakpoints});break;case"builder.updateSpacer":var a=n.data;i.rootState._spacer,i.updateState((function(e){e._spacer=a}));break;case"builder.resetState":var o=n.data,s=o.state;if(o.model===i.name){for(var l in i.rootState)"function"!=typeof i.rootState[l]&&delete i.rootState[l];Object.assign(i.rootState,s),i.setState(__assign(__assign({},i.state),{state:i.rootState,updates:(i.state&&i.state.updates||0)+1}))}break;case"builder.resetSymbolState":var u=n.data.state,c=(s=u.state,u.model,u.id);if(i.props.builderBlock&&i.props.builderBlock===c){for(var l in i.rootState)delete i.rootState[l];Object.assign(i.rootState,s),i.setState(__assign(__assign({},i.state),{state:i.rootState,updates:(i.state&&i.state.updates||0)+1}))}}},i.resizeFn=function(){var e=i.deviceSizeState;e!==i.state.state.deviceSize&&i.setState(__assign(__assign({},i.state),{updates:(i.state&&i.state.updates||0)+1,state:Object.assign(i.rootState,__assign(__assign({},i.state.state),{deviceSize:e}))}))},i.resizeListener=sdk.Builder.isEditing?throttle(i.resizeFn,200):debounce(i.resizeFn,400),i.mounted=!1,i.updateState=function(e){var t=i.rootState;e&&e(t),i.mounted?i.setState({update:i.updateState,state:t,updates:(i.state&&i.state.updates||0)+1}):i.state=__assign(__assign({},i.state),{update:i.updateState,state:t,updates:(i.state&&i.state.updates||0)+1}),i.notifyStateChange()},i.onContentLoaded=function(e,t){if("page"===i.name&&sdk.Builder.isBrowser&&e){var n=e.title,r=e.pageTitle,a=e.description,o=e.pageDescription;if((n||r)&&(document.title=n||r),a||o){var s=document.querySelector('meta[name="description"]');s||((s=document.createElement("meta")).setAttribute("name","description"),document.head.appendChild(s)),s.setAttribute("content",a||o)}}if(sdk.Builder.isEditing&&i.notifyStateChange(),i.props.contentLoaded&&i.props.contentLoaded(e,t),e&&e.inputs&&Array.isArray(e.inputs)&&e.inputs.length&&(e.state||(e.state={}),e.inputs.forEach((function(t){t&&t.name&&void 0!==t.defaultValue&&void 0===e.state[t.name]&&(e.state[t.name]=t.defaultValue)}))),e&&e.state){var l=__assign(__assign({},i.state),{updates:(i.state&&i.state.updates||0)+1,state:Object.assign(i.rootState,__assign(__assign(__assign(__assign({},i.state.state),{location:i.locationState,deviceSize:i.deviceSizeState,device:i.device}),e.state),i.externalState))});i.mounted?i.setState(l):i.state=l}if(e&&e.jsCode&&sdk.Builder.isBrowser&&!i.options.codegen){var u=!1;if(sdk.Builder.isEditing&&(i.lastJsCode===e.jsCode?u=!0:i.lastJsCode=e.jsCode),!u){var c=i.state.state;try{new Function("data","ref","state","update","element","Builder","builder","context",e.jsCode)(e,i,c,i.state.update,i.ref,sdk.Builder,sdk.builder,i.state.context)}catch(t){var d=toError(t);sdk.Builder.isBrowser?console.warn("Builder custom code error:",d.message,"in",e.jsCode,d.stack):isDebug()&&console.debug("Builder custom code error:",d.message,"in",e.jsCode,d.stack)}}}if(e&&e.httpRequests&&!i.props.noAsync&&!(u=!1)){var p=function(t){var n=e.httpRequests[t];if(n&&(!i.data[t]||sdk.Builder.isEditing))if(sdk.Builder.isBrowser){var r=i.evalExpression(n);if(sdk.Builder.isEditing&&i.lastHttpRequests[t]===r)return"continue";i.lastHttpRequests[t]=r;var a=n.match(/builder\.io\/api\/v2\/([^\/\?]+)/i);a&&a[1],i.handleRequest(t,r);var o=i.httpSubscriptionPerKey[t];o&&o.unsubscribe();var s=i.httpSubscriptionPerKey[t]=i.onStateChange.subscribe((function(){var e=i.evalExpression(n);e!==r&&(i.handleRequest(t,e),i.lastHttpRequests[t]=e)}));i.subscriptions.add(s)}else i.handleRequest(t,i.evalExpression(n))};for(var f in e.httpRequests)p(f)}};var a=i.inlinedContent;a&&a.content&&(a=a.content),i.sizes=getSizesForBreakpoints((null===(n=null==a?void 0:a.meta)||void 0===n?void 0:n.breakpoints)||{});var o=null===(r=i.inlinedContent)||void 0===r?void 0:r.data;if(o&&Array.isArray(o.inputs)&&o.inputs.length>0&&(o.state||(o.state={}),o.inputs.forEach((function(e){e&&e.name&&void 0!==e.defaultValue&&void 0===o.state[e.name]&&(o.state[e.name]=e.defaultValue)}))),i.state={context:__assign(__assign({},t.context),{apiKey:i.props.apiKey||sdk.builder.apiKey}),state:Object.assign(i.rootState,__assign(__assign(__assign(__assign({},i.inlinedContent&&i.inlinedContent.data&&i.inlinedContent.data.state),{isBrowser:sdk.Builder.isBrowser,isServer:!sdk.Builder.isBrowser,_hydrate:t.hydrate,location:i.locationState,deviceSize:i.deviceSizeState,device:i.device}),i.getHtmlData()),t.data)),updates:0,key:0,update:i.updateState},sdk.Builder.isBrowser){var s=i.props.apiKey;if(s&&s!==i.builder.apiKey&&!instancesMap.has(s)){var l=new sdk.Builder(s,void 0,void 0,!0);instancesMap.set(s,l)}if(i.inlinedContent){var u=i.inlinedContent.content||i.inlinedContent;i.onContentLoaded(null==u?void 0:u.data,getContentWithInfo(u))}}return i.registerCustomComponents(),i}return __extends(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return __assign(__assign({},t.defaults),this.props)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.props.model||this.props.modelName||this.props.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.ref},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inlinedContent",{get:function(){if(!this.isPreviewing||this.props.inlineContent)return this.props.content},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"builder",{get:function(){return this.props.apiKey&&instancesMap.get(this.props.apiKey)||this.props.builder||sdk.builder},enumerable:!1,configurable:!0}),t.prototype.getHtmlData=function(){var e=this.inlinedContent&&this.inlinedContent.id||this.props.entry,t=e&&sdk.Builder.isBrowser&&document.querySelector('script[data-builder-json="'.concat(e,'"],script[data-builder-state="').concat(e,'"]'));if(t)try{return JSON.parse(t.innerText)}catch(e){console.warn("Could not parse Builder.io HTML data transfer",e,t.innerText)}return{}},Object.defineProperty(t.prototype,"device",{get:function(){return this.builder.getUserAttributes().device||"desktop"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locationState",{get:function(){return __assign(__assign({},pick(this.location,"pathname","hostname","search","host")),{path:this.location.pathname&&this.location.pathname.split("/").slice(1)||"",query:searchToObject(this.location)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceSizeState",{get:function(){return sdk.Builder.isBrowser?this.sizes.getSizeForWidth(window.innerWidth):sizeMap[this.device]||"large"},enumerable:!1,configurable:!0}),t.renderInto=function(e,n,r,i){if(void 0===n&&(n={}),void 0===r&&(r=!0),void 0===i&&(i=!1),console.debug("BuilderPage.renderInto",e,n,r,this),e){var a=null;if("string"==typeof e?a=document.querySelector(e):e instanceof Element&&(a=e),a){var o=a.classList.contains("builder-hydrated");if(!o||i){a.classList.add("builder-hydrated");var s=r&&a.innerHTML.includes("builder-block");if(!a.classList.contains("builder-component")){var l=a.querySelector(".builder-api-styles")||(a.previousElementSibling&&a.previousElementSibling.matches(".builder-api-styles")?a.previousElementSibling:null),u="";if(l)l.innerHTML.replace(/\/\*start:([^\*]+?)\*\/([\s\S]*?)\/\*end:([^\*]+?)\*\//g,(function(e,t,n){var r=null;try{r=document.querySelector('[data-emotion-css="'.concat(t,'"]'))}catch(e){console.warn(e)}return r?r.innerHTML=n:sdk.Builder.isEditing||(u+=e),e})),sdk.Builder.nextTick((function(){l.innerHTML=u}));var c=a.querySelector(".builder-component");c?a=c:s=!1}location.search.includes("builder.debug=true")&&console.debug("hydrate",s,a);var d=a;if(!o){var p=document.createElement("div");a.insertAdjacentElement("beforebegin",p),p.appendChild(a),d=p}if((sdk.Builder.isEditing||sdk.Builder.isBrowser&&location.search.includes("builder.preview="))&&(s=!1),s&&a){var f=ReactDOM__default.default.render(React__default.default.createElement(t,__assign({},n)),d,d.builderRootRef);return d.builderRootRef=f,f}var v=ReactDOM__default.default.render(React__default.default.createElement(t,__assign({},n)),d,d.builderRootRef);return d.builderRootRef=v,v}console.debug("Tried to hydrate multiple times")}}},t.prototype.registerCustomComponents=function(){if(this.props.customComponents)for(var e=0,t=this.props.customComponents;e<t.length;e++){var n=t[e];if(n){var r=n.component,i=__rest(n,["component"]);sdk.Builder.registerComponent(r,i)}}},t.prototype.componentDidMount=function(){var e,t=this;this.mounted=!0,this.asServer&&(this.asServer=!1,this.updateState((function(e){e.isBrowser=!0,e.isServer=!1}))),sdk.Builder.isIframe&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.sdkInjected",data:{modelName:this.name}},"*")),sdk.Builder.isBrowser&&(window.addEventListener("resize",this.resizeListener),sdk.Builder.isEditing&&window.addEventListener("message",this.messageListener),(sdk.Builder.isEditing||sdk.Builder.isPreviewing)&&sdk.Builder.nextTick((function(){t.firstLoad=!1,t.reload()})),setTimeout((function(){window.dispatchEvent(new CustomEvent("builder:component:load",{detail:{ref:t}}))})))},Object.defineProperty(t.prototype,"isPreviewing",{get:function(){return(sdk.Builder.isServer||sdk.Builder.isBrowser&&sdk.Builder.isPreviewing&&!this.firstLoad)&&sdk.builder.previewingModel===this.name},enumerable:!1,configurable:!0}),t.prototype.notifyStateChange=function(){if(!sdk.Builder.isServer&&this&&this.state){var e=this.state.state;this.props.onStateChange&&this.props.onStateChange(e),sdk.Builder.isBrowser&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:e,ref:this}})),this.onStateChange.next(e)}},t.prototype.processStateFromApi=function(e){return e},Object.defineProperty(t.prototype,"location",{get:function(){return this.props.location||(sdk.Builder.isBrowser?location:{})},enumerable:!1,configurable:!0}),t.prototype.getCssFromFont=function(e,t){var n=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),r=n.split(",")[0],i=e.fileUrl?e.fileUrl:e.files&&e.files.regular,a="";if(i&&n&&r&&(a+='\n@font-face {\n font-family: "'.concat(n,'";\n src: local("').concat(r,"\"), url('").concat(i,"') format('woff2');\n font-display: fallback;\n font-weight: 400;\n}\n ").trim()),e.files)for(var o in e.files){if(String(Number(o))===o){var s=e.files[o];s&&s!==i&&(a+='\n@font-face {\n font-family: "'.concat(n,"\";\n src: url('").concat(s,"') format('woff2');\n font-display: fallback;\n font-weight: ").concat(o,";\n}\n ").trim())}}return a},t.prototype.componentWillUnmount=function(){this.unsubscribe(),sdk.Builder.isBrowser&&(window.removeEventListener("resize",this.resizeListener),window.removeEventListener("message",this.messageListener))},t.prototype.getFontCss=function(e){var t=this;return this.builder.allowCustomFonts&&(null==e?void 0:e.customFonts)&&e.customFonts.length&&e.customFonts.map((function(n){return t.getCssFromFont(n,e)})).join(" ")||""},t.prototype.ensureFontsLoaded=function(e){if(this.builder.allowCustomFonts&&(null==e?void 0:e.customFonts)&&Array.isArray(e.customFonts))for(var t=0,n=e.customFonts;t<n.length;t++){var r=n[t],i=r.fileUrl?r.fileUrl:r.files&&r.files.regular;if(!fontsLoaded.has(i)){var a=this.getCssFromFont(r,e);if(fontsLoaded.add(i),!a)continue;var o=document.createElement("style");o.className="builder-custom-font",o.setAttribute("data-builder-custom-font",i),o.innerHTML=a,document.head.appendChild(o)}}},t.prototype.getCss=function(e){var t,n=null===(t=this.useContent)||void 0===t?void 0:t.id,r=(null==e?void 0:e.cssCode)||"";return n&&(r=r.replace(/&/g,".builder-component-".concat(n))),r+this.getFontCss(e)},Object.defineProperty(t.prototype,"data",{get:function(){var e,t=__assign(__assign(__assign({},this.inlinedContent&&(null===(e=this.inlinedContent.data)||void 0===e?void 0:e.state)),this.externalState),this.state.state);return Object.assign(this.rootState,t),t},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(e){var t=this;this.props.data&&e.data!==this.props.data&&this.state.update((function(e){Object.assign(e,t.externalState)})),this.props.customComponents&&this.props.customComponents!==e.customComponents&&this.registerCustomComponents(),sdk.Builder.isEditing&&this.inlinedContent&&e.content!==this.inlinedContent&&this.onContentLoaded(this.inlinedContent.data,this.inlinedContent)},t.prototype.checkStyles=function(e){if(this.styleRef){var t=this.getCss(e);this.styleRef.innerHTML!==t&&(this.styleRef.innerHTML=t)}},t.prototype.reload=function(){this.setState({key:this.state.key+1})},Object.defineProperty(t.prototype,"content",{get:function(){var e=this.inlinedContent;return e&&e.content&&(e=__assign(__assign({},e),{data:e.content})),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"externalState",{get:function(){return __assign(__assign({},this.props.data),this.props.locale?{locale:this.props.locale}:{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useContent",{get:function(){return this.content||this.state.context.builderContent},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e,t=this,n=this.content,r=sdk.Builder.isBrowser&&this.externalState&&size(this.externalState)&&hash__default.default(this.externalState),i=sdk.Builder.isEditing?this.name:this.props.entry;i&&!sdk.Builder.isEditing&&r&&r.length<300&&(i+=":"+r);var a=this.props.dataOnly?React__default.default.Fragment:"div",o=null===(e=this.useContent)||void 0===e?void 0:e.id;return React__default.default.createElement(a,{onClick:function(e){!sdk.Builder.isEditing||t.props.isChild||t.props.stopClickPropagationWhenEditing||e.stopPropagation()},className:"builder-component ".concat(o?"builder-component-".concat(o):""),"data-name":this.name,"data-source":"Rendered by Builder.io",key:this.state.key,ref:function(e){return t.ref=e}},React__default.default.createElement(BuilderMetaContext.Consumer,null,(function(e){return React__default.default.createElement(BuilderMetaContext.Provider,{value:"boolean"==typeof t.props.ampMode?__assign(__assign({},e),{ampMode:t.props.ampMode}):e},React__default.default.createElement(BuilderAsyncRequestsContext.Consumer,null,(function(e){var r;return t._asyncRequests=e&&e.requests,t._errors=e&&e.errors,t._logs=e&&e.logs,React__default.default.createElement(BuilderContent,{isStatic:t.props.isStatic||sdk.Builder.isStatic,key:(null===(r=t.inlinedContent)||void 0===r?void 0:r.id)||("content"in t.props&&!t.isPreviewing?"null-content-prop":"no-content-prop"),builder:t.builder,ref:function(e){return t.contentRef=e},contentLoaded:function(e,n){return t.onContentLoaded(e,n)},options:__assign(__assign(__assign(__assign(__assign(__assign({key:i,entry:t.props.entry},n&&{initialContent:[n]}),!n&&"content"in t.props&&!t.isPreviewing&&{initialContent:[]}),t.props.url&&{url:t.props.url}),t.props.options),t.props.locale?{locale:t.props.locale}:{}),t.options.codegen&&{format:"react"}),inline:t.props.inlineContent||!t.isPreviewing&&"content"in t.props,contentError:t.props.contentError,modelName:t.name||"page"},(function(e,n,r){var i;if(t.props.dataOnly)return null;r&&r.id&&(t.state.breakpoints&&(r.meta=r.meta||{},r.meta.breakpoints=t.state.breakpoints),t.state.context.builderContent=r),sdk.Builder.isBrowser&&sdk.Builder.nextTick((function(){t.checkStyles(e)}));var a=t.options.codegen;if(a&&!t.Component&&(null==e?void 0:e.blocksJs)){var o=Array.from(new Set(sdk.Builder.components.map((function(e){return e.name})))),s=sdk.Builder.components.slice().reverse(),l=o.map((function(e){return s.find((function(t){return t.class&&t.name===e}))})),u=o.map((function(e){return(e||"").replace(/[^\w]+/gi,"")})),c=l.map((function(e){return wrapComponent(e)}));t.Component=(new(Function.bind.apply(Function,__spreadArray(__spreadArray([void 0,"jsx","_css","Builder","builder","React","useBuilderState"],u,!1),[e.blocksJs],!1)))).apply(void 0,__spreadArray([core.jsx,core.css,sdk.Builder,sdk.builder,React__default.default,function(e){var t=React__default.default.useState(0)[1];return React__default.default.useState((function(){return onChange(e,(function(){t((function(e){return e+1}))}))}))[0]}],c,!1))}var d=(null==e?void 0:e.blocks)||[],p=d.find((function(e){var t;return null===(t=e.id)||void 0===t?void 0:t.startsWith("builder-pixel")}));return e&&!p&&d.length>0&&d.push(getBuilderPixel(sdk.builder.apiKey)),e?React__default.default.createElement("div",__assign({"data-builder-component":t.name,"data-builder-content-id":r.id},t.isPreviewing?{"data-builder-variation-id":r.testVariationId||r.variationId||r.id}:{}),!a&&t.getCss(e)&&React__default.default.createElement("style",{ref:function(e){return t.styleRef=e},className:"builder-custom-styles",dangerouslySetInnerHTML:{__html:t.getCss(e)}}),React__default.default.createElement(BuilderStoreContext.Provider,{value:__assign(__assign({},t.state),{rootState:t.rootState,state:t.data,content:r,renderLink:t.props.renderLink})},a&&t.Component?React__default.default.createElement(t.Component,{data:t.data,context:t.state.context}):React__default.default.createElement(BuilderBlocks,{key:String(!!(null===(i=null==e?void 0:e.blocks)||void 0===i?void 0:i.length)),emailMode:t.props.emailMode,fieldName:"blocks",blocks:d}))):n?React__default.default.createElement("div",{"data-builder-component":t.name,className:"builder-loading"},t.props.children):React__default.default.createElement("div",{"data-builder-component":t.name,className:"builder-no-content"})}))})))})))},t.prototype.evalExpression=function(e){var t=this,n=this.data;return String(e).replace(/{{([^}]+)}}/g,(function(e,r){return tryEval(r,n,t._errors)}))},t.prototype.handleRequest=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,r,i,a,o=this;return __generator(this,(function(s){return sdk.Builder.isIframe&&fetchCache[t]?(this.updateState((function(n){n[e]=fetchCache[t]})),[2,fetchCache[t]]):(n=function(){return __awaiter(o,void 0,void 0,(function(){var n,r,i,a;return __generator(this,(function(o){switch(o.label){case 0:n=Date.now(),sdk.Builder.isBrowser||console.time("Fetch "+t),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,fetch(t)];case 2:return[4,o.sent().json()];case 3:return r=o.sent(),[3,6];case 4:return i=o.sent(),a=toError(i),this._errors&&this._errors.push(a),this._logs&&this._logs.push("Fetch to ".concat(t," errored in ").concat(Date.now()-n,"ms")),[2];case 5:return sdk.Builder.isBrowser||(console.timeEnd("Fetch "+t),this._logs&&this._logs.push("Fetched ".concat(t," in ").concat(Date.now()-n,"ms"))),[7];case 6:return r&&(sdk.Builder.isIframe&&(fetchCache[t]=r),this.updateState((function(t){t[e]=r}))),[2,r]}}))}))},(r=this._asyncRequests&&this._asyncRequests.find((function(e){return isRequestInfo(e)&&e.url===t})))?((i=r.promise).then((function(t){t&&o.updateState((function(n){n[e]=t}))})),[2,i]):(a=n(),sdk.Builder.nextTick((function(){o._asyncRequests&&o._asyncRequests.push(a)})),[2,a]))}))}))},t.prototype.unsubscribe=function(){this.subscriptions&&(this.subscriptions.unsubscribe(),this.subscriptions=new sdk.Subscription)},t.prototype.handleBuilderRequest=function(e,t){var n=this,r=tryEval(t,this.data,this._errors);this.subscriptions&&this.unsubscribe(),r&&this.subscriptions.add(this.builder.queueGetContent(r.model,r).subscribe((function(t){t&&n.updateState((function(n){n[e]=t}))})))},t.defaults={codegen:Boolean(sdk.Builder.isBrowser&&location.href.includes("builder.codegen=true"))},__decorate([debounceNextTick,__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],t.prototype,"notifyStateChange",null),t}(React__default.default.Component),withChildren=function(e){var t=React__default.default.forwardRef((function(t,n){var r=t.children||t.builderBlock&&t.builderBlock.children&&t.builderBlock.children.map((function(e){return React__default.default.createElement(BuilderBlock,{key:e.id,block:e})}));return React__default.default.createElement(e,__assign({},t,{ref:n}),r)}));return t.builderOptions={canHaveChildren:!0},t};function useIsPreviewing(){var e=React.useState(!1),t=e[0],n=e[1];return React.useEffect((function(){(sdk.Builder.isEditing||sdk.Builder.isPreviewing)&&n(!0)}),[]),t}sdk.Builder.isReact=!0,Object.defineProperty(exports,"Builder",{enumerable:!0,get:function(){return sdk.Builder}}),Object.defineProperty(exports,"builder",{enumerable:!0,get:function(){return sdk.builder}}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return sdk.builder}}),exports.BuilderAsyncRequestsContext=BuilderAsyncRequestsContext,exports.BuilderBlockComponent=BuilderBlock,exports.BuilderBlocks=BuilderBlocks,exports.BuilderComponent=BuilderComponent,exports.BuilderContent=BuilderContent,exports.BuilderMetaContext=BuilderMetaContext,exports.BuilderPage=BuilderComponent,exports.BuilderStoreContext=BuilderStoreContext,exports.stringToFunction=stringToFunction,exports.useIsPreviewing=useIsPreviewing,exports.withChildren=withChildren; | ||
//# sourceMappingURL=builder-react-lite.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
import{Builder,builder,Subscription,BehaviorSubject}from"@builder.io/sdk";export{Builder,builder,builder as default}from"@builder.io/sdk";import{jsx,ClassNames,css}from"@emotion/core";import*as React from"react";import React__default,{useState,useEffect}from"react";import ReactDOM from"react-dom";import hash from"hash-sum";var version="3.0.13",_a;"undefined"!=typeof window&&(null===(_a=window.parent)||void 0===_a||_a.postMessage({type:"builder.isReactSdk",data:{value:!0,supportsPatchUpdates:"v4",supportsCustomBreakpoints:!0,supportsGlobalSymbols:!0,priorVersion:version}},"*"));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function __rest(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function __decorate(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function __generator(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var fastClone=function(e){return JSON.parse(JSON.stringify(e))},sizeNames=["xsmall","small","medium","large"],sizes={xsmall:{min:0,default:0,max:0},small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200},getWidthForSize:function(e){return this[e].default},getSizeForWidth:function(e){for(var t=0,n=sizeNames;t<n.length;t++){var i=n[t];if(e<=this[i].max)return i}return"large"}},getSizesForBreakpoints=function(e){var t=e.small,n=e.medium,i=__assign(__assign({},sizes),fastClone(sizes));if(!t||!n)return i;var r=Math.floor(t/2);i.small={max:t,min:r,default:r+1};var o=i.small.max+1;i.medium={max:n,min:o,default:o+1};var a=i.medium.max+1;return i.large={max:2e3,min:a,default:a+1},i},set=function(e,t,n){if(Object(e)!==e)return e;var i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((function(e,t,n){return Object(e[t])===e[t]?e[t]:e[t]=Math.abs(Number(i[n+1]))>>0==+i[n+1]?[]:{}}),e)[i[i.length-1]]=n,e},noop=function(){return null},safeDynamicRequire;if("function"==typeof(null===globalThis||void 0===globalThis?void 0:globalThis.require)||Builder.isServer&&"function"==typeof require)try{safeDynamicRequire=eval("require")}catch(e){safeDynamicRequire=(null===globalThis||void 0===globalThis?void 0:globalThis.require)?globalThis.require:noop}function isDebug(){return Boolean("undefined"!=typeof process&&void 0!==process.env&&process.env.DEBUG)}null!=safeDynamicRequire||(safeDynamicRequire=noop);var fnCache={},api=function(e){return builder};function stringToFunction(e,t,n,i){if(void 0===t&&(t=!0),!e||!e.trim())return function(){};var r=e+":"+t;if(fnCache[r])return fnCache[r];var o=t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))||e.trim().startsWith("builder.run"),a=function(){};try{Builder.isBrowser&&(a=new Function("state","event","block","builder","Device","update","Builder","context","\n var names = [\n 'state',\n 'event',\n 'block',\n 'builder',\n 'Device',\n 'update',\n 'Builder',\n 'context'\n ];\n var rootState = state;\n if (typeof Proxy !== 'undefined') {\n rootState = new Proxy(rootState, {\n set: function () {\n return false;\n },\n get: function (target, key) {\n if (names.includes(key)) {\n return undefined;\n }\n return target[key];\n }\n });\n }\n /* Alias */\n var ctx = context;\n var log = console.log.bind(console);\n with (rootState) {\n ".concat(o?"return (".concat(e,");"):e,";\n }\n ")))}catch(t){n&&n.push(t);var s=t&&t.message;s&&"string"==typeof s&&i&&-1===i.indexOf(s)&&i.push(s),Builder.isBrowser&&console.warn("Function compile error in ".concat(e),t)}var l=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];try{if(Builder.isBrowser)return a.apply(void 0,t);var r=getIsolateContext(),s=safeDynamicRequire("isolated-vm"),l=r.evalClosureSync(makeFn(e,o),t.map((function(e,t){return"object"==typeof e?new s.Reference(t===indexOfBuilderInstance?__assign(__assign({},e),{getUserAttributes:function(){return e.getUserAttributes("")}}):e):null})));try{var u=JSON.parse(l);return u}catch(e){return l}}catch(t){return Builder.isBrowser?console.warn("Builder custom code error:",t.message||t,"in",e,t.stack||t):isDebug()&&console.debug("Builder custom code error:",t.message||t,"in",e,t.stack||t),n&&n.push(t),null}};return Builder.isBrowser&&(fnCache[r]=l),l}var indexOfBuilderInstance=3,makeFn=function(e,t,n){var i=n||["state","event","block","builder","Device","update","Builder","context"];return"\n".concat("\n var refToProxy = (obj) => {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n return new Proxy({}, {\n get(target, key) {\n if (key === 'copySync') {\n return () => obj.copySync();\n }\n const val = obj.getSync(key);\n if (typeof val?.getSync === 'function') {\n return refToProxy(val);\n }\n return val;\n },\n set(target, key, value) {\n obj.setSync(key, value);\n },\n deleteProperty(target, key) {\n obj.deleteSync(key);\n }\n })\n }\n","\n").concat("\n var stringify = (val) => {\n if (typeof val === 'object' && val !== null) {\n return JSON.stringify(val.copySync ? val.copySync() : val);\n }\n return val;\n }\n ","\n").concat(i.map((function(e,t){return"var ".concat(e," = refToProxy($").concat(t,");")})).join("\n")).concat("\n".concat(i.includes("context")?"var ctx = context;":"","\n").concat(t?"return stringify(".concat(e,");"):e,";\n"))},getIsolateContext=function(){var e=Builder.serverContext;e||(e=new(safeDynamicRequire("isolated-vm").Isolate)({memoryLimit:128}).createContextSync(),Builder.setServerContext(e));var t=e.global;return t.setSync("global",t.derefInto()),t.setSync("log",(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];isDebug()&&console.log.apply(console,e)})),e},isPromise=function(e){return"function"==typeof e.then},isRequestInfo=function(e){return!isPromise(e)},BuilderAsyncRequestsContext=React__default.createContext({requests:[],errors:[],logs:[]}),BuilderStoreContext=React__default.createContext({state:{},rootState:{},content:{},context:{},update:function(e){return null}}),applyPatchWithMinimalMutationChain=function(e,t,n){if(void 0===n&&(n=!1),Object(e)!==e)return e;var i=t.path,r=t.op,o=t.value,a=i.split(/\//);""===a[0]&&a.shift();for(var s=n?e:__assign({},e),l=s,u=0;u<a.length;u++){var c=u===a.length-1,d=a[u];if(c){if("replace"===r)l[d]=o;else if("add"===r){var p=Number(d);Array.isArray(l)?"-"===d?l.push(o):l.splice(p,0,o):l[d]=o}else if("remove"===r){p=Number(d);Array.isArray(l)?l.splice(p,1):delete l[d]}}else{var f=a[u+1],v=Object(l[d])===l[d]?l[d]:String(Number(f))===f?[]:{};l=l[d]=Array.isArray(v)?__spreadArray([],v,!0):__assign({},v)}}return s},htmlEscape=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},blockToHtmlString=function(e){var t;return"<".concat(htmlEscape(e.tagName||"div"),' \n class="builder-block ').concat(e.id," ").concat(e.class||"",'"\n builder-id="').concat(e.id,'"\n ').concat(Object.keys(e.properties||{}).map((function(t){return"".concat(htmlEscape(t),'="').concat(htmlEscape(e.properties[t]),'"')})).join(" "),"\n >").concat("Text"===(null===(t=null==e?void 0:e.component)||void 0===t?void 0:t.name)?e.component.options.text:e.children?e.children.map((function(e){return blockToHtmlString(e)})).join(""):"","</").concat(e.tagName||"div",">").replace(/\s+/g," ")},Link=function(e){return React__default.createElement(BuilderStoreContext.Consumer,null,(function(t){return t.renderLink?t.renderLink(e):React__default.createElement("a",__assign({},e))}))},camelCaseToKebabCase=function(e){return e?e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())})):""},kebabCaseToCamelCase=function(e){return void 0===e&&(e=""),e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))},Device={desktop:0,tablet:1,mobile:2},voidElements=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","textarea"]),last=function(e){return e[e.length-1]};function omit$1(e,t){for(var n=Object.assign({},e),i=0,r=t;i<r.length;i++){delete n[r[i]]}return n}var cssCase=function(e){if(!e)return e;var t=camelCaseToKebabCase(e);return e[0]===e[0].toUpperCase()&&(t="-"+t),t};function capitalize(e){if(e)return e[0].toUpperCase()+e.slice(1)}var BuilderBlock=function(_super){function BuilderBlock(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.state={hasError:!1,updates:0},_this.privateState={state:{},rootState:{},context:{},update:function(){}},_this.onWindowMessage=function(event){var message=event.data;if(message)switch(message.type){case"builder.selectionChange":var data=message.data;if(!data)break;var selection=data.selection,id=_this.block&&_this.block.id;id&&Array.isArray(selection)&&selection.indexOf(id)>-1&&setTimeout((function(){window.$block=_this,window.$blocks||(window.$blocks=[]),window.$blocks.push(_this)}));break;case"builder.patchUpdates":var data=message.data;if(!data||!data.data)break;var patches=data.data[_this.block.id];if(!patches)return;location.href.includes("builder.debug=true")&&eval("debugger");for(var _i=0,patches_1=patches;_i<patches_1.length;_i++){var patch=patches_1[_i];applyPatchWithMinimalMutationChain(_this.props.block,patch,!0)}_this.setState({updates:_this.state.updates+1})}},_this}return __extends(BuilderBlock,_super),Object.defineProperty(BuilderBlock.prototype,"store",{get:function(){return this.privateState},enumerable:!1,configurable:!0}),BuilderBlock.getDerivedStateFromError=function(e){return{hasError:!0}},BuilderBlock.prototype.componentDidCatch=function(e,t){console.error("Builder block error:",e,t)},BuilderBlock.prototype.stringToFunction=function(e,t){return void 0===t&&(t=!0),stringToFunction(e,t,this._errors,this._logs)},Object.defineProperty(BuilderBlock.prototype,"block",{get:function(){return this.props.block},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderBlock.prototype,"emotionCss",{get:function(){var e,t,n,i,r,o=this.block;if(Builder.isServer){var a=o.animations&&o.animations[0];if(a&&"hover"!==a.trigger){var s=a&&a.steps&&a.steps[0],l=s&&s.styles;l&&(r=l)}}var u=sizeNames.slice().reverse(),c=this.block,d={};if(c.responsiveStyles)for(var p=0,f=u;p<f.length;p++){var v=f[p];if("large"===v)this.props.emailMode||(d["&.builder-block"]=Object.assign({},c.responsiveStyles[v],r));else{var m=getSizesForBreakpoints((null===(t=null===(e=this.privateState.context.builderContent)||void 0===e?void 0:e.meta)||void 0===t?void 0:t.breakpoints)||{});d["@media only screen and (max-width: ".concat(m[v].max,"px)")]={"&.builder-block":c.responsiveStyles[v]}}}var h=o.animations&&o.animations.find((function(e){return"hover"===e.trigger}));return h&&(d[":hover"]=(null===(i=null===(n=h.steps)||void 0===n?void 0:n[1])||void 0===i?void 0:i.styles)||{},d.transition="all ".concat(h.duration,"s ").concat(camelCaseToKebabCase(h.easing)),h.delay&&(d.transitionDelay=h.delay+"s")),d},enumerable:!1,configurable:!0}),BuilderBlock.prototype.eval=function(e){return this.stringToFunction(e)(this.privateState.state,void 0,this.block,builder,Device,this.privateState.update,Builder,this.privateState.context)},BuilderBlock.prototype.componentWillUnmount=function(){Builder.isEditing&&removeEventListener("message",this.onWindowMessage)},BuilderBlock.prototype.componentDidMount=function(){var e,t=this,n=this.block,i=n&&n.animations;if(Builder.isEditing&&addEventListener("message",this.onWindowMessage),i){var r={animations:fastClone(i)};if(n.bindings)for(var o in n.bindings)if((null===(e=o.trim)||void 0===e?void 0:e.call(o))&&o.startsWith("animations.")){var a=this.stringToFunction(n.bindings[o]);void 0!==a&&set(r,o,a(this.privateState.state,null,n,builder,null,null,Builder,this.privateState.context))}Builder.animator.bindAnimations(r.animations.filter((function(e){return"hover"!==e.trigger})).map((function(e){return __assign(__assign({},e),{elementId:t.block.id})})))}},BuilderBlock.prototype.getElement=function(e,t){var n,i,r,o,a,s=this;void 0===e&&(e=0),void 0===t&&(t=this.privateState.state);var l=this.props;l.child,l.fieldName;var u,c=this.block,d=(c.tagName||"div").toLowerCase();if("template"===d){var p=c.children?c.children.map((function(e){return blockToHtmlString(e)})).join(" "):"";return console.debug("template html",p),jsx("template",__assign({},c.properties,{dangerouslySetInnerHTML:{__html:p}}))}var f=c.component&&(c.component.name||c.component.component),v=null;c.component&&!c.component.class&&(c.component&&c.component.tag?u=c.component.tag:(v=Builder.components.find((function(e){return e.name===f}))||null)&&v.class?u=v.class:v&&v.tag?u=v.tag:(null==f?void 0:f.startsWith("Builder:"))?console.warn("Missing @builder.io/widgets installation, please install and import @builder.io/widgets to use ".concat(f.split(":")[1]," in your content, more info here: https://github.com/BuilderIO/builder/tree/main/packages/widgets")):f&&console.warn("Missing registration for ".concat(f,", have you included the registration in your bundle?")));var m=__assign(__assign({},c.properties),{style:{}});if(m=__assign(__assign({},m.properties),m),c.component&&(m.component=fastClone(c.component)),c.bindings)for(var h in c.bindings)if(null===(i=h.trim)||void 0===i?void 0:i.call(h)){var g=this.stringToFunction(c.bindings[h]);set(m,h,g(t,null,c,api(),Device,null,Builder,this.privateState.context))}if(m.hide)return null;if(delete m.hide,("show"in m||c.bindings&&c.bindings.show)&&!m.show)return null;if(delete m.show,c.actions){var b=function(e){if(!(null===(r=e.trim)||void 0===r?void 0:r.call(e)))return"continue";var n=c.actions[e];m["on"+capitalize(e)]=function(e){var i=t;return"undefined"!=typeof Proxy&&(i=new Proxy(t,{set:function(e,t,n){return e[t]=n,s.privateState.rootState[t]=n,!0}})),s.stringToFunction(n,!1)(i,e,s.block,builder,Device,s.privateState.update,Builder,s.privateState.context)}};for(var h in c.actions)b(h)}var y=(m.component||m.options)&&__assign(__assign({},m.options),m.component.options||m.component.data),_=voidElements.has(d),B=v&&(v.fragment||v.noWrap),k=(null===(o=m.attr)||void 0===o?void 0:o.style)||("string"==typeof m.style?m.style:"")||"";if("string"==typeof k){"object"!=typeof m.style&&(m.style={});for(var S=0,C=k.split(";");S<C.length;S++){var w=C[S].split(":");if(!w.length)return;h=w[0],g=w[1];h&&(w.length>2&&(g=w.slice(1).join(":")),m.style[kebabCaseToCamelCase(h)]=g)}}var x=__assign(__assign(__assign({},omit$1(m,["class","component","attr"])),((n={})["string"!=typeof d||d.includes("-")?"class":"className"]="builder-block ".concat(this.id).concat(c.class?" ".concat(c.class):"").concat(!c.component||["Image","Video","Banner"].indexOf(f)>-1?"":" builder-has-component")+(m.class?" "+m.class:"")+(Builder.isEditing&&(null===(a=this.privateState.state._spacer)||void 0===a?void 0:a.parent)===c.id?" builder-spacer-parent":""),n.key=this.id+e,n["builder-id"]=this.id,n)),0!==e&&{"builder-index":e});Builder.isEditing&&(x["builder-inline-styles"]=m.attr&&m.attr.style?Object.keys(m.style).reduce((function(e,t){return(e?"".concat(e,";"):"")+"".concat(cssCase(t),":").concat(m.style[t],";")}),""):""),(x.properties&&x.properties.href||x.href)&&"div"===d&&(d="a"),"a"===d&&(d=Link);var E=c.children||x.children||[];return jsx(React__default.Fragment,null,jsx(ClassNames,null,(function(e){var t=e.css;if(e.cx,!s.props.emailMode){var n=" "+t(s.emotionCss);x.class&&(x.class+=n),x.className&&(x.className+=n)}return jsx(BuilderAsyncRequestsContext.Consumer,null,(function(e){return s._asyncRequests=e&&e.requests,s._errors=e&&e.errors,s._logs=e&&e.logs,_?jsx(d,__assign({},x)):u&&(B||s.props.emailMode)?jsx(u,__assign({},y,{attributes:x,builderBlock:c,builderState:s.privateState})):jsx(d,__assign({},x),u&&jsx(u,__assign({builderState:s.privateState,builderBlock:c},y)),c.text||m.text?m.text:!u&&E&&Array.isArray(E)&&E.length?E.map((function(e,t){return jsx(BuilderBlock,{key:(s.id||"")+t,block:e,index:t,size:s.props.size,fieldName:s.props.fieldName,child:s.props.child,emailMode:s.props.emailMode})})):null)}))})))},Object.defineProperty(BuilderBlock.prototype,"id",{get:function(){var e=this.block;return e.id.startsWith("builder")?e.id:"builder-"+e.id},enumerable:!1,configurable:!0}),BuilderBlock.prototype.contents=function(e){var t=this,n=this.block;if(this.privateState=e,n.repeat&&n.repeat.collection){var i=n.repeat.collection,r=last((i||"").trim().split("(")[0].trim().split(".")),o=n.repeat.itemName||(r?r+"Item":"item"),a=this.stringToFunction(i)(e.state,null,n,api(),Device,null,Builder,this.privateState.context);return Array.isArray(a)?a.map((function(n,i){var r,a=__assign(__assign({},e.state),((r={$index:i,$item:n})[o]=n,r["$".concat(o,"Index")]=i,r));return jsx(BuilderStoreContext.Provider,{key:i,value:__assign(__assign({},e),{state:a})},t.getElement(i,a))})):null}return this.getElement()},BuilderBlock.prototype.render=function(){var e=this;return this.state.hasError?jsx("span",{css:{display:"inline-block",padding:5,color:"#999",fontSize:11,fontStyle:"italic"}},"Builder block error :( Check console for details"):jsx(BuilderStoreContext.Consumer,null,(function(t){return e.contents(t)}))},BuilderBlock}(React__default.Component),BuilderBlocks=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClickEmptyBlocks=function(){var e;Builder.isIframe&&t.noBlocks&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:t.parentId,dataPath:t.path}},"*"))},t.onHoverEmptyBlocks=function(){var e;Builder.isEditing&&t.noBlocks&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:t.parentId,dataPath:t.path}},"*"))},t}return __extends(t,e),Object.defineProperty(t.prototype,"isRoot",{get:function(){return!this.props.child},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noBlocks",{get:function(){var e=this.props.blocks;return!(e&&e.length)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){var e=this.props.dataPath||"";return e.trim()&&(e.startsWith("this.")?e=e.replace("this.",""):e.startsWith("component.options.")||(e="component.options."+e)),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.props.parentElementId?this.props.parentElementId:this.props.parent&&this.props.parent.id},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props.blocks,n=this.props.emailMode?"span":"div";return jsx(n,__assign({className:"builder-blocks"+(this.noBlocks?" no-blocks":"")+(this.props.child?" builder-blocks-child":"")+(this.props.className?" "+this.props.className:""),"builder-type":"blocks","builder-path":Builder.isIframe?this.path:void 0,"builder-parent-id":this.parentId,css:__assign(__assign({},!this.props.emailMode&&{display:"flex",flexDirection:"column",alignItems:"stretch"}),this.props.style),onClick:function(){e.noBlocks&&e.onClickEmptyBlocks()}},Builder.isEditing&&{onMouseEnter:function(){return e.onHoverEmptyBlocks()}}),t&&Array.isArray(t)&&t.map((function(t,n){return t&&"@builder.io/sdk:Element"===t["@type"]?jsx(BuilderBlock,{key:t.id,block:t,index:n,fieldName:e.props.fieldName,child:e.props.child,emailMode:e.props.emailMode}):t}))||t)},t.renderInto=function(e,n,i){if(void 0===n&&(n={}),e){var r=null;return"string"==typeof e?r=document.querySelector(e):e instanceof Element&&(r=e),ReactDOM.render(jsx(BuilderStoreContext.Provider,{value:i},jsx(t,__assign({},n))),r)}},t}(React__default.Component),NoWrap=function(e){return e.children};function getData(e){if(void 0!==(null==e?void 0:e.data)){var t=e.data,n=t.blocks,i=t.blocksString,r=Array.isArray(n)||"string"==typeof i,o=__assign(__assign({},e.data),r&&{blocks:n||JSON.parse(i)});return delete o.blocksString,o}}var variantsScript=function(e,t){return"\n(function() {\n if (window.builderNoTrack || !navigator.cookieEnabled) {\n return;\n }\n\n var variants = ".concat(e,";\n function removeVariants() {\n variants.forEach(function (template) {\n document.querySelector('template[data-template-variant-id=\"' + template.id + '\"]').remove();\n });\n document.getElementById('variants-script-").concat(t,'\').remove();\n }\n\n if (typeof document.createElement("template").content === \'undefined\') {\n removeVariants();\n return ;\n }\n\n function setCookie(name,value,days) {\n var expires = "";\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days*24*60*60*1000));\n expires = "; expires=" + date.toUTCString();\n }\n document.cookie = name + "=" + (value || "") + expires + "; path=/" + "; Secure; SameSite=None";\n }\n\n function getCookie(name) {\n var nameEQ = name + "=";\n var ca = document.cookie.split(\';\');\n for(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==\' \') c = c.substring(1,c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);\n }\n return null;\n }\n var cookieName = \'builder.tests.').concat(t,"';\n var variantInCookie = getCookie(cookieName);\n var availableIDs = variants.map(function(vr) { return vr.id }).concat('").concat(t,"');\n var variantId;\n if (availableIDs.indexOf(variantInCookie) > -1) {\n variantId = variantInCookie;\n }\n if (!variantId) {\n var n = 0;\n var random = Math.random();\n for (var i = 0; i < variants.length; i++) {\n var variant = variants[i];\n var testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n variantId = variant.id;\n break;\n }\n }\n if (!variantId) {\n variantId = \"").concat(t,'";\n setCookie(cookieName, "').concat(t,'");\n }\n }\n if (variantId && variantId !== "').concat(t,"\") {\n var winningTemplate = document.querySelector('template[data-template-variant-id=\"' + variantId + '\"]');\n if (winningTemplate) {\n var parentNode = winningTemplate.parentNode;\n var newParent = parentNode.cloneNode(false);\n newParent.appendChild(winningTemplate.content.firstChild);\n parentNode.parentNode.replaceChild(newParent, parentNode);\n }\n } else if (variants.length > 0) {\n removeVariants();\n }\n})()").replace(/\s+/g," ")},VariantsProvider=function(e){var t=e.initialContent,n=e.children;if(Builder.isBrowser&&!builder.canTrack)return n([t]);if(!Boolean(Object.keys((null==t?void 0:t.variations)||{}).length))return n([t]);var i=Object.keys(t.variations).map((function(e){return __assign(__assign({id:e},t.variations[e]),{data:getData(t.variations[e])})})),r=__spreadArray(__spreadArray([],i,!0),[t],!1);if(Builder.isServer){var o=JSON.stringify(Object.keys(t.variations||{}).map((function(e){return{id:e,testRatio:t.variations[e].testRatio}})));return React.createElement(React.Fragment,null,n(r,(function(){return React.createElement("script",{id:"variants-script-".concat(t.id),dangerouslySetInnerHTML:{__html:variantsScript(o,t.id)}})})))}var a="builder.tests.".concat(t.id),s=builder.getCookie(a);if(!s&&Builder.isBrowser)for(var l=0,u=Math.random(),c=0;c<i.length;c++){var d=i[c];if(u<(l+=d.testRatio)){builder.setCookie(a,d.id),s=d.id;break}}return s||(s=t.id,builder.setCookie(a,s)),n([r.find((function(e){return e.id===s}))])},BuilderContent=function(_super){function BuilderContent(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.ref=null,_this.state={loading:!_this.props.content,data:getContentWithInfo(_this.props.content),updates:1},_this.onWindowMessage=function(event){var _a,_b,message=event.data;if(message)switch(message.type){case"builder.patchUpdates":if(null===(_a=_this.props.options)||void 0===_a?void 0:_a.noEditorUpdates)return;var data=message.data;if(!data||!data.data)break;var patches=data.data[null===(_b=_this.state.data)||void 0===_b?void 0:_b.id];if(!patches||!patches.length)return;location.href.includes("builder.debug=true")&&eval("debugger");for(var newData=_this.state.data,_i=0,patches_1=patches;_i<patches_1.length;_i++){var patch=patches_1[_i];newData=applyPatchWithMinimalMutationChain(newData,patch,!1)}_this.setState({updates:_this.state.updates+1,data:newData}),_this.props.contentLoaded&&_this.props.contentLoaded(newData.data,newData)}},_this.subscriptions=new Subscription,_this.firstLoad=!0,_this.clicked=!1,_this.trackedImpression=!1,_this.intersectionObserver=null,_this.onClick=function(e){var t=e.nativeEvent,n=_this.data;n&&(builder.autoTrack&&_this.builder.trackInteraction(n.id,_this.renderedVariantId,_this.clicked,t,{content:n}),_this.clicked||(_this.clicked=!0))},_this}return __extends(BuilderContent,_super),Object.defineProperty(BuilderContent.prototype,"builder",{get:function(){return this.props.builder||builder},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"name",{get:function(){var e=this.props;return"model"in e?e.model:e.modelName},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"renderedVariantId",{get:function(){var e,t,n=this.props.isStatic?this.builder.getCookie("builder.tests.".concat(null===(e=this.data)||void 0===e?void 0:e.id)):null===(t=this.data)||void 0===t?void 0:t.variationId;if(null!==n)return n},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"options",{get:function(){var e,t,n=__assign({},this.props.options||{});return n.key||!(null===(e=this.props.content)||void 0===e?void 0:e.id)||Builder.isEditing||Builder.isPreviewing||(n.key=this.props.content.id),!this.props.content||(null===(t=n.initialContent)||void 0===t?void 0:t.length)||!this.props.inline&&Builder.isPreviewing||(n.initialContent=[this.props.content]),n},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"data",{get:function(){var e=(this.props.inline||!Builder.isBrowser||this.firstLoad)&&this.options.initialContent&&this.options.initialContent[0]||this.state.data;return getContentWithInfo(e)},enumerable:!1,configurable:!0}),BuilderContent.prototype.componentDidMount=function(){var e,t;if(!this.props.inline||Builder.isEditing||Builder.isPreviewing)this.subscribeToContent();else if(this.props.inline&&(null===(t=null===(e=this.options)||void 0===e?void 0:e.initialContent)||void 0===t?void 0:t.length)){var n=this.options.initialContent[0];(null==n?void 0:n.id)&&this.builder.trackImpression(n.id,this.renderedVariantId,void 0,{content:n})}Builder.isEditing&&addEventListener("message",this.onWindowMessage)},BuilderContent.prototype.subscribeToContent=function(){var e=this;"_inline"!==this.name&&this.subscriptions.add(this.builder.queueGetContent(this.name,this.options).subscribe((function(t){var n=t&&t[0];e.setState({data:n,loading:!1});var i=(e.builder.editingModel||e.builder.previewingModel)===e.name;if(!e.props.inline&&e.props.content&&e.firstLoad&&i&&(e.firstLoad=!1,e.subscriptions.unsubscribe(),e.subscribeToContent()),n&&e.firstLoad&&(e.firstLoad=!1,builder.autoTrack&&!Builder.isEditing)){var r=!1;if("function"==typeof IntersectionObserver&&e.ref)try{(e.intersectionObserver=new IntersectionObserver((function(t,i){t.forEach((function(t){t.intersectionRatio>0&&!e.trackedImpression&&(e.builder.trackImpression(n.id,e.renderedVariantId,void 0,{content:e.data}),e.data,e.trackedImpression=!0,e.ref&&i.unobserve(e.ref))}))}))).observe(e.ref),r=!0}catch(e){console.warn("Could not bind intersection observer")}r||(e.trackedImpression=!0,e.builder.trackImpression(n.id,e.renderedVariantId,void 0,{content:n}))}e.props.contentLoaded&&e.props.contentLoaded(n&&n.data,n)}),(function(t){e.props.contentError&&(e.props.contentError(t),e.setState({loading:!1}))})))},BuilderContent.prototype.componentWillUnmount=function(){Builder.isEditing&&removeEventListener("message",this.onWindowMessage),this.subscriptions.unsubscribe(),this.intersectionObserver&&this.ref&&this.intersectionObserver.unobserve(this.ref)},BuilderContent.prototype.render=function(){var e=this;if(this.props.dataOnly)return null;var t=this.state.loading,n=this.data,i=this.props.dataOnly?NoWrap:"div";return React__default.createElement(VariantsProvider,{initialContent:n},(function(r,o){return React__default.createElement(React__default.Fragment,null,r.map((function(a,s){var l=s===r.length-1?React__default.Fragment:"template";return React__default.createElement(React__default.Fragment,{key:String((null==a?void 0:a.id)+s)},"template"!==l&&(null==o?void 0:o()),React__default.createElement(l,__assign({key:String((null==a?void 0:a.id)+s)},"template"===l&&{"data-template-variant-id":null==a?void 0:a.id}),React__default.createElement(i,__assign({},0===s&&!e.props.dataOnly&&{ref:function(t){return e.ref=t}},{className:"builder-content",onClick:e.onClick,"builder-content-id":null==a?void 0:a.id,"builder-model":e.name}),e.props.children(null==a?void 0:a.data,!e.props.inline&&t,n))))})))}))},BuilderContent}(React__default.Component),getContentWithInfo=function(e){var t;if(e){var n=builder.getCookie("builder.tests.".concat(e.id)),i=n===e.id?e:null===(t=e.variations)||void 0===t?void 0:t[n],r=(null==i?void 0:i.name)||((null==i?void 0:i.id)===e.id?"Default variation":"");return __assign(__assign({},e),{variationId:n,testVariationId:n,testVariationName:r})}return null};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var onChange_1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Symbol("target"),i=Symbol("unsubscribe"),r=function(e,t){return t&&t.toString&&(e&&(e+="."),e+=t.toString()),e},o=function(e){return Array.isArray(e)?e.slice():Object.assign({},e)},a=function(e,t,a){if("undefined"==typeof Proxy)return e;void 0===a&&(a={});var s,l,u=Symbol("ProxyTarget"),c=!1,d=!1,p=!1,f=a.equals||Object.is,v=new WeakMap,m=new WeakMap,h=new WeakMap,g=function(e,n,i,a){if(!p)if(c){if(c&&l&&void 0!==i&&void 0!==a&&"length"!==n){var u=l;e!==s&&function(e,t){for(var n;e;)-1===(n=e.indexOf("."))&&(n=e.length),t(e.slice(0,n)),e=e.slice(n+1)}(e=e.replace(s,"").slice(1),(function(e){u[e]=o(u[e]),u=u[e]})),u[n]=i}d=!0}else t(r(e,n),a,i)},b=function(e,t){var n=v?v.get(e):void 0;n&&n.delete(t)},y=function(e,t){if(p)return e;m.set(e,t);var n=h.get(e);return void 0===n&&(n=new Proxy(e,B),h.set(e,n)),n},_=function(e){return p||!0===a.ignoreSymbols&&"symbol"==typeof e},B={get:function(e,t,o){if(t===u||t===n)return e;if(t===i&&""===m.get(e))return function(e){return p=!0,v=null,m=null,h=null,e}(e);var s=Reflect.get(e,t,o);if(function(e){return null===e||"object"!=typeof e&&"function"!=typeof e}(s)||function(e){return e instanceof RegExp||e instanceof Number}(s)||"constructor"===t||!0===a.isShallow)return s;var l=function(e,t){var n=v?v.get(e):void 0;if(n)return n;n=new Map,v.set(e,n);var i=n.get(t);return i||(i=Reflect.getOwnPropertyDescriptor(e,t),n.set(t,i)),i}(e,t);if(l&&!l.configurable){if(l.set&&!l.get)return;if(!1===l.writable)return s}return y(s,r(m.get(e),t))},set:function(e,t,n,i){n&&void 0!==n[u]&&(n=n[u]);var r=_(t),o=r?null:Reflect.get(e,t,i),a=Reflect.set(e[u]||e,t,n);return r||f(o,n)||g(m.get(e),t,o,n),a},defineProperty:function(e,t,n){var i=Reflect.defineProperty(e,t,n);return _(t)||(b(e,t),g(m.get(e),t,void 0,n.value)),i},deleteProperty:function(e,t){if(!Reflect.has(e,t))return!0;var n=_(t),i=n?null:Reflect.get(e,t),r=Reflect.deleteProperty(e,t);return n||(b(e,t),g(m.get(e),t,i)),r},apply:function(e,t,n){var i=t instanceof Date;if(i&&(t=t[u]),!c){c=!0,i&&(l=t.valueOf()),(Array.isArray(t)||"[object Object]"===toString.call(t))&&(l=o(t[u])),s=(s=m.get(e)).slice(0,Math.max(s.lastIndexOf("."),0));var r=Reflect.apply(e,t,n);return c=!1,(d||i&&!f(l,t.valueOf()))&&(g(s,"",l,t[u]||t),l=null,d=!1),r}return Reflect.apply(e,t,n)}},k=y(e,"");return t=t.bind(k),k};a.target=function(e){return e[n]||e},a.unsubscribe=function(e){return e[i]||e},e.exports=a,t.default=a})),onChange=unwrapExports(onChange_1),nextTick=Builder.nextTick;function debounceNextTick(e,t,n){return void 0===t&&"function"==typeof e?debounceNextTickImpl(e):{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,t,{configurable:!0,enumerable:n.enumerable,value:debounceNextTickImpl(n.value)}),this[t]}}}function debounceNextTickImpl(e){var t=null,n=null;return function(){var e=t;if(t=[].slice.call(arguments),n=this,null!==e)return;nextTick(i)};function i(){e.apply(n,t),t=null,n=null}}function throttle(e,t,n){var i,r,o;void 0===n&&(n={});var a=null,s=0,l=function(){s=!1===n.leading?0:Date.now(),a=null,o=e.apply(i,r),a||(i=r=null)};return function(){var u=Date.now();s||!1!==n.leading||(s=u);var c=t-(u-s);return i=this,r=arguments,c<=0||c>t?(a&&(clearTimeout(a),a=null),s=u,o=e.apply(i,r),a||(i=r=null)):a||!1===n.trailing||(a=setTimeout(l,c)),o}}var BuilderMetaContext=React__default.createContext({emailMode:!1,ampMode:!1,isServer:!1}),tryEval=function(e,t,n){void 0===t&&(t={});var i=e;if("string"==typeof i&&i.trim()){var r=!(i.includes(";")||i.includes(" return ")),o=function(){};try{Builder.isBrowser&&(o=new Function("state","var rootState = state;\n if (typeof Proxy !== 'undefined') {\n rootState = new Proxy(rootState, {\n set: function () {\n return false;\n },\n get: function (target, key) {\n if (key === 'state') {\n return state;\n }\n return target[key]\n }\n });\n }\n with (rootState) {\n ".concat(r?"return (".concat(e,");"):e,";\n }")))}catch(e){Builder.isBrowser&&console.warn("Could not compile javascript",e)}try{if(Builder.isBrowser)return o(t||{});var a=safeDynamicRequire("isolated-vm"),s=getIsolateContext(),l=makeFn(e,r,["state"]),u=s.evalClosureSync(l,[new a.Reference(t||{})]);try{return JSON.parse(u)}catch(e){return u}}catch(t){n&&n.push(t),Builder.isBrowser?console.warn("Builder custom code error:",t.message,"in",e,t.stack):isDebug()&&console.debug("Builder custom code error:",t.message,"in",e,t.stack)}}};function toError(e){return e instanceof Error?e:new Error(String(e))}function getBuilderPixel(e){return{id:"builder-pixel-"+Math.random().toString(36).split(".")[1],"@type":"@builder.io/sdk:Element",tagName:"img",properties:{role:"presentation","aria-hidden":"true",src:"https://cdn.builder.io/api/v1/pixel?apiKey=".concat(e)},responsiveStyles:{large:{height:"0",width:"0",display:"inline-block",opacity:"0",overflow:"hidden",pointerEvents:"none"}}}}function pick(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i={};return t.forEach((function(t){i[t]=e[t]})),i}function omit(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=__assign({},e);return t.forEach((function(e){delete i[e]})),i}var instancesMap=new Map,wrapComponent=function(e){return function(t){var n,i=t.builderTag||"div",r=["children"].concat((null===(n=e.inputs)||void 0===n?void 0:n.map((function(e){return e.name})))||[]),o=omit.apply(void 0,__spreadArray(__spreadArray([t],r,!1),["attributes"],!1)),a=t;return e.noWrap?React__default.createElement(e.class,__assign({attributes:o},a)):React__default.createElement(i,__assign({},o),React__default.createElement(e.class,__assign({},a)))}},size=function(e){return Object.keys(e).length};function debounce(e,t,n){var i;return void 0===n&&(n=!1),function(){var r=this,o=arguments;clearTimeout(i),i=setTimeout((function(){i=null,n||e.apply(r,o)}),t),n&&!i&&e.apply(r,o)}}var fontsLoaded=new Set,fetch;globalThis.fetch&&(fetch=globalThis.fetch),null!=fetch||(fetch=require("node-fetch"));var sizeMap={desktop:"large",tablet:"medium",mobile:"small"},fetchCache={};function searchToObject(e){var t=(e.search||"").substring(1).split("&"),n={};for(var i in t)if(t[i]&&"string"==typeof t[i]){var r=t[i].split("=");n[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return n}var BuilderComponent=function(e){function t(t){var n,i,r=this;(r=e.call(this,t)||this).subscriptions=new Subscription,r.onStateChange=new BehaviorSubject(null),r.asServer=Builder.isServer,r.contentRef=null,r.styleRef=null,r.rootState=Builder.isServer?{}:onChange({},(function(){return r.updateState()})),r.lastJsCode="",r.lastHttpRequests={},r.httpSubscriptionPerKey={},r.firstLoad=!0,r.ref=null,r.messageListener=function(e){var t,n=e.data;switch(n.type){case"builder.configureSdk":var i=n.data;if(!i.contentId||i.contentId!==(null===(t=r.useContent)||void 0===t?void 0:t.id))return;r.sizes=getSizesForBreakpoints(i.breakpoints||{}),r.setState({state:Object.assign(r.rootState,{deviceSize:r.deviceSizeState,device:r.device}),updates:(r.state&&r.state.updates||0)+1,breakpoints:i.breakpoints});break;case"builder.updateSpacer":var o=n.data;r.rootState._spacer,r.updateState((function(e){e._spacer=o}));break;case"builder.resetState":var a=n.data,s=a.state;if(a.model===r.name){for(var l in r.rootState)"function"!=typeof r.rootState[l]&&delete r.rootState[l];Object.assign(r.rootState,s),r.setState(__assign(__assign({},r.state),{state:r.rootState,updates:(r.state&&r.state.updates||0)+1}))}break;case"builder.resetSymbolState":var u=n.data.state,c=(s=u.state,u.model,u.id);if(r.props.builderBlock&&r.props.builderBlock===c){for(var l in r.rootState)delete r.rootState[l];Object.assign(r.rootState,s),r.setState(__assign(__assign({},r.state),{state:r.rootState,updates:(r.state&&r.state.updates||0)+1}))}}},r.resizeFn=function(){var e=r.deviceSizeState;e!==r.state.state.deviceSize&&r.setState(__assign(__assign({},r.state),{updates:(r.state&&r.state.updates||0)+1,state:Object.assign(r.rootState,__assign(__assign({},r.state.state),{deviceSize:e}))}))},r.resizeListener=Builder.isEditing?throttle(r.resizeFn,200):debounce(r.resizeFn,400),r.mounted=!1,r.updateState=function(e){var t=r.rootState;e&&e(t),r.mounted?r.setState({update:r.updateState,state:t,updates:(r.state&&r.state.updates||0)+1}):r.state=__assign(__assign({},r.state),{update:r.updateState,state:t,updates:(r.state&&r.state.updates||0)+1}),r.notifyStateChange()},r.onContentLoaded=function(e,t){if("page"===r.name&&Builder.isBrowser&&e){var n=e.title,i=e.pageTitle,o=e.description,a=e.pageDescription;if((n||i)&&(document.title=n||i),o||a){var s=document.querySelector('meta[name="description"]');s||((s=document.createElement("meta")).setAttribute("name","description"),document.head.appendChild(s)),s.setAttribute("content",o||a)}}if(Builder.isEditing&&r.notifyStateChange(),r.props.contentLoaded&&r.props.contentLoaded(e,t),e&&e.inputs&&Array.isArray(e.inputs)&&e.inputs.length&&(e.state||(e.state={}),e.inputs.forEach((function(t){t&&t.name&&void 0!==t.defaultValue&&void 0===e.state[t.name]&&(e.state[t.name]=t.defaultValue)}))),e&&e.state){var l=__assign(__assign({},r.state),{updates:(r.state&&r.state.updates||0)+1,state:Object.assign(r.rootState,__assign(__assign(__assign(__assign({},r.state.state),{location:r.locationState,deviceSize:r.deviceSizeState,device:r.device}),e.state),r.externalState))});r.mounted?r.setState(l):r.state=l}if(e&&e.jsCode&&Builder.isBrowser&&!r.options.codegen){var u=!1;if(Builder.isEditing&&(r.lastJsCode===e.jsCode?u=!0:r.lastJsCode=e.jsCode),!u){var c=r.state.state;try{new Function("data","ref","state","update","element","Builder","builder","context",e.jsCode)(e,r,c,r.state.update,r.ref,Builder,builder,r.state.context)}catch(t){var d=toError(t);Builder.isBrowser?console.warn("Builder custom code error:",d.message,"in",e.jsCode,d.stack):isDebug()&&console.debug("Builder custom code error:",d.message,"in",e.jsCode,d.stack)}}}if(e&&e.httpRequests&&!r.props.noAsync&&!(u=!1)){var p=function(t){var n=e.httpRequests[t];if(n&&(!r.data[t]||Builder.isEditing))if(Builder.isBrowser){var i=r.evalExpression(n);if(Builder.isEditing&&r.lastHttpRequests[t]===i)return"continue";r.lastHttpRequests[t]=i;var o=n.match(/builder\.io\/api\/v2\/([^\/\?]+)/i);o&&o[1],r.handleRequest(t,i);var a=r.httpSubscriptionPerKey[t];a&&a.unsubscribe();var s=r.httpSubscriptionPerKey[t]=r.onStateChange.subscribe((function(){var e=r.evalExpression(n);e!==i&&(r.handleRequest(t,e),r.lastHttpRequests[t]=e)}));r.subscriptions.add(s)}else r.handleRequest(t,r.evalExpression(n))};for(var f in e.httpRequests)p(f)}};var o=r.inlinedContent;o&&o.content&&(o=o.content),r.sizes=getSizesForBreakpoints((null===(n=null==o?void 0:o.meta)||void 0===n?void 0:n.breakpoints)||{});var a=null===(i=r.inlinedContent)||void 0===i?void 0:i.data;if(a&&Array.isArray(a.inputs)&&a.inputs.length>0&&(a.state||(a.state={}),a.inputs.forEach((function(e){e&&e.name&&void 0!==e.defaultValue&&void 0===a.state[e.name]&&(a.state[e.name]=e.defaultValue)}))),r.state={context:__assign(__assign({},t.context),{apiKey:r.props.apiKey||builder.apiKey}),state:Object.assign(r.rootState,__assign(__assign(__assign(__assign({},r.inlinedContent&&r.inlinedContent.data&&r.inlinedContent.data.state),{isBrowser:Builder.isBrowser,isServer:!Builder.isBrowser,_hydrate:t.hydrate,location:r.locationState,deviceSize:r.deviceSizeState,device:r.device}),r.getHtmlData()),t.data)),updates:0,key:0,update:r.updateState},Builder.isBrowser){var s=r.props.apiKey;if(s&&s!==r.builder.apiKey&&!instancesMap.has(s)){var l=new Builder(s,void 0,void 0,!0);instancesMap.set(s,l)}if(r.inlinedContent){var u=r.inlinedContent.content||r.inlinedContent;r.onContentLoaded(null==u?void 0:u.data,getContentWithInfo(u))}}return r.registerCustomComponents(),r}return __extends(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return __assign(__assign({},t.defaults),this.props)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.props.model||this.props.modelName||this.props.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.ref},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inlinedContent",{get:function(){if(!this.isPreviewing||this.props.inlineContent)return this.props.content},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"builder",{get:function(){return this.props.apiKey&&instancesMap.get(this.props.apiKey)||this.props.builder||builder},enumerable:!1,configurable:!0}),t.prototype.getHtmlData=function(){var e=this.inlinedContent&&this.inlinedContent.id||this.props.entry,t=e&&Builder.isBrowser&&document.querySelector('script[data-builder-json="'.concat(e,'"],script[data-builder-state="').concat(e,'"]'));if(t)try{return JSON.parse(t.innerText)}catch(e){console.warn("Could not parse Builder.io HTML data transfer",e,t.innerText)}return{}},Object.defineProperty(t.prototype,"device",{get:function(){return this.builder.getUserAttributes().device||"desktop"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locationState",{get:function(){return __assign(__assign({},pick(this.location,"pathname","hostname","search","host")),{path:this.location.pathname&&this.location.pathname.split("/").slice(1)||"",query:searchToObject(this.location)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceSizeState",{get:function(){return Builder.isBrowser?this.sizes.getSizeForWidth(window.innerWidth):sizeMap[this.device]||"large"},enumerable:!1,configurable:!0}),t.renderInto=function(e,n,i,r){if(void 0===n&&(n={}),void 0===i&&(i=!0),void 0===r&&(r=!1),console.debug("BuilderPage.renderInto",e,n,i,this),e){var o=null;if("string"==typeof e?o=document.querySelector(e):e instanceof Element&&(o=e),o){var a=o.classList.contains("builder-hydrated");if(!a||r){o.classList.add("builder-hydrated");var s=i&&o.innerHTML.includes("builder-block");if(!o.classList.contains("builder-component")){var l=o.querySelector(".builder-api-styles")||(o.previousElementSibling&&o.previousElementSibling.matches(".builder-api-styles")?o.previousElementSibling:null),u="";if(l)l.innerHTML.replace(/\/\*start:([^\*]+?)\*\/([\s\S]*?)\/\*end:([^\*]+?)\*\//g,(function(e,t,n){var i=null;try{i=document.querySelector('[data-emotion-css="'.concat(t,'"]'))}catch(e){console.warn(e)}return i?i.innerHTML=n:Builder.isEditing||(u+=e),e})),Builder.nextTick((function(){l.innerHTML=u}));var c=o.querySelector(".builder-component");c?o=c:s=!1}location.search.includes("builder.debug=true")&&console.debug("hydrate",s,o);var d=o;if(!a){var p=document.createElement("div");o.insertAdjacentElement("beforebegin",p),p.appendChild(o),d=p}if((Builder.isEditing||Builder.isBrowser&&location.search.includes("builder.preview="))&&(s=!1),s&&o){var f=ReactDOM.render(React__default.createElement(t,__assign({},n)),d,d.builderRootRef);return d.builderRootRef=f,f}var v=ReactDOM.render(React__default.createElement(t,__assign({},n)),d,d.builderRootRef);return d.builderRootRef=v,v}console.debug("Tried to hydrate multiple times")}}},t.prototype.registerCustomComponents=function(){if(this.props.customComponents)for(var e=0,t=this.props.customComponents;e<t.length;e++){var n=t[e];if(n){var i=n.component,r=__rest(n,["component"]);Builder.registerComponent(i,r)}}},t.prototype.componentDidMount=function(){var e,t=this;this.mounted=!0,this.asServer&&(this.asServer=!1,this.updateState((function(e){e.isBrowser=!0,e.isServer=!1}))),Builder.isIframe&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.sdkInjected",data:{modelName:this.name}},"*")),Builder.isBrowser&&(window.addEventListener("resize",this.resizeListener),Builder.isEditing&&window.addEventListener("message",this.messageListener),(Builder.isEditing||Builder.isPreviewing)&&Builder.nextTick((function(){t.firstLoad=!1,t.reload()})),setTimeout((function(){window.dispatchEvent(new CustomEvent("builder:component:load",{detail:{ref:t}}))})))},Object.defineProperty(t.prototype,"isPreviewing",{get:function(){return(Builder.isServer||Builder.isBrowser&&Builder.isPreviewing&&!this.firstLoad)&&builder.previewingModel===this.name},enumerable:!1,configurable:!0}),t.prototype.notifyStateChange=function(){if(!Builder.isServer&&this&&this.state){var e=this.state.state;this.props.onStateChange&&this.props.onStateChange(e),Builder.isBrowser&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:e,ref:this}})),this.onStateChange.next(e)}},t.prototype.processStateFromApi=function(e){return e},Object.defineProperty(t.prototype,"location",{get:function(){return this.props.location||(Builder.isBrowser?location:{})},enumerable:!1,configurable:!0}),t.prototype.getCssFromFont=function(e,t){var n=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),i=n.split(",")[0],r=e.fileUrl?e.fileUrl:e.files&&e.files.regular,o="";if(r&&n&&i&&(o+='\n@font-face {\n font-family: "'.concat(n,'";\n src: local("').concat(i,"\"), url('").concat(r,"') format('woff2');\n font-display: fallback;\n font-weight: 400;\n}\n ").trim()),e.files)for(var a in e.files){if(String(Number(a))===a){var s=e.files[a];s&&s!==r&&(o+='\n@font-face {\n font-family: "'.concat(n,"\";\n src: url('").concat(s,"') format('woff2');\n font-display: fallback;\n font-weight: ").concat(a,";\n}\n ").trim())}}return o},t.prototype.componentWillUnmount=function(){this.unsubscribe(),Builder.isBrowser&&(window.removeEventListener("resize",this.resizeListener),window.removeEventListener("message",this.messageListener))},t.prototype.getFontCss=function(e){var t=this;return this.builder.allowCustomFonts&&(null==e?void 0:e.customFonts)&&e.customFonts.length&&e.customFonts.map((function(n){return t.getCssFromFont(n,e)})).join(" ")||""},t.prototype.ensureFontsLoaded=function(e){if(this.builder.allowCustomFonts&&(null==e?void 0:e.customFonts)&&Array.isArray(e.customFonts))for(var t=0,n=e.customFonts;t<n.length;t++){var i=n[t],r=i.fileUrl?i.fileUrl:i.files&&i.files.regular;if(!fontsLoaded.has(r)){var o=this.getCssFromFont(i,e);if(fontsLoaded.add(r),!o)continue;var a=document.createElement("style");a.className="builder-custom-font",a.setAttribute("data-builder-custom-font",r),a.innerHTML=o,document.head.appendChild(a)}}},t.prototype.getCss=function(e){var t,n=null===(t=this.useContent)||void 0===t?void 0:t.id,i=(null==e?void 0:e.cssCode)||"";return n&&(i=i.replace(/&/g,".builder-component-".concat(n))),i+this.getFontCss(e)},Object.defineProperty(t.prototype,"data",{get:function(){var e,t=__assign(__assign(__assign({},this.inlinedContent&&(null===(e=this.inlinedContent.data)||void 0===e?void 0:e.state)),this.externalState),this.state.state);return Object.assign(this.rootState,t),t},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(e){var t=this;this.props.data&&e.data!==this.props.data&&this.state.update((function(e){Object.assign(e,t.externalState)})),this.props.customComponents&&this.props.customComponents!==e.customComponents&&this.registerCustomComponents(),Builder.isEditing&&this.inlinedContent&&e.content!==this.inlinedContent&&this.onContentLoaded(this.inlinedContent.data,this.inlinedContent)},t.prototype.checkStyles=function(e){if(this.styleRef){var t=this.getCss(e);this.styleRef.innerHTML!==t&&(this.styleRef.innerHTML=t)}},t.prototype.reload=function(){this.setState({key:this.state.key+1})},Object.defineProperty(t.prototype,"content",{get:function(){var e=this.inlinedContent;return e&&e.content&&(e=__assign(__assign({},e),{data:e.content})),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"externalState",{get:function(){return __assign(__assign({},this.props.data),this.props.locale?{locale:this.props.locale}:{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useContent",{get:function(){return this.content||this.state.context.builderContent},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e,t=this,n=this.content,i=Builder.isBrowser&&this.externalState&&size(this.externalState)&&hash(this.externalState),r=Builder.isEditing?this.name:this.props.entry;r&&!Builder.isEditing&&i&&i.length<300&&(r+=":"+i);var o=this.props.dataOnly?React__default.Fragment:"div",a=null===(e=this.useContent)||void 0===e?void 0:e.id;return React__default.createElement(o,{onClick:function(e){!Builder.isEditing||t.props.isChild||t.props.stopClickPropagationWhenEditing||e.stopPropagation()},className:"builder-component ".concat(a?"builder-component-".concat(a):""),"data-name":this.name,"data-source":"Rendered by Builder.io",key:this.state.key,ref:function(e){return t.ref=e}},React__default.createElement(BuilderMetaContext.Consumer,null,(function(e){return React__default.createElement(BuilderMetaContext.Provider,{value:"boolean"==typeof t.props.ampMode?__assign(__assign({},e),{ampMode:t.props.ampMode}):e},React__default.createElement(BuilderAsyncRequestsContext.Consumer,null,(function(e){var i;return t._asyncRequests=e&&e.requests,t._errors=e&&e.errors,t._logs=e&&e.logs,React__default.createElement(BuilderContent,{isStatic:t.props.isStatic||Builder.isStatic,key:(null===(i=t.inlinedContent)||void 0===i?void 0:i.id)||("content"in t.props&&!t.isPreviewing?"null-content-prop":"no-content-prop"),builder:t.builder,ref:function(e){return t.contentRef=e},contentLoaded:function(e,n){return t.onContentLoaded(e,n)},options:__assign(__assign(__assign(__assign(__assign(__assign({key:r,entry:t.props.entry},n&&{initialContent:[n]}),!n&&"content"in t.props&&!t.isPreviewing&&{initialContent:[]}),t.props.url&&{url:t.props.url}),t.props.options),t.props.locale?{locale:t.props.locale}:{}),t.options.codegen&&{format:"react"}),inline:t.props.inlineContent||!t.isPreviewing&&"content"in t.props,contentError:t.props.contentError,modelName:t.name||"page"},(function(e,n,i){var r;if(t.props.dataOnly)return null;i&&i.id&&(t.state.breakpoints&&(i.meta=i.meta||{},i.meta.breakpoints=t.state.breakpoints),t.state.context.builderContent=i),Builder.isBrowser&&Builder.nextTick((function(){t.checkStyles(e)}));var o=t.options.codegen;if(o&&!t.Component&&(null==e?void 0:e.blocksJs)){var a=Array.from(new Set(Builder.components.map((function(e){return e.name})))),s=Builder.components.slice().reverse(),l=a.map((function(e){return s.find((function(t){return t.class&&t.name===e}))})),u=a.map((function(e){return(e||"").replace(/[^\w]+/gi,"")})),c=l.map((function(e){return wrapComponent(e)}));t.Component=(new(Function.bind.apply(Function,__spreadArray(__spreadArray([void 0,"jsx","_css","Builder","builder","React","useBuilderState"],u,!1),[e.blocksJs],!1)))).apply(void 0,__spreadArray([jsx,css,Builder,builder,React__default,function(e){var t=React__default.useState(0)[1];return React__default.useState((function(){return onChange(e,(function(){t((function(e){return e+1}))}))}))[0]}],c,!1))}var d=(null==e?void 0:e.blocks)||[],p=d.find((function(e){var t;return null===(t=e.id)||void 0===t?void 0:t.startsWith("builder-pixel")}));return e&&!p&&d.length>0&&d.push(getBuilderPixel(builder.apiKey)),e?React__default.createElement("div",__assign({"data-builder-component":t.name,"data-builder-content-id":i.id},t.isPreviewing?{"data-builder-variation-id":i.testVariationId||i.variationId||i.id}:{}),!o&&t.getCss(e)&&React__default.createElement("style",{ref:function(e){return t.styleRef=e},className:"builder-custom-styles",dangerouslySetInnerHTML:{__html:t.getCss(e)}}),React__default.createElement(BuilderStoreContext.Provider,{value:__assign(__assign({},t.state),{rootState:t.rootState,state:t.data,content:i,renderLink:t.props.renderLink})},o&&t.Component?React__default.createElement(t.Component,{data:t.data,context:t.state.context}):React__default.createElement(BuilderBlocks,{key:String(!!(null===(r=null==e?void 0:e.blocks)||void 0===r?void 0:r.length)),emailMode:t.props.emailMode,fieldName:"blocks",blocks:d}))):n?React__default.createElement("div",{"data-builder-component":t.name,className:"builder-loading"},t.props.children):React__default.createElement("div",{"data-builder-component":t.name,className:"builder-no-content"})}))})))})))},t.prototype.evalExpression=function(e){var t=this,n=this.data;return String(e).replace(/{{([^}]+)}}/g,(function(e,i){return tryEval(i,n,t._errors)}))},t.prototype.handleRequest=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a=this;return __generator(this,(function(s){return Builder.isIframe&&fetchCache[t]?(this.updateState((function(n){n[e]=fetchCache[t]})),[2,fetchCache[t]]):(n=function(){return __awaiter(a,void 0,void 0,(function(){var n,i,r,o;return __generator(this,(function(a){switch(a.label){case 0:n=Date.now(),Builder.isBrowser||console.time("Fetch "+t),a.label=1;case 1:return a.trys.push([1,4,5,6]),[4,fetch(t)];case 2:return[4,a.sent().json()];case 3:return i=a.sent(),[3,6];case 4:return r=a.sent(),o=toError(r),this._errors&&this._errors.push(o),this._logs&&this._logs.push("Fetch to ".concat(t," errored in ").concat(Date.now()-n,"ms")),[2];case 5:return Builder.isBrowser||(console.timeEnd("Fetch "+t),this._logs&&this._logs.push("Fetched ".concat(t," in ").concat(Date.now()-n,"ms"))),[7];case 6:return i&&(Builder.isIframe&&(fetchCache[t]=i),this.updateState((function(t){t[e]=i}))),[2,i]}}))}))},(i=this._asyncRequests&&this._asyncRequests.find((function(e){return isRequestInfo(e)&&e.url===t})))?((r=i.promise).then((function(t){t&&a.updateState((function(n){n[e]=t}))})),[2,r]):(o=n(),Builder.nextTick((function(){a._asyncRequests&&a._asyncRequests.push(o)})),[2,o]))}))}))},t.prototype.unsubscribe=function(){this.subscriptions&&(this.subscriptions.unsubscribe(),this.subscriptions=new Subscription)},t.prototype.handleBuilderRequest=function(e,t){var n=this,i=tryEval(t,this.data,this._errors);this.subscriptions&&this.unsubscribe(),i&&this.subscriptions.add(this.builder.queueGetContent(i.model,i).subscribe((function(t){t&&n.updateState((function(n){n[e]=t}))})))},t.defaults={codegen:Boolean(Builder.isBrowser&&location.href.includes("builder.codegen=true"))},__decorate([debounceNextTick,__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],t.prototype,"notifyStateChange",null),t}(React__default.Component),withChildren=function(e){var t=React__default.forwardRef((function(t,n){var i=t.children||t.builderBlock&&t.builderBlock.children&&t.builderBlock.children.map((function(e){return React__default.createElement(BuilderBlock,{key:e.id,block:e})}));return React__default.createElement(e,__assign({},t,{ref:n}),i)}));return t.builderOptions={canHaveChildren:!0},t};function useIsPreviewing(){var e=useState(!1),t=e[0],n=e[1];return useEffect((function(){(Builder.isEditing||Builder.isPreviewing)&&n(!0)}),[]),t}Builder.isReact=!0;export{BuilderAsyncRequestsContext,BuilderBlock as BuilderBlockComponent,BuilderBlocks,BuilderComponent,BuilderContent,BuilderMetaContext,BuilderComponent as BuilderPage,BuilderStoreContext,stringToFunction,useIsPreviewing,withChildren}; | ||
import{Builder,builder,Subscription,BehaviorSubject}from"@builder.io/sdk";export{Builder,builder,builder as default}from"@builder.io/sdk";import{jsx,ClassNames,css}from"@emotion/core";import*as React from"react";import React__default,{useState,useEffect}from"react";import ReactDOM from"react-dom";import hash from"hash-sum";var version="3.0.14-0",_a;"undefined"!=typeof window&&(null===(_a=window.parent)||void 0===_a||_a.postMessage({type:"builder.isReactSdk",data:{value:!0,supportsPatchUpdates:"v4",supportsCustomBreakpoints:!0,supportsGlobalSymbols:!0,priorVersion:version}},"*"));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function __rest(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function __decorate(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function __generator(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var fastClone=function(e){return JSON.parse(JSON.stringify(e))},sizeNames=["xsmall","small","medium","large"],sizes={xsmall:{min:0,default:0,max:0},small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200},getWidthForSize:function(e){return this[e].default},getSizeForWidth:function(e){for(var t=0,n=sizeNames;t<n.length;t++){var i=n[t];if(e<=this[i].max)return i}return"large"}},getSizesForBreakpoints=function(e){var t=e.small,n=e.medium,i=__assign(__assign({},sizes),fastClone(sizes));if(!t||!n)return i;var r=Math.floor(t/2);i.small={max:t,min:r,default:r+1};var o=i.small.max+1;i.medium={max:n,min:o,default:o+1};var a=i.medium.max+1;return i.large={max:2e3,min:a,default:a+1},i},set=function(e,t,n){if(Object(e)!==e)return e;var i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((function(e,t,n){return Object(e[t])===e[t]?e[t]:e[t]=Math.abs(Number(i[n+1]))>>0==+i[n+1]?[]:{}}),e)[i[i.length-1]]=n,e},noop=function(){return null},safeDynamicRequire;if("function"==typeof(null===globalThis||void 0===globalThis?void 0:globalThis.require)||Builder.isServer&&"function"==typeof require)try{safeDynamicRequire=eval("require")}catch(e){safeDynamicRequire=(null===globalThis||void 0===globalThis?void 0:globalThis.require)?globalThis.require:noop}function isDebug(){return Boolean("undefined"!=typeof process&&void 0!==process.env&&process.env.DEBUG)}null!=safeDynamicRequire||(safeDynamicRequire=noop);var fnCache={},api=function(e){return builder};function stringToFunction(e,t,n,i){if(void 0===t&&(t=!0),!e||!e.trim())return function(){};var r=e+":"+t;if(fnCache[r])return fnCache[r];var o=t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))||e.trim().startsWith("builder.run"),a=function(){};try{Builder.isBrowser&&(a=new Function("state","event","block","builder","Device","update","Builder","context","\n var names = [\n 'state',\n 'event',\n 'block',\n 'builder',\n 'Device',\n 'update',\n 'Builder',\n 'context'\n ];\n var rootState = state;\n if (typeof Proxy !== 'undefined') {\n rootState = new Proxy(rootState, {\n set: function () {\n return false;\n },\n get: function (target, key) {\n if (names.includes(key)) {\n return undefined;\n }\n return target[key];\n }\n });\n }\n /* Alias */\n var ctx = context;\n var log = console.log.bind(console);\n with (rootState) {\n ".concat(o?"return (".concat(e,");"):e,";\n }\n ")))}catch(t){n&&n.push(t);var s=t&&t.message;s&&"string"==typeof s&&i&&-1===i.indexOf(s)&&i.push(s),Builder.isBrowser&&console.warn("Function compile error in ".concat(e),t)}var l=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];try{if(Builder.isBrowser)return a.apply(void 0,t);var r=getIsolateContext(),s=safeDynamicRequire("isolated-vm"),l=r.evalClosureSync(makeFn(e,o),t.map((function(e,t){return"object"==typeof e?new s.Reference(t===indexOfBuilderInstance?__assign(__assign({},e),{getUserAttributes:function(){return e.getUserAttributes("")}}):e):null})));try{var u=JSON.parse(l);return u}catch(e){return l}}catch(t){return Builder.isBrowser?console.warn("Builder custom code error:",t.message||t,"in",e,t.stack||t):isDebug()&&console.debug("Builder custom code error:",t.message||t,"in",e,t.stack||t),n&&n.push(t),null}};return Builder.isBrowser&&(fnCache[r]=l),l}var indexOfBuilderInstance=3,makeFn=function(e,t,n){var i=n||["state","event","block","builder","Device","update","Builder","context"];return"\n".concat("\n var refToProxy = (obj) => {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n return new Proxy({}, {\n get(target, key) {\n if (key === 'copySync') {\n return () => obj.copySync();\n }\n const val = obj.getSync(key);\n if (typeof val?.getSync === 'function') {\n return refToProxy(val);\n }\n return val;\n },\n set(target, key, value) {\n obj.setSync(key, value);\n },\n deleteProperty(target, key) {\n obj.deleteSync(key);\n }\n })\n }\n","\n").concat("\n var stringify = (val) => {\n if (typeof val === 'object' && val !== null) {\n return JSON.stringify(val.copySync ? val.copySync() : val);\n }\n return val;\n }\n ","\n").concat(i.map((function(e,t){return"var ".concat(e," = refToProxy($").concat(t,");")})).join("\n")).concat("\n".concat(i.includes("context")?"var ctx = context;":"","\n").concat(t?"return stringify(".concat(e,");"):e,";\n"))},getIsolateContext=function(){var e=Builder.serverContext;e||(e=new(safeDynamicRequire("isolated-vm").Isolate)({memoryLimit:128}).createContextSync(),Builder.setServerContext(e));var t=e.global;return t.setSync("global",t.derefInto()),t.setSync("log",(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];isDebug()&&console.log.apply(console,e)})),e},isPromise=function(e){return"function"==typeof e.then},isRequestInfo=function(e){return!isPromise(e)},BuilderAsyncRequestsContext=React__default.createContext({requests:[],errors:[],logs:[]}),BuilderStoreContext=React__default.createContext({state:{},rootState:{},content:{},context:{},update:function(e){return null}}),applyPatchWithMinimalMutationChain=function(e,t,n){if(void 0===n&&(n=!1),Object(e)!==e)return e;var i=t.path,r=t.op,o=t.value,a=i.split(/\//);""===a[0]&&a.shift();for(var s=n?e:__assign({},e),l=s,u=0;u<a.length;u++){var c=u===a.length-1,d=a[u];if(c){if("replace"===r)l[d]=o;else if("add"===r){var p=Number(d);Array.isArray(l)?"-"===d?l.push(o):l.splice(p,0,o):l[d]=o}else if("remove"===r){p=Number(d);Array.isArray(l)?l.splice(p,1):delete l[d]}}else{var f=a[u+1],v=Object(l[d])===l[d]?l[d]:String(Number(f))===f?[]:{};l=l[d]=Array.isArray(v)?__spreadArray([],v,!0):__assign({},v)}}return s},htmlEscape=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},blockToHtmlString=function(e){var t;return"<".concat(htmlEscape(e.tagName||"div"),' \n class="builder-block ').concat(e.id," ").concat(e.class||"",'"\n builder-id="').concat(e.id,'"\n ').concat(Object.keys(e.properties||{}).map((function(t){return"".concat(htmlEscape(t),'="').concat(htmlEscape(e.properties[t]),'"')})).join(" "),"\n >").concat("Text"===(null===(t=null==e?void 0:e.component)||void 0===t?void 0:t.name)?e.component.options.text:e.children?e.children.map((function(e){return blockToHtmlString(e)})).join(""):"","</").concat(e.tagName||"div",">").replace(/\s+/g," ")},Link=function(e){return React__default.createElement(BuilderStoreContext.Consumer,null,(function(t){return t.renderLink?t.renderLink(e):React__default.createElement("a",__assign({},e))}))},camelCaseToKebabCase=function(e){return e?e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())})):""},kebabCaseToCamelCase=function(e){return void 0===e&&(e=""),e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))},Device={desktop:0,tablet:1,mobile:2},voidElements=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","textarea"]),last=function(e){return e[e.length-1]};function omit$1(e,t){for(var n=Object.assign({},e),i=0,r=t;i<r.length;i++){delete n[r[i]]}return n}var cssCase=function(e){if(!e)return e;var t=camelCaseToKebabCase(e);return e[0]===e[0].toUpperCase()&&(t="-"+t),t};function capitalize(e){if(e)return e[0].toUpperCase()+e.slice(1)}var BuilderBlock=function(_super){function BuilderBlock(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.state={hasError:!1,updates:0},_this.privateState={state:{},rootState:{},context:{},update:function(){}},_this.onWindowMessage=function(event){var message=event.data;if(message)switch(message.type){case"builder.selectionChange":var data=message.data;if(!data)break;var selection=data.selection,id=_this.block&&_this.block.id;id&&Array.isArray(selection)&&selection.indexOf(id)>-1&&setTimeout((function(){window.$block=_this,window.$blocks||(window.$blocks=[]),window.$blocks.push(_this)}));break;case"builder.patchUpdates":var data=message.data;if(!data||!data.data)break;var patches=data.data[_this.block.id];if(!patches)return;location.href.includes("builder.debug=true")&&eval("debugger");for(var _i=0,patches_1=patches;_i<patches_1.length;_i++){var patch=patches_1[_i];applyPatchWithMinimalMutationChain(_this.props.block,patch,!0)}_this.setState({updates:_this.state.updates+1})}},_this}return __extends(BuilderBlock,_super),Object.defineProperty(BuilderBlock.prototype,"store",{get:function(){return this.privateState},enumerable:!1,configurable:!0}),BuilderBlock.getDerivedStateFromError=function(e){return{hasError:!0}},BuilderBlock.prototype.componentDidCatch=function(e,t){console.error("Builder block error:",e,t)},BuilderBlock.prototype.stringToFunction=function(e,t){return void 0===t&&(t=!0),stringToFunction(e,t,this._errors,this._logs)},Object.defineProperty(BuilderBlock.prototype,"block",{get:function(){return this.props.block},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderBlock.prototype,"emotionCss",{get:function(){var e,t,n,i,r,o=this.block;if(Builder.isServer){var a=o.animations&&o.animations[0];if(a&&"hover"!==a.trigger){var s=a&&a.steps&&a.steps[0],l=s&&s.styles;l&&(r=l)}}var u=sizeNames.slice().reverse(),c=this.block,d={};if(c.responsiveStyles)for(var p=0,f=u;p<f.length;p++){var v=f[p];if("large"===v)this.props.emailMode||(d["&.builder-block"]=Object.assign({},c.responsiveStyles[v],r));else{var m=getSizesForBreakpoints((null===(t=null===(e=this.privateState.context.builderContent)||void 0===e?void 0:e.meta)||void 0===t?void 0:t.breakpoints)||{});d["@media only screen and (max-width: ".concat(m[v].max,"px)")]={"&.builder-block":c.responsiveStyles[v]}}}var h=o.animations&&o.animations.find((function(e){return"hover"===e.trigger}));return h&&(d[":hover"]=(null===(i=null===(n=h.steps)||void 0===n?void 0:n[1])||void 0===i?void 0:i.styles)||{},d.transition="all ".concat(h.duration,"s ").concat(camelCaseToKebabCase(h.easing)),h.delay&&(d.transitionDelay=h.delay+"s")),d},enumerable:!1,configurable:!0}),BuilderBlock.prototype.eval=function(e){return this.stringToFunction(e)(this.privateState.state,void 0,this.block,builder,Device,this.privateState.update,Builder,this.privateState.context)},BuilderBlock.prototype.componentWillUnmount=function(){Builder.isEditing&&removeEventListener("message",this.onWindowMessage)},BuilderBlock.prototype.componentDidMount=function(){var e,t=this,n=this.block,i=n&&n.animations;if(Builder.isEditing&&addEventListener("message",this.onWindowMessage),i){var r={animations:fastClone(i)};if(n.bindings)for(var o in n.bindings)if((null===(e=o.trim)||void 0===e?void 0:e.call(o))&&o.startsWith("animations.")){var a=this.stringToFunction(n.bindings[o]);void 0!==a&&set(r,o,a(this.privateState.state,null,n,builder,null,null,Builder,this.privateState.context))}Builder.animator.bindAnimations(r.animations.filter((function(e){return"hover"!==e.trigger})).map((function(e){return __assign(__assign({},e),{elementId:t.block.id})})))}},BuilderBlock.prototype.getElement=function(e,t){var n,i,r,o,a,s=this;void 0===e&&(e=0),void 0===t&&(t=this.privateState.state);var l=this.props;l.child,l.fieldName;var u,c=this.block,d=(c.tagName||"div").toLowerCase();if("template"===d){var p=c.children?c.children.map((function(e){return blockToHtmlString(e)})).join(" "):"";return console.debug("template html",p),jsx("template",__assign({},c.properties,{dangerouslySetInnerHTML:{__html:p}}))}var f=c.component&&(c.component.name||c.component.component),v=null;c.component&&!c.component.class&&(c.component&&c.component.tag?u=c.component.tag:(v=Builder.components.find((function(e){return e.name===f}))||null)&&v.class?u=v.class:v&&v.tag?u=v.tag:(null==f?void 0:f.startsWith("Builder:"))?console.warn("Missing @builder.io/widgets installation, please install and import @builder.io/widgets to use ".concat(f.split(":")[1]," in your content, more info here: https://github.com/BuilderIO/builder/tree/main/packages/widgets")):f&&console.warn("Missing registration for ".concat(f,", have you included the registration in your bundle?")));var m=__assign(__assign({},c.properties),{style:{}});if(m=__assign(__assign({},m.properties),m),c.component&&(m.component=fastClone(c.component)),c.bindings)for(var h in c.bindings)if(null===(i=h.trim)||void 0===i?void 0:i.call(h)){var g=this.stringToFunction(c.bindings[h]);set(m,h,g(t,null,c,api(),Device,null,Builder,this.privateState.context))}if(m.hide)return null;if(delete m.hide,("show"in m||c.bindings&&c.bindings.show)&&!m.show)return null;if(delete m.show,c.actions){var b=function(e){if(!(null===(r=e.trim)||void 0===r?void 0:r.call(e)))return"continue";var n=c.actions[e];m["on"+capitalize(e)]=function(e){var i=t;return"undefined"!=typeof Proxy&&(i=new Proxy(t,{set:function(e,t,n){return e[t]=n,s.privateState.rootState[t]=n,!0}})),s.stringToFunction(n,!1)(i,e,s.block,builder,Device,s.privateState.update,Builder,s.privateState.context)}};for(var h in c.actions)b(h)}var y=(m.component||m.options)&&__assign(__assign({},m.options),m.component.options||m.component.data),_=voidElements.has(d),B=v&&(v.fragment||v.noWrap),k=(null===(o=m.attr)||void 0===o?void 0:o.style)||("string"==typeof m.style?m.style:"")||"";if("string"==typeof k){"object"!=typeof m.style&&(m.style={});for(var S=0,C=k.split(";");S<C.length;S++){var w=C[S].split(":");if(!w.length)return;h=w[0],g=w[1];h&&(w.length>2&&(g=w.slice(1).join(":")),m.style[kebabCaseToCamelCase(h)]=g)}}var x=__assign(__assign(__assign({},omit$1(m,["class","component","attr"])),((n={})["string"!=typeof d||d.includes("-")?"class":"className"]="builder-block ".concat(this.id).concat(c.class?" ".concat(c.class):"").concat(!c.component||["Image","Video","Banner"].indexOf(f)>-1?"":" builder-has-component")+(m.class?" "+m.class:"")+(Builder.isEditing&&(null===(a=this.privateState.state._spacer)||void 0===a?void 0:a.parent)===c.id?" builder-spacer-parent":""),n.key=this.id+e,n["builder-id"]=this.id,n)),0!==e&&{"builder-index":e});Builder.isEditing&&(x["builder-inline-styles"]=m.attr&&m.attr.style?Object.keys(m.style).reduce((function(e,t){return(e?"".concat(e,";"):"")+"".concat(cssCase(t),":").concat(m.style[t],";")}),""):""),(x.properties&&x.properties.href||x.href)&&"div"===d&&(d="a"),"a"===d&&(d=Link);var E=c.children||x.children||[];return jsx(React__default.Fragment,null,jsx(ClassNames,null,(function(e){var t=e.css;if(e.cx,!s.props.emailMode){var n=" "+t(s.emotionCss);x.class&&(x.class+=n),x.className&&(x.className+=n)}return jsx(BuilderAsyncRequestsContext.Consumer,null,(function(e){return s._asyncRequests=e&&e.requests,s._errors=e&&e.errors,s._logs=e&&e.logs,_?jsx(d,__assign({},x)):u&&(B||s.props.emailMode)?jsx(u,__assign({},y,{attributes:x,builderBlock:c,builderState:s.privateState})):jsx(d,__assign({},x),u&&jsx(u,__assign({builderState:s.privateState,builderBlock:c},y)),c.text||m.text?m.text:!u&&E&&Array.isArray(E)&&E.length?E.map((function(e,t){return jsx(BuilderBlock,{key:(s.id||"")+t,block:e,index:t,size:s.props.size,fieldName:s.props.fieldName,child:s.props.child,emailMode:s.props.emailMode})})):null)}))})))},Object.defineProperty(BuilderBlock.prototype,"id",{get:function(){var e=this.block;return e.id.startsWith("builder")?e.id:"builder-"+e.id},enumerable:!1,configurable:!0}),BuilderBlock.prototype.contents=function(e){var t=this,n=this.block;if(this.privateState=e,n.repeat&&n.repeat.collection){var i=n.repeat.collection,r=last((i||"").trim().split("(")[0].trim().split(".")),o=n.repeat.itemName||(r?r+"Item":"item"),a=this.stringToFunction(i)(e.state,null,n,api(),Device,null,Builder,this.privateState.context);return Array.isArray(a)?a.map((function(n,i){var r,a=__assign(__assign({},e.state),((r={$index:i,$item:n})[o]=n,r["$".concat(o,"Index")]=i,r));return jsx(BuilderStoreContext.Provider,{key:i,value:__assign(__assign({},e),{state:a})},t.getElement(i,a))})):null}return this.getElement()},BuilderBlock.prototype.render=function(){var e=this;return this.state.hasError?jsx("span",{css:{display:"inline-block",padding:5,color:"#999",fontSize:11,fontStyle:"italic"}},"Builder block error :( Check console for details"):jsx(BuilderStoreContext.Consumer,null,(function(t){return e.contents(t)}))},BuilderBlock}(React__default.Component),BuilderBlocks=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClickEmptyBlocks=function(){var e;Builder.isIframe&&t.noBlocks&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:t.parentId,dataPath:t.path}},"*"))},t.onHoverEmptyBlocks=function(){var e;Builder.isEditing&&t.noBlocks&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:t.parentId,dataPath:t.path}},"*"))},t}return __extends(t,e),Object.defineProperty(t.prototype,"isRoot",{get:function(){return!this.props.child},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noBlocks",{get:function(){var e=this.props.blocks;return!(e&&e.length)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){var e=this.props.dataPath||"";return e.trim()&&(e.startsWith("this.")?e=e.replace("this.",""):e.startsWith("component.options.")||(e="component.options."+e)),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.props.parentElementId?this.props.parentElementId:this.props.parent&&this.props.parent.id},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props.blocks,n=this.props.emailMode?"span":"div";return jsx(n,__assign({className:"builder-blocks"+(this.noBlocks?" no-blocks":"")+(this.props.child?" builder-blocks-child":"")+(this.props.className?" "+this.props.className:""),"builder-type":"blocks","builder-path":Builder.isIframe?this.path:void 0,"builder-parent-id":this.parentId,css:__assign(__assign({},!this.props.emailMode&&{display:"flex",flexDirection:"column",alignItems:"stretch"}),this.props.style),onClick:function(){e.noBlocks&&e.onClickEmptyBlocks()}},Builder.isEditing&&{onMouseEnter:function(){return e.onHoverEmptyBlocks()}}),t&&Array.isArray(t)&&t.map((function(t,n){return t&&"@builder.io/sdk:Element"===t["@type"]?jsx(BuilderBlock,{key:t.id,block:t,index:n,fieldName:e.props.fieldName,child:e.props.child,emailMode:e.props.emailMode}):t}))||t)},t.renderInto=function(e,n,i){if(void 0===n&&(n={}),e){var r=null;return"string"==typeof e?r=document.querySelector(e):e instanceof Element&&(r=e),ReactDOM.render(jsx(BuilderStoreContext.Provider,{value:i},jsx(t,__assign({},n))),r)}},t}(React__default.Component),NoWrap=function(e){return e.children};function getData(e){if(void 0!==(null==e?void 0:e.data)){var t=e.data,n=t.blocks,i=t.blocksString,r=Array.isArray(n)||"string"==typeof i,o=__assign(__assign({},e.data),r&&{blocks:n||JSON.parse(i)});return delete o.blocksString,o}}var variantsScript=function(e,t){return"\n(function() {\n if (window.builderNoTrack || !navigator.cookieEnabled) {\n return;\n }\n\n var variants = ".concat(e,";\n function removeVariants() {\n variants.forEach(function (template) {\n document.querySelector('template[data-template-variant-id=\"' + template.id + '\"]').remove();\n });\n document.getElementById('variants-script-").concat(t,'\').remove();\n }\n\n if (typeof document.createElement("template").content === \'undefined\') {\n removeVariants();\n return ;\n }\n\n function setCookie(name,value,days) {\n var expires = "";\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days*24*60*60*1000));\n expires = "; expires=" + date.toUTCString();\n }\n document.cookie = name + "=" + (value || "") + expires + "; path=/" + "; Secure; SameSite=None";\n }\n\n function getCookie(name) {\n var nameEQ = name + "=";\n var ca = document.cookie.split(\';\');\n for(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==\' \') c = c.substring(1,c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);\n }\n return null;\n }\n var cookieName = \'builder.tests.').concat(t,"';\n var variantInCookie = getCookie(cookieName);\n var availableIDs = variants.map(function(vr) { return vr.id }).concat('").concat(t,"');\n var variantId;\n if (availableIDs.indexOf(variantInCookie) > -1) {\n variantId = variantInCookie;\n }\n if (!variantId) {\n var n = 0;\n var random = Math.random();\n for (var i = 0; i < variants.length; i++) {\n var variant = variants[i];\n var testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n variantId = variant.id;\n break;\n }\n }\n if (!variantId) {\n variantId = \"").concat(t,'";\n setCookie(cookieName, "').concat(t,'");\n }\n }\n if (variantId && variantId !== "').concat(t,"\") {\n var winningTemplate = document.querySelector('template[data-template-variant-id=\"' + variantId + '\"]');\n if (winningTemplate) {\n var parentNode = winningTemplate.parentNode;\n var newParent = parentNode.cloneNode(false);\n newParent.appendChild(winningTemplate.content.firstChild);\n parentNode.parentNode.replaceChild(newParent, parentNode);\n }\n } else if (variants.length > 0) {\n removeVariants();\n }\n})()").replace(/\s+/g," ")},VariantsProvider=function(e){var t=e.initialContent,n=e.children;if(Builder.isBrowser&&!builder.canTrack)return n([t]);if(!Boolean(Object.keys((null==t?void 0:t.variations)||{}).length))return n([t]);var i=Object.keys(t.variations).map((function(e){return __assign(__assign({id:e},t.variations[e]),{data:getData(t.variations[e])})})),r=__spreadArray(__spreadArray([],i,!0),[t],!1);if(Builder.isServer){var o=JSON.stringify(Object.keys(t.variations||{}).map((function(e){return{id:e,testRatio:t.variations[e].testRatio}})));return React.createElement(React.Fragment,null,n(r,(function(){return React.createElement("script",{id:"variants-script-".concat(t.id),dangerouslySetInnerHTML:{__html:variantsScript(o,t.id)}})})))}var a="builder.tests.".concat(t.id),s=builder.getCookie(a);if(!s&&Builder.isBrowser)for(var l=0,u=Math.random(),c=0;c<i.length;c++){var d=i[c];if(u<(l+=d.testRatio)){builder.setCookie(a,d.id),s=d.id;break}}return s||(s=t.id,builder.setCookie(a,s)),n([r.find((function(e){return e.id===s}))])},BuilderContent=function(_super){function BuilderContent(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.ref=null,_this.state={loading:!_this.props.content,data:getContentWithInfo(_this.props.content),updates:1},_this.onWindowMessage=function(event){var _a,_b,message=event.data;if(message)switch(message.type){case"builder.patchUpdates":if(null===(_a=_this.props.options)||void 0===_a?void 0:_a.noEditorUpdates)return;var data=message.data;if(!data||!data.data)break;var patches=data.data[null===(_b=_this.state.data)||void 0===_b?void 0:_b.id];if(!patches||!patches.length)return;location.href.includes("builder.debug=true")&&eval("debugger");for(var newData=_this.state.data,_i=0,patches_1=patches;_i<patches_1.length;_i++){var patch=patches_1[_i];newData=applyPatchWithMinimalMutationChain(newData,patch,!1)}_this.setState({updates:_this.state.updates+1,data:newData}),_this.props.contentLoaded&&_this.props.contentLoaded(newData.data,newData)}},_this.subscriptions=new Subscription,_this.firstLoad=!0,_this.clicked=!1,_this.trackedImpression=!1,_this.intersectionObserver=null,_this.onClick=function(e){var t=e.nativeEvent,n=_this.data;n&&(builder.autoTrack&&_this.builder.trackInteraction(n.id,_this.renderedVariantId,_this.clicked,t,{content:n}),_this.clicked||(_this.clicked=!0))},_this}return __extends(BuilderContent,_super),Object.defineProperty(BuilderContent.prototype,"builder",{get:function(){return this.props.builder||builder},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"name",{get:function(){var e=this.props;return"model"in e?e.model:e.modelName},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"renderedVariantId",{get:function(){var e,t,n=this.props.isStatic?this.builder.getCookie("builder.tests.".concat(null===(e=this.data)||void 0===e?void 0:e.id)):null===(t=this.data)||void 0===t?void 0:t.variationId;if(null!==n)return n},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"options",{get:function(){var e,t,n=__assign({},this.props.options||{});return n.key||!(null===(e=this.props.content)||void 0===e?void 0:e.id)||Builder.isEditing||Builder.isPreviewing||(n.key=this.props.content.id),!this.props.content||(null===(t=n.initialContent)||void 0===t?void 0:t.length)||!this.props.inline&&Builder.isPreviewing||(n.initialContent=[this.props.content]),n},enumerable:!1,configurable:!0}),Object.defineProperty(BuilderContent.prototype,"data",{get:function(){var e=(this.props.inline||!Builder.isBrowser||this.firstLoad)&&this.options.initialContent&&this.options.initialContent[0]||this.state.data;return getContentWithInfo(e)},enumerable:!1,configurable:!0}),BuilderContent.prototype.componentDidMount=function(){var e,t;if(!this.props.inline||Builder.isEditing||Builder.isPreviewing)this.subscribeToContent();else if(this.props.inline&&(null===(t=null===(e=this.options)||void 0===e?void 0:e.initialContent)||void 0===t?void 0:t.length)){var n=this.options.initialContent[0];(null==n?void 0:n.id)&&this.builder.trackImpression(n.id,this.renderedVariantId,void 0,{content:n})}Builder.isEditing&&addEventListener("message",this.onWindowMessage)},BuilderContent.prototype.subscribeToContent=function(){var e=this;"_inline"!==this.name&&this.subscriptions.add(this.builder.queueGetContent(this.name,this.options).subscribe((function(t){var n=t&&t[0];e.setState({data:n,loading:!1});var i=(e.builder.editingModel||e.builder.previewingModel)===e.name;if(!e.props.inline&&e.props.content&&e.firstLoad&&i&&(e.firstLoad=!1,e.subscriptions.unsubscribe(),e.subscribeToContent()),n&&e.firstLoad&&(e.firstLoad=!1,builder.autoTrack&&!Builder.isEditing)){var r=!1;if("function"==typeof IntersectionObserver&&e.ref)try{(e.intersectionObserver=new IntersectionObserver((function(t,i){t.forEach((function(t){t.intersectionRatio>0&&!e.trackedImpression&&(e.builder.trackImpression(n.id,e.renderedVariantId,void 0,{content:e.data}),e.data,e.trackedImpression=!0,e.ref&&i.unobserve(e.ref))}))}))).observe(e.ref),r=!0}catch(e){console.warn("Could not bind intersection observer")}r||(e.trackedImpression=!0,e.builder.trackImpression(n.id,e.renderedVariantId,void 0,{content:n}))}e.props.contentLoaded&&e.props.contentLoaded(n&&n.data,n)}),(function(t){e.props.contentError&&(e.props.contentError(t),e.setState({loading:!1}))})))},BuilderContent.prototype.componentWillUnmount=function(){Builder.isEditing&&removeEventListener("message",this.onWindowMessage),this.subscriptions.unsubscribe(),this.intersectionObserver&&this.ref&&this.intersectionObserver.unobserve(this.ref)},BuilderContent.prototype.render=function(){var e=this;if(this.props.dataOnly)return null;var t=this.state.loading,n=this.data,i=this.props.dataOnly?NoWrap:"div";return React__default.createElement(VariantsProvider,{initialContent:n},(function(r,o){return React__default.createElement(React__default.Fragment,null,r.map((function(a,s){var l=s===r.length-1?React__default.Fragment:"template";return React__default.createElement(React__default.Fragment,{key:String((null==a?void 0:a.id)+s)},"template"!==l&&(null==o?void 0:o()),React__default.createElement(l,__assign({key:String((null==a?void 0:a.id)+s)},"template"===l&&{"data-template-variant-id":null==a?void 0:a.id}),React__default.createElement(i,__assign({},0===s&&!e.props.dataOnly&&{ref:function(t){return e.ref=t}},{className:"builder-content",onClick:e.onClick,"builder-content-id":null==a?void 0:a.id,"builder-model":e.name}),e.props.children(null==a?void 0:a.data,!e.props.inline&&t,n))))})))}))},BuilderContent}(React__default.Component),getContentWithInfo=function(e){var t;if(e){var n=builder.getCookie("builder.tests.".concat(e.id)),i=n===e.id?e:null===(t=e.variations)||void 0===t?void 0:t[n],r=(null==i?void 0:i.name)||((null==i?void 0:i.id)===e.id?"Default variation":"");return __assign(__assign({},e),{variationId:n,testVariationId:n,testVariationName:r})}return null};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var onChange_1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Symbol("target"),i=Symbol("unsubscribe"),r=function(e,t){return t&&t.toString&&(e&&(e+="."),e+=t.toString()),e},o=function(e){return Array.isArray(e)?e.slice():Object.assign({},e)},a=function(e,t,a){if("undefined"==typeof Proxy)return e;void 0===a&&(a={});var s,l,u=Symbol("ProxyTarget"),c=!1,d=!1,p=!1,f=a.equals||Object.is,v=new WeakMap,m=new WeakMap,h=new WeakMap,g=function(e,n,i,a){if(!p)if(c){if(c&&l&&void 0!==i&&void 0!==a&&"length"!==n){var u=l;e!==s&&function(e,t){for(var n;e;)-1===(n=e.indexOf("."))&&(n=e.length),t(e.slice(0,n)),e=e.slice(n+1)}(e=e.replace(s,"").slice(1),(function(e){u[e]=o(u[e]),u=u[e]})),u[n]=i}d=!0}else t(r(e,n),a,i)},b=function(e,t){var n=v?v.get(e):void 0;n&&n.delete(t)},y=function(e,t){if(p)return e;m.set(e,t);var n=h.get(e);return void 0===n&&(n=new Proxy(e,B),h.set(e,n)),n},_=function(e){return p||!0===a.ignoreSymbols&&"symbol"==typeof e},B={get:function(e,t,o){if(t===u||t===n)return e;if(t===i&&""===m.get(e))return function(e){return p=!0,v=null,m=null,h=null,e}(e);var s=Reflect.get(e,t,o);if(function(e){return null===e||"object"!=typeof e&&"function"!=typeof e}(s)||function(e){return e instanceof RegExp||e instanceof Number}(s)||"constructor"===t||!0===a.isShallow)return s;var l=function(e,t){var n=v?v.get(e):void 0;if(n)return n;n=new Map,v.set(e,n);var i=n.get(t);return i||(i=Reflect.getOwnPropertyDescriptor(e,t),n.set(t,i)),i}(e,t);if(l&&!l.configurable){if(l.set&&!l.get)return;if(!1===l.writable)return s}return y(s,r(m.get(e),t))},set:function(e,t,n,i){n&&void 0!==n[u]&&(n=n[u]);var r=_(t),o=r?null:Reflect.get(e,t,i),a=Reflect.set(e[u]||e,t,n);return r||f(o,n)||g(m.get(e),t,o,n),a},defineProperty:function(e,t,n){var i=Reflect.defineProperty(e,t,n);return _(t)||(b(e,t),g(m.get(e),t,void 0,n.value)),i},deleteProperty:function(e,t){if(!Reflect.has(e,t))return!0;var n=_(t),i=n?null:Reflect.get(e,t),r=Reflect.deleteProperty(e,t);return n||(b(e,t),g(m.get(e),t,i)),r},apply:function(e,t,n){var i=t instanceof Date;if(i&&(t=t[u]),!c){c=!0,i&&(l=t.valueOf()),(Array.isArray(t)||"[object Object]"===toString.call(t))&&(l=o(t[u])),s=(s=m.get(e)).slice(0,Math.max(s.lastIndexOf("."),0));var r=Reflect.apply(e,t,n);return c=!1,(d||i&&!f(l,t.valueOf()))&&(g(s,"",l,t[u]||t),l=null,d=!1),r}return Reflect.apply(e,t,n)}},k=y(e,"");return t=t.bind(k),k};a.target=function(e){return e[n]||e},a.unsubscribe=function(e){return e[i]||e},e.exports=a,t.default=a})),onChange=unwrapExports(onChange_1),nextTick=Builder.nextTick;function debounceNextTick(e,t,n){return void 0===t&&"function"==typeof e?debounceNextTickImpl(e):{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,t,{configurable:!0,enumerable:n.enumerable,value:debounceNextTickImpl(n.value)}),this[t]}}}function debounceNextTickImpl(e){var t=null,n=null;return function(){var e=t;if(t=[].slice.call(arguments),n=this,null!==e)return;nextTick(i)};function i(){e.apply(n,t),t=null,n=null}}function throttle(e,t,n){var i,r,o;void 0===n&&(n={});var a=null,s=0,l=function(){s=!1===n.leading?0:Date.now(),a=null,o=e.apply(i,r),a||(i=r=null)};return function(){var u=Date.now();s||!1!==n.leading||(s=u);var c=t-(u-s);return i=this,r=arguments,c<=0||c>t?(a&&(clearTimeout(a),a=null),s=u,o=e.apply(i,r),a||(i=r=null)):a||!1===n.trailing||(a=setTimeout(l,c)),o}}var BuilderMetaContext=React__default.createContext({emailMode:!1,ampMode:!1,isServer:!1}),tryEval=function(e,t,n){void 0===t&&(t={});var i=e;if("string"==typeof i&&i.trim()){var r=!(i.includes(";")||i.includes(" return ")),o=function(){};try{Builder.isBrowser&&(o=new Function("state","var rootState = state;\n if (typeof Proxy !== 'undefined') {\n rootState = new Proxy(rootState, {\n set: function () {\n return false;\n },\n get: function (target, key) {\n if (key === 'state') {\n return state;\n }\n return target[key]\n }\n });\n }\n with (rootState) {\n ".concat(r?"return (".concat(e,");"):e,";\n }")))}catch(e){Builder.isBrowser&&console.warn("Could not compile javascript",e)}try{if(Builder.isBrowser)return o(t||{});var a=safeDynamicRequire("isolated-vm"),s=getIsolateContext(),l=makeFn(e,r,["state"]),u=s.evalClosureSync(l,[new a.Reference(t||{})]);try{return JSON.parse(u)}catch(e){return u}}catch(t){n&&n.push(t),Builder.isBrowser?console.warn("Builder custom code error:",t.message,"in",e,t.stack):isDebug()&&console.debug("Builder custom code error:",t.message,"in",e,t.stack)}}};function toError(e){return e instanceof Error?e:new Error(String(e))}function getBuilderPixel(e){return{id:"builder-pixel-"+Math.random().toString(36).split(".")[1],"@type":"@builder.io/sdk:Element",tagName:"img",properties:{role:"presentation","aria-hidden":"true",src:"https://cdn.builder.io/api/v1/pixel?apiKey=".concat(e)},responsiveStyles:{large:{height:"0",width:"0",display:"inline-block",opacity:"0",overflow:"hidden",pointerEvents:"none"}}}}function pick(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i={};return t.forEach((function(t){i[t]=e[t]})),i}function omit(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=__assign({},e);return t.forEach((function(e){delete i[e]})),i}var instancesMap=new Map,wrapComponent=function(e){return function(t){var n,i=t.builderTag||"div",r=["children"].concat((null===(n=e.inputs)||void 0===n?void 0:n.map((function(e){return e.name})))||[]),o=omit.apply(void 0,__spreadArray(__spreadArray([t],r,!1),["attributes"],!1)),a=t;return e.noWrap?React__default.createElement(e.class,__assign({attributes:o},a)):React__default.createElement(i,__assign({},o),React__default.createElement(e.class,__assign({},a)))}},size=function(e){return Object.keys(e).length};function debounce(e,t,n){var i;return void 0===n&&(n=!1),function(){var r=this,o=arguments;clearTimeout(i),i=setTimeout((function(){i=null,n||e.apply(r,o)}),t),n&&!i&&e.apply(r,o)}}var fontsLoaded=new Set,fetch;globalThis.fetch&&(fetch=globalThis.fetch),null!=fetch||(fetch=require("node-fetch"));var sizeMap={desktop:"large",tablet:"medium",mobile:"small"},fetchCache={};function searchToObject(e){var t=(e.search||"").substring(1).split("&"),n={};for(var i in t)if(t[i]&&"string"==typeof t[i]){var r=t[i].split("=");n[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return n}var BuilderComponent=function(e){function t(t){var n,i,r=this;(r=e.call(this,t)||this).subscriptions=new Subscription,r.onStateChange=new BehaviorSubject(null),r.asServer=Builder.isServer,r.contentRef=null,r.styleRef=null,r.rootState=Builder.isServer?{}:onChange({},(function(){return r.updateState()})),r.lastJsCode="",r.lastHttpRequests={},r.httpSubscriptionPerKey={},r.firstLoad=!0,r.ref=null,r.messageListener=function(e){var t,n=e.data;switch(n.type){case"builder.configureSdk":var i=n.data;if(!i.contentId||i.contentId!==(null===(t=r.useContent)||void 0===t?void 0:t.id))return;r.sizes=getSizesForBreakpoints(i.breakpoints||{}),r.setState({state:Object.assign(r.rootState,{deviceSize:r.deviceSizeState,device:r.device}),updates:(r.state&&r.state.updates||0)+1,breakpoints:i.breakpoints});break;case"builder.updateSpacer":var o=n.data;r.rootState._spacer,r.updateState((function(e){e._spacer=o}));break;case"builder.resetState":var a=n.data,s=a.state;if(a.model===r.name){for(var l in r.rootState)"function"!=typeof r.rootState[l]&&delete r.rootState[l];Object.assign(r.rootState,s),r.setState(__assign(__assign({},r.state),{state:r.rootState,updates:(r.state&&r.state.updates||0)+1}))}break;case"builder.resetSymbolState":var u=n.data.state,c=(s=u.state,u.model,u.id);if(r.props.builderBlock&&r.props.builderBlock===c){for(var l in r.rootState)delete r.rootState[l];Object.assign(r.rootState,s),r.setState(__assign(__assign({},r.state),{state:r.rootState,updates:(r.state&&r.state.updates||0)+1}))}}},r.resizeFn=function(){var e=r.deviceSizeState;e!==r.state.state.deviceSize&&r.setState(__assign(__assign({},r.state),{updates:(r.state&&r.state.updates||0)+1,state:Object.assign(r.rootState,__assign(__assign({},r.state.state),{deviceSize:e}))}))},r.resizeListener=Builder.isEditing?throttle(r.resizeFn,200):debounce(r.resizeFn,400),r.mounted=!1,r.updateState=function(e){var t=r.rootState;e&&e(t),r.mounted?r.setState({update:r.updateState,state:t,updates:(r.state&&r.state.updates||0)+1}):r.state=__assign(__assign({},r.state),{update:r.updateState,state:t,updates:(r.state&&r.state.updates||0)+1}),r.notifyStateChange()},r.onContentLoaded=function(e,t){if("page"===r.name&&Builder.isBrowser&&e){var n=e.title,i=e.pageTitle,o=e.description,a=e.pageDescription;if((n||i)&&(document.title=n||i),o||a){var s=document.querySelector('meta[name="description"]');s||((s=document.createElement("meta")).setAttribute("name","description"),document.head.appendChild(s)),s.setAttribute("content",o||a)}}if(Builder.isEditing&&r.notifyStateChange(),r.props.contentLoaded&&r.props.contentLoaded(e,t),e&&e.inputs&&Array.isArray(e.inputs)&&e.inputs.length&&(e.state||(e.state={}),e.inputs.forEach((function(t){t&&t.name&&void 0!==t.defaultValue&&void 0===e.state[t.name]&&(e.state[t.name]=t.defaultValue)}))),e&&e.state){var l=__assign(__assign({},r.state),{updates:(r.state&&r.state.updates||0)+1,state:Object.assign(r.rootState,__assign(__assign(__assign(__assign({},r.state.state),{location:r.locationState,deviceSize:r.deviceSizeState,device:r.device}),e.state),r.externalState))});r.mounted?r.setState(l):r.state=l}if(e&&e.jsCode&&Builder.isBrowser&&!r.options.codegen){var u=!1;if(Builder.isEditing&&(r.lastJsCode===e.jsCode?u=!0:r.lastJsCode=e.jsCode),!u){var c=r.state.state;try{new Function("data","ref","state","update","element","Builder","builder","context",e.jsCode)(e,r,c,r.state.update,r.ref,Builder,builder,r.state.context)}catch(t){var d=toError(t);Builder.isBrowser?console.warn("Builder custom code error:",d.message,"in",e.jsCode,d.stack):isDebug()&&console.debug("Builder custom code error:",d.message,"in",e.jsCode,d.stack)}}}if(e&&e.httpRequests&&!r.props.noAsync&&!(u=!1)){var p=function(t){var n=e.httpRequests[t];if(n&&(!r.data[t]||Builder.isEditing))if(Builder.isBrowser){var i=r.evalExpression(n);if(Builder.isEditing&&r.lastHttpRequests[t]===i)return"continue";r.lastHttpRequests[t]=i;var o=n.match(/builder\.io\/api\/v2\/([^\/\?]+)/i);o&&o[1],r.handleRequest(t,i);var a=r.httpSubscriptionPerKey[t];a&&a.unsubscribe();var s=r.httpSubscriptionPerKey[t]=r.onStateChange.subscribe((function(){var e=r.evalExpression(n);e!==i&&(r.handleRequest(t,e),r.lastHttpRequests[t]=e)}));r.subscriptions.add(s)}else r.handleRequest(t,r.evalExpression(n))};for(var f in e.httpRequests)p(f)}};var o=r.inlinedContent;o&&o.content&&(o=o.content),r.sizes=getSizesForBreakpoints((null===(n=null==o?void 0:o.meta)||void 0===n?void 0:n.breakpoints)||{});var a=null===(i=r.inlinedContent)||void 0===i?void 0:i.data;if(a&&Array.isArray(a.inputs)&&a.inputs.length>0&&(a.state||(a.state={}),a.inputs.forEach((function(e){e&&e.name&&void 0!==e.defaultValue&&void 0===a.state[e.name]&&(a.state[e.name]=e.defaultValue)}))),r.state={context:__assign(__assign({},t.context),{apiKey:r.props.apiKey||builder.apiKey}),state:Object.assign(r.rootState,__assign(__assign(__assign(__assign({},r.inlinedContent&&r.inlinedContent.data&&r.inlinedContent.data.state),{isBrowser:Builder.isBrowser,isServer:!Builder.isBrowser,_hydrate:t.hydrate,location:r.locationState,deviceSize:r.deviceSizeState,device:r.device}),r.getHtmlData()),t.data)),updates:0,key:0,update:r.updateState},Builder.isBrowser){var s=r.props.apiKey;if(s&&s!==r.builder.apiKey&&!instancesMap.has(s)){var l=new Builder(s,void 0,void 0,!0);instancesMap.set(s,l)}if(r.inlinedContent){var u=r.inlinedContent.content||r.inlinedContent;r.onContentLoaded(null==u?void 0:u.data,getContentWithInfo(u))}}return r.registerCustomComponents(),r}return __extends(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return __assign(__assign({},t.defaults),this.props)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.props.model||this.props.modelName||this.props.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.ref},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inlinedContent",{get:function(){if(!this.isPreviewing||this.props.inlineContent)return this.props.content},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"builder",{get:function(){return this.props.apiKey&&instancesMap.get(this.props.apiKey)||this.props.builder||builder},enumerable:!1,configurable:!0}),t.prototype.getHtmlData=function(){var e=this.inlinedContent&&this.inlinedContent.id||this.props.entry,t=e&&Builder.isBrowser&&document.querySelector('script[data-builder-json="'.concat(e,'"],script[data-builder-state="').concat(e,'"]'));if(t)try{return JSON.parse(t.innerText)}catch(e){console.warn("Could not parse Builder.io HTML data transfer",e,t.innerText)}return{}},Object.defineProperty(t.prototype,"device",{get:function(){return this.builder.getUserAttributes().device||"desktop"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"locationState",{get:function(){return __assign(__assign({},pick(this.location,"pathname","hostname","search","host")),{path:this.location.pathname&&this.location.pathname.split("/").slice(1)||"",query:searchToObject(this.location)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceSizeState",{get:function(){return Builder.isBrowser?this.sizes.getSizeForWidth(window.innerWidth):sizeMap[this.device]||"large"},enumerable:!1,configurable:!0}),t.renderInto=function(e,n,i,r){if(void 0===n&&(n={}),void 0===i&&(i=!0),void 0===r&&(r=!1),console.debug("BuilderPage.renderInto",e,n,i,this),e){var o=null;if("string"==typeof e?o=document.querySelector(e):e instanceof Element&&(o=e),o){var a=o.classList.contains("builder-hydrated");if(!a||r){o.classList.add("builder-hydrated");var s=i&&o.innerHTML.includes("builder-block");if(!o.classList.contains("builder-component")){var l=o.querySelector(".builder-api-styles")||(o.previousElementSibling&&o.previousElementSibling.matches(".builder-api-styles")?o.previousElementSibling:null),u="";if(l)l.innerHTML.replace(/\/\*start:([^\*]+?)\*\/([\s\S]*?)\/\*end:([^\*]+?)\*\//g,(function(e,t,n){var i=null;try{i=document.querySelector('[data-emotion-css="'.concat(t,'"]'))}catch(e){console.warn(e)}return i?i.innerHTML=n:Builder.isEditing||(u+=e),e})),Builder.nextTick((function(){l.innerHTML=u}));var c=o.querySelector(".builder-component");c?o=c:s=!1}location.search.includes("builder.debug=true")&&console.debug("hydrate",s,o);var d=o;if(!a){var p=document.createElement("div");o.insertAdjacentElement("beforebegin",p),p.appendChild(o),d=p}if((Builder.isEditing||Builder.isBrowser&&location.search.includes("builder.preview="))&&(s=!1),s&&o){var f=ReactDOM.render(React__default.createElement(t,__assign({},n)),d,d.builderRootRef);return d.builderRootRef=f,f}var v=ReactDOM.render(React__default.createElement(t,__assign({},n)),d,d.builderRootRef);return d.builderRootRef=v,v}console.debug("Tried to hydrate multiple times")}}},t.prototype.registerCustomComponents=function(){if(this.props.customComponents)for(var e=0,t=this.props.customComponents;e<t.length;e++){var n=t[e];if(n){var i=n.component,r=__rest(n,["component"]);Builder.registerComponent(i,r)}}},t.prototype.componentDidMount=function(){var e,t=this;this.mounted=!0,this.asServer&&(this.asServer=!1,this.updateState((function(e){e.isBrowser=!0,e.isServer=!1}))),Builder.isIframe&&(null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.sdkInjected",data:{modelName:this.name}},"*")),Builder.isBrowser&&(window.addEventListener("resize",this.resizeListener),Builder.isEditing&&window.addEventListener("message",this.messageListener),(Builder.isEditing||Builder.isPreviewing)&&Builder.nextTick((function(){t.firstLoad=!1,t.reload()})),setTimeout((function(){window.dispatchEvent(new CustomEvent("builder:component:load",{detail:{ref:t}}))})))},Object.defineProperty(t.prototype,"isPreviewing",{get:function(){return(Builder.isServer||Builder.isBrowser&&Builder.isPreviewing&&!this.firstLoad)&&builder.previewingModel===this.name},enumerable:!1,configurable:!0}),t.prototype.notifyStateChange=function(){if(!Builder.isServer&&this&&this.state){var e=this.state.state;this.props.onStateChange&&this.props.onStateChange(e),Builder.isBrowser&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:e,ref:this}})),this.onStateChange.next(e)}},t.prototype.processStateFromApi=function(e){return e},Object.defineProperty(t.prototype,"location",{get:function(){return this.props.location||(Builder.isBrowser?location:{})},enumerable:!1,configurable:!0}),t.prototype.getCssFromFont=function(e,t){var n=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),i=n.split(",")[0],r=e.fileUrl?e.fileUrl:e.files&&e.files.regular,o="";if(r&&n&&i&&(o+='\n@font-face {\n font-family: "'.concat(n,'";\n src: local("').concat(i,"\"), url('").concat(r,"') format('woff2');\n font-display: fallback;\n font-weight: 400;\n}\n ").trim()),e.files)for(var a in e.files){if(String(Number(a))===a){var s=e.files[a];s&&s!==r&&(o+='\n@font-face {\n font-family: "'.concat(n,"\";\n src: url('").concat(s,"') format('woff2');\n font-display: fallback;\n font-weight: ").concat(a,";\n}\n ").trim())}}return o},t.prototype.componentWillUnmount=function(){this.unsubscribe(),Builder.isBrowser&&(window.removeEventListener("resize",this.resizeListener),window.removeEventListener("message",this.messageListener))},t.prototype.getFontCss=function(e){var t=this;return this.builder.allowCustomFonts&&(null==e?void 0:e.customFonts)&&e.customFonts.length&&e.customFonts.map((function(n){return t.getCssFromFont(n,e)})).join(" ")||""},t.prototype.ensureFontsLoaded=function(e){if(this.builder.allowCustomFonts&&(null==e?void 0:e.customFonts)&&Array.isArray(e.customFonts))for(var t=0,n=e.customFonts;t<n.length;t++){var i=n[t],r=i.fileUrl?i.fileUrl:i.files&&i.files.regular;if(!fontsLoaded.has(r)){var o=this.getCssFromFont(i,e);if(fontsLoaded.add(r),!o)continue;var a=document.createElement("style");a.className="builder-custom-font",a.setAttribute("data-builder-custom-font",r),a.innerHTML=o,document.head.appendChild(a)}}},t.prototype.getCss=function(e){var t,n=null===(t=this.useContent)||void 0===t?void 0:t.id,i=(null==e?void 0:e.cssCode)||"";return n&&(i=i.replace(/&/g,".builder-component-".concat(n))),i+this.getFontCss(e)},Object.defineProperty(t.prototype,"data",{get:function(){var e,t=__assign(__assign(__assign({},this.inlinedContent&&(null===(e=this.inlinedContent.data)||void 0===e?void 0:e.state)),this.externalState),this.state.state);return Object.assign(this.rootState,t),t},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(e){var t=this;this.props.data&&e.data!==this.props.data&&this.state.update((function(e){Object.assign(e,t.externalState)})),this.props.customComponents&&this.props.customComponents!==e.customComponents&&this.registerCustomComponents(),Builder.isEditing&&this.inlinedContent&&e.content!==this.inlinedContent&&this.onContentLoaded(this.inlinedContent.data,this.inlinedContent)},t.prototype.checkStyles=function(e){if(this.styleRef){var t=this.getCss(e);this.styleRef.innerHTML!==t&&(this.styleRef.innerHTML=t)}},t.prototype.reload=function(){this.setState({key:this.state.key+1})},Object.defineProperty(t.prototype,"content",{get:function(){var e=this.inlinedContent;return e&&e.content&&(e=__assign(__assign({},e),{data:e.content})),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"externalState",{get:function(){return __assign(__assign({},this.props.data),this.props.locale?{locale:this.props.locale}:{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useContent",{get:function(){return this.content||this.state.context.builderContent},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e,t=this,n=this.content,i=Builder.isBrowser&&this.externalState&&size(this.externalState)&&hash(this.externalState),r=Builder.isEditing?this.name:this.props.entry;r&&!Builder.isEditing&&i&&i.length<300&&(r+=":"+i);var o=this.props.dataOnly?React__default.Fragment:"div",a=null===(e=this.useContent)||void 0===e?void 0:e.id;return React__default.createElement(o,{onClick:function(e){!Builder.isEditing||t.props.isChild||t.props.stopClickPropagationWhenEditing||e.stopPropagation()},className:"builder-component ".concat(a?"builder-component-".concat(a):""),"data-name":this.name,"data-source":"Rendered by Builder.io",key:this.state.key,ref:function(e){return t.ref=e}},React__default.createElement(BuilderMetaContext.Consumer,null,(function(e){return React__default.createElement(BuilderMetaContext.Provider,{value:"boolean"==typeof t.props.ampMode?__assign(__assign({},e),{ampMode:t.props.ampMode}):e},React__default.createElement(BuilderAsyncRequestsContext.Consumer,null,(function(e){var i;return t._asyncRequests=e&&e.requests,t._errors=e&&e.errors,t._logs=e&&e.logs,React__default.createElement(BuilderContent,{isStatic:t.props.isStatic||Builder.isStatic,key:(null===(i=t.inlinedContent)||void 0===i?void 0:i.id)||("content"in t.props&&!t.isPreviewing?"null-content-prop":"no-content-prop"),builder:t.builder,ref:function(e){return t.contentRef=e},contentLoaded:function(e,n){return t.onContentLoaded(e,n)},options:__assign(__assign(__assign(__assign(__assign(__assign({key:r,entry:t.props.entry},n&&{initialContent:[n]}),!n&&"content"in t.props&&!t.isPreviewing&&{initialContent:[]}),t.props.url&&{url:t.props.url}),t.props.options),t.props.locale?{locale:t.props.locale}:{}),t.options.codegen&&{format:"react"}),inline:t.props.inlineContent||!t.isPreviewing&&"content"in t.props,contentError:t.props.contentError,modelName:t.name||"page"},(function(e,n,i){var r;if(t.props.dataOnly)return null;i&&i.id&&(t.state.breakpoints&&(i.meta=i.meta||{},i.meta.breakpoints=t.state.breakpoints),t.state.context.builderContent=i),Builder.isBrowser&&Builder.nextTick((function(){t.checkStyles(e)}));var o=t.options.codegen;if(o&&!t.Component&&(null==e?void 0:e.blocksJs)){var a=Array.from(new Set(Builder.components.map((function(e){return e.name})))),s=Builder.components.slice().reverse(),l=a.map((function(e){return s.find((function(t){return t.class&&t.name===e}))})),u=a.map((function(e){return(e||"").replace(/[^\w]+/gi,"")})),c=l.map((function(e){return wrapComponent(e)}));t.Component=(new(Function.bind.apply(Function,__spreadArray(__spreadArray([void 0,"jsx","_css","Builder","builder","React","useBuilderState"],u,!1),[e.blocksJs],!1)))).apply(void 0,__spreadArray([jsx,css,Builder,builder,React__default,function(e){var t=React__default.useState(0)[1];return React__default.useState((function(){return onChange(e,(function(){t((function(e){return e+1}))}))}))[0]}],c,!1))}var d=(null==e?void 0:e.blocks)||[],p=d.find((function(e){var t;return null===(t=e.id)||void 0===t?void 0:t.startsWith("builder-pixel")}));return e&&!p&&d.length>0&&d.push(getBuilderPixel(builder.apiKey)),e?React__default.createElement("div",__assign({"data-builder-component":t.name,"data-builder-content-id":i.id},t.isPreviewing?{"data-builder-variation-id":i.testVariationId||i.variationId||i.id}:{}),!o&&t.getCss(e)&&React__default.createElement("style",{ref:function(e){return t.styleRef=e},className:"builder-custom-styles",dangerouslySetInnerHTML:{__html:t.getCss(e)}}),React__default.createElement(BuilderStoreContext.Provider,{value:__assign(__assign({},t.state),{rootState:t.rootState,state:t.data,content:i,renderLink:t.props.renderLink})},o&&t.Component?React__default.createElement(t.Component,{data:t.data,context:t.state.context}):React__default.createElement(BuilderBlocks,{key:String(!!(null===(r=null==e?void 0:e.blocks)||void 0===r?void 0:r.length)),emailMode:t.props.emailMode,fieldName:"blocks",blocks:d}))):n?React__default.createElement("div",{"data-builder-component":t.name,className:"builder-loading"},t.props.children):React__default.createElement("div",{"data-builder-component":t.name,className:"builder-no-content"})}))})))})))},t.prototype.evalExpression=function(e){var t=this,n=this.data;return String(e).replace(/{{([^}]+)}}/g,(function(e,i){return tryEval(i,n,t._errors)}))},t.prototype.handleRequest=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a=this;return __generator(this,(function(s){return Builder.isIframe&&fetchCache[t]?(this.updateState((function(n){n[e]=fetchCache[t]})),[2,fetchCache[t]]):(n=function(){return __awaiter(a,void 0,void 0,(function(){var n,i,r,o;return __generator(this,(function(a){switch(a.label){case 0:n=Date.now(),Builder.isBrowser||console.time("Fetch "+t),a.label=1;case 1:return a.trys.push([1,4,5,6]),[4,fetch(t)];case 2:return[4,a.sent().json()];case 3:return i=a.sent(),[3,6];case 4:return r=a.sent(),o=toError(r),this._errors&&this._errors.push(o),this._logs&&this._logs.push("Fetch to ".concat(t," errored in ").concat(Date.now()-n,"ms")),[2];case 5:return Builder.isBrowser||(console.timeEnd("Fetch "+t),this._logs&&this._logs.push("Fetched ".concat(t," in ").concat(Date.now()-n,"ms"))),[7];case 6:return i&&(Builder.isIframe&&(fetchCache[t]=i),this.updateState((function(t){t[e]=i}))),[2,i]}}))}))},(i=this._asyncRequests&&this._asyncRequests.find((function(e){return isRequestInfo(e)&&e.url===t})))?((r=i.promise).then((function(t){t&&a.updateState((function(n){n[e]=t}))})),[2,r]):(o=n(),Builder.nextTick((function(){a._asyncRequests&&a._asyncRequests.push(o)})),[2,o]))}))}))},t.prototype.unsubscribe=function(){this.subscriptions&&(this.subscriptions.unsubscribe(),this.subscriptions=new Subscription)},t.prototype.handleBuilderRequest=function(e,t){var n=this,i=tryEval(t,this.data,this._errors);this.subscriptions&&this.unsubscribe(),i&&this.subscriptions.add(this.builder.queueGetContent(i.model,i).subscribe((function(t){t&&n.updateState((function(n){n[e]=t}))})))},t.defaults={codegen:Boolean(Builder.isBrowser&&location.href.includes("builder.codegen=true"))},__decorate([debounceNextTick,__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],t.prototype,"notifyStateChange",null),t}(React__default.Component),withChildren=function(e){var t=React__default.forwardRef((function(t,n){var i=t.children||t.builderBlock&&t.builderBlock.children&&t.builderBlock.children.map((function(e){return React__default.createElement(BuilderBlock,{key:e.id,block:e})}));return React__default.createElement(e,__assign({},t,{ref:n}),i)}));return t.builderOptions={canHaveChildren:!0},t};function useIsPreviewing(){var e=useState(!1),t=e[0],n=e[1];return useEffect((function(){(Builder.isEditing||Builder.isPreviewing)&&n(!0)}),[]),t}Builder.isReact=!0;export{BuilderAsyncRequestsContext,BuilderBlock as BuilderBlockComponent,BuilderBlocks,BuilderComponent,BuilderContent,BuilderMetaContext,BuilderComponent as BuilderPage,BuilderStoreContext,stringToFunction,useIsPreviewing,withChildren}; | ||
//# sourceMappingURL=builder-react-lite.esm.js.map |
{ | ||
"name": "@builder.io/react", | ||
"version": "3.0.13", | ||
"version": "3.0.14-0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
{ | ||
"name": "@builder.io/react", | ||
"version": "3.0.14-0", | ||
"version": "3.0.14", | ||
"description": "", | ||
@@ -136,4 +136,3 @@ "keywords": [], | ||
}, | ||
"gitHead": "4d96fbc32864698afbb355ab991c6d90be991951", | ||
"stableVersion": "3.0.13" | ||
"gitHead": "4d96fbc32864698afbb355ab991c6d90be991951" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5
4955644