@contentstack/live-preview-utils 1.1.0 → 1.2.0
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/README.md +1 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/setupJest.d.ts +1 -0
- package/dist/setupJest.d.ts.map +1 -0
- package/dist/{contentstack-live-preview-HOC.d.ts → src/contentstack-live-preview-HOC.d.ts} +2 -1
- package/dist/src/contentstack-live-preview-HOC.d.ts.map +1 -0
- package/dist/{index.d.ts → src/index.d.ts} +0 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/{live-preview.d.ts → src/live-preview.d.ts} +0 -1
- package/dist/src/live-preview.d.ts.map +1 -0
- package/dist/{utils → src/utils}/defaults.d.ts +0 -0
- package/dist/src/utils/defaults.d.ts.map +1 -0
- package/dist/{utils → src/utils}/handleUserConfig.d.ts +0 -0
- package/dist/src/utils/handleUserConfig.d.ts.map +1 -0
- package/dist/{utils → src/utils}/index.d.ts +0 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/onCookieChange.d.ts +10 -0
- package/dist/src/utils/onCookieChange.d.ts.map +1 -0
- package/dist/{utils → src/utils}/public-logger.d.ts +0 -0
- package/dist/src/utils/public-logger.d.ts.map +1 -0
- package/dist/src/utils/replaceHtml.d.ts +7 -0
- package/dist/src/utils/replaceHtml.d.ts.map +1 -0
- package/dist/src/utils/types.d.ts +86 -0
- package/dist/src/utils/types.d.ts.map +1 -0
- package/package.json +2 -1
- package/dist/contentstack-live-preview-HOC.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/live-preview.d.ts.map +0 -1
- package/dist/utils/defaults.d.ts.map +0 -1
- package/dist/utils/handleUserConfig.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/public-logger.d.ts.map +0 -1
- package/dist/utils/types.d.ts +0 -49
- package/dist/utils/types.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take care of the rest.
|
|
4
4
|
|
|
5
|
-
Contentstack provides the Live Preview Utils SDK to establish a communication channel between the various Contentstack SDKs and your website, transmitting live changes to the preview pane.
|
|
5
|
+
Contentstack provides the Live Preview Utils SDK to establish a communication channel between the various Contentstack SDKs and your website, transmitting live changes to the preview pane. [Read More](https://www.contentstack.com/docs/content-managers/live-preview/).
|
|
6
6
|
|
|
7
7
|
# Installation
|
|
8
8
|
|
|
@@ -29,7 +29,6 @@ Use the following command to initialize the SDK:
|
|
|
29
29
|
import ContentstackLivePreview from "@contentstack/live-preview-utils";
|
|
30
30
|
|
|
31
31
|
ContentstackLivePreview.init({
|
|
32
|
-
enable: true,
|
|
33
32
|
stackDetails: {
|
|
34
33
|
apiKey: "your-stack-api-key",
|
|
35
34
|
},
|
|
@@ -38,11 +37,9 @@ ContentstackLivePreview.init({
|
|
|
38
37
|
|
|
39
38
|
ternatively, if you want to initialize the SDK directly inside the HTML tag, use the ContentstackLivePreview.init() method as follows:
|
|
40
39
|
|
|
41
|
-
|
|
42
40
|
```html
|
|
43
41
|
<script>
|
|
44
42
|
ContentstackLivePreview.init({
|
|
45
|
-
enable: true,
|
|
46
43
|
stackDetails: {
|
|
47
44
|
apiKey: "your-stack-api-key",
|
|
48
45
|
},
|
|
@@ -56,7 +53,6 @@ Live Preview provides edit tags that allow you to edit your content in real-time
|
|
|
56
53
|
|
|
57
54
|
To use live edit tags within your stack, you need to include them in your main index.js file as follows:
|
|
58
55
|
|
|
59
|
-
|
|
60
56
|
```javascript
|
|
61
57
|
import "@contentstack/live-preview-utils/dist/main.css";
|
|
62
58
|
```
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ContentstackLivePreview=t():e.ContentstackLivePreview=t()}(this,(function(){return(()=>{var e={704:e=>{e.exports=function(e,a){for(var l=e.split(t),s=l.length,c=new Array(s),u=0;u<s;u++){var d=l[u];if(""!==d){var p=n.test(d)&&!r.test(d);p&&(d=d.replace(i,(function(e,t,n){return o(e,d.length-n-e.length==0)})));var h=d[0];h=u>0?h.toUpperCase():h.toLowerCase(),c[u]=h+(p?d.slice(1):d.slice(1).toLowerCase())}}return c.join("")};var t=/[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/,n=/^[a-z\u00E0-\u00FCA-Z\u00C0-\u00DC][\d|a-z\u00E0-\u00FCA-Z\u00C0-\u00DC]*$/,i=/([A-Z\u00C0-\u00DC]{4,})/g,r=/^[A-Z\u00C0-\u00DC]+$/;function o(e,t){var n=e.split(""),i=n.shift().toUpperCase(),r=t?n.pop().toLowerCase():n.pop();return i+n.join("").toLowerCase()+r}},279:(e,t,n)=>{"use strict";n.r(t)},492:(e,t,n)=>{"use strict";var i;n.r(t),n.d(t,{default:()=>p});var r="undefined"==typeof document?void 0:document,o=!!r&&"content"in r.createElement("template"),a=!!r&&r.createRange&&"createContextualFragment"in r.createRange();function l(e,t){var n,i,r=e.nodeName,o=t.nodeName;return r===o||(n=r.charCodeAt(0),i=o.charCodeAt(0),n<=90&&i>=97?r===o.toUpperCase():i<=90&&n>=97&&o===r.toUpperCase())}function s(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var c={OPTION:function(e,t){var n=e.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}s(e,t,"selected")},INPUT:function(e,t){s(e,t,"checked"),s(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var i=e.firstChild;if(i){var r=i.nodeValue;if(r==n||!n&&r==e.placeholder)return;i.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,i,r=-1,o=0,a=e.firstChild;a;)if("OPTGROUP"===(i=a.nodeName&&a.nodeName.toUpperCase()))a=(n=a).firstChild;else{if("OPTION"===i){if(a.hasAttribute("selected")){r=o;break}o++}!(a=a.nextSibling)&&n&&(a=n.nextSibling,n=null)}e.selectedIndex=r}}};function u(){}function d(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}const p=function(e,t,n){if(n||(n={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName||"BODY"===e.nodeName){var s=t;(t=r.createElement("html")).innerHTML=s}else p=(p=t).trim(),t=o?function(e){var t=r.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(p):a?function(e){return i||(i=r.createRange()).selectNode(r.body),i.createContextualFragment(e).childNodes[0]}(p):function(e){var t=r.createElement("body");return t.innerHTML=e,t.childNodes[0]}(p);var p,h=n.getNodeKey||d,f=n.onBeforeNodeAdded||u,v=n.onNodeAdded||u,g=n.onBeforeElUpdated||u,m=n.onElUpdated||u,b=n.onBeforeNodeDiscarded||u,y=n.onNodeDiscarded||u,w=n.onBeforeElChildrenUpdated||u,C=!0===n.childrenOnly,P=Object.create(null),k=[];function L(e){k.push(e)}function U(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var i=void 0;t&&(i=h(n))?L(i):(y(n),n.firstChild&&U(n,t)),n=n.nextSibling}}function A(e,t,n){!1!==b(e)&&(t&&t.removeChild(e),y(e),U(e,n))}function E(e){v(e);for(var t=e.firstChild;t;){var n=t.nextSibling,i=h(t);if(i){var r=P[i];r&&l(t,r)?(t.parentNode.replaceChild(r,t),S(r,t)):E(t)}else E(t);t=n}}function S(e,t,n){var i=h(t);if(i&&delete P[i],!n){if(!1===g(e,t))return;if(function(e,t){var n,i,r,o,a=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var l=a.length-1;l>=0;l--)i=(n=a[l]).name,r=n.namespaceURI,o=n.value,r?(i=n.localName||i,e.getAttributeNS(r,i)!==o&&("xmlns"===n.prefix&&(i=n.name),e.setAttributeNS(r,i,o))):e.getAttribute(i)!==o&&e.setAttribute(i,o);for(var s=e.attributes,c=s.length-1;c>=0;c--)i=(n=s[c]).name,(r=n.namespaceURI)?(i=n.localName||i,t.hasAttributeNS(r,i)||e.removeAttributeNS(r,i)):t.hasAttribute(i)||e.removeAttribute(i)}}(e,t),m(e),!1===w(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var n,i,o,a,s,u=t.firstChild,d=e.firstChild;e:for(;u;){for(a=u.nextSibling,n=h(u);d;){if(o=d.nextSibling,u.isSameNode&&u.isSameNode(d)){u=a,d=o;continue e}i=h(d);var p=d.nodeType,v=void 0;if(p===u.nodeType&&(1===p?(n?n!==i&&((s=P[n])?o===s?v=!1:(e.insertBefore(s,d),i?L(i):A(d,e,!0),d=s):v=!1):i&&(v=!1),(v=!1!==v&&l(d,u))&&S(d,u)):3!==p&&8!=p||(v=!0,d.nodeValue!==u.nodeValue&&(d.nodeValue=u.nodeValue))),v){u=a,d=o;continue e}i?L(i):A(d,e,!0),d=o}if(n&&(s=P[n])&&l(s,u))e.appendChild(s),S(s,u);else{var g=f(u);!1!==g&&(g&&(u=g),u.actualize&&(u=u.actualize(e.ownerDocument||r)),e.appendChild(u),E(u))}u=a,d=o}!function(e,t,n){for(;t;){var i=t.nextSibling;(n=h(t))?L(n):A(t,e,!0),t=i}}(e,d,i);var m=c[e.nodeName];m&&m(e,t)}(e,t):c.TEXTAREA(e,t)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var i=h(n);i&&(P[i]=n),e(n),n=n.nextSibling}}(e);var _,D,T=e,O=T.nodeType,x=t.nodeType;if(!C)if(1===O)1===x?l(e,t)||(y(e),T=function(e,t){for(var n=e.firstChild;n;){var i=n.nextSibling;t.appendChild(n),n=i}return t}(e,(_=t.nodeName,(D=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==D?r.createElementNS(D,_):r.createElement(_)))):T=t;else if(3===O||8===O){if(x===O)return T.nodeValue!==t.nodeValue&&(T.nodeValue=t.nodeValue),T;T=t}if(T===t)y(e);else{if(t.isSameNode&&t.isSameNode(T))return;if(S(T,t,C),k)for(var M=0,N=k.length;M<N;M++){var I=P[k[M]];I&&A(I,I.parentNode,!1)}}return!C&&T!==e&&e.parentNode&&(T.actualize&&(T=T.actualize(e.ownerDocument||r)),e.parentNode.replaceChild(T,e)),T}},135:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((i=i.apply(e,t||[])).next())}))},r=this&&this.__generator||function(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: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(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentstackLivePreview=void 0;var a=n(614),l=o(n(704)),s=o(n(922)),c=n(334),u=n(895),d=function(){function e(){}return e.init=function(t){if(void 0===t&&(t=c.userInitData),"undefined"!=typeof window)return e.livePreview?(u.PublicLogger.warn("You have already initialized the Live Preview SDK. So, any subsequent initialization returns the existing SDK instance."),Promise.resolve(e.livePreview)):(e.livePreview=new s.default(t),e.livePreview.setOnChangeCallback(e.publish),Promise.resolve(e.livePreview));e.userConfig=t},e.publish=function(){Object.values(e.subscribers).forEach((function(e){e()}))},e.subscribe=function(t){var n=(0,a.v4)();return e.subscribers[n]=t,n},e.onEntryChange=function(t){e.userConfig&&(e.livePreview=new s.default(e.userConfig),e.livePreview.setOnChangeCallback(e.publish),e.userConfig=null);var n=e.subscribe(t);return t(),n},e.unsbscribeOnEntryChange=function(t){"string"==typeof t?(e.subscribers[t]||u.PublicLogger.warn("No subscriber found with the given id."),delete e.subscribers[t]):"function"==typeof t&&(Object.entries(e.subscribers).some((function(n){var i=n[0];return n[1]===t&&(delete e.subscribers[i],!0)}))||u.PublicLogger.warn("No subscriber found with the given callback."))},e.getGatsbyDataFormat=function(e,t){return i(this,void 0,void 0,(function(){return r(this,(function(n){return"function"==typeof e.find?[2,e.toJSON().find().then((function(n){return n.map((function(n){return n.map((function(n){var i;return(i={})[(0,l.default)(t+"_"+e.content_type_uid)]=n,i}))}))})).catch((function(e){console.error(e)}))]:"function"==typeof e.fetch?[2,e.toJSON().fetch().then((function(n){var i;return(i={})[(0,l.default)(t+"_"+e.content_type_uid)]=n.toJSON(),i})).catch((function(e){console.error(e)}))]:[2]}))}))},e.livePreview=null,e.userConfig=null,e.subscribers={},e}();t.ContentstackLivePreview=d,t.default=d,e.exports=d},607:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentstackLivePreview=void 0;var r=i(n(135));n(279),t.ContentstackLivePreview=r.default,t.default=t.ContentstackLivePreview,e.exports=t.ContentstackLivePreview},922:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=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},i.apply(this,arguments)},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(928),a=n(895),l=r(n(492)),s=n(383),c=n(334),u=function(){function e(e){var t=this;void 0===e&&(e=c.userInitData),this.config={ssr:!0,enable:!1,cleanCslpOnProduction:!0,stackDetails:{apiKey:"",environment:"",contentTypeUid:"",entryUid:""},clientUrlParams:{protocol:"https",host:"app.contentstack.com",port:443,url:"https://app.contentstack.com:443"},stackSdk:{live_preview:{},headers:{api_key:""},environment:""},onChange:function(){}},this.tooltip=null,this.currentElementBesideTooltip=null,this.tooltipChild={singular:null,multiple:null},this.tooltipCurrentChild="singular",this.createCslpTooltip=function(){if(!document.getElementById("cslp-tooltip")){var e=document.createElement("button");e.classList.add("cslp-tooltip"),e.setAttribute("data-test-id","cs-cslp-tooltip"),e.id="cslp-tooltip",window.document.body.insertAdjacentElement("beforeend",e),t.tooltipChild.singular=(0,o.createSingularEditButton)(t.scrollHandler),t.tooltipChild.multiple=(0,o.createMultipleEditButton)(t.scrollHandler,t.linkClickHandler),e.innerHTML="",e.appendChild(t.tooltipChild.singular),t.tooltip=e}t.updateTooltipPosition()},(0,s.handleInitData)(e,this.config),this.addEditStyleOnHover=this.addEditStyleOnHover.bind(this),this.generateRedirectUrl=this.generateRedirectUrl.bind(this),this.scrollHandler=this.scrollHandler.bind(this),this.linkClickHandler=this.linkClickHandler.bind(this),this.handleUserChange=this.handleUserChange.bind(this),this.setOnChangeCallback=this.setOnChangeCallback.bind(this),this.updateDocumentBody=this.updateDocumentBody.bind(this),this.resolveIncomingMessage=this.resolveIncomingMessage.bind(this),this.createCslpTooltip=this.createCslpTooltip.bind(this),this.requestDataSync=this.requestDataSync.bind(this),this.updateTooltipPosition=this.updateTooltipPosition.bind(this),this.removeDataCslp=this.removeDataCslp.bind(this),e.debug&&a.PublicLogger.debug("Contentstack Live Preview Debugging mode: config --",this.config),this.config.enable?(void 0!==typeof document&&"complete"===document.readyState?this.requestDataSync():window.addEventListener("load",this.requestDataSync),window.addEventListener("message",this.resolveIncomingMessage),window.addEventListener("scroll",this.updateTooltipPosition),window.addEventListener("mouseover",this.addEditStyleOnHover)):this.config.cleanCslpOnProduction&&this.removeDataCslp()}return e.prototype.addEditStyleOnHover=function(e){for(var t,n,i,r=!0,o=0,a=e.composedPath();o<a.length;o++){var l=a[o];if("BODY"===l.nodeName)break;if("function"==typeof(null==l?void 0:l.getAttribute)){var s=l.getAttribute("data-cslp");r&&s?(this.currentElementBesideTooltip&&this.currentElementBesideTooltip.classList.remove("cslp-edit-mode"),l.classList.add("cslp-edit-mode"),this.currentElementBesideTooltip=l,this.updateTooltipPosition()&&(null===(t=this.tooltip)||void 0===t||t.setAttribute("current-data-cslp",s),null===(n=this.tooltip)||void 0===n||n.setAttribute("current-href",null!==(i=l.getAttribute("href"))&&void 0!==i?i:"")),r=!1):r||l.classList.remove("cslp-edit-mode")}}},e.prototype.generateRedirectUrl=function(e,t,n,i){if(void 0===t&&(t="en-us"),!this.config.stackDetails.apiKey)throw"To use edit tags, you must provide the stack API key. Specify the API key while initializing the Live Preview SDK.\n\n ContentstackLivePreview.init({\n ...,\n stackDetails: {\n apiKey: 'your-api-key'\n },\n ...\n })";var r=String(this.config.clientUrlParams.protocol),o=String(this.config.clientUrlParams.host),a=String(this.config.clientUrlParams.port),l="!/stack/"+this.config.stackDetails.apiKey+"/content-type/"+e+"/"+(null!=t?t:"en-us")+"/entry/"+n+"/edit",s=new URL(r+"://"+o);return s.port=a,s.hash=l,s.searchParams.append("preview-field",i),s.searchParams.append("preview-url",window.location.origin),s.origin+"/"+s.hash+s.search},e.prototype.scrollHandler=function(){if(this.tooltip){var e=this.tooltip.getAttribute("current-data-cslp");if(e){var t=e.split("."),n=t[0],i=t[1],r=t[2],o=t.slice(3);if(window.location!==window.parent.location)window.parent.postMessage({from:"live-preview",type:"scroll",data:{field:o.join("."),content_type_uid:n,entry_uid:i,locale:r}},"*");else try{var l=this.generateRedirectUrl(n,r,i,o.join("."));window.open(l,"_blank")}catch(e){a.PublicLogger.error(e)}}}},e.prototype.linkClickHandler=function(){if(this.tooltip){var e=this.tooltip.getAttribute("current-href");e&&window.location.assign(e)}},e.prototype.handleUserChange=function(e){this.config.stackSdk.live_preview=i(i(i({},this.config.stackSdk.live_preview),e),{live_preview:e.hash}),this.config.onChange()},e.prototype.setOnChangeCallback=function(e){this.config.onChange=e},e.prototype.updateDocumentBody=function(e){var t=(new DOMParser).parseFromString(e,"text/html");(0,l.default)(document.body,t.body),this.createCslpTooltip()},e.prototype.resolveIncomingMessage=function(e){if("object"==typeof e.data){var t=e.data,n=t.type,i=t.from,r=t.data;if("live-preview"===i)switch(n){case"client-data-send":if(this.config.ssr){var o=r.body;o&&this.updateDocumentBody(o)}else this.handleUserChange(r);break;case"init-ack":var a=r.contentTypeUid,l=r.entryUid;this.config.stackDetails.contentTypeUid=a,this.config.stackDetails.entryUid=l;break;case"history":switch(r.type){case"forward":window.history.forward();break;case"backward":window.history.back();break;case"reload":window.history.go()}}}},e.prototype.requestDataSync=function(){this.handleUserChange({live_preview:"init"}),this.createCslpTooltip(),window.parent.postMessage({from:"live-preview",type:"init",data:{config:{shouldReload:this.config.ssr,href:window.location.href}}},"*"),this.config.ssr||setInterval((function(){window.parent.postMessage({from:"live-preview",type:"check-entry-page",data:{href:window.location.href}},"*")}),1500)},e.prototype.updateTooltipPosition=function(){var e;if(!this.currentElementBesideTooltip||!this.tooltip)return!1;var t=this.currentElementBesideTooltip.getBoundingClientRect(),n=null===(e=this.tooltip.parentElement)||void 0===e?void 0:e.getBoundingClientRect();if(t&&n){var i=t.top-40,r=t.left-5;return i<0&&(i=t.top<0?t.top:0),this.tooltip.style.top=i+"px",this.tooltip.style.zIndex=this.currentElementBesideTooltip.style.zIndex||"200",this.tooltip.style.left=r+"px",this.tooltipChild.singular&&this.tooltipChild.multiple&&(this.currentElementBesideTooltip.hasAttribute("href")?"multiple"!==this.tooltipCurrentChild&&(this.tooltip.innerHTML="",this.tooltip.appendChild(this.tooltipChild.multiple),this.tooltipCurrentChild="multiple"):"singular"!==this.tooltipCurrentChild&&(this.tooltip.innerHTML="",this.tooltip.appendChild(this.tooltipChild.singular),this.tooltipCurrentChild="singular")),!0}return!1},e.prototype.removeDataCslp=function(){document.querySelectorAll("[data-cslp]").forEach((function(e){e.removeAttribute("data-cslp")}))},e}();t.default=u},334:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.userInitData=void 0,t.userInitData={ssr:!0,enable:!1,cleanCslpOnProduction:!0,stackDetails:{apiKey:"",environment:""},clientUrlParams:{protocol:"https",host:"app.contentstack.com",port:443},stackSdk:{live_preview:{},headers:{api_key:""},environment:""}}},383:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleUserConfig=t.handleInitData=void 0;var i=n(895),r=function(e,t){var n,i,r;if(e.clientUrlParams.host=null!==(n=t.host)&&void 0!==n?n:e.clientUrlParams.host,e.clientUrlParams.protocol=null!==(i=t.protocol)&&void 0!==i?i:e.clientUrlParams.protocol,e.clientUrlParams.port=null!==(r=t.port)&&void 0!==r?r:e.clientUrlParams.port,void 0!==t.protocol&&void 0===t.port)switch(t.protocol){case"http":e.clientUrlParams.port=80;break;case"https":e.clientUrlParams.port=443}var o=e.clientUrlParams.host;o.endsWith("/")&&(o=o.slice(0,-1),e.clientUrlParams.host=o),e.clientUrlParams.url=e.clientUrlParams.protocol+"://"+e.clientUrlParams.host+":"+e.clientUrlParams.port};function o(e){return Object.prototype.hasOwnProperty.call(e,"cachePolicy")}t.handleInitData=function(e,t){var n,a,l,s,c,u,d,p,h,f,v,g,m,b,y,w,C,P,k,L,U,A,E;if(o(e)){i.PublicLogger.warn("Deprecated: Do not pass the Stack object directly to the Live Preview SDK. Pass it using the config.stackSDK config object.");var S=(null==e?void 0:e.live_preview)||{};t.ssr=!1,t.enable=null!==(n=S.enable)&&void 0!==n?n:t.enable,t.cleanCslpOnProduction=null!==(a=S.cleanCslpOnProduction)&&void 0!==a?a:t.cleanCslpOnProduction,t.stackSdk=e,Object.prototype.hasOwnProperty.call(e.headers,"api_key")&&e.headers.api_key&&(t.stackDetails.apiKey=e.headers.api_key),Object.prototype.hasOwnProperty.call(e,"environment")&&(t.stackDetails.environment=e.environment),r(t,null!==(l=S.clientUrlParams)&&void 0!==l?l:t.clientUrlParams)}else if(!o(e)){var _=e.stackSdk||t.stackSdk;t.enable=null!==(u=null!==(s=e.enable)&&void 0!==s?s:null===(c=_.live_preview)||void 0===c?void 0:c.enable)&&void 0!==u?u:t.enable,t.ssr=null===(f=null!==(h=null!==(d=e.ssr)&&void 0!==d?d:null===(p=_.live_preview)||void 0===p?void 0:p.ssr)&&void 0!==h?h:"object"!=typeof e.stackSdk)||void 0===f||f,t.stackSdk=_,t.cleanCslpOnProduction=null!==(m=null!==(v=e.cleanCslpOnProduction)&&void 0!==v?v:null===(g=_.live_preview)||void 0===g?void 0:g.cleanCslpOnProduction)&&void 0!==m?m:t.cleanCslpOnProduction,t.stackDetails.apiKey=null!==(C=null!==(y=null===(b=e.stackDetails)||void 0===b?void 0:b.apiKey)&&void 0!==y?y:null===(w=_.headers)||void 0===w?void 0:w.api_key)&&void 0!==C?C:t.stackDetails.apiKey,t.stackDetails.environment=null!==(L=null!==(k=null===(P=e.stackDetails)||void 0===P?void 0:P.environment)&&void 0!==k?k:_.environment)&&void 0!==L?L:t.stackDetails.environment,r(t,null!==(E=null!==(U=e.clientUrlParams)&&void 0!==U?U:null===(A=_.live_preview)||void 0===A?void 0:A.clientUrlParams)&&void 0!==E?E:t.clientUrlParams)}},t.handleUserConfig={clientUrlParams:r}},928:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMultipleEditButton=t.createSingularEditButton=t.tooltipMultipleInnerHtml=t.tooltipSingularInnerHtml=t.hasWindow=void 0,t.hasWindow=function(){return"undefined"!=typeof window},t.tooltipSingularInnerHtml='<div class="singular edit-button">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.1 3.5L0.3 11.3C0.1 11.5 0 11.7 0 12V15C0 15.6 0.4 16 1 16H4C4.3 16 4.5 15.9 4.7 15.7L12.5 7.9L8.1 3.5Z" fill="#718096"></path>\n <path d="M15.7 3.3L12.7 0.3C12.3 -0.1 11.7 -0.1 11.3 0.3L9.5 2.1L13.9 6.5L15.7 4.7C16.1 4.3 16.1 3.7 15.7 3.3Z" fill="#718096"></path>\n </svg>Edit\n </div>',t.tooltipMultipleInnerHtml='<div class="edit-button" title="edit">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.1 3.5L0.3 11.3C0.1 11.5 0 11.7 0 12V15C0 15.6 0.4 16 1 16H4C4.3 16 4.5 15.9 4.7 15.7L12.5 7.9L8.1 3.5Z" fill="#718096"></path>\n <path d="M15.7 3.3L12.7 0.3C12.3 -0.1 11.7 -0.1 11.3 0.3L9.5 2.1L13.9 6.5L15.7 4.7C16.1 4.3 16.1 3.7 15.7 3.3Z" fill="#718096"></path>\n </svg>\n </div>\n <div title="click element" class="external-link-button">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M2.66654 2.66758H13.3332V13.3342H6.66654V16.0009H13.3332C14.0405 16.0009 14.7187 15.72 15.2188 15.2199C15.7189 14.7198 15.9999 14.0415 15.9999 13.3342V2.66758C15.9999 1.96034 15.7189 1.28206 15.2188 0.781964C14.7187 0.281867 14.0405 0.000915527 13.3332 0.000915527H2.66654C1.9593 0.000915527 1.28102 0.281867 0.780927 0.781964C0.280829 1.28206 -0.00012207 1.96034 -0.00012207 2.66758V9.33425H2.66654V2.66758Z" fill="#718096" />\n <path d="M6.94263 7.05734L0.999958 13L2.88529 14.8853L8.82796 8.94267L10.8853 11V5.00001H4.88529L6.94263 7.05734Z" fill="#718096" />\n </svg>\n </div>',t.createSingularEditButton=function(e){var t=document.createElement("div");return t.classList.add("cslp-tooltip-child","singular"),t.setAttribute("data-test-id","cslp-singular-edit-button"),t.innerHTML='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.1 3.5L0.3 11.3C0.1 11.5 0 11.7 0 12V15C0 15.6 0.4 16 1 16H4C4.3 16 4.5 15.9 4.7 15.7L12.5 7.9L8.1 3.5Z" fill="#718096"></path>\n <path d="M15.7 3.3L12.7 0.3C12.3 -0.1 11.7 -0.1 11.3 0.3L9.5 2.1L13.9 6.5L15.7 4.7C16.1 4.3 16.1 3.7 15.7 3.3Z" fill="#718096"></path>\n </svg>Edit',t.addEventListener("click",e),t},t.createMultipleEditButton=function(e,t){var n=document.createElement("div");n.classList.add("cslp-tooltip-child"),n.setAttribute("data-title","Edit"),n.setAttribute("data-test-id","cslp-multiple-edit-button"),n.innerHTML=' <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.1 3.5L0.3 11.3C0.1 11.5 0 11.7 0 12V15C0 15.6 0.4 16 1 16H4C4.3 16 4.5 15.9 4.7 15.7L12.5 7.9L8.1 3.5Z" fill="#718096"></path>\n <path d="M15.7 3.3L12.7 0.3C12.3 -0.1 11.7 -0.1 11.3 0.3L9.5 2.1L13.9 6.5L15.7 4.7C16.1 4.3 16.1 3.7 15.7 3.3Z" fill="#718096"></path>\n </svg>',n.addEventListener("click",e);var i=document.createElement("div");i.classList.add("cslp-tooltip-child"),i.setAttribute("data-title","Go to link"),i.setAttribute("data-test-id","cslp-multiple-external-link-button"),i.innerHTML=' <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M2.66654 2.66758H13.3332V13.3342H6.66654V16.0009H13.3332C14.0405 16.0009 14.7187 15.72 15.2188 15.2199C15.7189 14.7198 15.9999 14.0415 15.9999 13.3342V2.66758C15.9999 1.96034 15.7189 1.28206 15.2188 0.781964C14.7187 0.281867 14.0405 0.000915527 13.3332 0.000915527H2.66654C1.9593 0.000915527 1.28102 0.281867 0.780927 0.781964C0.280829 1.28206 -0.00012207 1.96034 -0.00012207 2.66758V9.33425H2.66654V2.66758Z" fill="#718096" />\n <path d="M6.94263 7.05734L0.999958 13L2.88529 14.8853L8.82796 8.94267L10.8853 11V5.00001H4.88529L6.94263 7.05734Z" fill="#718096" />\n </svg>',i.addEventListener("click",t);var r=document.createDocumentFragment();r.appendChild(n),r.appendChild(i);var o=document.createElement("div");return o.appendChild(r),o.classList.add("multiple"),o}},895:function(e,t){"use strict";var n=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicLogger=void 0;var i=function(){function e(){}return e.logEvent=function(e,t){e.apply(void 0,n(["Live_Preview_SDK:"],t,!1))},e.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logEvent(console.error,e)},e.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logEvent(console.warn,e)},e.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logEvent(console.debug,e)},e}();t.PublicLogger=i},614:(e,t,n)=>{"use strict";var i;n.r(t),n.d(t,{NIL:()=>D,parse:()=>g,stringify:()=>u,v1:()=>v,v3:()=>U,v4:()=>A,v5:()=>_,validate:()=>l,version:()=>T});var r=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(r)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,l=function(e){return"string"==typeof e&&a.test(e)};for(var s=[],c=0;c<256;++c)s.push((c+256).toString(16).substr(1));const u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};var d,p,h=0,f=0;const v=function(e,t,n){var i=t&&n||0,r=t||new Array(16),a=(e=e||{}).node||d,l=void 0!==e.clockseq?e.clockseq:p;if(null==a||null==l){var s=e.random||(e.rng||o)();null==a&&(a=d=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==l&&(l=p=16383&(s[6]<<8|s[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:f+1,g=c-h+(v-f)/1e4;if(g<0&&void 0===e.clockseq&&(l=l+1&16383),(g<0||c>h)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=c,f=v,p=l;var m=(1e4*(268435455&(c+=122192928e5))+v)%4294967296;r[i++]=m>>>24&255,r[i++]=m>>>16&255,r[i++]=m>>>8&255,r[i++]=255&m;var b=c/4294967296*1e4&268435455;r[i++]=b>>>8&255,r[i++]=255&b,r[i++]=b>>>24&15|16,r[i++]=b>>>16&255,r[i++]=l>>>8|128,r[i++]=255&l;for(var y=0;y<6;++y)r[i+y]=a[y];return t||u(r)},g=function(e){if(!l(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function m(e,t,n){function i(e,i,r,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof i&&(i=g(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(i),a.set(e,i.length),(a=n(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,r){o=o||0;for(var l=0;l<16;++l)r[o+l]=a[l];return r}return u(a)}try{i.name=e}catch(e){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function b(e){return 14+(e+64>>>9<<4)+1}function y(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function w(e,t,n,i,r,o){return y((a=y(y(t,e),y(i,o)))<<(l=r)|a>>>32-l,n);var a,l}function C(e,t,n,i,r,o,a){return w(t&n|~t&i,e,t,r,o,a)}function P(e,t,n,i,r,o,a){return w(t&i|n&~i,e,t,r,o,a)}function k(e,t,n,i,r,o,a){return w(t^n^i,e,t,r,o,a)}function L(e,t,n,i,r,o,a){return w(n^(t|~i),e,t,r,o,a)}const U=m("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,i="0123456789abcdef",r=0;r<n;r+=8){var o=e[r>>5]>>>r%32&255,a=parseInt(i.charAt(o>>>4&15)+i.charAt(15&o),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[b(t)-1]=t;for(var n=1732584193,i=-271733879,r=-1732584194,o=271733878,a=0;a<e.length;a+=16){var l=n,s=i,c=r,u=o;n=C(n,i,r,o,e[a],7,-680876936),o=C(o,n,i,r,e[a+1],12,-389564586),r=C(r,o,n,i,e[a+2],17,606105819),i=C(i,r,o,n,e[a+3],22,-1044525330),n=C(n,i,r,o,e[a+4],7,-176418897),o=C(o,n,i,r,e[a+5],12,1200080426),r=C(r,o,n,i,e[a+6],17,-1473231341),i=C(i,r,o,n,e[a+7],22,-45705983),n=C(n,i,r,o,e[a+8],7,1770035416),o=C(o,n,i,r,e[a+9],12,-1958414417),r=C(r,o,n,i,e[a+10],17,-42063),i=C(i,r,o,n,e[a+11],22,-1990404162),n=C(n,i,r,o,e[a+12],7,1804603682),o=C(o,n,i,r,e[a+13],12,-40341101),r=C(r,o,n,i,e[a+14],17,-1502002290),n=P(n,i=C(i,r,o,n,e[a+15],22,1236535329),r,o,e[a+1],5,-165796510),o=P(o,n,i,r,e[a+6],9,-1069501632),r=P(r,o,n,i,e[a+11],14,643717713),i=P(i,r,o,n,e[a],20,-373897302),n=P(n,i,r,o,e[a+5],5,-701558691),o=P(o,n,i,r,e[a+10],9,38016083),r=P(r,o,n,i,e[a+15],14,-660478335),i=P(i,r,o,n,e[a+4],20,-405537848),n=P(n,i,r,o,e[a+9],5,568446438),o=P(o,n,i,r,e[a+14],9,-1019803690),r=P(r,o,n,i,e[a+3],14,-187363961),i=P(i,r,o,n,e[a+8],20,1163531501),n=P(n,i,r,o,e[a+13],5,-1444681467),o=P(o,n,i,r,e[a+2],9,-51403784),r=P(r,o,n,i,e[a+7],14,1735328473),n=k(n,i=P(i,r,o,n,e[a+12],20,-1926607734),r,o,e[a+5],4,-378558),o=k(o,n,i,r,e[a+8],11,-2022574463),r=k(r,o,n,i,e[a+11],16,1839030562),i=k(i,r,o,n,e[a+14],23,-35309556),n=k(n,i,r,o,e[a+1],4,-1530992060),o=k(o,n,i,r,e[a+4],11,1272893353),r=k(r,o,n,i,e[a+7],16,-155497632),i=k(i,r,o,n,e[a+10],23,-1094730640),n=k(n,i,r,o,e[a+13],4,681279174),o=k(o,n,i,r,e[a],11,-358537222),r=k(r,o,n,i,e[a+3],16,-722521979),i=k(i,r,o,n,e[a+6],23,76029189),n=k(n,i,r,o,e[a+9],4,-640364487),o=k(o,n,i,r,e[a+12],11,-421815835),r=k(r,o,n,i,e[a+15],16,530742520),n=L(n,i=k(i,r,o,n,e[a+2],23,-995338651),r,o,e[a],6,-198630844),o=L(o,n,i,r,e[a+7],10,1126891415),r=L(r,o,n,i,e[a+14],15,-1416354905),i=L(i,r,o,n,e[a+5],21,-57434055),n=L(n,i,r,o,e[a+12],6,1700485571),o=L(o,n,i,r,e[a+3],10,-1894986606),r=L(r,o,n,i,e[a+10],15,-1051523),i=L(i,r,o,n,e[a+1],21,-2054922799),n=L(n,i,r,o,e[a+8],6,1873313359),o=L(o,n,i,r,e[a+15],10,-30611744),r=L(r,o,n,i,e[a+6],15,-1560198380),i=L(i,r,o,n,e[a+13],21,1309151649),n=L(n,i,r,o,e[a+4],6,-145523070),o=L(o,n,i,r,e[a+11],10,-1120210379),r=L(r,o,n,i,e[a+2],15,718787259),i=L(i,r,o,n,e[a+9],21,-343485551),n=y(n,l),i=y(i,s),r=y(r,c),o=y(o,u)}return[n,i,r,o]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(b(t)),i=0;i<t;i+=8)n[i>>5]|=(255&e[i/8])<<i%32;return n}(e),8*e.length))})),A=function(e,t,n){var i=(e=e||{}).random||(e.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return u(i)};function E(e,t,n,i){switch(e){case 0:return t&n^~t&i;case 1:return t^n^i;case 2:return t&n^t&i^n&i;case 3:return t^n^i}}function S(e,t){return e<<t|e>>>32-t}const _=m("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var i=unescape(encodeURIComponent(e));e=[];for(var r=0;r<i.length;++r)e.push(i.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var o=e.length/4+2,a=Math.ceil(o/16),l=new Array(a),s=0;s<a;++s){for(var c=new Uint32Array(16),u=0;u<16;++u)c[u]=e[64*s+4*u]<<24|e[64*s+4*u+1]<<16|e[64*s+4*u+2]<<8|e[64*s+4*u+3];l[s]=c}l[a-1][14]=8*(e.length-1)/Math.pow(2,32),l[a-1][14]=Math.floor(l[a-1][14]),l[a-1][15]=8*(e.length-1)&4294967295;for(var d=0;d<a;++d){for(var p=new Uint32Array(80),h=0;h<16;++h)p[h]=l[d][h];for(var f=16;f<80;++f)p[f]=S(p[f-3]^p[f-8]^p[f-14]^p[f-16],1);for(var v=n[0],g=n[1],m=n[2],b=n[3],y=n[4],w=0;w<80;++w){var C=Math.floor(w/20),P=S(v,5)+E(C,g,m,b)+y+t[C]+p[w]>>>0;y=b,b=m,m=S(g,30)>>>0,g=v,v=P}n[0]=n[0]+v>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+y>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),D="00000000-0000-0000-0000-000000000000",T=function(e){if(!l(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}return n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(607)})()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ContentstackLivePreview=t():e.ContentstackLivePreview=t()}(this,(function(){return(()=>{var e={704:e=>{e.exports=function(e,a){for(var l=e.split(t),s=l.length,c=new Array(s),u=0;u<s;u++){var d=l[u];if(""!==d){var p=n.test(d)&&!r.test(d);p&&(d=d.replace(i,(function(e,t,n){return o(e,d.length-n-e.length==0)})));var h=d[0];h=u>0?h.toUpperCase():h.toLowerCase(),c[u]=h+(p?d.slice(1):d.slice(1).toLowerCase())}}return c.join("")};var t=/[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/,n=/^[a-z\u00E0-\u00FCA-Z\u00C0-\u00DC][\d|a-z\u00E0-\u00FCA-Z\u00C0-\u00DC]*$/,i=/([A-Z\u00C0-\u00DC]{4,})/g,r=/^[A-Z\u00C0-\u00DC]+$/;function o(e,t){var n=e.split(""),i=n.shift().toUpperCase(),r=t?n.pop().toLowerCase():n.pop();return i+n.join("").toLowerCase()+r}},279:(e,t,n)=>{"use strict";n.r(t)},492:(e,t,n)=>{"use strict";var i;n.r(t),n.d(t,{default:()=>p});var r="undefined"==typeof document?void 0:document,o=!!r&&"content"in r.createElement("template"),a=!!r&&r.createRange&&"createContextualFragment"in r.createRange();function l(e,t){var n,i,r=e.nodeName,o=t.nodeName;return r===o||(n=r.charCodeAt(0),i=o.charCodeAt(0),n<=90&&i>=97?r===o.toUpperCase():i<=90&&n>=97&&o===r.toUpperCase())}function s(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var c={OPTION:function(e,t){var n=e.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}s(e,t,"selected")},INPUT:function(e,t){s(e,t,"checked"),s(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var i=e.firstChild;if(i){var r=i.nodeValue;if(r==n||!n&&r==e.placeholder)return;i.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,i,r=-1,o=0,a=e.firstChild;a;)if("OPTGROUP"===(i=a.nodeName&&a.nodeName.toUpperCase()))a=(n=a).firstChild;else{if("OPTION"===i){if(a.hasAttribute("selected")){r=o;break}o++}!(a=a.nextSibling)&&n&&(a=n.nextSibling,n=null)}e.selectedIndex=r}}};function u(){}function d(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}const p=function(e,t,n){if(n||(n={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName||"BODY"===e.nodeName){var s=t;(t=r.createElement("html")).innerHTML=s}else p=(p=t).trim(),t=o?function(e){var t=r.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(p):a?function(e){return i||(i=r.createRange()).selectNode(r.body),i.createContextualFragment(e).childNodes[0]}(p):function(e){var t=r.createElement("body");return t.innerHTML=e,t.childNodes[0]}(p);var p,h=n.getNodeKey||d,f=n.onBeforeNodeAdded||u,v=n.onNodeAdded||u,g=n.onBeforeElUpdated||u,m=n.onElUpdated||u,y=n.onBeforeNodeDiscarded||u,b=n.onNodeDiscarded||u,w=n.onBeforeElChildrenUpdated||u,C=!0===n.childrenOnly,k=Object.create(null),P=[];function L(e){P.push(e)}function S(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var i=void 0;t&&(i=h(n))?L(i):(b(n),n.firstChild&&S(n,t)),n=n.nextSibling}}function U(e,t,n){!1!==y(e)&&(t&&t.removeChild(e),b(e),S(e,n))}function _(e){v(e);for(var t=e.firstChild;t;){var n=t.nextSibling,i=h(t);if(i){var r=k[i];r&&l(t,r)?(t.parentNode.replaceChild(r,t),E(r,t)):_(t)}else _(t);t=n}}function E(e,t,n){var i=h(t);if(i&&delete k[i],!n){if(!1===g(e,t))return;if(function(e,t){var n,i,r,o,a=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var l=a.length-1;l>=0;l--)i=(n=a[l]).name,r=n.namespaceURI,o=n.value,r?(i=n.localName||i,e.getAttributeNS(r,i)!==o&&("xmlns"===n.prefix&&(i=n.name),e.setAttributeNS(r,i,o))):e.getAttribute(i)!==o&&e.setAttribute(i,o);for(var s=e.attributes,c=s.length-1;c>=0;c--)i=(n=s[c]).name,(r=n.namespaceURI)?(i=n.localName||i,t.hasAttributeNS(r,i)||e.removeAttributeNS(r,i)):t.hasAttribute(i)||e.removeAttribute(i)}}(e,t),m(e),!1===w(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var n,i,o,a,s,u=t.firstChild,d=e.firstChild;e:for(;u;){for(a=u.nextSibling,n=h(u);d;){if(o=d.nextSibling,u.isSameNode&&u.isSameNode(d)){u=a,d=o;continue e}i=h(d);var p=d.nodeType,v=void 0;if(p===u.nodeType&&(1===p?(n?n!==i&&((s=k[n])?o===s?v=!1:(e.insertBefore(s,d),i?L(i):U(d,e,!0),d=s):v=!1):i&&(v=!1),(v=!1!==v&&l(d,u))&&E(d,u)):3!==p&&8!=p||(v=!0,d.nodeValue!==u.nodeValue&&(d.nodeValue=u.nodeValue))),v){u=a,d=o;continue e}i?L(i):U(d,e,!0),d=o}if(n&&(s=k[n])&&l(s,u))e.appendChild(s),E(s,u);else{var g=f(u);!1!==g&&(g&&(u=g),u.actualize&&(u=u.actualize(e.ownerDocument||r)),e.appendChild(u),_(u))}u=a,d=o}!function(e,t,n){for(;t;){var i=t.nextSibling;(n=h(t))?L(n):U(t,e,!0),t=i}}(e,d,i);var m=c[e.nodeName];m&&m(e,t)}(e,t):c.TEXTAREA(e,t)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var i=h(n);i&&(k[i]=n),e(n),n=n.nextSibling}}(e);var A,D,O=e,T=O.nodeType,x=t.nodeType;if(!C)if(1===T)1===x?l(e,t)||(b(e),O=function(e,t){for(var n=e.firstChild;n;){var i=n.nextSibling;t.appendChild(n),n=i}return t}(e,(A=t.nodeName,(D=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==D?r.createElementNS(D,A):r.createElement(A)))):O=t;else if(3===T||8===T){if(x===T)return O.nodeValue!==t.nodeValue&&(O.nodeValue=t.nodeValue),O;O=t}if(O===t)b(e);else{if(t.isSameNode&&t.isSameNode(O))return;if(E(O,t,C),P)for(var M=0,I=P.length;M<I;M++){var N=k[P[M]];N&&U(N,N.parentNode,!1)}}return!C&&O!==e&&e.parentNode&&(O.actualize&&(O=O.actualize(e.ownerDocument||r)),e.parentNode.replaceChild(O,e)),O}},135:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((i=i.apply(e,t||[])).next())}))},r=this&&this.__generator||function(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: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(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentstackLivePreview=void 0;var a=n(614),l=o(n(704)),s=o(n(147)),c=o(n(922)),u=n(334),d=n(895),p=function(){function e(){}return e.init=function(t){if(void 0===t&&(t=u.userInitData),"undefined"!=typeof window)return e.livePreview?(d.PublicLogger.warn("You have already initialized the Live Preview SDK. So, any subsequent initialization returns the existing SDK instance."),Promise.resolve(e.livePreview)):(e.livePreview=new c.default(t),e.livePreview.setOnChangeCallback(e.publish),Promise.resolve(e.livePreview));e.userConfig=t},e.publish=function(){Object.values(e.subscribers).forEach((function(e){e()}))},e.subscribe=function(t){var n=(0,a.v4)();return e.subscribers[n]=t,n},e.onEntryChange=function(t){e.userConfig&&(e.livePreview=new c.default(e.userConfig),e.livePreview.setOnChangeCallback(e.publish),e.userConfig=null);var n=e.subscribe(t);return t(),n},e.unsubscribeOnEntryChange=function(t){"string"==typeof t?(e.subscribers[t]||d.PublicLogger.warn("No subscriber found with the given id."),delete e.subscribers[t]):"function"==typeof t&&(Object.entries(e.subscribers).some((function(n){var i=n[0];return n[1]===t&&(delete e.subscribers[i],!0)}))||d.PublicLogger.warn("No subscriber found with the given callback."))},e.getGatsbyDataFormat=function(e,t){return i(this,void 0,void 0,(function(){return r(this,(function(n){return"function"==typeof e.find?[2,e.toJSON().find().then((function(n){return n.map((function(n){return n.map((function(n){var i;return(i={})[(0,l.default)(t+"_"+e.content_type_uid)]=n,i}))}))})).catch((function(e){console.error(e)}))]:"function"==typeof e.fetch?[2,e.toJSON().fetch().then((function(n){var i;return(i={})[(0,l.default)(t+"_"+e.content_type_uid)]=n,i})).catch((function(e){console.error(e)}))]:[2]}))}))},e.getSdkVersion=function(){return s.default.version},e.livePreview=null,e.userConfig=null,e.subscribers={},e}();t.ContentstackLivePreview=p,t.default=p,e.exports=p},607:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentstackLivePreview=void 0;var r=i(n(135));n(279),t.ContentstackLivePreview=r.default,t.default=t.ContentstackLivePreview,e.exports=t.ContentstackLivePreview},922:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return i=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},i.apply(this,arguments)},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(928),a=n(895),l=n(383),s=n(334),c=r(n(147)),u=n(63),d=function(){function e(e){var t=this;void 0===e&&(e=s.userInitData),this.config={ssr:!0,enable:!0,runScriptsOnUpdate:!1,cleanCslpOnProduction:!0,stackDetails:{apiKey:"",environment:"",contentTypeUid:"",entryUid:""},clientUrlParams:{protocol:"https",host:"app.contentstack.com",port:443,url:"https://app.contentstack.com:443"},stackSdk:{live_preview:{},headers:{api_key:""},environment:""},onChange:function(){}},this.tooltip=null,this.currentElementBesideTooltip=null,this.tooltipChild={singular:null,multiple:null},this.tooltipCurrentChild="singular",this.createCslpTooltip=function(){if(!document.getElementById("cslp-tooltip")){var e=document.createElement("button");e.classList.add("cslp-tooltip"),e.setAttribute("data-test-id","cs-cslp-tooltip"),e.id="cslp-tooltip",window.document.body.insertAdjacentElement("beforeend",e),t.tooltipChild.singular=(0,o.createSingularEditButton)(t.scrollHandler),t.tooltipChild.multiple=(0,o.createMultipleEditButton)(t.scrollHandler,t.linkClickHandler),e.innerHTML="",e.appendChild(t.tooltipChild.singular),t.tooltip=e}t.updateTooltipPosition()},(0,l.handleInitData)(e,this.config),this.addEditStyleOnHover=this.addEditStyleOnHover.bind(this),this.generateRedirectUrl=this.generateRedirectUrl.bind(this),this.scrollHandler=this.scrollHandler.bind(this),this.linkClickHandler=this.linkClickHandler.bind(this),this.handleUserChange=this.handleUserChange.bind(this),this.setOnChangeCallback=this.setOnChangeCallback.bind(this),this.resolveIncomingMessage=this.resolveIncomingMessage.bind(this),this.createCslpTooltip=this.createCslpTooltip.bind(this),this.requestDataSync=this.requestDataSync.bind(this),this.updateTooltipPosition=this.updateTooltipPosition.bind(this),this.removeDataCslp=this.removeDataCslp.bind(this),e.debug&&a.PublicLogger.debug("Contentstack Live Preview Debugging mode: config --",this.config),this.config.enable?(void 0!==typeof document&&"complete"===document.readyState?this.requestDataSync():window.addEventListener("load",this.requestDataSync),window.addEventListener("message",this.resolveIncomingMessage),window.addEventListener("scroll",this.updateTooltipPosition),window.addEventListener("mouseover",this.addEditStyleOnHover)):this.config.cleanCslpOnProduction&&this.removeDataCslp()}return e.prototype.addEditStyleOnHover=function(e){for(var t,n,i,r=!0,o=0,a=e.composedPath();o<a.length;o++){var l=a[o];if("BODY"===l.nodeName)break;if("function"==typeof(null==l?void 0:l.getAttribute)){var s=l.getAttribute("data-cslp");r&&s?(this.currentElementBesideTooltip&&this.currentElementBesideTooltip.classList.remove("cslp-edit-mode"),l.classList.add("cslp-edit-mode"),this.currentElementBesideTooltip=l,this.updateTooltipPosition()&&(null===(t=this.tooltip)||void 0===t||t.setAttribute("current-data-cslp",s),null===(n=this.tooltip)||void 0===n||n.setAttribute("current-href",null!==(i=l.getAttribute("href"))&&void 0!==i?i:"")),r=!1):r||l.classList.remove("cslp-edit-mode")}}},e.prototype.generateRedirectUrl=function(e,t,n,i){if(void 0===t&&(t="en-us"),!this.config.stackDetails.apiKey)throw"To use edit tags, you must provide the stack API key. Specify the API key while initializing the Live Preview SDK.\n\n ContentstackLivePreview.init({\n ...,\n stackDetails: {\n apiKey: 'your-api-key'\n },\n ...\n })";var r=String(this.config.clientUrlParams.protocol),o=String(this.config.clientUrlParams.host),a=String(this.config.clientUrlParams.port),l="!/stack/"+this.config.stackDetails.apiKey+"/content-type/"+e+"/"+(null!=t?t:"en-us")+"/entry/"+n+"/edit",s=new URL(r+"://"+o);return s.port=a,s.hash=l,s.searchParams.append("preview-field",i),s.searchParams.append("preview-url",window.location.origin),s.origin+"/"+s.hash+s.search},e.prototype.scrollHandler=function(){if(this.tooltip){var e=this.tooltip.getAttribute("current-data-cslp");if(e){var t=e.split("."),n=t[0],i=t[1],r=t[2],o=t.slice(3);if(window.location!==window.parent.location)window.parent.postMessage({from:"live-preview",type:"scroll",data:{field:o.join("."),content_type_uid:n,entry_uid:i,locale:r}},"*");else try{var l=this.generateRedirectUrl(n,r,i,o.join("."));window.open(l,"_blank")}catch(e){a.PublicLogger.error(e)}}}},e.prototype.linkClickHandler=function(){if(this.tooltip){var e=this.tooltip.getAttribute("current-href");e&&window.location.assign(e)}},e.prototype.handleUserChange=function(e){this.config.stackSdk.live_preview=i(i(i({},this.config.stackSdk.live_preview),e),{live_preview:e.hash}),this.config.onChange()},e.prototype.setOnChangeCallback=function(e){this.config.onChange=e},e.prototype.resolveIncomingMessage=function(e){var t=this;if("object"==typeof e.data&&"live-preview"===e.data.from)switch(e.data.type){case"client-data-send":var n=this.config.stackDetails,i=n.contentTypeUid,r=n.entryUid,o=e.data.data.hash;if(this.config.ssr){var a=new URL(window.location.href);a.searchParams.append("live_preview",o),a.searchParams.append("content_type_uid",i),a.searchParams.append("entry_uid",r),fetch(a.toString(),{method:"GET"}).then((function(e){return e.text()})).then((function(e){(0,u.updateDocumentBody)(document,e,{onPostOperation:t.createCslpTooltip,shouldReRunScripts:t.config.runScriptsOnUpdate})}))}else this.handleUserChange({content_type_uid:i,entry_uid:r,hash:o});break;case"init-ack":var l=e.data.data;i=l.contentTypeUid,r=l.entryUid,this.config.stackDetails.contentTypeUid=i,this.config.stackDetails.entryUid=r;break;case"history":switch(e.data.data.type){case"forward":window.history.forward();break;case"backward":window.history.back();break;case"reload":window.history.go()}break;case"document-body-post-scripts-loaded":var s=e.data.data.body;(0,u.replaceDocumentBody)(s,this.createCslpTooltip)}},e.prototype.requestDataSync=function(){this.handleUserChange({live_preview:"init"}),this.createCslpTooltip(),window.parent.postMessage({from:"live-preview",type:"init",data:{config:{shouldReload:this.config.ssr,href:window.location.href,sdkVersion:c.default.version}}},"*"),this.config.ssr||setInterval((function(){window.parent.postMessage({from:"live-preview",type:"check-entry-page",data:{href:window.location.href}},"*")}),1500)},e.prototype.updateTooltipPosition=function(){var e;if(!this.currentElementBesideTooltip||!this.tooltip)return!1;var t=this.currentElementBesideTooltip.getBoundingClientRect(),n=null===(e=this.tooltip.parentElement)||void 0===e?void 0:e.getBoundingClientRect();if(t&&n){var i=t.top-40,r=t.left-5;return i<0&&(i=t.top<0?t.top:0),this.tooltip.style.top=i+"px",this.tooltip.style.zIndex=this.currentElementBesideTooltip.style.zIndex||"200",this.tooltip.style.left=r+"px",this.tooltipChild.singular&&this.tooltipChild.multiple&&(this.currentElementBesideTooltip.hasAttribute("href")?"multiple"!==this.tooltipCurrentChild&&(this.tooltip.innerHTML="",this.tooltip.appendChild(this.tooltipChild.multiple),this.tooltipCurrentChild="multiple"):"singular"!==this.tooltipCurrentChild&&(this.tooltip.innerHTML="",this.tooltip.appendChild(this.tooltipChild.singular),this.tooltipCurrentChild="singular")),!0}return!1},e.prototype.removeDataCslp=function(){document.querySelectorAll("[data-cslp]").forEach((function(e){e.removeAttribute("data-cslp")}))},e}();t.default=d},334:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.userInitData=void 0,t.userInitData={ssr:!0,enable:!0,cleanCslpOnProduction:!0,stackDetails:{apiKey:"",environment:""},clientUrlParams:{protocol:"https",host:"app.contentstack.com",port:443},stackSdk:{live_preview:{},headers:{api_key:""},environment:""},runScriptsOnUpdate:!1}},383:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleUserConfig=t.handleInitData=void 0;var i=n(895),r=function(e,t){var n,i,r;if(e.clientUrlParams.host=null!==(n=t.host)&&void 0!==n?n:e.clientUrlParams.host,e.clientUrlParams.protocol=null!==(i=t.protocol)&&void 0!==i?i:e.clientUrlParams.protocol,e.clientUrlParams.port=null!==(r=t.port)&&void 0!==r?r:e.clientUrlParams.port,void 0!==t.protocol&&void 0===t.port)switch(t.protocol){case"http":e.clientUrlParams.port=80;break;case"https":e.clientUrlParams.port=443}var o=e.clientUrlParams.host;o.endsWith("/")&&(o=o.slice(0,-1),e.clientUrlParams.host=o),e.clientUrlParams.url=e.clientUrlParams.protocol+"://"+e.clientUrlParams.host+":"+e.clientUrlParams.port};function o(e){return Object.prototype.hasOwnProperty.call(e,"cachePolicy")}t.handleInitData=function(e,t){var n,a,l,s,c,u,d,p,h,f,v,g,m,y,b,w,C,k,P,L,S,U,_,E,A,D,O;if(o(e)){i.PublicLogger.warn("Deprecated: Do not pass the Stack object directly to the Live Preview SDK. Pass it using the config.stackSDK config object.");var T=(null==e?void 0:e.live_preview)||{};t.ssr=!1,t.runScriptsOnUpdate=null!==(n=T.runScriptsOnUpdate)&&void 0!==n?n:t.runScriptsOnUpdate,t.enable=null!==(a=T.enable)&&void 0!==a?a:t.enable,t.cleanCslpOnProduction=null!==(l=T.cleanCslpOnProduction)&&void 0!==l?l:t.cleanCslpOnProduction,t.stackSdk=e,Object.prototype.hasOwnProperty.call(e.headers,"api_key")&&e.headers.api_key&&(t.stackDetails.apiKey=e.headers.api_key),Object.prototype.hasOwnProperty.call(e,"environment")&&(t.stackDetails.environment=e.environment),r(t,null!==(s=T.clientUrlParams)&&void 0!==s?s:t.clientUrlParams)}else if(!o(e)){var x=e.stackSdk||t.stackSdk;t.enable=null!==(d=null!==(c=e.enable)&&void 0!==c?c:null===(u=x.live_preview)||void 0===u?void 0:u.enable)&&void 0!==d?d:t.enable,t.ssr=null===(v=null!==(f=null!==(p=e.ssr)&&void 0!==p?p:null===(h=x.live_preview)||void 0===h?void 0:h.ssr)&&void 0!==f?f:"object"!=typeof e.stackSdk)||void 0===v||v,t.runScriptsOnUpdate=null!==(y=null!==(g=e.runScriptsOnUpdate)&&void 0!==g?g:null===(m=x.live_preview)||void 0===m?void 0:m.runScriptsOnUpdate)&&void 0!==y?y:t.runScriptsOnUpdate,t.stackSdk=x,t.cleanCslpOnProduction=null!==(C=null!==(b=e.cleanCslpOnProduction)&&void 0!==b?b:null===(w=x.live_preview)||void 0===w?void 0:w.cleanCslpOnProduction)&&void 0!==C?C:t.cleanCslpOnProduction,t.stackDetails.apiKey=null!==(S=null!==(P=null===(k=e.stackDetails)||void 0===k?void 0:k.apiKey)&&void 0!==P?P:null===(L=x.headers)||void 0===L?void 0:L.api_key)&&void 0!==S?S:t.stackDetails.apiKey,t.stackDetails.environment=null!==(E=null!==(_=null===(U=e.stackDetails)||void 0===U?void 0:U.environment)&&void 0!==_?_:x.environment)&&void 0!==E?E:t.stackDetails.environment,r(t,null!==(O=null!==(A=e.clientUrlParams)&&void 0!==A?A:null===(D=x.live_preview)||void 0===D?void 0:D.clientUrlParams)&&void 0!==O?O:t.clientUrlParams)}},t.handleUserConfig={clientUrlParams:r}},928:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMultipleEditButton=t.createSingularEditButton=t.tooltipMultipleInnerHtml=t.tooltipSingularInnerHtml=t.hasWindow=void 0,t.hasWindow=function(){return"undefined"!=typeof window},t.tooltipSingularInnerHtml='<div class="singular edit-button">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.1 3.5L0.3 11.3C0.1 11.5 0 11.7 0 12V15C0 15.6 0.4 16 1 16H4C4.3 16 4.5 15.9 4.7 15.7L12.5 7.9L8.1 3.5Z" fill="#718096"></path>\n <path d="M15.7 3.3L12.7 0.3C12.3 -0.1 11.7 -0.1 11.3 0.3L9.5 2.1L13.9 6.5L15.7 4.7C16.1 4.3 16.1 3.7 15.7 3.3Z" fill="#718096"></path>\n </svg>Edit\n </div>',t.tooltipMultipleInnerHtml='<div class="edit-button" title="edit">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.1 3.5L0.3 11.3C0.1 11.5 0 11.7 0 12V15C0 15.6 0.4 16 1 16H4C4.3 16 4.5 15.9 4.7 15.7L12.5 7.9L8.1 3.5Z" fill="#718096"></path>\n <path d="M15.7 3.3L12.7 0.3C12.3 -0.1 11.7 -0.1 11.3 0.3L9.5 2.1L13.9 6.5L15.7 4.7C16.1 4.3 16.1 3.7 15.7 3.3Z" fill="#718096"></path>\n </svg>\n </div>\n <div title="click element" class="external-link-button">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M2.66654 2.66758H13.3332V13.3342H6.66654V16.0009H13.3332C14.0405 16.0009 14.7187 15.72 15.2188 15.2199C15.7189 14.7198 15.9999 14.0415 15.9999 13.3342V2.66758C15.9999 1.96034 15.7189 1.28206 15.2188 0.781964C14.7187 0.281867 14.0405 0.000915527 13.3332 0.000915527H2.66654C1.9593 0.000915527 1.28102 0.281867 0.780927 0.781964C0.280829 1.28206 -0.00012207 1.96034 -0.00012207 2.66758V9.33425H2.66654V2.66758Z" fill="#718096" />\n <path d="M6.94263 7.05734L0.999958 13L2.88529 14.8853L8.82796 8.94267L10.8853 11V5.00001H4.88529L6.94263 7.05734Z" fill="#718096" />\n </svg>\n </div>',t.createSingularEditButton=function(e){var t=document.createElement("div");return t.classList.add("cslp-tooltip-child","singular"),t.setAttribute("data-test-id","cslp-singular-edit-button"),t.innerHTML='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.1 3.5L0.3 11.3C0.1 11.5 0 11.7 0 12V15C0 15.6 0.4 16 1 16H4C4.3 16 4.5 15.9 4.7 15.7L12.5 7.9L8.1 3.5Z" fill="#718096"></path>\n <path d="M15.7 3.3L12.7 0.3C12.3 -0.1 11.7 -0.1 11.3 0.3L9.5 2.1L13.9 6.5L15.7 4.7C16.1 4.3 16.1 3.7 15.7 3.3Z" fill="#718096"></path>\n </svg>Edit',t.addEventListener("click",e),t},t.createMultipleEditButton=function(e,t){var n=document.createElement("div");n.classList.add("cslp-tooltip-child"),n.setAttribute("data-title","Edit"),n.setAttribute("data-test-id","cslp-multiple-edit-button"),n.innerHTML=' <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.1 3.5L0.3 11.3C0.1 11.5 0 11.7 0 12V15C0 15.6 0.4 16 1 16H4C4.3 16 4.5 15.9 4.7 15.7L12.5 7.9L8.1 3.5Z" fill="#718096"></path>\n <path d="M15.7 3.3L12.7 0.3C12.3 -0.1 11.7 -0.1 11.3 0.3L9.5 2.1L13.9 6.5L15.7 4.7C16.1 4.3 16.1 3.7 15.7 3.3Z" fill="#718096"></path>\n </svg>',n.addEventListener("click",e);var i=document.createElement("div");i.classList.add("cslp-tooltip-child"),i.setAttribute("data-title","Go to link"),i.setAttribute("data-test-id","cslp-multiple-external-link-button"),i.innerHTML=' <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M2.66654 2.66758H13.3332V13.3342H6.66654V16.0009H13.3332C14.0405 16.0009 14.7187 15.72 15.2188 15.2199C15.7189 14.7198 15.9999 14.0415 15.9999 13.3342V2.66758C15.9999 1.96034 15.7189 1.28206 15.2188 0.781964C14.7187 0.281867 14.0405 0.000915527 13.3332 0.000915527H2.66654C1.9593 0.000915527 1.28102 0.281867 0.780927 0.781964C0.280829 1.28206 -0.00012207 1.96034 -0.00012207 2.66758V9.33425H2.66654V2.66758Z" fill="#718096" />\n <path d="M6.94263 7.05734L0.999958 13L2.88529 14.8853L8.82796 8.94267L10.8853 11V5.00001H4.88529L6.94263 7.05734Z" fill="#718096" />\n </svg>',i.addEventListener("click",t);var r=document.createDocumentFragment();r.appendChild(n),r.appendChild(i);var o=document.createElement("div");return o.appendChild(r),o.classList.add("multiple"),o}},895:function(e,t){"use strict";var n=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicLogger=void 0;var i=function(){function e(){}return e.logEvent=function(e,t){e.apply(void 0,n(["Live_Preview_SDK:"],t,!1))},e.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logEvent(console.error,e)},e.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logEvent(console.warn,e)},e.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logEvent(console.debug,e)},e}();t.PublicLogger=i},63:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((i=i.apply(e,t||[])).next())}))},r=this&&this.__generator||function(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: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(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.replaceDocumentBody=t.updateDocumentBody=t.rerunScriptsInDocument=void 0;var a=o(n(492));function l(){var e=document.querySelectorAll("script"),t=e.length,n=0;function i(){n++,0==--t&&window.parent.postMessage({from:"live-preview",type:"document-body-post-scripts-loaded",data:{body:document.body.outerHTML}},"*"),r()}function r(){if(n<e.length){var t=e[n],r=t.parentNode,o=document.createElement("script");t.src?(o.onerror=i,o.onload=i,o.src=t.src):(o.text=t.text,i()),null==r||r.replaceChild(o,t)}}e.length&&r()}function s(e,t){var n=(new DOMParser).parseFromString(e,"text/html");(0,a.default)(document.body,n.body),t&&t()}t.rerunScriptsInDocument=l,t.updateDocumentBody=function(e,t,n){return i(this,void 0,void 0,(function(){var i,o,a,c,u;return r(this,(function(r){return i=n.shouldReRunScripts,o=n.onPostOperation,i?(e.querySelectorAll("iframe#contentstack-live-preview-iframe").forEach((function(e){e.remove()})),(a=e.createElement("iframe")).style.display="none",a.id="contentstack-live-preview-iframe",c=/(<\s*\/\s*script\s*>)|(`)/gm,u=t.replace(c,(function(e,t,n){return n?"\\`":"<\\/script>"})),a.srcdoc="\n <head>\n <script>\n function prepareIframeForScriptRerun() {\n const responseHTML = `"+u+'`;\n\n const html = document.getElementsByTagName("html").item(0);\n\n const rerunScriptsInDocument = '+l+"\n\n if (html) {\n html.innerHTML = responseHTML;\n rerunScriptsInDocument();\n }\n }\n prepareIframeForScriptRerun()\n <\/script>\n </head>",e.body.appendChild(a)):s(t,o),[2]}))}))},t.replaceDocumentBody=s},614:(e,t,n)=>{"use strict";var i;n.r(t),n.d(t,{NIL:()=>D,parse:()=>g,stringify:()=>u,v1:()=>v,v3:()=>S,v4:()=>U,v5:()=>A,validate:()=>l,version:()=>O});var r=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(r)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,l=function(e){return"string"==typeof e&&a.test(e)};for(var s=[],c=0;c<256;++c)s.push((c+256).toString(16).substr(1));const u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};var d,p,h=0,f=0;const v=function(e,t,n){var i=t&&n||0,r=t||new Array(16),a=(e=e||{}).node||d,l=void 0!==e.clockseq?e.clockseq:p;if(null==a||null==l){var s=e.random||(e.rng||o)();null==a&&(a=d=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==l&&(l=p=16383&(s[6]<<8|s[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:f+1,g=c-h+(v-f)/1e4;if(g<0&&void 0===e.clockseq&&(l=l+1&16383),(g<0||c>h)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=c,f=v,p=l;var m=(1e4*(268435455&(c+=122192928e5))+v)%4294967296;r[i++]=m>>>24&255,r[i++]=m>>>16&255,r[i++]=m>>>8&255,r[i++]=255&m;var y=c/4294967296*1e4&268435455;r[i++]=y>>>8&255,r[i++]=255&y,r[i++]=y>>>24&15|16,r[i++]=y>>>16&255,r[i++]=l>>>8|128,r[i++]=255&l;for(var b=0;b<6;++b)r[i+b]=a[b];return t||u(r)},g=function(e){if(!l(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function m(e,t,n){function i(e,i,r,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof i&&(i=g(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(i),a.set(e,i.length),(a=n(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,r){o=o||0;for(var l=0;l<16;++l)r[o+l]=a[l];return r}return u(a)}try{i.name=e}catch(e){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function y(e){return 14+(e+64>>>9<<4)+1}function b(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function w(e,t,n,i,r,o){return b((a=b(b(t,e),b(i,o)))<<(l=r)|a>>>32-l,n);var a,l}function C(e,t,n,i,r,o,a){return w(t&n|~t&i,e,t,r,o,a)}function k(e,t,n,i,r,o,a){return w(t&i|n&~i,e,t,r,o,a)}function P(e,t,n,i,r,o,a){return w(t^n^i,e,t,r,o,a)}function L(e,t,n,i,r,o,a){return w(n^(t|~i),e,t,r,o,a)}const S=m("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,i="0123456789abcdef",r=0;r<n;r+=8){var o=e[r>>5]>>>r%32&255,a=parseInt(i.charAt(o>>>4&15)+i.charAt(15&o),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[y(t)-1]=t;for(var n=1732584193,i=-271733879,r=-1732584194,o=271733878,a=0;a<e.length;a+=16){var l=n,s=i,c=r,u=o;n=C(n,i,r,o,e[a],7,-680876936),o=C(o,n,i,r,e[a+1],12,-389564586),r=C(r,o,n,i,e[a+2],17,606105819),i=C(i,r,o,n,e[a+3],22,-1044525330),n=C(n,i,r,o,e[a+4],7,-176418897),o=C(o,n,i,r,e[a+5],12,1200080426),r=C(r,o,n,i,e[a+6],17,-1473231341),i=C(i,r,o,n,e[a+7],22,-45705983),n=C(n,i,r,o,e[a+8],7,1770035416),o=C(o,n,i,r,e[a+9],12,-1958414417),r=C(r,o,n,i,e[a+10],17,-42063),i=C(i,r,o,n,e[a+11],22,-1990404162),n=C(n,i,r,o,e[a+12],7,1804603682),o=C(o,n,i,r,e[a+13],12,-40341101),r=C(r,o,n,i,e[a+14],17,-1502002290),n=k(n,i=C(i,r,o,n,e[a+15],22,1236535329),r,o,e[a+1],5,-165796510),o=k(o,n,i,r,e[a+6],9,-1069501632),r=k(r,o,n,i,e[a+11],14,643717713),i=k(i,r,o,n,e[a],20,-373897302),n=k(n,i,r,o,e[a+5],5,-701558691),o=k(o,n,i,r,e[a+10],9,38016083),r=k(r,o,n,i,e[a+15],14,-660478335),i=k(i,r,o,n,e[a+4],20,-405537848),n=k(n,i,r,o,e[a+9],5,568446438),o=k(o,n,i,r,e[a+14],9,-1019803690),r=k(r,o,n,i,e[a+3],14,-187363961),i=k(i,r,o,n,e[a+8],20,1163531501),n=k(n,i,r,o,e[a+13],5,-1444681467),o=k(o,n,i,r,e[a+2],9,-51403784),r=k(r,o,n,i,e[a+7],14,1735328473),n=P(n,i=k(i,r,o,n,e[a+12],20,-1926607734),r,o,e[a+5],4,-378558),o=P(o,n,i,r,e[a+8],11,-2022574463),r=P(r,o,n,i,e[a+11],16,1839030562),i=P(i,r,o,n,e[a+14],23,-35309556),n=P(n,i,r,o,e[a+1],4,-1530992060),o=P(o,n,i,r,e[a+4],11,1272893353),r=P(r,o,n,i,e[a+7],16,-155497632),i=P(i,r,o,n,e[a+10],23,-1094730640),n=P(n,i,r,o,e[a+13],4,681279174),o=P(o,n,i,r,e[a],11,-358537222),r=P(r,o,n,i,e[a+3],16,-722521979),i=P(i,r,o,n,e[a+6],23,76029189),n=P(n,i,r,o,e[a+9],4,-640364487),o=P(o,n,i,r,e[a+12],11,-421815835),r=P(r,o,n,i,e[a+15],16,530742520),n=L(n,i=P(i,r,o,n,e[a+2],23,-995338651),r,o,e[a],6,-198630844),o=L(o,n,i,r,e[a+7],10,1126891415),r=L(r,o,n,i,e[a+14],15,-1416354905),i=L(i,r,o,n,e[a+5],21,-57434055),n=L(n,i,r,o,e[a+12],6,1700485571),o=L(o,n,i,r,e[a+3],10,-1894986606),r=L(r,o,n,i,e[a+10],15,-1051523),i=L(i,r,o,n,e[a+1],21,-2054922799),n=L(n,i,r,o,e[a+8],6,1873313359),o=L(o,n,i,r,e[a+15],10,-30611744),r=L(r,o,n,i,e[a+6],15,-1560198380),i=L(i,r,o,n,e[a+13],21,1309151649),n=L(n,i,r,o,e[a+4],6,-145523070),o=L(o,n,i,r,e[a+11],10,-1120210379),r=L(r,o,n,i,e[a+2],15,718787259),i=L(i,r,o,n,e[a+9],21,-343485551),n=b(n,l),i=b(i,s),r=b(r,c),o=b(o,u)}return[n,i,r,o]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(y(t)),i=0;i<t;i+=8)n[i>>5]|=(255&e[i/8])<<i%32;return n}(e),8*e.length))})),U=function(e,t,n){var i=(e=e||{}).random||(e.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return u(i)};function _(e,t,n,i){switch(e){case 0:return t&n^~t&i;case 1:return t^n^i;case 2:return t&n^t&i^n&i;case 3:return t^n^i}}function E(e,t){return e<<t|e>>>32-t}const A=m("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var i=unescape(encodeURIComponent(e));e=[];for(var r=0;r<i.length;++r)e.push(i.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var o=e.length/4+2,a=Math.ceil(o/16),l=new Array(a),s=0;s<a;++s){for(var c=new Uint32Array(16),u=0;u<16;++u)c[u]=e[64*s+4*u]<<24|e[64*s+4*u+1]<<16|e[64*s+4*u+2]<<8|e[64*s+4*u+3];l[s]=c}l[a-1][14]=8*(e.length-1)/Math.pow(2,32),l[a-1][14]=Math.floor(l[a-1][14]),l[a-1][15]=8*(e.length-1)&4294967295;for(var d=0;d<a;++d){for(var p=new Uint32Array(80),h=0;h<16;++h)p[h]=l[d][h];for(var f=16;f<80;++f)p[f]=E(p[f-3]^p[f-8]^p[f-14]^p[f-16],1);for(var v=n[0],g=n[1],m=n[2],y=n[3],b=n[4],w=0;w<80;++w){var C=Math.floor(w/20),k=E(v,5)+_(C,g,m,y)+b+t[C]+p[w]>>>0;b=y,y=m,m=E(g,30)>>>0,g=v,v=k}n[0]=n[0]+v>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),D="00000000-0000-0000-0000-000000000000",O=function(e){if(!l(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},147:e=>{"use strict";e.exports=JSON.parse('{"name":"@contentstack/live-preview-utils","version":"1.2.0","types":"dist/index.d.ts","description":"Contentstack provides the Live Preview SDK to establish a communication channel between the various Contentstack SDKs and your website, transmitting live changes to the preview pane.","main":"dist/index.js","files":["dist"],"scripts":{"build":"webpack --config webpack.prod.js","test":"jest","test:coverage":"jest src --coverage --watchAll --coverageDirectory=\\"coverage\\"","dev":"webpack --config webpack.dev.js","prepare":"npm run build"},"keywords":["live-preview"],"author":"Contentstack","license":"MIT","devDependencies":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.3.1","@testing-library/jest-dom":"^5.14.1","@types/jest":"^27.0.1","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.31.1","@typescript-eslint/parser":"^4.31.1","babel-loader":"^8.0.5","css-loader":"^5.2.2","eslint":"^7.32.0","jest":"^27.2.0","jest-fetch-mock":"^3.0.3","mini-css-extract-plugin":"^2.3.0","style-loader":"^2.0.0","ts-jest":"^27.0.5","ts-loader":"^8.1.0","typescript":"^4.4.3","webpack":"^5.53.0","webpack-cli":"^4.8.0","webpack-dev-server":"^4.7.4","webpack-merge":"^5.8.0"},"repository":{"type":"git","url":"https://github.com/contentstack/live-preview-sdk.git"},"dependencies":{"just-camel-case":"^4.0.2","morphdom":"^2.6.1","uuid":"^8.3.2"}}')}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}return n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(607)})()}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|