diff --git a/apps/backend/package.json b/apps/backend/package.json index 467966e49b..9b5f781edd 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -10,7 +10,6 @@ "test": "cd supabase/functions/api && deno test", "status": "supabase status -o json" }, - "dependencies": {}, "devDependencies": { "@onlook/typescript": "*", "@types/bun": "latest", diff --git a/apps/web/client/next.config.ts b/apps/web/client/next.config.ts index 30b6a31dde..b6d842561c 100644 --- a/apps/web/client/next.config.ts +++ b/apps/web/client/next.config.ts @@ -2,7 +2,7 @@ * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful * for Docker builds. */ -import { NextConfig } from 'next'; +import type { NextConfig } from 'next'; import createNextIntlPlugin from 'next-intl/plugin'; import path from 'node:path'; import './src/env'; diff --git a/apps/web/client/package.json b/apps/web/client/package.json index 0703a194e2..566f6668c7 100644 --- a/apps/web/client/package.json +++ b/apps/web/client/package.json @@ -30,16 +30,27 @@ "dependencies": { "@ai-sdk/provider-utils": "^3.0.10", "@ai-sdk/react": "2.0.60", + "@codemirror/autocomplete": "^6.19.0", "@codemirror/lang-css": "^6.2.0", "@codemirror/lang-html": "^6.4.7", "@codemirror/lang-javascript": "^6.2.3", "@codemirror/lang-json": "^6.0.1", "@codemirror/lang-markdown": "^6.1.7", + "@codemirror/language": "^6.11.3", + "@codemirror/lint": "^6.9.0", + "@codemirror/search": "^6.5.11", + "@codemirror/state": "^6.5.2", + "@codemirror/view": "^6.38.6", + "@codesandbox/sdk": "^1.1.6", + "@lezer/highlight": "^1.2.1", + "@mendable/firecrawl-js": "^1.29.1", "@onlook/code-provider": "*", "@onlook/constants": "*", "@onlook/db": "*", "@onlook/email": "*", + "@onlook/file-system": "*", "@onlook/fonts": "*", + "@onlook/git": "*", "@onlook/github": "*", "@onlook/growth": "*", "@onlook/image-server": "*", @@ -50,10 +61,13 @@ "@onlook/stripe": "*", "@onlook/ui": "*", "@onlook/utility": "*", + "@onlook/web-preload": "*", + "@openrouter/ai-sdk-provider": "^1.2.0", "@opentelemetry/api-logs": "0.57.2", "@opentelemetry/instrumentation": "0.57.2", "@opentelemetry/sdk-logs": "0.57.2", "@supabase/ssr": "^0.6.1", + "@supabase/supabase-js": "^2.75.0", "@t3-oss/env-nextjs": "^0.12.0", "@tanstack/react-query": "^5.69.0", "@trpc/client": "^11.0.0", @@ -66,68 +80,90 @@ "@xterm/xterm": "^5.5.0", "@zenfs/core": "2.4.0", "@zenfs/dom": "1.2.5", - "ai": "5.0.26", + "ai": "5.0.60", "blob-util": "^2.0.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "culori": "^4.0.1", "date-fns": "^4.1.0", + "drizzle-orm": "^0.44.6", + "exa-js": "^1.8.26", "flexsearch": "^0.8.160", + "framer-motion": "^12.23.24", "freestyle-sandboxes": "^0.0.78", "gleap": "^14.8.8", + "gpt-tokenizer": "^3.0.1", "langfuse-vercel": "^3.38.4", "localforage": "^1.10.0", + "lodash": "^4.17.21", "lru-cache": "^11.2.1", - "lucide-react": "^0.486.0", + "lucide-react": "^0.544.0", + "marked": "^15.0.7", + "mime-lite": "^1.0.3", + "mobx": "^6.15.0", "mobx-react-lite": "^4.1.0", "motion": "^12.23.19", + "nanoid": "^5.1.6", "next": ">=15.5.3", "next-intl": "^4.0.2", "next-themes": "^0.4.6", "octokit": "^5.0.3", + "openai": "^4.103.0", "penpal": "^7.0.4", + "pg": "^8.16.3", + "postgres": "^3.4.7", "posthog-js": "^1.246.0", "posthog-node": "^4.17.2", + "prettier": "^3.3.3", "prosemirror-commands": "^1.7.1", "prosemirror-history": "^1.4.1", "prosemirror-keymap": "^1.2.2", - "react": "^19.0.0", + "prosemirror-model": "^1.25.3", + "prosemirror-state": "^1.4.3", + "prosemirror-view": "^1.34.2", + "react": "^19.1.13", "react-arborist": "^3.4.3", "react-codemirror-merge": "4.23.10", - "react-dom": "^19.0.0", + "react-dnd": "^16.0.1", + "react-dnd-html5-backend": "^16.0.1", + "react-dom": "^19.1.13", "react-hotkeys-hook": "^5.0.1", "react-markdown": "^10.1.0", "remark-gfm": "^4.0.1", "server-only": "^0.0.1", + "sharp": "^0.33.5", "shiki": "^3.2.2", + "sonner": "^2.0.4", "strip-ansi": "^7.1.0", - "superjson": "^2.2.1", - "tailwind-merge": "^3.2.0", + "superjson": "^2.2.2", + "tailwind-merge": "^3.3.1", "tldts": "^7.0.12", "tw-animate-css": "^1.2.5", "unicornstudio-react": "^1.4.33", "use-resize-observer": "^9.1.0", + "use-stick-to-bottom": "^1.1.1", "uuid": "^11.1.0", "webfontloader": "^1.6.28", - "zod": "^4.1.3" + "zod": "^4.1.8" }, "devDependencies": { "@eslint/eslintrc": "^3.3.1", "@onlook/eslint": "*", "@onlook/typescript": "*", - "@tailwindcss/postcss": "^4.0.15", + "@tailwindcss/postcss": "^4.1.5", "@types/culori": "^4.0.0", - "@types/node": "^20.14.10", - "@types/react": "^19.0.0", - "@types/react-dom": "^19.0.0", + "@types/lodash": "^4.17.16", + "@types/node": "^24.7.2", + "@types/react": "^19.1.13", + "@types/react-dom": "^19.1.13", "@types/webfontloader": "^1.6.38", "eslint": "^9.0.0", "postcss": "^8.5.3", - "tailwindcss": "^4.0.15", + "tailwindcss": "^4.1.5", "type-fest": "^4.41.0", - "typescript": "^5.5.4" + "typescript": "^5.8.2" }, "ct3aMetadata": { "initVersion": "7.39.2" } -} \ No newline at end of file +} diff --git a/apps/web/client/public/onlook-preload-script.js b/apps/web/client/public/onlook-preload-script.js index 311328e493..84e30ea62c 100644 --- a/apps/web/client/public/onlook-preload-script.js +++ b/apps/web/client/public/onlook-preload-script.js @@ -1,26 +1,26 @@ -var k4=Object.create;var{getPrototypeOf:U4,defineProperty:Je,getOwnPropertyNames:J4}=Object;var P4=Object.prototype.hasOwnProperty;var Kh=(r,t,i)=>{i=r!=null?k4(U4(r)):{};let o=t||!r||!r.__esModule?Je(i,"default",{value:r,enumerable:!0}):i;for(let n of J4(r))if(!P4.call(o,n))Je(o,n,{get:()=>r[n],enumerable:!0});return o};var vr=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var j=(r,t)=>{for(var i in t)Je(r,i,{get:t[i],enumerable:!0,configurable:!0,set:(o)=>t[i]=()=>o})};var Pe=vr((rU,Xh)=>{function E4(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}Xh.exports=E4});var qh=vr((tU,Wh)=>{var L4=typeof global=="object"&&global&&global.Object===Object&&global;Wh.exports=L4});var Ee=vr((nU,Nh)=>{var K4=qh(),X4=typeof self=="object"&&self&&self.Object===Object&&self,W4=K4||X4||Function("return this")();Nh.exports=W4});var Sh=vr((iU,Vh)=>{var q4=Ee(),N4=function(){return q4.Date.now()};Vh.exports=N4});var Fh=vr((oU,Yh)=>{var V4=/\s/;function S4(r){var t=r.length;while(t--&&V4.test(r.charAt(t)));return t}Yh.exports=S4});var Gh=vr((eU,Qh)=>{var Y4=Fh(),F4=/^\s+/;function Q4(r){return r?r.slice(0,Y4(r)+1).replace(F4,""):r}Qh.exports=Q4});var Le=vr((lU,Ah)=>{var G4=Ee(),A4=G4.Symbol;Ah.exports=A4});var Hh=vr((cU,Rh)=>{var Bh=Le(),yh=Object.prototype,B4=yh.hasOwnProperty,y4=yh.toString,wn=Bh?Bh.toStringTag:void 0;function R4(r){var t=B4.call(r,wn),i=r[wn];try{r[wn]=void 0;var o=!0}catch(e){}var n=y4.call(r);if(o)if(t)r[wn]=i;else delete r[wn];return n}Rh.exports=R4});var Zh=vr((uU,Mh)=>{var H4=Object.prototype,M4=H4.toString;function Z4(r){return M4.call(r)}Mh.exports=Z4});var sh=vr((gU,dh)=>{var Ch=Le(),C4=Hh(),T4=Zh(),d4="[object Null]",s4="[object Undefined]",Th=Ch?Ch.toStringTag:void 0;function r6(r){if(r==null)return r===void 0?s4:d4;return Th&&Th in Object(r)?C4(r):T4(r)}dh.exports=r6});var t$=vr((mU,r$)=>{function t6(r){return r!=null&&typeof r=="object"}r$.exports=t6});var i$=vr((bU,n$)=>{var n6=sh(),i6=t$(),o6="[object Symbol]";function e6(r){return typeof r=="symbol"||i6(r)&&n6(r)==o6}n$.exports=e6});var c$=vr((vU,l$)=>{var l6=Gh(),o$=Pe(),c6=i$(),e$=NaN,u6=/^[-+]0x[0-9a-f]+$/i,g6=/^0b[01]+$/i,m6=/^0o[0-7]+$/i,b6=parseInt;function v6(r){if(typeof r=="number")return r;if(c6(r))return e$;if(o$(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=o$(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=l6(r);var i=g6.test(r);return i||m6.test(r)?b6(r.slice(2),i?2:8):u6.test(r)?e$:+r}l$.exports=v6});var Xe=vr((hU,g$)=>{var h6=Pe(),Ke=Sh(),u$=c$(),$6="Expected a function",x6=Math.max,f6=Math.min;function w6(r,t,i){var o,n,e,l,u,g,c=0,m=!1,v=!1,h=!0;if(typeof r!="function")throw TypeError($6);if(t=u$(t)||0,h6(i))m=!!i.leading,v="maxWait"in i,e=v?x6(u$(i.maxWait)||0,t):e,h="trailing"in i?!!i.trailing:h;function b(S){var A=o,tr=n;return o=n=void 0,c=S,l=r.apply(tr,A),l}function f(S){return c=S,u=setTimeout(O,t),m?b(S):l}function D(S){var A=S-g,tr=S-c,Ue=t-A;return v?f6(Ue,e-tr):Ue}function I(S){var A=S-g,tr=S-c;return g===void 0||A>=t||A<0||v&&tr>=e}function O(){var S=Ke();if(I(S))return J(S);u=setTimeout(O,D(S))}function J(S){if(u=void 0,h&&o)return b(S);return o=n=void 0,l}function q(){if(u!==void 0)clearTimeout(u);c=0,o=g=n=u=void 0}function E(){return u===void 0?l:J(Ke())}function K(){var S=Ke(),A=I(S);if(o=arguments,n=this,g=S,A){if(u===void 0)return f(g);if(v)return clearTimeout(u),u=setTimeout(O,t),b(g)}if(u===void 0)u=setTimeout(O,t);return l}return K.cancel=q,K.flush=E,K}g$.exports=w6});var m0=vr(($a)=>{var g0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");$a.encode=function(r){if(0<=r&&r{var b0=m0(),Me=5,v0=1<>1;return t?-i:i}za.encode=function(t){var i="",o,n=wa(t);do{if(o=n&h0,n>>>=Me,n>0)o|=$0;i+=b0.encode(o)}while(n>0);return i};za.decode=function(t,i,o){var n=t.length,e=0,l=0,u,g;do{if(i>=n)throw Error("Expected more digits in base 64 VLQ value.");if(g=b0.decode(t.charCodeAt(i++)),g===-1)throw Error("Invalid base64 digit: "+t.charAt(i-1));u=!!(g&$0),g&=h0,e=e+(g<{function Da(r,t,i){if(t in r)return r[t];else if(arguments.length===3)return i;else throw Error('"'+t+'" is a required argument.')}Na.getArg=Da;var f0=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,pa=/^data:.+\,.+$/;function kn(r){var t=r.match(f0);if(!t)return null;return{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}}Na.urlParse=kn;function yt(r){var t="";if(r.scheme)t+=r.scheme+":";if(t+="//",r.auth)t+=r.auth+"@";if(r.host)t+=r.host;if(r.port)t+=":"+r.port;if(r.path)t+=r.path;return t}Na.urlGenerate=yt;var Ia=32;function ja(r){var t=[];return function(i){for(var o=0;oIa)t.pop();return e}}var Ze=ja(function(t){var i=t,o=kn(t);if(o){if(!o.path)return t;i=o.path}var n=Na.isAbsolute(i),e=[],l=0,u=0;while(!0)if(l=u,u=i.indexOf("/",l),u===-1){e.push(i.slice(l));break}else{e.push(i.slice(l,u));while(u=0;u--)if(g=e[u],g===".")e.splice(u,1);else if(g==="..")c++;else if(c>0)if(g==="")e.splice(u+1,c),c=0;else e.splice(u,2),c--;if(i=e.join("/"),i==="")i=n?"/":".";if(o)return o.path=i,yt(o);return i});Na.normalize=Ze;function w0(r,t){if(r==="")r=".";if(t==="")t=".";var i=kn(t),o=kn(r);if(o)r=o.path||"/";if(i&&!i.scheme){if(o)i.scheme=o.scheme;return yt(i)}if(i||t.match(pa))return t;if(o&&!o.host&&!o.path)return o.host=t,yt(o);var n=t.charAt(0)==="/"?t:Ze(r.replace(/\/+$/,"")+"/"+t);if(o)return o.path=n,yt(o);return n}Na.join=w0;Na.isAbsolute=function(r){return r.charAt(0)==="/"||f0.test(r)};function ka(r,t){if(r==="")r=".";r=r.replace(/\/$/,"");var i=0;while(t.indexOf(r+"/")!==0){var o=r.lastIndexOf("/");if(o<0)return t;if(r=r.slice(0,o),r.match(/^([^\/]+:\/)?\/*$/))return t;++i}return Array(i+1).join("../")+t.substr(r.length+1)}Na.relative=ka;var a0=function(){var r=Object.create(null);return!("__proto__"in r)}();function z0(r){return r}function Ua(r){if(_0(r))return"$"+r;return r}Na.toSetString=a0?z0:Ua;function Ja(r){if(_0(r))return r.slice(1);return r}Na.fromSetString=a0?z0:Ja;function _0(r){if(!r)return!1;var t=r.length;if(t<9)return!1;if(r.charCodeAt(t-1)!==95||r.charCodeAt(t-2)!==95||r.charCodeAt(t-3)!==111||r.charCodeAt(t-4)!==116||r.charCodeAt(t-5)!==111||r.charCodeAt(t-6)!==114||r.charCodeAt(t-7)!==112||r.charCodeAt(t-8)!==95||r.charCodeAt(t-9)!==95)return!1;for(var i=t-10;i>=0;i--)if(r.charCodeAt(i)!==36)return!1;return!0}function Pa(r,t,i){var o=tt(r.source,t.source);if(o!==0)return o;if(o=r.originalLine-t.originalLine,o!==0)return o;if(o=r.originalColumn-t.originalColumn,o!==0||i)return o;if(o=r.generatedColumn-t.generatedColumn,o!==0)return o;if(o=r.generatedLine-t.generatedLine,o!==0)return o;return tt(r.name,t.name)}Na.compareByOriginalPositions=Pa;function Ea(r,t,i){var o=r.originalLine-t.originalLine;if(o!==0)return o;if(o=r.originalColumn-t.originalColumn,o!==0||i)return o;if(o=r.generatedColumn-t.generatedColumn,o!==0)return o;if(o=r.generatedLine-t.generatedLine,o!==0)return o;return tt(r.name,t.name)}Na.compareByOriginalPositionsNoSource=Ea;function La(r,t,i){var o=r.generatedLine-t.generatedLine;if(o!==0)return o;if(o=r.generatedColumn-t.generatedColumn,o!==0||i)return o;if(o=tt(r.source,t.source),o!==0)return o;if(o=r.originalLine-t.originalLine,o!==0)return o;if(o=r.originalColumn-t.originalColumn,o!==0)return o;return tt(r.name,t.name)}Na.compareByGeneratedPositionsDeflated=La;function Ka(r,t,i){var o=r.generatedColumn-t.generatedColumn;if(o!==0||i)return o;if(o=tt(r.source,t.source),o!==0)return o;if(o=r.originalLine-t.originalLine,o!==0)return o;if(o=r.originalColumn-t.originalColumn,o!==0)return o;return tt(r.name,t.name)}Na.compareByGeneratedPositionsDeflatedNoLine=Ka;function tt(r,t){if(r===t)return 0;if(r===null)return 1;if(t===null)return-1;if(r>t)return 1;return-1}function Xa(r,t){var i=r.generatedLine-t.generatedLine;if(i!==0)return i;if(i=r.generatedColumn-t.generatedColumn,i!==0)return i;if(i=tt(r.source,t.source),i!==0)return i;if(i=r.originalLine-t.originalLine,i!==0)return i;if(i=r.originalColumn-t.originalColumn,i!==0)return i;return tt(r.name,t.name)}Na.compareByGeneratedPositionsInflated=Xa;function Wa(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}Na.parseSourceMapInput=Wa;function qa(r,t,i){if(t=t||"",r){if(r[r.length-1]!=="/"&&t[0]!=="/")r+="/";t=r+t}if(i){var o=kn(i);if(!o)throw Error("sourceMapURL could not be parsed");if(o.path){var n=o.path.lastIndexOf("/");if(n>=0)o.path=o.path.substring(0,n+1)}t=w0(yt(o),t)}return Ze(t)}Na.computeSourceURL=qa});var O0=vr((sa)=>{var Ce=Zi(),Te=Object.prototype.hasOwnProperty,kt=typeof Map<"u";function nt(){this._array=[],this._set=kt?new Map:Object.create(null)}nt.fromArray=function(t,i){var o=new nt;for(var n=0,e=t.length;n=0)return i}else{var o=Ce.toSetString(t);if(Te.call(this._set,o))return this._set[o]}throw Error('"'+t+'" is not in the set.')};nt.prototype.at=function(t){if(t>=0&&t{var D0=Zi();function tz(r,t){var i=r.generatedLine,o=t.generatedLine,n=r.generatedColumn,e=t.generatedColumn;return o>i||o==i&&e>=n||D0.compareByGeneratedPositionsInflated(r,t)<=0}function Ci(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ci.prototype.unsortedForEach=function(t,i){this._array.forEach(t,i)};Ci.prototype.add=function(t){if(tz(this._last,t))this._last=t,this._array.push(t);else this._sorted=!1,this._array.push(t)};Ci.prototype.toArray=function(){if(!this._sorted)this._array.sort(D0.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};nz.MappingList=Ci});var qt="PENPAL_CHILD";var I4=Kh(Xe(),1);var a6=class extends Error{code;constructor(r,t){super(t);this.name="PenpalError",this.code=r}},Or=a6,z6=(r)=>({name:r.name,message:r.message,stack:r.stack,penpalCode:r instanceof Or?r.code:void 0}),_6=({name:r,message:t,stack:i,penpalCode:o})=>{let n=o?new Or(o,t):Error(t);return n.name=r,n.stack=i,n},O6=Symbol("Reply"),D6=class{value;transferables;#r=O6;constructor(r,t){this.value=r,this.transferables=t?.transferables}},p6=D6,Jr="penpal",Ki=(r)=>{return typeof r==="object"&&r!==null},$$=(r)=>{return typeof r==="function"},I6=(r)=>{return Ki(r)&&r.namespace===Jr},Nt=(r)=>{return r.type==="SYN"},Xi=(r)=>{return r.type==="ACK1"},an=(r)=>{return r.type==="ACK2"},x$=(r)=>{return r.type==="CALL"},f$=(r)=>{return r.type==="REPLY"},j6=(r)=>{return r.type==="DESTROY"},w$=(r,t=[])=>{let i=[];for(let o of Object.keys(r)){let n=r[o];if($$(n))i.push([...t,o]);else if(Ki(n))i.push(...w$(n,[...t,o]))}return i},k6=(r,t)=>{let i=r.reduce((o,n)=>{return Ki(o)?o[n]:void 0},t);return $$(i)?i:void 0},mt=(r)=>{return r.join(".")},m$=(r,t,i)=>({namespace:Jr,channel:r,type:"REPLY",callId:t,isError:!0,...i instanceof Error?{value:z6(i),isSerializedErrorInstance:!0}:{value:i}}),U6=(r,t,i,o)=>{let n=!1,e=async(l)=>{if(n)return;if(!x$(l))return;o?.(`Received ${mt(l.methodPath)}() call`,l);let{methodPath:u,args:g,id:c}=l,m,v;try{let h=k6(u,t);if(!h)throw new Or("METHOD_NOT_FOUND",`Method \`${mt(u)}\` is not found.`);let b=await h(...g);if(b instanceof p6)v=b.transferables,b=await b.value;m={namespace:Jr,channel:i,type:"REPLY",callId:c,value:b}}catch(h){m=m$(i,c,h)}if(n)return;try{o?.(`Sending ${mt(u)}() reply`,m),r.sendMessage(m,v)}catch(h){if(h.name==="DataCloneError")m=m$(i,c,h),o?.(`Sending ${mt(u)}() reply`,m),r.sendMessage(m);throw h}};return r.addMessageHandler(e),()=>{n=!0,r.removeMessageHandler(e)}},J6=U6,a$=crypto.randomUUID?.bind(crypto)??(()=>[,,,,].fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")),P6=Symbol("CallOptions"),E6=class{transferables;timeout;#r=P6;constructor(r){this.transferables=r?.transferables,this.timeout=r?.timeout}},L6=E6,K6=new Set(["apply","call","bind"]),z$=(r,t,i=[])=>{return new Proxy(i.length?()=>{}:Object.create(null),{get(o,n){if(n==="then")return;if(i.length&&K6.has(n))return Reflect.get(o,n);return z$(r,t,[...i,n])},apply(o,n,e){return r(i,e)}})},b$=(r)=>{return new Or("CONNECTION_DESTROYED",`Method call ${mt(r)}() failed due to destroyed connection`)},X6=(r,t,i)=>{let o=!1,n=new Map,e=(g)=>{if(!f$(g))return;let{callId:c,value:m,isError:v,isSerializedErrorInstance:h}=g,b=n.get(c);if(!b)return;if(n.delete(c),i?.(`Received ${mt(b.methodPath)}() call`,g),v)b.reject(h?_6(m):m);else b.resolve(m)};return r.addMessageHandler(e),{remoteProxy:z$((g,c)=>{if(o)throw b$(g);let m=a$(),v=c[c.length-1],h=v instanceof L6,{timeout:b,transferables:f}=h?v:{},D=h?c.slice(0,-1):c;return new Promise((I,O)=>{let J=b!==void 0?window.setTimeout(()=>{n.delete(m),O(new Or("METHOD_CALL_TIMEOUT",`Method call ${mt(g)}() timed out after ${b}ms`))},b):void 0;n.set(m,{methodPath:g,resolve:I,reject:O,timeoutId:J});try{let q={namespace:Jr,channel:t,type:"CALL",id:m,methodPath:g,args:D};i?.(`Sending ${mt(g)}() call`,q),r.sendMessage(q,f)}catch(q){O(new Or("TRANSMISSION_FAILED",q.message))}})},i),destroy:()=>{o=!0,r.removeMessageHandler(e);for(let{methodPath:g,reject:c,timeoutId:m}of n.values())clearTimeout(m),c(b$(g));n.clear()}}},W6=X6,q6=()=>{let r,t;return{promise:new Promise((o,n)=>{r=o,t=n}),resolve:r,reject:t}},N6=q6,V6=class extends Error{constructor(r){super(`You've hit a bug in Penpal. Please file an issue with the following information: ${r}`)}},Vt=V6,We="deprecated-penpal",S6=(r)=>{return Ki(r)&&"penpal"in r},Y6=(r)=>r.split("."),v$=(r)=>r.join("."),_$=(r)=>{return new Vt(`Unexpected message to translate: ${JSON.stringify(r)}`)},F6=(r)=>{if(r.penpal==="syn")return{namespace:Jr,channel:void 0,type:"SYN",participantId:We};if(r.penpal==="ack")return{namespace:Jr,channel:void 0,type:"ACK2"};if(r.penpal==="call")return{namespace:Jr,channel:void 0,type:"CALL",id:r.id,methodPath:Y6(r.methodName),args:r.args};if(r.penpal==="reply")if(r.resolution==="fulfilled")return{namespace:Jr,channel:void 0,type:"REPLY",callId:r.id,value:r.returnValue};else return{namespace:Jr,channel:void 0,type:"REPLY",callId:r.id,isError:!0,...r.returnValueIsError?{value:r.returnValue,isSerializedErrorInstance:!0}:{value:r.returnValue}};throw _$(r)},Q6=(r)=>{if(Xi(r))return{penpal:"synAck",methodNames:r.methodPaths.map(v$)};if(x$(r))return{penpal:"call",id:r.id,methodName:v$(r.methodPath),args:r.args};if(f$(r))if(r.isError)return{penpal:"reply",id:r.callId,resolution:"rejected",...r.isSerializedErrorInstance?{returnValue:r.value,returnValueIsError:!0}:{returnValue:r.value}};else return{penpal:"reply",id:r.callId,resolution:"fulfilled",returnValue:r.value};throw _$(r)},G6=({messenger:r,methods:t,timeout:i,channel:o,log:n})=>{let e=a$(),l,u=[],g=!1,c=w$(t),{promise:m,resolve:v,reject:h}=N6(),b=i!==void 0?setTimeout(()=>{h(new Or("CONNECTION_TIMEOUT",`Connection timed out after ${i}ms`))},i):void 0,f=()=>{for(let K of u)K()},D=()=>{if(g)return;u.push(J6(r,t,o,n));let{remoteProxy:K,destroy:S}=W6(r,o,n);u.push(S),clearTimeout(b),g=!0,v({remoteProxy:K,destroy:f})},I=()=>{let K={namespace:Jr,type:"SYN",channel:o,participantId:e};n?.("Sending handshake SYN",K);try{r.sendMessage(K)}catch(S){h(new Or("TRANSMISSION_FAILED",S.message))}},O=(K)=>{if(n?.("Received handshake SYN",K),K.participantId===l&&l!==We)return;if(l=K.participantId,I(),!(e>l||l===We))return;let A={namespace:Jr,channel:o,type:"ACK1",methodPaths:c};n?.("Sending handshake ACK1",A);try{r.sendMessage(A)}catch(tr){h(new Or("TRANSMISSION_FAILED",tr.message));return}},J=(K)=>{n?.("Received handshake ACK1",K);let S={namespace:Jr,channel:o,type:"ACK2"};n?.("Sending handshake ACK2",S);try{r.sendMessage(S)}catch(A){h(new Or("TRANSMISSION_FAILED",A.message));return}D()},q=(K)=>{n?.("Received handshake ACK2",K),D()},E=(K)=>{if(Nt(K))O(K);if(Xi(K))J(K);if(an(K))q(K)};return r.addMessageHandler(E),u.push(()=>r.removeMessageHandler(E)),I(),m},A6=G6,B6=(r)=>{let t=!1,i;return(...o)=>{if(!t)t=!0,i=r(...o);return i}},y6=B6,h$=new WeakSet,R6=({messenger:r,methods:t={},timeout:i,channel:o,log:n})=>{if(!r)throw new Or("INVALID_ARGUMENT","messenger must be defined");if(h$.has(r))throw new Or("INVALID_ARGUMENT","A messenger can only be used for a single connection");h$.add(r);let e=[r.destroy],l=y6((c)=>{if(c){let m={namespace:Jr,channel:o,type:"DESTROY"};try{r.sendMessage(m)}catch(v){}}for(let m of e)m();n?.("Connection destroyed")}),u=(c)=>{return I6(c)&&c.channel===o};return{promise:(async()=>{try{r.initialize({log:n,validateReceivedMessage:u}),r.addMessageHandler((v)=>{if(j6(v))l(!1)});let{remoteProxy:c,destroy:m}=await A6({messenger:r,methods:t,timeout:i,channel:o,log:n});return e.push(m),c}catch(c){throw l(!0),c}})(),destroy:()=>{l(!0)}}},O$=R6,H6=class{#r;#o;#n;#t;#l;#i=new Set;#e;#c=!1;constructor({remoteWindow:r,allowedOrigins:t}){if(!r)throw new Or("INVALID_ARGUMENT","remoteWindow must be defined");this.#r=r,this.#o=t?.length?t:[window.origin]}initialize=({log:r,validateReceivedMessage:t})=>{this.#n=r,this.#t=t,window.addEventListener("message",this.#b)};sendMessage=(r,t)=>{if(Nt(r)){let i=this.#u(r);this.#r.postMessage(r,{targetOrigin:i,transfer:t});return}if(Xi(r)||this.#c){let i=this.#c?Q6(r):r,o=this.#u(r);this.#r.postMessage(i,{targetOrigin:o,transfer:t});return}if(an(r)){let{port1:i,port2:o}=new MessageChannel;this.#e=i,i.addEventListener("message",this.#g),i.start();let n=[o,...t||[]],e=this.#u(r);this.#r.postMessage(r,{targetOrigin:e,transfer:n});return}if(this.#e){this.#e.postMessage(r,{transfer:t});return}throw new Vt("Port is undefined")};addMessageHandler=(r)=>{this.#i.add(r)};removeMessageHandler=(r)=>{this.#i.delete(r)};destroy=()=>{window.removeEventListener("message",this.#b),this.#m(),this.#i.clear()};#v=(r)=>{return this.#o.some((t)=>t instanceof RegExp?t.test(r):t===r||t==="*")};#u=(r)=>{if(Nt(r))return"*";if(!this.#l)throw new Vt("Concrete remote origin not set");return this.#l==="null"&&this.#o.includes("*")?"*":this.#l};#m=()=>{this.#e?.removeEventListener("message",this.#g),this.#e?.close(),this.#e=void 0};#b=({source:r,origin:t,ports:i,data:o})=>{if(r!==this.#r)return;if(S6(o))this.#n?.("Please upgrade the child window to the latest version of Penpal."),this.#c=!0,o=F6(o);if(!this.#t?.(o))return;if(!this.#v(t)){this.#n?.(`Received a message from origin \`${t}\` which did not match allowed origins \`[${this.#o.join(", ")}]\``);return}if(Nt(o))this.#m(),this.#l=t;if(an(o)&&!this.#c){if(this.#e=i[0],!this.#e)throw new Vt("No port received on ACK2");this.#e.addEventListener("message",this.#g),this.#e.start()}for(let n of this.#i)n(o)};#g=({data:r})=>{if(!this.#t?.(r))return;for(let t of this.#i)t(r)}},D$=H6,$U=class{#r;#o;#n=new Set;#t;constructor({worker:r}){if(!r)throw new Or("INVALID_ARGUMENT","worker must be defined");this.#r=r}initialize=({validateReceivedMessage:r})=>{this.#o=r,this.#r.addEventListener("message",this.#i)};sendMessage=(r,t)=>{if(Nt(r)||Xi(r)){this.#r.postMessage(r,{transfer:t});return}if(an(r)){let{port1:i,port2:o}=new MessageChannel;this.#t=i,i.addEventListener("message",this.#i),i.start(),this.#r.postMessage(r,{transfer:[o,...t||[]]});return}if(this.#t){this.#t.postMessage(r,{transfer:t});return}throw new Vt("Port is undefined")};addMessageHandler=(r)=>{this.#n.add(r)};removeMessageHandler=(r)=>{this.#n.delete(r)};destroy=()=>{this.#r.removeEventListener("message",this.#i),this.#l(),this.#n.clear()};#l=()=>{this.#t?.removeEventListener("message",this.#i),this.#t?.close(),this.#t=void 0};#i=({ports:r,data:t})=>{if(!this.#o?.(t))return;if(Nt(t))this.#l();if(an(t)){if(this.#t=r[0],!this.#t)throw new Vt("No port received on ACK2");this.#t.addEventListener("message",this.#i),this.#t.start()}for(let i of this.#n)i(t)}};var xU=class{#r;#o;#n=new Set;constructor({port:r}){if(!r)throw new Or("INVALID_ARGUMENT","port must be defined");this.#r=r}initialize=({validateReceivedMessage:r})=>{this.#o=r,this.#r.addEventListener("message",this.#t),this.#r.start()};sendMessage=(r,t)=>{this.#r?.postMessage(r,{transfer:t})};addMessageHandler=(r)=>{this.#n.add(r)};removeMessageHandler=(r)=>{this.#n.delete(r)};destroy=()=>{this.#r.removeEventListener("message",this.#t),this.#r.close(),this.#n.clear()};#t=({data:r})=>{if(!this.#o?.(r))return;for(let t of this.#n)t(r)}};var p$=["SCRIPT","STYLE","LINK","META","NOSCRIPT"],I$=new Set(["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","h1","h2","h3","h4","h5","h6","i","iframe","img","input","ins","kbd","label","li","map","mark","meter","noscript","object","output","p","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr"]);var KU={SCALE:0.7,PAN_POSITION:{x:175,y:100},URL:"http://localhost:3000/",ASPECT_RATIO_LOCKED:!1,DEVICE:"Custom:Custom",THEME:"system",ORIENTATION:"Portrait",MIN_DIMENSIONS:{width:"280px",height:"360px"},COMMANDS:{run:"bun run dev",build:"bun run build",install:"bun install"},IMAGE_FOLDER:"public",IMAGE_DIMENSION:{width:"100px",height:"100px"},FONT_FOLDER:"fonts",FONT_CONFIG:"app/fonts.ts",TAILWIND_CONFIG:"tailwind.config.ts",CHAT_SETTINGS:{showSuggestions:!0,autoApplyCode:!0,expandCodeBlocks:!1,showMiniChat:!1,maxImages:5},EDITOR_SETTINGS:{shouldWarnDelete:!1,enableBunReplace:!0,buildFlags:"--no-lint"}};var qe=["node_modules","dist","build",".git",".next"];var WU=[...qe,"static","out",".next-prod",".onlook","public/onlook-preload-script.js"],qU=[...qe,".next-prod"],NU=[...qe,"coverage"],M6=[".jsx",".tsx"],Z6=[".js",".ts",".mjs",".cjs"],VU=[...M6,...Z6];var FU={["en"]:"English",["ja"]:"日本語",["zh"]:"中文",["ko"]:"한국어"};var J$=Kh(Xe(),1);function Q(r){return document.querySelector(`[${"data-odid"}="${r}"]`)}function Ne(r,t=!1){let i=`[${"data-odid"}="${r}"]`;if(!t)return i;return C6(i)}function C6(r){return CSS.escape(r)}function Dt(r){return r&&r instanceof Node&&r.nodeType===Node.ELEMENT_NODE&&!p$.includes(r.tagName)&&!r.hasAttribute("data-onlook-ignore")&&r.style.display!=="none"}var T6="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var j$=(r=21)=>{let t="",i=r|0;while(i--)t+=T6[Math.random()*64|0];return t};function Pr(r){let t=r.getAttribute("data-odid");if(!t)t=`odid-${j$()}`,r.setAttribute("data-odid",t);return t}function Qr(r){return r.getAttribute("data-oid")}function Gr(r){return r.getAttribute("data-oiid")}function k$(r,t){if(!ar)return;ar.onDomProcessed({layerMap:Object.fromEntries(r),rootNode:t}).catch((i)=>{console.error("Failed to send DOM processed event:",i)})}function Ve(r){window._onlookFrameId=r}function St(){let r=window._onlookFrameId;if(!r)return console.warn("Frame id not found"),ar?.getFrameId().then((t)=>{Ve(t)}),"";return r}function Se(r){window._onlookBranchId=r}function zn(){let r=window._onlookBranchId;if(!r)return console.warn("Branch id not found"),ar?.getBranchId().then((t)=>{Se(t)}),"";return r}function d6(r=document.body){if(!St())return console.warn("frameView id not found, skipping dom processing"),null;let i=zr(r);if(!i)return console.warn("Error building layer tree, root element is null"),null;let o=r.getAttribute("data-odid");if(!o)return console.warn("Root dom id not found"),null;let n=i.get(o);if(!n)return console.warn("Root node not found"),null;return k$(i,n),{rootDomId:o,layerMap:Array.from(i.entries())}}var Wi=J$.default(d6,500),s6=[(r)=>{let t=r.parentElement;return t&&t.tagName.toLowerCase()==="svg"},(r)=>{return r.tagName.toLowerCase()==="next-route-announcer"},(r)=>{return r.tagName.toLowerCase()==="nextjs-portal"}];function zr(r){if(!Dt(r))return null;let t=new Map,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:(e)=>{let l=e;if(s6.some((u)=>u(l)))return NodeFilter.FILTER_REJECT;return Dt(l)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),o=U$(r);o.children=[],t.set(o.domId,o);let n=i.nextNode();while(n){let e=U$(n);e.children=[];let l=n.parentElement;if(l){let u=l.getAttribute("data-odid");if(u){e.parent=u;let g=t.get(u);if(g&&g.children)g.children.push(e.domId)}}t.set(e.domId,e),n=i.nextNode()}return t}function U$(r){let t=Pr(r),i=Qr(r),o=Gr(r),n=Array.from(r.childNodes).map((g)=>g.nodeType===Node.TEXT_NODE?g.textContent:"").join(" ").trim().slice(0,500),e=window.getComputedStyle(r),l=r.getAttribute("data-ocname");return{domId:t,oid:i||null,instanceId:o||null,textContent:n||"",tagName:r.tagName.toLowerCase(),isVisible:e.visibility!=="hidden",component:l||null,frameId:St(),children:null,parent:null,dynamicType:null,coreElementType:null}}function Ye(r){throw Error(`Expected \`never\`, found: ${JSON.stringify(r)}`)}var P$=(r)=>JSON.parse(JSON.stringify(r));function E$(r){let t=K$(r),i=ra(r),o=ta(r);return{defined:{width:"auto",height:"auto",...i,...o},computed:t}}function L$(r){let t=Q(r);if(!t)return{};return K$(t)}function K$(r){return P$(window.getComputedStyle(r))}function ra(r){let t={},i=X$(r.style.cssText);return Object.entries(i).forEach(([o,n])=>{t[o]=n}),t}function ta(r){let t={},i=document.styleSheets;for(let o=0;ot[c]=m)}}catch(u){console.warn("Error",u)}}return t}function X$(r){let t={};return r.split(";").forEach((i)=>{if(i=i.trim(),!i)return;let[o,...n]=i.split(":");t[o?.trim()??""]=n.join(":").trim()}),t}var W$=(r,t)=>{let i=document.elementFromPoint(r,t);if(!i)return;let o=(e)=>{if(e?.shadowRoot){let l=e.shadowRoot.elementFromPoint(r,t);if(l==e)return e;else if(l?.shadowRoot)return o(l);else return l||e}else return e};return o(i)||i},lr=(r,t)=>{let i=r.parentElement,o=i?{domId:i.getAttribute("data-odid"),frameId:St(),branchId:zn(),oid:i.getAttribute("data-oid"),instanceId:i.getAttribute("data-oiid"),rect:i.getBoundingClientRect()}:null,n=r.getBoundingClientRect(),e=t?E$(r):null;return{domId:r.getAttribute("data-odid"),oid:r.getAttribute("data-oid"),frameId:St(),branchId:zn(),instanceId:r.getAttribute("data-oiid"),rect:n,tagName:r.tagName,parent:o,styles:e}};function qi(r){try{let t=r.getAttribute("data-onlook-drag-saved-style");if(t){let i=JSON.parse(t);for(let o in i)r.style[o]=i[o]}}catch(t){console.warn("Error restoring style",t)}}function q$(r){let t=r.parentElement;if(!t)return;return{type:"index",targetDomId:t.getAttribute("data-odid"),targetOid:Gr(t)||Qr(t)||null,index:Array.from(r.parentElement?.children||[]).indexOf(r),originalIndex:Array.from(r.parentElement?.children||[]).indexOf(r)}}var N$=(r)=>{let t=Array.from(r.childNodes).filter((i)=>i.nodeType===Node.TEXT_NODE).map((i)=>i.textContent);if(t.length===0)return;return t.join("")};var Ni=(r,t)=>{let i=Q(r)||document.body;return lr(i,t)},V$=(r,t,i)=>{let o=na(r,t)||document.body;return lr(o,i)},na=(r,t)=>{let i=document.elementFromPoint(r,t);if(!i)return;let o=(e)=>{if(e?.shadowRoot){let l=e.shadowRoot.elementFromPoint(r,t);if(l==e)return e;else if(l?.shadowRoot)return o(l);else return l||e}else return e};return o(i)||i},S$=(r,t,i)=>{let o=Q(r);if(!o){console.warn("Failed to updateElementInstanceId: Element not found");return}o.setAttribute("data-oiid",t),o.setAttribute("data-ocname",i)},Y$=(r)=>{let t=Q(r);if(!t?.parentElement)return null;return lr(t.parentElement,!1)},F$=(r)=>{let t=Q(r);if(!t)return 0;return t.children.length},Q$=(r)=>{let t=Q(r);if(!t)return null;return lr(t.offsetParent,!1)};function G$(r,t,i){let o=Q(r.domId);if(!o)return console.warn("Failed to find parent element",r.domId),null;let n=ia(t),e=new Set(i.map((c)=>c.domId)),l=Array.from(o.children).map((c,m)=>({element:c,index:m,domId:Pr(c)})).filter(({domId:c})=>e.has(c));if(l.length===0)return console.warn("No valid children found to group"),null;let u=Math.min(...l.map((c)=>c.index));return o.insertBefore(n,o.children[u]??null),l.forEach(({element:c})=>{let m=c.cloneNode(!0);m.setAttribute("data-onlook-inserted","true"),n.appendChild(m),c.style.display="none",B$(c)}),{domEl:lr(n,!0),newMap:zr(n)}}function A$(r,t){let i=Q(r.domId);if(!i)return console.warn(`Parent element not found: ${r.domId}`),null;let o;if(t.domId)o=Q(t.domId);else return console.warn("Container domId is required for ungrouping"),null;if(!o)return console.warn("Container element not found for ungrouping"),null;return Array.from(o.children).forEach((l)=>{i.appendChild(l)}),o.remove(),{domEl:lr(i,!0),newMap:zr(i)}}function ia(r){let t=document.createElement(r.tagName);return Object.entries(r.attributes).forEach(([i,o])=>{t.setAttribute(i,o)}),t.setAttribute("data-onlook-inserted","true"),t.setAttribute("data-odid",r.domId),t.setAttribute("data-oid",r.oid),t}function B$(r){r.removeAttribute("data-odid"),r.removeAttribute("data-oid"),r.removeAttribute("data-onlook-inserted");let t=Array.from(r.children);if(t.length===0)return;t.forEach((i)=>{B$(i)})}function Vi(r){let t=Q(r);if(!t)return console.warn("Element not found for domId:",r),null;return y$(t)}function y$(r){let t=Array.from(r.attributes).reduce((o,n)=>{return o[n.name]=n.value,o},{}),i=Gr(r)||Qr(r)||null;if(!i)return console.warn("Element has no oid"),null;return{oid:i,branchId:zn(),domId:Pr(r),tagName:r.tagName.toLowerCase(),children:Array.from(r.children).map((o)=>y$(o)).filter(Boolean),attributes:t,textContent:N$(r)||null,styles:{}}}function R$(r){let t=Q(r);if(!t)throw Error("Element not found for domId: "+r);let i=t.parentElement;if(!i)throw Error("Inserted element has no parent");let o=Gr(i)||Qr(i);if(!o)return console.warn("Parent element has no oid"),null;let n=Pr(i),e=Array.from(i.children).indexOf(t);if(e===-1)return{type:"append",targetDomId:n,targetOid:o};return{type:"index",targetDomId:n,targetOid:o,index:e,originalIndex:e}}function H$(r){let t=document.querySelector(`[${"data-odid"}="${r}"]`);if(!t)return console.warn("No element found",{domId:r}),{dynamicType:null,coreType:null};let i=t.getAttribute("data-onlook-dynamic-type")||null,o=t.getAttribute("data-onlook-core-element-type")||null;return{dynamicType:i,coreType:o}}function M$(r,t,i){let o=document.querySelector(`[${"data-odid"}="${r}"]`);if(o){if(t)o.setAttribute("data-onlook-dynamic-type",t);if(i)o.setAttribute("data-onlook-core-element-type",i)}}function Z$(){let t=document.body.querySelector(`[${"data-oid"}]`);if(t)return lr(t,!0);return null}var Sr=0,w=1,k=2,H=3,F=4,gr=5,Yt=6,er=7,fr=8,P=9,U=10,B=11,L=12,N=13,dr=14,hr=15,d=16,nr=17,ir=18,mr=19,wr=20,X=21,p=22,Z=23,xr=24,y=25;function cr(r){return r>=48&&r<=57}function Ir(r){return cr(r)||r>=65&&r<=70||r>=97&&r<=102}function Fi(r){return r>=65&&r<=90}function oa(r){return r>=97&&r<=122}function ea(r){return Fi(r)||oa(r)}function la(r){return r>=128}function Yi(r){return ea(r)||la(r)||r===95}function _n(r){return Yi(r)||cr(r)||r===45}function ca(r){return r>=0&&r<=8||r===11||r>=14&&r<=31||r===127}function On(r){return r===10||r===13||r===12}function Ar(r){return On(r)||r===32||r===9}function Dr(r,t){if(r!==92)return!1;if(On(t)||t===0)return!1;return!0}function Ft(r,t,i){if(r===45)return Yi(t)||t===45||Dr(t,i);if(Yi(r))return!0;if(r===92)return Dr(r,t);return!1}function Qi(r,t,i){if(r===43||r===45){if(cr(t))return 2;return t===46&&cr(i)?3:0}if(r===46)return cr(t)?2:0;if(cr(r))return 1;return 0}function Gi(r){if(r===65279)return 1;if(r===65534)return 1;return 0}var Fe=Array(128),ua=128,Dn=130,Qe=131,Ai=132,Ge=133;for(let r=0;rr.length)return!1;for(let n=t;n=0;t--)if(!Ar(r.charCodeAt(t)))break;return t+1}function pn(r,t){for(;t=55296&&t<=57343||t>1114111)t=65533;return String.fromCodePoint(t)}var Gt=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function At(r=null,t){if(r===null||r.length0?Gi(t.charCodeAt(0)):0,n=At(r.lines,i),e=At(r.columns,i),l=r.startLine,u=r.startColumn;for(let g=o;g{}){r=String(r||"");let i=r.length,o=At(this.offsetAndType,r.length+1),n=At(this.balance,r.length+1),e=0,l=-1,u=0,g=r.length;this.offsetAndType=null,this.balance=null,n.fill(0),t(r,(c,m,v)=>{let h=e++;if(o[h]=c<>Rr]}else if(r0(c))g=h,u=It[c]}),o[e]=Sr<e)n[c]=e}this.source=r,this.firstCharOffset=l===-1?0:l,this.tokenCount=e,this.offsetAndType=o,this.balance=n,this.reset(),this.next()}lookupType(r){if(r+=this.tokenIndex,r>Rr;return Sr}lookupTypeNonSC(r){for(let t=this.tokenIndex;t>Rr;if(i!==N&&i!==y){if(r--===0)return i}}return Sr}lookupOffset(r){if(r+=this.tokenIndex,r>Rr;if(i!==N&&i!==y){if(r--===0)return t-this.tokenIndex}}return Sr}lookupValue(r,t){if(r+=this.tokenIndex,r0)return r>Rr,this.tokenEnd=t&yr;else this.tokenIndex=this.tokenCount,this.next()}next(){let r=this.tokenIndex+1;if(r>Rr,this.tokenEnd=r&yr;else this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=Sr,this.tokenStart=this.tokenEnd=this.source.length}skipSC(){while(this.tokenType===N||this.tokenType===y)this.next()}skipUntilBalanced(r,t){let i=r,o=0,n=0;r:for(;i0?this.offsetAndType[i-1]&yr:this.firstCharOffset,t(this.source.charCodeAt(n))){case 1:break r;case 2:i++;break r;default:if(r0(this.offsetAndType[i]>>Rr))i=o}}this.skip(i-this.tokenIndex)}forEachToken(r){for(let t=0,i=this.firstCharOffset;t>Rr;i=e,r(l,o,e,t)}}dump(){let r=Array(this.tokenCount);return this.forEachToken((t,i,o,n)=>{r[n]={idx:n,type:Gt[t],chunk:this.source.substring(i,o),balance:this.balance[n]}}),r}}function bt(r,t){function i(v){return v=r.length){if(cString(f+O+1).padStart(h)+" |"+I).join(` +var U4=Object.create;var{getPrototypeOf:J4,defineProperty:Je,getOwnPropertyNames:P4}=Object;var E4=Object.prototype.hasOwnProperty;var Xh=(r,t,i)=>{i=r!=null?U4(J4(r)):{};let o=t||!r||!r.__esModule?Je(i,"default",{value:r,enumerable:!0}):i;for(let n of P4(r))if(!E4.call(o,n))Je(o,n,{get:()=>r[n],enumerable:!0});return o};var vr=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var j=(r,t)=>{for(var i in t)Je(r,i,{get:t[i],enumerable:!0,configurable:!0,set:(o)=>t[i]=()=>o})};var Pe=vr((iU,Wh)=>{function L4(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}Wh.exports=L4});var Nh=vr((oU,qh)=>{var K4=typeof global=="object"&&global&&global.Object===Object&&global;qh.exports=K4});var Ee=vr((eU,Sh)=>{var X4=Nh(),W4=typeof self=="object"&&self&&self.Object===Object&&self,q4=X4||W4||Function("return this")();Sh.exports=q4});var Yh=vr((lU,Vh)=>{var N4=Ee(),S4=function(){return N4.Date.now()};Vh.exports=S4});var Qh=vr((cU,Fh)=>{var V4=/\s/;function Y4(r){var t=r.length;while(t--&&V4.test(r.charAt(t)));return t}Fh.exports=Y4});var Ah=vr((uU,Gh)=>{var F4=Qh(),Q4=/^\s+/;function G4(r){return r?r.slice(0,F4(r)+1).replace(Q4,""):r}Gh.exports=G4});var Le=vr((gU,Bh)=>{var A4=Ee(),B4=A4.Symbol;Bh.exports=B4});var Mh=vr((mU,Hh)=>{var yh=Le(),Rh=Object.prototype,y4=Rh.hasOwnProperty,R4=Rh.toString,wn=yh?yh.toStringTag:void 0;function H4(r){var t=y4.call(r,wn),i=r[wn];try{r[wn]=void 0;var o=!0}catch(e){}var n=R4.call(r);if(o)if(t)r[wn]=i;else delete r[wn];return n}Hh.exports=H4});var Th=vr((bU,Zh)=>{var M4=Object.prototype,Z4=M4.toString;function T4(r){return Z4.call(r)}Zh.exports=T4});var r$=vr((vU,sh)=>{var Ch=Le(),C4=Mh(),d4=Th(),s4="[object Null]",ra="[object Undefined]",dh=Ch?Ch.toStringTag:void 0;function ta(r){if(r==null)return r===void 0?ra:s4;return dh&&dh in Object(r)?C4(r):d4(r)}sh.exports=ta});var n$=vr((hU,t$)=>{function na(r){return r!=null&&typeof r=="object"}t$.exports=na});var o$=vr(($U,i$)=>{var ia=r$(),oa=n$(),ea="[object Symbol]";function la(r){return typeof r=="symbol"||oa(r)&&ia(r)==ea}i$.exports=la});var u$=vr((fU,c$)=>{var ca=Ah(),e$=Pe(),ua=o$(),l$=NaN,ga=/^[-+]0x[0-9a-f]+$/i,ma=/^0b[01]+$/i,ba=/^0o[0-7]+$/i,va=parseInt;function ha(r){if(typeof r=="number")return r;if(ua(r))return l$;if(e$(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=e$(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=ca(r);var i=ma.test(r);return i||ba.test(r)?va(r.slice(2),i?2:8):ga.test(r)?l$:+r}c$.exports=ha});var Xe=vr((xU,m$)=>{var $a=Pe(),Ke=Yh(),g$=u$(),fa="Expected a function",xa=Math.max,wa=Math.min;function aa(r,t,i){var o,n,e,l,u,g,c=0,m=!1,v=!1,h=!0;if(typeof r!="function")throw TypeError(fa);if(t=g$(t)||0,$a(i))m=!!i.leading,v="maxWait"in i,e=v?xa(g$(i.maxWait)||0,t):e,h="trailing"in i?!!i.trailing:h;function b(V){var A=o,tr=n;return o=n=void 0,c=V,l=r.apply(tr,A),l}function x(V){return c=V,u=setTimeout(O,t),m?b(V):l}function D(V){var A=V-g,tr=V-c,Ue=t-A;return v?wa(Ue,e-tr):Ue}function I(V){var A=V-g,tr=V-c;return g===void 0||A>=t||A<0||v&&tr>=e}function O(){var V=Ke();if(I(V))return J(V);u=setTimeout(O,D(V))}function J(V){if(u=void 0,h&&o)return b(V);return o=n=void 0,l}function q(){if(u!==void 0)clearTimeout(u);c=0,o=g=n=u=void 0}function E(){return u===void 0?l:J(Ke())}function K(){var V=Ke(),A=I(V);if(o=arguments,n=this,g=V,A){if(u===void 0)return x(g);if(v)return clearTimeout(u),u=setTimeout(O,t),b(g)}if(u===void 0)u=setTimeout(O,t);return l}return K.cancel=q,K.flush=E,K}m$.exports=aa});var b0=vr((f6)=>{var m0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");f6.encode=function(r){if(0<=r&&r{var v0=b0(),Me=5,h0=1<>1;return t?-i:i}_6.encode=function(t){var i="",o,n=a6(t);do{if(o=n&$0,n>>>=Me,n>0)o|=f0;i+=v0.encode(o)}while(n>0);return i};_6.decode=function(t,i,o){var n=t.length,e=0,l=0,u,g;do{if(i>=n)throw Error("Expected more digits in base 64 VLQ value.");if(g=v0.decode(t.charCodeAt(i++)),g===-1)throw Error("Invalid base64 digit: "+t.charAt(i-1));u=!!(g&f0),g&=$0,e=e+(g<{function p6(r,t,i){if(t in r)return r[t];else if(arguments.length===3)return i;else throw Error('"'+t+'" is a required argument.')}S6.getArg=p6;var w0=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,I6=/^data:.+\,.+$/;function kn(r){var t=r.match(w0);if(!t)return null;return{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}}S6.urlParse=kn;function yt(r){var t="";if(r.scheme)t+=r.scheme+":";if(t+="//",r.auth)t+=r.auth+"@";if(r.host)t+=r.host;if(r.port)t+=":"+r.port;if(r.path)t+=r.path;return t}S6.urlGenerate=yt;var j6=32;function k6(r){var t=[];return function(i){for(var o=0;oj6)t.pop();return e}}var Ze=k6(function(t){var i=t,o=kn(t);if(o){if(!o.path)return t;i=o.path}var n=S6.isAbsolute(i),e=[],l=0,u=0;while(!0)if(l=u,u=i.indexOf("/",l),u===-1){e.push(i.slice(l));break}else{e.push(i.slice(l,u));while(u=0;u--)if(g=e[u],g===".")e.splice(u,1);else if(g==="..")c++;else if(c>0)if(g==="")e.splice(u+1,c),c=0;else e.splice(u,2),c--;if(i=e.join("/"),i==="")i=n?"/":".";if(o)return o.path=i,yt(o);return i});S6.normalize=Ze;function a0(r,t){if(r==="")r=".";if(t==="")t=".";var i=kn(t),o=kn(r);if(o)r=o.path||"/";if(i&&!i.scheme){if(o)i.scheme=o.scheme;return yt(i)}if(i||t.match(I6))return t;if(o&&!o.host&&!o.path)return o.host=t,yt(o);var n=t.charAt(0)==="/"?t:Ze(r.replace(/\/+$/,"")+"/"+t);if(o)return o.path=n,yt(o);return n}S6.join=a0;S6.isAbsolute=function(r){return r.charAt(0)==="/"||w0.test(r)};function U6(r,t){if(r==="")r=".";r=r.replace(/\/$/,"");var i=0;while(t.indexOf(r+"/")!==0){var o=r.lastIndexOf("/");if(o<0)return t;if(r=r.slice(0,o),r.match(/^([^\/]+:\/)?\/*$/))return t;++i}return Array(i+1).join("../")+t.substr(r.length+1)}S6.relative=U6;var z0=function(){var r=Object.create(null);return!("__proto__"in r)}();function _0(r){return r}function J6(r){if(O0(r))return"$"+r;return r}S6.toSetString=z0?_0:J6;function P6(r){if(O0(r))return r.slice(1);return r}S6.fromSetString=z0?_0:P6;function O0(r){if(!r)return!1;var t=r.length;if(t<9)return!1;if(r.charCodeAt(t-1)!==95||r.charCodeAt(t-2)!==95||r.charCodeAt(t-3)!==111||r.charCodeAt(t-4)!==116||r.charCodeAt(t-5)!==111||r.charCodeAt(t-6)!==114||r.charCodeAt(t-7)!==112||r.charCodeAt(t-8)!==95||r.charCodeAt(t-9)!==95)return!1;for(var i=t-10;i>=0;i--)if(r.charCodeAt(i)!==36)return!1;return!0}function E6(r,t,i){var o=tt(r.source,t.source);if(o!==0)return o;if(o=r.originalLine-t.originalLine,o!==0)return o;if(o=r.originalColumn-t.originalColumn,o!==0||i)return o;if(o=r.generatedColumn-t.generatedColumn,o!==0)return o;if(o=r.generatedLine-t.generatedLine,o!==0)return o;return tt(r.name,t.name)}S6.compareByOriginalPositions=E6;function L6(r,t,i){var o=r.originalLine-t.originalLine;if(o!==0)return o;if(o=r.originalColumn-t.originalColumn,o!==0||i)return o;if(o=r.generatedColumn-t.generatedColumn,o!==0)return o;if(o=r.generatedLine-t.generatedLine,o!==0)return o;return tt(r.name,t.name)}S6.compareByOriginalPositionsNoSource=L6;function K6(r,t,i){var o=r.generatedLine-t.generatedLine;if(o!==0)return o;if(o=r.generatedColumn-t.generatedColumn,o!==0||i)return o;if(o=tt(r.source,t.source),o!==0)return o;if(o=r.originalLine-t.originalLine,o!==0)return o;if(o=r.originalColumn-t.originalColumn,o!==0)return o;return tt(r.name,t.name)}S6.compareByGeneratedPositionsDeflated=K6;function X6(r,t,i){var o=r.generatedColumn-t.generatedColumn;if(o!==0||i)return o;if(o=tt(r.source,t.source),o!==0)return o;if(o=r.originalLine-t.originalLine,o!==0)return o;if(o=r.originalColumn-t.originalColumn,o!==0)return o;return tt(r.name,t.name)}S6.compareByGeneratedPositionsDeflatedNoLine=X6;function tt(r,t){if(r===t)return 0;if(r===null)return 1;if(t===null)return-1;if(r>t)return 1;return-1}function W6(r,t){var i=r.generatedLine-t.generatedLine;if(i!==0)return i;if(i=r.generatedColumn-t.generatedColumn,i!==0)return i;if(i=tt(r.source,t.source),i!==0)return i;if(i=r.originalLine-t.originalLine,i!==0)return i;if(i=r.originalColumn-t.originalColumn,i!==0)return i;return tt(r.name,t.name)}S6.compareByGeneratedPositionsInflated=W6;function q6(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}S6.parseSourceMapInput=q6;function N6(r,t,i){if(t=t||"",r){if(r[r.length-1]!=="/"&&t[0]!=="/")r+="/";t=r+t}if(i){var o=kn(i);if(!o)throw Error("sourceMapURL could not be parsed");if(o.path){var n=o.path.lastIndexOf("/");if(n>=0)o.path=o.path.substring(0,n+1)}t=a0(yt(o),t)}return Ze(t)}S6.computeSourceURL=N6});var D0=vr((rz)=>{var Te=Zi(),Ce=Object.prototype.hasOwnProperty,kt=typeof Map<"u";function nt(){this._array=[],this._set=kt?new Map:Object.create(null)}nt.fromArray=function(t,i){var o=new nt;for(var n=0,e=t.length;n=0)return i}else{var o=Te.toSetString(t);if(Ce.call(this._set,o))return this._set[o]}throw Error('"'+t+'" is not in the set.')};nt.prototype.at=function(t){if(t>=0&&t{var p0=Zi();function nz(r,t){var i=r.generatedLine,o=t.generatedLine,n=r.generatedColumn,e=t.generatedColumn;return o>i||o==i&&e>=n||p0.compareByGeneratedPositionsInflated(r,t)<=0}function Ti(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ti.prototype.unsortedForEach=function(t,i){this._array.forEach(t,i)};Ti.prototype.add=function(t){if(nz(this._last,t))this._last=t,this._array.push(t);else this._sorted=!1,this._array.push(t)};Ti.prototype.toArray=function(){if(!this._sorted)this._array.sort(p0.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};iz.MappingList=Ti});var qt="PENPAL_CHILD";var j4=Xh(Xe(),1);var za=class extends Error{code;constructor(r,t){super(t);this.name="PenpalError",this.code=r}},Or=za,_a=(r)=>({name:r.name,message:r.message,stack:r.stack,penpalCode:r instanceof Or?r.code:void 0}),Oa=({name:r,message:t,stack:i,penpalCode:o})=>{let n=o?new Or(o,t):Error(t);return n.name=r,n.stack=i,n},Da=Symbol("Reply"),pa=class{value;transferables;#r=Da;constructor(r,t){this.value=r,this.transferables=t?.transferables}},Ia=pa,Jr="penpal",Ki=(r)=>{return typeof r==="object"&&r!==null},f$=(r)=>{return typeof r==="function"},ja=(r)=>{return Ki(r)&&r.namespace===Jr},Nt=(r)=>{return r.type==="SYN"},Xi=(r)=>{return r.type==="ACK1"},an=(r)=>{return r.type==="ACK2"},x$=(r)=>{return r.type==="CALL"},w$=(r)=>{return r.type==="REPLY"},ka=(r)=>{return r.type==="DESTROY"},a$=(r,t=[])=>{let i=[];for(let o of Object.keys(r)){let n=r[o];if(f$(n))i.push([...t,o]);else if(Ki(n))i.push(...a$(n,[...t,o]))}return i},Ua=(r,t)=>{let i=r.reduce((o,n)=>{return Ki(o)?o[n]:void 0},t);return f$(i)?i:void 0},mt=(r)=>{return r.join(".")},b$=(r,t,i)=>({namespace:Jr,channel:r,type:"REPLY",callId:t,isError:!0,...i instanceof Error?{value:_a(i),isSerializedErrorInstance:!0}:{value:i}}),Ja=(r,t,i,o)=>{let n=!1,e=async(l)=>{if(n)return;if(!x$(l))return;o?.(`Received ${mt(l.methodPath)}() call`,l);let{methodPath:u,args:g,id:c}=l,m,v;try{let h=Ua(u,t);if(!h)throw new Or("METHOD_NOT_FOUND",`Method \`${mt(u)}\` is not found.`);let b=await h(...g);if(b instanceof Ia)v=b.transferables,b=await b.value;m={namespace:Jr,channel:i,type:"REPLY",callId:c,value:b}}catch(h){m=b$(i,c,h)}if(n)return;try{o?.(`Sending ${mt(u)}() reply`,m),r.sendMessage(m,v)}catch(h){if(h.name==="DataCloneError")m=b$(i,c,h),o?.(`Sending ${mt(u)}() reply`,m),r.sendMessage(m);throw h}};return r.addMessageHandler(e),()=>{n=!0,r.removeMessageHandler(e)}},Pa=Ja,z$=crypto.randomUUID?.bind(crypto)??(()=>[,,,,].fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")),Ea=Symbol("CallOptions"),La=class{transferables;timeout;#r=Ea;constructor(r){this.transferables=r?.transferables,this.timeout=r?.timeout}},Ka=La,Xa=new Set(["apply","call","bind"]),_$=(r,t,i=[])=>{return new Proxy(i.length?()=>{}:Object.create(null),{get(o,n){if(n==="then")return;if(i.length&&Xa.has(n))return Reflect.get(o,n);return _$(r,t,[...i,n])},apply(o,n,e){return r(i,e)}})},v$=(r)=>{return new Or("CONNECTION_DESTROYED",`Method call ${mt(r)}() failed due to destroyed connection`)},Wa=(r,t,i)=>{let o=!1,n=new Map,e=(g)=>{if(!w$(g))return;let{callId:c,value:m,isError:v,isSerializedErrorInstance:h}=g,b=n.get(c);if(!b)return;if(n.delete(c),i?.(`Received ${mt(b.methodPath)}() call`,g),v)b.reject(h?Oa(m):m);else b.resolve(m)};return r.addMessageHandler(e),{remoteProxy:_$((g,c)=>{if(o)throw v$(g);let m=z$(),v=c[c.length-1],h=v instanceof Ka,{timeout:b,transferables:x}=h?v:{},D=h?c.slice(0,-1):c;return new Promise((I,O)=>{let J=b!==void 0?window.setTimeout(()=>{n.delete(m),O(new Or("METHOD_CALL_TIMEOUT",`Method call ${mt(g)}() timed out after ${b}ms`))},b):void 0;n.set(m,{methodPath:g,resolve:I,reject:O,timeoutId:J});try{let q={namespace:Jr,channel:t,type:"CALL",id:m,methodPath:g,args:D};i?.(`Sending ${mt(g)}() call`,q),r.sendMessage(q,x)}catch(q){O(new Or("TRANSMISSION_FAILED",q.message))}})},i),destroy:()=>{o=!0,r.removeMessageHandler(e);for(let{methodPath:g,reject:c,timeoutId:m}of n.values())clearTimeout(m),c(v$(g));n.clear()}}},qa=Wa,Na=()=>{let r,t;return{promise:new Promise((o,n)=>{r=o,t=n}),resolve:r,reject:t}},Sa=Na,Va=class extends Error{constructor(r){super(`You've hit a bug in Penpal. Please file an issue with the following information: ${r}`)}},St=Va,We="deprecated-penpal",Ya=(r)=>{return Ki(r)&&"penpal"in r},Fa=(r)=>r.split("."),h$=(r)=>r.join("."),O$=(r)=>{return new St(`Unexpected message to translate: ${JSON.stringify(r)}`)},Qa=(r)=>{if(r.penpal==="syn")return{namespace:Jr,channel:void 0,type:"SYN",participantId:We};if(r.penpal==="ack")return{namespace:Jr,channel:void 0,type:"ACK2"};if(r.penpal==="call")return{namespace:Jr,channel:void 0,type:"CALL",id:r.id,methodPath:Fa(r.methodName),args:r.args};if(r.penpal==="reply")if(r.resolution==="fulfilled")return{namespace:Jr,channel:void 0,type:"REPLY",callId:r.id,value:r.returnValue};else return{namespace:Jr,channel:void 0,type:"REPLY",callId:r.id,isError:!0,...r.returnValueIsError?{value:r.returnValue,isSerializedErrorInstance:!0}:{value:r.returnValue}};throw O$(r)},Ga=(r)=>{if(Xi(r))return{penpal:"synAck",methodNames:r.methodPaths.map(h$)};if(x$(r))return{penpal:"call",id:r.id,methodName:h$(r.methodPath),args:r.args};if(w$(r))if(r.isError)return{penpal:"reply",id:r.callId,resolution:"rejected",...r.isSerializedErrorInstance?{returnValue:r.value,returnValueIsError:!0}:{returnValue:r.value}};else return{penpal:"reply",id:r.callId,resolution:"fulfilled",returnValue:r.value};throw O$(r)},Aa=({messenger:r,methods:t,timeout:i,channel:o,log:n})=>{let e=z$(),l,u=[],g=!1,c=a$(t),{promise:m,resolve:v,reject:h}=Sa(),b=i!==void 0?setTimeout(()=>{h(new Or("CONNECTION_TIMEOUT",`Connection timed out after ${i}ms`))},i):void 0,x=()=>{for(let K of u)K()},D=()=>{if(g)return;u.push(Pa(r,t,o,n));let{remoteProxy:K,destroy:V}=qa(r,o,n);u.push(V),clearTimeout(b),g=!0,v({remoteProxy:K,destroy:x})},I=()=>{let K={namespace:Jr,type:"SYN",channel:o,participantId:e};n?.("Sending handshake SYN",K);try{r.sendMessage(K)}catch(V){h(new Or("TRANSMISSION_FAILED",V.message))}},O=(K)=>{if(n?.("Received handshake SYN",K),K.participantId===l&&l!==We)return;if(l=K.participantId,I(),!(e>l||l===We))return;let A={namespace:Jr,channel:o,type:"ACK1",methodPaths:c};n?.("Sending handshake ACK1",A);try{r.sendMessage(A)}catch(tr){h(new Or("TRANSMISSION_FAILED",tr.message));return}},J=(K)=>{n?.("Received handshake ACK1",K);let V={namespace:Jr,channel:o,type:"ACK2"};n?.("Sending handshake ACK2",V);try{r.sendMessage(V)}catch(A){h(new Or("TRANSMISSION_FAILED",A.message));return}D()},q=(K)=>{n?.("Received handshake ACK2",K),D()},E=(K)=>{if(Nt(K))O(K);if(Xi(K))J(K);if(an(K))q(K)};return r.addMessageHandler(E),u.push(()=>r.removeMessageHandler(E)),I(),m},Ba=Aa,ya=(r)=>{let t=!1,i;return(...o)=>{if(!t)t=!0,i=r(...o);return i}},Ra=ya,$$=new WeakSet,Ha=({messenger:r,methods:t={},timeout:i,channel:o,log:n})=>{if(!r)throw new Or("INVALID_ARGUMENT","messenger must be defined");if($$.has(r))throw new Or("INVALID_ARGUMENT","A messenger can only be used for a single connection");$$.add(r);let e=[r.destroy],l=Ra((c)=>{if(c){let m={namespace:Jr,channel:o,type:"DESTROY"};try{r.sendMessage(m)}catch(v){}}for(let m of e)m();n?.("Connection destroyed")}),u=(c)=>{return ja(c)&&c.channel===o};return{promise:(async()=>{try{r.initialize({log:n,validateReceivedMessage:u}),r.addMessageHandler((v)=>{if(ka(v))l(!1)});let{remoteProxy:c,destroy:m}=await Ba({messenger:r,methods:t,timeout:i,channel:o,log:n});return e.push(m),c}catch(c){throw l(!0),c}})(),destroy:()=>{l(!0)}}},D$=Ha,Ma=class{#r;#o;#n;#t;#l;#i=new Set;#e;#c=!1;constructor({remoteWindow:r,allowedOrigins:t}){if(!r)throw new Or("INVALID_ARGUMENT","remoteWindow must be defined");this.#r=r,this.#o=t?.length?t:[window.origin]}initialize=({log:r,validateReceivedMessage:t})=>{this.#n=r,this.#t=t,window.addEventListener("message",this.#b)};sendMessage=(r,t)=>{if(Nt(r)){let i=this.#u(r);this.#r.postMessage(r,{targetOrigin:i,transfer:t});return}if(Xi(r)||this.#c){let i=this.#c?Ga(r):r,o=this.#u(r);this.#r.postMessage(i,{targetOrigin:o,transfer:t});return}if(an(r)){let{port1:i,port2:o}=new MessageChannel;this.#e=i,i.addEventListener("message",this.#g),i.start();let n=[o,...t||[]],e=this.#u(r);this.#r.postMessage(r,{targetOrigin:e,transfer:n});return}if(this.#e){this.#e.postMessage(r,{transfer:t});return}throw new St("Port is undefined")};addMessageHandler=(r)=>{this.#i.add(r)};removeMessageHandler=(r)=>{this.#i.delete(r)};destroy=()=>{window.removeEventListener("message",this.#b),this.#m(),this.#i.clear()};#v=(r)=>{return this.#o.some((t)=>t instanceof RegExp?t.test(r):t===r||t==="*")};#u=(r)=>{if(Nt(r))return"*";if(!this.#l)throw new St("Concrete remote origin not set");return this.#l==="null"&&this.#o.includes("*")?"*":this.#l};#m=()=>{this.#e?.removeEventListener("message",this.#g),this.#e?.close(),this.#e=void 0};#b=({source:r,origin:t,ports:i,data:o})=>{if(r!==this.#r)return;if(Ya(o))this.#n?.("Please upgrade the child window to the latest version of Penpal."),this.#c=!0,o=Qa(o);if(!this.#t?.(o))return;if(!this.#v(t)){this.#n?.(`Received a message from origin \`${t}\` which did not match allowed origins \`[${this.#o.join(", ")}]\``);return}if(Nt(o))this.#m(),this.#l=t;if(an(o)&&!this.#c){if(this.#e=i[0],!this.#e)throw new St("No port received on ACK2");this.#e.addEventListener("message",this.#g),this.#e.start()}for(let n of this.#i)n(o)};#g=({data:r})=>{if(!this.#t?.(r))return;for(let t of this.#i)t(r)}},p$=Ma,wU=class{#r;#o;#n=new Set;#t;constructor({worker:r}){if(!r)throw new Or("INVALID_ARGUMENT","worker must be defined");this.#r=r}initialize=({validateReceivedMessage:r})=>{this.#o=r,this.#r.addEventListener("message",this.#i)};sendMessage=(r,t)=>{if(Nt(r)||Xi(r)){this.#r.postMessage(r,{transfer:t});return}if(an(r)){let{port1:i,port2:o}=new MessageChannel;this.#t=i,i.addEventListener("message",this.#i),i.start(),this.#r.postMessage(r,{transfer:[o,...t||[]]});return}if(this.#t){this.#t.postMessage(r,{transfer:t});return}throw new St("Port is undefined")};addMessageHandler=(r)=>{this.#n.add(r)};removeMessageHandler=(r)=>{this.#n.delete(r)};destroy=()=>{this.#r.removeEventListener("message",this.#i),this.#l(),this.#n.clear()};#l=()=>{this.#t?.removeEventListener("message",this.#i),this.#t?.close(),this.#t=void 0};#i=({ports:r,data:t})=>{if(!this.#o?.(t))return;if(Nt(t))this.#l();if(an(t)){if(this.#t=r[0],!this.#t)throw new St("No port received on ACK2");this.#t.addEventListener("message",this.#i),this.#t.start()}for(let i of this.#n)i(t)}};var aU=class{#r;#o;#n=new Set;constructor({port:r}){if(!r)throw new Or("INVALID_ARGUMENT","port must be defined");this.#r=r}initialize=({validateReceivedMessage:r})=>{this.#o=r,this.#r.addEventListener("message",this.#t),this.#r.start()};sendMessage=(r,t)=>{this.#r?.postMessage(r,{transfer:t})};addMessageHandler=(r)=>{this.#n.add(r)};removeMessageHandler=(r)=>{this.#n.delete(r)};destroy=()=>{this.#r.removeEventListener("message",this.#t),this.#r.close(),this.#n.clear()};#t=({data:r})=>{if(!this.#o?.(r))return;for(let t of this.#n)t(r)}};var I$=["SCRIPT","STYLE","LINK","META","NOSCRIPT"],j$=new Set(["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","h1","h2","h3","h4","h5","h6","i","iframe","img","input","ins","kbd","label","li","map","mark","meter","noscript","object","output","p","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr"]);var qU={SCALE:0.7,PAN_POSITION:{x:175,y:100},URL:"http://localhost:3000/",ASPECT_RATIO_LOCKED:!1,DEVICE:"Custom:Custom",THEME:"system",ORIENTATION:"Portrait",MIN_DIMENSIONS:{width:"280px",height:"360px"},COMMANDS:{run:"bun run dev",build:"bun run build",install:"bun install"},IMAGE_FOLDER:"public",IMAGE_DIMENSION:{width:"100px",height:"100px"},FONT_FOLDER:"fonts",FONT_CONFIG:"app/fonts.ts",TAILWIND_CONFIG:"tailwind.config.ts",CHAT_SETTINGS:{showSuggestions:!0,autoApplyCode:!0,expandCodeBlocks:!1,showMiniChat:!1,maxImages:5},EDITOR_SETTINGS:{shouldWarnDelete:!1,enableBunReplace:!0,buildFlags:"--no-lint"}};var qe=["node_modules","dist","build",".git",".next"];var SU=[...qe,"static","out",".next-prod",".onlook","public/onlook-preload-script.js"],VU=[...qe,".next-prod"],YU=[...qe,"coverage"],Za=[".jsx",".tsx"],Ta=[".js",".ts",".mjs",".cjs"],FU=[...Za,...Ta];var AU={["en"]:"English",["ja"]:"日本語",["zh"]:"中文",["ko"]:"한국어"};var P$=Xh(Xe(),1);function Q(r){return document.querySelector(`[${"data-odid"}="${r}"]`)}function Ne(r,t=!1){let i=`[${"data-odid"}="${r}"]`;if(!t)return i;return Ca(i)}function Ca(r){return CSS.escape(r)}function Dt(r){return r&&r instanceof Node&&r.nodeType===Node.ELEMENT_NODE&&!I$.includes(r.tagName)&&!r.hasAttribute("data-onlook-ignore")&&r.style.display!=="none"}var da="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var k$=(r=21)=>{let t="",i=r|0;while(i--)t+=da[Math.random()*64|0];return t};function Pr(r){let t=r.getAttribute("data-odid");if(!t)t=`odid-${k$()}`,r.setAttribute("data-odid",t);return t}function Qr(r){return r.getAttribute("data-oid")}function Gr(r){return r.getAttribute("data-oiid")}function U$(r,t){if(!ar)return;ar.onDomProcessed({layerMap:Object.fromEntries(r),rootNode:t}).catch((i)=>{console.error("Failed to send DOM processed event:",i)})}function Se(r){window._onlookFrameId=r}function Vt(){let r=window._onlookFrameId;if(!r)return console.warn("Frame id not found"),ar?.getFrameId().then((t)=>{Se(t)}),"";return r}function Ve(r){window._onlookBranchId=r}function zn(){let r=window._onlookBranchId;if(!r)return console.warn("Branch id not found"),ar?.getBranchId().then((t)=>{Ve(t)}),"";return r}function sa(r=document.body){if(!Vt())return console.warn("frameView id not found, skipping dom processing"),null;let i=zr(r);if(!i)return console.warn("Error building layer tree, root element is null"),null;let o=r.getAttribute("data-odid");if(!o)return console.warn("Root dom id not found"),null;let n=i.get(o);if(!n)return console.warn("Root node not found"),null;return U$(i,n),{rootDomId:o,layerMap:Array.from(i.entries())}}var Wi=P$.default(sa,500),r6=[(r)=>{let t=r.parentElement;return t&&t.tagName.toLowerCase()==="svg"},(r)=>{return r.tagName.toLowerCase()==="next-route-announcer"},(r)=>{return r.tagName.toLowerCase()==="nextjs-portal"}];function zr(r){if(!Dt(r))return null;let t=new Map,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:(e)=>{let l=e;if(r6.some((u)=>u(l)))return NodeFilter.FILTER_REJECT;return Dt(l)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),o=J$(r);o.children=[],t.set(o.domId,o);let n=i.nextNode();while(n){let e=J$(n);e.children=[];let l=n.parentElement;if(l){let u=l.getAttribute("data-odid");if(u){e.parent=u;let g=t.get(u);if(g&&g.children)g.children.push(e.domId)}}t.set(e.domId,e),n=i.nextNode()}return t}function J$(r){let t=Pr(r),i=Qr(r),o=Gr(r),n=Array.from(r.childNodes).map((g)=>g.nodeType===Node.TEXT_NODE?g.textContent:"").join(" ").trim().slice(0,500),e=window.getComputedStyle(r),l=r.getAttribute("data-ocname");return{domId:t,oid:i||null,instanceId:o||null,textContent:n||"",tagName:r.tagName.toLowerCase(),isVisible:e.visibility!=="hidden",component:l||null,frameId:Vt(),children:null,parent:null,dynamicType:null,coreElementType:null}}function Ye(r){throw Error(`Expected \`never\`, found: ${JSON.stringify(r)}`)}var E$=(r)=>JSON.parse(JSON.stringify(r));function L$(r){let t=X$(r),i=t6(r),o=n6(r);return{defined:{width:"auto",height:"auto",...i,...o},computed:t}}function K$(r){let t=Q(r);if(!t)return{};return X$(t)}function X$(r){return E$(window.getComputedStyle(r))}function t6(r){let t={},i=W$(r.style.cssText);return Object.entries(i).forEach(([o,n])=>{t[o]=n}),t}function n6(r){let t={},i=document.styleSheets;for(let o=0;ot[c]=m)}}catch(u){console.warn("Error",u)}}return t}function W$(r){let t={};return r.split(";").forEach((i)=>{if(i=i.trim(),!i)return;let[o,...n]=i.split(":");t[o?.trim()??""]=n.join(":").trim()}),t}var q$=(r,t)=>{let i=document.elementFromPoint(r,t);if(!i)return;let o=(e)=>{if(e?.shadowRoot){let l=e.shadowRoot.elementFromPoint(r,t);if(l==e)return e;else if(l?.shadowRoot)return o(l);else return l||e}else return e};return o(i)||i},lr=(r,t)=>{let i=r.parentElement,o=i?{domId:i.getAttribute("data-odid"),frameId:Vt(),branchId:zn(),oid:i.getAttribute("data-oid"),instanceId:i.getAttribute("data-oiid"),rect:i.getBoundingClientRect()}:null,n=r.getBoundingClientRect(),e=t?L$(r):null;return{domId:r.getAttribute("data-odid"),oid:r.getAttribute("data-oid"),frameId:Vt(),branchId:zn(),instanceId:r.getAttribute("data-oiid"),rect:n,tagName:r.tagName,parent:o,styles:e}};function qi(r){try{let t=r.getAttribute("data-onlook-drag-saved-style");if(t){let i=JSON.parse(t);for(let o in i)r.style[o]=i[o]}}catch(t){console.warn("Error restoring style",t)}}function N$(r){let t=r.parentElement;if(!t)return;return{type:"index",targetDomId:t.getAttribute("data-odid"),targetOid:Gr(t)||Qr(t)||null,index:Array.from(r.parentElement?.children||[]).indexOf(r),originalIndex:Array.from(r.parentElement?.children||[]).indexOf(r)}}var S$=(r)=>{let t=Array.from(r.childNodes).filter((i)=>i.nodeType===Node.TEXT_NODE).map((i)=>i.textContent);if(t.length===0)return;return t.join("")};var Ni=(r,t)=>{let i=Q(r)||document.body;return lr(i,t)},V$=(r,t,i)=>{let o=i6(r,t)||document.body;return lr(o,i)},i6=(r,t)=>{let i=document.elementFromPoint(r,t);if(!i)return;let o=(e)=>{if(e?.shadowRoot){let l=e.shadowRoot.elementFromPoint(r,t);if(l==e)return e;else if(l?.shadowRoot)return o(l);else return l||e}else return e};return o(i)||i},Y$=(r,t,i)=>{let o=Q(r);if(!o){console.warn("Failed to updateElementInstanceId: Element not found");return}o.setAttribute("data-oiid",t),o.setAttribute("data-ocname",i)},F$=(r)=>{let t=Q(r);if(!t?.parentElement)return null;return lr(t.parentElement,!1)},Q$=(r)=>{let t=Q(r);if(!t)return 0;return t.children.length},G$=(r)=>{let t=Q(r);if(!t)return null;return lr(t.offsetParent,!1)};function A$(r,t,i){let o=Q(r.domId);if(!o)return console.warn("Failed to find parent element",r.domId),null;let n=o6(t),e=new Set(i.map((c)=>c.domId)),l=Array.from(o.children).map((c,m)=>({element:c,index:m,domId:Pr(c)})).filter(({domId:c})=>e.has(c));if(l.length===0)return console.warn("No valid children found to group"),null;let u=Math.min(...l.map((c)=>c.index));return o.insertBefore(n,o.children[u]??null),l.forEach(({element:c})=>{let m=c.cloneNode(!0);m.setAttribute("data-onlook-inserted","true"),n.appendChild(m),c.style.display="none",y$(c)}),{domEl:lr(n,!0),newMap:zr(n)}}function B$(r,t){let i=Q(r.domId);if(!i)return console.warn(`Parent element not found: ${r.domId}`),null;let o;if(t.domId)o=Q(t.domId);else return console.warn("Container domId is required for ungrouping"),null;if(!o)return console.warn("Container element not found for ungrouping"),null;return Array.from(o.children).forEach((l)=>{i.appendChild(l)}),o.remove(),{domEl:lr(i,!0),newMap:zr(i)}}function o6(r){let t=document.createElement(r.tagName);return Object.entries(r.attributes).forEach(([i,o])=>{t.setAttribute(i,o)}),t.setAttribute("data-onlook-inserted","true"),t.setAttribute("data-odid",r.domId),t.setAttribute("data-oid",r.oid),t}function y$(r){r.removeAttribute("data-odid"),r.removeAttribute("data-oid"),r.removeAttribute("data-onlook-inserted");let t=Array.from(r.children);if(t.length===0)return;t.forEach((i)=>{y$(i)})}function Si(r){let t=Q(r);if(!t)return console.warn("Element not found for domId:",r),null;return R$(t)}function R$(r){let t=Array.from(r.attributes).reduce((o,n)=>{return o[n.name]=n.value,o},{}),i=Gr(r)||Qr(r)||null;if(!i)return console.warn("Element has no oid"),null;return{oid:i,branchId:zn(),domId:Pr(r),tagName:r.tagName.toLowerCase(),children:Array.from(r.children).map((o)=>R$(o)).filter(Boolean),attributes:t,textContent:S$(r)||null,styles:{}}}function H$(r){let t=Q(r);if(!t)throw Error("Element not found for domId: "+r);let i=t.parentElement;if(!i)throw Error("Inserted element has no parent");let o=Gr(i)||Qr(i);if(!o)return console.warn("Parent element has no oid"),null;let n=Pr(i),e=Array.from(i.children).indexOf(t);if(e===-1)return{type:"append",targetDomId:n,targetOid:o};return{type:"index",targetDomId:n,targetOid:o,index:e,originalIndex:e}}function M$(r){let t=document.querySelector(`[${"data-odid"}="${r}"]`);if(!t)return console.warn("No element found",{domId:r}),{dynamicType:null,coreType:null};let i=t.getAttribute("data-onlook-dynamic-type")||null,o=t.getAttribute("data-onlook-core-element-type")||null;return{dynamicType:i,coreType:o}}function Z$(r,t,i){let o=document.querySelector(`[${"data-odid"}="${r}"]`);if(o){if(t)o.setAttribute("data-onlook-dynamic-type",t);if(i)o.setAttribute("data-onlook-core-element-type",i)}}function T$(){let t=document.body.querySelector(`[${"data-oid"}]`);if(t)return lr(t,!0);return null}var Vr=0,w=1,k=2,H=3,F=4,gr=5,Yt=6,er=7,xr=8,P=9,U=10,B=11,L=12,N=13,dr=14,hr=15,d=16,nr=17,ir=18,mr=19,wr=20,X=21,p=22,Z=23,fr=24,y=25;function cr(r){return r>=48&&r<=57}function Ir(r){return cr(r)||r>=65&&r<=70||r>=97&&r<=102}function Fi(r){return r>=65&&r<=90}function e6(r){return r>=97&&r<=122}function l6(r){return Fi(r)||e6(r)}function c6(r){return r>=128}function Yi(r){return l6(r)||c6(r)||r===95}function _n(r){return Yi(r)||cr(r)||r===45}function u6(r){return r>=0&&r<=8||r===11||r>=14&&r<=31||r===127}function On(r){return r===10||r===13||r===12}function Ar(r){return On(r)||r===32||r===9}function Dr(r,t){if(r!==92)return!1;if(On(t)||t===0)return!1;return!0}function Ft(r,t,i){if(r===45)return Yi(t)||t===45||Dr(t,i);if(Yi(r))return!0;if(r===92)return Dr(r,t);return!1}function Qi(r,t,i){if(r===43||r===45){if(cr(t))return 2;return t===46&&cr(i)?3:0}if(r===46)return cr(t)?2:0;if(cr(r))return 1;return 0}function Gi(r){if(r===65279)return 1;if(r===65534)return 1;return 0}var Fe=Array(128),g6=128,Dn=130,Qe=131,Ai=132,Ge=133;for(let r=0;rr.length)return!1;for(let n=t;n=0;t--)if(!Ar(r.charCodeAt(t)))break;return t+1}function pn(r,t){for(;t=55296&&t<=57343||t>1114111)t=65533;return String.fromCodePoint(t)}var Gt=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function At(r=null,t){if(r===null||r.length0?Gi(t.charCodeAt(0)):0,n=At(r.lines,i),e=At(r.columns,i),l=r.startLine,u=r.startColumn;for(let g=o;g{}){r=String(r||"");let i=r.length,o=At(this.offsetAndType,r.length+1),n=At(this.balance,r.length+1),e=0,l=-1,u=0,g=r.length;this.offsetAndType=null,this.balance=null,n.fill(0),t(r,(c,m,v)=>{let h=e++;if(o[h]=c<>Rr]}else if(t0(c))g=h,u=It[c]}),o[e]=Vr<e)n[c]=e}this.source=r,this.firstCharOffset=l===-1?0:l,this.tokenCount=e,this.offsetAndType=o,this.balance=n,this.reset(),this.next()}lookupType(r){if(r+=this.tokenIndex,r>Rr;return Vr}lookupTypeNonSC(r){for(let t=this.tokenIndex;t>Rr;if(i!==N&&i!==y){if(r--===0)return i}}return Vr}lookupOffset(r){if(r+=this.tokenIndex,r>Rr;if(i!==N&&i!==y){if(r--===0)return t-this.tokenIndex}}return Vr}lookupValue(r,t){if(r+=this.tokenIndex,r0)return r>Rr,this.tokenEnd=t&yr;else this.tokenIndex=this.tokenCount,this.next()}next(){let r=this.tokenIndex+1;if(r>Rr,this.tokenEnd=r&yr;else this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=Vr,this.tokenStart=this.tokenEnd=this.source.length}skipSC(){while(this.tokenType===N||this.tokenType===y)this.next()}skipUntilBalanced(r,t){let i=r,o=0,n=0;r:for(;i0?this.offsetAndType[i-1]&yr:this.firstCharOffset,t(this.source.charCodeAt(n))){case 1:break r;case 2:i++;break r;default:if(t0(this.offsetAndType[i]>>Rr))i=o}}this.skip(i-this.tokenIndex)}forEachToken(r){for(let t=0,i=this.firstCharOffset;t>Rr;i=e,r(l,o,e,t)}}dump(){let r=Array(this.tokenCount);return this.forEachToken((t,i,o,n)=>{r[n]={idx:n,type:Gt[t],chunk:this.source.substring(i,o),balance:this.balance[n]}}),r}}function bt(r,t){function i(v){return v=r.length){if(cString(x+O+1).padStart(h)+" |"+I).join(` `)}let u=` -`.repeat(Math.max(o-1,0)),g=" ".repeat(Math.max(n-1,0)),c=(u+g+r).split(/\r\n?|\n|\f/),m=Math.max(1,t-e)-1,v=Math.min(t+e,c.length+1),h=Math.max(4,String(v).length)+1,b=0;if(i+=(n0.length-1)*(c[t-1].substr(0,i-1).match(/\t/g)||[]).length,i>Be)b=i-t0+3,i=t0-2;for(let f=m;f<=v;f++)if(f>=0&&f0&&c[f].length>b?"…":"")+c[f].substr(b,Be-2)+(c[f].length>b+Be-1?"…":"");return[l(m,t),Array(i+h+2).join("-")+"^",l(t,v)].filter(Boolean).join(` -`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function ye(r,t,i,o,n,e=1,l=1){return Object.assign(jt("SyntaxError",r),{source:t,offset:i,line:o,column:n,sourceFragment(g){return i0({source:t,line:o,column:n,baseLine:e,baseColumn:l},isNaN(g)?0:g)},get formattedMessage(){return`Parse error: ${r} -`+i0({source:t,line:o,column:n,baseLine:e,baseColumn:l},2)}})}function o0(r){let t=this.createList(),i=!1,o={recognizer:r};while(!this.eof){switch(this.tokenType){case y:this.next();continue;case N:i=!0,this.next();continue}let n=r.getNode.call(this,o);if(n===void 0)break;if(i){if(r.onWhiteSpace)r.onWhiteSpace.call(this,n,t,o);i=!1}t.push(n)}if(i&&r.onWhiteSpace)r.onWhiteSpace.call(this,null,t,o);return t}var e0=()=>{},ma=33,ba=35,Re=59,l0=123,c0=0;function va(r){return function(){return this[r]()}}function He(r){let t=Object.create(null);for(let i of Object.keys(r)){let o=r[i],n=o.parse||o;if(n)t[i]=n}return t}function ha(r){let t={context:Object.create(null),features:Object.assign(Object.create(null),r.features),scope:Object.assign(Object.create(null),r.scope),atrule:He(r.atrule),pseudo:He(r.pseudo),node:He(r.node)};for(let[i,o]of Object.entries(r.parseContext))switch(typeof o){case"function":t.context[i]=o;break;case"string":t.context[i]=va(o);break}return{config:t,...t,...t.node}}function u0(r){let t="",i="",o=!1,n=e0,e=!1,l=new Hi,u=Object.assign(new Mi,ha(r||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:o0,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===l0?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===l0||c===Re?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===ma||c===Re?1:0},consumeUntilSemicolonIncluded(c){return c===Re?2:0},createList(){return new or},createSingleNodeList(c){return new or().appendData(c)},getFirstListNode(c){return c&&c.first},getLastListNode(c){return c&&c.last},parseWithFallback(c,m){let v=this.tokenIndex;try{return c.call(this)}catch(h){if(e)throw h;this.skip(v-this.tokenIndex);let b=m.call(this);return e=!0,n(h,b),e=!1,b}},lookupNonWSType(c){let m;do if(m=this.lookupType(c++),m!==N&&m!==y)return m;while(m!==c0);return c0},charCodeAt(c){return c>=0&&cb.toUpperCase()),v=`${/[[\](){}]/.test(m)?`"${m}"`:m} is expected`,h=this.tokenStart;switch(c){case w:if(this.tokenType===k||this.tokenType===er)h=this.tokenEnd-1,v="Identifier is expected but function found";else v="Identifier is expected";break;case F:if(this.isDelim(ba))this.next(),h++,v="Name is expected";break;case B:if(this.tokenType===U)h=this.tokenEnd,v="Percent sign is expected";break}this.error(v,h)}this.next()},eatIdent(c){if(this.tokenType!==w||this.lookupValue(0,c)===!1)this.error(`Identifier "${c}" is expected`);this.next()},eatDelim(c){if(!this.isDelim(c))this.error(`Delim "${String.fromCharCode(c)}" is expected`);this.next()},getLocation(c,m){if(o)return l.getLocationRange(c,m,i);return null},getLocationFromList(c){if(o){let m=this.getFirstListNode(c),v=this.getLastListNode(c);return l.getLocationRange(m!==null?m.loc.start.offset-l.startOffset:this.tokenStart,v!==null?v.loc.end.offset-l.startOffset:this.tokenStart,i)}return null},error(c,m){let v=typeof m<"u"&&m",o=Boolean(m.positions),n=typeof m.onParseError==="function"?m.onParseError:e0,e=!1,u.parseAtrulePrelude="parseAtrulePrelude"in m?Boolean(m.parseAtrulePrelude):!0,u.parseRulePrelude="parseRulePrelude"in m?Boolean(m.parseRulePrelude):!0,u.parseValue="parseValue"in m?Boolean(m.parseValue):!0,u.parseCustomProperty="parseCustomProperty"in m?Boolean(m.parseCustomProperty):!1;let{context:v="default",onComment:h}=m;if(v in u.context===!1)throw Error("Unknown context `"+v+"`");if(typeof h==="function")u.forEachToken((f,D,I)=>{if(f===y){let O=u.getLocation(D,I),J=rt(t,I-2,I,"*/")?t.slice(D+2,I-2):t.slice(D+2,I);h(J,O)}});let b=u.context[v].call(u,m);if(!u.eof)u.error();return b},{SyntaxError:ye,config:u.config})}var Un=x0(),ur=Zi(),Ti=O0().ArraySet,oz=p0().MappingList;function Wr(r){if(!r)r={};this._file=ur.getArg(r,"file",null),this._sourceRoot=ur.getArg(r,"sourceRoot",null),this._skipValidation=ur.getArg(r,"skipValidation",!1),this._ignoreInvalidMapping=ur.getArg(r,"ignoreInvalidMapping",!1),this._sources=new Ti,this._names=new Ti,this._mappings=new oz,this._sourcesContents=null}Wr.prototype._version=3;Wr.fromSourceMap=function(t,i){var o=t.sourceRoot,n=new Wr(Object.assign(i||{},{file:t.file,sourceRoot:o}));return t.eachMapping(function(e){var l={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){if(l.source=e.source,o!=null)l.source=ur.relative(o,l.source);if(l.original={line:e.originalLine,column:e.originalColumn},e.name!=null)l.name=e.name}n.addMapping(l)}),t.sources.forEach(function(e){var l=e;if(o!==null)l=ur.relative(o,e);if(!n._sources.has(l))n._sources.add(l);var u=t.sourceContentFor(e);if(u!=null)n.setSourceContent(e,u)}),n};Wr.prototype.addMapping=function(t){var i=ur.getArg(t,"generated"),o=ur.getArg(t,"original",null),n=ur.getArg(t,"source",null),e=ur.getArg(t,"name",null);if(!this._skipValidation){if(this._validateMapping(i,o,n,e)===!1)return}if(n!=null){if(n=String(n),!this._sources.has(n))this._sources.add(n)}if(e!=null){if(e=String(e),!this._names.has(e))this._names.add(e)}this._mappings.add({generatedLine:i.line,generatedColumn:i.column,originalLine:o!=null&&o.line,originalColumn:o!=null&&o.column,source:n,name:e})};Wr.prototype.setSourceContent=function(t,i){var o=t;if(this._sourceRoot!=null)o=ur.relative(this._sourceRoot,o);if(i!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[ur.toSetString(o)]=i}else if(this._sourcesContents){if(delete this._sourcesContents[ur.toSetString(o)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};Wr.prototype.applySourceMap=function(t,i,o){var n=i;if(i==null){if(t.file==null)throw Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=t.file}var e=this._sourceRoot;if(e!=null)n=ur.relative(e,n);var l=new Ti,u=new Ti;this._mappings.unsortedForEach(function(g){if(g.source===n&&g.originalLine!=null){var c=t.originalPositionFor({line:g.originalLine,column:g.originalColumn});if(c.source!=null){if(g.source=c.source,o!=null)g.source=ur.join(o,g.source);if(e!=null)g.source=ur.relative(e,g.source);if(g.originalLine=c.line,g.originalColumn=c.column,c.name!=null)g.name=c.name}}var m=g.source;if(m!=null&&!l.has(m))l.add(m);var v=g.name;if(v!=null&&!u.has(v))u.add(v)},this),this._sources=l,this._names=u,t.sources.forEach(function(g){var c=t.sourceContentFor(g);if(c!=null){if(o!=null)g=ur.join(o,g);if(e!=null)g=ur.relative(e,g);this.setSourceContent(g,c)}},this)};Wr.prototype._validateMapping=function(t,i,o,n){if(i&&typeof i.line!=="number"&&typeof i.column!=="number"){var e="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping){if(typeof console<"u"&&console.warn)console.warn(e);return!1}else throw Error(e)}if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!i&&!o&&!n)return;else if(t&&"line"in t&&"column"in t&&i&&"line"in i&&"column"in i&&t.line>0&&t.column>=0&&i.line>0&&i.column>=0&&o)return;else{var e="Invalid mapping: "+JSON.stringify({generated:t,source:o,original:i,name:n});if(this._ignoreInvalidMapping){if(typeof console<"u"&&console.warn)console.warn(e);return!1}else throw Error(e)}};Wr.prototype._serializeMappings=function(){var t=0,i=1,o=0,n=0,e=0,l=0,u="",g,c,m,v,h=this._mappings.toArray();for(var b=0,f=h.length;b0){if(!ur.compareByGeneratedPositionsInflated(c,h[b-1]))continue;g+=","}if(g+=Un.encode(c.generatedColumn-t),t=c.generatedColumn,c.source!=null){if(v=this._sources.indexOf(c.source),g+=Un.encode(v-l),l=v,g+=Un.encode(c.originalLine-1-n),n=c.originalLine-1,g+=Un.encode(c.originalColumn-o),o=c.originalColumn,c.name!=null)m=this._names.indexOf(c.name),g+=Un.encode(m-e),e=m}u+=g}return u};Wr.prototype._generateSourcesContent=function(t,i){return t.map(function(o){if(!this._sourcesContents)return null;if(i!=null)o=ur.relative(i,o);var n=ur.toSetString(o);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};Wr.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)t.file=this._file;if(this._sourceRoot!=null)t.sourceRoot=this._sourceRoot;if(this._sourcesContents)t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot);return t};Wr.prototype.toString=function(){return JSON.stringify(this.toJSON())};var de=Wr;var I0=new Set(["Atrule","Selector","Declaration"]);function j0(r){let t=new de,i={line:1,column:0},o={line:0,column:0},n={line:1,column:0},e={generated:n},l=1,u=0,g=!1,c=r.node;r.node=function(h){if(h.loc&&h.loc.start&&I0.has(h.type)){let b=h.loc.start.line,f=h.loc.start.column-1;if(o.line!==b||o.column!==f){if(o.line=b,o.column=f,i.line=l,i.column=u,g){if(g=!1,i.line!==n.line||i.column!==n.column)t.addMapping(e)}g=!0,t.addMapping({source:h.loc.source,original:o,generated:i})}}if(c.call(this,h),g&&I0.has(h.type))n.line=l,n.column=u};let m=r.emit;r.emit=function(h,b,f){for(let D=0;Duz,safe:()=>rl});var ez=43,lz=45,se=(r,t)=>{if(r===P)r=t;if(typeof r==="string"){let i=r.charCodeAt(0);return i>127?32768:i<<8}return r},k0=[[w,w],[w,k],[w,er],[w,fr],[w,"-"],[w,U],[w,B],[w,L],[w,hr],[w,X],[H,w],[H,k],[H,er],[H,fr],[H,"-"],[H,U],[H,B],[H,L],[H,hr],[F,w],[F,k],[F,er],[F,fr],[F,"-"],[F,U],[F,B],[F,L],[F,hr],[L,w],[L,k],[L,er],[L,fr],[L,"-"],[L,U],[L,B],[L,L],[L,hr],["#",w],["#",k],["#",er],["#",fr],["#","-"],["#",U],["#",B],["#",L],["#",hr],["-",w],["-",k],["-",er],["-",fr],["-","-"],["-",U],["-",B],["-",L],["-",hr],[U,w],[U,k],[U,er],[U,fr],[U,U],[U,B],[U,L],[U,"%"],[U,hr],["@",w],["@",k],["@",er],["@",fr],["@","-"],["@",hr],[".",U],[".",B],[".",L],["+",U],["+",B],["+",L],["/","*"]],cz=k0.concat([[w,F],[L,F],[F,F],[H,X],[H,gr],[H,d],[B,B],[B,L],[B,k],[B,"-"],[p,w],[p,k],[p,B],[p,L],[p,F],[p,"-"]]);function U0(r){let t=new Set(r.map(([i,o])=>se(i)<<16|se(o)));return function(i,o,n){let e=se(o,n),l=n.charCodeAt(0);if(l===lz&&o!==w&&o!==k&&o!==hr||l===ez?t.has(i<<16|l<<8):t.has(i<<16|e))this.emit(" ",N,!0);return e}}var uz=U0(k0),rl=U0(cz);var gz=92;function mz(r,t){if(typeof t==="function"){let i=null;r.children.forEach((o)=>{if(i!==null)t.call(this,i);this.node(o),i=o});return}r.children.forEach(this.node,this)}function bz(r){bt(r,(t,i,o)=>{this.token(t,r.slice(i,o))})}function J0(r){let t=new Map;for(let[i,o]of Object.entries(r.node))if(typeof(o.generate||o)==="function")t.set(i,o.generate||o);return function(i,o){let n="",e=0,l={node(g){if(t.has(g.type))t.get(g.type).call(u,g);else throw Error("Unknown node type: "+g.type)},tokenBefore:rl,token(g,c){if(e=this.tokenBefore(e,g,c),this.emit(c,g,!1),g===P&&c.charCodeAt(0)===gz)this.emit(` -`,N,!0)},emit(g){n+=g},result(){return n}};if(o){if(typeof o.decorator==="function")l=o.decorator(l);if(o.sourceMap)l=j0(l);if(o.mode in di)l.tokenBefore=di[o.mode]}let u={node:(g)=>l.node(g),children:mz,token:(g,c)=>l.token(g,c),tokenize:bz};return l.node(i),l.result()}}function P0(r){return{fromPlainObject(t){return r(t,{enter(i){if(i.children&&i.children instanceof or===!1)i.children=new or().fromArray(i.children)}}),t},toPlainObject(t){return r(t,{leave(i){if(i.children&&i.children instanceof or)i.children=i.children.toArray()}}),t}}}var{hasOwnProperty:tl}=Object.prototype,Jn=function(){};function E0(r){return typeof r==="function"?r:Jn}function L0(r,t){return function(i,o,n){if(i.type===t)r.call(this,i,o,n)}}function vz(r,t){let i=t.structure,o=[];for(let n in i){if(tl.call(i,n)===!1)continue;let e=i[n],l={name:n,type:!1,nullable:!1};if(!Array.isArray(e))e=[e];for(let u of e)if(u===null)l.nullable=!0;else if(typeof u==="string")l.type="node";else if(Array.isArray(u))l.type="list";if(l.type)o.push(l)}if(o.length)return{context:t.walkContext,fields:o};return null}function hz(r){let t={};for(let i in r.node)if(tl.call(r.node,i)){let o=r.node[i];if(!o.structure)throw Error("Missed `structure` field in `"+i+"` node type definition");t[i]=vz(i,o)}return t}function K0(r,t){let i=r.fields.slice(),o=r.context,n=typeof o==="string";if(t)i.reverse();return function(e,l,u,g){let c;if(n)c=l[o],l[o]=e;for(let m of i){let v=e[m.name];if(!m.nullable||v){if(m.type==="list"){if(t?v.reduceRight(g,!1):v.reduce(g,!1))return!0}else if(u(v))return!0}}if(n)l[o]=c}}function X0({StyleSheet:r,Atrule:t,Rule:i,Block:o,DeclarationList:n}){return{Atrule:{StyleSheet:r,Atrule:t,Rule:i,Block:o},Rule:{StyleSheet:r,Atrule:t,Rule:i,Block:o},Declaration:{StyleSheet:r,Atrule:t,Rule:i,Block:o,DeclarationList:n}}}function W0(r){let t=hz(r),i={},o={},n=Symbol("break-walk"),e=Symbol("skip-node");for(let c in t)if(tl.call(t,c)&&t[c]!==null)i[c]=K0(t[c],!1),o[c]=K0(t[c],!0);let l=X0(i),u=X0(o),g=function(c,m){function v(O,J,q){let E=h.call(I,O,J,q);if(E===n)return!0;if(E===e)return!1;if(f.hasOwnProperty(O.type)){if(f[O.type](O,I,v,D))return!0}if(b.call(I,O,J,q)===n)return!0;return!1}let h=Jn,b=Jn,f=i,D=(O,J,q,E)=>O||v(J,q,E),I={break:n,skip:e,root:c,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof m==="function")h=m;else if(m){if(h=E0(m.enter),b=E0(m.leave),m.reverse)f=o;if(m.visit){if(l.hasOwnProperty(m.visit))f=m.reverse?u[m.visit]:l[m.visit];else if(!t.hasOwnProperty(m.visit))throw Error("Bad value `"+m.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=L0(h,m.visit),b=L0(b,m.visit)}}if(h===Jn&&b===Jn)throw Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");v(c)};return g.break=n,g.skip=e,g.find=function(c,m){let v=null;return g(c,function(h,b,f){if(m.call(this,h,b,f))return v=h,n}),v},g.findLast=function(c,m){let v=null;return g(c,{reverse:!0,enter(h,b,f){if(m.call(this,h,b,f))return v=h,n}}),v},g.findAll=function(c,m){let v=[];return g(c,function(h,b,f){if(m.call(this,h,b,f))v.push(h)}),v},g}function $z(r){return r}function xz(r){let{min:t,max:i,comma:o}=r;if(t===0&&i===0)return o?"#?":"*";if(t===0&&i===1)return"?";if(t===1&&i===0)return o?"#":"+";if(t===1&&i===1)return"";return(o?"#":"")+(t===i?"{"+t+"}":"{"+t+","+(i!==0?i:"")+"}")}function fz(r){switch(r.type){case"Range":return" ["+(r.min===null?"-∞":r.min)+","+(r.max===null?"∞":r.max)+"]";default:throw Error("Unknown node type `"+r.type+"`")}}function wz(r,t,i,o){let n=r.combinator===" "||o?r.combinator:" "+r.combinator+" ",e=r.terms.map((l)=>si(l,t,i,o)).join(n);if(r.explicit||i)return(o||e[0]===","?"[":"[ ")+e+(o?"]":" ]");return e}function si(r,t,i,o){let n;switch(r.type){case"Group":n=wz(r,t,i,o)+(r.disallowEmpty?"!":"");break;case"Multiplier":return si(r.term,t,i,o)+t(xz(r),r);case"Boolean":n="";break;case"Type":n="<"+r.name+(r.opts?t(fz(r.opts),r.opts):"")+">";break;case"Property":n="<'"+r.name+"'>";break;case"Keyword":n=r.name;break;case"AtKeyword":n="@"+r.name;break;case"Function":n=r.name+"(";break;case"String":case"Token":n=r.value;break;case"Comma":n=",";break;default:throw Error("Unknown node type `"+r.type+"`")}return t(n,r)}function Rt(r,t){let i=$z,o=!1,n=!1;if(typeof t==="function")i=t;else if(t){if(o=Boolean(t.forceBraces),n=Boolean(t.compact),typeof t.decorate==="function")i=t.decorate}return si(r,i,o,n)}var q0={offset:0,line:1,column:1};function az(r,t){let{tokens:i,longestMatch:o}=r,n=o1)m=ro(e||t,"end")||Pn(q0,c),v=Pn(m);else m=ro(e,"start")||Pn(ro(t,"start")||q0,c.slice(0,l)),v=ro(e,"end")||Pn(m,c.substr(l,u));return{css:c,mismatchOffset:l,mismatchLength:u,start:m,end:v}}function ro(r,t){let i=r&&r.loc&&r.loc[t];if(i)return"line"in i?Pn(i):i;return null}function Pn({offset:r,line:t,column:i},o){let n={offset:r,line:t,column:i};if(o){let e=o.split(/\n|\r\n?|\f/);n.offset+=o.length,n.line+=e.length-1,n.column=e.length===1?n.column+o.length:e.pop().length+1}return n}var Ht=function(r,t){let i=jt("SyntaxReferenceError",r+(t?" `"+t+"`":""));return i.reference=t,i},N0=function(r,t,i,o){let n=jt("SyntaxMatchError",r),{css:e,mismatchOffset:l,mismatchLength:u,start:g,end:c}=az(o,i);return n.rawMessage=r,n.syntax=t?Rt(t):"",n.css=e,n.mismatchOffset=l,n.mismatchLength=u,n.message=r+` +`.repeat(Math.max(o-1,0)),g=" ".repeat(Math.max(n-1,0)),c=(u+g+r).split(/\r\n?|\n|\f/),m=Math.max(1,t-e)-1,v=Math.min(t+e,c.length+1),h=Math.max(4,String(v).length)+1,b=0;if(i+=(i0.length-1)*(c[t-1].substr(0,i-1).match(/\t/g)||[]).length,i>Be)b=i-n0+3,i=n0-2;for(let x=m;x<=v;x++)if(x>=0&&x0&&c[x].length>b?"…":"")+c[x].substr(b,Be-2)+(c[x].length>b+Be-1?"…":"");return[l(m,t),Array(i+h+2).join("-")+"^",l(t,v)].filter(Boolean).join(` +`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function ye(r,t,i,o,n,e=1,l=1){return Object.assign(jt("SyntaxError",r),{source:t,offset:i,line:o,column:n,sourceFragment(g){return o0({source:t,line:o,column:n,baseLine:e,baseColumn:l},isNaN(g)?0:g)},get formattedMessage(){return`Parse error: ${r} +`+o0({source:t,line:o,column:n,baseLine:e,baseColumn:l},2)}})}function e0(r){let t=this.createList(),i=!1,o={recognizer:r};while(!this.eof){switch(this.tokenType){case y:this.next();continue;case N:i=!0,this.next();continue}let n=r.getNode.call(this,o);if(n===void 0)break;if(i){if(r.onWhiteSpace)r.onWhiteSpace.call(this,n,t,o);i=!1}t.push(n)}if(i&&r.onWhiteSpace)r.onWhiteSpace.call(this,null,t,o);return t}var l0=()=>{},b6=33,v6=35,Re=59,c0=123,u0=0;function h6(r){return function(){return this[r]()}}function He(r){let t=Object.create(null);for(let i of Object.keys(r)){let o=r[i],n=o.parse||o;if(n)t[i]=n}return t}function $6(r){let t={context:Object.create(null),features:Object.assign(Object.create(null),r.features),scope:Object.assign(Object.create(null),r.scope),atrule:He(r.atrule),pseudo:He(r.pseudo),node:He(r.node)};for(let[i,o]of Object.entries(r.parseContext))switch(typeof o){case"function":t.context[i]=o;break;case"string":t.context[i]=h6(o);break}return{config:t,...t,...t.node}}function g0(r){let t="",i="",o=!1,n=l0,e=!1,l=new Hi,u=Object.assign(new Mi,$6(r||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:e0,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===c0?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===c0||c===Re?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===b6||c===Re?1:0},consumeUntilSemicolonIncluded(c){return c===Re?2:0},createList(){return new or},createSingleNodeList(c){return new or().appendData(c)},getFirstListNode(c){return c&&c.first},getLastListNode(c){return c&&c.last},parseWithFallback(c,m){let v=this.tokenIndex;try{return c.call(this)}catch(h){if(e)throw h;this.skip(v-this.tokenIndex);let b=m.call(this);return e=!0,n(h,b),e=!1,b}},lookupNonWSType(c){let m;do if(m=this.lookupType(c++),m!==N&&m!==y)return m;while(m!==u0);return u0},charCodeAt(c){return c>=0&&cb.toUpperCase()),v=`${/[[\](){}]/.test(m)?`"${m}"`:m} is expected`,h=this.tokenStart;switch(c){case w:if(this.tokenType===k||this.tokenType===er)h=this.tokenEnd-1,v="Identifier is expected but function found";else v="Identifier is expected";break;case F:if(this.isDelim(v6))this.next(),h++,v="Name is expected";break;case B:if(this.tokenType===U)h=this.tokenEnd,v="Percent sign is expected";break}this.error(v,h)}this.next()},eatIdent(c){if(this.tokenType!==w||this.lookupValue(0,c)===!1)this.error(`Identifier "${c}" is expected`);this.next()},eatDelim(c){if(!this.isDelim(c))this.error(`Delim "${String.fromCharCode(c)}" is expected`);this.next()},getLocation(c,m){if(o)return l.getLocationRange(c,m,i);return null},getLocationFromList(c){if(o){let m=this.getFirstListNode(c),v=this.getLastListNode(c);return l.getLocationRange(m!==null?m.loc.start.offset-l.startOffset:this.tokenStart,v!==null?v.loc.end.offset-l.startOffset:this.tokenStart,i)}return null},error(c,m){let v=typeof m<"u"&&m",o=Boolean(m.positions),n=typeof m.onParseError==="function"?m.onParseError:l0,e=!1,u.parseAtrulePrelude="parseAtrulePrelude"in m?Boolean(m.parseAtrulePrelude):!0,u.parseRulePrelude="parseRulePrelude"in m?Boolean(m.parseRulePrelude):!0,u.parseValue="parseValue"in m?Boolean(m.parseValue):!0,u.parseCustomProperty="parseCustomProperty"in m?Boolean(m.parseCustomProperty):!1;let{context:v="default",onComment:h}=m;if(v in u.context===!1)throw Error("Unknown context `"+v+"`");if(typeof h==="function")u.forEachToken((x,D,I)=>{if(x===y){let O=u.getLocation(D,I),J=rt(t,I-2,I,"*/")?t.slice(D+2,I-2):t.slice(D+2,I);h(J,O)}});let b=u.context[v].call(u,m);if(!u.eof)u.error();return b},{SyntaxError:ye,config:u.config})}var Un=x0(),ur=Zi(),Ci=D0().ArraySet,ez=I0().MappingList;function Wr(r){if(!r)r={};this._file=ur.getArg(r,"file",null),this._sourceRoot=ur.getArg(r,"sourceRoot",null),this._skipValidation=ur.getArg(r,"skipValidation",!1),this._ignoreInvalidMapping=ur.getArg(r,"ignoreInvalidMapping",!1),this._sources=new Ci,this._names=new Ci,this._mappings=new ez,this._sourcesContents=null}Wr.prototype._version=3;Wr.fromSourceMap=function(t,i){var o=t.sourceRoot,n=new Wr(Object.assign(i||{},{file:t.file,sourceRoot:o}));return t.eachMapping(function(e){var l={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){if(l.source=e.source,o!=null)l.source=ur.relative(o,l.source);if(l.original={line:e.originalLine,column:e.originalColumn},e.name!=null)l.name=e.name}n.addMapping(l)}),t.sources.forEach(function(e){var l=e;if(o!==null)l=ur.relative(o,e);if(!n._sources.has(l))n._sources.add(l);var u=t.sourceContentFor(e);if(u!=null)n.setSourceContent(e,u)}),n};Wr.prototype.addMapping=function(t){var i=ur.getArg(t,"generated"),o=ur.getArg(t,"original",null),n=ur.getArg(t,"source",null),e=ur.getArg(t,"name",null);if(!this._skipValidation){if(this._validateMapping(i,o,n,e)===!1)return}if(n!=null){if(n=String(n),!this._sources.has(n))this._sources.add(n)}if(e!=null){if(e=String(e),!this._names.has(e))this._names.add(e)}this._mappings.add({generatedLine:i.line,generatedColumn:i.column,originalLine:o!=null&&o.line,originalColumn:o!=null&&o.column,source:n,name:e})};Wr.prototype.setSourceContent=function(t,i){var o=t;if(this._sourceRoot!=null)o=ur.relative(this._sourceRoot,o);if(i!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[ur.toSetString(o)]=i}else if(this._sourcesContents){if(delete this._sourcesContents[ur.toSetString(o)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};Wr.prototype.applySourceMap=function(t,i,o){var n=i;if(i==null){if(t.file==null)throw Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=t.file}var e=this._sourceRoot;if(e!=null)n=ur.relative(e,n);var l=new Ci,u=new Ci;this._mappings.unsortedForEach(function(g){if(g.source===n&&g.originalLine!=null){var c=t.originalPositionFor({line:g.originalLine,column:g.originalColumn});if(c.source!=null){if(g.source=c.source,o!=null)g.source=ur.join(o,g.source);if(e!=null)g.source=ur.relative(e,g.source);if(g.originalLine=c.line,g.originalColumn=c.column,c.name!=null)g.name=c.name}}var m=g.source;if(m!=null&&!l.has(m))l.add(m);var v=g.name;if(v!=null&&!u.has(v))u.add(v)},this),this._sources=l,this._names=u,t.sources.forEach(function(g){var c=t.sourceContentFor(g);if(c!=null){if(o!=null)g=ur.join(o,g);if(e!=null)g=ur.relative(e,g);this.setSourceContent(g,c)}},this)};Wr.prototype._validateMapping=function(t,i,o,n){if(i&&typeof i.line!=="number"&&typeof i.column!=="number"){var e="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping){if(typeof console<"u"&&console.warn)console.warn(e);return!1}else throw Error(e)}if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!i&&!o&&!n)return;else if(t&&"line"in t&&"column"in t&&i&&"line"in i&&"column"in i&&t.line>0&&t.column>=0&&i.line>0&&i.column>=0&&o)return;else{var e="Invalid mapping: "+JSON.stringify({generated:t,source:o,original:i,name:n});if(this._ignoreInvalidMapping){if(typeof console<"u"&&console.warn)console.warn(e);return!1}else throw Error(e)}};Wr.prototype._serializeMappings=function(){var t=0,i=1,o=0,n=0,e=0,l=0,u="",g,c,m,v,h=this._mappings.toArray();for(var b=0,x=h.length;b0){if(!ur.compareByGeneratedPositionsInflated(c,h[b-1]))continue;g+=","}if(g+=Un.encode(c.generatedColumn-t),t=c.generatedColumn,c.source!=null){if(v=this._sources.indexOf(c.source),g+=Un.encode(v-l),l=v,g+=Un.encode(c.originalLine-1-n),n=c.originalLine-1,g+=Un.encode(c.originalColumn-o),o=c.originalColumn,c.name!=null)m=this._names.indexOf(c.name),g+=Un.encode(m-e),e=m}u+=g}return u};Wr.prototype._generateSourcesContent=function(t,i){return t.map(function(o){if(!this._sourcesContents)return null;if(i!=null)o=ur.relative(i,o);var n=ur.toSetString(o);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};Wr.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)t.file=this._file;if(this._sourceRoot!=null)t.sourceRoot=this._sourceRoot;if(this._sourcesContents)t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot);return t};Wr.prototype.toString=function(){return JSON.stringify(this.toJSON())};var de=Wr;var j0=new Set(["Atrule","Selector","Declaration"]);function k0(r){let t=new de,i={line:1,column:0},o={line:0,column:0},n={line:1,column:0},e={generated:n},l=1,u=0,g=!1,c=r.node;r.node=function(h){if(h.loc&&h.loc.start&&j0.has(h.type)){let b=h.loc.start.line,x=h.loc.start.column-1;if(o.line!==b||o.column!==x){if(o.line=b,o.column=x,i.line=l,i.column=u,g){if(g=!1,i.line!==n.line||i.column!==n.column)t.addMapping(e)}g=!0,t.addMapping({source:h.loc.source,original:o,generated:i})}}if(c.call(this,h),g&&j0.has(h.type))n.line=l,n.column=u};let m=r.emit;r.emit=function(h,b,x){for(let D=0;Dgz,safe:()=>rl});var lz=43,cz=45,se=(r,t)=>{if(r===P)r=t;if(typeof r==="string"){let i=r.charCodeAt(0);return i>127?32768:i<<8}return r},U0=[[w,w],[w,k],[w,er],[w,xr],[w,"-"],[w,U],[w,B],[w,L],[w,hr],[w,X],[H,w],[H,k],[H,er],[H,xr],[H,"-"],[H,U],[H,B],[H,L],[H,hr],[F,w],[F,k],[F,er],[F,xr],[F,"-"],[F,U],[F,B],[F,L],[F,hr],[L,w],[L,k],[L,er],[L,xr],[L,"-"],[L,U],[L,B],[L,L],[L,hr],["#",w],["#",k],["#",er],["#",xr],["#","-"],["#",U],["#",B],["#",L],["#",hr],["-",w],["-",k],["-",er],["-",xr],["-","-"],["-",U],["-",B],["-",L],["-",hr],[U,w],[U,k],[U,er],[U,xr],[U,U],[U,B],[U,L],[U,"%"],[U,hr],["@",w],["@",k],["@",er],["@",xr],["@","-"],["@",hr],[".",U],[".",B],[".",L],["+",U],["+",B],["+",L],["/","*"]],uz=U0.concat([[w,F],[L,F],[F,F],[H,X],[H,gr],[H,d],[B,B],[B,L],[B,k],[B,"-"],[p,w],[p,k],[p,B],[p,L],[p,F],[p,"-"]]);function J0(r){let t=new Set(r.map(([i,o])=>se(i)<<16|se(o)));return function(i,o,n){let e=se(o,n),l=n.charCodeAt(0);if(l===cz&&o!==w&&o!==k&&o!==hr||l===lz?t.has(i<<16|l<<8):t.has(i<<16|e))this.emit(" ",N,!0);return e}}var gz=J0(U0),rl=J0(uz);var mz=92;function bz(r,t){if(typeof t==="function"){let i=null;r.children.forEach((o)=>{if(i!==null)t.call(this,i);this.node(o),i=o});return}r.children.forEach(this.node,this)}function vz(r){bt(r,(t,i,o)=>{this.token(t,r.slice(i,o))})}function P0(r){let t=new Map;for(let[i,o]of Object.entries(r.node))if(typeof(o.generate||o)==="function")t.set(i,o.generate||o);return function(i,o){let n="",e=0,l={node(g){if(t.has(g.type))t.get(g.type).call(u,g);else throw Error("Unknown node type: "+g.type)},tokenBefore:rl,token(g,c){if(e=this.tokenBefore(e,g,c),this.emit(c,g,!1),g===P&&c.charCodeAt(0)===mz)this.emit(` +`,N,!0)},emit(g){n+=g},result(){return n}};if(o){if(typeof o.decorator==="function")l=o.decorator(l);if(o.sourceMap)l=k0(l);if(o.mode in di)l.tokenBefore=di[o.mode]}let u={node:(g)=>l.node(g),children:bz,token:(g,c)=>l.token(g,c),tokenize:vz};return l.node(i),l.result()}}function E0(r){return{fromPlainObject(t){return r(t,{enter(i){if(i.children&&i.children instanceof or===!1)i.children=new or().fromArray(i.children)}}),t},toPlainObject(t){return r(t,{leave(i){if(i.children&&i.children instanceof or)i.children=i.children.toArray()}}),t}}}var{hasOwnProperty:tl}=Object.prototype,Jn=function(){};function L0(r){return typeof r==="function"?r:Jn}function K0(r,t){return function(i,o,n){if(i.type===t)r.call(this,i,o,n)}}function hz(r,t){let i=t.structure,o=[];for(let n in i){if(tl.call(i,n)===!1)continue;let e=i[n],l={name:n,type:!1,nullable:!1};if(!Array.isArray(e))e=[e];for(let u of e)if(u===null)l.nullable=!0;else if(typeof u==="string")l.type="node";else if(Array.isArray(u))l.type="list";if(l.type)o.push(l)}if(o.length)return{context:t.walkContext,fields:o};return null}function $z(r){let t={};for(let i in r.node)if(tl.call(r.node,i)){let o=r.node[i];if(!o.structure)throw Error("Missed `structure` field in `"+i+"` node type definition");t[i]=hz(i,o)}return t}function X0(r,t){let i=r.fields.slice(),o=r.context,n=typeof o==="string";if(t)i.reverse();return function(e,l,u,g){let c;if(n)c=l[o],l[o]=e;for(let m of i){let v=e[m.name];if(!m.nullable||v){if(m.type==="list"){if(t?v.reduceRight(g,!1):v.reduce(g,!1))return!0}else if(u(v))return!0}}if(n)l[o]=c}}function W0({StyleSheet:r,Atrule:t,Rule:i,Block:o,DeclarationList:n}){return{Atrule:{StyleSheet:r,Atrule:t,Rule:i,Block:o},Rule:{StyleSheet:r,Atrule:t,Rule:i,Block:o},Declaration:{StyleSheet:r,Atrule:t,Rule:i,Block:o,DeclarationList:n}}}function q0(r){let t=$z(r),i={},o={},n=Symbol("break-walk"),e=Symbol("skip-node");for(let c in t)if(tl.call(t,c)&&t[c]!==null)i[c]=X0(t[c],!1),o[c]=X0(t[c],!0);let l=W0(i),u=W0(o),g=function(c,m){function v(O,J,q){let E=h.call(I,O,J,q);if(E===n)return!0;if(E===e)return!1;if(x.hasOwnProperty(O.type)){if(x[O.type](O,I,v,D))return!0}if(b.call(I,O,J,q)===n)return!0;return!1}let h=Jn,b=Jn,x=i,D=(O,J,q,E)=>O||v(J,q,E),I={break:n,skip:e,root:c,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof m==="function")h=m;else if(m){if(h=L0(m.enter),b=L0(m.leave),m.reverse)x=o;if(m.visit){if(l.hasOwnProperty(m.visit))x=m.reverse?u[m.visit]:l[m.visit];else if(!t.hasOwnProperty(m.visit))throw Error("Bad value `"+m.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=K0(h,m.visit),b=K0(b,m.visit)}}if(h===Jn&&b===Jn)throw Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");v(c)};return g.break=n,g.skip=e,g.find=function(c,m){let v=null;return g(c,function(h,b,x){if(m.call(this,h,b,x))return v=h,n}),v},g.findLast=function(c,m){let v=null;return g(c,{reverse:!0,enter(h,b,x){if(m.call(this,h,b,x))return v=h,n}}),v},g.findAll=function(c,m){let v=[];return g(c,function(h,b,x){if(m.call(this,h,b,x))v.push(h)}),v},g}function fz(r){return r}function xz(r){let{min:t,max:i,comma:o}=r;if(t===0&&i===0)return o?"#?":"*";if(t===0&&i===1)return"?";if(t===1&&i===0)return o?"#":"+";if(t===1&&i===1)return"";return(o?"#":"")+(t===i?"{"+t+"}":"{"+t+","+(i!==0?i:"")+"}")}function wz(r){switch(r.type){case"Range":return" ["+(r.min===null?"-∞":r.min)+","+(r.max===null?"∞":r.max)+"]";default:throw Error("Unknown node type `"+r.type+"`")}}function az(r,t,i,o){let n=r.combinator===" "||o?r.combinator:" "+r.combinator+" ",e=r.terms.map((l)=>si(l,t,i,o)).join(n);if(r.explicit||i)return(o||e[0]===","?"[":"[ ")+e+(o?"]":" ]");return e}function si(r,t,i,o){let n;switch(r.type){case"Group":n=az(r,t,i,o)+(r.disallowEmpty?"!":"");break;case"Multiplier":return si(r.term,t,i,o)+t(xz(r),r);case"Boolean":n="";break;case"Type":n="<"+r.name+(r.opts?t(wz(r.opts),r.opts):"")+">";break;case"Property":n="<'"+r.name+"'>";break;case"Keyword":n=r.name;break;case"AtKeyword":n="@"+r.name;break;case"Function":n=r.name+"(";break;case"String":case"Token":n=r.value;break;case"Comma":n=",";break;default:throw Error("Unknown node type `"+r.type+"`")}return t(n,r)}function Rt(r,t){let i=fz,o=!1,n=!1;if(typeof t==="function")i=t;else if(t){if(o=Boolean(t.forceBraces),n=Boolean(t.compact),typeof t.decorate==="function")i=t.decorate}return si(r,i,o,n)}var N0={offset:0,line:1,column:1};function zz(r,t){let{tokens:i,longestMatch:o}=r,n=o1)m=ro(e||t,"end")||Pn(N0,c),v=Pn(m);else m=ro(e,"start")||Pn(ro(t,"start")||N0,c.slice(0,l)),v=ro(e,"end")||Pn(m,c.substr(l,u));return{css:c,mismatchOffset:l,mismatchLength:u,start:m,end:v}}function ro(r,t){let i=r&&r.loc&&r.loc[t];if(i)return"line"in i?Pn(i):i;return null}function Pn({offset:r,line:t,column:i},o){let n={offset:r,line:t,column:i};if(o){let e=o.split(/\n|\r\n?|\f/);n.offset+=o.length,n.line+=e.length-1,n.column=e.length===1?n.column+o.length:e.pop().length+1}return n}var Ht=function(r,t){let i=jt("SyntaxReferenceError",r+(t?" `"+t+"`":""));return i.reference=t,i},S0=function(r,t,i,o){let n=jt("SyntaxMatchError",r),{css:e,mismatchOffset:l,mismatchLength:u,start:g,end:c}=zz(o,i);return n.rawMessage=r,n.syntax=t?Rt(t):"",n.css=e,n.mismatchOffset=l,n.mismatchLength=u,n.message=r+` syntax: `+n.syntax+` value: `+(e||"")+` - --------`+Array(n.mismatchOffset+1).join("-")+"^",Object.assign(n,g),n.loc={source:i&&i.loc&&i.loc.source||"",start:g,end:c},n};var to=new Map,Mt=new Map;var no=zz,nl=_z;function io(r,t){return t=t||0,r.length-t>=2&&r.charCodeAt(t)===45&&r.charCodeAt(t+1)===45}function V0(r,t){if(t=t||0,r.length-t>=3){if(r.charCodeAt(t)===45&&r.charCodeAt(t+1)!==45){let i=r.indexOf("-",t+2);if(i!==-1)return r.substring(t,i+1)}}return""}function zz(r){if(to.has(r))return to.get(r);let t=r.toLowerCase(),i=to.get(t);if(i===void 0){let o=io(t,0),n=!o?V0(t,0):"";i=Object.freeze({basename:t.substr(n.length),name:t,prefix:n,vendor:n,custom:o})}return to.set(r,i),i}function _z(r){if(Mt.has(r))return Mt.get(r);let t=r,i=r[0];if(i==="/")i=r[1]==="/"?"//":"/";else if(i!=="_"&&i!=="*"&&i!=="$"&&i!=="#"&&i!=="+"&&i!=="&")i="";let o=io(t,i.length);if(!o){if(t=t.toLowerCase(),Mt.has(t)){let u=Mt.get(t);return Mt.set(r,u),u}}let n=!o?V0(t,i.length):"",e=t.substr(0,i.length+n.length),l=Object.freeze({basename:t.substr(e.length),name:t.substr(i.length),hack:i,vendor:n,prefix:e,custom:o});return Mt.set(r,l),l}var Zt=["initial","inherit","unset","revert","revert-layer"];var Ln=43,Hr=45,il=110,Ct=!0,Dz=!1;function el(r,t){return r!==null&&r.type===P&&r.value.charCodeAt(0)===t}function En(r,t,i){while(r!==null&&(r.type===N||r.type===y))r=i(++t);return t}function vt(r,t,i,o){if(!r)return 0;let n=r.value.charCodeAt(t);if(n===Ln||n===Hr){if(i)return 0;t++}for(;t6)return 0}return o}function oo(r,t,i){if(!r)return 0;while(cl(i(t),Y0)){if(++r>6)return 0;t++}return t}function ul(r,t){let i=0;if(r===null||r.type!==w||!sr(r.value,0,Iz))return 0;if(r=t(++i),r===null)return 0;if(cl(r,pz)){if(r=t(++i),r===null)return 0;if(r.type===w)return oo(Kn(r,0,!0),++i,t);if(cl(r,Y0))return oo(1,++i,t);return 0}if(r.type===U){let o=Kn(r,1,!0);if(o===0)return 0;if(r=t(++i),r===null)return i;if(r.type===L||r.type===U){if(!jz(r,S0)||!Kn(r,1,!1))return 0;return i+1}return oo(o,i,t)}if(r.type===L)return oo(Kn(r,1,!0),++i,t);return 0}var kz=["calc(","-moz-calc(","-webkit-calc("],gl=new Map([[k,p],[X,p],[mr,wr],[Z,xr]]);function Yr(r,t){return tr.max&&typeof r.max!=="string")return!0}return!1}function Uz(r,t){let i=0,o=[],n=0;r:do{switch(r.type){case xr:case p:case wr:if(r.type!==i)break r;if(i=o.pop(),o.length===0){n++;break r}break;case k:case X:case mr:case Z:o.push(i),i=gl.get(r.type);break}n++}while(r=t(n));return n}function qr(r){return function(t,i,o){if(t===null)return 0;if(t.type===k&&Q0(t.value,kz))return Uz(t,i);return r(t,i,o)}}function C(r){return function(t){if(t===null||t.type!==r)return 0;return 1}}function Jz(r){if(r===null||r.type!==w)return 0;let t=r.value.toLowerCase();if(Q0(t,Zt))return 0;if(F0(t,"default"))return 0;return 1}function A0(r){if(r===null||r.type!==w)return 0;if(Yr(r.value,0)!==45||Yr(r.value,1)!==45)return 0;return 1}function Pz(r){if(!A0(r))return 0;if(r.value==="--")return 0;return 1}function Ez(r){if(r===null||r.type!==F)return 0;let t=r.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let i=1;iGz,semitones:()=>Hz,resolution:()=>Bz,length:()=>Fz,frequency:()=>Az,flex:()=>yz,decibel:()=>Rz,angle:()=>Qz});var Fz=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],Qz=["deg","grad","rad","turn"],Gz=["s","ms"],Az=["hz","khz"],Bz=["dpi","dpcm","dppx","x"],yz=["fr"],Rz=["db"],Hz=["st"];function ml(r,t,i){return Object.assign(jt("SyntaxError",r),{input:t,offset:i,rawMessage:r,message:r+` + --------`+Array(n.mismatchOffset+1).join("-")+"^",Object.assign(n,g),n.loc={source:i&&i.loc&&i.loc.source||"",start:g,end:c},n};var to=new Map,Mt=new Map;var no=_z,nl=Oz;function io(r,t){return t=t||0,r.length-t>=2&&r.charCodeAt(t)===45&&r.charCodeAt(t+1)===45}function V0(r,t){if(t=t||0,r.length-t>=3){if(r.charCodeAt(t)===45&&r.charCodeAt(t+1)!==45){let i=r.indexOf("-",t+2);if(i!==-1)return r.substring(t,i+1)}}return""}function _z(r){if(to.has(r))return to.get(r);let t=r.toLowerCase(),i=to.get(t);if(i===void 0){let o=io(t,0),n=!o?V0(t,0):"";i=Object.freeze({basename:t.substr(n.length),name:t,prefix:n,vendor:n,custom:o})}return to.set(r,i),i}function Oz(r){if(Mt.has(r))return Mt.get(r);let t=r,i=r[0];if(i==="/")i=r[1]==="/"?"//":"/";else if(i!=="_"&&i!=="*"&&i!=="$"&&i!=="#"&&i!=="+"&&i!=="&")i="";let o=io(t,i.length);if(!o){if(t=t.toLowerCase(),Mt.has(t)){let u=Mt.get(t);return Mt.set(r,u),u}}let n=!o?V0(t,i.length):"",e=t.substr(0,i.length+n.length),l=Object.freeze({basename:t.substr(e.length),name:t.substr(i.length),hack:i,vendor:n,prefix:e,custom:o});return Mt.set(r,l),l}var Zt=["initial","inherit","unset","revert","revert-layer"];var Ln=43,Hr=45,il=110,Tt=!0,pz=!1;function el(r,t){return r!==null&&r.type===P&&r.value.charCodeAt(0)===t}function En(r,t,i){while(r!==null&&(r.type===N||r.type===y))r=i(++t);return t}function vt(r,t,i,o){if(!r)return 0;let n=r.value.charCodeAt(t);if(n===Ln||n===Hr){if(i)return 0;t++}for(;t6)return 0}return o}function oo(r,t,i){if(!r)return 0;while(cl(i(t),F0)){if(++r>6)return 0;t++}return t}function ul(r,t){let i=0;if(r===null||r.type!==w||!sr(r.value,0,jz))return 0;if(r=t(++i),r===null)return 0;if(cl(r,Iz)){if(r=t(++i),r===null)return 0;if(r.type===w)return oo(Kn(r,0,!0),++i,t);if(cl(r,F0))return oo(1,++i,t);return 0}if(r.type===U){let o=Kn(r,1,!0);if(o===0)return 0;if(r=t(++i),r===null)return i;if(r.type===L||r.type===U){if(!kz(r,Y0)||!Kn(r,1,!1))return 0;return i+1}return oo(o,i,t)}if(r.type===L)return oo(Kn(r,1,!0),++i,t);return 0}var Uz=["calc(","-moz-calc(","-webkit-calc("],gl=new Map([[k,p],[X,p],[mr,wr],[Z,fr]]);function Yr(r,t){return tr.max&&typeof r.max!=="string")return!0}return!1}function Jz(r,t){let i=0,o=[],n=0;r:do{switch(r.type){case fr:case p:case wr:if(r.type!==i)break r;if(i=o.pop(),o.length===0){n++;break r}break;case k:case X:case mr:case Z:o.push(i),i=gl.get(r.type);break}n++}while(r=t(n));return n}function qr(r){return function(t,i,o){if(t===null)return 0;if(t.type===k&&G0(t.value,Uz))return Jz(t,i);return r(t,i,o)}}function T(r){return function(t){if(t===null||t.type!==r)return 0;return 1}}function Pz(r){if(r===null||r.type!==w)return 0;let t=r.value.toLowerCase();if(G0(t,Zt))return 0;if(Q0(t,"default"))return 0;return 1}function B0(r){if(r===null||r.type!==w)return 0;if(Yr(r.value,0)!==45||Yr(r.value,1)!==45)return 0;return 1}function Ez(r){if(!B0(r))return 0;if(r.value==="--")return 0;return 1}function Lz(r){if(r===null||r.type!==F)return 0;let t=r.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let i=1;iAz,semitones:()=>Mz,resolution:()=>yz,length:()=>Qz,frequency:()=>Bz,flex:()=>Rz,decibel:()=>Hz,angle:()=>Gz});var Qz=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],Gz=["deg","grad","rad","turn"],Az=["s","ms"],Bz=["hz","khz"],yz=["dpi","dpcm","dppx","x"],Rz=["fr"],Hz=["db"],Mz=["st"];function ml(r,t,i){return Object.assign(jt("SyntaxError",r),{input:t,offset:i,rawMessage:r,message:r+` `+t+` ---`+Array((i||t.length)+1).join("-")+"^"})}var Mz=9,Zz=10,Cz=12,Tz=13,dz=32,R0=new Uint8Array(128).map((r,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0);class bl{constructor(r){this.str=r,this.pos=0}charCodeAt(r){return r=128||R0[t]===0)break}if(this.pos===r)this.error("Expect a keyword");return this.substringToPos(r)}scanNumber(){let r=this.pos;for(;r57)break}if(this.pos===r)this.error("Expect a number");return this.substringToPos(r)}scanString(){let r=this.str.indexOf("'",this.pos+1);if(r===-1)this.pos=this.str.length,this.error("Expect an apostrophe");return this.substringToPos(r+1)}}var sz=9,r1=10,t1=12,n1=13,i1=32,rx=33,xl=35,H0=38,co=39,tx=40,o1=41,nx=42,fl=43,wl=44,M0=45,al=60,hl=62,$l=63,e1=64,Xn=91,Wn=93,uo=123,Z0=124,C0=125,T0=8734,d0={" ":1,"&&":2,"||":3,"|":4};function s0(r){let t=null,i=null;if(r.eat(uo),r.skipWs(),t=r.scanNumber(r),r.skipWs(),r.charCode()===wl){if(r.pos++,r.skipWs(),r.charCode()!==C0)i=r.scanNumber(r),r.skipWs()}else i=t;return r.eat(C0),{min:Number(t),max:i?Number(i):0}}function l1(r){let t=null,i=!1;switch(r.charCode()){case nx:r.pos++,t={min:0,max:0};break;case fl:r.pos++,t={min:1,max:0};break;case $l:r.pos++,t={min:0,max:1};break;case xl:if(r.pos++,i=!0,r.charCode()===uo)t=s0(r);else if(r.charCode()===$l)r.pos++,t={min:0,max:0};else t={min:1,max:0};break;case uo:t=s0(r);break;default:return null}return{type:"Multiplier",comma:i,min:t.min,max:t.max,term:null}}function ht(r,t){let i=l1(r);if(i!==null){if(i.term=t,r.charCode()===xl&&r.charCodeAt(r.pos-1)===fl)return ht(r,i);return i}return t}function vl(r){let t=r.peek();if(t==="")return null;return ht(r,{type:"Token",value:t})}function c1(r){let t;return r.eat(al),r.eat(co),t=r.scanWord(),r.eat(co),r.eat(hl),ht(r,{type:"Property",name:t})}function u1(r){let t=null,i=null,o=1;if(r.eat(Xn),r.charCode()===M0)r.peek(),o=-1;if(o==-1&&r.charCode()===T0)r.peek();else if(t=o*Number(r.scanNumber(r)),r.isNameCharCode())t+=r.scanWord();if(r.skipWs(),r.eat(wl),r.skipWs(),r.charCode()===T0)r.peek();else{if(o=1,r.charCode()===M0)r.peek(),o=-1;if(i=o*Number(r.scanNumber(r)),r.isNameCharCode())i+=r.scanWord()}return r.eat(Wn),{type:"Range",min:t,max:i}}function g1(r){let t,i=null;if(r.eat(al),t=r.scanWord(),t==="boolean-expr"){r.eat(Xn);let o=zl(r,Wn);return r.eat(Wn),r.eat(hl),ht(r,{type:"Boolean",term:o.terms.length===1?o.terms[0]:o})}if(r.charCode()===tx&&r.nextCharCode()===o1)r.pos+=2,t+="()";if(r.charCodeAt(r.findWsEnd(r.pos))===Xn)r.skipWs(),i=u1(r);return r.eat(hl),ht(r,{type:"Type",name:t,opts:i})}function m1(r){let t=r.scanWord();if(r.charCode()===tx)return r.pos++,{type:"Function",name:t};return ht(r,{type:"Keyword",name:t})}function b1(r,t){function i(n,e){return{type:"Group",terms:n,combinator:e,disallowEmpty:!1,explicit:!1}}let o;t=Object.keys(t).sort((n,e)=>d0[n]-d0[e]);while(t.length>0){o=t.shift();let n=0,e=0;for(;n1)r.splice(e,n-e,i(r.slice(e,n),o)),n=e+1;e=-1}}if(e!==-1&&t.length)r.splice(e,n-e,i(r.slice(e,n),o))}return o}function zl(r,t){let i=Object.create(null),o=[],n,e=null,l=r.pos;while(r.charCode()!==t&&(n=h1(r,t)))if(n.type!=="Spaces"){if(n.type==="Combinator"){if(e===null||e.type==="Combinator")r.pos=l,r.error("Unexpected combinator");i[n.value]=!0}else if(e!==null&&e.type!=="Combinator")i[" "]=!0,o.push({type:"Combinator",value:" "});o.push(n),e=n,l=r.pos}if(e!==null&&e.type==="Combinator")r.pos-=l,r.error("Unexpected combinator");return{type:"Group",terms:o,combinator:b1(o,i)||" ",disallowEmpty:!1,explicit:!1}}function v1(r,t){let i;if(r.eat(Xn),i=zl(r,t),r.eat(Wn),i.explicit=!0,r.charCode()===rx)r.pos++,i.disallowEmpty=!0;return i}function h1(r,t){let i=r.charCode();switch(i){case Wn:break;case Xn:return ht(r,v1(r,t));case al:return r.nextCharCode()===co?c1(r):g1(r);case Z0:return{type:"Combinator",value:r.substringToPos(r.pos+(r.nextCharCode()===Z0?2:1))};case H0:return r.pos++,r.eat(H0),{type:"Combinator",value:"&&"};case wl:return r.pos++,{type:"Comma"};case co:return ht(r,{type:"String",value:r.scanString()});case i1:case sz:case r1:case n1:case t1:return{type:"Spaces",value:r.scanSpaces()};case e1:if(i=r.nextCharCode(),r.isNameCharCode(i))return r.pos++,{type:"AtKeyword",name:r.scanWord()};return vl(r);case nx:case fl:case $l:case xl:case rx:break;case uo:if(i=r.nextCharCode(),i<48||i>57)return vl(r);break;default:if(r.isNameCharCode(i))return m1(r);return vl(r)}}function qn(r){let t=new bl(r),i=zl(t);if(t.pos!==r.length)t.error("Unexpected input");if(i.terms.length===1&&i.terms[0].type==="Group")return i.terms[0];return i}var Nn=function(){};function ix(r){return typeof r==="function"?r:Nn}function _l(r,t,i){function o(l){switch(n.call(i,l),l.type){case"Group":l.terms.forEach(o);break;case"Multiplier":case"Boolean":o(l.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw Error("Unknown type: "+l.type)}e.call(i,l)}let n=Nn,e=Nn;if(typeof t==="function")n=t;else if(t)n=ix(t.enter),e=ix(t.leave);if(n===Nn&&e===Nn)throw Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");o(r,i)}var x1={decorator(r){let t=[],i=null;return{...r,node(o){let n=i;i=o,r.node.call(this,o),i=n},emit(o,n,e){t.push({type:n,value:o,node:e?null:i})},result(){return t}}}};function f1(r){let t=[];return bt(r,(i,o,n)=>t.push({type:i,value:r.slice(o,n),node:null})),t}function Ol(r,t){if(typeof r==="string")return f1(r);return t.generate(r,x1)}var G={type:"Match"},R={type:"Mismatch"},go={type:"DisallowEmpty"},w1=40,a1=41;function _r(r,t,i){if(t===G&&i===R)return r;if(r===G&&t===G&&i===G)return r;if(r.type==="If"&&r.else===R&&t===G)t=r.then,r=r.match;return{type:"If",match:r,then:t,else:i}}function ex(r){return r.length>2&&r.charCodeAt(r.length-2)===w1&&r.charCodeAt(r.length-1)===a1}function ox(r){return r.type==="Keyword"||r.type==="AtKeyword"||r.type==="Function"||r.type==="Type"&&ex(r.name)}function $t(r,t=" ",i=!1){return{type:"Group",terms:r,combinator:t,disallowEmpty:!1,explicit:i}}function Vn(r,t,i=new Set){if(!i.has(r))switch(i.add(r),r.type){case"If":r.match=Vn(r.match,t,i),r.then=Vn(r.then,t,i),r.else=Vn(r.else,t,i);break;case"Type":return t[r.name]||r}return r}function Dl(r,t,i){switch(r){case" ":{let o=G;for(let n=t.length-1;n>=0;n--){let e=t[n];o=_r(e,o,R)}return o}case"|":{let o=R,n=null;for(let e=t.length-1;e>=0;e--){let l=t[e];if(ox(l)){if(n===null&&e>0&&ox(t[e-1]))n=Object.create(null),o=_r({type:"Enum",map:n},G,o);if(n!==null){let u=(ex(l.name)?l.name.slice(0,-1):l.name).toLowerCase();if(u in n===!1){n[u]=l;continue}}}n=null,o=_r(l,G,o)}return o}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let o=R;for(let n=t.length-1;n>=0;n--){let e=t[n],l;if(t.length>1)l=Dl(r,t.filter(function(u){return u!==e}),!1);else l=G;o=_r(e,l,o)}return o}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let o=i?G:R;for(let n=t.length-1;n>=0;n--){let e=t[n],l;if(t.length>1)l=Dl(r,t.filter(function(u){return u!==e}),!0);else l=G;o=_r(e,l,o)}return o}}}function z1(r){let t=G,i=Tt(r.term);if(r.max===0){if(i=_r(i,go,R),t=_r(i,null,R),t.then=_r(G,G,t),r.comma)t.then.else=_r({type:"Comma",syntax:r},t,R)}else for(let o=r.min||1;o<=r.max;o++){if(r.comma&&t!==G)t=_r({type:"Comma",syntax:r},t,R);t=_r(i,_r(G,G,t),R)}if(r.min===0)t=_r(G,G,t);else for(let o=0;o=65&&n<=90)n=n|32;if(n!==o)return!1}return!0}function k1(r){if(r.type!==P)return!1;return r.value!=="?"}function gx(r){if(r===null)return!0;return r.type===ir||r.type===k||r.type===X||r.type===mr||r.type===Z||k1(r)}function mx(r){if(r===null)return!0;return r.type===p||r.type===wr||r.type===xr||r.type===P&&r.value==="/"}function U1(r,t,i){function o(){do J++,O=Jq)q=J}function c(){v={syntax:t.syntax,opts:t.syntax.opts||v!==null&&v.opts||null,prev:v},E={type:Il,syntax:t.syntax,token:E.token,prev:E}}function m(){if(E.type===Il)E=E.prev;else E={type:bx,syntax:v.syntax,token:E.token,prev:E};v=v.prev}let v=null,h=null,b=null,f=null,D=0,I=null,O=null,J=-1,q=0,E={type:_1,syntax:null,token:null,prev:null};o();while(I===null&&++Db.tokenIndex)b=f,f=!1}else if(b===null){I=D1;break}t=b.nextState,h=b.thenStack,v=b.syntaxStack,E=b.matchStack,J=b.tokenIndex,O=JJ){while(J":"<'"+t.name+"'>"));if(f!==!1&&O!==null&&t.type==="Type"){if(t.name==="custom-ident"&&O.type===w||t.name==="length"&&O.value==="0"){if(f===null)f=e(t,b);t=R;break}}c(),t=tr.matchRef||tr.match;break}case"Keyword":{let A=t.name;if(O!==null){let tr=O.value;if(tr.indexOf("\\")!==-1)tr=tr.replace(/\\[09].*$/,"");if(pl(tr,A)){g(),t=G;break}}t=R;break}case"AtKeyword":case"Function":if(O!==null&&pl(O.value,t.name)){g(),t=G;break}t=R;break;case"Token":if(O!==null&&O.value===t.value){g(),t=G;break}t=R;break;case"Comma":if(O!==null&&O.type===ir)if(gx(E.token))t=R;else g(),t=mx(O)?R:G;else t=gx(E.token)||mx(O)?G:R;break;case"String":let K="",S=J;for(;SJ1,isProperty:()=>P1,isKeyword:()=>E1,getTrace:()=>vx});function vx(r){function t(n){if(n===null)return!1;return n.type==="Type"||n.type==="Property"||n.type==="Keyword"}function i(n){if(Array.isArray(n.match)){for(let e=0;ei.type==="Type"&&i.name===t)}function P1(r,t){return kl(this,r,(i)=>i.type==="Property"&&i.name===t)}function E1(r){return kl(this,r,(t)=>t.type==="Keyword")}function kl(r,t,i){let o=vx.call(r,t);if(o===null)return!1;return o.some(i)}function hx(r){if("node"in r)return r.node;return hx(r.match[0])}function $x(r){if("node"in r)return r.node;return $x(r.match[r.match.length-1])}function Jl(r,t,i,o,n){function e(u){if(u.syntax!==null&&u.syntax.type===o&&u.syntax.name===n){let g=hx(u),c=$x(u);r.syntax.walk(t,function(m,v,h){if(m===g){let b=new or;do{if(b.appendData(v.data),v.data===c)break;v=v.next}while(v!==null);l.push({parent:h,nodes:b})}})}if(Array.isArray(u.match))u.match.forEach(e)}let l=[];if(i.matched!==null)e(i.matched);return l}var{hasOwnProperty:Yn}=Object.prototype;function Pl(r){return typeof r==="number"&&isFinite(r)&&Math.floor(r)===r&&r>=0}function xx(r){return Boolean(r)&&Pl(r.offset)&&Pl(r.line)&&Pl(r.column)}function L1(r,t){return function(o,n){if(!o||o.constructor!==Object)return n(o,"Type of node should be an Object");for(let e in o){let l=!0;if(Yn.call(o,e)===!1)continue;if(e==="type"){if(o.type!==r)n(o,"Wrong node type `"+o.type+"`, expected `"+r+"`")}else if(e==="loc"){if(o.loc===null)continue;else if(o.loc&&o.loc.constructor===Object)if(typeof o.loc.source!=="string")e+=".source";else if(!xx(o.loc.start))e+=".start";else if(!xx(o.loc.end))e+=".end";else continue;l=!1}else if(t.hasOwnProperty(e)){l=!1;for(let u=0;!l&&u");else throw Error("Wrong value `"+n+"` in `"+t+"` structure definition")}return i.join(" | ")}function K1(r,t){let i=t.structure,o={type:String,loc:!0},n={type:'"'+r+'"'};for(let e in i){if(Yn.call(i,e)===!1)continue;let l=o[e]=Array.isArray(i[e])?i[e].slice():[i[e]];n[e]=fx(l,r+"."+e)}return{docs:n,check:L1(r,o)}}function wx(r){let t={};if(r.node){for(let i in r.node)if(Yn.call(r.node,i)){let o=r.node[i];if(o.structure)t[i]=K1(i,o);else throw Error("Missed `structure` field in `"+i+"` node type definition")}}return t}function El(r,t,i){let o={};for(let n in r)if(r[n].syntax)o[n]=i?r[n].syntax:Rt(r[n].syntax,{compact:t});return o}function X1(r,t,i){let o={};for(let[n,e]of Object.entries(r))o[n]={prelude:e.prelude&&(i?e.prelude.syntax:Rt(e.prelude.syntax,{compact:t})),descriptors:e.descriptors&&El(e.descriptors,t,i)};return o}function W1(r){for(let t=0;t{return i[o]=this.createDescriptor(t.descriptors[o],"AtruleDescriptor",o,r),i},Object.create(null)):null}}addProperty_(r,t){if(!t)return;this.properties[r]=this.createDescriptor(t,"Property",r)}addType_(r,t){if(!t)return;this.types[r]=this.createDescriptor(t,"Type",r)}checkAtruleName(r){if(!this.getAtrule(r))return new Ht("Unknown at-rule","@"+r)}checkAtrulePrelude(r,t){let i=this.checkAtruleName(r);if(i)return i;let o=this.getAtrule(r);if(!o.prelude&&t)return SyntaxError("At-rule `@"+r+"` should not contain a prelude");if(o.prelude&&!t){if(!dt(this,o.prelude,"",!1).matched)return SyntaxError("At-rule `@"+r+"` should contain a prelude")}}checkAtruleDescriptorName(r,t){let i=this.checkAtruleName(r);if(i)return i;let o=this.getAtrule(r),n=no(t);if(!o.descriptors)return SyntaxError("At-rule `@"+r+"` has no known descriptors");if(!o.descriptors[n.name]&&!o.descriptors[n.basename])return new Ht("Unknown at-rule descriptor",t)}checkPropertyName(r){if(!this.getProperty(r))return new Ht("Unknown property",r)}matchAtrulePrelude(r,t){let i=this.checkAtrulePrelude(r,t);if(i)return Fr(null,i);let o=this.getAtrule(r);if(!o.prelude)return Fr(null,null);return dt(this,o.prelude,t||"",!1)}matchAtruleDescriptor(r,t,i){let o=this.checkAtruleDescriptorName(r,t);if(o)return Fr(null,o);let n=this.getAtrule(r),e=no(t);return dt(this,n.descriptors[e.name]||n.descriptors[e.basename],i,!1)}matchDeclaration(r){if(r.type!=="Declaration")return Fr(null,Error("Not a Declaration node"));return this.matchProperty(r.property,r.value)}matchProperty(r,t){if(nl(r).custom)return Fr(null,Error("Lexer matching doesn't applicable for custom properties"));let i=this.checkPropertyName(r);if(i)return Fr(null,i);return dt(this,this.getProperty(r),t,!0)}matchType(r,t){let i=this.getType(r);if(!i)return Fr(null,new Ht("Unknown type",r));return dt(this,i,t,!1)}match(r,t){if(typeof r!=="string"&&(!r||!r.type))return Fr(null,new Ht("Bad syntax"));if(typeof r==="string"||!r.match)r=this.createDescriptor(r,"Type","anonymous");return dt(this,r,t,!1)}findValueFragments(r,t,i,o){return Jl(this,t,this.matchProperty(r,t),i,o)}findDeclarationValueFragments(r,t,i){return Jl(this,r.value,this.matchDeclaration(r),t,i)}findAllFragments(r,t,i){let o=[];return this.syntax.walk(r,{visit:"Declaration",enter:(n)=>{o.push.apply(o,this.findDeclarationValueFragments(n,t,i))}}),o}getAtrule(r,t=!0){let i=no(r);return(i.vendor&&t?this.atrules[i.name]||this.atrules[i.basename]:this.atrules[i.name])||null}getAtrulePrelude(r,t=!0){let i=this.getAtrule(r,t);return i&&i.prelude||null}getAtruleDescriptor(r,t){return this.atrules.hasOwnProperty(r)&&this.atrules.declarators?this.atrules[r].declarators[t]||null:null}getProperty(r,t=!0){let i=nl(r);return(i.vendor&&t?this.properties[i.name]||this.properties[i.basename]:this.properties[i.name])||null}getType(r){return hasOwnProperty.call(this.types,r)?this.types[r]:null}validate(){function r(u,g){return g?`<${u}>`:`<'${u}'>`}function t(u,g,c,m){if(c.has(g))return c.get(g);if(c.set(g,!1),m.syntax!==null)_l(m.syntax,function(v){if(v.type!=="Type"&&v.type!=="Property")return;let h=v.type==="Type"?u.types:u.properties,b=v.type==="Type"?o:n;if(!hasOwnProperty.call(h,v.name))i.push(`${r(g,c===o)} used missed syntax definition ${r(v.name,v.type==="Type")}`),c.set(g,!0);else if(t(u,v.name,b,h[v.name]))i.push(`${r(g,c===o)} used broken syntax definition ${r(v.name,v.type==="Type")}`),c.set(g,!0)},this)}let i=[],o=new Map,n=new Map;for(let u in this.types)t(this,u,o,this.types[u]);for(let u in this.properties)t(this,u,n,this.properties[u]);let e=[...o.keys()].filter((u)=>o.get(u)),l=[...n.keys()].filter((u)=>n.get(u));if(e.length||l.length)return{errors:i,types:e,properties:l};return null}dump(r,t){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:El(this.types,!t,r),properties:El(this.properties,!t,r),atrules:X1(this.atrules,!t,r)}}toString(){return JSON.stringify(this.dump())}}function Ll(r,t){if(typeof t==="string"&&/^\s*\|/.test(t))return typeof r==="string"?r+t:t.replace(/^\s*\|\s*/,"");return t||null}function ax(r,t){let i=Object.create(null);for(let[o,n]of Object.entries(r))if(n){i[o]={};for(let e of Object.keys(n))if(t.includes(e))i[o][e]=n[e]}return i}function Qn(r,t){let i={...r};for(let[o,n]of Object.entries(t))switch(o){case"generic":i[o]=Boolean(n);break;case"cssWideKeywords":i[o]=r[o]?[...r[o],...n]:n||[];break;case"units":i[o]={...r[o]};for(let[e,l]of Object.entries(n))i[o][e]=Array.isArray(l)?l:[];break;case"atrules":i[o]={...r[o]};for(let[e,l]of Object.entries(n)){let u=i[o][e]||{},g=i[o][e]={prelude:u.prelude||null,descriptors:{...u.descriptors}};if(!l)continue;g.prelude=l.prelude?Ll(g.prelude,l.prelude):g.prelude||null;for(let[c,m]of Object.entries(l.descriptors||{}))g.descriptors[c]=m?Ll(g.descriptors[c],m):null;if(!Object.keys(g.descriptors).length)g.descriptors=null}break;case"types":case"properties":i[o]={...r[o]};for(let[e,l]of Object.entries(n))i[o][e]=Ll(i[o][e],l);break;case"scope":case"features":i[o]={...r[o]};for(let[e,l]of Object.entries(n))i[o][e]={...i[o][e],...l};break;case"parseContext":i[o]={...r[o],...n};break;case"atrule":case"pseudo":i[o]={...r[o],...ax(n,["parse"])};break;case"node":i[o]={...r[o],...ax(n,["name","structure","parse","generate","walkContext"])};break}return i}function zx(r){let t=u0(r),i=W0(r),o=J0(r),{fromPlainObject:n,toPlainObject:e}=P0(i),l={lexer:null,createLexer:(u)=>new Fn(u,l,l.lexer.structure),tokenize:bt,parse:t,generate:o,walk:i,find:i.find,findLast:i.findLast,findAll:i.findAll,fromPlainObject:n,toPlainObject:e,fork(u){let g=Qn({},r);return zx(typeof u==="function"?u(g):Qn(g,u))}};return l.lexer=new Fn({generic:r.generic,cssWideKeywords:r.cssWideKeywords,units:r.units,types:r.types,atrules:r.atrules,properties:r.properties,node:r.node},l),l}var Kl=(r)=>zx(Qn({},r));var _x={generic:!0,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( )","alpha-value":"|","angle-percentage":"|","angular-color-hint":"","angular-color-stop":"&&?","angular-color-stop-list":"[ [, ]?]# , ","animateable-feature":"scroll-position|contents|","asin()":"asin( )","atan()":"atan( )","atan2()":"atan2( , )",attachment:"scroll|fixed|local","attr()":"attr( ? [, ]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' ']'|'[' [|] ? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [? ]+ ? )","auto-track-list":"[? [|]]* ? [? [|]]* ?",axis:"block|inline|x|y","baseline-position":"[first|last]? baseline","basic-shape":"||||||","bg-image":"none|","bg-layer":"|| [/ ]?||||||||","bg-position":"[[left|center|right|top|bottom|]|[left|center|right|] [top|center|bottom|]|[center|[left|right] ?]&&[center|[top|bottom] ?]]","bg-size":"[|auto]{1,2}|cover|contain","blur()":"blur( )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( )","calc()":"calc( )","calc-sum":" [['+'|'-'] ]*","calc-product":" ['*' |'/' ]*","calc-value":"||||( )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"|","cf-mixing-image":"?&&","circle()":"circle( []? [at ]? )","clamp()":"clamp( #{3} )","class-selector":"'.' ","clip-source":"",color:"|currentColor||||<-non-standard-color>","color-stop":"|","color-stop-angle":"{1,2}","color-stop-length":"{1,2}","color-stop-list":"[ [, ]?]# , ","color-interpolation-method":"in [| ?|]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[? *]!","compound-selector-list":"#","complex-selector":" [? ]*","complex-selector-list":"#","conic-gradient()":"conic-gradient( [from ]? [at ]? , )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[|contents||||||]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"","contrast()":"contrast( [] )","cos()":"cos( )",counter:"|","counter()":"counter( , ? )","counter-name":"","counter-style":"|symbols( )","counter-style-name":"","counters()":"counters( , , ? )","cross-fade()":"cross-fade( , ? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( , , , )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( {2,3} ? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( , [first|start|last|first-except]? )|element( )","ellipse()":"ellipse( [{2}]? [at ]? )","ending-shape":"circle|ellipse","env()":"env( , ? )","exp()":"exp( )","explicit-track-list":"[? ]+ ?","family-name":"|+","feature-tag-value":" [|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":" '{' '}'","feature-value-block-list":"+","feature-value-declaration":" : + ;","feature-value-declaration-list":"","feature-value-name":"","fill-rule":"nonzero|evenodd","filter-function":"|||||||||","filter-function-list":"[|]+","final-bg-layer":"<'background-color'>|||| [/ ]?||||||||","fixed-breadth":"","fixed-repeat":"repeat( [] , [? ]+ ? )","fixed-size":"|minmax( , )|minmax( , )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|","frequency-percentage":"|","general-enclosed":"[ ? )]|[( ? )]","generic-family":"|||<-non-standard-generic-family>","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"|fill-box|stroke-box|view-box",gradient:"||||||<-legacy-gradient>","grayscale()":"grayscale( )","grid-line":"auto||[&&?]|[span&&[||]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( [/ ]? )|hsl( , , , ? )","hsla()":"hsla( [/ ]? )|hsla( , , , ? )",hue:"|","hue-rotate()":"hue-rotate( )","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hwb()":"hwb( [|none] [|none] [|none] [/ [|none]]? )","hypot()":"hypot( # )",image:"||||||","image()":"image( ? [? , ?]! )","image-set()":"image-set( # )","image-set-option":"[|] [||type( )]","image-src":"|","image-tags":"ltr|rtl","inflexible-breadth":"|min-content|max-content|auto","inset()":"inset( {1,4} [round <'border-radius'>]? )","invert()":"invert( )","keyframes-name":"|","keyframe-block":"# { }","keyframe-block-list":"+","keyframe-selector":"from|to|| ","lab()":"lab( [||none] [||none] [||none] [/ [|none]]? )","layer()":"layer( )","layer-name":" ['.' ]*","lch()":"lch( [||none] [||none] [|none] [/ [|none]]? )","leader()":"leader( )","leader-type":"dotted|solid|space|","length-percentage":"|","light-dark()":"light-dark( , )","line-names":"'[' * ']'","line-name-list":"[|]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"|thin|medium|thick","linear-color-hint":"","linear-color-stop":" ?","linear-gradient()":"linear-gradient( [[|to ]||]? , )","log()":"log( , ? )","mask-layer":"|| [/ ]?||||||[|no-clip]||||","mask-position":"[|left|center|right] [|top|center|bottom]?","mask-reference":"none||","mask-source":"","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( #{6} )","matrix3d()":"matrix3d( #{16} )","max()":"max( # )","media-and":" [and ]+","media-condition":"|||","media-condition-without-or":"||","media-feature":"( [||] )","media-in-parens":"( )||","media-not":"not ","media-or":" [or ]+","media-query":"|[not|only]? [and ]?","media-query-list":"#","media-type":"","mf-boolean":"","mf-name":"","mf-plain":" : ","mf-range":" ['<'|'>']? '='? | ['<'|'>']? '='? | '<' '='? '<' '='? | '>' '='? '>' '='? ","mf-value":"|||","min()":"min( # )","minmax()":"minmax( [|min-content|max-content|auto] , [||min-content|max-content|auto] )","mod()":"mod( , )","name-repeat":"repeat( [|auto-fill] , + )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen","namespace-prefix":"","ns-prefix":"[|'*']? '|'","number-percentage":"|","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"|even|odd","opacity()":"opacity( [] )","overflow-position":"unsafe|safe","outline-radius":"|","page-body":"? [; ]?| ","page-margin-box":" '{' '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[#]?","page-selector":"+| *","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [ ,]? )","paint()":"paint( , ? )","perspective()":"perspective( [|none] )","polygon()":"polygon( ? , [ ]# )","polar-color-space":"hsl|hwb|lch|oklch",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|] [top|center|bottom|]?|[[left|right] ]&&[[top|bottom] ]]","pow()":"pow( , )","pseudo-class-selector":"':' |':' ')'","pseudo-element-selector":"':' |","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [||]? [at ]? , )",ratio:" [/ ]?","ray()":"ray( &&?&&contain?&&[at ]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rectangular-color-space":"srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"? ","relative-selector-list":"#","relative-size":"larger|smaller","rem()":"rem( , )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from ]? [at ]? , )","repeating-linear-gradient()":"repeating-linear-gradient( [|to ]? , )","repeating-radial-gradient()":"repeating-radial-gradient( [||]? [at ]? , )","reversed-counter-name":"reversed( )","rgb()":"rgb( {3} [/ ]? )|rgb( {3} [/ ]? )|rgb( #{3} , ? )|rgb( #{3} , ? )","rgba()":"rgba( {3} [/ ]? )|rgba( {3} [/ ]? )|rgba( #{3} , ? )|rgba( #{3} , ? )","rotate()":"rotate( [|] )","rotate3d()":"rotate3d( , , , [|] )","rotateX()":"rotateX( [|] )","rotateY()":"rotateY( [|] )","rotateZ()":"rotateZ( [|] )","round()":"round( ? , , )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( )","scale()":"scale( [|]#{1,2} )","scale3d()":"scale3d( [|]#{3} )","scaleX()":"scaleX( [|] )","scaleY()":"scaleY( [|] )","scaleZ()":"scaleZ( [|] )","scroll()":"scroll( [||]? )",scroller:"root|nearest|self","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"|closest-side|farthest-side","sign()":"sign( )","skew()":"skew( [|] , [|]? )","skewX()":"skewX( [|] )","skewY()":"skewY( [|] )","sepia()":"sepia( )",shadow:"inset?&&{2,4}&&?","shadow-t":"[{2,3}&&?]",shape:"rect( , , , )|rect( )","shape-box":"|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( )","single-animation":"<'animation-duration'>||||<'animation-delay'>||||||||||[none|]||","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|||","single-transition":"[none|]||