react-bricks 3.7.0-beta.0 → 3.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/frontend/index.js +1 -1
- package/frontend/package.json +1 -1
- package/frontend/react-bricks-frontend.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/react-bricks-61f6a026.js +2 -0
- package/react-bricks-6f85114a.esm.js +2 -0
- package/react-bricks.d.ts +2 -0
- package/react-bricks.esm.js +1 -1
- package/react-bricks-1a4433ad.js +0 -2
- package/react-bricks-bc1cac75.esm.js +0 -2
package/react-bricks-1a4433ad.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("classnames"),n=require("react-query"),r=require("axios"),a=require("react-icons/fi");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(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 s,l,c,u,d,p,g,m,f,v,h,y,x=i(e),b=o(e),E=o(t),k=o(r),P=function(e,t){return P=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])},P(e,t)};function T(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 a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}function _(e,t,n,r){return new(n||(n=Promise))((function(a,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}l((r=r.apply(e,t||[])).next())}))}function w(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[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(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&o[0]?r.return:o[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;switch(r=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],r=0}finally{n=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function I(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function C(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},exports.__assign.apply(this,arguments)},exports.types=void 0,(s=exports.types||(exports.types={})).EmbedType="RB_PAGE_EMBED",(l=s.SideEditPropType||(s.SideEditPropType={})).Text="TEXT",l.Textarea="TEXTAREA",l.Number="NUMBER",l.Date="DATE",l.Range="RANGE",l.Boolean="BOOLEAN",l.Select="SELECT",l.Image="IMAGE",l.Custom="CUSTOM",l.Relationship="RELATIONSHIP",(c=s.OptionsDisplay||(s.OptionsDisplay={})).Select="SELECT",c.Radio="RADIO",c.Color="COLOR",(u=s.RichTextFeatures||(s.RichTextFeatures={})).Bold="BOLD",u.Italic="ITALIC",u.Code="CODE",u.Highlight="HIGHLIGHT",u.Link="LINK",u.UnorderedList="UL",u.OrderedList="OL",u.Heading1="H1",u.Heading2="H2",u.Heading3="H3",u.Heading4="H4",u.Heading5="H5",u.Heading6="H6",u.Quote="QUOTE",(d=s.SortDirection||(s.SortDirection={})).Up="UP",d.Down="DOWN",(p=s.PageStatus||(s.PageStatus={})).Draft="DRAFT",p.Published="PUBLISHED",(g=s.DeployEnvironment||(s.DeployEnvironment={})).Staging="STAGING",g.Production="PRODUCTION",(m=s.PlaygroundSelectedItemType||(s.PlaygroundSelectedItemType={})).Block="BLOCK",m.Page="PAGE",(f=s.DeviceType||(s.DeviceType={})).Desktop="DESKTOP",f.Tablet="TABLET",f.Phone="PHONE",(v=s.Tab||(s.Tab={})).Block="BLOCK",v.Item="ITEM",v.PageSettings="PAGE-SETTINGS",v.Document="DOCUMENT",v.Stories="STORIES",v.CollaborationLocked="COLLABORATION-LOCKED",(h=s.ClickToEditSide||(s.ClickToEditSide={})).BottomRight="BOTTOM-RIGHT",h.BottomLeft="BOTTOM-LEFT",h.TopRight="TOP-RIGHT",h.TopLeft="TOP-LEFT",h.None="NONE",(y=s.BlockIconsPosition||(s.BlockIconsPosition={})).InsideBlock="INSIDE-BLOCK",y.OutsideBlock="OUTSIDE-BLOCK";var S=x.createContext({focused:{blockId:""},setFocused:function(){},triggerTextRefreshBlockId:"",setTriggerTextRefreshBlockId:function(){},setAddAfterBlockId:function(){},pageValues:{id:"",type:"",name:"",slug:"",meta:{},authorId:"",author:{id:"",email:"",firstName:"",lastName:""},invalidBlocksTypes:[],status:exports.types.PageStatus.Draft,isLocked:!1,tags:[],createdAt:"",publishedAt:"",language:"",translations:[]},handleChangePageValue:function(){}}),A=x.createContext({pageValues:{id:"",type:"",name:"",slug:"",meta:{},authorId:"",author:{id:"",email:"",firstName:"",lastName:""},invalidBlocksTypes:[],status:exports.types.PageStatus.Draft,isLocked:!1,tags:[],createdAt:"",publishedAt:"",language:"",translations:[]}}),L=function(){var t=e.useContext(S),n=t.pageValues,r=t.handleChangePageValue,a=e.useContext(A).pageValues;return[n.id?n:a,r]},N=x.createContext({values:{},onChange:function(){},blockId:"",blockType:"",parents:[],handleChange:function(e){return function(){}}}),B=function(e){return function(e){var t,n;if(!1===O(e))return!1;if("function"!=typeof(t=e.constructor))return!1;if(!1===O(n=t.prototype))return!1;if(!1===n.hasOwnProperty("isPrototypeOf"))return!1;return!0}(e)&&"string"==typeof e.text};function R(e){return B(e)?e.text:e.children&&Array.isArray(e.children)?e.children.map(R).join(""):""}function O(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}var D,F={serialize:function(e){return Array.isArray(e)&&e.length>0?e.map(R).join("\n"):""},deserialize:function(e){return e.split("\n").map((function(e){return{type:"paragraph",children:[{text:e}]}}))},isText:B},z=function(e,t,n){if(F.isText(e)){var r=K(e.text);return t.filter((function(e){return"Mark"===e.type})).reduce((function(t,n){return e[n.name]?n.renderLeaf({children:t}):t}),r)}var a=t.filter((function(e){return"List"===e.type})).find((function(t){return e.type===t.name}));if(a){var o=H(e,t);return a.renderElement({children:o.map((function(e,t){return x.createElement(x.Fragment,{key:t},a.renderItemElement({children:e}))})),element:{url:e.url}})}var i=H(e,t,n),s=t.filter((function(e){return"Block"===e.type})).find((function(t){return e.type===t.name}));return s?s.renderElement({children:i,element:{url:e.url}}):n?n({children:i,element:{type:"",children:[]},attributes:{ref:null}}):i},H=function(e,t,n){var r;return null===(r=e.children)||void 0===r?void 0:r.map((function(e,r){return x.createElement(x.Fragment,{key:r},z(e,t,n))}))},K=function(e){var t=null==e?void 0:e.replace(/\n/g,"<|BR|>\n<|BR|>").split("<|BR|>");if(t)return 1===t.length?e:x.createElement(x.Fragment,null,t.map((function(e,t,n){return"\n"===e&&n.length===t+1||"\n"===e&&n.length===t+2&&""===n[n.length-1]?x.createElement(x.Fragment,{key:t},x.createElement("br",null)," "):"\n"===e?x.createElement("br",null):x.createElement(x.Fragment,{key:t},e)})))},U=function(t){var n,r,a=t.renderBlock,o=t.placeholder,i=t.renderPlaceholder,s=t.propName,l=t.multiline,c=void 0!==l&&l,u=t.softLineBreak,d=void 0!==u&&u,p=t.metaFieldName,g=t.customFieldName,m=e.useContext(N).values,f=I(L(),1)[0],v=s?m[s]:p?f.meta[p]||"":g&&f.customValues&&f.customValues[g]||"";if(null===(n=U.prototype)||void 0===n?void 0:n.renderAdmin)return null===(r=U.prototype)||void 0===r?void 0:r.renderAdmin({renderBlock:a,placeholder:o,renderPlaceholder:i,propName:s,multiline:c,softLineBreak:d,metaFieldName:p,customFieldName:g});var h=v;return v?("string"==typeof v&&(h=F.deserialize(v)),x.createElement(x.Fragment,null,h.map((function(e,t){return x.createElement(x.Fragment,{key:t},z(e,[],a))})))):null},j=function(t){var n,r,a=t.renderBlock,o=t.placeholder,i=t.renderPlaceholder,s=t.propName,l=t.plugins,c=void 0===l?[]:l,u=t.multiline,d=void 0===u||u,p=t.softLineBreak,g=void 0===p||p,m=t.metaFieldName,f=t.customFieldName,v=e.useContext(N).values,h=I(L(),1)[0],y=s?v[s]:m?h.meta[m]:f&&h.customValues?h.customValues[f]:"";if(null===(n=j.prototype)||void 0===n?void 0:n.renderAdmin)return null===(r=j.prototype)||void 0===r?void 0:r.renderAdmin({renderBlock:a,placeholder:o,renderPlaceholder:i,propName:s,plugins:c,multiline:d,softLineBreak:g,metaFieldName:m,customFieldName:f});var b=y;return y?("string"==typeof y&&(b=F.deserialize(y)),x.createElement(x.Fragment,null,b.map((function(e,t){return x.createElement(x.Fragment,{key:t},z(e,c,a))})))):null},M=x.createContext({appId:"",apiKey:"",bricks:{},pageTypes:[],logo:"",loginUI:{},contentClassName:"",renderLocalLink:function(e){var t=e.href,n=e.children;return x.createElement("a",{href:t},n)},navigate:function(){},loginPath:"",editorPath:"",playgroundPath:"",appSettingsPath:"",previewPath:"",getAdminMenu:function(e){return e.isAdmin,[]},useCssInJs:!1,appRootElement:"",clickToEditSide:exports.types.ClickToEditSide.BottomRight,responsiveBreakpoints:[],enableAutoSave:!0,disableSaveIfInvalidProps:!1,enablePreview:!0,browserSupport:{webP:!0,lazyLoading:!0},blockIconsPosition:exports.types.BlockIconsPosition.InsideBlock,enableUnsplash:!0,unsplashApiKey:"",enablePreviewImage:!1,enablePreviewIcon:!1}),W=function(e){var t,n;return(null===(t=W.prototype)||void 0===t?void 0:t.adminConstructor)?null===(n=W.prototype)||void 0===n?void 0:n.adminConstructor(e):{type:"Mark",name:e.name,label:e.label||e.name[0].toUpperCase()+e.name.slice(1),hotKey:e.hotKey,renderLeaf:e.render,toggle:function(e){}}},V=W({name:"bold",hotKey:"mod+b",render:function(e){return x.createElement("strong",null,e.children)}}),G=W({name:"italic",hotKey:"mod+i",render:function(e){return x.createElement("em",null,e.children)}}),Q=W({name:"code",hotKey:"mod+`",render:function(e){return x.createElement("code",{style:{margin:"0 1px",display:"inline-block",padding:"3px 6px",fontSize:"0.875rem",lineHeight:1.25,maxWidth:"100%",fontFamily:'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',borderRadius:"3px",backgroundColor:"#F5F7F9"}},e.children)}}),q=W({name:"highlight",hotKey:"mod+h",render:function(e){return x.createElement("mark",{style:{paddingLeft:4,paddingRight:4,borderRadius:2,backgroundColor:"#ff0",color:"#0f0f05"}},e.children)}}),J=function(t){var n,r,a=t.href,o=t.children,i=t.target,s=t.className,l=T(t,["href","children","target","className"]),c=e.useContext(M).renderLocalLink;if(null===(n=J.prototype)||void 0===n?void 0:n.renderAdmin)return null===(r=J.prototype)||void 0===r?void 0:r.renderAdmin(exports.__assign({href:a,children:o,target:i,className:s},l));var u={href:a};return/^\/(?!\/)/.test(a)?c?c(exports.__assign({href:a,target:i,children:o,className:s},l)):(c||console.warn("Local path found in Link, but no renderLocalLink function was provided. Rendering <a> as fallback"),x.createElement("a",exports.__assign({},u,{target:i,className:s},l),o)):x.createElement("a",exports.__assign({},u,{target:i,className:s},l),o)},X={type:"Block",name:"link",label:"Link",isInline:!0,renderElement:function(e){var t=e.attributes,n=e.children,r=e.element;return x.createElement(J,exports.__assign({},t,{href:r.url}),n)},toggle:function(e){}},Y=function(e){var t,n;return(null===(t=Y.prototype)||void 0===t?void 0:t.adminConstructor)?null===(n=Y.prototype)||void 0===n?void 0:n.adminConstructor(e):{type:e.itemName?"List":"Block",name:e.name,isInline:e.isInline,itemName:e.itemName,label:e.label||e.name[0].toUpperCase()+e.name.slice(1),hotKey:e.hotKey,renderElement:e.render,renderItemElement:e.renderItem,toggle:function(e,t){}}},$=Y({name:"h1",hotKey:"mod+shift+1",render:function(e){return x.createElement("h1",null,e.children)}}),Z=Y({name:"h2",hotKey:"mod+shift+2",render:function(e){return x.createElement("h2",null,e.children)}}),ee=Y({name:"h3",hotKey:"mod+shift+3",render:function(e){return x.createElement("h3",null,e.children)}}),te=Y({name:"h4",hotKey:"mod+shift+4",render:function(e){return x.createElement("h4",null,e.children)}}),ne=Y({name:"h5",hotKey:"mod+shift+5",render:function(e){return x.createElement("h5",null,e.children)}}),re=Y({name:"h6",hotKey:"mod+shift+6",render:function(e){return x.createElement("h6",null,e.children)}}),ae=Y({name:"quote",render:function(e){return x.createElement("blockquote",null,e.children)}}),oe=Y({name:"ol",label:"Number list",itemName:"li",render:function(e){return x.createElement("ol",{className:"list-decimal"},e.children)},renderItem:function(e){return x.createElement("li",null,e.children)}}),ie=Y({name:"ul",label:"Bullet list",itemName:"li",render:function(e){return x.createElement("ul",{className:"list-disc"},e.children)},renderItem:function(e){return x.createElement("li",null,e.children)}}),se=Object.freeze({__proto__:null,bold:V,italic:G,code:Q,highlight:q,link:X,heading1:$,heading2:Z,heading3:ee,heading4:te,heading5:ne,heading6:re,quote:ae,orderedList:oe,unorderedList:ie}),le=((D={})[exports.types.RichTextFeatures.Bold]={newPlugin:V,renderLeaf:"renderBold"},D[exports.types.RichTextFeatures.Italic]={newPlugin:G,renderLeaf:"renderItalic"},D[exports.types.RichTextFeatures.Highlight]={newPlugin:q,renderLeaf:"renderHighlight"},D[exports.types.RichTextFeatures.Code]={newPlugin:Q,renderLeaf:"renderCode"},D[exports.types.RichTextFeatures.Link]={newPlugin:X,renderLink:"renderLink"},D[exports.types.RichTextFeatures.UnorderedList]={newPlugin:ie,renderElement:"renderUL",renderItemElement:"renderLI"},D[exports.types.RichTextFeatures.OrderedList]={newPlugin:oe,renderElement:"renderOL",renderItemElement:"renderLI"},D[exports.types.RichTextFeatures.Heading1]={newPlugin:$,renderElement:"renderH1"},D[exports.types.RichTextFeatures.Heading2]={newPlugin:Z,renderElement:"renderH2"},D[exports.types.RichTextFeatures.Heading3]={newPlugin:ee,renderElement:"renderH3"},D[exports.types.RichTextFeatures.Heading4]={newPlugin:te,renderElement:"renderH4"},D[exports.types.RichTextFeatures.Heading5]={newPlugin:ne,renderElement:"renderH5"},D[exports.types.RichTextFeatures.Heading6]={newPlugin:re,renderElement:"renderH6"},D[exports.types.RichTextFeatures.Quote]={newPlugin:ae,renderElement:"renderQuote"},D),ce=function(e){var t,n;if(null===(t=ce.prototype)||void 0===t?void 0:t.renderAdmin)return null===(n=ce.prototype)||void 0===n?void 0:n.renderAdmin(e);var r=[];return e.allowedFeatures&&e.allowedFeatures.length>0&&(r=e.allowedFeatures.map((function(t){var n=le[t],r=n.newPlugin,a=n.renderLeaf,o=n.renderElement,i=n.renderItemElement,s=n.renderLink,l={},c=e[a],u=e[o],d=e[i],p=e[s];return a&&c&&(l.renderLeaf=c),o&&u&&(l.renderElement=u),i&&d&&(l.renderItemElement=d),s&&p&&(l.renderElement=function(e){var t=e.attributes,n=e.children,r=e.element;return p({attributes:t,children:n,element:r,href:r.url})}),exports.__assign(exports.__assign({},r),l)}))),b.default.createElement(j,{renderBlock:e.renderBlock,placeholder:e.placeholder,propName:e.propName,plugins:r,multiline:e.multiline,softLineBreak:e.softLineBreak,renderPlaceholder:e.renderPlaceholder,metaFieldName:e.metaFieldName,customFieldName:e.customFieldName})},ue="https://api.reactbricks.com/v2",de=function(e,t){if(!t)return e;var n=e.lastIndexOf(".");return e.substring(0,n)+"/"+t+e.substring(n)},pe=function(e,t){return e?t?e.split(",").map((function(e){var n=I(e.trim().split(" "),2),r=n[0],a=n[1];return r&&a?"".concat(de(r,t)," ").concat(a):de(e,t)})).join(", "):e:""},ge=require("react-progressive-graceful-image").default,me=function(e){e.propName;var t=e.source,n=e.alt,r=e.wrapper,a=e.noLazyLoad,o=void 0!==a&&a;e.containerClassName,e.containerStyle;var i=e.imageClassName,s=e.imageStyle,l=void 0===s?{}:s;e.noWrapper;var c=e.sizes,u=void 0===c?"100vw":c,d=e.loading,p=void 0===d?"lazy":d;e.renderWrapper;var g=e.useNativeLazyLoading,m=void 0===g||g;e.useWebP;var f=T(e,["propName","source","alt","wrapper","noLazyLoad","containerClassName","containerStyle","imageClassName","imageStyle","noWrapper","sizes","loading","renderWrapper","useNativeLazyLoading","useWebP"]);if(!t)return null;var v=x.useContext(M).browserSupport,h=(null==t?void 0:t.alt)||n,y=de(t.src,t.seoName),b=t.fallbackSrc?de(t.fallbackSrc,t.seoName):"",E=de(t.placeholderSrc||"",t.seoName),k=pe(t.srcSet,t.seoName),P=t.fallbackSrc?pe(t.fallbackSrc,t.seoName):"",_=p,w=b&&!v.webP?b:y,I=b&&!v.webP?P:k,C=exports.__assign({src:w,srcSet:I,sizes:u,alt:h,width:t.width,height:t.height,loading:_,decoding:"async",className:"rb-lazy ".concat(i),style:l},f),S=exports.__assign(exports.__assign({},C),{className:i});return r({width:t.width,height:t.height,children:x.createElement(x.Fragment,null,v.lazyLoading&&m?x.createElement("img",exports.__assign({},C)):x.createElement(ge,{src:w,srcSetData:{srcSet:I,sizes:u},placeholder:E,delay:300,noLazyLoad:o},(function(e,t,n){var r=exports.__assign({},l);r.transition||(r.transition="filter 300ms ease-in-out"),t&&(r.filter="blur(2px)");var a=exports.__assign(exports.__assign({},C),{src:e,srcSet:n.srcSet,sizes:n.sizes});return x.createElement("img",exports.__assign({},a))})),x.createElement("noscript",null,x.createElement("style",{type:"text/css"},".rb-lazy { display: none; }"),x.createElement("img",exports.__assign({},S))))})},fe=function(t){var n,r,a=e.useContext(N).values,o=I(L(),2),i=o[0];o[1];var s=t.propName?a[t.propName]:t.metaFieldName?i.meta[t.metaFieldName]:t.customFieldName&&i.customValues?i.customValues[t.customFieldName]:null,l=function(e){var t=e.children;return x.createElement(x.Fragment,null,t)};if(!t.containerClassName&&!t.containerStyle||t.noWrapper||(l=function(e){var n=e.children;return x.createElement("div",{className:t.containerClassName,style:t.containerStyle},n)}),t.renderWrapper&&(l=t.renderWrapper),null===(n=fe.prototype)||void 0===n?void 0:n.renderAdmin)return null===(r=fe.prototype)||void 0===r?void 0:r.renderAdmin(t);t.maxWidth,t.aspectRatio;var c=T(t,["maxWidth","aspectRatio"]);return x.createElement(me,exports.__assign({},c,{source:s,wrapper:l}))},ve=function(t){var n,r=t.allowedExtensions,a=void 0===r?[]:r,o=t.propName,i=t.renderBlock,s=e.useContext(N).values[o];return(null===(n=ve.prototype)||void 0===n?void 0:n.renderAdmin)?ve.prototype.renderAdmin({propName:o,renderBlock:i,allowedExtensions:a}):s?i(s):null},he=function(t){var n,r,a=t.propName,o=t.itemProps,i=void 0===o?{}:o,s=t.renderWrapper,l=t.renderItemWrapper,c=e.useContext(M).bricks,u=e.useContext(N),d=u.values,p=u.blockId,g=u.blockType,m=u.parents,f=u.handleChange;u.handleAddItem;var v=d[a];if(null===(n=he.prototype)||void 0===n?void 0:n.renderAdmin)return null===(r=he.prototype)||void 0===r?void 0:r.renderAdmin({propName:a,itemProps:i,renderWrapper:s,renderItemWrapper:l});if(!v||0===v.length)return null;var h=C(C([],I(m),!1),[{blockId:p,typeName:g,propName:a}],!1),y=x.createElement(x.Fragment,null,v.map((function(e,t){var n=c[e.type];if(n){var r=exports.__assign(exports.__assign(exports.__assign({},e.props),i),{key:e.id,index:t,onChange:function(){}}),a=x.createElement(N.Provider,{key:e.id,value:{onChange:f(e.id,h),values:e.props,blockId:e.id,blockType:e.type,parents:h,handleChange:f}},x.createElement(n,exports.__assign({},r)));return l?l(a,t,v.length):a}})));return s?s(y):y},ye=function(){var e,t;return(null===(e=ye.prototype)||void 0===e?void 0:e.useAdmin)?null===(t=ye.prototype)||void 0===t?void 0:t.useAdmin():{isAdmin:!1,previewMode:!1,currentPage:{pageId:""}}},xe=function(t){var n,r,a=e.useContext(N),o=a.values,i=a.onChange;if(null===(n=xe.prototype)||void 0===n?void 0:n.useAdmin)return null===(r=xe.prototype)||void 0===r?void 0:r.useAdmin(t);return[o[t],function(e){return i(t,e)},!0]},be=function(){return x.createElement("div",{className:E.default("max-w-xl mx-auto py-6")})};be.schema={name:"paragraph",label:"Paragraph",getDefaultProps:function(){return{text:"Lorem ipsum dolor sit amet"}}};var Ee={paragraph:be},ke=[{type:exports.types.DeviceType.Phone,width:375,label:"Phone (375px)"},{type:exports.types.DeviceType.Tablet,width:768,label:"Tablet (768px)"},{type:exports.types.DeviceType.Desktop,width:"100%",label:"Desktop (100%)"}],Pe=new n.QueryClient,Te=new Promise((function(e){var t=new Image;t.onerror=function(){return e(!1)},t.onload=function(){return e(1===t.width)},t.src="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA="})).catch((function(){return!1})),_e=[{name:"page",pluralName:"pages",defaultLocked:!1,defaultStatus:exports.types.PageStatus.Draft,defaultLanguage:"en",getDefaultContent:function(){return[]}}],we={logoHeight:80,welcomeText:"Welcome",sideImage:"https://images.unsplash.com/photo-1461418559055-6f020c5a91e7?ixlib=rb-1.2.1&auto=format&fit=crop&w=1601&q=80"},Ie=function(e){var t=e.bricks,n=e.block;return x.createElement(x.Fragment,null,function(e){var n=t[e.type],r=I(L(),1)[0];if(n){var a=e.props;return n.schema.mapExternalDataToProps&&"function"==typeof n.schema.mapExternalDataToProps&&r.externalData&&"object"==typeof r.externalData&&(a=n.schema.mapExternalDataToProps(r.externalData,e.props)),x.createElement(N.Provider,{value:{values:a,onChange:function(){},blockId:e.id,blockType:e.type,parents:[],handleChange:function(e){return function(){}},handleAddItem:function(e){return function(){}}}},n.schema.name===exports.types.EmbedType?x.createElement("div",{style:{display:"relative",pointerEvents:"none"}},x.createElement("div",{style:{position:"absolute",inset:"2px"}}),x.createElement(Ae,{page:a.content,showClickToEdit:!1})):x.createElement(n,exports.__assign({},a)))}}(n))},Ce=function(e){var t=e.bricks,n=e.content;return x.createElement("div",null,n.map((function(e){return x.createElement(Ie,{key:e.id,bricks:t,block:e})})))},Se=function(t){var n=t.pageId,r=t.language,o=e.useContext(M),i=o.navigate,s=o.editorPath,l=o.clickToEditSide;if(l===exports.types.ClickToEditSide.None)return null;var c=I(e.useState(!1),2),u=c[0],d=c[1];if(e.useEffect((function(){d(!0)}),[]),!u)return null;var p,g=localStorage.getItem("rb_t");if(g&&g.length>10&&g.startsWith("ey")){var m={};return l===exports.types.ClickToEditSide.BottomRight&&(m.bottom=50,m.right=0,m.borderTopLeftRadius=999,m.borderBottomLeftRadius=999,m.transform="translate(8px,0)"),l===exports.types.ClickToEditSide.BottomLeft&&(m.bottom=50,m.left=0,m.borderTopRightRadius=999,m.borderBottomRightRadius=999,m.transform="translate(-8px,0)"),l===exports.types.ClickToEditSide.TopRight&&(m.top=50,m.right=0,m.borderTopLeftRadius=999,m.borderBottomLeftRadius=999,m.transform="translate(8px,0)"),l===exports.types.ClickToEditSide.TopLeft&&(m.top=50,m.left=0,m.borderTopRightRadius=999,m.borderBottomRightRadius=999,m.transform="translate(-8px,0)"),b.default.createElement(b.default.Fragment,null,b.default.createElement("style",null,"\n.rb-click-to-edit {\n position: fixed;\n width: 61px;\n height: 38px;\n background-color: #f65a8e;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: 20px;\n cursor: pointer;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n transition: all 150ms ease;\n border: 2px solid #fff;\n}\n.rb-click-to-edit-left:hover {\n transform: translate(-2px,0)!important;\n}\n.rb-click-to-edit-right:hover {\n transform: translate(2px,0)!important;\n}\n "),b.default.createElement("div",{className:"rb-click-to-edit ".concat((p=l,p===exports.types.ClickToEditSide.TopLeft||p===exports.types.ClickToEditSide.BottomLeft?"rb-click-to-edit-left":"rb-click-to-edit-right")),style:m,onClick:function(){return i("".concat(s,"?p=").concat(encodeURIComponent(n),"&l=").concat(r))}},b.default.createElement(a.FiEdit,null)))}return null},Ae=function(t){var n=t.page,r=t.showClickToEdit,a=void 0===r||r;if(!n)return null;var o=e.useContext(M).bricks;n.content;var i=T(n,["content"]),s=exports.__assign({},i);return x.createElement("div",null,n&&n.content&&n.content.length>0&&x.createElement(A.Provider,{value:{pageValues:s}},x.createElement(Ce,{bricks:o,content:n.content}),!!a&&x.createElement(Se,{pageId:n.id,language:n.language})))},Le=function(e,t,n){return!(n&&n.find((function(t){return t===e}))||t&&!t.find((function(t){return t===e})))},Ne={id:"",type:"",slug:"",name:"",meta:{},author:{id:"",firstName:"",lastName:"",email:""},status:exports.types.PageStatus.Draft,isLocked:!1,content:[],tags:[],createdAt:"",language:"en",translations:[]},Be=function(e,t,n){if(!e||!e.type||!e.content)return Ne;var r=t.find((function(t){return t.name===e.type}));if(!r)return Ne;var a=Re(n,e.content,r.allowedBlockTypes,r.excludedBlockTypes);return exports.__assign(exports.__assign({},e),{content:a.blocks,invalidBlocksTypes:a.invalidBlocksTypes})},Re=function(e,t,n,r){return t.reduce((function(t,a){var o=e[a.type];if(!o||!Le(a.type,n,r))return exports.__assign(exports.__assign({},t),{invalidBlocksTypes:C(C([],I(t.invalidBlocksTypes),!1),[a.type],!1)});var i=o.schema.sideEditProps?o.schema.sideEditProps.reduce((function(e,t){if(t.groupName||"BOOLEAN"!==t.type||e.push(t),t.groupName){var n=t.props.filter((function(e){return"BOOLEAN"===e.type}));e=C(C([],I(e),!1),I(n),!1)}return e}),[]):[],s=i.reduce((function(e,t){var n,r=a.props[t.name];return exports.__assign(exports.__assign({},e),((n={})[t.name]=!!r,n))}),{}),l=exports.__assign(exports.__assign({},a),{props:exports.__assign(exports.__assign({},a.props),s)});return Object.keys(l.props).forEach((function(t){var n,r,a,i,s,c,u;l.props[t]&&(null===(r=null===(n=l.props[t])||void 0===n?void 0:n.document)||void 0===r?void 0:r.data)&&(null===(i=null===(a=l.props[t])||void 0===a?void 0:a.document)||void 0===i?void 0:i.nodes)&&"document"===(null===(c=null===(s=l.props[t])||void 0===s?void 0:s.document)||void 0===c?void 0:c.object)||(null===(u=o.schema.repeaterItems)||void 0===u?void 0:u.find((function(e){return e.name===t})))&&(l.props[t]=Re(e,l.props[t]).blocks)})),exports.__assign(exports.__assign({},t),{blocks:C(C([],I(t.blocks),!1),[l],!1)})}),{blocks:[],invalidBlocksTypes:[]})},Oe=function(e){if("undefined"==typeof window)return null;e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(window.location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},De=function(e,t){return _(void 0,void 0,Promise,(function(){var n,r;return w(this,(function(a){switch(a.label){case 0:return n=null,(null==(r=null==t?void 0:t.find((function(t){return t.name===e.type})))?void 0:r.getExternalData)&&"function"==typeof r.getExternalData?[4,r.getExternalData(e)]:[3,2];case 1:return(n=a.sent())&&"object"==typeof n?[2,n]:[2,null];case 2:return[2,null]}}))}))},Fe=function(e,t,n){return _(void 0,void 0,void 0,(function(){var r,a,o,i,s;return w(this,(function(l){switch(l.label){case 0:return r=e.content.filter((function(e){return e.type===exports.types.EmbedType})),[4,Promise.all(r.map((function(e){return _(void 0,void 0,void 0,(function(){var t,r,a;return w(this,(function(o){switch(o.label){case 0:return(null==(t=e.props.page)?void 0:t.id)&&(null==t?void 0:t.language)?[4,n(t)]:[3,2];case 1:return a=o.sent(),[3,3];case 2:a=[],o.label=3;case 3:return r=a,[2,exports.__assign(exports.__assign({},e),{props:exports.__assign(exports.__assign({},e.props),{content:r})})]}}))}))})))];case 1:return a=l.sent(),o=e.content.reduce((function(e,t){if(t.type===exports.types.EmbedType){var n=a.find((function(e){var n,r,a,o;return e.type===exports.types.EmbedType&&(null===(n=e.props.page)||void 0===n?void 0:n.id)===(null===(r=t.props.page)||void 0===r?void 0:r.id)&&(null===(a=e.props.page)||void 0===a?void 0:a.language)===(null===(o=t.props.page)||void 0===o?void 0:o.language)}));return n?C(C([],I(e),!1),[n],!1):e}return C(C([],I(e),!1),[t],!1)}),[]),[4,Promise.all(r.map((function(e){return _(void 0,void 0,void 0,(function(){var r,a;return w(this,(function(o){switch(o.label){case 0:return r=e.props.page,[4,n(r)];case 1:return a=o.sent(),[2,De(a,t)]}}))}))})))];case 2:return i=l.sent(),s=i.reduce((function(e,t){return t?exports.__assign(exports.__assign({},e),t):e}),{}),[2,{contentWithEmbeds:o,externalDataEmbed:s}]}}))}))},ze=function(e){return function(t){return _(void 0,void 0,void 0,(function(){return w(this,(function(n){switch(n.label){case 0:return[4,k.default.get(t.language?"".concat(ue,"/app/pages/").concat(t.slug,"/translations/").concat(t.language):"".concat(ue,"/app/pages/").concat(t.slug),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:return[2,n.sent().data]}}))}))}},He=function(e){return e.reduce((function(e,t){var n=[];for(var r in t.props)Array.isArray(t.props[r])&&t.props[r].length>0&&t.props[r][0].props?n.push.apply(n,C([],I(He(t.props[r])),!1)):n.push(F.serialize(t.props[r]));return C(C([],I(e),!1),I(n),!1)}),[])};exports.API_URI=ue,exports.AUTH_TOKEN_LS_KEY="rb_t",exports.BlockContext=N,exports.CompatibleRichText=ce,exports.ContentEditorContext=S,exports.EMPTY_PAGE=Ne,exports.File=ve,exports.Image=fe,exports.ImageViewer=me,exports.Link=J,exports.PageViewer=Ae,exports.Plain=F,exports.Preview=function(){var t=I(e.useState(),2),n=t[0],r=t[1],a=e.useContext(M),o=a.bricks,i=a.pageTypes;if(e.useEffect((function(){_(void 0,void 0,void 0,(function(){var e,t,n,a,s,l;return w(this,(function(c){switch(c.label){case 0:return(e=new URLSearchParams(window.location.search)).has("p")?(t=encodeURIComponent(e.get("p")||""),[4,k.default.get("".concat(ue,"/app/preview/").concat(t))]):[3,4];case 1:return n=c.sent().data,a=null,(null==(s=null==i?void 0:i.find((function(e){return e.name===n.type})))?void 0:s.getExternalData)&&"function"==typeof s.getExternalData?[4,s.getExternalData(n)]:[3,3];case 2:(a=c.sent())&&"object"==typeof a&&(n.externalData=a),c.label=3;case 3:l=Be(n,i,o),r(l),c.label=4;case 4:return[2]}}))}))}),[]),!n)return null;n.content;var s=T(n,["content"]),l=exports.__assign({},s);return x.createElement("div",null,n&&n.content&&n.content.length>0&&x.createElement(A.Provider,{value:{pageValues:l}},x.createElement(Ce,{bricks:o,content:n.content})))},exports.ReactBricks=function(e){var t=e.appId,r=e.apiKey,a=e.bricks,o=e.pageTypes,i=e.customFields,s=e.logo,l=void 0===s?"":s,c=e.loginUI,u=e.contentClassName,d=void 0===u?"":u,p=e.renderLocalLink,g=e.navigate,m=e.loginPath,f=void 0===m?"/admin":m,v=e.editorPath,h=void 0===v?"/admin/editor":v,y=e.playgroundPath,b=void 0===y?"/admin/playground":y,E=e.appSettingsPath,k=void 0===E?"/admin/app-settings":E,P=e.previewPath,T=void 0===P?"/preview":P,C=e.getAdminMenu,S=e.isDarkColorMode,A=void 0!==S&&S,L=e.toggleColorMode,N=e.useCssInJs,B=void 0!==N&&N,R=e.appRootElement,O=e.clickToEditSide,D=void 0===O?exports.types.ClickToEditSide.BottomRight:O,F=e.responsiveBreakpoints,z=e.enableAutoSave,H=void 0===z||z,K=e.disableSaveIfInvalidProps,U=void 0!==K&&K,j=e.enablePreview,W=void 0===j||j,V=e.blockIconsPosition,G=void 0===V?exports.types.BlockIconsPosition.InsideBlock:V,Q=e.enableUnsplash,q=void 0===Q||Q,J=e.unsplashApiKey,X=e.enablePreviewImage,Y=void 0!==X&&X,$=e.enablePreviewIcon,Z=void 0!==$&&$,ee=e.children,te=I(x.useState({webP:!0,lazyLoading:!0}),2),ne=te[0],re=te[1];x.useEffect((function(){_(void 0,void 0,Promise,(function(){var e,t;return w(this,(function(n){switch(n.label){case 0:return e=!1,"loading"in HTMLImageElement.prototype&&(e=!0),[4,Te];case 1:return t=n.sent(),re({webP:t,lazyLoading:e}),[2]}}))}))}),[]);var ae=!1;if(a&&0!==a.length||console.warn("No bricks provided. Using default paragraph."),o||console.warn("No Page type schema provided. Using default page."),Array.isArray(a)||(console.error('"bricks" should be an array of Bricks'),ae=!0),null==o||o.forEach((function(e){e.getDefaultContent&&e.getDefaultContent().length>0&&"string"!=typeof e.getDefaultContent()[0]&&console.error("A page type getDefaultContent() must return an array of bricks' names: please check the ".concat(e.name," page type."))})),a&&a.forEach((function(e){e.schema?(e.schema.render&&console.warn('The "render" method is depreacted on React Bricks v2 bricks. Please check the '.concat(name," brick.")),e.schema.superType&&console.warn('The "superType" property is depreacted on React Bricks v2 bricks. Please check the '.concat(name," brick.")),e.schema.textEditProps&&console.warn('The "textEditProps" property is depreacted on React Bricks v2 bricks. Please check the '.concat(name," brick."))):(console.error('Each brick component must have a "schema" property. Please check the '.concat(name," brick.")),ae=!0)})),ae)return x.createElement("div",{style:{padding:"8px 16px",backgroundColor:"#fff5f5",border:"1px solid #fed7d7",borderRadius:4,color:"#c53030",margin:"50px auto",width:300}},"At least a blocking error found in schema. Check the console.");var oe=null==a?void 0:a.reduce((function(e,t){var n;return exports.__assign(exports.__assign({},e),((n={})[t.schema.name]=t,n))}),{}),ie=F&&F.length?F:ke,se=we;return c&&(se=c,void 0===c.sideImage&&(se.sideImage=we.sideImage),void 0===c.welcomeText&&(se.welcomeText=we.welcomeText),void 0===c.logoHeight&&(se.logoHeight=we.logoHeight)),x.createElement(M.Provider,{value:{appId:t,apiKey:r,bricks:oe||Ee,pageTypes:o||_e,customFields:i,logo:l,loginUI:se,contentClassName:d,renderLocalLink:p,navigate:g,loginPath:f,editorPath:h,playgroundPath:b,appSettingsPath:k,previewPath:T,getAdminMenu:C,isDarkColorMode:A,toggleColorMode:L,useCssInJs:B,appRootElement:R,clickToEditSide:D,responsiveBreakpoints:ie,enableAutoSave:!!H,disableSaveIfInvalidProps:!!U,enablePreview:!!W,browserSupport:ne,blockIconsPosition:G,enableUnsplash:q,unsplashApiKey:J,enablePreviewImage:Y,enablePreviewIcon:Z}},x.createElement(n.QueryClientProvider,{client:Pe},ee))},exports.ReactBricksContext=M,exports.Repeater=he,exports.RichText=j,exports.SOCKET_PATH="/ws/",exports.SOCKET_URI="https://ws.reactbricks.com",exports.Text=U,exports.__awaiter=_,exports.__extends=function(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}P(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},exports.__generator=w,exports.__read=I,exports.__rest=T,exports.__spreadArray=C,exports.__values=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},exports.blockAllowed=Le,exports.blockPluginConstructor=Y,exports.cleanBlocks=Re,exports.cleanPage=Be,exports.fetchPage=function(e,t,n,r){return _(void 0,void 0,Promise,(function(){var a,o,i,s,l,c;return w(this,(function(u){switch(u.label){case 0:return[4,(a=ze(t))({slug:e,language:n})];case 1:return o=u.sent(),[4,De(o,r)];case 2:return i=u.sent(),[4,Fe(o,r||[],a)];case 3:return s=u.sent(),l=s.contentWithEmbeds,c=s.externalDataEmbed,o.content=l,o.externalData=exports.__assign(exports.__assign({},i||{}),c||{}),[2,o]}}))}))},exports.fetchPages=function(e,t){var n=void 0===t?{}:t,r=n.type,a=void 0===r?"":r,o=n.types,i=void 0===o?[]:o,s=n.tag,l=void 0===s?"":s,c=n.language,u=void 0===c?"":c,d=n.page,p=void 0===d?1:d,g=n.pageSize,m=void 0===g?100:g,f=n.sort,v=void 0===f?"":f,h=n.filterBy,y=void 0===h?{}:h,x=n.usePagination,b=void 0!==x&&x;return _(void 0,void 0,void 0,(function(){var t,n,r,o,s;return w(this,(function(c){switch(c.label){case 0:return m<=0&&(m=100),t="type=".concat(a,"&types=").concat(null==i?void 0:i.join(","),"&tag=").concat(l,"&language=").concat(u,"&page=").concat(p,"&pageSize=").concat(m,"&sort=").concat(v,"&filterBy=").concat(JSON.stringify(y)),[4,k.default.get("".concat(ue,"/app/pages?").concat(t),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:return n=c.sent(),r=n.data,o=n.headers,b?(s=o["x-total-count"]?parseInt(o["x-total-count"],10):0,[2,{items:r,pagination:{page:p,pageSize:m,totalItems:s,totalPages:Math.ceil(s/m)}}]):[2,r]}}))}))},exports.fetchTags=function(e,t,n){return void 0===t&&(t=1),void 0===n&&(n=100),_(void 0,void 0,Promise,(function(){var r,a,o,i;return w(this,(function(s){switch(s.label){case 0:return[4,k.default.get("".concat(ue,"/app/tags?pageSize=").concat(n,"&page=").concat(t),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:return r=s.sent(),a=r.data,o=r.headers,i=o["x-total-count"]?parseInt(o["x-total-count"],10):0,[2,{items:a,pagination:{page:t,pageSize:n,totalItems:i,totalPages:Math.ceil(i/n)}}]}}))}))},exports.getPagePlainText=He,exports.getUrlParameter=Oe,exports.markPluginConstructor=W,exports.plugins=se,exports.queryClient=Pe,exports.useAdminContext=ye,exports.usePage=function(t,r){var a=e.useContext(M).pageTypes,o=localStorage.getItem("rb_t"),i=Oe("t");return n.useQuery(["page",{pageId:t,language:r}],(function(){return _(void 0,void 0,Promise,(function(){var e,n,s,l,c,u;return w(this,(function(d){switch(d.label){case 0:return p=o||i,e=function(e){return _(void 0,void 0,void 0,(function(){return w(this,(function(t){switch(t.label){case 0:return[4,k.default.get(e.language?"".concat(ue,"/admin/pages/").concat(e.id,"/translations/").concat(e.language):"".concat(ue,"/admin/pages/").concat(e.id),{headers:{Authorization:"Bearer ".concat(p)}})];case 1:return[2,t.sent().data]}}))}))},[4,e({id:t,language:r})];case 1:return n=d.sent(),[4,De(n,a)];case 2:return s=d.sent(),[4,Fe(n,a,e)];case 3:return l=d.sent(),c=l.contentWithEmbeds,u=l.externalDataEmbed,n.content=c,n.externalData=exports.__assign(exports.__assign({},s||{}),u||{}),[2,n]}var p}))}))}),{enabled:!(!t||!o&&!i),refetchOnWindowFocus:!1})},exports.usePage$1=function(t,r){var a=e.useContext(M),o=a.apiKey,i=a.pageTypes;return n.useQuery(["pagePublic",{slug:t,language:r}],(function(){return _(void 0,void 0,Promise,(function(){var e,n,a,s,l,c;return w(this,(function(u){switch(u.label){case 0:return[4,(e=ze(o))({slug:t,language:r})];case 1:return n=u.sent(),[4,De(n,i)];case 2:return a=u.sent(),[4,Fe(n,i,e)];case 3:return s=u.sent(),l=s.contentWithEmbeds,c=s.externalDataEmbed,n.content=l,n.externalData=exports.__assign(exports.__assign({},a||{}),c||{}),[2,n]}}))}))}),{enabled:!!t})},exports.usePageValues=L,exports.usePages=function(e){var t=void 0===e?{}:e,r=t.type,a=void 0===r?"":r,o=t.types,i=void 0===o?[]:o,s=t.tag,l=void 0===s?"":s,c=t.language,u=void 0===c?"":c,d=t.page,p=void 0===d?1:d,g=t.pageSize,m=void 0===g?1e3:g,f=t.sort,v=void 0===f?"":f,h=t.usePagination,y=void 0!==h&&h,x=t.filterBy,b=void 0===x?{}:x;m<=0&&(m=1e3);var E=localStorage.getItem("rb_t"),P=Oe("t"),T="type=".concat(a,"&types=").concat(null==i?void 0:i.join(","),"&tag=").concat(l,"&language=").concat(u,"&page=").concat(p,"&pageSize=").concat(m,"&sort=").concat(v,"&filterBy=").concat(JSON.stringify(b));return n.useQuery(["pages",{pageType:a,pageTypes:i,tag:l,language:u,page:p,pageSize:m,sort:v}],(function(){return _(void 0,void 0,void 0,(function(){var e,t,n,r;return w(this,(function(a){switch(a.label){case 0:return[4,k.default.get("".concat(ue,"/admin/pages?").concat(T))];case 1:return e=a.sent(),t=e.data,n=e.headers,y?(r=n["x-total-count"]?parseInt(n["x-total-count"],10):0,[2,{items:t,pagination:{page:p,pageSize:m,totalItems:r,totalPages:Math.ceil(r/m)}}]):[2,t]}}))}))}),{enabled:!!E||!!P})},exports.usePagesPublic=function(t){var r=void 0===t?{}:t,a=r.type,o=void 0===a?"":a,i=r.types,s=void 0===i?[]:i,l=r.tag,c=void 0===l?"":l,u=r.language,d=void 0===u?"":u,p=r.page,g=void 0===p?1:p,m=r.pageSize,f=void 0===m?100:m,v=r.sort,h=void 0===v?"":v,y=r.usePagination,x=void 0!==y&&y,b=r.filterBy,E=void 0===b?{}:b,P=e.useContext(M).apiKey;f<=0&&(f=100);var T="type=".concat(o,"&types=").concat(null==s?void 0:s.join(","),"&tag=").concat(c,"&language=").concat(d,"&page=").concat(g,"&pageSize=").concat(f,"&sort=").concat(h,"&filterBy=").concat(JSON.stringify(E));return n.useQuery(["pagesPublic",{pageType:o,pageTypes:s,tag:c,page:g,pageSize:f,sort:h}],(function(){return _(void 0,void 0,void 0,(function(){var e,t,n,r;return w(this,(function(a){switch(a.label){case 0:return[4,k.default.get("".concat(ue,"/app/pages?").concat(T),{headers:{Authorization:"Bearer ".concat(P)}})];case 1:return e=a.sent(),t=e.data,n=e.headers,x?(r=n["x-total-count"]?parseInt(n["x-total-count"],10):0,[2,{items:t,pagination:{page:g,pageSize:f,totalItems:r,totalPages:Math.ceil(r/f)}}]):[2,t]}}))}))}))},exports.useReactBricksContext=function(){return e.useContext(M)},exports.useTagsPublic=function(t,r){void 0===t&&(t=1),void 0===r&&(r=100);var a=e.useContext(M).apiKey;return n.useQuery(["tagsPublic"],(function(){return _(void 0,void 0,void 0,(function(){var e,n,o,i;return w(this,(function(s){switch(s.label){case 0:return[4,k.default.get("".concat(ue,"/app/tags?pageSize=").concat(r,"&page=").concat(t),{headers:{Authorization:"Bearer ".concat(a)}})];case 1:return e=s.sent(),n=e.data,o=e.headers,i=o["x-total-count"]?parseInt(o["x-total-count"],10):0,[2,{items:n,pagination:{page:t,pageSize:r,totalItems:i,totalPages:Math.ceil(i/r)}}]}}))}))}),{staleTime:3e5})},exports.useVisualEdit=xe;
|
|
2
|
-
//# sourceMappingURL=react-bricks-1a4433ad.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import t,{useContext as n,useState as r,useEffect as a}from"react";import o from"classnames";import{QueryClient as i,QueryClientProvider as l,useQuery as c}from"react-query";import s from"axios";import{FiEdit as u}from"react-icons/fi";var d=function(e,t){return d=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])},d(e,t)};function p(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}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var m,g=function(){return g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},g.apply(this,arguments)};function f(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 a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}function v(e,t,n,r){return new(n||(n=Promise))((function(a,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function l(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}c((r=r.apply(e,t||[])).next())}))}function h(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&o[0]?r.return:o[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;switch(r=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],r=0}finally{n=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function E(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){var t,n,r,a,o,i,l,c,s,u,d;e.EmbedType="RB_PAGE_EMBED",(t=e.SideEditPropType||(e.SideEditPropType={})).Text="TEXT",t.Textarea="TEXTAREA",t.Number="NUMBER",t.Date="DATE",t.Range="RANGE",t.Boolean="BOOLEAN",t.Select="SELECT",t.Image="IMAGE",t.Custom="CUSTOM",t.Relationship="RELATIONSHIP",(n=e.OptionsDisplay||(e.OptionsDisplay={})).Select="SELECT",n.Radio="RADIO",n.Color="COLOR",(r=e.RichTextFeatures||(e.RichTextFeatures={})).Bold="BOLD",r.Italic="ITALIC",r.Code="CODE",r.Highlight="HIGHLIGHT",r.Link="LINK",r.UnorderedList="UL",r.OrderedList="OL",r.Heading1="H1",r.Heading2="H2",r.Heading3="H3",r.Heading4="H4",r.Heading5="H5",r.Heading6="H6",r.Quote="QUOTE",(a=e.SortDirection||(e.SortDirection={})).Up="UP",a.Down="DOWN",(o=e.PageStatus||(e.PageStatus={})).Draft="DRAFT",o.Published="PUBLISHED",(i=e.DeployEnvironment||(e.DeployEnvironment={})).Staging="STAGING",i.Production="PRODUCTION",(l=e.PlaygroundSelectedItemType||(e.PlaygroundSelectedItemType={})).Block="BLOCK",l.Page="PAGE",(c=e.DeviceType||(e.DeviceType={})).Desktop="DESKTOP",c.Tablet="TABLET",c.Phone="PHONE",(s=e.Tab||(e.Tab={})).Block="BLOCK",s.Item="ITEM",s.PageSettings="PAGE-SETTINGS",s.Document="DOCUMENT",s.Stories="STORIES",s.CollaborationLocked="COLLABORATION-LOCKED",(u=e.ClickToEditSide||(e.ClickToEditSide={})).BottomRight="BOTTOM-RIGHT",u.BottomLeft="BOTTOM-LEFT",u.TopRight="TOP-RIGHT",u.TopLeft="TOP-LEFT",u.None="NONE",(d=e.BlockIconsPosition||(e.BlockIconsPosition={})).InsideBlock="INSIDE-BLOCK",d.OutsideBlock="OUTSIDE-BLOCK"}(m||(m={}));var k=e.createContext({focused:{blockId:""},setFocused:function(){},triggerTextRefreshBlockId:"",setTriggerTextRefreshBlockId:function(){},setAddAfterBlockId:function(){},pageValues:{id:"",type:"",name:"",slug:"",meta:{},authorId:"",author:{id:"",email:"",firstName:"",lastName:""},invalidBlocksTypes:[],status:m.PageStatus.Draft,isLocked:!1,tags:[],createdAt:"",publishedAt:"",language:"",translations:[]},handleChangePageValue:function(){}}),P=e.createContext({pageValues:{id:"",type:"",name:"",slug:"",meta:{},authorId:"",author:{id:"",email:"",firstName:"",lastName:""},invalidBlocksTypes:[],status:m.PageStatus.Draft,isLocked:!1,tags:[],createdAt:"",publishedAt:"",language:"",translations:[]}}),T=function(){var e=n(k),t=e.pageValues,r=e.handleChangePageValue,a=n(P).pageValues;return[t.id?t:a,r]},w=e.createContext({values:{},onChange:function(){},blockId:"",blockType:"",parents:[],handleChange:function(e){return function(){}}}),x=function(e){return function(e){var t,n;if(!1===S(e))return!1;if("function"!=typeof(t=e.constructor))return!1;if(!1===S(n=t.prototype))return!1;if(!1===n.hasOwnProperty("isPrototypeOf"))return!1;return!0}(e)&&"string"==typeof e.text};function I(e){return x(e)?e.text:e.children&&Array.isArray(e.children)?e.children.map(I).join(""):""}function S(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}var L,N={serialize:function(e){return Array.isArray(e)&&e.length>0?e.map(I).join("\n"):""},deserialize:function(e){return e.split("\n").map((function(e){return{type:"paragraph",children:[{text:e}]}}))},isText:x},A=function(t,n,r){if(N.isText(t)){var a=C(t.text);return n.filter((function(e){return"Mark"===e.type})).reduce((function(e,n){return t[n.name]?n.renderLeaf({children:e}):e}),a)}var o=n.filter((function(e){return"List"===e.type})).find((function(e){return t.type===e.name}));if(o){var i=B(t,n);return o.renderElement({children:i.map((function(t,n){return e.createElement(e.Fragment,{key:n},o.renderItemElement({children:t}))})),element:{url:t.url}})}var l=B(t,n,r),c=n.filter((function(e){return"Block"===e.type})).find((function(e){return t.type===e.name}));return c?c.renderElement({children:l,element:{url:t.url}}):r?r({children:l,element:{type:"",children:[]},attributes:{ref:null}}):l},B=function(t,n,r){var a;return null===(a=t.children)||void 0===a?void 0:a.map((function(t,a){return e.createElement(e.Fragment,{key:a},A(t,n,r))}))},C=function(t){var n=null==t?void 0:t.replace(/\n/g,"<|BR|>\n<|BR|>").split("<|BR|>");if(n)return 1===n.length?t:e.createElement(e.Fragment,null,n.map((function(t,n,r){return"\n"===t&&r.length===n+1||"\n"===t&&r.length===n+2&&""===r[r.length-1]?e.createElement(e.Fragment,{key:n},e.createElement("br",null)," "):"\n"===t?e.createElement("br",null):e.createElement(e.Fragment,{key:n},t)})))},R=function(t){var r,a,o=t.renderBlock,i=t.placeholder,l=t.renderPlaceholder,c=t.propName,s=t.multiline,u=void 0!==s&&s,d=t.softLineBreak,p=void 0!==d&&d,m=t.metaFieldName,g=t.customFieldName,f=n(w).values,v=b(T(),1)[0],h=c?f[c]:m?v.meta[m]||"":g&&v.customValues&&v.customValues[g]||"";if(null===(r=R.prototype)||void 0===r?void 0:r.renderAdmin)return null===(a=R.prototype)||void 0===a?void 0:a.renderAdmin({renderBlock:o,placeholder:i,renderPlaceholder:l,propName:c,multiline:u,softLineBreak:p,metaFieldName:m,customFieldName:g});var y=h;return h?("string"==typeof h&&(y=N.deserialize(h)),e.createElement(e.Fragment,null,y.map((function(t,n){return e.createElement(e.Fragment,{key:n},A(t,[],o))})))):null},O=function(t){var r,a,o=t.renderBlock,i=t.placeholder,l=t.renderPlaceholder,c=t.propName,s=t.plugins,u=void 0===s?[]:s,d=t.multiline,p=void 0===d||d,m=t.softLineBreak,g=void 0===m||m,f=t.metaFieldName,v=t.customFieldName,h=n(w).values,y=b(T(),1)[0],E=c?h[c]:f?y.meta[f]:v&&y.customValues?y.customValues[v]:"";if(null===(r=O.prototype)||void 0===r?void 0:r.renderAdmin)return null===(a=O.prototype)||void 0===a?void 0:a.renderAdmin({renderBlock:o,placeholder:i,renderPlaceholder:l,propName:c,plugins:u,multiline:p,softLineBreak:g,metaFieldName:f,customFieldName:v});var k=E;return E?("string"==typeof E&&(k=N.deserialize(E)),e.createElement(e.Fragment,null,k.map((function(t,n){return e.createElement(e.Fragment,{key:n},A(t,u,o))})))):null},D=e.createContext({appId:"",apiKey:"",bricks:{},pageTypes:[],logo:"",loginUI:{},contentClassName:"",renderLocalLink:function(t){var n=t.href,r=t.children;return e.createElement("a",{href:n},r)},navigate:function(){},loginPath:"",editorPath:"",playgroundPath:"",appSettingsPath:"",previewPath:"",getAdminMenu:function(e){return e.isAdmin,[]},useCssInJs:!1,appRootElement:"",clickToEditSide:m.ClickToEditSide.BottomRight,responsiveBreakpoints:[],enableAutoSave:!0,disableSaveIfInvalidProps:!1,enablePreview:!0,browserSupport:{webP:!0,lazyLoading:!0},blockIconsPosition:m.BlockIconsPosition.InsideBlock,enableUnsplash:!0,unsplashApiKey:"",enablePreviewImage:!1,enablePreviewIcon:!1}),F=function(e){var t,n;return(null===(t=F.prototype)||void 0===t?void 0:t.adminConstructor)?null===(n=F.prototype)||void 0===n?void 0:n.adminConstructor(e):{type:"Mark",name:e.name,label:e.label||e.name[0].toUpperCase()+e.name.slice(1),hotKey:e.hotKey,renderLeaf:e.render,toggle:function(e){}}},z=F({name:"bold",hotKey:"mod+b",render:function(t){return e.createElement("strong",null,t.children)}}),H=F({name:"italic",hotKey:"mod+i",render:function(t){return e.createElement("em",null,t.children)}}),K=F({name:"code",hotKey:"mod+`",render:function(t){return e.createElement("code",{style:{margin:"0 1px",display:"inline-block",padding:"3px 6px",fontSize:"0.875rem",lineHeight:1.25,maxWidth:"100%",fontFamily:'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',borderRadius:"3px",backgroundColor:"#F5F7F9"}},t.children)}}),U=F({name:"highlight",hotKey:"mod+h",render:function(t){return e.createElement("mark",{style:{paddingLeft:4,paddingRight:4,borderRadius:2,backgroundColor:"#ff0",color:"#0f0f05"}},t.children)}}),j=function(t){var r,a,o=t.href,i=t.children,l=t.target,c=t.className,s=f(t,["href","children","target","className"]),u=n(D).renderLocalLink;if(null===(r=j.prototype)||void 0===r?void 0:r.renderAdmin)return null===(a=j.prototype)||void 0===a?void 0:a.renderAdmin(g({href:o,children:i,target:l,className:c},s));var d={href:o};return/^\/(?!\/)/.test(o)?u?u(g({href:o,target:l,children:i,className:c},s)):(u||console.warn("Local path found in Link, but no renderLocalLink function was provided. Rendering <a> as fallback"),e.createElement("a",g({},d,{target:l,className:c},s),i)):e.createElement("a",g({},d,{target:l,className:c},s),i)},M={type:"Block",name:"link",label:"Link",isInline:!0,renderElement:function(t){var n=t.attributes,r=t.children,a=t.element;return e.createElement(j,g({},n,{href:a.url}),r)},toggle:function(e){}},W=function(e){var t,n;return(null===(t=W.prototype)||void 0===t?void 0:t.adminConstructor)?null===(n=W.prototype)||void 0===n?void 0:n.adminConstructor(e):{type:e.itemName?"List":"Block",name:e.name,isInline:e.isInline,itemName:e.itemName,label:e.label||e.name[0].toUpperCase()+e.name.slice(1),hotKey:e.hotKey,renderElement:e.render,renderItemElement:e.renderItem,toggle:function(e,t){}}},_=W({name:"h1",hotKey:"mod+shift+1",render:function(t){return e.createElement("h1",null,t.children)}}),V=W({name:"h2",hotKey:"mod+shift+2",render:function(t){return e.createElement("h2",null,t.children)}}),G=W({name:"h3",hotKey:"mod+shift+3",render:function(t){return e.createElement("h3",null,t.children)}}),J=W({name:"h4",hotKey:"mod+shift+4",render:function(t){return e.createElement("h4",null,t.children)}}),Q=W({name:"h5",hotKey:"mod+shift+5",render:function(t){return e.createElement("h5",null,t.children)}}),q=W({name:"h6",hotKey:"mod+shift+6",render:function(t){return e.createElement("h6",null,t.children)}}),X=W({name:"quote",render:function(t){return e.createElement("blockquote",null,t.children)}}),Y=W({name:"ol",label:"Number list",itemName:"li",render:function(t){return e.createElement("ol",{className:"list-decimal"},t.children)},renderItem:function(t){return e.createElement("li",null,t.children)}}),Z=W({name:"ul",label:"Bullet list",itemName:"li",render:function(t){return e.createElement("ul",{className:"list-disc"},t.children)},renderItem:function(t){return e.createElement("li",null,t.children)}}),$=Object.freeze({__proto__:null,bold:z,italic:H,code:K,highlight:U,link:M,heading1:_,heading2:V,heading3:G,heading4:J,heading5:Q,heading6:q,quote:X,orderedList:Y,unorderedList:Z}),ee=((L={})[m.RichTextFeatures.Bold]={newPlugin:z,renderLeaf:"renderBold"},L[m.RichTextFeatures.Italic]={newPlugin:H,renderLeaf:"renderItalic"},L[m.RichTextFeatures.Highlight]={newPlugin:U,renderLeaf:"renderHighlight"},L[m.RichTextFeatures.Code]={newPlugin:K,renderLeaf:"renderCode"},L[m.RichTextFeatures.Link]={newPlugin:M,renderLink:"renderLink"},L[m.RichTextFeatures.UnorderedList]={newPlugin:Z,renderElement:"renderUL",renderItemElement:"renderLI"},L[m.RichTextFeatures.OrderedList]={newPlugin:Y,renderElement:"renderOL",renderItemElement:"renderLI"},L[m.RichTextFeatures.Heading1]={newPlugin:_,renderElement:"renderH1"},L[m.RichTextFeatures.Heading2]={newPlugin:V,renderElement:"renderH2"},L[m.RichTextFeatures.Heading3]={newPlugin:G,renderElement:"renderH3"},L[m.RichTextFeatures.Heading4]={newPlugin:J,renderElement:"renderH4"},L[m.RichTextFeatures.Heading5]={newPlugin:Q,renderElement:"renderH5"},L[m.RichTextFeatures.Heading6]={newPlugin:q,renderElement:"renderH6"},L[m.RichTextFeatures.Quote]={newPlugin:X,renderElement:"renderQuote"},L),te=function(e){var n,r;if(null===(n=te.prototype)||void 0===n?void 0:n.renderAdmin)return null===(r=te.prototype)||void 0===r?void 0:r.renderAdmin(e);var a=[];return e.allowedFeatures&&e.allowedFeatures.length>0&&(a=e.allowedFeatures.map((function(t){var n=ee[t],r=n.newPlugin,a=n.renderLeaf,o=n.renderElement,i=n.renderItemElement,l=n.renderLink,c={},s=e[a],u=e[o],d=e[i],p=e[l];return a&&s&&(c.renderLeaf=s),o&&u&&(c.renderElement=u),i&&d&&(c.renderItemElement=d),l&&p&&(c.renderElement=function(e){var t=e.attributes,n=e.children,r=e.element;return p({attributes:t,children:n,element:r,href:r.url})}),g(g({},r),c)}))),t.createElement(O,{renderBlock:e.renderBlock,placeholder:e.placeholder,propName:e.propName,plugins:a,multiline:e.multiline,softLineBreak:e.softLineBreak,renderPlaceholder:e.renderPlaceholder,metaFieldName:e.metaFieldName,customFieldName:e.customFieldName})},ne="https://api.reactbricks.com/v2",re="rb_t",ae="https://ws.reactbricks.com",oe="/ws/",ie=function(e,t){if(!t)return e;var n=e.lastIndexOf(".");return e.substring(0,n)+"/"+t+e.substring(n)},le=function(e,t){return e?t?e.split(",").map((function(e){var n=b(e.trim().split(" "),2),r=n[0],a=n[1];return r&&a?"".concat(ie(r,t)," ").concat(a):ie(e,t)})).join(", "):e:""},ce=require("react-progressive-graceful-image").default,se=function(t){t.propName;var n=t.source,r=t.alt,a=t.wrapper,o=t.noLazyLoad,i=void 0!==o&&o;t.containerClassName,t.containerStyle;var l=t.imageClassName,c=t.imageStyle,s=void 0===c?{}:c;t.noWrapper;var u=t.sizes,d=void 0===u?"100vw":u,p=t.loading,m=void 0===p?"lazy":p;t.renderWrapper;var v=t.useNativeLazyLoading,h=void 0===v||v;t.useWebP;var y=f(t,["propName","source","alt","wrapper","noLazyLoad","containerClassName","containerStyle","imageClassName","imageStyle","noWrapper","sizes","loading","renderWrapper","useNativeLazyLoading","useWebP"]);if(!n)return null;var b=e.useContext(D).browserSupport,E=(null==n?void 0:n.alt)||r,k=ie(n.src,n.seoName),P=n.fallbackSrc?ie(n.fallbackSrc,n.seoName):"",T=ie(n.placeholderSrc||"",n.seoName),w=le(n.srcSet,n.seoName),x=n.fallbackSrc?le(n.fallbackSrc,n.seoName):"",I=m,S=P&&!b.webP?P:k,L=P&&!b.webP?x:w,N=g({src:S,srcSet:L,sizes:d,alt:E,width:n.width,height:n.height,loading:I,decoding:"async",className:"rb-lazy ".concat(l),style:s},y),A=g(g({},N),{className:l});return a({width:n.width,height:n.height,children:e.createElement(e.Fragment,null,b.lazyLoading&&h?e.createElement("img",g({},N)):e.createElement(ce,{src:S,srcSetData:{srcSet:L,sizes:d},placeholder:T,delay:300,noLazyLoad:i},(function(t,n,r){var a=g({},s);a.transition||(a.transition="filter 300ms ease-in-out"),n&&(a.filter="blur(2px)");var o=g(g({},N),{src:t,srcSet:r.srcSet,sizes:r.sizes});return e.createElement("img",g({},o))})),e.createElement("noscript",null,e.createElement("style",{type:"text/css"},".rb-lazy { display: none; }"),e.createElement("img",g({},A))))})},ue=function(t){var r,a,o=n(w).values,i=b(T(),2),l=i[0];i[1];var c=t.propName?o[t.propName]:t.metaFieldName?l.meta[t.metaFieldName]:t.customFieldName&&l.customValues?l.customValues[t.customFieldName]:null,s=function(t){var n=t.children;return e.createElement(e.Fragment,null,n)};if(!t.containerClassName&&!t.containerStyle||t.noWrapper||(s=function(n){var r=n.children;return e.createElement("div",{className:t.containerClassName,style:t.containerStyle},r)}),t.renderWrapper&&(s=t.renderWrapper),null===(r=ue.prototype)||void 0===r?void 0:r.renderAdmin)return null===(a=ue.prototype)||void 0===a?void 0:a.renderAdmin(t);t.maxWidth,t.aspectRatio;var u=f(t,["maxWidth","aspectRatio"]);return e.createElement(se,g({},u,{source:c,wrapper:s}))},de=function(e){var t,r=e.allowedExtensions,a=void 0===r?[]:r,o=e.propName,i=e.renderBlock,l=n(w).values[o];return(null===(t=de.prototype)||void 0===t?void 0:t.renderAdmin)?de.prototype.renderAdmin({propName:o,renderBlock:i,allowedExtensions:a}):l?i(l):null},pe=function(t){var r,a,o=t.propName,i=t.itemProps,l=void 0===i?{}:i,c=t.renderWrapper,s=t.renderItemWrapper,u=n(D).bricks,d=n(w),p=d.values,m=d.blockId,f=d.blockType,v=d.parents,h=d.handleChange;d.handleAddItem;var y=p[o];if(null===(r=pe.prototype)||void 0===r?void 0:r.renderAdmin)return null===(a=pe.prototype)||void 0===a?void 0:a.renderAdmin({propName:o,itemProps:l,renderWrapper:c,renderItemWrapper:s});if(!y||0===y.length)return null;var k=E(E([],b(v),!1),[{blockId:m,typeName:f,propName:o}],!1),P=e.createElement(e.Fragment,null,y.map((function(t,n){var r=u[t.type];if(r){var a=g(g(g({},t.props),l),{key:t.id,index:n,onChange:function(){}}),o=e.createElement(w.Provider,{key:t.id,value:{onChange:h(t.id,k),values:t.props,blockId:t.id,blockType:t.type,parents:k,handleChange:h}},e.createElement(r,g({},a)));return s?s(o,n,y.length):o}})));return c?c(P):P},me=function(){var e,t;return(null===(e=me.prototype)||void 0===e?void 0:e.useAdmin)?null===(t=me.prototype)||void 0===t?void 0:t.useAdmin():{isAdmin:!1,previewMode:!1,currentPage:{pageId:""}}},ge=function(e){var t,r,a=n(w),o=a.values,i=a.onChange;if(null===(t=ge.prototype)||void 0===t?void 0:t.useAdmin)return null===(r=ge.prototype)||void 0===r?void 0:r.useAdmin(e);return[o[e],function(t){return i(e,t)},!0]},fe=function(){return e.createElement("div",{className:o("max-w-xl mx-auto py-6")})};fe.schema={name:"paragraph",label:"Paragraph",getDefaultProps:function(){return{text:"Lorem ipsum dolor sit amet"}}};var ve={paragraph:fe},he=[{type:m.DeviceType.Phone,width:375,label:"Phone (375px)"},{type:m.DeviceType.Tablet,width:768,label:"Tablet (768px)"},{type:m.DeviceType.Desktop,width:"100%",label:"Desktop (100%)"}],ye=new i,be=new Promise((function(e){var t=new Image;t.onerror=function(){return e(!1)},t.onload=function(){return e(1===t.width)},t.src="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA="})).catch((function(){return!1})),Ee=[{name:"page",pluralName:"pages",defaultLocked:!1,defaultStatus:m.PageStatus.Draft,defaultLanguage:"en",getDefaultContent:function(){return[]}}],ke={logoHeight:80,welcomeText:"Welcome",sideImage:"https://images.unsplash.com/photo-1461418559055-6f020c5a91e7?ixlib=rb-1.2.1&auto=format&fit=crop&w=1601&q=80"},Pe=function(t){var n=t.appId,r=t.apiKey,a=t.bricks,o=t.pageTypes,i=t.customFields,c=t.logo,s=void 0===c?"":c,u=t.loginUI,d=t.contentClassName,p=void 0===d?"":d,f=t.renderLocalLink,y=t.navigate,E=t.loginPath,k=void 0===E?"/admin":E,P=t.editorPath,T=void 0===P?"/admin/editor":P,w=t.playgroundPath,x=void 0===w?"/admin/playground":w,I=t.appSettingsPath,S=void 0===I?"/admin/app-settings":I,L=t.previewPath,N=void 0===L?"/preview":L,A=t.getAdminMenu,B=t.isDarkColorMode,C=void 0!==B&&B,R=t.toggleColorMode,O=t.useCssInJs,F=void 0!==O&&O,z=t.appRootElement,H=t.clickToEditSide,K=void 0===H?m.ClickToEditSide.BottomRight:H,U=t.responsiveBreakpoints,j=t.enableAutoSave,M=void 0===j||j,W=t.disableSaveIfInvalidProps,_=void 0!==W&&W,V=t.enablePreview,G=void 0===V||V,J=t.blockIconsPosition,Q=void 0===J?m.BlockIconsPosition.InsideBlock:J,q=t.enableUnsplash,X=void 0===q||q,Y=t.unsplashApiKey,Z=t.enablePreviewImage,$=void 0!==Z&&Z,ee=t.enablePreviewIcon,te=void 0!==ee&&ee,ne=t.children,re=b(e.useState({webP:!0,lazyLoading:!0}),2),ae=re[0],oe=re[1];e.useEffect((function(){v(void 0,void 0,Promise,(function(){var e,t;return h(this,(function(n){switch(n.label){case 0:return e=!1,"loading"in HTMLImageElement.prototype&&(e=!0),[4,be];case 1:return t=n.sent(),oe({webP:t,lazyLoading:e}),[2]}}))}))}),[]);var ie=!1;if(a&&0!==a.length||console.warn("No bricks provided. Using default paragraph."),o||console.warn("No Page type schema provided. Using default page."),Array.isArray(a)||(console.error('"bricks" should be an array of Bricks'),ie=!0),null==o||o.forEach((function(e){e.getDefaultContent&&e.getDefaultContent().length>0&&"string"!=typeof e.getDefaultContent()[0]&&console.error("A page type getDefaultContent() must return an array of bricks' names: please check the ".concat(e.name," page type."))})),a&&a.forEach((function(e){e.schema?(e.schema.render&&console.warn('The "render" method is depreacted on React Bricks v2 bricks. Please check the '.concat(name," brick.")),e.schema.superType&&console.warn('The "superType" property is depreacted on React Bricks v2 bricks. Please check the '.concat(name," brick.")),e.schema.textEditProps&&console.warn('The "textEditProps" property is depreacted on React Bricks v2 bricks. Please check the '.concat(name," brick."))):(console.error('Each brick component must have a "schema" property. Please check the '.concat(name," brick.")),ie=!0)})),ie)return e.createElement("div",{style:{padding:"8px 16px",backgroundColor:"#fff5f5",border:"1px solid #fed7d7",borderRadius:4,color:"#c53030",margin:"50px auto",width:300}},"At least a blocking error found in schema. Check the console.");var le=null==a?void 0:a.reduce((function(e,t){var n;return g(g({},e),((n={})[t.schema.name]=t,n))}),{}),ce=U&&U.length?U:he,se=ke;return u&&(se=u,void 0===u.sideImage&&(se.sideImage=ke.sideImage),void 0===u.welcomeText&&(se.welcomeText=ke.welcomeText),void 0===u.logoHeight&&(se.logoHeight=ke.logoHeight)),e.createElement(D.Provider,{value:{appId:n,apiKey:r,bricks:le||ve,pageTypes:o||Ee,customFields:i,logo:s,loginUI:se,contentClassName:p,renderLocalLink:f,navigate:y,loginPath:k,editorPath:T,playgroundPath:x,appSettingsPath:S,previewPath:N,getAdminMenu:A,isDarkColorMode:C,toggleColorMode:R,useCssInJs:F,appRootElement:z,clickToEditSide:K,responsiveBreakpoints:ce,enableAutoSave:!!M,disableSaveIfInvalidProps:!!_,enablePreview:!!G,browserSupport:ae,blockIconsPosition:Q,enableUnsplash:X,unsplashApiKey:Y,enablePreviewImage:$,enablePreviewIcon:te}},e.createElement(l,{client:ye},ne))},Te=function(t){var n=t.bricks,r=t.block;return e.createElement(e.Fragment,null,function(t){var r=n[t.type],a=b(T(),1)[0];if(r){var o=t.props;return r.schema.mapExternalDataToProps&&"function"==typeof r.schema.mapExternalDataToProps&&a.externalData&&"object"==typeof a.externalData&&(o=r.schema.mapExternalDataToProps(a.externalData,t.props)),e.createElement(w.Provider,{value:{values:o,onChange:function(){},blockId:t.id,blockType:t.type,parents:[],handleChange:function(e){return function(){}},handleAddItem:function(e){return function(){}}}},r.schema.name===m.EmbedType?e.createElement("div",{style:{display:"relative",pointerEvents:"none"}},e.createElement("div",{style:{position:"absolute",inset:"2px"}}),e.createElement(Ie,{page:o.content,showClickToEdit:!1})):e.createElement(r,g({},o)))}}(r))},we=function(t){var n=t.bricks,r=t.content;return e.createElement("div",null,r.map((function(t){return e.createElement(Te,{key:t.id,bricks:n,block:t})})))},xe=function(e){var o=e.pageId,i=e.language,l=n(D),c=l.navigate,s=l.editorPath,d=l.clickToEditSide;if(d===m.ClickToEditSide.None)return null;var p=b(r(!1),2),g=p[0],f=p[1];if(a((function(){f(!0)}),[]),!g)return null;var v,h=localStorage.getItem("rb_t");if(h&&h.length>10&&h.startsWith("ey")){var y={};return d===m.ClickToEditSide.BottomRight&&(y.bottom=50,y.right=0,y.borderTopLeftRadius=999,y.borderBottomLeftRadius=999,y.transform="translate(8px,0)"),d===m.ClickToEditSide.BottomLeft&&(y.bottom=50,y.left=0,y.borderTopRightRadius=999,y.borderBottomRightRadius=999,y.transform="translate(-8px,0)"),d===m.ClickToEditSide.TopRight&&(y.top=50,y.right=0,y.borderTopLeftRadius=999,y.borderBottomLeftRadius=999,y.transform="translate(8px,0)"),d===m.ClickToEditSide.TopLeft&&(y.top=50,y.left=0,y.borderTopRightRadius=999,y.borderBottomRightRadius=999,y.transform="translate(-8px,0)"),t.createElement(t.Fragment,null,t.createElement("style",null,"\n.rb-click-to-edit {\n position: fixed;\n width: 61px;\n height: 38px;\n background-color: #f65a8e;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n font-size: 20px;\n cursor: pointer;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n transition: all 150ms ease;\n border: 2px solid #fff;\n}\n.rb-click-to-edit-left:hover {\n transform: translate(-2px,0)!important;\n}\n.rb-click-to-edit-right:hover {\n transform: translate(2px,0)!important;\n}\n "),t.createElement("div",{className:"rb-click-to-edit ".concat((v=d,v===m.ClickToEditSide.TopLeft||v===m.ClickToEditSide.BottomLeft?"rb-click-to-edit-left":"rb-click-to-edit-right")),style:y,onClick:function(){return c("".concat(s,"?p=").concat(encodeURIComponent(o),"&l=").concat(i))}},t.createElement(u,null)))}return null},Ie=function(t){var r=t.page,a=t.showClickToEdit,o=void 0===a||a;if(!r)return null;var i=n(D).bricks;r.content;var l=f(r,["content"]),c=g({},l);return e.createElement("div",null,r&&r.content&&r.content.length>0&&e.createElement(P.Provider,{value:{pageValues:c}},e.createElement(we,{bricks:i,content:r.content}),!!o&&e.createElement(xe,{pageId:r.id,language:r.language})))},Se=function(e,t,n){return!(n&&n.find((function(t){return t===e}))||t&&!t.find((function(t){return t===e})))},Le={id:"",type:"",slug:"",name:"",meta:{},author:{id:"",firstName:"",lastName:"",email:""},status:m.PageStatus.Draft,isLocked:!1,content:[],tags:[],createdAt:"",language:"en",translations:[]},Ne=function(e,t,n){if(!e||!e.type||!e.content)return Le;var r=t.find((function(t){return t.name===e.type}));if(!r)return Le;var a=Ae(n,e.content,r.allowedBlockTypes,r.excludedBlockTypes);return g(g({},e),{content:a.blocks,invalidBlocksTypes:a.invalidBlocksTypes})},Ae=function(e,t,n,r){return t.reduce((function(t,a){var o=e[a.type];if(!o||!Se(a.type,n,r))return g(g({},t),{invalidBlocksTypes:E(E([],b(t.invalidBlocksTypes),!1),[a.type],!1)});var i=o.schema.sideEditProps?o.schema.sideEditProps.reduce((function(e,t){if(t.groupName||"BOOLEAN"!==t.type||e.push(t),t.groupName){var n=t.props.filter((function(e){return"BOOLEAN"===e.type}));e=E(E([],b(e),!1),b(n),!1)}return e}),[]):[],l=i.reduce((function(e,t){var n,r=a.props[t.name];return g(g({},e),((n={})[t.name]=!!r,n))}),{}),c=g(g({},a),{props:g(g({},a.props),l)});return Object.keys(c.props).forEach((function(t){var n,r,a,i,l,s,u;c.props[t]&&(null===(r=null===(n=c.props[t])||void 0===n?void 0:n.document)||void 0===r?void 0:r.data)&&(null===(i=null===(a=c.props[t])||void 0===a?void 0:a.document)||void 0===i?void 0:i.nodes)&&"document"===(null===(s=null===(l=c.props[t])||void 0===l?void 0:l.document)||void 0===s?void 0:s.object)||(null===(u=o.schema.repeaterItems)||void 0===u?void 0:u.find((function(e){return e.name===t})))&&(c.props[t]=Ae(e,c.props[t]).blocks)})),g(g({},t),{blocks:E(E([],b(t.blocks),!1),[c],!1)})}),{blocks:[],invalidBlocksTypes:[]})},Be=function(){var t=b(r(),2),o=t[0],i=t[1],l=n(D),c=l.bricks,u=l.pageTypes;if(a((function(){v(void 0,void 0,void 0,(function(){var e,t,n,r,a,o;return h(this,(function(l){switch(l.label){case 0:return(e=new URLSearchParams(window.location.search)).has("p")?(t=encodeURIComponent(e.get("p")||""),[4,s.get("".concat(ne,"/app/preview/").concat(t))]):[3,4];case 1:return n=l.sent().data,r=null,(null==(a=null==u?void 0:u.find((function(e){return e.name===n.type})))?void 0:a.getExternalData)&&"function"==typeof a.getExternalData?[4,a.getExternalData(n)]:[3,3];case 2:(r=l.sent())&&"object"==typeof r&&(n.externalData=r),l.label=3;case 3:o=Ne(n,u,c),i(o),l.label=4;case 4:return[2]}}))}))}),[]),!o)return null;o.content;var d=f(o,["content"]),p=g({},d);return e.createElement("div",null,o&&o.content&&o.content.length>0&&e.createElement(P.Provider,{value:{pageValues:p}},e.createElement(we,{bricks:c,content:o.content})))},Ce=function(e){if("undefined"==typeof window)return null;e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(window.location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},Re=function(e,t){return v(void 0,void 0,Promise,(function(){var n,r;return h(this,(function(a){switch(a.label){case 0:return n=null,(null==(r=null==t?void 0:t.find((function(t){return t.name===e.type})))?void 0:r.getExternalData)&&"function"==typeof r.getExternalData?[4,r.getExternalData(e)]:[3,2];case 1:return(n=a.sent())&&"object"==typeof n?[2,n]:[2,null];case 2:return[2,null]}}))}))},Oe=function(e,t,n){return v(void 0,void 0,void 0,(function(){var r,a,o,i,l;return h(this,(function(c){switch(c.label){case 0:return r=e.content.filter((function(e){return e.type===m.EmbedType})),[4,Promise.all(r.map((function(e){return v(void 0,void 0,void 0,(function(){var t,r,a;return h(this,(function(o){switch(o.label){case 0:return(null==(t=e.props.page)?void 0:t.id)&&(null==t?void 0:t.language)?[4,n(t)]:[3,2];case 1:return a=o.sent(),[3,3];case 2:a=[],o.label=3;case 3:return r=a,[2,g(g({},e),{props:g(g({},e.props),{content:r})})]}}))}))})))];case 1:return a=c.sent(),o=e.content.reduce((function(e,t){if(t.type===m.EmbedType){var n=a.find((function(e){var n,r,a,o;return e.type===m.EmbedType&&(null===(n=e.props.page)||void 0===n?void 0:n.id)===(null===(r=t.props.page)||void 0===r?void 0:r.id)&&(null===(a=e.props.page)||void 0===a?void 0:a.language)===(null===(o=t.props.page)||void 0===o?void 0:o.language)}));return n?E(E([],b(e),!1),[n],!1):e}return E(E([],b(e),!1),[t],!1)}),[]),[4,Promise.all(r.map((function(e){return v(void 0,void 0,void 0,(function(){var r,a;return h(this,(function(o){switch(o.label){case 0:return r=e.props.page,[4,n(r)];case 1:return a=o.sent(),[2,Re(a,t)]}}))}))})))];case 2:return i=c.sent(),l=i.reduce((function(e,t){return t?g(g({},e),t):e}),{}),[2,{contentWithEmbeds:o,externalDataEmbed:l}]}}))}))},De=function(e){return function(t){return v(void 0,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,s.get(t.language?"".concat(ne,"/app/pages/").concat(t.slug,"/translations/").concat(t.language):"".concat(ne,"/app/pages/").concat(t.slug),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:return[2,n.sent().data]}}))}))}},Fe=function(e,t){var r=n(D).pageTypes,a=localStorage.getItem("rb_t"),o=Ce("t");return c(["page",{pageId:e,language:t}],(function(){return v(void 0,void 0,Promise,(function(){var n,i,l,c,u,d;return h(this,(function(p){switch(p.label){case 0:return m=a||o,n=function(e){return v(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,s.get(e.language?"".concat(ne,"/admin/pages/").concat(e.id,"/translations/").concat(e.language):"".concat(ne,"/admin/pages/").concat(e.id),{headers:{Authorization:"Bearer ".concat(m)}})];case 1:return[2,t.sent().data]}}))}))},[4,n({id:e,language:t})];case 1:return i=p.sent(),[4,Re(i,r)];case 2:return l=p.sent(),[4,Oe(i,r,n)];case 3:return c=p.sent(),u=c.contentWithEmbeds,d=c.externalDataEmbed,i.content=u,i.externalData=g(g({},l||{}),d||{}),[2,i]}var m}))}))}),{enabled:!(!e||!a&&!o),refetchOnWindowFocus:!1})},ze=function(e,t){var r=n(D),a=r.apiKey,o=r.pageTypes;return c(["pagePublic",{slug:e,language:t}],(function(){return v(void 0,void 0,Promise,(function(){var n,r,i,l,c,s;return h(this,(function(u){switch(u.label){case 0:return[4,(n=De(a))({slug:e,language:t})];case 1:return r=u.sent(),[4,Re(r,o)];case 2:return i=u.sent(),[4,Oe(r,o,n)];case 3:return l=u.sent(),c=l.contentWithEmbeds,s=l.externalDataEmbed,r.content=c,r.externalData=g(g({},i||{}),s||{}),[2,r]}}))}))}),{enabled:!!e})},He=function(e){var t=void 0===e?{}:e,n=t.type,r=void 0===n?"":n,a=t.types,o=void 0===a?[]:a,i=t.tag,l=void 0===i?"":i,u=t.language,d=void 0===u?"":u,p=t.page,m=void 0===p?1:p,g=t.pageSize,f=void 0===g?1e3:g,y=t.sort,b=void 0===y?"":y,E=t.usePagination,k=void 0!==E&&E,P=t.filterBy,T=void 0===P?{}:P;f<=0&&(f=1e3);var w=localStorage.getItem("rb_t"),x=Ce("t"),I="type=".concat(r,"&types=").concat(null==o?void 0:o.join(","),"&tag=").concat(l,"&language=").concat(d,"&page=").concat(m,"&pageSize=").concat(f,"&sort=").concat(b,"&filterBy=").concat(JSON.stringify(T));return c(["pages",{pageType:r,pageTypes:o,tag:l,language:d,page:m,pageSize:f,sort:b}],(function(){return v(void 0,void 0,void 0,(function(){var e,t,n,r;return h(this,(function(a){switch(a.label){case 0:return[4,s.get("".concat(ne,"/admin/pages?").concat(I))];case 1:return e=a.sent(),t=e.data,n=e.headers,k?(r=n["x-total-count"]?parseInt(n["x-total-count"],10):0,[2,{items:t,pagination:{page:m,pageSize:f,totalItems:r,totalPages:Math.ceil(r/f)}}]):[2,t]}}))}))}),{enabled:!!w||!!x})},Ke=function(e){var t=void 0===e?{}:e,r=t.type,a=void 0===r?"":r,o=t.types,i=void 0===o?[]:o,l=t.tag,u=void 0===l?"":l,d=t.language,p=void 0===d?"":d,m=t.page,g=void 0===m?1:m,f=t.pageSize,y=void 0===f?100:f,b=t.sort,E=void 0===b?"":b,k=t.usePagination,P=void 0!==k&&k,T=t.filterBy,w=void 0===T?{}:T,x=n(D).apiKey;y<=0&&(y=100);var I="type=".concat(a,"&types=").concat(null==i?void 0:i.join(","),"&tag=").concat(u,"&language=").concat(p,"&page=").concat(g,"&pageSize=").concat(y,"&sort=").concat(E,"&filterBy=").concat(JSON.stringify(w));return c(["pagesPublic",{pageType:a,pageTypes:i,tag:u,page:g,pageSize:y,sort:E}],(function(){return v(void 0,void 0,void 0,(function(){var e,t,n,r;return h(this,(function(a){switch(a.label){case 0:return[4,s.get("".concat(ne,"/app/pages?").concat(I),{headers:{Authorization:"Bearer ".concat(x)}})];case 1:return e=a.sent(),t=e.data,n=e.headers,P?(r=n["x-total-count"]?parseInt(n["x-total-count"],10):0,[2,{items:t,pagination:{page:g,pageSize:y,totalItems:r,totalPages:Math.ceil(r/y)}}]):[2,t]}}))}))}))},Ue=function(e,t){void 0===e&&(e=1),void 0===t&&(t=100);var r=n(D).apiKey;return c(["tagsPublic"],(function(){return v(void 0,void 0,void 0,(function(){var n,a,o,i;return h(this,(function(l){switch(l.label){case 0:return[4,s.get("".concat(ne,"/app/tags?pageSize=").concat(t,"&page=").concat(e),{headers:{Authorization:"Bearer ".concat(r)}})];case 1:return n=l.sent(),a=n.data,o=n.headers,i=o["x-total-count"]?parseInt(o["x-total-count"],10):0,[2,{items:a,pagination:{page:e,pageSize:t,totalItems:i,totalPages:Math.ceil(i/t)}}]}}))}))}),{staleTime:3e5})},je=function(){return n(D)},Me=function(e,t,n,r){return v(void 0,void 0,Promise,(function(){var a,o,i,l,c,s;return h(this,(function(u){switch(u.label){case 0:return[4,(a=De(t))({slug:e,language:n})];case 1:return o=u.sent(),[4,Re(o,r)];case 2:return i=u.sent(),[4,Oe(o,r||[],a)];case 3:return l=u.sent(),c=l.contentWithEmbeds,s=l.externalDataEmbed,o.content=c,o.externalData=g(g({},i||{}),s||{}),[2,o]}}))}))},We=function(e,t){var n=void 0===t?{}:t,r=n.type,a=void 0===r?"":r,o=n.types,i=void 0===o?[]:o,l=n.tag,c=void 0===l?"":l,u=n.language,d=void 0===u?"":u,p=n.page,m=void 0===p?1:p,g=n.pageSize,f=void 0===g?100:g,y=n.sort,b=void 0===y?"":y,E=n.filterBy,k=void 0===E?{}:E,P=n.usePagination,T=void 0!==P&&P;return v(void 0,void 0,void 0,(function(){var t,n,r,o,l;return h(this,(function(u){switch(u.label){case 0:return f<=0&&(f=100),t="type=".concat(a,"&types=").concat(null==i?void 0:i.join(","),"&tag=").concat(c,"&language=").concat(d,"&page=").concat(m,"&pageSize=").concat(f,"&sort=").concat(b,"&filterBy=").concat(JSON.stringify(k)),[4,s.get("".concat(ne,"/app/pages?").concat(t),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:return n=u.sent(),r=n.data,o=n.headers,T?(l=o["x-total-count"]?parseInt(o["x-total-count"],10):0,[2,{items:r,pagination:{page:m,pageSize:f,totalItems:l,totalPages:Math.ceil(l/f)}}]):[2,r]}}))}))},_e=function(e,t,n){return void 0===t&&(t=1),void 0===n&&(n=100),v(void 0,void 0,Promise,(function(){var r,a,o,i;return h(this,(function(l){switch(l.label){case 0:return[4,s.get("".concat(ne,"/app/tags?pageSize=").concat(n,"&page=").concat(t),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:return r=l.sent(),a=r.data,o=r.headers,i=o["x-total-count"]?parseInt(o["x-total-count"],10):0,[2,{items:a,pagination:{page:t,pageSize:n,totalItems:i,totalPages:Math.ceil(i/n)}}]}}))}))},Ve=function(e){return e.reduce((function(e,t){var n=[];for(var r in t.props)Array.isArray(t.props[r])&&t.props[r].length>0&&t.props[r][0].props?n.push.apply(n,E([],b(Ve(t.props[r])),!1)):n.push(N.serialize(t.props[r]));return E(E([],b(e),!1),b(n),!1)}),[])};export{ne as A,w as B,k as C,ue as D,Le as E,pe as F,de as G,me as H,se as I,ge as J,Pe as K,j as L,Be as M,ze as N,Ue as O,N as P,Me as Q,D as R,ae as S,R as T,We as U,_e as V,Ve as W,b as _,E as a,g as b,f as c,y as d,v as e,h as f,p as g,je as h,He as i,re as j,Ce as k,oe as l,Ie as m,Se as n,Ke as o,Fe as p,Ne as q,Ae as r,ye as s,m as t,T as u,W as v,F as w,$ as x,te as y,O as z};
|
|
2
|
-
//# sourceMappingURL=react-bricks-bc1cac75.esm.js.map
|