@bluepic/embed 0.1.151 → 0.1.152

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.
@@ -73426,7 +73426,7 @@ function getTemplateLiveUrl(m, c, ne) {
73426
73426
  fonts: JSON.stringify(ne.config.fonts ?? []),
73427
73427
  webgl: ne.config.webgl,
73428
73428
  resolution: ne.config.resolution,
73429
- autoDetectBxCoreVersion: c !== void 0,
73429
+ autoDetectBxCoreVersion: c === void 0,
73430
73430
  resolveSerial: ne.useBoilerplate ? void 0 : getTemplateSerialUrl(m, ne)
73431
73431
  }).filter(([, $e]) => $e && $e !== "null")
73432
73432
  )
@@ -2535,7 +2535,7 @@ ${He.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&(Jr=Jr.replac
2535
2535
 
2536
2536
 
2537
2537
  }
2538
- `,document.head.appendChild(ne);const we=vue.createApp({setup(){const Pe=vue.ref(),Me=vue.ref();return{popupProviderRef:Pe,popoverProviderRef:Me}},render(){return[vue.h(PopupProvider,{ref:"popupProviderRef"}),vue.h(PopoverProvider,{ref:"popoverProviderRef"})]}}).mount(c);this.popupProviderRef=we.popupProviderRef,this.popoverProviderRef=we.popoverProviderRef;try{document.body.appendChild(c)}catch(Pe){console.error("Error adding wrapper to body:",Pe)}}}function convertDeprecatedField(m){return m.datatype==="Collection"?{type:"Collection",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{fields:m.props.fields.map(convertDeprecatedField).filter(c=>c!==void 0),min:m.props.min,max:m.props.max,layout:"list"},hitbox:void 0,layout:{maxWidth:"100%",minWidth:"100%"}}:m.datatype==="Dropdown"?{type:"Select",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{size:"medium",layout:"dropdown",showLabels:!0,imageDisplay:"cover",options:m.props.options.map(c=>({label:c.label,value:c.value,image:c.preview}))},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Select"?{type:"Select",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{size:"medium",layout:"button",showLabels:!0,imageDisplay:m.props.imageDisplay,options:m.props.options.map((c,ne)=>({label:`Option ${ne+1}`,value:c.value,image:c.preview}))},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Text"?{type:"Text",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{clearable:m.props.clearable,maxHeight:"150px",maxLength:m.props.maxLength,maxLineLength:m.props.maxLineLength,maxLines:m.props.maxLines,multiline:m.props.multiline,placeholder:m.description??"Text...",showWordCount:m.props.showWordCount,uppercase:!1,richtext:{enabled:m.props.richtext,mixedStyleLabel:{en:m.props.mixedStyleLabel},noStyleLabel:{en:m.props.noStyleLabel},userAgentRichText:m.props.userAgentRichText,options:m.props.richTextOptions}},layout:{minWidth:"120px",maxWidth:"auto"},hitbox:void 0}:m.datatype==="Image"?{type:"Image",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{allowUploadFromDevice:m.props.allowUpload??!0,allowedTypes:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"],convertTo:void 0,width:m.props.width,height:m.props.height,imageLibraries:m.props.imageLibraries.map(c=>c.props?.sharingUrl?c.props.sharingUrl.indexOf("googledrive")>-1?{type:"sharedDrive",service:"googledrive",label:c.label,sharedUrl:c.props.sharingUrl}:{type:"sharedDrive",service:"onedrive",label:c.label,sharedUrl:c.props.sharingUrl}:{type:"custom",name:c.name,label:c.label,controller:c.controller,props:c.props}),layout:"normal",quality:m.props.quality,removeBackground:!1,uploadLabel:"Upload Image"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="ImageAdjust"?{type:"ImageAdjust",model:{...m.model,image:m.model.image,adjust:m.model.adjust},description:m.description,detailedDescription:void 0,props:{aspectRatio:m.props.aspectRatio,maxScale:m.props.maxScale,minScale:m.props.minScale,maxX:m.props.maxX,maxY:m.props.maxY,minX:m.props.minX,minY:m.props.minY,type:"popup"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Switch"?{type:"Checkbox",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{label:"",size:"medium"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Number"?{type:"Number",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{min:m.props.min,max:m.props.max,step:m.props.step,type:"slider"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Color"?{type:"Color",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{alpha:!0},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Map"?{type:"Map",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{aspectRatio:m.props.aspectRatio,mapStyle:m.props.mapStyle,mapboxAccessToken:m.props.mapboxAccessToken,padding:m.props.padding,type:m.props.type},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:void 0}function getCloudflareLiveUrl(m,c){return`https://${m?`${m.replaceAll(/\./g,"-")}.`:""}${c.cloudflarePagesHostname}`}function getTemplateSerialUrl(m,c){return`${c.embedApiBaseUrl}/api/public/project/serial/${m}?${new URLSearchParams({env:c.env}).toString()}`}function getTemplatePreviewUrl(m,c){return`${c.embedApiBaseUrl}/api/public/project/preview/${m}?${new URLSearchParams({env:c.env}).toString()}`}function getTemplateLiveUrl(m,c,ne){return`${getCloudflareLiveUrl(c,ne)}?`+new URLSearchParams(Object.fromEntries(Object.entries({fonts:JSON.stringify(ne.config.fonts??[]),webgl:ne.config.webgl,resolution:ne.config.resolution,autoDetectBxCoreVersion:c!==void 0,resolveSerial:ne.useBoilerplate?void 0:getTemplateSerialUrl(m,ne)}).filter(([,Pe])=>Pe&&Pe!=="null"))).toString()}function optimizePreviewUrl(m,c,ne){try{const we=new URL(m);if(we.hostname==="imagedelivery.net"){const[,Pe,Me,Ze]=we.pathname.split("/");return`https://imagedelivery.net/${Pe}/${Me}/${c||ne?new URLSearchParams(Object.fromEntries(Object.entries({w:c,h:ne}).filter(([ie,rr])=>rr!==void 0).map(([ie,rr])=>[ie,String(rr)]))).toString():Ze}`}}catch(we){return console.error(we),m}}class EmbeddedController extends EventTarget{iframe;alive;ready;sessionId;$data;constructor(c,ne,we=5){super(),this.iframe=c,this.alive=!0,this.ready=!1,this.sessionId=null,this.initListener();let Pe=!1,Me=!1;this.addEventListener("mounted",async()=>{if(ne!==void 0&&!Me){const rr=await ne;Me=!0,rr?await this.evaluate(vr=>{const or=JSON.parse(vr);window.bx_serial.value=or},JSON.stringify(rr)):this.dispatchEvent(new CustomEvent("error",{detail:{code:2}}))}else Pe||(Pe=!0,this.dispatchEvent(new CustomEvent("ready")))}),this.addEventListener("setGlobalScope",rr=>{const vr=Object.fromEntries(Object.entries(rr.detail).map(([yr,kr])=>kr?.__type__==="function"?[yr,new Function(`return (${kr.__value__})()`)]:[yr,kr])),or=new CustomEvent("globalScope",{detail:vr});this.dispatchEvent(or)});const Ze=setInterval(async()=>{if(!this.alive)return clearInterval(Ze);try{await this.ping()&&clearInterval(Ze)}catch{}},5);this.$data=new Proxy(this,{get(rr,vr){return rr.get(vr)},set(rr,vr,or){return rr.set(vr,or)}});let ie=0;this.addEventListener("http:error",rr=>{const vr=rr.detail?.code;if(vr>=400&&(console.error("ERROR DURING LIVE REQUEST",vr),vr===412))if(ie<we){const or=new URL(c.src);or.searchParams.set("force",Date.now().toString()),c.src=or.toString(),ie++}else this.dispatchEvent(new CustomEvent("error",{detail:{code:412}}))})}destroy(){this.alive=!1}ping(c=100){return new Promise((ne,we)=>{const Pe=Date.now(),Me=Pe,Ze=setTimeout(we,c),ie=({data:rr})=>{this.alive&&rr.type=="pong"&&rr.id==Me&&(ne(Date.now()-Pe),clearTimeout(Ze),window.removeEventListener("message",ie))};window.addEventListener("message",ie);try{this.iframe.contentWindow?.postMessage({type:"ping",id:Me},"*")}catch{}})}getSessionId(){return new Promise(c=>{const ne=nanoid();this.apply("getSessionId",ne),window.addEventListener("message",({data:we})=>{we.scope==="bx"&&we.taskId===ne&&c(we.sessionId)})})}messageIsSession(c){return c.sessionId==this.sessionId}messageIsEvent(c){return c.type=="event"}initListener(){window.addEventListener("message",async({data:c})=>{if(c.error&&(console.error("ERROR FROM LIVE SANDBOX",c),c?.response?.error==="File ist not embedded"?this.dispatchEvent(new CustomEvent("error",{detail:{code:2}})):this.dispatchEvent(new CustomEvent("error",{detail:{code:1}}))),this.messageIsSession(c)&&(c.taskId&&this.dispatchEvent(new CustomEvent("rerender")),this.messageIsEvent(c))){const ne=new CustomEvent(c.message,{detail:c.payload});this.dispatchEvent(ne)}if(c.type==="bx:init"){const ne=await this.getSessionId();ne!=this.sessionId&&(this.sessionId=ne,this.dispatchEvent(new CustomEvent("init"))),this.dispatchEvent(new CustomEvent("roll"))}c.type==="event"&&c.message==="mounted"&&this.dispatchEvent(new CustomEvent("mounted"))},!1)}apply(c,...ne){try{this.iframe.contentWindow?.postMessage({type:"action",name:c,args:ne},"*")}catch(we){console.error(we)}}get(c){return this.evaluate(ne=>this.$data[ne],c)}set(c,ne){return this.apply("set",c,ne),!0}evaluate(c,...ne){return new Promise((we,Pe)=>{const Me=nanoid();this.apply("evaluate",c.toString(),Me,ne);const Ze=({detail:rr})=>{if(rr.processId==Me){try{we(JSON.parse(rr.result))}catch{we(rr.result)}this.removeEventListener("return",Ze),this.removeEventListener("error",ie)}},ie=({detail:rr})=>{rr.processId==Me&&(Pe(rr.error),this.removeEventListener("return",Ze),this.removeEventListener("error",ie))};this.addEventListener("return",Ze),this.addEventListener("error",ie)})}setData(c){return new Promise((ne,we)=>{this.evaluate(Pe=>{const Me=JSON.parse(Pe);for(const Ze in Me)window.bx_data[Ze]=Me[Ze]},JSON.stringify(c)).then(Pe=>{ne(Pe)}).catch(Pe=>{we(Pe)})})}transform(c,ne,we,Pe){this.apply("transform",c,ne,we,Pe)}}function dataUrlToBlob(m){const c=window.atob(m.split(",")[1]),ne=m.split(",")[0].split(":")[1].split(";")[0],we=new ArrayBuffer(c.length),Pe=new Uint8Array(we);for(var Me=0;Me<c.length;Me++)Pe[Me]=c.charCodeAt(Me);return new Blob([we],{type:ne})}var css={},commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,parse$b=function(m,c){c=c||{};var ne=1,we=1;function Pe(nr){var $e=nr.match(/\n/g);$e&&(ne+=$e.length);var ur=nr.lastIndexOf(`
2538
+ `,document.head.appendChild(ne);const we=vue.createApp({setup(){const Pe=vue.ref(),Me=vue.ref();return{popupProviderRef:Pe,popoverProviderRef:Me}},render(){return[vue.h(PopupProvider,{ref:"popupProviderRef"}),vue.h(PopoverProvider,{ref:"popoverProviderRef"})]}}).mount(c);this.popupProviderRef=we.popupProviderRef,this.popoverProviderRef=we.popoverProviderRef;try{document.body.appendChild(c)}catch(Pe){console.error("Error adding wrapper to body:",Pe)}}}function convertDeprecatedField(m){return m.datatype==="Collection"?{type:"Collection",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{fields:m.props.fields.map(convertDeprecatedField).filter(c=>c!==void 0),min:m.props.min,max:m.props.max,layout:"list"},hitbox:void 0,layout:{maxWidth:"100%",minWidth:"100%"}}:m.datatype==="Dropdown"?{type:"Select",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{size:"medium",layout:"dropdown",showLabels:!0,imageDisplay:"cover",options:m.props.options.map(c=>({label:c.label,value:c.value,image:c.preview}))},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Select"?{type:"Select",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{size:"medium",layout:"button",showLabels:!0,imageDisplay:m.props.imageDisplay,options:m.props.options.map((c,ne)=>({label:`Option ${ne+1}`,value:c.value,image:c.preview}))},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Text"?{type:"Text",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{clearable:m.props.clearable,maxHeight:"150px",maxLength:m.props.maxLength,maxLineLength:m.props.maxLineLength,maxLines:m.props.maxLines,multiline:m.props.multiline,placeholder:m.description??"Text...",showWordCount:m.props.showWordCount,uppercase:!1,richtext:{enabled:m.props.richtext,mixedStyleLabel:{en:m.props.mixedStyleLabel},noStyleLabel:{en:m.props.noStyleLabel},userAgentRichText:m.props.userAgentRichText,options:m.props.richTextOptions}},layout:{minWidth:"120px",maxWidth:"auto"},hitbox:void 0}:m.datatype==="Image"?{type:"Image",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{allowUploadFromDevice:m.props.allowUpload??!0,allowedTypes:["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"],convertTo:void 0,width:m.props.width,height:m.props.height,imageLibraries:m.props.imageLibraries.map(c=>c.props?.sharingUrl?c.props.sharingUrl.indexOf("googledrive")>-1?{type:"sharedDrive",service:"googledrive",label:c.label,sharedUrl:c.props.sharingUrl}:{type:"sharedDrive",service:"onedrive",label:c.label,sharedUrl:c.props.sharingUrl}:{type:"custom",name:c.name,label:c.label,controller:c.controller,props:c.props}),layout:"normal",quality:m.props.quality,removeBackground:!1,uploadLabel:"Upload Image"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="ImageAdjust"?{type:"ImageAdjust",model:{...m.model,image:m.model.image,adjust:m.model.adjust},description:m.description,detailedDescription:void 0,props:{aspectRatio:m.props.aspectRatio,maxScale:m.props.maxScale,minScale:m.props.minScale,maxX:m.props.maxX,maxY:m.props.maxY,minX:m.props.minX,minY:m.props.minY,type:"popup"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Switch"?{type:"Checkbox",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{label:"",size:"medium"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Number"?{type:"Number",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{min:m.props.min,max:m.props.max,step:m.props.step,type:"slider"},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Color"?{type:"Color",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{alpha:!0},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:m.datatype==="Map"?{type:"Map",model:{modelValue:m.model.modelValue},description:m.description,detailedDescription:void 0,props:{aspectRatio:m.props.aspectRatio,mapStyle:m.props.mapStyle,mapboxAccessToken:m.props.mapboxAccessToken,padding:m.props.padding,type:m.props.type},layout:{minWidth:"100%",maxWidth:"100%"},hitbox:void 0}:void 0}function getCloudflareLiveUrl(m,c){return`https://${m?`${m.replaceAll(/\./g,"-")}.`:""}${c.cloudflarePagesHostname}`}function getTemplateSerialUrl(m,c){return`${c.embedApiBaseUrl}/api/public/project/serial/${m}?${new URLSearchParams({env:c.env}).toString()}`}function getTemplatePreviewUrl(m,c){return`${c.embedApiBaseUrl}/api/public/project/preview/${m}?${new URLSearchParams({env:c.env}).toString()}`}function getTemplateLiveUrl(m,c,ne){return`${getCloudflareLiveUrl(c,ne)}?`+new URLSearchParams(Object.fromEntries(Object.entries({fonts:JSON.stringify(ne.config.fonts??[]),webgl:ne.config.webgl,resolution:ne.config.resolution,autoDetectBxCoreVersion:c===void 0,resolveSerial:ne.useBoilerplate?void 0:getTemplateSerialUrl(m,ne)}).filter(([,Pe])=>Pe&&Pe!=="null"))).toString()}function optimizePreviewUrl(m,c,ne){try{const we=new URL(m);if(we.hostname==="imagedelivery.net"){const[,Pe,Me,Ze]=we.pathname.split("/");return`https://imagedelivery.net/${Pe}/${Me}/${c||ne?new URLSearchParams(Object.fromEntries(Object.entries({w:c,h:ne}).filter(([ie,rr])=>rr!==void 0).map(([ie,rr])=>[ie,String(rr)]))).toString():Ze}`}}catch(we){return console.error(we),m}}class EmbeddedController extends EventTarget{iframe;alive;ready;sessionId;$data;constructor(c,ne,we=5){super(),this.iframe=c,this.alive=!0,this.ready=!1,this.sessionId=null,this.initListener();let Pe=!1,Me=!1;this.addEventListener("mounted",async()=>{if(ne!==void 0&&!Me){const rr=await ne;Me=!0,rr?await this.evaluate(vr=>{const or=JSON.parse(vr);window.bx_serial.value=or},JSON.stringify(rr)):this.dispatchEvent(new CustomEvent("error",{detail:{code:2}}))}else Pe||(Pe=!0,this.dispatchEvent(new CustomEvent("ready")))}),this.addEventListener("setGlobalScope",rr=>{const vr=Object.fromEntries(Object.entries(rr.detail).map(([yr,kr])=>kr?.__type__==="function"?[yr,new Function(`return (${kr.__value__})()`)]:[yr,kr])),or=new CustomEvent("globalScope",{detail:vr});this.dispatchEvent(or)});const Ze=setInterval(async()=>{if(!this.alive)return clearInterval(Ze);try{await this.ping()&&clearInterval(Ze)}catch{}},5);this.$data=new Proxy(this,{get(rr,vr){return rr.get(vr)},set(rr,vr,or){return rr.set(vr,or)}});let ie=0;this.addEventListener("http:error",rr=>{const vr=rr.detail?.code;if(vr>=400&&(console.error("ERROR DURING LIVE REQUEST",vr),vr===412))if(ie<we){const or=new URL(c.src);or.searchParams.set("force",Date.now().toString()),c.src=or.toString(),ie++}else this.dispatchEvent(new CustomEvent("error",{detail:{code:412}}))})}destroy(){this.alive=!1}ping(c=100){return new Promise((ne,we)=>{const Pe=Date.now(),Me=Pe,Ze=setTimeout(we,c),ie=({data:rr})=>{this.alive&&rr.type=="pong"&&rr.id==Me&&(ne(Date.now()-Pe),clearTimeout(Ze),window.removeEventListener("message",ie))};window.addEventListener("message",ie);try{this.iframe.contentWindow?.postMessage({type:"ping",id:Me},"*")}catch{}})}getSessionId(){return new Promise(c=>{const ne=nanoid();this.apply("getSessionId",ne),window.addEventListener("message",({data:we})=>{we.scope==="bx"&&we.taskId===ne&&c(we.sessionId)})})}messageIsSession(c){return c.sessionId==this.sessionId}messageIsEvent(c){return c.type=="event"}initListener(){window.addEventListener("message",async({data:c})=>{if(c.error&&(console.error("ERROR FROM LIVE SANDBOX",c),c?.response?.error==="File ist not embedded"?this.dispatchEvent(new CustomEvent("error",{detail:{code:2}})):this.dispatchEvent(new CustomEvent("error",{detail:{code:1}}))),this.messageIsSession(c)&&(c.taskId&&this.dispatchEvent(new CustomEvent("rerender")),this.messageIsEvent(c))){const ne=new CustomEvent(c.message,{detail:c.payload});this.dispatchEvent(ne)}if(c.type==="bx:init"){const ne=await this.getSessionId();ne!=this.sessionId&&(this.sessionId=ne,this.dispatchEvent(new CustomEvent("init"))),this.dispatchEvent(new CustomEvent("roll"))}c.type==="event"&&c.message==="mounted"&&this.dispatchEvent(new CustomEvent("mounted"))},!1)}apply(c,...ne){try{this.iframe.contentWindow?.postMessage({type:"action",name:c,args:ne},"*")}catch(we){console.error(we)}}get(c){return this.evaluate(ne=>this.$data[ne],c)}set(c,ne){return this.apply("set",c,ne),!0}evaluate(c,...ne){return new Promise((we,Pe)=>{const Me=nanoid();this.apply("evaluate",c.toString(),Me,ne);const Ze=({detail:rr})=>{if(rr.processId==Me){try{we(JSON.parse(rr.result))}catch{we(rr.result)}this.removeEventListener("return",Ze),this.removeEventListener("error",ie)}},ie=({detail:rr})=>{rr.processId==Me&&(Pe(rr.error),this.removeEventListener("return",Ze),this.removeEventListener("error",ie))};this.addEventListener("return",Ze),this.addEventListener("error",ie)})}setData(c){return new Promise((ne,we)=>{this.evaluate(Pe=>{const Me=JSON.parse(Pe);for(const Ze in Me)window.bx_data[Ze]=Me[Ze]},JSON.stringify(c)).then(Pe=>{ne(Pe)}).catch(Pe=>{we(Pe)})})}transform(c,ne,we,Pe){this.apply("transform",c,ne,we,Pe)}}function dataUrlToBlob(m){const c=window.atob(m.split(",")[1]),ne=m.split(",")[0].split(":")[1].split(";")[0],we=new ArrayBuffer(c.length),Pe=new Uint8Array(we);for(var Me=0;Me<c.length;Me++)Pe[Me]=c.charCodeAt(Me);return new Blob([we],{type:ne})}var css={},commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,parse$b=function(m,c){c=c||{};var ne=1,we=1;function Pe(nr){var $e=nr.match(/\n/g);$e&&(ne+=$e.length);var ur=nr.lastIndexOf(`
2539
2539
  `);we=~ur?nr.length-ur:we+nr.length}function Me(){var nr={line:ne,column:we};return function($e){return $e.position=new Ze(nr),Ar(),$e}}function Ze(nr){this.start=nr,this.end={line:ne,column:we},this.source=c.source}Ze.prototype.content=m;var ie=[];function rr(nr){var $e=new Error(c.source+":"+ne+":"+we+": "+nr);if($e.reason=nr,$e.filename=c.source,$e.line=ne,$e.column=we,$e.source=m,c.silent)ie.push($e);else throw $e}function vr(){var nr=kr();return{type:"stylesheet",stylesheet:{source:c.source,rules:nr,parsingErrors:ie}}}function or(){return Br(/^{\s*/)}function yr(){return Br(/^}/)}function kr(){var nr,$e=[];for(Ar(),Pr($e);m.length&&m.charAt(0)!="}"&&(nr=pr()||br());)nr!==!1&&($e.push(nr),Pr($e));return $e}function Br(nr){var $e=nr.exec(m);if(!!$e){var ur=$e[0];return Pe(ur),m=m.slice(ur.length),$e}}function Ar(){Br(/^\s*/)}function Pr(nr){var $e;for(nr=nr||[];$e=Fr();)$e!==!1&&nr.push($e);return nr}function Fr(){var nr=Me();if(!(m.charAt(0)!="/"||m.charAt(1)!="*")){for(var $e=2;m.charAt($e)!=""&&(m.charAt($e)!="*"||m.charAt($e+1)!="/");)++$e;if($e+=2,m.charAt($e-1)==="")return rr("End of comment missing");var ur=m.slice(2,$e-2);return we+=2,Pe(ur),m=m.slice($e),we+=2,nr({type:"comment",comment:ur})}}function Yr(){var nr=Br(/^([^{]+)/);if(!!nr)return trim(nr[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function($e){return $e.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function($e){return $e.replace(/\u200C/g,",")})}function Vr(){var nr=Me(),$e=Br(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!!$e){if($e=trim($e[0]),!Br(/^:\s*/))return rr("property missing ':'");var ur=Br(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),$r=nr({type:"declaration",property:$e.replace(commentre,""),value:ur?trim(ur[0]).replace(commentre,""):""});return Br(/^[;\s]*/),$r}}function Xr(){var nr=[];if(!or())return rr("missing '{'");Pr(nr);for(var $e;$e=Vr();)$e!==!1&&(nr.push($e),Pr(nr));return yr()?nr:rr("missing '}'")}function Zr(){for(var nr,$e=[],ur=Me();nr=Br(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)$e.push(nr[1]),Br(/^,\s*/);if(!!$e.length)return ur({type:"keyframe",values:$e,declarations:Xr()})}function ai(){var nr=Me(),ur=Br(/^@([-\w]+)?keyframes\s*/);if(!!ur){var $e=ur[1],ur=Br(/^([-\w]+)\s*/);if(!ur)return rr("@keyframes missing name");var $r=ur[1];if(!or())return rr("@keyframes missing '{'");for(var Hr,gi=Pr();Hr=Zr();)gi.push(Hr),gi=gi.concat(Pr());return yr()?nr({type:"keyframes",name:$r,vendor:$e,keyframes:gi}):rr("@keyframes missing '}'")}}function ci(){var nr=Me(),$e=Br(/^@supports *([^{]+)/);if(!!$e){var ur=trim($e[1]);if(!or())return rr("@supports missing '{'");var $r=Pr().concat(kr());return yr()?nr({type:"supports",supports:ur,rules:$r}):rr("@supports missing '}'")}}function xi(){var nr=Me(),$e=Br(/^@host\s*/);if(!!$e){if(!or())return rr("@host missing '{'");var ur=Pr().concat(kr());return yr()?nr({type:"host",rules:ur}):rr("@host missing '}'")}}function di(){var nr=Me(),$e=Br(/^@media *([^{]+)/);if(!!$e){var ur=trim($e[1]);if(!or())return rr("@media missing '{'");var $r=Pr().concat(kr());return yr()?nr({type:"media",media:ur,rules:$r}):rr("@media missing '}'")}}function ni(){var nr=Me(),$e=Br(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(!!$e)return nr({type:"custom-media",name:trim($e[1]),media:trim($e[2])})}function li(){var nr=Me(),$e=Br(/^@page */);if(!!$e){var ur=Yr()||[];if(!or())return rr("@page missing '{'");for(var $r=Pr(),Hr;Hr=Vr();)$r.push(Hr),$r=$r.concat(Pr());return yr()?nr({type:"page",selectors:ur,declarations:$r}):rr("@page missing '}'")}}function gr(){var nr=Me(),$e=Br(/^@([-\w]+)?document *([^{]+)/);if(!!$e){var ur=trim($e[1]),$r=trim($e[2]);if(!or())return rr("@document missing '{'");var Hr=Pr().concat(kr());return yr()?nr({type:"document",document:$r,vendor:ur,rules:Hr}):rr("@document missing '}'")}}function Ae(){var nr=Me(),$e=Br(/^@font-face\s*/);if(!!$e){if(!or())return rr("@font-face missing '{'");for(var ur=Pr(),$r;$r=Vr();)ur.push($r),ur=ur.concat(Pr());return yr()?nr({type:"font-face",declarations:ur}):rr("@font-face missing '}'")}}var ze=lr("import"),Ue=lr("charset"),tr=lr("namespace");function lr(nr){var $e=new RegExp("^@"+nr+"\\s*([^;]+);");return function(){var ur=Me(),$r=Br($e);if(!!$r){var Hr={type:nr};return Hr[nr]=$r[1].trim(),ur(Hr)}}}function pr(){if(m[0]=="@")return ai()||di()||ni()||ci()||ze()||Ue()||tr()||gr()||li()||xi()||Ae()}function br(){var nr=Me(),$e=Yr();return $e?(Pr(),nr({type:"rule",selectors:$e,declarations:Xr()})):rr("selector missing")}return addParent(vr())};function trim(m){return m?m.replace(/^\s+|\s+$/g,""):""}function addParent(m,c){var ne=m&&typeof m.type=="string",we=ne?m:c;for(var Pe in m){var Me=m[Pe];Array.isArray(Me)?Me.forEach(function(Ze){addParent(Ze,we)}):Me&&typeof Me=="object"&&addParent(Me,we)}return ne&&Object.defineProperty(m,"parent",{configurable:!0,writable:!0,enumerable:!1,value:c||null}),m}var compiler=Compiler$2;function Compiler$2(m){this.options=m||{}}Compiler$2.prototype.emit=function(m){return m},Compiler$2.prototype.visit=function(m){return this[m.type](m)},Compiler$2.prototype.mapVisit=function(m,c){var ne="";c=c||"";for(var we=0,Pe=m.length;we<Pe;we++)ne+=this.visit(m[we]),c&&we<Pe-1&&(ne+=this.emit(c));return ne};var Base$1=compiler,inherits$1=inherits_browser.exports,compress=Compiler$1;function Compiler$1(m){Base$1.call(this,m)}inherits$1(Compiler$1,Base$1),Compiler$1.prototype.compile=function(m){return m.stylesheet.rules.map(this.visit,this).join("")},Compiler$1.prototype.comment=function(m){return this.emit("",m.position)},Compiler$1.prototype.import=function(m){return this.emit("@import "+m.import+";",m.position)},Compiler$1.prototype.media=function(m){return this.emit("@media "+m.media,m.position)+this.emit("{")+this.mapVisit(m.rules)+this.emit("}")},Compiler$1.prototype.document=function(m){var c="@"+(m.vendor||"")+"document "+m.document;return this.emit(c,m.position)+this.emit("{")+this.mapVisit(m.rules)+this.emit("}")},Compiler$1.prototype.charset=function(m){return this.emit("@charset "+m.charset+";",m.position)},Compiler$1.prototype.namespace=function(m){return this.emit("@namespace "+m.namespace+";",m.position)},Compiler$1.prototype.supports=function(m){return this.emit("@supports "+m.supports,m.position)+this.emit("{")+this.mapVisit(m.rules)+this.emit("}")},Compiler$1.prototype.keyframes=function(m){return this.emit("@"+(m.vendor||"")+"keyframes "+m.name,m.position)+this.emit("{")+this.mapVisit(m.keyframes)+this.emit("}")},Compiler$1.prototype.keyframe=function(m){var c=m.declarations;return this.emit(m.values.join(","),m.position)+this.emit("{")+this.mapVisit(c)+this.emit("}")},Compiler$1.prototype.page=function(m){var c=m.selectors.length?m.selectors.join(", "):"";return this.emit("@page "+c,m.position)+this.emit("{")+this.mapVisit(m.declarations)+this.emit("}")},Compiler$1.prototype["font-face"]=function(m){return this.emit("@font-face",m.position)+this.emit("{")+this.mapVisit(m.declarations)+this.emit("}")},Compiler$1.prototype.host=function(m){return this.emit("@host",m.position)+this.emit("{")+this.mapVisit(m.rules)+this.emit("}")},Compiler$1.prototype["custom-media"]=function(m){return this.emit("@custom-media "+m.name+" "+m.media+";",m.position)},Compiler$1.prototype.rule=function(m){var c=m.declarations;return c.length?this.emit(m.selectors.join(","),m.position)+this.emit("{")+this.mapVisit(c)+this.emit("}"):""},Compiler$1.prototype.declaration=function(m){return this.emit(m.property+":"+m.value,m.position)+this.emit(";")};var Base=compiler,inherits=inherits_browser.exports,identity=Compiler;function Compiler(m){m=m||{},Base.call(this,m),this.indentation=m.indent}inherits(Compiler,Base),Compiler.prototype.compile=function(m){return this.stylesheet(m)},Compiler.prototype.stylesheet=function(m){return this.mapVisit(m.stylesheet.rules,`
2540
2540
 
2541
2541
  `)},Compiler.prototype.comment=function(m){return this.emit(this.indent()+"/*"+m.comment+"*/",m.position)},Compiler.prototype.import=function(m){return this.emit("@import "+m.import+";",m.position)},Compiler.prototype.media=function(m){return this.emit("@media "+m.media,m.position)+this.emit(` {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bluepic/embed",
3
3
  "private": false,
4
- "version": "0.1.151",
4
+ "version": "0.1.152",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "package.json",