@next-bricks/visual-builder 1.33.8 → 1.35.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.
Files changed (91) hide show
  1. package/dist/bricks.json +8 -6
  2. package/dist/chunks/{114.fdfd0dd9.js → 114.c25646f6.js} +2 -2
  3. package/dist/chunks/{114.fdfd0dd9.js.map → 114.c25646f6.js.map} +1 -1
  4. package/dist/chunks/{2252.25422902.js → 2252.fdcd5468.js} +3 -3
  5. package/dist/chunks/{2252.25422902.js.map → 2252.fdcd5468.js.map} +1 -1
  6. package/dist/chunks/{2980.0e831600.js → 2980.86aa3c5b.js} +2 -2
  7. package/dist/chunks/{2980.0e831600.js.map → 2980.86aa3c5b.js.map} +1 -1
  8. package/dist/chunks/{4837.cd50030b.js → 4837.bc21d4bb.js} +2 -2
  9. package/dist/chunks/{7218.9e675e7d.js.map → 4837.bc21d4bb.js.map} +1 -1
  10. package/dist/chunks/5399.be09f124.js +2 -0
  11. package/dist/chunks/5399.be09f124.js.map +1 -0
  12. package/dist/chunks/{5814.8ed8f39d.js → 5814.7b571c77.js} +3 -3
  13. package/dist/chunks/{5814.8ed8f39d.js.map → 5814.7b571c77.js.map} +1 -1
  14. package/dist/chunks/6773.9ed5373b.js +2 -0
  15. package/dist/chunks/6773.9ed5373b.js.map +1 -0
  16. package/dist/chunks/718.4da7e7c3.js +3 -0
  17. package/dist/chunks/718.4da7e7c3.js.map +1 -0
  18. package/dist/chunks/{7218.9e675e7d.js → 7218.163468a5.js} +2 -2
  19. package/dist/chunks/{4837.cd50030b.js.map → 7218.163468a5.js.map} +1 -1
  20. package/dist/chunks/{7733.dfa9b454.js → 7733.4fc7b710.js} +2 -2
  21. package/dist/chunks/{7733.dfa9b454.js.map → 7733.4fc7b710.js.map} +1 -1
  22. package/dist/chunks/8144.c19b5f90.js +3 -0
  23. package/dist/chunks/{7150.0e64cf9e.js.LICENSE.txt → 8144.c19b5f90.js.LICENSE.txt} +2 -0
  24. package/dist/chunks/8144.c19b5f90.js.map +1 -0
  25. package/dist/chunks/8989.74e3337d.js +2 -0
  26. package/dist/chunks/{8989.0d8b22ea.js.map → 8989.74e3337d.js.map} +1 -1
  27. package/dist/chunks/{9027.58391f17.js → 9027.ae3dd6a1.js} +2 -2
  28. package/dist/chunks/{9027.58391f17.js.map → 9027.ae3dd6a1.js.map} +1 -1
  29. package/dist/chunks/{9080.b97eaf67.js → 9080.fe043f12.js} +2 -2
  30. package/dist/chunks/{9080.b97eaf67.js.map → 9080.fe043f12.js.map} +1 -1
  31. package/dist/chunks/batch-update-raw-data-generated-view.d729bc1b.js +3 -0
  32. package/dist/chunks/batch-update-raw-data-generated-view.d729bc1b.js.LICENSE.txt +1 -0
  33. package/dist/chunks/batch-update-raw-data-generated-view.d729bc1b.js.map +1 -0
  34. package/dist/chunks/{chat-preview.bb6cd3b4.js → chat-preview.0ee9b1ac.js} +3 -3
  35. package/dist/chunks/{chat-preview.bb6cd3b4.js.map → chat-preview.0ee9b1ac.js.map} +1 -1
  36. package/dist/chunks/{check-editor-by-name.2c85abd3.js → check-editor-by-name.66abd437.js} +2 -2
  37. package/dist/chunks/{check-editor-by-name.2c85abd3.js.map → check-editor-by-name.66abd437.js.map} +1 -1
  38. package/dist/chunks/{contract-select.5302ec7e.js → contract-select.39759636.js} +3 -3
  39. package/dist/chunks/{contract-select.5302ec7e.js.map → contract-select.39759636.js.map} +1 -1
  40. package/dist/chunks/inject-preview-agent.b12c08c4.js.map +1 -1
  41. package/dist/chunks/main.8bd04251.js +2 -0
  42. package/dist/chunks/main.8bd04251.js.map +1 -0
  43. package/dist/chunks/{pre-generated-container.182db37b.js → pre-generated-container.fd7db719.js} +2 -2
  44. package/dist/chunks/{pre-generated-container.182db37b.js.map → pre-generated-container.fd7db719.js.map} +1 -1
  45. package/dist/chunks/pre-generated-preview.f09452bf.js +3 -0
  46. package/dist/chunks/pre-generated-preview.f09452bf.js.map +1 -0
  47. package/dist/chunks/{property-editor.6f5b4896.js → property-editor.079839d6.js} +2 -2
  48. package/dist/chunks/{property-editor.6f5b4896.js.map → property-editor.079839d6.js.map} +1 -1
  49. package/dist/chunks/raw-data-preview.a9da1ecb.js +3 -0
  50. package/dist/chunks/raw-data-preview.a9da1ecb.js.LICENSE.txt +5 -0
  51. package/dist/chunks/raw-data-preview.a9da1ecb.js.map +1 -0
  52. package/dist/chunks/{workbench-action-list.a319ba8f.js → workbench-action-list.19d9ee9d.js} +2 -2
  53. package/dist/chunks/{workbench-action-list.a319ba8f.js.map → workbench-action-list.19d9ee9d.js.map} +1 -1
  54. package/dist/chunks/{workbench-history-action.e20b5e26.js → workbench-history-action.976d14c0.js} +3 -3
  55. package/dist/chunks/{workbench-history-action.e20b5e26.js.map → workbench-history-action.976d14c0.js.map} +1 -1
  56. package/dist/index.cabccf48.js +2 -0
  57. package/dist/index.cabccf48.js.map +1 -0
  58. package/dist/manifest.json +71 -20
  59. package/dist/types.json +418 -0
  60. package/dist-types/bootstrap.d.ts +2 -0
  61. package/dist-types/data-providers/batch-update-raw-data-generated-view.d.ts +9 -0
  62. package/dist-types/data-providers/batch-update-raw-data-generated-view.spec.d.ts +1 -0
  63. package/dist-types/raw-data-preview/convert.d.ts +3 -0
  64. package/dist-types/raw-data-preview/index.d.ts +53 -0
  65. package/dist-types/raw-data-preview/index.spec.d.ts +1 -0
  66. package/dist-types/raw-data-preview/raw-data-interfaces.d.ts +74 -0
  67. package/package.json +2 -2
  68. package/dist/chunks/1370.f1c0b4dc.js +0 -2
  69. package/dist/chunks/1370.f1c0b4dc.js.map +0 -1
  70. package/dist/chunks/5399.96998a74.js +0 -2
  71. package/dist/chunks/5399.96998a74.js.map +0 -1
  72. package/dist/chunks/6773.7837da8c.js +0 -2
  73. package/dist/chunks/6773.7837da8c.js.map +0 -1
  74. package/dist/chunks/7150.0e64cf9e.js +0 -3
  75. package/dist/chunks/7150.0e64cf9e.js.map +0 -1
  76. package/dist/chunks/7426.4f61da8a.js +0 -3
  77. package/dist/chunks/7426.4f61da8a.js.map +0 -1
  78. package/dist/chunks/8989.0d8b22ea.js +0 -2
  79. package/dist/chunks/main.07bd0560.js +0 -2
  80. package/dist/chunks/main.07bd0560.js.map +0 -1
  81. package/dist/chunks/pre-generated-preview.9fe5a3d8.js +0 -3
  82. package/dist/chunks/pre-generated-preview.9fe5a3d8.js.map +0 -1
  83. package/dist/index.b98e786d.js +0 -2
  84. package/dist/index.b98e786d.js.map +0 -1
  85. /package/dist/chunks/{2252.25422902.js.LICENSE.txt → 2252.fdcd5468.js.LICENSE.txt} +0 -0
  86. /package/dist/chunks/{5814.8ed8f39d.js.LICENSE.txt → 5814.7b571c77.js.LICENSE.txt} +0 -0
  87. /package/dist/chunks/{7426.4f61da8a.js.LICENSE.txt → 718.4da7e7c3.js.LICENSE.txt} +0 -0
  88. /package/dist/chunks/{chat-preview.bb6cd3b4.js.LICENSE.txt → chat-preview.0ee9b1ac.js.LICENSE.txt} +0 -0
  89. /package/dist/chunks/{contract-select.5302ec7e.js.LICENSE.txt → contract-select.39759636.js.LICENSE.txt} +0 -0
  90. /package/dist/chunks/{pre-generated-preview.9fe5a3d8.js.LICENSE.txt → pre-generated-preview.f09452bf.js.LICENSE.txt} +0 -0
  91. /package/dist/chunks/{workbench-history-action.e20b5e26.js.LICENSE.txt → workbench-history-action.976d14c0.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ "use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[8989,4586],{2559:(t,r,e)=>{function s(t,r,e){if("function"==typeof t?t===r:t.has(r))return arguments.length<3?r:e;throw new TypeError("Private element is not present on this object")}e.d(r,{A:()=>s})},2016:(t,r,e)=>{function s(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}e.d(r,{A:()=>s})},829:(t,r,e)=>{e.d(r,{A:()=>o});var s=e(2559);function o(t,r){return t.get((0,s.A)(t,r))}},918:(t,r,e)=>{e.d(r,{A:()=>o});var s=e(2016);function o(t,r,e){(0,s.A)(t,r),r.set(t,e)}},6121:(t,r,e)=>{e.d(r,{A:()=>o});var s=e(2559);function o(t,r,e){return t.set((0,s.A)(t,r),e),e}},4635:(t,r,e)=>{e.d(r,{A:()=>o});var s=e(2016);function o(t,r){(0,s.A)(t,r),r.add(t)}},4586:(t,r,e)=>{e.d(r,{A:()=>o});var s=e(1369);function o(t,r,e){return(r=(0,s.A)(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}},1369:(t,r,e)=>{e.d(r,{A:()=>o});var s=e(7545);function o(t){var r=function(t,r){if("object"!=(0,s.A)(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!=(0,s.A)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==(0,s.A)(r)?r:r+""}},7545:(t,r,e)=>{function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}e.d(r,{A:()=>s})},8989:(t,r,e)=>{e.r(r),e.d(r,{HttpAbortError:()=>I,HttpFetchError:()=>q,HttpParseError:()=>F,HttpResponseError:()=>D,createHttpInstance:()=>L,defaultAdapter:()=>B,fetch:()=>W,http:()=>U,isHttpAbortError:()=>J});var s={};e.r(s),e.d(s,{HttpAbortError:()=>f,HttpFetchError:()=>l,HttpParseError:()=>d,HttpResponseError:()=>p,createHttpInstance:()=>x,defaultAdapter:()=>H,fetch:()=>o,getUrlWithParams:()=>w,http:()=>j,isHttpAbortError:()=>b});const o=(t,r)=>{const e=new Request(t,Object.assign({credentials:"same-origin"},r));return self.fetch(e)};var n=e(4635),a=e(918),i=e(4586),c=e(829),u=e(2559),h=e(6121);class l extends Error{constructor(t){super(t),this.name="HttpFetchError",Error.captureStackTrace&&Error.captureStackTrace(this,l)}}class p extends Error{constructor(t,r){super(t.statusText),(0,i.A)(this,"response",void 0),(0,i.A)(this,"responseJson",void 0),this.name="HttpResponseError",Error.captureStackTrace&&Error.captureStackTrace(this,p),this.response=t,this.responseJson=r}}class d extends Error{constructor(t){super(t.statusText),(0,i.A)(this,"response",void 0),this.name="HttpParseError",Error.captureStackTrace&&Error.captureStackTrace(this,d),this.response=t}}class f extends Error{constructor(t){super(t),this.name="HttpAbortError"}}class A{constructor(){(0,i.A)(this,"handlers",[])}use(t,r){return this.handlers.push({fulfilled:t,rejected:r}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}forEach(t){this.handlers.forEach((r=>{null!==r&&t(r)}))}}function E(t){return null==t}const m=document.querySelector("base"),v=m?m.href:location.origin+"/",b=t=>t instanceof DOMException&&20===t.code,y=async(t,r,e)=>new Promise((async(s,n)=>{let a;e.url=t;let i,{responseType:c}=e.options||{};c||(c="json");try{a=await o(t,r)}catch(t){return void n(b(t)?new f(t.toString()):new l(t.toString()))}if(a.ok){try{i=await a[c]()}catch(t){return void n(b(t)?new f(t.toString()):new d(a))}s({status:a.status,statusText:a.statusText,headers:a.headers,data:i})}else{let t;try{t=await a.json()}catch{}n(new p(a,t))}})),w=(t,r)=>{if(r){const e=new URL(t,v);r instanceof URLSearchParams?r.forEach((function(t,r){e.searchParams.append(r,t)})):Object.entries(r).forEach((t=>{let[r,s]=t;Array.isArray(s)?s.forEach((t=>{e.searchParams.append(r,E(t)?"":t)})):e.searchParams.append(r,E(s)?"":s)}));const{href:s}=e;return s.startsWith(v)?s.substr(v.length):s}return t},T=(t,r)=>{if(void 0!==t){const e=new Headers(r||{}),s="Content-Type";let o=t;return e.has(s)||("string"==typeof t?e.set(s,"application/x-www-form-urlencoded"):t instanceof FormData||(e.set(s,"application/json"),o=JSON.stringify(t))),{body:o,headers:e}}return{headers:r}},H=t=>{const{url:r,method:e,data:s}=t;return["DELETE","GET","HEAD"].includes(t.method)?((t,r,e)=>{const{params:s,responseType:o,interceptorParams:n,observe:a,noAbortOnRouteChange:i,useCache:c,...u}=e.options||{};return y(w(r,s),{...u,method:t},e)})(e,r,t):((t,r,e,s)=>{const{params:o,headers:n,responseType:a,interceptorParams:i,observe:c,noAbortOnRouteChange:u,useCache:h,...l}=s.options||{};return y(w(r,o),{...l,method:t,...T(e,n)},s)})(e,r,s,t)};var g=new WeakMap,S=new WeakSet;class P{constructor(t){var r=this;(0,n.A)(this,S),(0,i.A)(this,"interceptors",void 0),(0,a.A)(this,g,H),(0,i.A)(this,"request",(async(t,r,e)=>{const{body:s,method:o,...n}=r||{};return(0,u.A)(S,this,k).call(this,{url:t,data:s,method:o||"GET",options:{...e||{},...n}})})),(0,i.A)(this,"simpleRequest",(function(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,u.A)(S,r,k).call(r,{url:e,method:t,options:s})})),(0,i.A)(this,"requestWithBody",(function(t,e,s){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,u.A)(S,r,k).call(r,{url:e,method:t,data:s,options:o})})),this.interceptors={request:new A,response:new A},null!=t&&t.adapter&&(0,h.A)(g,this,t.adapter)}getUrlWithParams(t,r){return w(t,r)}getBodyAndHeaders(t,r){return T(t,r)}get(t,r){return(0,u.A)(S,this,k).call(this,{url:t,method:"GET",options:r})}delete(t,r){return(0,u.A)(S,this,k).call(this,{url:t,method:"DELETE",options:r})}head(t,r){return(0,u.A)(S,this,k).call(this,{url:t,method:"HEAD",options:r})}post(t,r,e){return(0,u.A)(S,this,k).call(this,{url:t,method:"POST",data:r,options:e})}put(t,r,e){return(0,u.A)(S,this,k).call(this,{url:t,method:"PUT",data:r,options:e})}patch(t,r,e){return(0,u.A)(S,this,k).call(this,{url:t,method:"PATCH",data:r,options:e})}}function k(t){const r=[];let e=Promise.resolve(t);for(this.interceptors.request.forEach((t=>{r.push(t.fulfilled,t.rejected)})),r.push((t=>(0,c.A)(g,this).call(this,t)),void 0),this.interceptors.response.forEach((e=>{r.push((r=>{var s;return null===(s=e.fulfilled)||void 0===s?void 0:s.call(e,r,t)}),(r=>{var s;return null===(s=e.rejected)||void 0===s?void 0:s.call(e,r,t)}))})),r.push((r=>{var e;return"response"===(null===(e=t.options)||void 0===e?void 0:e.observe)?r:r.data}),void 0);r.length;)e=e.then(r.shift(),r.shift());return e}let j=new P;function x(t){j=new P(t)}var R;let C,_;const{dll:O}=window;C=O&&null!==(R=window.BRICK_NEXT_VERSIONS)&&void 0!==R&&null!==(R=R["brick-container"])&&void 0!==R&&R.startsWith("2.")&&(_=O("JxWY"))?_:s;const{fetch:W,HttpFetchError:q,HttpResponseError:D,HttpParseError:F,HttpAbortError:I,http:U,isHttpAbortError:J,createHttpInstance:L,defaultAdapter:B}=C}}]);
2
+ //# sourceMappingURL=8989.74e3337d.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/8989.0d8b22ea.js","mappings":"gKAAe,SAASA,EAAkBC,EAAGC,EAAGC,GAC9C,GAAI,mBAAqBF,EAAIA,IAAMC,EAAID,EAAEG,IAAIF,GAAI,OAAOG,UAAUC,OAAS,EAAIJ,EAAIC,EACnF,MAAM,IAAII,UAAU,gDACtB,C,iCCHe,SAASC,EAA2BC,EAAKC,GACtD,GAAIA,EAAkBN,IAAIK,GACxB,MAAM,IAAIF,UAAU,iEAExB,C,+DCHe,SAASI,EAAuBC,EAAGC,GAChD,OAAOD,EAAEE,KAAI,OAAiBF,EAAGC,GACnC,C,+CCFe,SAASE,EAA2BN,EAAKO,EAAYC,IAClE,OAA0BR,EAAKO,GAC/BA,EAAWE,IAAIT,EAAKQ,EACtB,C,gDCHe,SAASE,EAAuBP,EAAGC,EAAGO,GACnD,OAAOR,EAAEM,KAAI,OAAiBN,EAAGC,GAAIO,GAAIA,CAC3C,C,gDCFe,SAASC,EAA4BZ,EAAKa,IACvD,OAA0Bb,EAAKa,GAC/BA,EAAWC,IAAId,EACjB,C,gDCHe,SAASe,EAAgBf,EAAKgB,EAAKR,GAYhD,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M,IACJC,GACEC,OAEFH,EADEE,GAAgE,QAAxDH,EAAwBI,OAAOC,2BAA2D,IAA1BL,GAA2G,QAAtEA,EAAwBA,EAAsB,0BAA0D,IAA1BA,GAAoCA,EAAsB9C,WAAW,QAAUgD,EAAeC,EAAI,SAClRD,EAEA,EAEf,MACEzH,MAAK,EACLQ,eAAc,EACdO,kBAAiB,EACjBI,eAAc,EACdC,eAAc,EACdiG,KAAI,EACJ3E,iBAAgB,EAChB4E,mBAAkB,EAClBlC,eAAc,GACZoC,C","sources":["webpack:///../../node_modules/@babel/runtime/helpers/esm/assertClassBrand.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack:///../../node_modules/@next-core/http/dist/esm/fetch.js","webpack:///../../node_modules/@next-core/http/dist/esm/errors.js","webpack:///../../node_modules/@next-core/http/dist/esm/InterceptorManager.js","webpack:///../../node_modules/@next-core/http/dist/esm/http.js","webpack:///../../node_modules/@next-core/http/dist/esm/index.js"],"sourcesContent":["export default function _assertClassBrand(e, t, n) {\n if (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;\n throw new TypeError(\"Private element is not present on this object\");\n}","export default function _checkPrivateRedeclaration(obj, privateCollection) {\n if (privateCollection.has(obj)) {\n throw new TypeError(\"Cannot initialize the same private elements twice on an object\");\n }\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldGet2(s, a) {\n return s.get(assertClassBrand(s, a));\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateFieldInitSpec(obj, privateMap, value) {\n checkPrivateRedeclaration(obj, privateMap);\n privateMap.set(obj, value);\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldSet2(s, a, r) {\n return s.set(assertClassBrand(s, a), r), r;\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateMethodInitSpec(obj, privateSet) {\n checkPrivateRedeclaration(obj, privateSet);\n privateSet.add(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","export const fetch = (input, init) => {\n // Support older browsers which default credentials is \"omit\".\n // Ref https://github.com/whatwg/fetch/pull/585\n const req = new Request(input, Object.assign({\n credentials: \"same-origin\"\n }, init));\n return self.fetch(req);\n};\n//# sourceMappingURL=fetch.js.map","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nexport class HttpFetchError extends Error {\n constructor(message) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(message);\n this.name = \"HttpFetchError\";\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n // istanbul ignore else\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HttpFetchError);\n }\n }\n}\nexport class HttpResponseError extends Error {\n constructor(response, responseJson) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(response.statusText);\n _defineProperty(this, \"response\", void 0);\n _defineProperty(this, \"responseJson\", void 0);\n this.name = \"HttpResponseError\";\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n // istanbul ignore else\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HttpResponseError);\n }\n this.response = response;\n this.responseJson = responseJson;\n }\n}\nexport class HttpParseError extends Error {\n constructor(response) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(response.statusText);\n _defineProperty(this, \"response\", void 0);\n this.name = \"HttpParseError\";\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n // istanbul ignore else\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HttpParseError);\n }\n this.response = response;\n }\n}\nexport class HttpAbortError extends Error {\n constructor(message) {\n super(message);\n this.name = \"HttpAbortError\";\n }\n}\n//# sourceMappingURL=errors.js.map","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nexport default class InterceptorManager {\n constructor() {\n _defineProperty(this, \"handlers\", []);\n }\n use(onFulfilled, onRejected) {\n this.handlers.push({\n fulfilled: onFulfilled,\n rejected: onRejected\n });\n return this.handlers.length - 1;\n }\n eject(id) {\n // istanbul ignore else\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n forEach(fn) {\n this.handlers.forEach(handler => {\n // istanbul ignore else\n if (handler !== null) {\n fn(handler);\n }\n });\n }\n}\n//# sourceMappingURL=InterceptorManager.js.map","import _classPrivateMethodInitSpec from \"@babel/runtime/helpers/classPrivateMethodInitSpec\";\nimport _classPrivateFieldInitSpec from \"@babel/runtime/helpers/classPrivateFieldInitSpec\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classPrivateFieldGet from \"@babel/runtime/helpers/classPrivateFieldGet2\";\nimport _assertClassBrand from \"@babel/runtime/helpers/assertClassBrand\";\nimport _classPrivateFieldSet from \"@babel/runtime/helpers/classPrivateFieldSet2\";\nimport { fetch } from \"./fetch.js\";\nimport { HttpAbortError, HttpFetchError, HttpParseError, HttpResponseError } from \"./errors.js\";\nimport InterceptorManager from \"./InterceptorManager.js\";\nfunction isNil(value) {\n return value === undefined || value === null;\n}\nconst base = document.querySelector(\"base\");\nconst fullBaseHref = base ? base.href : location.origin + \"/\";\n/**\n * Detect whether the input is a native browser abort error.\n *\n * @ref https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n */\nexport const isHttpAbortError = error => error instanceof DOMException && error.code === 20;\nconst request = async (url, init, config) => {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n let response;\n config.url = url;\n let {\n responseType\n } = config.options || {};\n if (!responseType) {\n // Defaults to `json`\n responseType = \"json\";\n }\n try {\n response = await fetch(url, init);\n } catch (e) {\n reject(isHttpAbortError(e) ? new HttpAbortError(e.toString()) : new HttpFetchError(e.toString()));\n return;\n }\n if (!response.ok) {\n let responseJson;\n try {\n responseJson = await response.json();\n } catch {\n // Do nothing.\n }\n reject(new HttpResponseError(response, responseJson));\n return;\n }\n let data;\n try {\n data = await response[responseType]();\n } catch (e) {\n reject(isHttpAbortError(e) ? new HttpAbortError(e.toString()) : new HttpParseError(response));\n return;\n }\n const res = {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n data\n };\n resolve(res);\n });\n};\nexport const getUrlWithParams = (url, params) => {\n if (params) {\n const parsedUrl = new URL(url, fullBaseHref);\n if (params instanceof URLSearchParams) {\n params.forEach(function (value, key) {\n parsedUrl.searchParams.append(key, value);\n });\n } else {\n Object.entries(params).forEach(_ref => {\n let [key, value] = _ref;\n if (Array.isArray(value)) {\n value.forEach(v => {\n parsedUrl.searchParams.append(key, isNil(v) ? \"\" : v);\n });\n } else {\n parsedUrl.searchParams.append(key, isNil(value) ? \"\" : value);\n }\n });\n }\n const {\n href\n } = parsedUrl;\n if (href.startsWith(fullBaseHref)) {\n return href.substr(fullBaseHref.length);\n }\n return href;\n }\n return url;\n};\nconst getBodyAndHeaders = (data, headers) => {\n if (data !== undefined) {\n // `new Headers(undefined)` will throw a TypeError in older browsers (chrome 58).\n // https://bugs.chromium.org/p/chromium/issues/detail?id=335871\n const parsedHeaders = new Headers(headers || {});\n const contentTypeHeader = \"Content-Type\";\n let body = data;\n // If `Content-Type` already provided, ignore detecting content type.\n if (!parsedHeaders.has(contentTypeHeader)) {\n if (typeof data === \"string\") {\n parsedHeaders.set(contentTypeHeader, \"application/x-www-form-urlencoded\");\n } else if (data instanceof FormData) {\n // Do nothing\n } else {\n parsedHeaders.set(contentTypeHeader, \"application/json\");\n body = JSON.stringify(data);\n }\n }\n return {\n body,\n headers: parsedHeaders\n };\n }\n return {\n headers\n };\n};\nconst simpleRequest = (method, url, config) => {\n const {\n params,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n responseType,\n interceptorParams,\n observe,\n noAbortOnRouteChange,\n useCache,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...requestInit\n } = config.options || {};\n return request(getUrlWithParams(url, params), {\n ...requestInit,\n method\n }, config);\n};\nconst requestWithBody = (method, url, data, config) => {\n const {\n params,\n headers,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n responseType,\n interceptorParams,\n observe,\n noAbortOnRouteChange,\n useCache,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...requestInit\n } = config.options || {};\n return request(getUrlWithParams(url, params), {\n ...requestInit,\n method,\n ...getBodyAndHeaders(data, headers)\n }, config);\n};\nconst defaultAdapter = config => {\n const {\n url,\n method,\n data\n } = config;\n\n // \"DELETE\", \"GET\", \"HEAD\" methods.\n if ([\"DELETE\", \"GET\", \"HEAD\"].includes(config.method)) {\n return simpleRequest(method, url, config);\n }\n\n // \"POST\", \"PUT\" , \"PATCH\" methods.\n return requestWithBody(method, url, data, config);\n};\nvar _adapter = /*#__PURE__*/new WeakMap();\nvar _Http_brand = /*#__PURE__*/new WeakSet();\nclass Http {\n constructor(_config) {\n var _this = this;\n _classPrivateMethodInitSpec(this, _Http_brand);\n _defineProperty(this, \"interceptors\", void 0);\n _classPrivateFieldInitSpec(this, _adapter, defaultAdapter);\n _defineProperty(this, \"request\", async (url, init, options) => {\n const {\n body,\n method,\n ...requestInit\n } = init || {};\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n data: body,\n method: method || \"GET\",\n options: {\n ...(options || {}),\n ...requestInit\n }\n });\n });\n _defineProperty(this, \"simpleRequest\", function (method, url) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return _assertClassBrand(_Http_brand, _this, _fetch).call(_this, {\n url,\n method,\n options\n });\n });\n _defineProperty(this, \"requestWithBody\", function (method, url, data) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return _assertClassBrand(_Http_brand, _this, _fetch).call(_this, {\n url,\n method,\n data,\n options\n });\n });\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n if (_config !== null && _config !== void 0 && _config.adapter) {\n _classPrivateFieldSet(_adapter, this, _config.adapter);\n }\n }\n getUrlWithParams(url, params) {\n return getUrlWithParams(url, params);\n }\n getBodyAndHeaders(data, headers) {\n return getBodyAndHeaders(data, headers);\n }\n get(url, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"GET\",\n options\n });\n }\n delete(url, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"DELETE\",\n options\n });\n }\n head(url, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"HEAD\",\n options\n });\n }\n post(url, data, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"POST\",\n data,\n options\n });\n }\n put(url, data, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"PUT\",\n data,\n options\n });\n }\n patch(url, data, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"PATCH\",\n data,\n options\n });\n }\n}\nfunction _fetch(config) {\n const chain = [];\n let promise = Promise.resolve(config);\n this.interceptors.request.forEach(interceptor => {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n chain.push(config => _classPrivateFieldGet(_adapter, this).call(this, config), undefined);\n this.interceptors.response.forEach(interceptor => {\n chain.push(res => {\n var _interceptor$fulfille;\n return (_interceptor$fulfille = interceptor.fulfilled) === null || _interceptor$fulfille === void 0 ? void 0 : _interceptor$fulfille.call(interceptor, res, config);\n }, error => {\n var _interceptor$rejected;\n return (_interceptor$rejected = interceptor.rejected) === null || _interceptor$rejected === void 0 ? void 0 : _interceptor$rejected.call(interceptor, error, config);\n });\n });\n chain.push(response => {\n var _config$options;\n return ((_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.observe) === \"response\" ? response : response.data;\n }, undefined);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n return promise;\n}\nlet http = new Http();\nfunction createHttpInstance(config) {\n http = new Http(config);\n}\nexport { http, createHttpInstance, defaultAdapter };\n//# sourceMappingURL=http.js.map","var _window$BRICK_NEXT_VE;\n// istanbul ignore file\n// Make v3 bricks compatible with Brick Next v2.\nimport * as HttpModuleV3 from \"./exports.js\";\nlet HttpModule;\nlet HttpModuleV2;\nconst {\n dll\n} = window;\nif (dll && (_window$BRICK_NEXT_VE = window.BRICK_NEXT_VERSIONS) !== null && _window$BRICK_NEXT_VE !== void 0 && (_window$BRICK_NEXT_VE = _window$BRICK_NEXT_VE[\"brick-container\"]) !== null && _window$BRICK_NEXT_VE !== void 0 && _window$BRICK_NEXT_VE.startsWith(\"2.\") && (HttpModuleV2 = dll(\"JxWY\"))) {\n HttpModule = HttpModuleV2;\n} else {\n HttpModule = HttpModuleV3;\n}\nconst {\n fetch,\n HttpFetchError,\n HttpResponseError,\n HttpParseError,\n HttpAbortError,\n http,\n isHttpAbortError,\n createHttpInstance,\n defaultAdapter\n} = HttpModule;\nexport { fetch, HttpFetchError, HttpResponseError, HttpParseError, HttpAbortError, http, isHttpAbortError, createHttpInstance, defaultAdapter };\n//# sourceMappingURL=index.js.map"],"names":["_assertClassBrand","e","t","n","has","arguments","length","TypeError","_checkPrivateRedeclaration","obj","privateCollection","_classPrivateFieldGet2","s","a","get","_classPrivateFieldInitSpec","privateMap","value","set","_classPrivateFieldSet2","r","_classPrivateMethodInitSpec","privateSet","add","_defineProperty","key","Object","defineProperty","enumerable","configurable","writable","toPropertyKey","i","Symbol","toPrimitive","call","String","_typeof","o","iterator","constructor","prototype","fetch","input","init","req","Request","assign","credentials","self","HttpFetchError","Error","message","super","this","name","captureStackTrace","HttpResponseError","response","responseJson","statusText","HttpParseError","HttpAbortError","InterceptorManager","use","onFulfilled","onRejected","handlers","push","fulfilled","rejected","eject","id","forEach","fn","handler","isNil","base","document","querySelector","fullBaseHref","href","location","origin","isHttpAbortError","error","DOMException","code","request","async","url","config","Promise","resolve","reject","data","responseType","options","toString","ok","status","headers","json","getUrlWithParams","params","parsedUrl","URL","URLSearchParams","searchParams","append","entries","_ref","Array","isArray","v","startsWith","substr","getBodyAndHeaders","undefined","parsedHeaders","Headers","contentTypeHeader","body","FormData","JSON","stringify","defaultAdapter","method","includes","interceptorParams","observe","noAbortOnRouteChange","useCache","requestInit","simpleRequest","requestWithBody","_adapter","WeakMap","_Http_brand","WeakSet","Http","_config","_this","_fetch","interceptors","adapter","head","post","put","patch","chain","promise","interceptor","res","_interceptor$fulfille","_interceptor$rejected","_config$options","then","shift","http","createHttpInstance","_window$BRICK_NEX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MlF,MAAKuB,IAAU,OAAsB6C,EAAUlF,MAAMnB,KAAKmB,KAAMqC,SAAS2B,GAC/EhE,KAAK0F,aAAatF,SAASe,SAAQ+E,IACjCF,EAAMlF,MAAKqF,IACT,IAAIC,EACJ,OAA2D,QAAnDA,EAAwBF,EAAYnF,iBAAiD,IAA1BqF,OAAmC,EAASA,EAAsBvH,KAAKqH,EAAaC,EAAK9D,EAAO,IAClKN,IACD,IAAIsE,EACJ,OAA0D,QAAlDA,EAAwBH,EAAYlF,gBAAgD,IAA1BqF,OAAmC,EAASA,EAAsBxH,KAAKqH,EAAanE,EAAOM,EAAO,GACpK,IAEJ2D,EAAMlF,MAAKV,IACT,IAAIkG,EACJ,MAA0H,cAA3E,QAAtCA,EAAkBjE,EAAOM,eAAyC,IAApB2D,OAA6B,EAASA,EAAgB1B,SAA0BxE,EAAWA,EAASqC,IAAI,QAC9JuB,GACIgC,EAAMhJ,QACXiJ,EAAUA,EAAQM,KAAKP,EAAMQ,QAASR,EAAMQ,SAE9C,OAAOP,CACT,CACA,IAAIQ,EAAO,IAAInB,EACf,SAASoB,EAAmBrE,GAC1BoE,EAAO,IAAInB,EAAKjD,EAClB,CC5SA,IAAIsE,EAIJ,IAAIC,EACAC,EACJ,MAAM,IACJC,GACEC,OAEFH,EADEE,GAAgE,QAAxDH,EAAwBI,OAAOC,2BAA2D,IAA1BL,GAA2G,QAAtEA,EAAwBA,EAAsB,0BAA0D,IAA1BA,GAAoCA,EAAsB9C,WAAW,QAAUgD,EAAeC,EAAI,SAClRD,EAEA,EAEf,MACEzH,MAAK,EACLQ,eAAc,EACdO,kBAAiB,EACjBI,eAAc,EACdC,eAAc,EACdiG,KAAI,EACJ3E,iBAAgB,EAChB4E,mBAAkB,EAClBlC,eAAc,GACZoC,C","sources":["webpack:///../../node_modules/@babel/runtime/helpers/esm/assertClassBrand.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack:///../../node_modules/@next-core/http/dist/esm/fetch.js","webpack:///../../node_modules/@next-core/http/dist/esm/errors.js","webpack:///../../node_modules/@next-core/http/dist/esm/InterceptorManager.js","webpack:///../../node_modules/@next-core/http/dist/esm/http.js","webpack:///../../node_modules/@next-core/http/dist/esm/index.js"],"sourcesContent":["export default function _assertClassBrand(e, t, n) {\n if (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;\n throw new TypeError(\"Private element is not present on this object\");\n}","export default function _checkPrivateRedeclaration(obj, privateCollection) {\n if (privateCollection.has(obj)) {\n throw new TypeError(\"Cannot initialize the same private elements twice on an object\");\n }\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldGet2(s, a) {\n return s.get(assertClassBrand(s, a));\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateFieldInitSpec(obj, privateMap, value) {\n checkPrivateRedeclaration(obj, privateMap);\n privateMap.set(obj, value);\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldSet2(s, a, r) {\n return s.set(assertClassBrand(s, a), r), r;\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateMethodInitSpec(obj, privateSet) {\n checkPrivateRedeclaration(obj, privateSet);\n privateSet.add(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","export const fetch = (input, init) => {\n // Support older browsers which default credentials is \"omit\".\n // Ref https://github.com/whatwg/fetch/pull/585\n const req = new Request(input, Object.assign({\n credentials: \"same-origin\"\n }, init));\n return self.fetch(req);\n};\n//# sourceMappingURL=fetch.js.map","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nexport class HttpFetchError extends Error {\n constructor(message) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(message);\n this.name = \"HttpFetchError\";\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n // istanbul ignore else\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HttpFetchError);\n }\n }\n}\nexport class HttpResponseError extends Error {\n constructor(response, responseJson) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(response.statusText);\n _defineProperty(this, \"response\", void 0);\n _defineProperty(this, \"responseJson\", void 0);\n this.name = \"HttpResponseError\";\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n // istanbul ignore else\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HttpResponseError);\n }\n this.response = response;\n this.responseJson = responseJson;\n }\n}\nexport class HttpParseError extends Error {\n constructor(response) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(response.statusText);\n _defineProperty(this, \"response\", void 0);\n this.name = \"HttpParseError\";\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n // istanbul ignore else\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HttpParseError);\n }\n this.response = response;\n }\n}\nexport class HttpAbortError extends Error {\n constructor(message) {\n super(message);\n this.name = \"HttpAbortError\";\n }\n}\n//# sourceMappingURL=errors.js.map","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nexport default class InterceptorManager {\n constructor() {\n _defineProperty(this, \"handlers\", []);\n }\n use(onFulfilled, onRejected) {\n this.handlers.push({\n fulfilled: onFulfilled,\n rejected: onRejected\n });\n return this.handlers.length - 1;\n }\n eject(id) {\n // istanbul ignore else\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n forEach(fn) {\n this.handlers.forEach(handler => {\n // istanbul ignore else\n if (handler !== null) {\n fn(handler);\n }\n });\n }\n}\n//# sourceMappingURL=InterceptorManager.js.map","import _classPrivateMethodInitSpec from \"@babel/runtime/helpers/classPrivateMethodInitSpec\";\nimport _classPrivateFieldInitSpec from \"@babel/runtime/helpers/classPrivateFieldInitSpec\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classPrivateFieldGet from \"@babel/runtime/helpers/classPrivateFieldGet2\";\nimport _assertClassBrand from \"@babel/runtime/helpers/assertClassBrand\";\nimport _classPrivateFieldSet from \"@babel/runtime/helpers/classPrivateFieldSet2\";\nimport { fetch } from \"./fetch.js\";\nimport { HttpAbortError, HttpFetchError, HttpParseError, HttpResponseError } from \"./errors.js\";\nimport InterceptorManager from \"./InterceptorManager.js\";\nfunction isNil(value) {\n return value === undefined || value === null;\n}\nconst base = document.querySelector(\"base\");\nconst fullBaseHref = base ? base.href : location.origin + \"/\";\n/**\n * Detect whether the input is a native browser abort error.\n *\n * @ref https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n */\nexport const isHttpAbortError = error => error instanceof DOMException && error.code === 20;\nconst request = async (url, init, config) => {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n let response;\n config.url = url;\n let {\n responseType\n } = config.options || {};\n if (!responseType) {\n // Defaults to `json`\n responseType = \"json\";\n }\n try {\n response = await fetch(url, init);\n } catch (e) {\n reject(isHttpAbortError(e) ? new HttpAbortError(e.toString()) : new HttpFetchError(e.toString()));\n return;\n }\n if (!response.ok) {\n let responseJson;\n try {\n responseJson = await response.json();\n } catch {\n // Do nothing.\n }\n reject(new HttpResponseError(response, responseJson));\n return;\n }\n let data;\n try {\n data = await response[responseType]();\n } catch (e) {\n reject(isHttpAbortError(e) ? new HttpAbortError(e.toString()) : new HttpParseError(response));\n return;\n }\n const res = {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n data\n };\n resolve(res);\n });\n};\nexport const getUrlWithParams = (url, params) => {\n if (params) {\n const parsedUrl = new URL(url, fullBaseHref);\n if (params instanceof URLSearchParams) {\n params.forEach(function (value, key) {\n parsedUrl.searchParams.append(key, value);\n });\n } else {\n Object.entries(params).forEach(_ref => {\n let [key, value] = _ref;\n if (Array.isArray(value)) {\n value.forEach(v => {\n parsedUrl.searchParams.append(key, isNil(v) ? \"\" : v);\n });\n } else {\n parsedUrl.searchParams.append(key, isNil(value) ? \"\" : value);\n }\n });\n }\n const {\n href\n } = parsedUrl;\n if (href.startsWith(fullBaseHref)) {\n return href.substr(fullBaseHref.length);\n }\n return href;\n }\n return url;\n};\nconst getBodyAndHeaders = (data, headers) => {\n if (data !== undefined) {\n // `new Headers(undefined)` will throw a TypeError in older browsers (chrome 58).\n // https://bugs.chromium.org/p/chromium/issues/detail?id=335871\n const parsedHeaders = new Headers(headers || {});\n const contentTypeHeader = \"Content-Type\";\n let body = data;\n // If `Content-Type` already provided, ignore detecting content type.\n if (!parsedHeaders.has(contentTypeHeader)) {\n if (typeof data === \"string\") {\n parsedHeaders.set(contentTypeHeader, \"application/x-www-form-urlencoded\");\n } else if (data instanceof FormData) {\n // Do nothing\n } else {\n parsedHeaders.set(contentTypeHeader, \"application/json\");\n body = JSON.stringify(data);\n }\n }\n return {\n body,\n headers: parsedHeaders\n };\n }\n return {\n headers\n };\n};\nconst simpleRequest = (method, url, config) => {\n const {\n params,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n responseType,\n interceptorParams,\n observe,\n noAbortOnRouteChange,\n useCache,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...requestInit\n } = config.options || {};\n return request(getUrlWithParams(url, params), {\n ...requestInit,\n method\n }, config);\n};\nconst requestWithBody = (method, url, data, config) => {\n const {\n params,\n headers,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n responseType,\n interceptorParams,\n observe,\n noAbortOnRouteChange,\n useCache,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...requestInit\n } = config.options || {};\n return request(getUrlWithParams(url, params), {\n ...requestInit,\n method,\n ...getBodyAndHeaders(data, headers)\n }, config);\n};\nconst defaultAdapter = config => {\n const {\n url,\n method,\n data\n } = config;\n\n // \"DELETE\", \"GET\", \"HEAD\" methods.\n if ([\"DELETE\", \"GET\", \"HEAD\"].includes(config.method)) {\n return simpleRequest(method, url, config);\n }\n\n // \"POST\", \"PUT\" , \"PATCH\" methods.\n return requestWithBody(method, url, data, config);\n};\nvar _adapter = /*#__PURE__*/new WeakMap();\nvar _Http_brand = /*#__PURE__*/new WeakSet();\nclass Http {\n constructor(_config) {\n var _this = this;\n _classPrivateMethodInitSpec(this, _Http_brand);\n _defineProperty(this, \"interceptors\", void 0);\n _classPrivateFieldInitSpec(this, _adapter, defaultAdapter);\n _defineProperty(this, \"request\", async (url, init, options) => {\n const {\n body,\n method,\n ...requestInit\n } = init || {};\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n data: body,\n method: method || \"GET\",\n options: {\n ...(options || {}),\n ...requestInit\n }\n });\n });\n _defineProperty(this, \"simpleRequest\", function (method, url) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return _assertClassBrand(_Http_brand, _this, _fetch).call(_this, {\n url,\n method,\n options\n });\n });\n _defineProperty(this, \"requestWithBody\", function (method, url, data) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return _assertClassBrand(_Http_brand, _this, _fetch).call(_this, {\n url,\n method,\n data,\n options\n });\n });\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n if (_config !== null && _config !== void 0 && _config.adapter) {\n _classPrivateFieldSet(_adapter, this, _config.adapter);\n }\n }\n getUrlWithParams(url, params) {\n return getUrlWithParams(url, params);\n }\n getBodyAndHeaders(data, headers) {\n return getBodyAndHeaders(data, headers);\n }\n get(url, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"GET\",\n options\n });\n }\n delete(url, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"DELETE\",\n options\n });\n }\n head(url, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"HEAD\",\n options\n });\n }\n post(url, data, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"POST\",\n data,\n options\n });\n }\n put(url, data, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"PUT\",\n data,\n options\n });\n }\n patch(url, data, options) {\n return _assertClassBrand(_Http_brand, this, _fetch).call(this, {\n url,\n method: \"PATCH\",\n data,\n options\n });\n }\n}\nfunction _fetch(config) {\n const chain = [];\n let promise = Promise.resolve(config);\n this.interceptors.request.forEach(interceptor => {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n chain.push(config => _classPrivateFieldGet(_adapter, this).call(this, config), undefined);\n this.interceptors.response.forEach(interceptor => {\n chain.push(res => {\n var _interceptor$fulfille;\n return (_interceptor$fulfille = interceptor.fulfilled) === null || _interceptor$fulfille === void 0 ? void 0 : _interceptor$fulfille.call(interceptor, res, config);\n }, error => {\n var _interceptor$rejected;\n return (_interceptor$rejected = interceptor.rejected) === null || _interceptor$rejected === void 0 ? void 0 : _interceptor$rejected.call(interceptor, error, config);\n });\n });\n chain.push(response => {\n var _config$options;\n return ((_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.observe) === \"response\" ? response : response.data;\n }, undefined);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n return promise;\n}\nlet http = new Http();\nfunction createHttpInstance(config) {\n http = new Http(config);\n}\nexport { http, createHttpInstance, defaultAdapter };\n//# sourceMappingURL=http.js.map","var _window$BRICK_NEXT_VE;\n// istanbul ignore file\n// Make v3 bricks compatible with Brick Next v2.\nimport * as HttpModuleV3 from \"./exports.js\";\nlet HttpModule;\nlet HttpModuleV2;\nconst {\n dll\n} = window;\nif (dll && (_window$BRICK_NEXT_VE = window.BRICK_NEXT_VERSIONS) !== null && _window$BRICK_NEXT_VE !== void 0 && (_window$BRICK_NEXT_VE = _window$BRICK_NEXT_VE[\"brick-container\"]) !== null && _window$BRICK_NEXT_VE !== void 0 && _window$BRICK_NEXT_VE.startsWith(\"2.\") && (HttpModuleV2 = dll(\"JxWY\"))) {\n HttpModule = HttpModuleV2;\n} else {\n HttpModule = HttpModuleV3;\n}\nconst {\n fetch,\n HttpFetchError,\n HttpResponseError,\n HttpParseError,\n HttpAbortError,\n http,\n isHttpAbortError,\n createHttpInstance,\n defaultAdapter\n} = HttpModule;\nexport { fetch, HttpFetchError, HttpResponseError, HttpParseError, HttpAbortError, http, isHttpAbortError, createHttpInstance, defaultAdapter };\n//# sourceMappingURL=index.js.map"],"names":["_assertClassBrand","e","t","n","has","arguments","length","TypeError","_checkPrivateRedeclaration","obj","privateCollection","_classPrivateFieldGet2","s","a","get","_classPrivateFieldInitSpec","privateMap","value","set","_classPrivateFieldSet2","r","_classPrivateMethodInitSpec","privateSet","add","_defineProperty","key","Object","defineProperty","enumerable","configurable","writable","toPropertyKey","i","Symbol","toPrimitive","call","String","_typeof","o","iterator","constructor","prototype","fetch","input","init","req","Request","assign","credentials","self","HttpFetchError","Error","message","super","this","name","captureStackTrace","HttpResponseError","response","responseJson","statusText","HttpParseError","HttpAbortError","InterceptorManager","use","onFulfilled","onRejected","handlers","push","fulfilled","rejected","eject","id","forEach","fn","handler","isNil","base","document","querySelector","fullBaseHref","href","location","origin","isHttpAbortError","error","DOMException","code","request","async","url","config","Promise","resolve","reject","data","responseType","options","toString","ok","status","headers","json","getUrlWithParams","params","parsedUrl","URL","URLSearchParams","searchParams","append","entries","_ref","Array","isArray","v","startsWith","substr","getBodyAndHeaders","undefined","parsedHeaders","Headers","contentTypeHeader","body","FormData","JSON","stringify","defaultAdapter","method","includes","interceptorParams","observe","noAbortOnRouteChange","useCache","requestInit","simpleRequest","requestWithBody","_adapter","WeakMap","_Http_brand","WeakSet","Http","_config","_this","_fetch","interceptors","adapter","head","post","put","patch","chain","promise","interceptor","res","_interceptor$fulfille","_interceptor$rejected","_config$options","then","shift","http","createHttpInstance","_window$BRICK_NEXT_VE","HttpModule","HttpModuleV2","dll","window","BRICK_NEXT_VERSIONS"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[9027],{6788:(e,t,o)=>{o.d(t,{b:()=>i});var n=o(279),a=o(2153),r=o(6946);function i(e){const t=function(e){const t=new Set;return(0,a.h)(e,(e=>{switch(e.type){case"Resolvable":case"EventHandler":{var o;const n=null===(o=e.raw)||void 0===o?void 0:o.useProvider;n&&t.add(n)}}})),t}((0,r.lN)(e)),o=[];for(const e of t)e.includes("@")&&o.push(e);return o}customElements.define("visual-builder.collect-used-contracts",(0,n.createProviderClass)(i))},9027:(e,t,o)=>{o.d(t,{A:()=>D,w:()=>N});var n=o(9435),a=o(9422),r=o(6055),i=o(1030),s=o(8317),d=o.n(s);let l;function c(e){e.preventDefault(),e.stopPropagation(),function(e){const t=g(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"select-brick",iidList:t},l)}(e.composedPath())}function p(e){e.preventDefault(),e.stopPropagation()}const u=(0,i.throttle)((e=>{const t=g(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:t},l)}),100,{leading:!1});function v(e){e.preventDefault(),e.stopPropagation(),u(e.composedPath())}function h(e){e.preventDefault(),e.stopPropagation(),u(e.composedPath())}function w(e){e.preventDefault(),e.stopPropagation(),window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:[]},l)}function m(e){e.preventDefault(),e.stopPropagation(),function(e,t){const o=g(e);o.length>0&&window.parent.postMessage({sender:"previewer",type:"context-menu-on-brick",iidList:o,position:t},l)}(e.composedPath(),{x:e.clientX,y:e.clientY})}function g(e){const t=[];for(const o of e)o instanceof HTMLElement&&"string"==typeof o.dataset.iid&&t.push(o.dataset.iid);return t}var y=o(6788);function f(e){const t=typeof e;switch(t){case"string":case"boolean":case"number":return{type:t,value:e};case"undefined":return{type:t}}return null===e?{type:"null"}:Array.isArray(e)?{type:"array",length:e.length}:{type:"object"}}let b=!1,S=n.getHistory,I=n.matchPath,x=n.__secret_internals,E=r.flowApi,k=!1;try{var L;const e=window.dll;if(e&&null!==(L=window.BRICK_NEXT_VERSIONS)&&void 0!==L&&null!==(L=L["brick-container"])&&void 0!==L&&L.startsWith("2.")){const{getHistory:t,developHelper:o,collectDebugContract:n}=e("tYg3"),{matchPath:a}=e("A+yw");S=t,I=a,x={...o,getContextValue(e,t){let{tplStateStoreId:n}=t;return o.getContextValue(e,{tplContextId:n})},getAllContextValues(e){let{tplStateStoreId:t}=e;const n=o.getAllContextValues({tplContextId:t});return Object.fromEntries([...n].map((e=>{let[t,o]=e;return[t,o.value]})))},debugDataValue(e,t){let{tplStateStoreId:n}=t;return o.debugDataValue(e,{tplContextId:n})}},E={collectDebugContract:n},k=!0}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}let P=null,C=null;async function D(e,t){var o,r;if(b)return;b=!0;const s=t=>{window.parent.postMessage({sender:"previewer",...t},e)};let u,g,k,L;s({type:"preview-started"}),l=e;const D=(e,t,o)=>{const n=T(t);s({type:"highlight-brick",highlightType:e,outlines:n,iid:t,alias:o})};let N;t.templateId&&(N=t.settings);const M=()=>{x.updateTemplatePreviewSettings(t.appId,t.templateId,N),S().reload()},R=()=>{x.updateSnippetPreviewSettings(t.appId,JSON.parse(t.snippetData)),S().reload()},q=()=>{x.updateFormPreviewSettings(t.appId,t.formId,t.formData),S().reload()},O=S();window.addEventListener("message",(async o=>{var r,f;let{data:b,origin:I}=o;if(I===e&&b&&"preview-container"===b.sender)if("builder"===b.forwardedFor)switch(b.type){case"hover-on-brick":u=b.iid,g=b.alias,D("hover",b.iid,b.alias);break;case"hover-on-main":D("hover","#main-mount-point","root");break;case"hover-on-context":(e=>{const t=e.map((e=>T(e.iid,e.alias))).flat();s({type:"highlight-context",outlines:t})})(b.highlightNodes);break;case"select-brick":k=b.iid,L=b.alias,D("active",b.iid,b.alias);break;case"hover-on-iframe":(e=>{const t=document.elementFromPoint(e.x,e.y);if("BODY"===(null==t?void 0:t.tagName))window.parent.postMessage({sender:"previewer",type:"hover-on-main",isDirection:!0,position:{x:e.x,y:e.y}},l);else{const o=function(e){const t=[];let o=e;for(;o;)"string"==typeof o.dataset.iid&&t.push(o.dataset.iid),o=o.parentElement;return t}(t);window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:o,isDirection:!0,position:{x:e.x,y:e.y}},l)}})(b.position)}else switch(b.type){case"toggle-inspecting":b.enabled?(window.addEventListener("click",c,!0),window.addEventListener("mousedown",p,!0),window.addEventListener("mouseover",p,!0),window.addEventListener("mouseup",p,!0),window.addEventListener("pointerdown",v,!0),window.addEventListener("pointermove",h,!0),window.addEventListener("pointerup",p,!0),window.addEventListener("pointerleave",w,!0),window.addEventListener("contextmenu",m,!0)):(window.removeEventListener("click",c,!0),window.removeEventListener("mousedown",p,!0),window.removeEventListener("mouseover",p,!0),window.removeEventListener("mouseup",p,!0),window.removeEventListener("pointerdown",v,!0),window.removeEventListener("pointermove",h,!0),window.removeEventListener("pointerup",p,!0),window.removeEventListener("pointerleave",w,!0),window.removeEventListener("contextmenu",m,!0));break;case"refresh":if(null!==(r=b.options)&&void 0!==r&&r.updateStoryboardType){var P;let e;var C,_;"route"===b.options.updateStoryboardType?x.updateStoryboardByRoute(t.appId,b.storyboardPatch):"template"===b.options.updateStoryboardType?x.updateStoryboardByTemplate(t.appId,b.storyboardPatch,b.options.settings):"snippet"===b.options.updateStoryboardType?x.updateStoryboardBySnippet(t.appId,b.storyboardPatch):"form"===b.options.updateStoryboardType&&x.updateFormPreviewSettings(t.appId,t.formId,b.storyboardPatch),"form"!==(null===(P=b.options)||void 0===P?void 0:P.updateStoryboardType)&&(e=await(null===(C=(_=x).getAddedContracts)||void 0===C?void 0:C.call(_,b.storyboardPatch,{appId:t.appId,updateStoryboardType:b.options.updateStoryboardType,formId:t.formId,collectUsedContracts:y.b}))),(0,i.isEmpty)(e)?S().reload():s({type:"contract-update",data:{add:e}});break}x.updateStoryboard(t.appId,b.storyboardPatch),t.templateId?(N=b.settings,M()):t.formId||t.formData?q():null!==(f=b.options)&&void 0!==f&&f.snippetData?(t.snippetData=b.options.snippetData,R()):S().reload();break;case"reload":location.reload();break;case"back":O.goBack();break;case"forward":O.goForward();break;case"capture":(async function(e,t){const o=await d()(document.body,{logging:!1,scale:1,width:window.innerWidth,height:window.innerHeight,foreignObjectRendering:!0}),n=document.createElement("canvas");var a;return function(e,t,o,n){const a=o/n,{width:r,height:i}=e,s=r/i,d=s>=a,l=d?o:n*s,c=d?o/s:n;t.width=l,t.height=c,t.getContext("2d").drawImage(e,0,0,r,i,0,0,l,c),t.toDataURL()}(o,n,e,t),await(a=n,new Promise((function(e,t){a.toBlob((function(o){o?e(o):t()}))})))})(b.maxWidth,b.maxHeight).then((e=>{s({type:"capture-ok",screenshot:e})}),(()=>{s({type:"capture-failed"})}));break;case"inspect-data-value":((e,t)=>{try{const{dataType:o}=t;let n,a,r;if("state"===o&&(n=A(),!n))return void s({type:"inspect-data-value-error",data:{error:{message:"tplStateStoreId not found, unable to preview STATE value"}}});if(e)r="inspect-single-data-value-success",a=x.getContextValue(e,{tplStateStoreId:n});else{r="inspect-all-data-values-success";const e=x.getAllContextValues({tplStateStoreId:n});a=Object.entries(e).map((e=>{let[t,o]=e;return{name:t,value:o}}))}s({type:r,data:{name:e,value:a}})}catch(e){s({type:"inspect-data-value-error",data:{message:e.message}})}})(b.name,b.option);break;case"update-preview-url":{const e=b.previewUrl.startsWith(window.origin)?b.previewUrl.substring(window.origin.length):b.previewUrl,t=(0,n.getBasePath)(),o=e.startsWith(t)?e.substring(t.length-1):e;S().push(o);break}case"update-preview-route":t.routePath=b.routePath,t.routeExact=b.routeExact,B();break;case"debug-data-value":(async(e,o,n)=>{try{o&&E.collectDebugContract([o]);const a=await x.debugDataValue(e,{tplStateStoreId:"state"===n.dataType?A():void 0,routeId:t.routeId});s({type:"debug-data-value-success",data:{debugConf:e,value:a}})}catch(e){s({type:"debug-data-value-error",data:e instanceof a.HttpResponseError?e.responseJson:{message:e.message}})}})(b.debugData,b.contractData,b.options);break;case"excute-proxy-method":{const[e,t,o=[]]=b.proxyMethodArgs;try{const n=document.body.querySelector(e)[t](...o);window.parent.postMessage({sender:"previewer",type:"excute-proxy-method-success",data:{method:t,res:n}})}catch(e){window.parent.postMessage({sender:"previewer",type:"excute-proxy-method-error",data:{method:t,res:e.message}})}break}}})),window.addEventListener("scroll",(()=>{s({type:"scroll",scroll:{x:window.scrollX,y:window.scrollY}})}));let _,H=!0;const V=e=>{s({type:"url-change",url:location.origin+O.createHref(e)}),_=e,B()};function B(){if(t.routePath){const e=!!I(_.pathname,{path:t.routePath,exact:t.routeExact});if(s({type:"route-match-change",match:e}),t.templateId&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(M(),t.disconnect())}));t.observe(e,{childList:!0})}if(t.formId&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(q(),t.disconnect())}));t.observe(e,{childList:!0})}if(t.snippetData&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(R(),t.disconnect())}));t.observe(e,{childList:!0})}H=e}}function j(){var e;const t=document.querySelector("eo-page-view"),o=(null==t||null===(e=t.shadowRoot)||void 0===e?void 0:e.querySelector(".content"))??null;var n;o!==P&&(null===(n=P)||void 0===n||n.removeEventListener("scroll",F),null==o||o.addEventListener("scroll",F),P=o,C=t)}function F(){s({type:"content-scroll",scroll:{x:this.scrollLeft,y:this.scrollTop}})}V(O.location),O.listen(V),t.templateId&&M(),(t.formId||t.formData)&&q(),t.snippetData&&R();const U=()=>{var e;const o=t.routeId,n=x.getLegalRuntimeValue({routeId:o});s({type:"inspect-runtime-data-value",data:{...(0,i.omit)(n,"query"),query:n.query?Object.fromEntries(n.query.entries()):{},path:null===(e=n.match)||void 0===e?void 0:e.params}})};let W;function Y(e){const o=t.templateId?A():void 0;var n,a;(W!==o||e)&&(W=o,null===(n=(a=x).setRealTimeDataInspectRoot)||void 0===n||n.call(a,{tplStateStoreId:o}))}null===(o=(r=x).addRealTimeDataInspectHook)||void 0===o||o.call(r,(e=>{let{changeType:t,tplStateStoreId:o,detail:n}=e;s({type:"real-time-data-inspect-change",changeType:t,tplStateStoreId:o,detail:"update"===t?{name:n.name,annotation:f(n.value)}:{data:Object.fromEntries(Object.entries(n.data).map((e=>{let[t,o]=e;return[t,f(o)]})))}})})),window.addEventListener("route.render",(()=>{Y(!0),U()})),j(),Y(!0),U(),new MutationObserver((0,i.throttle)((()=>{j(),Y(),u&&D("hover",u,g),k&&D("active",k,L)}),100,{leading:!1})).observe(document.body,{subtree:!0,childList:!0})}function T(e,t){if(!e)return[];const o=e.includes("#"),n=function(e,t){return e.map((e=>{var o;const n=null===(o=C)||void 0===o?void 0:o.contains(e),{width:a,height:r,left:i,top:s}=e.getBoundingClientRect();return{width:a,height:r,left:i+window.scrollX+(n?P.scrollLeft:0),top:s+window.scrollY+(n?P.scrollTop:0),alias:t,hasContentScroll:n}}))}(N(e,o),t);return o?n.map((e=>({...e,height:window.innerHeight-e.top}))):n}function N(e,t){const o=[];return function n(a){const r=a.querySelectorAll(t?e:`[data-iid="${e}"]`);if(o.push(...r),!(a===document&&r.length>0))for(const e of a.querySelectorAll("*"))e.shadowRoot&&n(e.shadowRoot)}(document),o}function A(){var e;const t=document.querySelector("#main-mount-point");return null==t||null===(e=t.firstChild)||void 0===e?void 0:e.dataset[k?"tplContextId":"tplStateStoreId"]}}}]);
2
- //# sourceMappingURL=9027.58391f17.js.map
1
+ "use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[9027],{6788:(e,t,o)=>{o.d(t,{b:()=>i});var n=o(279),a=o(2153),r=o(6946);function i(e){const t=function(e){const t=new Set;return(0,a.h)(e,(e=>{switch(e.type){case"Resolvable":case"EventHandler":{var o;const n=null===(o=e.raw)||void 0===o?void 0:o.useProvider;n&&t.add(n)}}})),t}((0,r.lN)(e)),o=[];for(const e of t)e.includes("@")&&o.push(e);return o}customElements.define("visual-builder.collect-used-contracts",(0,n.createProviderClass)(i))},9027:(e,t,o)=>{o.d(t,{A:()=>D,w:()=>N});var n=o(8581),a=o(9422),r=o(6055),i=o(1030),s=o(8317),d=o.n(s);let l;function c(e){e.preventDefault(),e.stopPropagation(),function(e){const t=g(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"select-brick",iidList:t},l)}(e.composedPath())}function p(e){e.preventDefault(),e.stopPropagation()}const u=(0,i.throttle)((e=>{const t=g(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:t},l)}),100,{leading:!1});function v(e){e.preventDefault(),e.stopPropagation(),u(e.composedPath())}function h(e){e.preventDefault(),e.stopPropagation(),u(e.composedPath())}function w(e){e.preventDefault(),e.stopPropagation(),window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:[]},l)}function m(e){e.preventDefault(),e.stopPropagation(),function(e,t){const o=g(e);o.length>0&&window.parent.postMessage({sender:"previewer",type:"context-menu-on-brick",iidList:o,position:t},l)}(e.composedPath(),{x:e.clientX,y:e.clientY})}function g(e){const t=[];for(const o of e)o instanceof HTMLElement&&"string"==typeof o.dataset.iid&&t.push(o.dataset.iid);return t}var y=o(6788);function f(e){const t=typeof e;switch(t){case"string":case"boolean":case"number":return{type:t,value:e};case"undefined":return{type:t}}return null===e?{type:"null"}:Array.isArray(e)?{type:"array",length:e.length}:{type:"object"}}let b=!1,S=n.getHistory,I=n.matchPath,x=n.__secret_internals,E=r.flowApi,k=!1;try{var L;const e=window.dll;if(e&&null!==(L=window.BRICK_NEXT_VERSIONS)&&void 0!==L&&null!==(L=L["brick-container"])&&void 0!==L&&L.startsWith("2.")){const{getHistory:t,developHelper:o,collectDebugContract:n}=e("tYg3"),{matchPath:a}=e("A+yw");S=t,I=a,x={...o,getContextValue(e,t){let{tplStateStoreId:n}=t;return o.getContextValue(e,{tplContextId:n})},getAllContextValues(e){let{tplStateStoreId:t}=e;const n=o.getAllContextValues({tplContextId:t});return Object.fromEntries([...n].map((e=>{let[t,o]=e;return[t,o.value]})))},debugDataValue(e,t){let{tplStateStoreId:n}=t;return o.debugDataValue(e,{tplContextId:n})}},E={collectDebugContract:n},k=!0}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}let P=null,C=null;async function D(e,t){var o,r;if(b)return;b=!0;const s=t=>{window.parent.postMessage({sender:"previewer",...t},e)};let u,g,k,L;s({type:"preview-started"}),l=e;const D=(e,t,o)=>{const n=T(t);s({type:"highlight-brick",highlightType:e,outlines:n,iid:t,alias:o})};let N;t.templateId&&(N=t.settings);const M=()=>{x.updateTemplatePreviewSettings(t.appId,t.templateId,N),S().reload()},R=()=>{x.updateSnippetPreviewSettings(t.appId,JSON.parse(t.snippetData)),S().reload()},q=()=>{x.updateFormPreviewSettings(t.appId,t.formId,t.formData),S().reload()},O=S();window.addEventListener("message",(async o=>{var r,f;let{data:b,origin:I}=o;if(I===e&&b&&"preview-container"===b.sender)if("builder"===b.forwardedFor)switch(b.type){case"hover-on-brick":u=b.iid,g=b.alias,D("hover",b.iid,b.alias);break;case"hover-on-main":D("hover","#main-mount-point","root");break;case"hover-on-context":(e=>{const t=e.map((e=>T(e.iid,e.alias))).flat();s({type:"highlight-context",outlines:t})})(b.highlightNodes);break;case"select-brick":k=b.iid,L=b.alias,D("active",b.iid,b.alias);break;case"hover-on-iframe":(e=>{const t=document.elementFromPoint(e.x,e.y);if("BODY"===(null==t?void 0:t.tagName))window.parent.postMessage({sender:"previewer",type:"hover-on-main",isDirection:!0,position:{x:e.x,y:e.y}},l);else{const o=function(e){const t=[];let o=e;for(;o;)"string"==typeof o.dataset.iid&&t.push(o.dataset.iid),o=o.parentElement;return t}(t);window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:o,isDirection:!0,position:{x:e.x,y:e.y}},l)}})(b.position)}else switch(b.type){case"toggle-inspecting":b.enabled?(window.addEventListener("click",c,!0),window.addEventListener("mousedown",p,!0),window.addEventListener("mouseover",p,!0),window.addEventListener("mouseup",p,!0),window.addEventListener("pointerdown",v,!0),window.addEventListener("pointermove",h,!0),window.addEventListener("pointerup",p,!0),window.addEventListener("pointerleave",w,!0),window.addEventListener("contextmenu",m,!0)):(window.removeEventListener("click",c,!0),window.removeEventListener("mousedown",p,!0),window.removeEventListener("mouseover",p,!0),window.removeEventListener("mouseup",p,!0),window.removeEventListener("pointerdown",v,!0),window.removeEventListener("pointermove",h,!0),window.removeEventListener("pointerup",p,!0),window.removeEventListener("pointerleave",w,!0),window.removeEventListener("contextmenu",m,!0));break;case"refresh":if(null!==(r=b.options)&&void 0!==r&&r.updateStoryboardType){var P;let e;var C,_;"route"===b.options.updateStoryboardType?x.updateStoryboardByRoute(t.appId,b.storyboardPatch):"template"===b.options.updateStoryboardType?x.updateStoryboardByTemplate(t.appId,b.storyboardPatch,b.options.settings):"snippet"===b.options.updateStoryboardType?x.updateStoryboardBySnippet(t.appId,b.storyboardPatch):"form"===b.options.updateStoryboardType&&x.updateFormPreviewSettings(t.appId,t.formId,b.storyboardPatch),"form"!==(null===(P=b.options)||void 0===P?void 0:P.updateStoryboardType)&&(e=await(null===(C=(_=x).getAddedContracts)||void 0===C?void 0:C.call(_,b.storyboardPatch,{appId:t.appId,updateStoryboardType:b.options.updateStoryboardType,formId:t.formId,collectUsedContracts:y.b}))),(0,i.isEmpty)(e)?S().reload():s({type:"contract-update",data:{add:e}});break}x.updateStoryboard(t.appId,b.storyboardPatch),t.templateId?(N=b.settings,M()):t.formId||t.formData?q():null!==(f=b.options)&&void 0!==f&&f.snippetData?(t.snippetData=b.options.snippetData,R()):S().reload();break;case"reload":location.reload();break;case"back":O.goBack();break;case"forward":O.goForward();break;case"capture":(async function(e,t){const o=await d()(document.body,{logging:!1,scale:1,width:window.innerWidth,height:window.innerHeight,foreignObjectRendering:!0}),n=document.createElement("canvas");var a;return function(e,t,o,n){const a=o/n,{width:r,height:i}=e,s=r/i,d=s>=a,l=d?o:n*s,c=d?o/s:n;t.width=l,t.height=c,t.getContext("2d").drawImage(e,0,0,r,i,0,0,l,c),t.toDataURL()}(o,n,e,t),await(a=n,new Promise((function(e,t){a.toBlob((function(o){o?e(o):t()}))})))})(b.maxWidth,b.maxHeight).then((e=>{s({type:"capture-ok",screenshot:e})}),(()=>{s({type:"capture-failed"})}));break;case"inspect-data-value":((e,t)=>{try{const{dataType:o}=t;let n,a,r;if("state"===o&&(n=A(),!n))return void s({type:"inspect-data-value-error",data:{error:{message:"tplStateStoreId not found, unable to preview STATE value"}}});if(e)r="inspect-single-data-value-success",a=x.getContextValue(e,{tplStateStoreId:n});else{r="inspect-all-data-values-success";const e=x.getAllContextValues({tplStateStoreId:n});a=Object.entries(e).map((e=>{let[t,o]=e;return{name:t,value:o}}))}s({type:r,data:{name:e,value:a}})}catch(e){s({type:"inspect-data-value-error",data:{message:e.message}})}})(b.name,b.option);break;case"update-preview-url":{const e=b.previewUrl.startsWith(window.origin)?b.previewUrl.substring(window.origin.length):b.previewUrl,t=(0,n.getBasePath)(),o=e.startsWith(t)?e.substring(t.length-1):e;S().push(o);break}case"update-preview-route":t.routePath=b.routePath,t.routeExact=b.routeExact,B();break;case"debug-data-value":(async(e,o,n)=>{try{o&&E.collectDebugContract([o]);const a=await x.debugDataValue(e,{tplStateStoreId:"state"===n.dataType?A():void 0,routeId:t.routeId});s({type:"debug-data-value-success",data:{debugConf:e,value:a}})}catch(e){s({type:"debug-data-value-error",data:e instanceof a.HttpResponseError?e.responseJson:{message:e.message}})}})(b.debugData,b.contractData,b.options);break;case"excute-proxy-method":{const[e,t,o=[]]=b.proxyMethodArgs;try{const n=document.body.querySelector(e)[t](...o);window.parent.postMessage({sender:"previewer",type:"excute-proxy-method-success",data:{method:t,res:n}})}catch(e){window.parent.postMessage({sender:"previewer",type:"excute-proxy-method-error",data:{method:t,res:e.message}})}break}}})),window.addEventListener("scroll",(()=>{s({type:"scroll",scroll:{x:window.scrollX,y:window.scrollY}})}));let _,H=!0;const V=e=>{s({type:"url-change",url:location.origin+O.createHref(e)}),_=e,B()};function B(){if(t.routePath){const e=!!I(_.pathname,{path:t.routePath,exact:t.routeExact});if(s({type:"route-match-change",match:e}),t.templateId&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(M(),t.disconnect())}));t.observe(e,{childList:!0})}if(t.formId&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(q(),t.disconnect())}));t.observe(e,{childList:!0})}if(t.snippetData&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(R(),t.disconnect())}));t.observe(e,{childList:!0})}H=e}}function j(){var e;const t=document.querySelector("eo-page-view"),o=(null==t||null===(e=t.shadowRoot)||void 0===e?void 0:e.querySelector(".content"))??null;var n;o!==P&&(null===(n=P)||void 0===n||n.removeEventListener("scroll",F),null==o||o.addEventListener("scroll",F),P=o,C=t)}function F(){s({type:"content-scroll",scroll:{x:this.scrollLeft,y:this.scrollTop}})}V(O.location),O.listen(V),t.templateId&&M(),(t.formId||t.formData)&&q(),t.snippetData&&R();const U=()=>{var e;const o=t.routeId,n=x.getLegalRuntimeValue({routeId:o});s({type:"inspect-runtime-data-value",data:{...(0,i.omit)(n,"query"),query:n.query?Object.fromEntries(n.query.entries()):{},path:null===(e=n.match)||void 0===e?void 0:e.params}})};let W;function Y(e){const o=t.templateId?A():void 0;var n,a;(W!==o||e)&&(W=o,null===(n=(a=x).setRealTimeDataInspectRoot)||void 0===n||n.call(a,{tplStateStoreId:o}))}null===(o=(r=x).addRealTimeDataInspectHook)||void 0===o||o.call(r,(e=>{let{changeType:t,tplStateStoreId:o,detail:n}=e;s({type:"real-time-data-inspect-change",changeType:t,tplStateStoreId:o,detail:"update"===t?{name:n.name,annotation:f(n.value)}:{data:Object.fromEntries(Object.entries(n.data).map((e=>{let[t,o]=e;return[t,f(o)]})))}})})),window.addEventListener("route.render",(()=>{Y(!0),U()})),j(),Y(!0),U(),new MutationObserver((0,i.throttle)((()=>{j(),Y(),u&&D("hover",u,g),k&&D("active",k,L)}),100,{leading:!1})).observe(document.body,{subtree:!0,childList:!0})}function T(e,t){if(!e)return[];const o=e.includes("#"),n=function(e,t){return e.map((e=>{var o;const n=null===(o=C)||void 0===o?void 0:o.contains(e),{width:a,height:r,left:i,top:s}=e.getBoundingClientRect();return{width:a,height:r,left:i+window.scrollX+(n?P.scrollLeft:0),top:s+window.scrollY+(n?P.scrollTop:0),alias:t,hasContentScroll:n}}))}(N(e,o),t);return o?n.map((e=>({...e,height:window.innerHeight-e.top}))):n}function N(e,t){const o=[];return function n(a){const r=a.querySelectorAll(t?e:`[data-iid="${e}"]`);if(o.push(...r),!(a===document&&r.length>0))for(const e of a.querySelectorAll("*"))e.shadowRoot&&n(e.shadowRoot)}(document),o}function A(){var e;const t=document.querySelector("#main-mount-point");return null==t||null===(e=t.firstChild)||void 0===e?void 0:e.dataset[k?"tplContextId":"tplStateStoreId"]}}}]);
2
+ //# sourceMappingURL=9027.ae3dd6a1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/9027.58391f17.js","mappings":"wMAgCO,SAASA,EAAqBC,GACnC,MAAMC,EArBR,SAAiBC,GACf,MAAMD,EAAa,IAAIE,IAgBvB,OAdAC,EAAAA,EAAAA,GAASF,GAAcG,IACrB,OAAQA,EAAKC,MACX,IAAK,aACL,IAAK,eAAgB,KAAAC,EACnB,MAAMC,EACI,QADOD,EACfF,EAAKI,WAAG,IAAAF,OAAA,EADUA,EAEjBC,YACCA,GACFP,EAAWS,IAAIF,EAEnB,EACF,IAGKP,CACT,CAGqBU,EAAQC,EAAAA,EAAAA,IAAgBZ,IAErCa,EAAY,GAElB,IAAK,MAAMC,KAAQb,EACba,EAAKC,SAAS,MAChBF,EAAUG,KAAKF,GAInB,OAAOD,CACT,CAEAI,eAAeC,OACb,yCACAC,EAAAA,EAAAA,qBAAoBpB,G,yGCvCf,IAAIqB,EAsCX,SAASC,EAAQC,GACfA,EAAMC,iBACND,EAAME,kBAmFR,SAAqBC,GACnB,MAAMC,EAAUC,EAAwBF,GACpCC,EAAQE,OAAS,GACnBC,OAAOC,OAA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ASrO,EAAM,cAAcA,OAK/B,GAHAsO,EAAS3Q,QAAQsR,KAGbD,IAASvJ,UAAYwJ,EAAW1Q,OAAS,GAK7C,IAAK,MAAMd,KAAQuR,EAAKE,iBAAiB,KACnCzR,EAAKiP,YACPqC,EAAKtR,EAAKiP,WAGhB,CAEAqC,CAAKtJ,UAEE6I,CACT,CAuBA,SAAS/E,IAA6C,IAAA4F,EACpD,MAAMpD,EAAiBtG,SAASuF,cAAc,qBAE9C,OAAQe,SAA0B,QAAZoD,EAAdpD,EAAgBI,kBAAU,IAAAgD,OAAA,EAA3BA,EAA6CpP,QAClDe,EAAO,eAAiB,kBAE5B,C","sources":["webpack:///./src/data-providers/collect-used-contracts.ts","webpack:///./src/data-providers/preview/inspector.ts","webpack:///./src/data-providers/preview/realTimeDataInspect.ts","webpack:///./src/data-providers/preview/connect.ts","webpack:///./src/data-providers/preview/capture.ts","webpack:///./src/data-providers/preview/resizeScreenshot.ts"],"sourcesContent":["import { createProviderClass } from \"@next-core/utils/general\";\nimport {\n type StoryboardNode,\n parseStoryboard,\n traverse,\n} from \"@next-core/storyboard\";\nimport {\n Storyboard,\n UseProviderResolveConf,\n UseProviderEventHandler,\n} from \"@next-core/types\";\n\nfunction collect(nodeOrNodes: StoryboardNode | StoryboardNode[]): Set<string> {\n const collection = new Set<string>();\n\n traverse(nodeOrNodes, (node) => {\n switch (node.type) {\n case \"Resolvable\":\n case \"EventHandler\": {\n const useProvider = (\n node.raw as UseProviderResolveConf | UseProviderEventHandler\n )?.useProvider;\n if (useProvider) {\n collection.add(useProvider);\n }\n }\n }\n });\n\n return collection;\n}\n\nexport function collectUsedContracts(storyboard: Storyboard): string[] {\n const collection = collect(parseStoryboard(storyboard as any));\n\n const contracts = [];\n\n for (const item of collection) {\n if (item.includes(\"@\")) {\n contracts.push(item);\n }\n }\n\n return contracts;\n}\n\ncustomElements.define(\n \"visual-builder.collect-used-contracts\",\n createProviderClass(collectUsedContracts)\n);\n","// istanbul ignore file: working in progress\n// https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-devtools-shared/src/backend/views/Highlighter/index.js\nimport { throttle } from \"lodash\";\nimport type {\n PreviewMessagePreviewerHoverOnBrick,\n PreviewMessagePreviewerSelectBrick,\n PreviewMessagePreviewerContextMenuOnBrick,\n} from \"./interfaces.js\";\n\nexport let previewProxyOrigin: string;\n\nexport function setPreviewFromOrigin(origin: string): void {\n previewProxyOrigin = origin;\n}\n\nexport function startInspecting(): void {\n registerListeners();\n}\n\nexport function stopInspecting(): void {\n unregisterListeners();\n}\n\nfunction registerListeners(): void {\n window.addEventListener(\"click\", onClick, true);\n window.addEventListener(\"mousedown\", onMouseEvent, true);\n window.addEventListener(\"mouseover\", onMouseEvent, true);\n window.addEventListener(\"mouseup\", onMouseEvent, true);\n window.addEventListener(\"pointerdown\", onPointerDown, true);\n window.addEventListener(\"pointermove\", onPointerMove, true);\n window.addEventListener(\"pointerup\", onMouseEvent, true);\n window.addEventListener(\"pointerleave\", onPointerLeave, true);\n window.addEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction unregisterListeners(): void {\n window.removeEventListener(\"click\", onClick, true);\n window.removeEventListener(\"mousedown\", onMouseEvent, true);\n window.removeEventListener(\"mouseover\", onMouseEvent, true);\n window.removeEventListener(\"mouseup\", onMouseEvent, true);\n window.removeEventListener(\"pointerdown\", onPointerDown, true);\n window.removeEventListener(\"pointermove\", onPointerMove, true);\n window.removeEventListener(\"pointerup\", onMouseEvent, true);\n window.removeEventListener(\"pointerleave\", onPointerLeave, true);\n window.removeEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n selectBrick(event.composedPath());\n}\n\nfunction onMouseEvent(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst hoverOnBrick = throttle(\n (eventTargets: EventTarget[]) => {\n const iidList = getPossibleBrickTargets(eventTargets);\n\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n }\n },\n 100,\n { leading: false }\n);\n\nfunction onPointerDown(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerMove(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerLeave(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList: [],\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n}\n\nfunction onContextMenu(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n contextMenuOnBrick(event.composedPath(), {\n x: event.clientX,\n y: event.clientY,\n });\n}\n\nfunction contextMenuOnBrick(\n eventTargets: EventTarget[],\n position: {\n x: number;\n y: number;\n }\n): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"context-menu-on-brick\",\n iidList,\n position,\n } as PreviewMessagePreviewerContextMenuOnBrick,\n previewProxyOrigin\n );\n }\n}\n\nfunction selectBrick(eventTargets: EventTarget[]): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"select-brick\",\n iidList,\n } as PreviewMessagePreviewerSelectBrick,\n previewProxyOrigin\n );\n }\n}\n\nexport function getPossibleBrickIidList(brick: HTMLElement): string[] {\n const iidList: string[] = [];\n // Traverse from bottom to up, to find bricks current hover on.\n let cursor: HTMLElement | null = brick;\n while (cursor) {\n if (typeof cursor.dataset.iid === \"string\") {\n iidList.push(cursor.dataset.iid);\n }\n cursor = cursor.parentElement;\n }\n return iidList;\n}\n\nexport function getPossibleBrickTargets(eventTargets: EventTarget[]) {\n const targets: string[] = [];\n for (const target of eventTargets) {\n if (\n target instanceof HTMLElement &&\n typeof target.dataset.iid === \"string\"\n ) {\n targets.push(target.dataset.iid);\n }\n }\n return targets;\n}\n","export function getRealTimeDataAnnotation(value: unknown) {\n const type = typeof value;\n switch (type) {\n case \"string\":\n case \"boolean\":\n case \"number\":\n return {\n type,\n value,\n };\n case \"undefined\":\n return { type };\n }\n if (value === null) {\n return { type: \"null\" };\n }\n if (Array.isArray(value)) {\n return { type: \"array\", length: value.length };\n }\n return { type: \"object\" };\n}\n","import {\n getHistory as _getHistory,\n getBasePath,\n matchPath as _matchPath,\n __secret_internals as _internals,\n type NextLocation,\n} from \"@next-core/runtime\";\nimport { HttpResponseError } from \"@next-core/http\";\nimport { flowApi as _flowAPi } from \"@next-core/easyops-runtime\";\nimport type {\n BrickConf,\n Contract,\n CustomTemplate,\n RouteConf,\n} from \"@next-core/types\";\nimport { isEmpty, throttle, omit } from \"lodash\";\nimport type {\n BrickOutline,\n HighLightNode,\n Position,\n PreviewDataOption,\n PreviewMessageFromPreviewer,\n PreviewMessagePreviewContractUpdate,\n PreviewMessagePreviewDataValueError,\n PreviewMessagePreviewDataValueSuccess,\n PreviewMessagePreviewDebugValueSuccess,\n PreviewMessagePreviewDebugValueError,\n PreviewMessagePreviewerCaptureFailed,\n PreviewMessagePreviewerCaptureOk,\n PreviewMessagePreviewerContentScroll,\n PreviewMessagePreviewerHighlightBrick,\n PreviewMessagePreviewerHighlightContext,\n PreviewMessagePreviewerHoverOnMain,\n PreviewMessagePreviewerRealTimeDataInspectChange,\n PreviewMessagePreviewerRouteMatchChange,\n PreviewMessagePreviewerScroll,\n PreviewMessagePreviewerUrlChange,\n PreviewMessageToPreviewer,\n PreviewSettings,\n PreviewStartOptions,\n PreviewDebugData,\n PreviewMessagePreviewInspectRuntimeValue,\n} from \"./interfaces.js\";\nimport { capture } from \"./capture.js\";\nimport {\n previewProxyOrigin,\n getPossibleBrickIidList,\n setPreviewFromOrigin,\n startInspecting,\n stopInspecting,\n} from \"./inspector.js\";\nimport { collectUsedContracts } from \"../collect-used-contracts.js\";\nimport { getRealTimeDataAnnotation } from \"./realTimeDataInspect.js\";\n\nlet connected = false;\n\ninterface DLL {\n (moduleId: \"tYg3\"): {\n getHistory: typeof _getHistory;\n developHelper: typeof _internals;\n collectDebugContract: typeof flowApi.collectDebugContract;\n };\n (moduleId: \"A+yw\"): {\n matchPath: typeof _matchPath;\n };\n}\n\nlet getHistory = _getHistory;\nlet matchPath = _matchPath;\nlet __secret_internals = _internals;\nlet flowApi = _flowAPi;\nlet isV2 = false;\n\n// istanbul ignore next\n// Make v3 bricks compatible with Brick Next v2.\ntry {\n const dll = (window as unknown as { dll?: DLL }).dll;\n if (\n dll &&\n window.BRICK_NEXT_VERSIONS?.[\"brick-container\"]?.startsWith(\"2.\")\n ) {\n const {\n getHistory: getHistoryV2,\n developHelper: developHelperV2,\n collectDebugContract,\n } = dll(\"tYg3\");\n const { matchPath: matchPathV2 } = dll(\"A+yw\");\n getHistory = getHistoryV2;\n matchPath = matchPathV2;\n // The `__secret_internals` of v3 has pretty the same API as\n // `developHelper` of v2, especially those for preview usage.\n __secret_internals = {\n ...developHelperV2,\n getContextValue(name, { tplStateStoreId }) {\n return developHelperV2.getContextValue(name, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n getAllContextValues({ tplStateStoreId }) {\n // V3 returns an object of key-value.\n // While v2 returns a map of ContextItem.\n const v2Map = developHelperV2.getAllContextValues({\n tplContextId: tplStateStoreId,\n } as any) as unknown as Map<string, { value: unknown }>;\n return Object.fromEntries(\n [...v2Map].map(([k, v]) => [k, (v as any).value])\n );\n },\n debugDataValue(data, { tplStateStoreId }) {\n return developHelperV2.debugDataValue(data, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n };\n\n flowApi = {\n collectDebugContract,\n } as any;\n isV2 = true;\n }\n} catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Try to use v2 runtime APIs failed:\", e);\n}\n\nlet contentScrollElement: Element | null = null;\nlet contentScrollHost: Element | null = null;\n\nexport default async function connect(\n previewFromOrigin: string,\n options: PreviewStartOptions\n) {\n if (connected) {\n return;\n }\n connected = true;\n\n const sendMessage = <T extends PreviewMessageFromPreviewer>(\n message: Omit<T, \"sender\">\n ): void => {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n ...message,\n },\n previewFromOrigin\n );\n };\n\n sendMessage({ type: \"preview-started\" });\n setPreviewFromOrigin(previewFromOrigin);\n\n let hoverIid: string;\n let hoverAlias: string;\n let activeIid: string;\n let activeAlias: string;\n\n const handleHoverOnIframe = (pos: Position): void => {\n const element = document.elementFromPoint(pos.x, pos.y);\n if (element?.tagName === \"BODY\") {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-main\",\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n } as PreviewMessagePreviewerHoverOnMain,\n previewProxyOrigin\n );\n } else {\n const iidList = getPossibleBrickIidList(element as HTMLElement);\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n },\n previewProxyOrigin\n );\n }\n };\n\n const sendHighlightBrickOutlines = (\n type: \"hover\" | \"active\",\n iid: string,\n alias: string\n ): void => {\n const outlines = getBrickOutlines(iid);\n sendMessage<PreviewMessagePreviewerHighlightBrick>({\n type: \"highlight-brick\",\n highlightType: type,\n outlines,\n iid: iid,\n alias: alias,\n });\n };\n\n const sendHighlightBricksOutlines = (nodes: HighLightNode[]): void => {\n const outlines = nodes\n .map((node) => getBrickOutlines(node.iid, node.alias))\n .flat();\n sendMessage<PreviewMessagePreviewerHighlightContext>({\n type: \"highlight-context\",\n outlines,\n });\n };\n\n let lastTemplatePreviewSettings: PreviewSettings | undefined;\n if (options.templateId) {\n lastTemplatePreviewSettings = options.settings;\n }\n\n const updateTemplatePreviewSettings = (): void => {\n __secret_internals.updateTemplatePreviewSettings(\n options.appId,\n options.templateId!,\n lastTemplatePreviewSettings\n );\n getHistory().reload();\n };\n\n const updateSnippetPreviewSettings = (): void => {\n __secret_internals.updateSnippetPreviewSettings(\n options.appId,\n JSON.parse(options.snippetData)\n );\n getHistory().reload();\n };\n\n const updateFormPreviewSettings = (): void => {\n (__secret_internals as any).updateFormPreviewSettings(\n options.appId,\n options.formId,\n options.formData\n );\n getHistory().reload();\n };\n\n const handlePreviewData = (name: string, option: PreviewDataOption): void => {\n try {\n const { dataType } = option;\n let tplStateStoreId;\n\n if (dataType === \"state\") {\n tplStateStoreId = getRootTplStateStoreId();\n\n if (!tplStateStoreId) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n error: {\n message:\n \"tplStateStoreId not found, unable to preview STATE value\",\n },\n },\n });\n\n return;\n }\n }\n\n let value, type: PreviewMessagePreviewDataValueSuccess[\"type\"];\n if (name) {\n type = \"inspect-single-data-value-success\";\n value = __secret_internals.getContextValue(name, {\n tplStateStoreId,\n });\n } else {\n type = \"inspect-all-data-values-success\";\n const data = __secret_internals.getAllContextValues({\n tplStateStoreId,\n });\n value = Object.entries(data).map(([name, value]) => ({ name, value }));\n }\n\n sendMessage<PreviewMessagePreviewDataValueSuccess>({\n type,\n data: {\n name,\n value,\n },\n });\n\n // istanbul ignore next\n } catch (error) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n message: (error as Error).message,\n },\n });\n }\n };\n\n const debugDataValue = async (\n data: PreviewDebugData,\n contractData: Contract,\n previewOption: PreviewDataOption\n ) => {\n try {\n if (contractData) {\n flowApi.collectDebugContract([contractData]);\n }\n const value = await __secret_internals.debugDataValue(data, {\n tplStateStoreId:\n previewOption.dataType === \"state\"\n ? getRootTplStateStoreId()\n : undefined,\n routeId: options.routeId,\n });\n\n sendMessage<PreviewMessagePreviewDebugValueSuccess>({\n type: \"debug-data-value-success\",\n data: {\n debugConf: data,\n value,\n },\n });\n } catch (error) {\n sendMessage<PreviewMessagePreviewDebugValueError>({\n type: \"debug-data-value-error\",\n data:\n error instanceof HttpResponseError\n ? error.responseJson\n : { message: (error as Error).message },\n });\n }\n };\n\n const history = getHistory();\n\n window.addEventListener(\n \"message\",\n async ({ data, origin }: MessageEvent<PreviewMessageToPreviewer>) => {\n if (\n origin !== previewFromOrigin ||\n !data ||\n data.sender !== \"preview-container\"\n ) {\n return;\n }\n if (data.forwardedFor === \"builder\") {\n switch (data.type) {\n case \"hover-on-brick\":\n hoverIid = data.iid;\n hoverAlias = data.alias;\n sendHighlightBrickOutlines(\"hover\", data.iid, data.alias);\n break;\n case \"hover-on-main\":\n sendHighlightBrickOutlines(\"hover\", \"#main-mount-point\", \"root\");\n break;\n case \"hover-on-context\":\n sendHighlightBricksOutlines(data.highlightNodes);\n break;\n case \"select-brick\":\n activeIid = data.iid;\n activeAlias = data.alias;\n sendHighlightBrickOutlines(\"active\", data.iid, data.alias);\n break;\n case \"hover-on-iframe\":\n handleHoverOnIframe(data.position);\n break;\n }\n } else\n switch (data.type) {\n case \"toggle-inspecting\":\n data.enabled ? startInspecting() : stopInspecting();\n break;\n case \"refresh\":\n if (data.options?.updateStoryboardType) {\n if (data.options.updateStoryboardType === \"route\") {\n __secret_internals.updateStoryboardByRoute(\n options.appId,\n data.storyboardPatch as RouteConf\n );\n } else if (data.options.updateStoryboardType === \"template\") {\n __secret_internals.updateStoryboardByTemplate(\n options.appId,\n data.storyboardPatch as CustomTemplate,\n data.options.settings\n );\n } else if (data.options.updateStoryboardType === \"snippet\") {\n __secret_internals.updateStoryboardBySnippet(\n options.appId,\n data.storyboardPatch as {\n snippetId: string;\n bricks: BrickConf[];\n }\n );\n } else if (data.options.updateStoryboardType === \"form\") {\n (__secret_internals as any).updateFormPreviewSettings(\n options.appId,\n options.formId,\n data.storyboardPatch\n );\n }\n\n let newContracts;\n if (data.options?.updateStoryboardType !== \"form\") {\n newContracts = await (\n __secret_internals as any\n ).getAddedContracts?.(data.storyboardPatch, {\n appId: options.appId,\n updateStoryboardType: data.options.updateStoryboardType,\n formId: options.formId,\n collectUsedContracts,\n });\n }\n\n if (!isEmpty(newContracts)) {\n sendMessage<PreviewMessagePreviewContractUpdate>({\n type: \"contract-update\",\n data: {\n add: newContracts,\n },\n });\n } else {\n getHistory().reload();\n }\n\n break;\n }\n __secret_internals.updateStoryboard(\n options.appId,\n data.storyboardPatch\n );\n if (options.templateId) {\n lastTemplatePreviewSettings = data.settings;\n updateTemplatePreviewSettings();\n } else if (options.formId || options.formData) {\n updateFormPreviewSettings();\n } else if (data.options?.snippetData) {\n options.snippetData = data.options.snippetData;\n updateSnippetPreviewSettings();\n } else {\n getHistory().reload();\n }\n break;\n case \"reload\":\n location.reload();\n break;\n case \"back\":\n history.goBack();\n break;\n case \"forward\":\n history.goForward();\n break;\n case \"capture\":\n capture(data.maxWidth, data.maxHeight).then(\n (screenshot) => {\n sendMessage<PreviewMessagePreviewerCaptureOk>({\n type: \"capture-ok\",\n screenshot,\n });\n },\n () => {\n sendMessage<PreviewMessagePreviewerCaptureFailed>({\n type: \"capture-failed\",\n });\n }\n );\n break;\n case \"inspect-data-value\":\n handlePreviewData(data.name, data.option);\n break;\n case \"update-preview-url\": {\n // Remove origin first.\n const url = data.previewUrl.startsWith(window.origin)\n ? data.previewUrl.substring(window.origin.length)\n : data.previewUrl;\n // Then remove base path.\n const basePath = getBasePath();\n const to = url.startsWith(basePath)\n ? url.substring(basePath.length - 1)\n : url;\n getHistory().push(to);\n break;\n }\n case \"update-preview-route\": {\n options.routePath = data.routePath;\n options.routeExact = data.routeExact;\n syncRouteMatch();\n break;\n }\n case \"debug-data-value\":\n debugDataValue(data.debugData, data.contractData, data.options);\n break;\n case \"excute-proxy-method\": {\n const [ref, method, args = []] = data.proxyMethodArgs;\n try {\n const result = document.body.querySelector(ref)[method](...args);\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-success\",\n data: { method: method, res: result },\n });\n } catch (err) {\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-error\",\n data: { method: method, res: (err as Error).message },\n });\n }\n break;\n }\n }\n }\n );\n\n window.addEventListener(\"scroll\", () => {\n sendMessage<PreviewMessagePreviewerScroll>({\n type: \"scroll\",\n scroll: {\n x: window.scrollX,\n y: window.scrollY,\n },\n });\n });\n\n let previewPageMatch = true;\n let currentLocation: NextLocation;\n const sendLocationChange = (loc: NextLocation): void => {\n sendMessage<PreviewMessagePreviewerUrlChange>({\n type: \"url-change\",\n url: location.origin + history.createHref(loc),\n });\n currentLocation = loc;\n syncRouteMatch();\n };\n\n function syncRouteMatch() {\n if (options.routePath) {\n const match = !!matchPath(currentLocation.pathname, {\n path: options.routePath,\n exact: options.routeExact,\n });\n sendMessage<PreviewMessagePreviewerRouteMatchChange>({\n type: \"route-match-change\",\n match,\n });\n\n // Re-update template preview settings once match route again (typically after login).\n if (options.templateId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateTemplatePreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n if (options.formId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\");\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild.childNodes.length === 0\n ) {\n updateFormPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n if (options.snippetData && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateSnippetPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n previewPageMatch = match;\n }\n }\n\n sendLocationChange(history.location);\n\n history.listen(sendLocationChange);\n\n if (options.templateId) {\n updateTemplatePreviewSettings();\n }\n\n if (options.formId || options.formData) {\n updateFormPreviewSettings();\n }\n\n if (options.snippetData) {\n updateSnippetPreviewSettings();\n }\n\n function setupContentScroll() {\n const host = document.querySelector(\"eo-page-view\");\n const element = host?.shadowRoot?.querySelector(\".content\") ?? null;\n if (element !== contentScrollElement) {\n contentScrollElement?.removeEventListener(\"scroll\", onContentScroll);\n element?.addEventListener(\"scroll\", onContentScroll);\n contentScrollElement = element;\n contentScrollHost = host;\n }\n }\n\n function onContentScroll(this: Element) {\n sendMessage<PreviewMessagePreviewerContentScroll>({\n type: \"content-scroll\",\n scroll: {\n x: this.scrollLeft,\n y: this.scrollTop,\n },\n });\n }\n\n const setupRuntimeValueInspect = () => {\n const routeId = options.routeId;\n\n const data = __secret_internals.getLegalRuntimeValue({ routeId });\n sendMessage<PreviewMessagePreviewInspectRuntimeValue>({\n type: \"inspect-runtime-data-value\",\n data: {\n ...omit(data, \"query\"),\n query: data.query ? Object.fromEntries(data.query.entries()) : {},\n path: data.match?.params,\n },\n });\n };\n\n __secret_internals.addRealTimeDataInspectHook?.(\n ({ changeType, tplStateStoreId, detail }) => {\n sendMessage<PreviewMessagePreviewerRealTimeDataInspectChange>({\n type: \"real-time-data-inspect-change\",\n changeType,\n tplStateStoreId,\n detail:\n changeType === \"update\"\n ? {\n name: detail.name,\n annotation: getRealTimeDataAnnotation(detail.value),\n }\n : {\n data: Object.fromEntries(\n Object.entries(detail.data).map(([k, v]) => [\n k,\n getRealTimeDataAnnotation(v),\n ])\n ),\n },\n });\n }\n );\n\n let memoizedRootTplStateStoreId: string | undefined;\n\n function setupRealTimeDataInspect(force?: boolean) {\n const tplStateStoreId = options.templateId\n ? getRootTplStateStoreId()\n : undefined;\n if (memoizedRootTplStateStoreId !== tplStateStoreId || force) {\n memoizedRootTplStateStoreId = tplStateStoreId;\n __secret_internals.setRealTimeDataInspectRoot?.({\n tplStateStoreId,\n });\n }\n }\n\n window.addEventListener(\"route.render\", () => {\n setupRealTimeDataInspect(true);\n setupRuntimeValueInspect();\n });\n\n setupContentScroll();\n setupRealTimeDataInspect(true);\n setupRuntimeValueInspect();\n\n const mutationCallback = (): void => {\n setupContentScroll();\n setupRealTimeDataInspect();\n if (hoverIid) {\n sendHighlightBrickOutlines(\"hover\", hoverIid, hoverAlias);\n }\n if (activeIid) {\n sendHighlightBrickOutlines(\"active\", activeIid, activeAlias);\n }\n };\n const mutationObserver = new MutationObserver(\n throttle(mutationCallback, 100, { leading: false })\n );\n mutationObserver.observe(document.body, { subtree: true, childList: true });\n}\n\nfunction getBrickOutlines(iid: string, alias?: string): BrickOutline[] {\n if (!iid) {\n return [];\n }\n const isRoot = iid.includes(\"#\");\n const elements = getElementsIncludingInShadowDOM(iid, isRoot);\n const outlines = getOutlines(elements, alias);\n return isRoot\n ? outlines.map((item) => ({\n ...item,\n height: window.innerHeight - item.top,\n }))\n : outlines;\n}\n\nexport function getElementsIncludingInShadowDOM(\n iid: string,\n isRoot?: boolean\n): HTMLElement[] {\n const elements: HTMLElement[] = [];\n\n function walk(root: Document | ShadowRoot) {\n const candidates = root.querySelectorAll<HTMLElement>(\n isRoot ? iid : `[data-iid=\"${iid}\"]`\n );\n elements.push(...candidates);\n\n // If elements are found in the document, we should stop searching in shadow DOM.\n if (root === document && candidates.length > 0) {\n return;\n }\n\n // These useBrick in v3 bricks will be inside shadow DOM.\n for (const item of root.querySelectorAll(\"*\")) {\n if (item.shadowRoot) {\n walk(item.shadowRoot);\n }\n }\n }\n\n walk(document);\n\n return elements;\n}\n\nfunction getOutlines(elements: HTMLElement[], alias?: string): BrickOutline[] {\n return elements.map((element) => {\n const hasContentScroll = contentScrollHost?.contains(element);\n const { width, height, left, top } = element.getBoundingClientRect();\n return {\n width,\n height,\n left:\n left +\n window.scrollX +\n (hasContentScroll ? contentScrollElement.scrollLeft : 0),\n top:\n top +\n window.scrollY +\n (hasContentScroll ? contentScrollElement.scrollTop : 0),\n alias,\n hasContentScroll,\n };\n });\n}\n\nfunction getRootTplStateStoreId(): string | undefined {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n\n return (mainMountPoint?.firstChild as HTMLElement)?.dataset[\n isV2 ? \"tplContextId\" : \"tplStateStoreId\"\n ];\n}\n","// istanbul ignore file: nothing logical except calling html2canvas.\nimport html2canvas from \"html2canvas\";\nimport { resizeScreenshot } from \"./resizeScreenshot.js\";\n\nfunction getCanvasBlob(canvas: HTMLCanvasElement): Promise<Blob> {\n return new Promise(function (resolve, reject) {\n canvas.toBlob(function (blob: Blob | null) {\n if (blob) {\n resolve(blob);\n } else {\n reject();\n }\n });\n });\n}\n\nexport async function capture(\n maxWidth: number,\n maxHeight: number\n): Promise<Blob> {\n const sourceCanvas = await html2canvas(document.body, {\n logging: false,\n scale: 1,\n width: window.innerWidth,\n height: window.innerHeight,\n foreignObjectRendering: true,\n });\n const targetCanvas = document.createElement(\"canvas\");\n resizeScreenshot(sourceCanvas, targetCanvas, maxWidth, maxHeight);\n const blob = await getCanvasBlob(targetCanvas);\n return blob;\n}\n","export function resizeScreenshot(\n canvas: HTMLCanvasElement,\n targetCanvas: HTMLCanvasElement,\n maxWidth: number,\n maxHeight: number\n): string {\n const targetRatio = maxWidth / maxHeight;\n const { width, height } = canvas;\n const ratio = width / height;\n const wider = ratio >= targetRatio;\n const finalWidth = wider ? maxWidth : maxHeight * ratio;\n const finalHeight = wider ? maxWidth / ratio : maxHeight;\n targetCanvas.width = finalWidth;\n targetCanvas.height = finalHeight;\n\n const ctx = targetCanvas.getContext(\"2d\")!;\n ctx.drawImage(canvas, 0, 0, width, height, 0, 0, finalWidth, finalHeight);\n return targetCanvas.toDataURL();\n}\n"],"names":["collectUsedContracts","storyboard","collection","nodeOrNodes","Set","traverse","node","type","_node$raw","useProvider","raw","add","collect","parseStoryboard","contracts","item","includes","push","customElements","define","createProviderClass","previewProxyOrigin","onClick","event","preventDefault","stopPropagation","eventTargets","iidList","getPossibleBrickTargets","length","window","parent","postMessage","sender","selectBrick","composedPath","onMouseEvent","hoverOnBrick","throttle","leading","onPointerDown","onPointerMove","onPointerLeave","onContextMenu","position","contextMenuOnBrick","x","clientX","y","clientY","targets","target","HTMLElement","dataset","iid","getRealTimeDataAnnotation","value","Array","isArray","connected","getHistory","_getHistory","matchPath","_matchPath","__secret_internals","_internals","flowApi","_flowAPi","isV2","_window$BRICK_NEXT_VE","dll","BRICK_NEXT_VERSIONS","startsWith","getHistoryV2","developHelper","developHelperV2","collectDebugContract","matchPathV2","getContextValue","name","_ref","tplStateStoreId","tplContextId","getAllContextValues","_ref2","v2Map","Object","fromEntries","map","_ref3","k","v","debugDataValue","data","_ref4","e","console","error","contentScrollElement","contentScrollHost","async","connect","previewFromOrigin","options","_secret_internals$ad","_secret_internals","sendMessage","message","hoverIid","hoverAlias","activeIid","activeAlias","sendHighlightBrickOutlines","alias","outlines","getBrickOutlines","highlightType","lastTemplatePreviewSettings","templateId","settings","updateTemplatePreviewSettings","appId","reload","updateSnippetPreviewSettings","JSON","parse","snippetData","updateFormPreviewSettings","formId","formData","history","addEventListener","_data$options","_data$options3","origin","_ref6","forwardedFor","nodes","flat","sendHighlightBricksOutlines","highlightNodes","pos","element","document","elementFromPoint","tagName","isDirection","brick","cursor","parentElement","getPossibleBrickIidList","handleHoverOnIframe","enabled","removeEventListener","updateStoryboardType","_data$options2","newContracts","_getAddedContracts","_ref7","updateStoryboardByRoute","storyboardPatch","updateStoryboardByTemplate","updateStoryboardBySnippet","getAddedContracts","call","isEmpty","updateStoryboard","location","goBack","goForward","maxWidth","maxHeight","sourceCanvas","html2canvas","body","logging","scale","width","innerWidth","height","innerHeight","foreignObjectRendering","targetCanvas","createElement","canvas","targetRatio","ratio","wider","finalWidth","finalHeight","getContext","drawImage","toDataURL","resizeScreenshot","Promise","resolve","reject","toBlob","blob","capture","then","screenshot","handlePreviewData","option","dataType","getRootTplStateStoreId","entries","_ref5","url","previewUrl","substring","basePath","getBasePath","to","routePath","routeExact","syncRouteMatch","contractData","previewOption","undefined","routeId","debugConf","HttpResponseError","responseJson","debugData","ref","method","args","proxyMethodArgs","result","querySelector","res","err","scroll","scrollX","scrollY","currentLocation","previewPageMatch","sendLocationChange","loc","createHref","match","pathname","path","exact","mainMountPoint","placeholderLoadObserver","MutationObserver","childNodes","firstChild","disconnect","observe","childList","setupContentScroll","_host$shadowRoot","host","shadowRoot","_contentScrollElement","onContentScroll","this","scrollLeft","scrollTop","listen","setupRuntimeValueInspect","_data$match","getLegalRuntimeValue","omit","query","params","memoizedRootTplStateStoreId","setupRealTimeDataInspect","force","_secret_internals$se","_secret_internals2","setRealTimeDataInspectRoot","addRealTimeDataInspectHook","_ref8","changeType","detail","annotation","_ref9","mutationCallback","subtree","isRoot","elements","_contentScrollHost","hasContentScroll","contains","left","top","getBoundingClientRect","getOutlines","getElementsIncludingInShadowDOM","walk","root","candidates","querySelectorAll","_mainMountPoint$first"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/9027.ae3dd6a1.js","mappings":"wMAgCO,SAASA,EAAqBC,GACnC,MAAMC,EArBR,SAAiBC,GACf,MAAMD,EAAa,IAAIE,IAgBvB,OAdAC,EAAAA,EAAAA,GAASF,GAAcG,IACrB,OAAQA,EAAKC,MACX,IAAK,aACL,IAAK,eAAgB,KAAAC,EACnB,MAAMC,EACI,QADOD,EACfF,EAAKI,WAAG,IAAAF,OAAA,EADUA,EAEjBC,YACCA,GACFP,EAAWS,IAAIF,EAEnB,EACF,IAGKP,CACT,CAG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,OAAO6M,SACNmD,EAAmB5L,EAAqBmK,UAAY,GACvDpJ,QACA6K,mBACD,GAEL,CA1DmBK,CADAC,EAAgC9O,EAAKqO,GACf1K,GACvC,OAAO0K,EACHzK,EAAS1B,KAAKzE,IAAI,IACbA,EACHoK,OAAQrJ,OAAOsJ,YAAcrK,EAAKkR,QAEpC/K,CACN,CAEO,SAASkL,EACd9O,EACAqO,GAEA,MAAMC,EAA0B,GAuBhC,OArBA,SAASS,EAAKC,GACZ,MAAMC,EAAaD,EAAKE,iBACtBb,EAASrO,EAAM,cAAcA,OAK/B,GAHAsO,EAAS3Q,QAAQsR,KAGbD,IAASvJ,UAAYwJ,EAAW1Q,OAAS,GAK7C,IAAK,MAAMd,KAAQuR,EAAKE,iBAAiB,KACnCzR,EAAKiP,YACPqC,EAAKtR,EAAKiP,WAGhB,CAEAqC,CAAKtJ,UAEE6I,CACT,CAuBA,SAAS/E,IAA6C,IAAA4F,EACpD,MAAMpD,EAAiBtG,SAASuF,cAAc,qBAE9C,OAAQe,SAA0B,QAAZoD,EAAdpD,EAAgBI,kBAAU,IAAAgD,OAAA,EAA3BA,EAA6CpP,QAClDe,EAAO,eAAiB,kBAE5B,C","sources":["webpack:///./src/data-providers/collect-used-contracts.ts","webpack:///./src/data-providers/preview/inspector.ts","webpack:///./src/data-providers/preview/realTimeDataInspect.ts","webpack:///./src/data-providers/preview/connect.ts","webpack:///./src/data-providers/preview/capture.ts","webpack:///./src/data-providers/preview/resizeScreenshot.ts"],"sourcesContent":["import { createProviderClass } from \"@next-core/utils/general\";\nimport {\n type StoryboardNode,\n parseStoryboard,\n traverse,\n} from \"@next-core/storyboard\";\nimport {\n Storyboard,\n UseProviderResolveConf,\n UseProviderEventHandler,\n} from \"@next-core/types\";\n\nfunction collect(nodeOrNodes: StoryboardNode | StoryboardNode[]): Set<string> {\n const collection = new Set<string>();\n\n traverse(nodeOrNodes, (node) => {\n switch (node.type) {\n case \"Resolvable\":\n case \"EventHandler\": {\n const useProvider = (\n node.raw as UseProviderResolveConf | UseProviderEventHandler\n )?.useProvider;\n if (useProvider) {\n collection.add(useProvider);\n }\n }\n }\n });\n\n return collection;\n}\n\nexport function collectUsedContracts(storyboard: Storyboard): string[] {\n const collection = collect(parseStoryboard(storyboard as any));\n\n const contracts = [];\n\n for (const item of collection) {\n if (item.includes(\"@\")) {\n contracts.push(item);\n }\n }\n\n return contracts;\n}\n\ncustomElements.define(\n \"visual-builder.collect-used-contracts\",\n createProviderClass(collectUsedContracts)\n);\n","// istanbul ignore file: working in progress\n// https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-devtools-shared/src/backend/views/Highlighter/index.js\nimport { throttle } from \"lodash\";\nimport type {\n PreviewMessagePreviewerHoverOnBrick,\n PreviewMessagePreviewerSelectBrick,\n PreviewMessagePreviewerContextMenuOnBrick,\n} from \"./interfaces.js\";\n\nexport let previewProxyOrigin: string;\n\nexport function setPreviewFromOrigin(origin: string): void {\n previewProxyOrigin = origin;\n}\n\nexport function startInspecting(): void {\n registerListeners();\n}\n\nexport function stopInspecting(): void {\n unregisterListeners();\n}\n\nfunction registerListeners(): void {\n window.addEventListener(\"click\", onClick, true);\n window.addEventListener(\"mousedown\", onMouseEvent, true);\n window.addEventListener(\"mouseover\", onMouseEvent, true);\n window.addEventListener(\"mouseup\", onMouseEvent, true);\n window.addEventListener(\"pointerdown\", onPointerDown, true);\n window.addEventListener(\"pointermove\", onPointerMove, true);\n window.addEventListener(\"pointerup\", onMouseEvent, true);\n window.addEventListener(\"pointerleave\", onPointerLeave, true);\n window.addEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction unregisterListeners(): void {\n window.removeEventListener(\"click\", onClick, true);\n window.removeEventListener(\"mousedown\", onMouseEvent, true);\n window.removeEventListener(\"mouseover\", onMouseEvent, true);\n window.removeEventListener(\"mouseup\", onMouseEvent, true);\n window.removeEventListener(\"pointerdown\", onPointerDown, true);\n window.removeEventListener(\"pointermove\", onPointerMove, true);\n window.removeEventListener(\"pointerup\", onMouseEvent, true);\n window.removeEventListener(\"pointerleave\", onPointerLeave, true);\n window.removeEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n selectBrick(event.composedPath());\n}\n\nfunction onMouseEvent(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst hoverOnBrick = throttle(\n (eventTargets: EventTarget[]) => {\n const iidList = getPossibleBrickTargets(eventTargets);\n\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n }\n },\n 100,\n { leading: false }\n);\n\nfunction onPointerDown(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerMove(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerLeave(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList: [],\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n}\n\nfunction onContextMenu(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n contextMenuOnBrick(event.composedPath(), {\n x: event.clientX,\n y: event.clientY,\n });\n}\n\nfunction contextMenuOnBrick(\n eventTargets: EventTarget[],\n position: {\n x: number;\n y: number;\n }\n): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"context-menu-on-brick\",\n iidList,\n position,\n } as PreviewMessagePreviewerContextMenuOnBrick,\n previewProxyOrigin\n );\n }\n}\n\nfunction selectBrick(eventTargets: EventTarget[]): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"select-brick\",\n iidList,\n } as PreviewMessagePreviewerSelectBrick,\n previewProxyOrigin\n );\n }\n}\n\nexport function getPossibleBrickIidList(brick: HTMLElement): string[] {\n const iidList: string[] = [];\n // Traverse from bottom to up, to find bricks current hover on.\n let cursor: HTMLElement | null = brick;\n while (cursor) {\n if (typeof cursor.dataset.iid === \"string\") {\n iidList.push(cursor.dataset.iid);\n }\n cursor = cursor.parentElement;\n }\n return iidList;\n}\n\nexport function getPossibleBrickTargets(eventTargets: EventTarget[]) {\n const targets: string[] = [];\n for (const target of eventTargets) {\n if (\n target instanceof HTMLElement &&\n typeof target.dataset.iid === \"string\"\n ) {\n targets.push(target.dataset.iid);\n }\n }\n return targets;\n}\n","export function getRealTimeDataAnnotation(value: unknown) {\n const type = typeof value;\n switch (type) {\n case \"string\":\n case \"boolean\":\n case \"number\":\n return {\n type,\n value,\n };\n case \"undefined\":\n return { type };\n }\n if (value === null) {\n return { type: \"null\" };\n }\n if (Array.isArray(value)) {\n return { type: \"array\", length: value.length };\n }\n return { type: \"object\" };\n}\n","import {\n getHistory as _getHistory,\n getBasePath,\n matchPath as _matchPath,\n __secret_internals as _internals,\n type NextLocation,\n} from \"@next-core/runtime\";\nimport { HttpResponseError } from \"@next-core/http\";\nimport { flowApi as _flowAPi } from \"@next-core/easyops-runtime\";\nimport type {\n BrickConf,\n Contract,\n CustomTemplate,\n RouteConf,\n} from \"@next-core/types\";\nimport { isEmpty, throttle, omit } from \"lodash\";\nimport type {\n BrickOutline,\n HighLightNode,\n Position,\n PreviewDataOption,\n PreviewMessageFromPreviewer,\n PreviewMessagePreviewContractUpdate,\n PreviewMessagePreviewDataValueError,\n PreviewMessagePreviewDataValueSuccess,\n PreviewMessagePreviewDebugValueSuccess,\n PreviewMessagePreviewDebugValueError,\n PreviewMessagePreviewerCaptureFailed,\n PreviewMessagePreviewerCaptureOk,\n PreviewMessagePreviewerContentScroll,\n PreviewMessagePreviewerHighlightBrick,\n PreviewMessagePreviewerHighlightContext,\n PreviewMessagePreviewerHoverOnMain,\n PreviewMessagePreviewerRealTimeDataInspectChange,\n PreviewMessagePreviewerRouteMatchChange,\n PreviewMessagePreviewerScroll,\n PreviewMessagePreviewerUrlChange,\n PreviewMessageToPreviewer,\n PreviewSettings,\n PreviewStartOptions,\n PreviewDebugData,\n PreviewMessagePreviewInspectRuntimeValue,\n} from \"./interfaces.js\";\nimport { capture } from \"./capture.js\";\nimport {\n previewProxyOrigin,\n getPossibleBrickIidList,\n setPreviewFromOrigin,\n startInspecting,\n stopInspecting,\n} from \"./inspector.js\";\nimport { collectUsedContracts } from \"../collect-used-contracts.js\";\nimport { getRealTimeDataAnnotation } from \"./realTimeDataInspect.js\";\n\nlet connected = false;\n\ninterface DLL {\n (moduleId: \"tYg3\"): {\n getHistory: typeof _getHistory;\n developHelper: typeof _internals;\n collectDebugContract: typeof flowApi.collectDebugContract;\n };\n (moduleId: \"A+yw\"): {\n matchPath: typeof _matchPath;\n };\n}\n\nlet getHistory = _getHistory;\nlet matchPath = _matchPath;\nlet __secret_internals = _internals;\nlet flowApi = _flowAPi;\nlet isV2 = false;\n\n// istanbul ignore next\n// Make v3 bricks compatible with Brick Next v2.\ntry {\n const dll = (window as unknown as { dll?: DLL }).dll;\n if (\n dll &&\n window.BRICK_NEXT_VERSIONS?.[\"brick-container\"]?.startsWith(\"2.\")\n ) {\n const {\n getHistory: getHistoryV2,\n developHelper: developHelperV2,\n collectDebugContract,\n } = dll(\"tYg3\");\n const { matchPath: matchPathV2 } = dll(\"A+yw\");\n getHistory = getHistoryV2;\n matchPath = matchPathV2;\n // The `__secret_internals` of v3 has pretty the same API as\n // `developHelper` of v2, especially those for preview usage.\n __secret_internals = {\n ...developHelperV2,\n getContextValue(name, { tplStateStoreId }) {\n return developHelperV2.getContextValue(name, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n getAllContextValues({ tplStateStoreId }) {\n // V3 returns an object of key-value.\n // While v2 returns a map of ContextItem.\n const v2Map = developHelperV2.getAllContextValues({\n tplContextId: tplStateStoreId,\n } as any) as unknown as Map<string, { value: unknown }>;\n return Object.fromEntries(\n [...v2Map].map(([k, v]) => [k, (v as any).value])\n );\n },\n debugDataValue(data, { tplStateStoreId }) {\n return developHelperV2.debugDataValue(data, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n };\n\n flowApi = {\n collectDebugContract,\n } as any;\n isV2 = true;\n }\n} catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Try to use v2 runtime APIs failed:\", e);\n}\n\nlet contentScrollElement: Element | null = null;\nlet contentScrollHost: Element | null = null;\n\nexport default async function connect(\n previewFromOrigin: string,\n options: PreviewStartOptions\n) {\n if (connected) {\n return;\n }\n connected = true;\n\n const sendMessage = <T extends PreviewMessageFromPreviewer>(\n message: Omit<T, \"sender\">\n ): void => {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n ...message,\n },\n previewFromOrigin\n );\n };\n\n sendMessage({ type: \"preview-started\" });\n setPreviewFromOrigin(previewFromOrigin);\n\n let hoverIid: string;\n let hoverAlias: string;\n let activeIid: string;\n let activeAlias: string;\n\n const handleHoverOnIframe = (pos: Position): void => {\n const element = document.elementFromPoint(pos.x, pos.y);\n if (element?.tagName === \"BODY\") {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-main\",\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n } as PreviewMessagePreviewerHoverOnMain,\n previewProxyOrigin\n );\n } else {\n const iidList = getPossibleBrickIidList(element as HTMLElement);\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n },\n previewProxyOrigin\n );\n }\n };\n\n const sendHighlightBrickOutlines = (\n type: \"hover\" | \"active\",\n iid: string,\n alias: string\n ): void => {\n const outlines = getBrickOutlines(iid);\n sendMessage<PreviewMessagePreviewerHighlightBrick>({\n type: \"highlight-brick\",\n highlightType: type,\n outlines,\n iid: iid,\n alias: alias,\n });\n };\n\n const sendHighlightBricksOutlines = (nodes: HighLightNode[]): void => {\n const outlines = nodes\n .map((node) => getBrickOutlines(node.iid, node.alias))\n .flat();\n sendMessage<PreviewMessagePreviewerHighlightContext>({\n type: \"highlight-context\",\n outlines,\n });\n };\n\n let lastTemplatePreviewSettings: PreviewSettings | undefined;\n if (options.templateId) {\n lastTemplatePreviewSettings = options.settings;\n }\n\n const updateTemplatePreviewSettings = (): void => {\n __secret_internals.updateTemplatePreviewSettings(\n options.appId,\n options.templateId!,\n lastTemplatePreviewSettings\n );\n getHistory().reload();\n };\n\n const updateSnippetPreviewSettings = (): void => {\n __secret_internals.updateSnippetPreviewSettings(\n options.appId,\n JSON.parse(options.snippetData)\n );\n getHistory().reload();\n };\n\n const updateFormPreviewSettings = (): void => {\n (__secret_internals as any).updateFormPreviewSettings(\n options.appId,\n options.formId,\n options.formData\n );\n getHistory().reload();\n };\n\n const handlePreviewData = (name: string, option: PreviewDataOption): void => {\n try {\n const { dataType } = option;\n let tplStateStoreId;\n\n if (dataType === \"state\") {\n tplStateStoreId = getRootTplStateStoreId();\n\n if (!tplStateStoreId) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n error: {\n message:\n \"tplStateStoreId not found, unable to preview STATE value\",\n },\n },\n });\n\n return;\n }\n }\n\n let value, type: PreviewMessagePreviewDataValueSuccess[\"type\"];\n if (name) {\n type = \"inspect-single-data-value-success\";\n value = __secret_internals.getContextValue(name, {\n tplStateStoreId,\n });\n } else {\n type = \"inspect-all-data-values-success\";\n const data = __secret_internals.getAllContextValues({\n tplStateStoreId,\n });\n value = Object.entries(data).map(([name, value]) => ({ name, value }));\n }\n\n sendMessage<PreviewMessagePreviewDataValueSuccess>({\n type,\n data: {\n name,\n value,\n },\n });\n\n // istanbul ignore next\n } catch (error) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n message: (error as Error).message,\n },\n });\n }\n };\n\n const debugDataValue = async (\n data: PreviewDebugData,\n contractData: Contract,\n previewOption: PreviewDataOption\n ) => {\n try {\n if (contractData) {\n flowApi.collectDebugContract([contractData]);\n }\n const value = await __secret_internals.debugDataValue(data, {\n tplStateStoreId:\n previewOption.dataType === \"state\"\n ? getRootTplStateStoreId()\n : undefined,\n routeId: options.routeId,\n });\n\n sendMessage<PreviewMessagePreviewDebugValueSuccess>({\n type: \"debug-data-value-success\",\n data: {\n debugConf: data,\n value,\n },\n });\n } catch (error) {\n sendMessage<PreviewMessagePreviewDebugValueError>({\n type: \"debug-data-value-error\",\n data:\n error instanceof HttpResponseError\n ? error.responseJson\n : { message: (error as Error).message },\n });\n }\n };\n\n const history = getHistory();\n\n window.addEventListener(\n \"message\",\n async ({ data, origin }: MessageEvent<PreviewMessageToPreviewer>) => {\n if (\n origin !== previewFromOrigin ||\n !data ||\n data.sender !== \"preview-container\"\n ) {\n return;\n }\n if (data.forwardedFor === \"builder\") {\n switch (data.type) {\n case \"hover-on-brick\":\n hoverIid = data.iid;\n hoverAlias = data.alias;\n sendHighlightBrickOutlines(\"hover\", data.iid, data.alias);\n break;\n case \"hover-on-main\":\n sendHighlightBrickOutlines(\"hover\", \"#main-mount-point\", \"root\");\n break;\n case \"hover-on-context\":\n sendHighlightBricksOutlines(data.highlightNodes);\n break;\n case \"select-brick\":\n activeIid = data.iid;\n activeAlias = data.alias;\n sendHighlightBrickOutlines(\"active\", data.iid, data.alias);\n break;\n case \"hover-on-iframe\":\n handleHoverOnIframe(data.position);\n break;\n }\n } else\n switch (data.type) {\n case \"toggle-inspecting\":\n data.enabled ? startInspecting() : stopInspecting();\n break;\n case \"refresh\":\n if (data.options?.updateStoryboardType) {\n if (data.options.updateStoryboardType === \"route\") {\n __secret_internals.updateStoryboardByRoute(\n options.appId,\n data.storyboardPatch as RouteConf\n );\n } else if (data.options.updateStoryboardType === \"template\") {\n __secret_internals.updateStoryboardByTemplate(\n options.appId,\n data.storyboardPatch as CustomTemplate,\n data.options.settings\n );\n } else if (data.options.updateStoryboardType === \"snippet\") {\n __secret_internals.updateStoryboardBySnippet(\n options.appId,\n data.storyboardPatch as {\n snippetId: string;\n bricks: BrickConf[];\n }\n );\n } else if (data.options.updateStoryboardType === \"form\") {\n (__secret_internals as any).updateFormPreviewSettings(\n options.appId,\n options.formId,\n data.storyboardPatch\n );\n }\n\n let newContracts;\n if (data.options?.updateStoryboardType !== \"form\") {\n newContracts = await (\n __secret_internals as any\n ).getAddedContracts?.(data.storyboardPatch, {\n appId: options.appId,\n updateStoryboardType: data.options.updateStoryboardType,\n formId: options.formId,\n collectUsedContracts,\n });\n }\n\n if (!isEmpty(newContracts)) {\n sendMessage<PreviewMessagePreviewContractUpdate>({\n type: \"contract-update\",\n data: {\n add: newContracts,\n },\n });\n } else {\n getHistory().reload();\n }\n\n break;\n }\n __secret_internals.updateStoryboard(\n options.appId,\n data.storyboardPatch\n );\n if (options.templateId) {\n lastTemplatePreviewSettings = data.settings;\n updateTemplatePreviewSettings();\n } else if (options.formId || options.formData) {\n updateFormPreviewSettings();\n } else if (data.options?.snippetData) {\n options.snippetData = data.options.snippetData;\n updateSnippetPreviewSettings();\n } else {\n getHistory().reload();\n }\n break;\n case \"reload\":\n location.reload();\n break;\n case \"back\":\n history.goBack();\n break;\n case \"forward\":\n history.goForward();\n break;\n case \"capture\":\n capture(data.maxWidth, data.maxHeight).then(\n (screenshot) => {\n sendMessage<PreviewMessagePreviewerCaptureOk>({\n type: \"capture-ok\",\n screenshot,\n });\n },\n () => {\n sendMessage<PreviewMessagePreviewerCaptureFailed>({\n type: \"capture-failed\",\n });\n }\n );\n break;\n case \"inspect-data-value\":\n handlePreviewData(data.name, data.option);\n break;\n case \"update-preview-url\": {\n // Remove origin first.\n const url = data.previewUrl.startsWith(window.origin)\n ? data.previewUrl.substring(window.origin.length)\n : data.previewUrl;\n // Then remove base path.\n const basePath = getBasePath();\n const to = url.startsWith(basePath)\n ? url.substring(basePath.length - 1)\n : url;\n getHistory().push(to);\n break;\n }\n case \"update-preview-route\": {\n options.routePath = data.routePath;\n options.routeExact = data.routeExact;\n syncRouteMatch();\n break;\n }\n case \"debug-data-value\":\n debugDataValue(data.debugData, data.contractData, data.options);\n break;\n case \"excute-proxy-method\": {\n const [ref, method, args = []] = data.proxyMethodArgs;\n try {\n const result = document.body.querySelector(ref)[method](...args);\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-success\",\n data: { method: method, res: result },\n });\n } catch (err) {\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-error\",\n data: { method: method, res: (err as Error).message },\n });\n }\n break;\n }\n }\n }\n );\n\n window.addEventListener(\"scroll\", () => {\n sendMessage<PreviewMessagePreviewerScroll>({\n type: \"scroll\",\n scroll: {\n x: window.scrollX,\n y: window.scrollY,\n },\n });\n });\n\n let previewPageMatch = true;\n let currentLocation: NextLocation;\n const sendLocationChange = (loc: NextLocation): void => {\n sendMessage<PreviewMessagePreviewerUrlChange>({\n type: \"url-change\",\n url: location.origin + history.createHref(loc),\n });\n currentLocation = loc;\n syncRouteMatch();\n };\n\n function syncRouteMatch() {\n if (options.routePath) {\n const match = !!matchPath(currentLocation.pathname, {\n path: options.routePath,\n exact: options.routeExact,\n });\n sendMessage<PreviewMessagePreviewerRouteMatchChange>({\n type: \"route-match-change\",\n match,\n });\n\n // Re-update template preview settings once match route again (typically after login).\n if (options.templateId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateTemplatePreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n if (options.formId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\");\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild.childNodes.length === 0\n ) {\n updateFormPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n if (options.snippetData && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateSnippetPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n previewPageMatch = match;\n }\n }\n\n sendLocationChange(history.location);\n\n history.listen(sendLocationChange);\n\n if (options.templateId) {\n updateTemplatePreviewSettings();\n }\n\n if (options.formId || options.formData) {\n updateFormPreviewSettings();\n }\n\n if (options.snippetData) {\n updateSnippetPreviewSettings();\n }\n\n function setupContentScroll() {\n const host = document.querySelector(\"eo-page-view\");\n const element = host?.shadowRoot?.querySelector(\".content\") ?? null;\n if (element !== contentScrollElement) {\n contentScrollElement?.removeEventListener(\"scroll\", onContentScroll);\n element?.addEventListener(\"scroll\", onContentScroll);\n contentScrollElement = element;\n contentScrollHost = host;\n }\n }\n\n function onContentScroll(this: Element) {\n sendMessage<PreviewMessagePreviewerContentScroll>({\n type: \"content-scroll\",\n scroll: {\n x: this.scrollLeft,\n y: this.scrollTop,\n },\n });\n }\n\n const setupRuntimeValueInspect = () => {\n const routeId = options.routeId;\n\n const data = __secret_internals.getLegalRuntimeValue({ routeId });\n sendMessage<PreviewMessagePreviewInspectRuntimeValue>({\n type: \"inspect-runtime-data-value\",\n data: {\n ...omit(data, \"query\"),\n query: data.query ? Object.fromEntries(data.query.entries()) : {},\n path: data.match?.params,\n },\n });\n };\n\n __secret_internals.addRealTimeDataInspectHook?.(\n ({ changeType, tplStateStoreId, detail }) => {\n sendMessage<PreviewMessagePreviewerRealTimeDataInspectChange>({\n type: \"real-time-data-inspect-change\",\n changeType,\n tplStateStoreId,\n detail:\n changeType === \"update\"\n ? {\n name: detail.name,\n annotation: getRealTimeDataAnnotation(detail.value),\n }\n : {\n data: Object.fromEntries(\n Object.entries(detail.data).map(([k, v]) => [\n k,\n getRealTimeDataAnnotation(v),\n ])\n ),\n },\n });\n }\n );\n\n let memoizedRootTplStateStoreId: string | undefined;\n\n function setupRealTimeDataInspect(force?: boolean) {\n const tplStateStoreId = options.templateId\n ? getRootTplStateStoreId()\n : undefined;\n if (memoizedRootTplStateStoreId !== tplStateStoreId || force) {\n memoizedRootTplStateStoreId = tplStateStoreId;\n __secret_internals.setRealTimeDataInspectRoot?.({\n tplStateStoreId,\n });\n }\n }\n\n window.addEventListener(\"route.render\", () => {\n setupRealTimeDataInspect(true);\n setupRuntimeValueInspect();\n });\n\n setupContentScroll();\n setupRealTimeDataInspect(true);\n setupRuntimeValueInspect();\n\n const mutationCallback = (): void => {\n setupContentScroll();\n setupRealTimeDataInspect();\n if (hoverIid) {\n sendHighlightBrickOutlines(\"hover\", hoverIid, hoverAlias);\n }\n if (activeIid) {\n sendHighlightBrickOutlines(\"active\", activeIid, activeAlias);\n }\n };\n const mutationObserver = new MutationObserver(\n throttle(mutationCallback, 100, { leading: false })\n );\n mutationObserver.observe(document.body, { subtree: true, childList: true });\n}\n\nfunction getBrickOutlines(iid: string, alias?: string): BrickOutline[] {\n if (!iid) {\n return [];\n }\n const isRoot = iid.includes(\"#\");\n const elements = getElementsIncludingInShadowDOM(iid, isRoot);\n const outlines = getOutlines(elements, alias);\n return isRoot\n ? outlines.map((item) => ({\n ...item,\n height: window.innerHeight - item.top,\n }))\n : outlines;\n}\n\nexport function getElementsIncludingInShadowDOM(\n iid: string,\n isRoot?: boolean\n): HTMLElement[] {\n const elements: HTMLElement[] = [];\n\n function walk(root: Document | ShadowRoot) {\n const candidates = root.querySelectorAll<HTMLElement>(\n isRoot ? iid : `[data-iid=\"${iid}\"]`\n );\n elements.push(...candidates);\n\n // If elements are found in the document, we should stop searching in shadow DOM.\n if (root === document && candidates.length > 0) {\n return;\n }\n\n // These useBrick in v3 bricks will be inside shadow DOM.\n for (const item of root.querySelectorAll(\"*\")) {\n if (item.shadowRoot) {\n walk(item.shadowRoot);\n }\n }\n }\n\n walk(document);\n\n return elements;\n}\n\nfunction getOutlines(elements: HTMLElement[], alias?: string): BrickOutline[] {\n return elements.map((element) => {\n const hasContentScroll = contentScrollHost?.contains(element);\n const { width, height, left, top } = element.getBoundingClientRect();\n return {\n width,\n height,\n left:\n left +\n window.scrollX +\n (hasContentScroll ? contentScrollElement.scrollLeft : 0),\n top:\n top +\n window.scrollY +\n (hasContentScroll ? contentScrollElement.scrollTop : 0),\n alias,\n hasContentScroll,\n };\n });\n}\n\nfunction getRootTplStateStoreId(): string | undefined {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n\n return (mainMountPoint?.firstChild as HTMLElement)?.dataset[\n isV2 ? \"tplContextId\" : \"tplStateStoreId\"\n ];\n}\n","// istanbul ignore file: nothing logical except calling html2canvas.\nimport html2canvas from \"html2canvas\";\nimport { resizeScreenshot } from \"./resizeScreenshot.js\";\n\nfunction getCanvasBlob(canvas: HTMLCanvasElement): Promise<Blob> {\n return new Promise(function (resolve, reject) {\n canvas.toBlob(function (blob: Blob | null) {\n if (blob) {\n resolve(blob);\n } else {\n reject();\n }\n });\n });\n}\n\nexport async function capture(\n maxWidth: number,\n maxHeight: number\n): Promise<Blob> {\n const sourceCanvas = await html2canvas(document.body, {\n logging: false,\n scale: 1,\n width: window.innerWidth,\n height: window.innerHeight,\n foreignObjectRendering: true,\n });\n const targetCanvas = document.createElement(\"canvas\");\n resizeScreenshot(sourceCanvas, targetCanvas, maxWidth, maxHeight);\n const blob = await getCanvasBlob(targetCanvas);\n return blob;\n}\n","export function resizeScreenshot(\n canvas: HTMLCanvasElement,\n targetCanvas: HTMLCanvasElement,\n maxWidth: number,\n maxHeight: number\n): string {\n const targetRatio = maxWidth / maxHeight;\n const { width, height } = canvas;\n const ratio = width / height;\n const wider = ratio >= targetRatio;\n const finalWidth = wider ? maxWidth : maxHeight * ratio;\n const finalHeight = wider ? maxWidth / ratio : maxHeight;\n targetCanvas.width = finalWidth;\n targetCanvas.height = finalHeight;\n\n const ctx = targetCanvas.getContext(\"2d\")!;\n ctx.drawImage(canvas, 0, 0, width, height, 0, 0, finalWidth, finalHeight);\n return targetCanvas.toDataURL();\n}\n"],"names":["collectUsedContracts","storyboard","collection","nodeOrNodes","Set","traverse","node","type","_node$raw","useProvider","raw","add","collect","parseStoryboard","contracts","item","includes","push","customElements","define","createProviderClass","previewProxyOrigin","onClick","event","preventDefault","stopPropagation","eventTargets","iidList","getPossibleBrickTargets","length","window","parent","postMessage","sender","selectBrick","composedPath","onMouseEvent","hoverOnBrick","throttle","leading","onPointerDown","onPointerMove","onPointerLeave","onContextMenu","position","contextMenuOnBrick","x","clientX","y","clientY","targets","target","HTMLElement","dataset","iid","getRealTimeDataAnnotation","value","Array","isArray","connected","getHistory","_getHistory","matchPath","_matchPath","__secret_internals","_internals","flowApi","_flowAPi","isV2","_window$BRICK_NEXT_VE","dll","BRICK_NEXT_VERSIONS","startsWith","getHistoryV2","developHelper","developHelperV2","collectDebugContract","matchPathV2","getContextValue","name","_ref","tplStateStoreId","tplContextId","getAllContextValues","_ref2","v2Map","Object","fromEntries","map","_ref3","k","v","debugDataValue","data","_ref4","e","console","error","contentScrollElement","contentScrollHost","async","connect","previewFromOrigin","options","_secret_internals$ad","_secret_internals","sendMessage","message","hoverIid","hoverAlias","activeIid","activeAlias","sendHighlightBrickOutlines","alias","outlines","getBrickOutlines","highlightType","lastTemplatePreviewSettings","templateId","settings","updateTemplatePreviewSettings","appId","reload","updateSnippetPreviewSettings","JSON","parse","snippetData","updateFormPreviewSettings","formId","formData","history","addEventListener","_data$options","_data$options3","origin","_ref6","forwardedFor","nodes","flat","sendHighlightBricksOutlines","highlightNodes","pos","element","document","elementFromPoint","tagName","isDirection","brick","cursor","parentElement","getPossibleBrickIidList","handleHoverOnIframe","enabled","removeEventListener","updateStoryboardType","_data$options2","newContracts","_getAddedContracts","_ref7","updateStoryboardByRoute","storyboardPatch","updateStoryboardByTemplate","updateStoryboardBySnippet","getAddedContracts","call","isEmpty","updateStoryboard","location","goBack","goForward","maxWidth","maxHeight","sourceCanvas","html2canvas","body","logging","scale","width","innerWidth","height","innerHeight","foreignObjectRendering","targetCanvas","createElement","canvas","targetRatio","ratio","wider","finalWidth","finalHeight","getContext","drawImage","toDataURL","resizeScreenshot","Promise","resolve","reject","toBlob","blob","capture","then","screenshot","handlePreviewData","option","dataType","getRootTplStateStoreId","entries","_ref5","url","previewUrl","substring","basePath","getBasePath","to","routePath","routeExact","syncRouteMatch","contractData","previewOption","undefined","routeId","debugConf","HttpResponseError","responseJson","debugData","ref","method","args","proxyMethodArgs","result","querySelector","res","err","scroll","scrollX","scrollY","currentLocation","previewPageMatch","sendLocationChange","loc","createHref","match","pathname","path","exact","mainMountPoint","placeholderLoadObserver","MutationObserver","childNodes","firstChild","disconnect","observe","childList","setupContentScroll","_host$shadowRoot","host","shadowRoot","_contentScrollElement","onContentScroll","this","scrollLeft","scrollTop","listen","setupRuntimeValueInspect","_data$match","getLegalRuntimeValue","omit","query","params","memoizedRootTplStateStoreId","setupRealTimeDataInspect","force","_secret_internals$se","_secret_internals2","setRealTimeDataInspectRoot","addRealTimeDataInspectHook","_ref8","changeType","detail","annotation","_ref9","mutationCallback","subtree","isRoot","elements","_contentScrollHost","hasContentScroll","contains","left","top","getBoundingClientRect","getOutlines","getElementsIncludingInShadowDOM","walk","root","candidates","querySelectorAll","_mainMountPoint$first"],"sourceRoot":""}